[ncl-talk] (no subject)
Mary Haley
haley at ucar.edu
Tue Jul 24 13:55:15 MDT 2018
Hi Laura,
There is definitely an issue with the minus sign in the variable name. If
you do something like this:
var = f->lwp37_mid-high_daynight_mon
then NCL thinks you are trying to read "lwp37_mid" off the file and
subtract the variable "high_daynight_mon" from it.
To work around this, enclose the variable name in $"..."$:
var = f->$"lwp37_mid-high_daynight_mon"$
You can also do this:
varname = "lwp37_mid-high_daynight_mon"
var = f->$varname$
--Mary
On Mon, Jul 23, 2018 at 9:04 PM, Laura Fowler <laura at ucar.edu> wrote:
> Hello:
>
> I am trying to read two variables in a NetCDF file. One is named "lwp37_high_daynight_mon"
> and I do not have any issue to read it.
>
> The other one is named "lwp37_mid-high_daynight_mon" for which ncl
> (6.4.0) an error message. I do not have any issue using ncdump with this
> variable. Does ncl has an issue reading variable that a name with a mix of
> "_" and "-" sign.
>
> This is the only thing I can think of.
>
> Many thanks,
> Laura
>
>
>
> --
> !-----------------------------------------------------------
> --------------------------------------------------
> Laura D. Fowler
>
> Mesoscale and Microscale Meteorology Division (MMM)
> National Center for Atmospheric Research
> P.O. Box 3000, Boulder CO 80307-3000
>
> e-mail: laura at ucar.edu
> phone: 303-497-1628
>
> !-----------------------------------------------------------
> --------------------------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180724/746534a7/attachment.html>
More information about the ncl-talk
mailing list