about missing value in nc file and avg function

From: YangJing (yangjing AT XXXXXX)
Date: Mon Jun 14 2004 - 07:08:17 MDT


ncl-talkHi aLL:

   Today I met a problem when i use NCL .

   In my NCL programm to creat a nc file.
   I wrote as follows:
..............
..............
    RAIN@_FillValue = 251.
  
    print(RAIN)

    outfile = addfile("rain_98_big.nc","c")
    outfile->RAIN = RAIN
   end
---------------------------------------------------------------------------------------------
Then it is printed on computer monitor :
    1, 0.5, 0, 0, 0, 0.3, 0.5, 0.3, 0, 0, 0, 0, 0, 0, 0, 0, 0.4, 1, 1.4, 0.8,
    0.1, 0, 0, 0, 0.1, 0.3, 0.3, 0.6, 5.3, 8, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    8.3, 6.3, 8.3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0.6, 1.3, 0.8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0.1, 0.1, 0.1,
    251., 251., 251., 0, 0, 0,251.,251.,251.,251., 0, 0, 0,..................

But, when I open the .nc file, it is as follows:
..........
............
         RAIN:_FillValue = 251.f
==============================

    1, 0.5, 0, 0, 0, 0.3, 0.5, 0.3, 0, 0, 0, 0, 0, 0, 0, 0, 0.4, 1, 1.4, 0.8,
    0.1, 0, 0, 0, 0.1, 0.3, 0.3, 0.6, 5.3, 8, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    8.3, 6.3, 8.3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0.6, 1.3, 0.8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0.1, 0.1, 0.1,
    _, _, _, 0, 0, 0, _, _, _, _, 0, 0, 0, _, 0, 0, 0, .................................
====================================
 You see the 251. is not displayed as it should be. why?

 Then I will make average for the array in "this" nc file I created.
 So i wrote
--------------------------------
     rainave = avg(RAIN)
--------------------------------
 but when I run the NCL script.
 I got these warnings.

warning:avg: Entire input array contains missing values, can't compute average
warning:avg: Entire input array contains missing values, can't compute average
warning:avg: Entire input array contains missing values, can't compute average
warning:avg: Entire input array contains missing values, can't compute average
warning:avg: Entire input array contains missing values, can't compute average
warning:avg: Entire input array contains missing values, can't compute average
warning:avg: Entire input array contains missing values, can't compute average
warning:avg: Entire input array contains missing values, can't compute average
warning:avg: Entire input array contains missing values, can't compute average
warning:avg: Entire input array contains missing values, can't compute average
warning:avg: Entire input array contains missing values, can't compute average
warning:avg: Entire input array contains missing values, can't compute average
warning:avg: Entire input array contains missing values, can't compute average
warning:avg: Entire input array contains missing values, can't compute average
warning:avg: Entire input array contains missing values, can't compute average
warning:avg: Entire input array contains missing values, can't compute average
warning:avg: Entire input array contains missing values, can't compute average
--------------------------------------------------------------------------------------

I don't know why?

could you help me?

Thanks a lot!
        

_______________________________________________
ncl-talk mailing list
ncl-talk AT ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk



This archive was generated by hypermail 2b29 : Fri Jun 25 2004 - 15:17:36 MDT