Heat Index plots in GRADS

Charles Seman Charles.Seman at NOAA.GOV
Thu May 10 16:42:20 EDT 2007


Kevin,

Could you try using "maskout()"
http://grads.iges.org/grads/gadoc/gradfuncmaskout.html

maybe:

'define HIall = ((-42.379 + (2.04901523*tempF) + (10.14333127*rh) -
(0.22475541*tempF*rh) - (0.00683783*pow(tempF,2)) -
(0.05481717*pow(rh,2)) + (0.00122874*pow(tempF,2)*rh) +
(0.00085282*tempF*pow(rh,2)) - (0.00000199*pow(tempF,2)*pow(rh,2)))-32)*5/9'


'define HI = maskout(HIall,tempF-80.)'
(or you could put the code for "HIall" inside the "maskout" too...)

this should put missing values wherever "tempF-80." is < 0 (note, HI
would remain at tempF = 80.)

I hope this helps,
Chuck

Kevin M Levey wrote:
>
> THU 10MAY07: 0940PDT
>
> Hi
>
> I was wondering if anyone has done Heat Index (HI) plotting in GRADS?
> I have the correct HI formula, but I get erroneous output since GRADS
> is calculating the HI at every point for every temp. However, HI
> should only be calculated for temps > 80F (26C). So, what happens is,
> GRADS calculates the HI for values < 80F (< 26C) when these points
> should NOT have HI values and the plot is a mess – showing both valid
> and non-valid HI values. I am pretty adept using GRADS, however, I’ve
> been working on this for days and can’t seem to figure out how to get
> GRADS to ignore values below the HI threshold. Has anyone come across
> this problem before? I am using GFS data.
>
> Many thanks!
>
> Below is a typical GRADS script for producing HI.
>
> Regards
>
> Kevin M Levey, MSc (University of Cape Town)
>
> Director of Meteorological Operations
>
> CustomWeather, Inc
>
> San Francisco, CA, USA
>
> http://www.1stweather.com
>
> http://www.myforecast.com
>
> http://www.customweather.com
>
> *002hr 0 DAY 1
>
> 'set mpdset hires'
>
> 'set mpt * off'
>
> 'set mpt 0 1 1 6'
>
> 'set mpt 1 1 1 1'
>
> 'set display color white'
>
> 'clear'
>
> 'open /prod/custom/intModel/GFS/temp/gfs_001.ctl'
>
> 'set xsize 800 600'
>
> 'set lat -36 -16'
>
> 'set lon 10 36'
>
> 'set map auto 1 1 6'
>
> 'set lev 1000'
>
> 'define temp = TMP2M - 273.16'
>
> 'define tempF = (temp *1.8) +32'
>
> 'define v = VGRDprs*3.6'
>
> 'define u = UGRDprs*3.6'
>
> 'define windkmh = mag(u,v)'
>
> 'define rh = RH2M'
>
> 'define HI = ((-42.379 + (2.04901523*tempF) + (10.14333127*rh) -
> (0.22475541*tempF*rh) - (0.00683783*pow(tempF,2)) -
> (0.05481717*pow(rh,2)) + (0.00122874*pow(tempF,2)*rh) +
> (0.00085282*tempF*pow(rh,2)) -
> (0.00000199*pow(tempF,2)*pow(rh,2)))-32)*5/9'
>
> *draw heat index map
>
> 'run /prod/custom/intModel/GFS/scripts/rgbset_HI1.gs'
>
> 'set gxout shaded'
>
> 'set cint 2.5'
>
> 'set cmin 40'
>
> 'set csmooth on'
>
> 'set grads off'
>
> 'd HI'
>
> 'set ccolor 0'
>
> 'set gxout contour'
>
> 'set cint 2.5'
>
> 'set cmin 30'
>
> 'set csmooth on'
>
> 'd HI'
>
> 'run /prod/custom/intModel/GFS/scripts/SA_cities.gs'
>
> 'run /prod/custom/intModel/GFS/scripts/cbarn'
>
> 'draw title HEAT INDEX (C)\INIT: 12UTC 13MAR07 VALID: 02H00 TUE 13 MAR
> 2007'
>
> 'printim /prod/custom/intModel/GFS/temp/GFS_HEAT_INDEX_PLOT1.png png
> x800 y600'
>
> 'reinit'
>

--

Please note that Charles.Seman at noaa.gov should be considered my NOAA
email address, not cjs at gfdl.noaa.gov.

********************************************************************
 Charles Seman                                Charles.Seman at noaa.gov
 U.S. Department of Commerce / NOAA / OAR
 Geophysical Fluid Dynamics Laboratory         voice: (609) 452-6547
 201 Forrestal Road                              fax: (609) 987-5063
 Princeton, NJ  08540-6649            http://www.gfdl.noaa.gov/~cjs/
********************************************************************

"The contents of this message are mine personally and do not reflect
any position of the Government or NOAA."



More information about the gradsusr mailing list