<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
It seems not to work with me, the resulting precipitation is the same as the original apcpsfc values and are too high...<br>see http://users.fulladsl.be/~spb4195/gfs/meteogram/t2m.png for lat: 51 lon 4 and compare with READY (http://users.fulladsl.be/spb4195//89054419_metgram.gif)<br>I'm not a specialist of Grads thus perhaps I do something stupid :-) ?<br><br><br>function main( args )<br>'reinit'<br><br>date= subwrd( args, 2 )<br>datum= substr( date, 7, 4 )<br>mon= substr( date, 1, 2 )<br>day= substr( date, 4, 2 )<br><br>run= subwrd( args, 1)<br>run= substr( run, 1, 2)<br><br>'set display color white'<br>'clear'<br>'set display color white'<br><br>'sdfopen http://nomads.ncep.noaa.gov:9090/dods/gfs_hd/gfs_hd'datum''mon''day'/gfs_hd_'run'z'<br><br>'q time'<br>res = subwrd(result,3)<br>datum2 = substr(res,4,9)<br><br>'clear'<br>'set display color white'<br><br>say 'calculating pre-data ==> Ok!' <br><br>lus = 0<br>'define prectemp = 0'<br><br>'q time'<br>res = subwrd(result,3)<br>datum2 = substr(res,4,9)<br><br>'set mpt * 1'<br>'set mpdset hires'<br>'set grid off'<br><br>'q time'<br>res = subwrd(result,3)<br>datum2 = substr(res,4,9)<br><br><br>***lus welke controleert of er een file is en dat voor 2.5 uur (13.650 tellen)****<br>while (datum2 = n & lus<13650)<br>'sdfopen http://nomads.ncep.noaa.gov:9090/dods/gfs_hd/gfs_hd'datum''mon''day'/gfs_hd_'run'z'<br>'q time'<br>res = subwrd(result,3)<br>datum2 = substr(res,4,9)<br>say 'file not open yet, waiting for correct file... 'lus' of 13.650 attempts'<br>lus=lus+1<br>endwhile<br><br>***script wordt enkel uitgevoerd als er een file is en zo wordt deleten alle kaarten vermeden***<br>if (datum2 != n)<br><br>*termijn (norm: 65)<br>n = 65<br><br>'clear'<br>'set display color white'<br><br>'q time'<br>res = subwrd(result,3)<br>datum2 = substr(res,4,9)<br>uur = substr(res,1,2)<br>dag = subwrd(result,6)<br>fff = substr(dag,1,2)<br><br>say 'calculating meteogram 1...' <br><br>'set string 1'<br>'set strsiz 0.10'<br>'draw string 3.0 0.3 (green flat line: indicative snow/rain treshold of 528 gpdam)'<br>'draw string 3.0 0.1 Source data: NCEP - maps (c) Karim Hamid'<br><br>'set dfile 'args<br>'mask=sumg(1,t=1,t-0,2)-sumg(1,t=1,t-1,2)'<br>_trr = 'tloop(apcpsfc-mask*const(apcpsfc(t-1),0,-u))'<br>_trrc = 'tloop(apcpsfc-mask*const(apcpsfc(t-1),0,-u))'<br><br>'set t 1 'n''<br><br>'define z500= hgtprs(lev=500)'<br>'define z850= hgtprs(lev=850)'<br>'define z1000= hgtprs(lev=1000)'<br>'define th500a = (z500-z1000)/10'<br>'define th500av = 528'<br><br>'set grid on 5 15'<br><br>'set clopts -1 -1 0.12'<br><br>'set ccolor 2'<br>'set lat 51'<br>'set lon 4'<br>'set ccolor 4'<br>'set axlim 510 550'<br>'set yaxis 510 550 5'<br>'display th500a'<br><br>'set ylab off'<br>'set cmark 0'<br>'set ccolor 3'<br>'set cthick 6'<br>'set axlim 510 550'<br>'set yaxis 510 550 5'<br>'display th500av'<br><br>'draw title 1000-500 thickness (gpdam) - Brussels\'dag' 'datum2' (run: GFS'run'z)'<br>'printim c:\model\upload\meteogram\th1000500.png'<br><br>'set t 1 'n''<br><br>clear<br>'set display color white'<br>clear<br><br>say 'calculating meteogram 2...' <br><br>'set string 1'<br>'set strsiz 0.10'<br>'draw string 3.0 0.3 (green flat line: indicative snow/rain treshold of 129 gpdam)'<br>'draw string 3.0 0.1 Source data: NCEP - maps (c) Karim Hamid'<br>'set ylab on'<br>'set grid on 5 1'<br><br>'define th850a = (z850-z1000)/10'<br>'define th850av = 129'<br><br>'set ccolor 2'<br>'set lat 51'<br>'set lon 4'<br>'set ccolor 4'<br>'set axlim 124 138 2'<br>'set yaxis 124 138 2'<br>'display th850a'<br><br>'set ylab off'<br>'set cmark 0'<br>'set ccolor 3'<br>'set cthick 6'<br>'set axlim 124 138 2'<br>'set yaxis 124 138 2'<br>'display th850av'<br><br>'draw title 1000-850 thickness (gpdam) - Brussels\'dag' 'datum2' (run: GFS'run'z)'<br>'printim c:\model\upload\meteogram\th1000850.png'<br><br>clear<br>'set display color white'<br>clear<br><br>say 'calculating meteogram 3...' <br><br>'set string 1'<br>'set strsiz 0.10'<br>'draw string 3.0 0.3 (blue flat line: hypothermia possible/purple flat line: frosbit possible)'<br>'draw string 3.0 0.1 Source data: NCEP - maps (c) Karim Hamid'<br><br>'set t 1 'n''<br><br>'define td=(tmp2m-273.15)-((14.55+0.114*(tmp2m-273.15))*(1-0.01*rh2m)+pow((2.5+0.007*(tmp2m-273.15))*(1-0.01*rh2m),3)+(15.9+0.117*(tmp2m-273.15))*pow((1-0.01*rh2m),14))'<br>'define dewp2m = td+273.15'<br>'define t2m = tmp2m-273.15'<br><br>********************TWmsl*********************<br>'define tw = ((-5.806+(0.672*t2m))-(0.006*(t2m*t2m))+((0.061+(0.004*t2m)+(0.000099*(t2m*t2m)))*rh2m)+(((-0.000033-(0.000005*t2m)-(0.0000001*(t2m*t2m))))*(rh2m*rh2m)))'<br>********************TWmsl*********************<br><br>'define wind = mag(ugrd10m,vgrd10m)'<br>'define W = mag(ugrd10m,vgrd10m)*2.2369363'<br>'define T = (9/5)*(tmp2m-273.15)+32'<br>'define chillf= 35.74+(0.6215*T)-(35.75*pow(W,0.16))+(0.4275*T*pow(W,0.16))'<br>'define chill = (chillf-32)*(5/9)'<br><br>'define t2m0 = 0'<br>'define chilla = -10'<br>'define chillb = -18'<br><br>'set t 1 'n''<br><br>'define tw0 = 0'<br><br>'set ylab on'<br>'set ccolor 2'<br>'set lat 50.5'<br>'set lon 4.5'<br>'set axlim -25 15'<br>'set yaxis -25 15 5'<br>'display t2m'<br><br>'set cmark 0'<br>'set ylab off'<br>'set cthick 6'<br>'set ccolor 1'<br>'display t2m0'<br><br>'set ylab on'<br>'set ccolor 4'<br>'set lat 51'<br>'set lon 4'<br>'set axlim -25 15'<br>'set yaxis -25 15 5'<br>'set cthick 3'<br>'display chill'<br><br>'set cmark 0'<br>'set ylab off'<br>'set cthick 6'<br>'set ccolor 4'<br>'set axlim -25 15'<br>'set yaxis -25 15 5'<br>'display chilla'<br><br>'set cmark 0'<br>'set ylab off'<br>'set cthick 6'<br>'set ccolor 14'<br>'set axlim -25 15'<br>'set yaxis -25 15 5'<br>'display chillb'<br><br>'draw title T2m & Windchill (JAG/TI) (°C) - Brussels\'dag' 'datum2' (run: GFS'run'z)'<br>'printim c:\model\upload\meteogram\tw.png'<br><br>clear<br>'set display color white'<br>clear<br><br>say 'calculating meteogram 4...' <br><br>'set string 1'<br>'set strsiz 0.10'<br>'draw string 3.0 0.1 Source data: NCEP - maps (c) Karim Hamid'<br><br>'set t 1 'n''<br><br>'q time'<br>res = subwrd(result,3)<br>datum2 = substr(res,4,9)<br>uur = substr(res,1,2)<br>dag = subwrd(result,6)<br>fff = substr(dag,1,2)<br><br>'define t2m0 = 0'<br><br>'set xlab on'<br>'set ylab on'<br>'set ccolor 2'<br>'set lat 51'<br>'set lon 4'<br>'set axlim -15 15'<br>'set yaxis -15 15 2'<br>'display tmp2m-273.15'<br><br>'set cmark 0'<br>'set ylab off'<br>'set ccolor 4'<br>'set cthick 6'<br>'set axlim -15 15'<br>'set yaxis -15 15 2'<br>'display t2m0'<br><br>'set ccolor 7'<br>'set ccolor 4'<br>'set axlim -15 15'<br>'set yaxis -15 15 2'<br>'set cthick 4'<br>'display tw'<br><br>'set ylpos 0 r'<br>'set xlab on'<br>'set ylab on'<br>'set axlim 0 5'<br>'set yaxis 0 5 1'<br>'set gxout bar'<br>'set barbase 0'<br>'set bargap 50'<br>'set ccolor 11'<br>'set grid off'<br>'d '_trr<br><br>'draw title T2m temperature (red) & Tw2m (blue) - Brussels\'dag' 'datum2' (run: GFS'run'z)'<br>'printim c:\model\upload\meteogram\t2m.png'<br><br>clear<br>'set display color white'<br>clear<br><br>say 'calculating meteogram 5...' <br><br>'set gxout line'<br><br>'set string 1'<br>'set strsiz 0.10'<br>'draw string 3.0 0.3 (blue flat line: hypothermia possible/purple flat line: frosbit possible)'<br>'draw string 3.0 0.1 Source data: NCEP - maps (c) Karim Hamid'<br><br>'set t 1 'n''<br>'set lat 51'<br>'set lon 3'<br><br>'define wind = mag(ugrd10m,vgrd10m)'<br>'define W = mag(ugrd10m,vgrd10m)*2.2369363'<br>'define T = (9/5)*(tmp2m-273.15)+32'<br>'define chillf= 35.74+(0.6215*T)-(35.75*pow(W,0.16))+(0.4275*T*pow(W,0.16))'<br>'define chill1 = (chillf-32)*(5/9)'<br><br>'set ylab on'<br>'set cmark 3'<br><br>'set ccolor 2'<br>'set axlim -25 15'<br>'set yaxis -25 15 5'<br>'set cthick 3'<br>'display chill1'<br>'printim c:\model\upload\meteogram\chilltemp1.png'<br><br>'set t 1 'n''<br>'set lat 50.5'<br>'set lon 4.5'<br><br>'define wind = mag(ugrd10m,vgrd10m)'<br>'define W = mag(ugrd10m,vgrd10m)*2.2369363'<br>'define T = (9/5)*(tmp2m-273.15)+32'<br>'define chillf= 35.74+(0.6215*T)-(35.75*pow(W,0.16))+(0.4275*T*pow(W,0.16))'<br>'define chill2 = (chillf-32)*(5/9)'<br><br>'set ylab on'<br>'set cmark 3'<br>'set ccolor 1'<br>'set axlim -25 15'<br>'set yaxis -25 15 5'<br>'set cthick 3'<br>'display chill2'<br>'printim c:\model\upload\meteogram\chilltemp2.png'<br><br>'set t 1 'n''<br>'set lat 50.5'<br>'set lon 6.5'<br><br>'define wind = mag(ugrd10m,vgrd10m)'<br>'define W = mag(ugrd10m,vgrd10m)*2.2369363'<br>'define T = (9/5)*(tmp2m-273.15)+32'<br>'define chillf= 35.74+(0.6215*T)-(35.75*pow(W,0.16))+(0.4275*T*pow(W,0.16))'<br>'define chill3 = (chillf-32)*(5/9)'<br><br>'define chill0 = 0'<br>'define chilla = -10'<br>'define chillb = -18'<br><br>'set ylab on'<br>'set cmark 3'<br>'set ccolor 4'<br>'set axlim -25 15'<br>'set yaxis -25 15 5'<br>'set cthick 3'<br>'display chill3'<br><br>'set cmark 0'<br>'set ylab off'<br>'set cthick 6'<br>'set ccolor 1'<br>'set axlim -25 15'<br>'set yaxis -25 15 5'<br>'display chill0'<br><br>'set cmark 0'<br>'set ylab off'<br>'set cthick 6'<br>'set ccolor 4'<br>'set axlim -25 15'<br>'set yaxis -25 15 5'<br>'display chilla'<br><br>'set cmark 0'<br>'set ylab off'<br>'set cthick 6'<br>'set ccolor 14'<br>'set axlim -25 15'<br>'set yaxis -25 15 5'<br>'display chillb'<br><br>'draw title Windchill (Belgium) for Westhoek (red), center (black) & Ardens (blue) (C)\'dag' 'datum2' (run: GFS'run'z)'<br>'printim c:\model\upload\meteogram\chillall.png'<br>'printim c:\model\upload\meteogram\chilltemp3.png'<br><br>else<br>say '**** no files open yet! ****'<br>endif<br><br>clear<br><br>'quit'<br><br><br>> From: Matthias.Malik@arcor.de<br>> To: gradsusr@gradsusr.org<br>> Date: Sat, 27 Nov 2010 15:12:17 +0100<br>> Subject: Re: [gradsusr] meteogram prec<br>> <br>> Hi,<br>> <br>> you can do that using maskout function.<br>> <br>> Here is an example how i do this with the<br>> NCEP GFS Precipitation:<br>> <br>> (...)<br>> *<br>> * global mask for precipitation (3hr interval)<br>> * * <br>> 'set dfile 'args<br>> 'set lat -90 90'<br>> 'set lon -180 180'<br>> 'set lev 1000'<br>> 'set t 2 65'<br>> <br>> 'mask=sumg(1,t=1,t-0,2)-sumg(1,t=1,t-1,2)'<br>> _trr = 'tloop(apcp-mask*const(apcp(t-1),0,-u))'<br>> _trrc = 'tloop(acpcp-mask*const(acpcp(t-1),0,-u))'<br>> <br>> (...)<br>> <br>> after that procedure (inside a grads script function) you<br>> can use the defined global variable as following:<br>> <br>> 'd '_trr<br>> 'd '_trrc<br>> <br>> <br>> Best regards,<br>> Matthias<br>> <br>> Am Samstag, den 27.11.2010, 13:53 +0100 schrieb eric delaere:<br>> > hi<br>> > <br>> > I have a problem to reproduce the precipitation barbs on a meteogram<br>> > from http://nomads.ncep.noaa.gov:9090/dods/gfs_hd/<br>> > I can draw the barbs (3 hourly) but it seems to be not the correct<br>> > values.<br>> > <br>> > I already knew that there was a problem with this data, since the 3,<br>> > 9, 15, 21...timesteps gives the precipitation in the last 3 hours, but<br>> > the 6, 12, 18,... timestems gives the prec in the last 6 hours !!<br>> > <br>> > For the maps, I could resolve this by use a small code:<br>> > <br>> > if ((uur = '03') | (uur = '09') | (uur = '15') | (uur = '21') | (uur =<br>> > '27') | (uur = '33') | (uur = '39') | (uur = '45') | (uur = '51') |<br>> > (uur = '57') | (uur = '63') | (uur = '69') | (uur = '75') | (uur =<br>> > '81') | (uur = '87') | (uur = '93'))<br>> > 'define prectemp = apcpsfc'<br>> > 'define prec = apcpsfc'<br>> > endif<br>> > <br>> > if ((uur = '00') | (uur = '06') | (uur = '12') | (uur = '18') | (uur =<br>> > '24') | (uur = '30') | (uur = '36') | (uur = '42') | (uur = '48') |<br>> > (uur = '54') | (uur = '60') | (uur = '66') | (uur = '72') | (uur =<br>> > '78') | (uur = '84') | (uur = '90') | (uur = '96'))<br>> > 'define prec = apcpsfc-prectemp'<br>> > <br>> > But for meteograms, this trick doesn't work.<br>> > <br>> > hereafter the source for the meteogram, but with the incorrect<br>> > precipitation values...<br>> > <br>> > 'set t 1 'n''<br>> > <br>> > 'q time'<br>> > res = subwrd(result,3)<br>> > datum2 = substr(res,4,9)<br>> > uur = substr(res,1,2)<br>> > dag = subwrd(result,6)<br>> > fff = substr(dag,1,2)<br>> > <br>> > 'define t2m0 = 0'<br>> > <br>> > 'set xlab on'<br>> > 'set ylab on'<br>> > 'set ccolor 2'<br>> > 'set lat 51'<br>> > 'set lon 4'<br>> > 'set axlim -15 15'<br>> > 'set yaxis -15 15 2'<br>> > 'display tmp2m-273.15'<br>> > <br>> > 'set cmark 0'<br>> > 'set ylab off'<br>> > 'set ccolor 4'<br>> > 'set cthick 6'<br>> > 'set axlim -15 15'<br>> > 'set yaxis -15 15 2'<br>> > 'display t2m0'<br>> > <br>> > 'set ccolor 7'<br>> > 'set ccolor 4'<br>> > 'set axlim -15 15'<br>> > 'set yaxis -15 15 2'<br>> > 'set cthick 4'<br>> > 'display tw'<br>> > <br>> > *'set ylpos 0 r'<br>> > *'set xlab on'<br>> > *'set ylab on'<br>> > *'set axlim 0 10'<br>> > *'set yaxis 0 10 1'<br>> > *'set gxout bar'<br>> > *'set barbase 0'<br>> > *'set bargap 50'<br>> > *'set ccolor 11'<br>> > *'set grid off'<br>> > *'display prec'<br>> > <br>> > The results are uploaded to http://users.fulladsl.be/spb4195/gfs.htm<br>> > <br>> > Someone has a solution to have the correct precipitation (so, to<br>> > subtract the last 3h prec value from the 6h values)?<br>> > <br>> > Thx! <br>> > _______________________________________________<br>> > gradsusr mailing list<br>> > gradsusr@gradsusr.org<br>> > http://gradsusr.org/mailman/listinfo/gradsusr<br>> <br>> _______________________________________________<br>> gradsusr mailing list<br>> gradsusr@gradsusr.org<br>> http://gradsusr.org/mailman/listinfo/gradsusr<br>                                            </body>
</html>