Why there are missing values in NARR data?

From: <Tao.Zhang_at_nyahnyahspammersnyahnyah>
Date: Sun, 10 May 2009 10:37:48 -0700

Hi,

  I am trying to regrid NARR (North American Regional Reanlysis) data
(netcdf format, see point 2 below) into 2X2 regular netcdf grid. I find
that the regrided 2X2 netcdf data have values of 6.5532 for snow cover,
it is obviously wrong. I print out the original NARR snow cover (netcdf
format) data (the code is listed in point 1 below), and the message
below shows that NARR raw data have values of 6.5532 already. As NARR
data is model ouput, there is no reason that the data should have
missing values. Actually, the snow cover should range from 0 to 1.
(snowc:unpacked_valid_range = 0.f, 1.f ;
                snowc:precision = 4s ;
                snowc:actual_range = 0.f, 1.f ;)

Therefore, I am sure that 6.5532 comes from the error calculation using
the missing values (6.5532=32766*0.0001+3.2766).

  But I don't understand why this occurs (there should be no missing
values for NARR data as it is model output)? How to get around this
missing values?

  Your suggestions are much appreciated.

   Thanks,
   Tao

  

----------------------------
Variable: x
Type: float
Total Size: 134568816 bytes
            33642204 values
Number of Dimensions: 3
Dimensions and sizes: [348] x [277] x [349]
Coordinates:
Number Of Attributes: 1
  _FillValue : -32767
(0) min=0 max=6.5532

Variable: x (subsection)
Type: float
Total Size: 386692 bytes
            96673 values
Number of Dimensions: 2
Dimensions and sizes: [277] x [349]
Coordinates:
Number Of Attributes: 1
  _FillValue : -32767
(0,0) 0
(0,1) 0
(0,2) 0

......
(45,343) 0
(45,344) 0
(45,345) 0
(45,346) 6.5532
(45,347) 6.5532
(45,348) 6.5532
(46,0) 0
(46,1) 0
(46,2) 0
(46,3) 0
(46,4) 0
(46,5) 0
(46,6) 0
--------------------------

  
(1) NCL Code
;**************************************************************
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"

begin
;*******************************************
; open file and read in data
;*******************************************
  diri = "../raw_nc/" ; input directory
  f = addfile (diri+"snowc.mon.mean.nc", "r")
                                              ; convert short=>float
; x = short2flt( f->snowc(:,:,:) ) ; (time,lat,lon)
;

  scale_factor = f->snowc_at_scale_factor
  add_offset = f->snowc_at_add_offset
  x = scale_factor * (f->snowc) + add_offset

  time = f->time
  lat2d = f->lat ; coordinates
  lon2d = f->lon
  dimlc = dimsizes(lat2d) ; dimension sizes
  nlat = dimlc(0)
  mlon = dimlc(1)
  ntime = dimsizes(time)
;
  print("lat2d: min="+min(lat2d)+" max="+max(lat2d))

  printVarSummary(x)
  print(" min="+min(x)+" max="+max(x))

  print(x(0,:,:))
end
    

(2) information about NARR (North American Regional Reanlysis) data

netcdf snowc.mon.mean {
dimensions:
        time = UNLIMITED ; // (348 currently)
        y = 277 ;
        x = 349 ;
        nbnds = 2 ;
variables:
        float lat(y, x) ;
                lat:long_name = "latitude coordinate" ;
                lat:units = "degrees_north" ;
                lat:axis = "Y" ;
                lat:coordinate_defines = "point" ;
                lat:standard_name = "latitude" ;
        float lon(y, x) ;
                lon:units = "degrees_east" ;
                lon:long_name = "longitude coordinate" ;
                lon:axis = "X" ;
                lon:coordinate_defines = "point" ;
                lon:standard_name = "longitude" ;
        float x(x) ;
                x:long_name = "eastward distance from southwest corner
of domain in projection coordinates" ;
                x:units = "m" ;
                x:standard_name = "projection_x_coordinate" ;
        float y(y) ;
                y:long_name = "northward distance from southwest corner
of domain in projection coordinates" ;
                y:units = "m" ;
                y:standard_name = "projection_y_coordinate" ;
        int Lambert_Conformal ;
                Lambert_Conformal:grid_mapping_name =
"lambert_conformal_conic" ;
                Lambert_Conformal:standard_parallel = 50., 50. ;
                Lambert_Conformal:longitude_of_central_meridian = -107. ;
                Lambert_Conformal:latitude_of_projection_origin = 50. ;
                Lambert_Conformal:false_easting = 5632642.22547 ;
                Lambert_Conformal:false_northing = 4612545.65137 ;

         short snowc(time, y, x) ;
                snowc:units = "1" ;
                snowc:long_name = "Monthly Snow Cover at Surface" ;
                snowc:unpacked_valid_range = 0.f, 1.f ;
                snowc:precision = 4s ;
                snowc:actual_range = 0.f, 1.f ;
                snowc:add_offset = 3.2766f ;
                snowc:scale_factor = 0.0001f ;
                snowc:missing_value = 32766s ;
                snowc:valid_range = -32766s, 22765s ;
                snowc:_FillValue = -32767s ;
                snowc:GRIB_name = "SNOWC" ;
                snowc:GRIB_id = 238 ;
                snowc:var_desc = "snow cover" ;
                snowc:standard_name = "" ;
                snowc:level_desc = "Surface" ;
                snowc:dataset = "NARR Monthly Averages" ;
                snowc:statistic = "Mean" ;
                snowc:parent_stat = "Individual Obs" ;
                snowc:grid_mapping = "Lambert_Conformal" ;
                snowc:coordinates = "lat lon" ;
                snowc:cell_methods = "time: mean (monthly from daily
values)" ;

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sun May 10 2009 - 11:37:48 MDT

This archive was generated by hypermail 2.2.0 : Mon May 11 2009 - 09:43:46 MDT