[gradsusr] GFS 0.25° compatibility

karim hamid karimhamid2 at hotmail.com
Mon Jan 26 09:58:15 EST 2015


hello

I have problems with running my old 0.5° GFS scripts with the new 0.25° 
ones. Hereafter i pasted the begin of my script. Is there a lot to 
change to make them compatible with the new 0.25° version of GFS? Now, I 
receive an error.

thx!!

function main( args )
'reinit'

date= subwrd( args, 2 )
datum= substr( date, 7, 4 )
mon= substr( date, 1, 2 )
day= substr( date, 4, 2 )

run=  subwrd( args, 1)
run=  substr( run, 1, 2)

'set display color white'
'clear'
'set display color white'
'sdfopen 
http://nomads.ncep.noaa.gov:80/dods/gfs_0p50/gfs'datum''mon''day'/gfs_0p50_'run'z'
*'sdfopen 
http://nomads.ncep.noaa.gov/dods/gfs_0p25/gfs'datum''mon''day'/gfs_hd_'run'z'
'q time'
res = subwrd(result,3)
datum2 = substr(res,4,9)

lus = 0

*windchill
c = 0
*snow
w = 1

'define poud=0'
'define prectemp=0'

'clear'
'set display color white'

say ''
say 'BLIZZARD EUR'
say 'opening date-file     ==> Ok!'
say 'calculating pre-data  ==> running...'

****************************EUR********************
'set lat 38 45'
'set lon -78 -66'
****************************EUR********************

'define prectemp = 0'

'define t1000=tmpprs(lev=1000)'
'define t975=tmpprs(lev=975)'
'define t950=tmpprs(lev=950)'
'define t925=tmpprs(lev=925)'
'define t900=tmpprs(lev=900)'
'define t875=tmpprs(lev=875)'
'define t850=tmpprs(lev=850)'
'define t825=tmpprs(lev=825)'
'define t800=tmpprs(lev=800)'
'define t775=tmpprs(lev=775)'
'define t750=tmpprs(lev=750)'
'define t725=tmpprs(lev=725)'
'define t700=tmpprs(lev=700)'
'define t675=tmpprs(lev=675)'
'define t650=tmpprs(lev=650)'
'define t625=tmpprs(lev=625)'
'define t600=tmpprs(lev=600)'
'define t575=tmpprs(lev=575)'
'define t550=tmpprs(lev=550)'
'define t525=tmpprs(lev=525)'
'define t500=tmpprs(lev=500)'
'define t475=tmpprs(lev=475)'
'define t450=tmpprs(lev=450)'

'define u10=ugrd10m'
'define v10=vgrd10m'
'define rh950=rhprs(lev=950)'
'define t10=tmp2m'

say 'calculating pre-data  ==> Ok!'

***lus welke controleert of er een file is en dat voor 2.5 uur (13.650 
tellen)****
while (datum2 = n & lus<13650)
'sdfopen 
http://nomads.ncep.noaa.gov:9090/dods/gfs_hd/gfs_hd'datum''mon''day'/gfs_hd_'run'z'
'q time'
res = subwrd(result,3)
datum2 = substr(res,4,9)
say 'file not open yet, waiting for correct file... 'lus' of 13.650 
attempts'
lus=lus+1
endwhile

'q time'
res = subwrd(result,3)
datum2 = substr(res,4,9)

***script wordt enkel uitgevoerd als er een file is en zo wordt deleten 
alle kaarten vermeden***
if (datum2 != n)

'define snow4=0'
'define snowmelt=0'

'set mpt * 15 1'
'set mpdset hires'
'set grid off'

*'set t 0'
*'define snow0 = weasdsfc'

n=1
*while (n<45)
while (n<2)
'set t 'n''

'q time'
res = subwrd(result,3)
datum2 = substr(res,4,9)
uur =  substr(res,1,2)
dag = subwrd(result,6)
fff = substr(dag,1,2)

timer=((n*3)-3)
'set t 'n''

'set mpt * 1'
'set mpdset hires'
'set grid off'

clear
'set display color white'
clear

say '[run: 'run'z] ' 'Isallo    ' datum2 '-' uur 'z +' timer 'h [' n ' 
of 17]  ==> running...'

'pmsl = prmslmsl/100'
'isallo = pmsl-poud'

********************PREC**************
'define is1 = maskout(isallo, isallo-0.1)'
'define is2 = const(is1, 1.1)'
'define is3 = const(is2, 0.000001, -u)'
*******************PREC**************

********************PREC**************
'define is4 = maskout(isallo, 0-isallo)'
'define is5 = const(is4, 1.1)'
'define is6 = const(is5, 0.000001, -u)'
*******************PREC**************

'define pmsl= prmslmsl/100'

'set gxout contour'
'set cthick 3'
'set cstyle 3'
'set rgb 17 255 168 168'
'set ccolor 17'
'set clab on'
'set csmooth on'
'set clopts -1 -1 0.07'
'set cmin 1013'
'set cint 2'
'display pmsl'

'set gxout contour'
'set cthick 3'
'set cstyle 3'
'set rgb 17 155 155 255'
'set ccolor 17'
'set clab on'
'set csmooth on'
'set cmax 1012.9'
'set cint 2'
'set clopts -1 -1 0.07'
'display pmsl'

'set gxout contour'
'set cthick 3'
'set cstyle 3'
'set ccolor 4'
'set clab on'
'set csmooth on'
'set clopts -1 -1 0.07'
'set cint 0.5'
'set cmin 0.5'
'display isallo*is3'

