[ncl-talk] scalar and streamline script sometimes hangs

David Brown dbrown at ucar.edu
Tue Sep 12 15:16:38 MDT 2017


Hi Scott,
The immediate problem is that the variable ELVCAPE in the file
"this_does_not_work.nc"
contains a (at least one) value of "inf"  (meaning infinity -- a non-number)

You can see this in the output of
your first printMinMax statement.

NCL graphics routines cannot handle non-numbers (inf, nan, or -inf),
and therefore you have to get rid of them prior to plotting.
In your case I was able to get a plot using the line:

plot_var = where(plot_var .gt. 1e36, plot_var at _FillValue, plot_var)

The 1e36 is just a value that presumably is greater than any actual data value.
Note that inf and -inf can both be compared to actual numbers unlike
nan's (not a number).
If you wanted to generically get rid of any possible instance of any
of these non-numbers you would need something like this:

v = where (v .gt. 1e36 .or. v .lt. - 1e36 .or. isnan_ieee(v),v at _FillValue, v)

This assumes that v already has an assigned _FillValue attribute.
  -dave


On Tue, Sep 12, 2017 at 12:01 PM, Scott Capps
<scapps at atmosdatasolutions.com> wrote:
> Good afternoon,
>
> I am having some intermittent issues with a script which plots lifted index,
> elevated CAPE and streamlines overlaid on one plot.  The script is attached
> which works for one netcdf file and hangs on another.  I can provide a
> sample netcdf file that works and one where it hangs.  I have sent the
> sample data to your ftp server:
>
> inv.nc
> this_works.nc
> this_does_not_work.nc
>
> I have removed all but the necessities in the attached script to replicate
> the issue.  The commands used to run the scripts are at the top in the
> "USAGE" section.  I am using Ubuntu:
>
> NCL v6.4.0
> Linux rose 4.10.0-33-generic #37-Ubuntu SMP Fri Aug 11 10:55:28 UTC 2017
> x86_64 x86_64 x86_64 GNU/Linux
>
> Any help is appreciated as to how I can prevent it from hanging (exit
> safely).
>
> Thank you,
>
> Scott
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>


More information about the ncl-talk mailing list