Re: ncl-talk Digest, Vol 71, Issue 58

From: Bridget Thrasher <bthrasher_at_nyahnyahspammersnyahnyah>
Date: Tue Oct 20 2009 - 12:49:43 MDT

But shouldn't using .not.ismissing() catch those as it does in the second
where statement? So I guess the question is why does the second statement
work, but the third does not?

> I suspect that you have missing values in the first argument to the
> where function. From the documentation:
>
> "If any elements of condtnl_expr are missing (i.e. equal
> to condtnl_array@_FillValue), then the corresponding
> elements of the return array become missing values equal
> to the missing value of whatever type is returned."
>
> For debugging, I recommend that you assign "condtnl_expr" to a named
> NCL variable, and print the counts of true, false, and missing for that.
>
> Dave Allured
> CU/CIRES Climate Diagnostics Center (CDC)
> http://cires.colorado.edu/science/centers/cdc/
> NOAA/ESRL/PSD<http://cires.colorado.edu/science/centers/cdc/%0ANOAA/ESRL/PSD>,
> Climate Analysis Branch (CAB)
> *** http://www.esrl.noaa.gov/psd/psd1/ ***
> NOTICE: NEW PSD1/CAB WEBSITE ADDRESS AS OF 2009-OCT-14
> PRODUCT AND DATA CONSUMERS PLEASE TAKE NOTE
>
> Bridget Thrasher wrote:
> > I am doing the following in a loop:
> >
> > mon_avg_obs(m,:,:) = where(mon_avg_obs(m,:,:).eq.0, -2222,
> mon_avg_obs(m,:,:))
> > factors(a*12+m,:,:) = data_all(a*12+m,:,:)/mon_avg_20c(m,:,:)

> print("1. "+num(ismissing(factors(a*12+m,:,:))))
>

> > factors(a*12+m,:,:) = where(.not.ismissing(mon_avg_obs(m,:,:)),
> dvar(a*12+m,:,:)/mon_avg_obs(m,:,:), factors(a*12+m,:,:))
> > print("2. "+num(ismissing(factors(a*12+m,:,:))))
>

> > factors(a*12+m,:,:) =
> where(.not.ismissing(mon_avg_obs(m,:,:)).and.mon_avg_obs(m,:,:).eq.-2222,
> 0., factors(a*12+m,:,:))
> > print("3. "+num(ismissing(factors(a*12+m,:,:))))
> >
> >
> > The output on the screen says:
> > (0) 1. 0
> > (0) 2. 0
> > (0) 3. 11753
> >
> > Why is the last where statement inserting a fill value? I've tried it
> > with and without the .not.ismissing() part, as well as some other
> > things, but all yield the same result.
> >
> > -Bridget
> >
> >
> > --
> > Bridget Thrasher, PhD
> > Postdoctoral Researcher
> > Climate Central
> > www.climatecentral.org <http://www.climatecentral.org>
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > ncl-talk mailing list
> > List instructions, subscriber options, unsubscribe:
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
> ------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk@ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
> End of ncl-talk Digest, Vol 71, Issue 58
> ****************************************
>
Bridget,

-- 
Bridget Thrasher, PhD
Postdoctoral Researcher
Climate Central
www.climatecentral.org
(650) 376-7130

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Oct 20 12:49:42 2009

This archive was generated by hypermail 2.1.8 : Fri Oct 23 2009 - 11:36:30 MDT