Topic Options
#1122124 - 22/08/2012 20:06 GrADS script for favourable hail ingredients
Ken Kato Offline
Meteorological Motor Mouth

Registered: 05/03/2012
Posts: 5992
For davidm & anyone else interested, here's my GrADS hail ingredients script I currently use. Note that this is largely based on the US Storm Prediction Centre's significant hail parameter with the exception of mixing ratio (I normalise it to a range of 0 to 20):



'reinit'
'sdfopen http://nomads.ncep.noaa.gov:9090/dods/gfs_hd/gfs_hd20120712/gfs_hd_00z'
'set LAT -47 -8'
'set LON 105 160'
'set lev 1000'
'set t 1'

'clear'
'set parea 1.1 10.7 0.9 7.2'
'set font 0'
'set strsiz 0.15 0.20'
'draw string 2.70 8.20 Probability of Significant Hail (%)'
'set strsiz 0.10 0.13'

* AMD LOCATION INFO IF REQ
'draw string 2.72 7.86 Location: Australia'

* AMD MODEL INITIAL TIME
'draw string 2.72 7.66 Model: NCEP Deterministic - initialised 00Z 12/7/12'

* AMD FORECAST PERIOD
'draw string 2.72 7.46 Forecast Period: 13/7/12'

'draw string 2.72 7.26 (Ingredients Used: MU CAPE, MU Mixing Ratio, 700-500hpa LR, 500T, 0-6km Shear)'
'set font 2'
'set strsiz 0.11 0.14'


* AMD VALUES OF t - NOMINAL DIFF OF 8 FOR A 24HR PERIOD
* SPC FORMULA: SHIP = [(MUCAPE j/kg) * (Mixing Ratio of MU PARCEL g/kg) * (700-500mb LAPSE RATE c/km) * (-500mb TEMP C) * (0-6km Shear m/s) ] / 44,000,000
'define maxHail=max((capesfc*(rh2m/5))*((tmpprs(lev=700)-tmpprs(lev=500))/2.5908)*((tmpprs(lev=500)-273)*-1)*(shear(ugrdprs(lev=500),vgrdprs(lev=500),ugrd10m,vgrd10m))/44000000/2*100,t=5,t=13)'




* These are the WHITE shades
'set rgb 100 0 0 0'
'set rgb 110 0 0 0'
'set rgb 120 70 70 70'
'set rgb 130 90 90 90'
'set rgb 140 110 110 110'
'set rgb 150 130 130 130'
'set rgb 160 150 150 150'
'set rgb 170 170 170 170'
'set rgb 180 190 190 190'
'set rgb 190 210 210 210'
'set rgb 200 230 230 230'
'set rgb 210 255 255 255'

'set gxout shaded'
'set clevs 0 10 20 30 40 50 60 70 80 90 100'
'set ccols 100 110 120 130 140 150 160 170 180 190 200 210'




* DRAW SHADED hail PROBS
'set background 0'
'set mpdset hires'
'set gxout shaded'
'set map 1 1 50'
'set cmin 10'
'set cmax 100'
'set cint 10'
'd MaxHail'
'run cbarn'

* DRAW CONTOURED hail PROBS
'set gxout contour'
'set ccolor 1'
'set cmin 10'
'set cmax 100'
'set cint 10'
'set clab on'
'd MaxHail'

Top
#1122126 - 22/08/2012 20:08 Re: GrADS script for favourable hail ingredients [Re: Ken Kato]
davidm Offline
Weatherzone Addict

Registered: 08/08/2011
Posts: 1555
Loc: Orange, NSW
Legend! Can't thank you enough. smile
_________________________
Wunderground | davidm.com.au

Top
#1122144 - 22/08/2012 21:25 Re: GrADS script for favourable hail ingredients [Re: davidm]
davidm Offline
Weatherzone Addict

Registered: 08/08/2011
Posts: 1555
Loc: Orange, NSW
Hmm this may be my noobishness but seems as though there are references to variables that are either calculated elsewhere or non-existant in this run.

Running the script with only modifying the data date gives the following:

Code:
ga-> run hail.gs
No hardcopy metafile open
All files closed; all defined objects released;
All GrADS attributes have been reinitialized
Syntax Error:  Invalid Operand 
  'shear' not a variable or function name
Operation Error:  Error from max function
  Error ocurred at column 1
DEFINE error:  Invalid expression. 
Syntax Error:  Invalid Operand 
  'maxhail' not a variable or function name
  Error ocurred at column 1
DISPLAY error:  Invalid expression 
  Expression = maxhail
Error opening script file: cbarn
Syntax Error:  Invalid Operand 
  'maxhail' not a variable or function name
  Error ocurred at column 1
DISPLAY error:  Invalid expression 
  Expression = maxhail


Manually pulling the data and listing variables as such shows a few sheer related variables (I could have sworn it was spelt shear)

Code:
ga-> sdfopen http://nomads.ncep.noaa.gov:9090/dods/gfs_hd/gfs_hd20120721/gfs_hd_00z
Scanning self-describing file:  http://nomads.ncep.noaa.gov:9090/dods/gfs_hd/gfs_hd20120721/gfs_hd_00z
SDF file http://nomads.ncep.noaa.gov:9090/dods/gfs_hd/gfs_hd20120721/gfs_hd_00z is open as file 1
LON set to 0 360 
LAT set to -90 90 
LEV set to 1000 1000 
Time values set: 2012:7:21:0 2012:7:21:0 
E set to 1 1 
ga-> q file 1