'set gxout contour'
'set cthick 3'
'set cstyle 3'
'set ccolor 2'
'set clab on'
'set csmooth on'
'set clopts -1 -1 0.07'
'set cint 0.5'
'set cmax -0.5'
'display isallo*is6'

'set gxout contour'
'set cthick 6'
'set cstyle 3'
'set ccolor 14'
'set clab off'
'set csmooth on'
'set clopts -1 -1 0.07'
'set cint 0.5'
'set cmin -0.01'
'set cmax 0.01'
'display isallo'

'poud = pmsl'

'draw title isallobars (hPa/3h) & Pmsl\'dag' 'datum2' 'uur'z +'timer'h 
(run: 'day'/'mon'-'run'z)'

'set string 1'
'set strsiz 0.10'
'draw string 0.4 0.3 ----'
'draw string 2.3 0.1 Source data: NCEP - maps (c) Karim Hamid - 
http://users.telenet.be/weather/gfs.htm'

'printim c:\model\upload\isallo\+'timer'.png'
'printim 
c:\model\archief\isallo\'datum2'-'uur'z+'timer'h-('day'-'mon'-'datum'-'run'z).png'

n=n+1
endwhile

n=2
while (n<18)

timer=((n*3)-3)

'set t 'n''

'clear'
'set display color white'

****************************USA********************
*'set lat   25 55'
*'set lon  -140 -70'
****************************USA********************
****************************EUR********************
'set lat 38 45'
'set lon -78 -66'
****************************EUR********************


****************************EUR********************
*'set lat 36 63'
*'set lon -10 25'
****************************EUR********************

'q time'
res = subwrd(result,3)
datum2 = substr(res,4,9)
uur =  substr(res,1,2)
dag = subwrd(result,6)
fff = substr(dag,1,2)

say '+---------------------------------------------------------------+'
say 'calculating...'

'define z500= hgtprs(lev=500)'
'define z850= hgtprs(lev=850)'
'define z1000= hgtprs(lev=1000)'
'define v10=vgrd10m'


*************03h cumulatie en 06h cumulatie probleem oplossen -> prec 
vervangt de originele apcpsfc uit dods**************
if ((uur = '03') | (uur = '09') | (uur = '15') | (uur = '21') | (uur = 
'27') | (uur = '33') | (uur = '39') | (uur = '45') | (uur = '51') | (uur 
= '57') | (uur = '63') | (uur = '69') | (uur = '75') | (uur = '81') | 
(uur = '87')  | (uur = '93'))
'define prectemp = apcpsfc'
'define prec = apcpsfc'
endif

if ((uur = '00') | (uur = '06') | (uur = '12') | (uur = '18') | (uur = 
'24') | (uur = '30') | (uur = '36') | (uur = '42') | (uur = '48') | (uur 
= '54') | (uur = '60') | (uur = '66') | (uur = '72') | (uur = '78') | 
(uur = '84') | (uur = '90')  | (uur = '96'))
'define prec = apcpsfc-prectemp'
endif
*************03h cumulatie en 06h cumulatie probleem oplossen -> prec 
vervangt de originele apcpsfc uit dods**************

********************GEO500**************
'set lev 500'
'define hoog = hgtprs/10'
********************GEO500**************

********************EPT & KO**************
'set lev 975'
'define 
dewp975=(tmpprs-273.15)-((14.55+0.114*(tmpprs-273.15))*(1-0.01*rhprs)+pow((2.5+0.007*(tmpprs-273.15))*(1-0.01*rhprs),3)+(15.9+0.117*(tmpprs-273.15))*pow((1-0.01*rhprs),14))' 

'define es975 = 0.6112*exp((17.67*(tmpprs-273.15))/((tmpprs-273.15)+243.5))'
'define e975=((es975*rhprs)/100)*10'
'define w975    = (0.622*e975)/(975-e975))'
'define te975   = (tmpprs)+((2800000*w975)/1004)'
'define ept975  = (te975*(pow((1000/975),(287/1004))))-273.16'

'set lev 950'
'define 
dewp950=(tmpprs-273.15)-((14.55+0.114*(tmpprs-273.15))*(1-0.01*rhprs)+pow((2.5+0.007*(tmpprs-273.15))*(1-0.01*rhprs),3)+(15.9+0.117*(tmpprs-273.15))*pow((1-0.01*rhprs),14))' 

'define es950 = 0.6112*exp((17.67*(tmpprs-273.15))/((tmpprs-273.15)+243.5))'
'define e950=((es950*rhprs)/100)*10'
'define w950    = (0.622*e950)/(950-e950))'
'define te950   = (tmpprs)+((2800000*w950)/1004)'
'define ept950  = (te950*(pow((1000/950),(287/1004))))-273.16'

'set lev 925'
'define 
dewp925=(tmpprs-273.15)-((14.55+0.114*(tmpprs-273.15))*(1-0.01*rhprs)+pow((2.5+0.007*(tmpprs-273.15))*(1-0.01*rhprs),3)+(15.9+0.117*(tmpprs-273.15))*pow((1-0.01*rhprs),14))' 

'define es925 = 0.6112*exp((17.67*(tmpprs-273.15))/((tmpprs-273.15)+243.5))'
'define e925=((es925*rhprs)/100)*10'
'define w925    = (0.622*e925)/(925-e925))'
'define te925   = (tmpprs)+((2800000*w925)/1004)'
'define ept925  = (te925*(pow((1000/925),(287/1004))))-273.16'

....etc



More information about the gradsusr mailing list