[gradsusr] Multi if maskout
Tyler Youschak
tyleryouschak at gmail.com
Sat Aug 3 09:02:26 EDT 2019
Hello,
I've been trying to do some magic to create an index. I was trying to originally create a function that had an if to check to see if the temperature were between two values, and then another if to check the value of another computed variable. Here to find out, I couldn't get it to work because it wouldn't actually use the variables I created in the functions. Later, I stumbled across an email in this group saying that it would take *more* time to do an if like I was doing and would be quicker to do a mask out for computation time.
So, that leads me to my question. I'm trying to do an "advanced" maskout (advanced to me, most likely not to those advanced members in here)! Any chance anyone could give me a starting point, or at least get me started for the first temperature range.
Here's my "pseudo code" (where t is temp and z is lcl height):
if(math_nint(t) = 0)
if((z >= 38000) & (z < 42000)) ; 'define wsi = 1' ; endif
if((z >= 42000) & (z < 49000)) ; 'define wsi = 2' ; endif
if((z >= 49000) & (z <= 55000)) ; 'define wsi = 3' ; endif
endif
if(math_nint(t) = 1)
if((z >= 35500) & (z < 42500)) ; 'define wsi = 1' ; endif
if((z >= 42500) & (z < 47000)) ; 'define wsi = 2' ; endif
if((z >= 47000) & (z <= 52500)) ; 'define wsi = 3' ; endif
endif
Thanks,
Tyler Youschak
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gradsusr.org/pipermail/gradsusr/attachments/20190803/e64478e2/attachment.html>
More information about the gradsusr
mailing list