Re: Where function inserting missing values. Why?

From: Wei Huang <huangwei_at_nyahnyahspammersnyahnyah>
Date: Tue Oct 20 2009 - 13:04:40 MDT

Briget,

Check _FillValue of mon_avg_obs, data_all, factors
with command printVarSummary(the_var).

It is likely, that variable factors has _FillValue of 0.

Regards

Wei Huang
huangwei@ucar.edu
VETS/CISL
National Center for Atmospheric Research
P.O. Box 3000 (1850 Table Mesa Dr.)
Boulder, CO 80307-3000 USA
(303) 497-8924

On Oct 20, 2009, at 10:31 AM, 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
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

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

This archive was generated by hypermail 2.1.8 : Thu Oct 22 2009 - 13:09:30 MDT