Reputation: 21
I am having trouble with this code in GrADS. The error kept saying that my two if statements were invalid. I reinstated some stars but it gave me a whole new error.
"open NAM12Z0709.ctl"
"set display color white"
"clear"
"set mpdset hires"
"set grad off"
"set lev 1000"
'run rgbset.gs'
'set lat 36 38'
'set lon -125 -120'
'define lcl=((TMPsfc-DPT2m)*400)'
'define tc=(TMPprs-273.15)'
'define es=(6.11*exp((17.625*tc)/(tc+243.05)))'
'define e=(es*RHprs/100)'
'define wr=(622*e/(925-e))'
'define expo=(exp((2257*wr)/(1004*TMPprs)))'
'define numer=(-2.06327*TMPprs/(6516))'
'define denom=(pow((RHprs/100),0.46))'
'define thetae=(expo*numer/denom)'
'define b=((-6.67*thetae-0.667)*(-0.1*VVELprs))'
if (HGTprs <= lcl)
'b=0'
endif
if (VVELprs >= 0)
'b=0'
endif
'set clevs 0.0 0.125 0.25 0.375 0.5 0.625 0.75 0.875 1.0'
'set ccols 1 4 13 3 10 7 12 8 2'
'set gxout shaded'
'set grads off'
'd b'
"printim testing12Zcloud.png png"
'clear'
'quit'
Upvotes: 0
Views: 406
Reputation: 171
You are confusing between Grads's variable/field and Grads Script's variable. Specificlly, you cannot use HGTprs and VVELprs as a Grads script variable like that.
Upvotes: 1