Re: Missing value problem?

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon Jun 03 2013 - 10:37:03 MDT

Thanks for providing a file.

Did you look at your data? I added three lines so I could print the min/max and count the number of missing and non-missing values of your input data (t1):

printMinMax(t1,0)
print("# of missing values = " + num(ismissing(t1)))
print("# of non missing values = " + num(.not.ismissing(t1)))

The output was:

(0) Carbon Mass Flux out of Atmosphere due to Net Primary Production on Land: min=-5.92884e-08 max=9.2756e-08
(0) # of missing values = 19720579
(0) # of non missing values = 6157949

I did the same for the (output) values, "Yearly":

printMinMax(Yearly,0)
print("# of missing values = " + num(ismissing(Yearly)))
print("# of non missing values = " + num(.not.ismissing(Yearly)))

Here's the output:

(0) Carbon Mass Flux out of Atmosphere due to Net Primary Production on Land: min=-1.08987e-09 max=6.66729e-08
(0) # of missing values = 1660494
(0) # of non missing values = 496050

So, I'm not sure what you mean by "it always return empty file (all grids are missing value)". You do have
some missing values, but you also have some valid values. This is to be expected given that your input
had some missing values.

--Mary

On Jun 1, 2013, at 10:47 AM, Jiang, Lifen wrote:

> Dear NCL members,
>
> I am calculating annual average of my monthly data using NCL "month_to_annual" function. However, it always returned empty file (all grids are missing value).
>
> I don't think the codes (see below) have problems because they worked very well for other data but for this. I guess the issue is related with missing value of the data file but cann't find what it is.
>
> I have uploaded the data file to UCAR's ftp under folder "incoming". I appreciate if anyone can help check what is the problem.
>
> Thank you!
>
> Lifen
>
> ****************
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
> f1 = addfile("npp_Lmon_NorESM1-M_historical_r1i1p1_185001-200512.nc", "r")
> t1 = f1->npp ; t1(time,lat,lon)
> printVarSummary(t1)
>
> t1@_FillValue = 0
> t1@missing_value = t1@_FillValue
>
> Yearly = month_to_annual(t1(time|:,lat|:,lon|:), 1) ; TMP(156,nlat,mlon)
>
> system("/bin/rm -f yearly_npp_NorESM1-M.nc") ; remove any pre-exist file
> fout = addfile("yearly_npp_NorESM1-M.nc", "c") ; new netCDF file
> fout@title = "Month to year"
> fout->Yearly = Yearly
> _______________________________________________
> 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 Mon Jun 3 10:39:38 2013

This archive was generated by hypermail 2.1.8 : Tue Jun 04 2013 - 09:50:17 MDT