[gradsusr] Using maskout in definition failing

Matt Bunkers - NWS Rapid City matthew.bunkers at noaa.gov
Wed Jan 25 11:42:39 EST 2023


Hello,

I created a variable ("gl") that uses two for-loops and an if-else
statement to determine areas that need to be masked.  Here is a snippet of
the code:

    if (landuse = -80 | landuse = -104 | landuse = 37)
      gl.i.j = 1
    else
      gl.i.j = -999000000
    endif

Then I close that file and open a new file to apply the mask:

'close 1'
'open /data/SOOapps/mjb-apps/NDVI/ndviout.ctl'
'define maskrh900mb=maskout(rh900mb,gl)'

This is giving me the following error:

Syntax Error:  Invalid Operand
  'gl' not a variable or function name
Operation Error:  Error from maskout function
  Error ocurred at column 1
DEFINE error:  Invalid expression.

The two arrays (rh900mb & gl) are the same dimensions, so I'm not sure what
is going wrong.  Does anyone have any suggestions?

Thank you,

-- Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gradsusr.org/pipermail/gradsusr/attachments/20230125/2824c402/attachment.html>


More information about the gradsusr mailing list