[gradsusr] Using maskout in definition failing

Michael Fiorino mfiorino at gmu.edu
Thu Feb 16 08:23:17 EST 2023


hi Matt,

the gl.i.j is a script variable(?)  you'd have to 'print' it to a txt file and then convert to grads...



Best Regards, Mike

Michael Fiorino, Ph.D. (meteorology, NPS)
Commander, US Navy (retired)
AOES George Mason University
Fairfax, VA

mfiorino at gmu.edu<mailto:mfiorino at gmu.edu> (GMU)
tenkiman at pm.me<mailto:tenkiman at pm.me> (home)

+1 720-204-0876 (mobile)

AOES is the Atmospheric, Oceanic and Earth Sciences department
https://science.gmu.edu/academics/departments-units/atmospheric-oceanic-earth-sciences

"Well Mike, it just goes to show ya, it's always something--if it ain't one thing, it's another"
-- Roseanne Roseannadanna


------ Original Message ------
From "Matt Bunkers - NWS Rapid City" <matthew.bunkers at noaa.gov<mailto:matthew.bunkers at noaa.gov>>
To "GrADS Users Forum" <gradsusr at gradsusr.org<mailto:gradsusr at gradsusr.org>>
Date 1/25/2023 11:42:39 AM
Subject [gradsusr] Using maskout in definition failing

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/20230216/086d4eef/attachment-0001.html>


More information about the gradsusr mailing list