[gradsusr] Multiple AND (logical) statements inside an if() in GrADS
Lyndz
olagueralyndonmark429 at gmail.com
Sat Feb 13 06:24:05 EST 2021
Dear GrADS experts,
I am calculating the heat stress index using the following:
'define temp = t2 - 273.16'
'define tempF = (temp *1.8) +32'
'define tempF = maskout(tempF,tempF-80)'
'define rh = rh2'
'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))'
if (rh < 13 & tempF >= 80 & tempF <= 112)
'define HIA = HI'
else
'define HIA = HI-((13-rh)/4)*sqrt(17-abs(tempF-95)/17)'
endif
if (rh > 85 & tempF >= 80 & tempF <= 87)
'define HIA = HI + 0.5*(tempF + 61 + ((tempF-68)*1.2) + (rh*0.094))'
endif
This is based on this link:
https://www.wpc.ncep.noaa.gov/html/heatindex_equation.shtml
Adjustments are added to and subtracted from the HI equation if the
temperature falls at a certain range.
Is this the correct way for doing this?
if (rh < 13 & tempF >= 80 & tempF <= 112)
if (rh > 85 & tempF >= 80 & tempF <= 87)
Or maybe there is a better approach for this....
I'll appreciate any comment/suggestion on this.
Sincerely,
*Lyndon Mark P. Olaguera, Ph.D.*
+63 906 023 9926
Manila Observatory,
Ateneo de Manila University Campus
Loyola Heights, Quezon city
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gradsusr.org/pipermail/gradsusr/attachments/20210213/fabad0b2/attachment.html>
More information about the gradsusr
mailing list