Code:
     vwsh2pv  0  t,y,x  ** pv=2e-06 (km^2/kg/s) surface vertical speed sheer [1/s] 
     vwshneg2pv  0  t,y,x  ** pv=-2e-06 (km^2/kg/s) surface vertical speed sheer [1/s] 
     vwsh0p5pv  0  t,y,x  ** pv=5e-07 (km^2/kg/s) surface vertical speed sheer [1/s] 
     vwshneg0p5pv  0  t,y,x  ** pv=-5e-07 (km^2/kg/s) surface vertical speed sheer [1/s] 
     vwsh1pv  0  t,y,x  ** pv=1e-06 (km^2/kg/s) surface vertical speed sheer [1/s] 
     vwshneg1pv  0  t,y,x  ** pv=-1e-06 (km^2/kg/s) surface vertical speed sheer [1/s] 
     vwsh1p5pv  0  t,y,x  ** pv=1.5e-06 (km^2/kg/s) surface vertical speed sheer [1/s] 
     vwshneg1p5pv  0  t,y,x  ** pv=-1.5e-06 (km^2/kg/s) surface vertical speed sheer [1/s] 
     vwshtrop  0  t,y,x  ** tropopause vertical speed sheer [1/s] 


I'm fairly certain this is a pebkac but it's doing my head in wink
_________________________
Wunderground | davidm.com.au

Top
#1122149 - 22/08/2012 21:46 Re: GrADS script for favourable hail ingredients [Re: davidm]
Ken Kato Offline
Meteorological Motor Mouth

Registered: 05/03/2012
Posts: 5992
Hmmm not sure why it'd be doing that. If it helps, I'm running GrADS Version 2.0.1.oga.1 (the self-installing Superpack version for Windows) and haven't had any probs accessing various inbuilt commands like 'shear' after opening the self-describing HD gfs model files either via the command prompt or scripts. All the Syntax Error messages you're getting after GrADS tries to use the shear command make sense though because most of those arguments rely on the 'shear' argument being available.

Also, yep it's spelt "shear" so it looks like whoever made the variable's description info, misspelt it.

Unfortunately I'm not really a GrADS guru (I know just enough to get by with my scripts) and I'm not even an IT guru either. The only other thing I can suggest if it still doesn't work with the 2.0.1 Windows version of GrADS is maybe check out the GrADS user forum at http://www.iges.org/grads/users.html

Either that, or hopefully someone reading this thread might be able to shed some light on it?

Top
#1122151 - 22/08/2012 22:00 Re: GrADS script for favourable hail ingredients [Re: Ken Kato]
Ken Kato Offline
Meteorological Motor Mouth

Registered: 05/03/2012
Posts: 5992
I just test-ran that script & only changed the 2nd line (containing the model initial date/time) to today's 00z run as follows:
'sdfopen http://nomads.ncep.noaa.gov:9090/dods/gfs_hd/gfs_hd20120822/gfs_hd_00z'

It ran fine without any errors and displayed the plot.

Top
#1122160 - 22/08/2012 23:01 Re: GrADS script for favourable hail ingredients [Re: Ken Kato]
davidm Offline
Weatherzone Addict

Registered: 08/08/2011
Posts: 1555
Loc: Orange, NSW
Same error again on today's run - I'd put money on it being a difference in compilation options as I'm using the OS X distribution of GrADS. Just checked the Open GrADS and I see that the oga on the version does correspond with their builds - downloading that now. smile
_________________________
Wunderground | davidm.com.au

Top
#1122162 - 22/08/2012 23:13 Re: GrADS script for favourable hail ingredients [Re: davidm]
davidm Offline
Weatherzone Addict

Registered: 08/08/2011
Posts: 1555
Loc: Orange, NSW
Works perfectly with OpenGrADS - I guess their version has extra functions compiled in, now I can really start playing with it wink

Thanks mate!
_________________________
Wunderground | davidm.com.au

Top
#1122366 - 23/08/2012 15:31 Re: GrADS script for favourable hail ingredients [Re: davidm]
davidm Offline
Weatherzone Addict

Registered: 08/08/2011
Posts: 1555
Loc: Orange, NSW
Looks like the formula was pretty accurate - lining up quite well with the areas forecast.
_________________________
Wunderground | davidm.com.au

Top
#1122373 - 23/08/2012 15:34 Re: GrADS script for favourable hail ingredients [Re: davidm]
Ken Kato Offline
Meteorological Motor Mouth

Registered: 05/03/2012
Posts: 5992
Indeed, the cells are starting to look pretty nasty! Glad the GrADS script eventually worked for you too.

Top


Who's Online
8 registered (Mike Hauber, Homer, Multiversity, Mcbobbings, Snowmaker, Snapper22lb, mysteriousbrad, 1 invisible), 57 Guests and 3 Spiders online.
Key: Admin, Global Mod, Mod
Today's Birthdays
araT, danz, kimsmith, Tara, Welshmun
Forum Stats
29918 Members
32 Forums
24132 Topics
1524136 Posts

Max Online: 2985 @ 26/01/2019 12:05
Satellite Image