lai/02.read_byte_LAI.ncl
author Forrest Hoffman <forrest@climatemodeling.org>
Mon, 26 Jan 2009 22:08:20 -0500
changeset 0 0c6405ab2ff4
permissions -rw-r--r--
Initial commit of C-LAMP Diagnostics from Jeff Lee
forrest@0
     1
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"  
forrest@0
     2
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"  
forrest@0
     3
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"  
forrest@0
     4
forrest@0
     5
begin
forrest@0
     6
  nlat  = 3600
forrest@0
     7
  mlon  = 7200
forrest@0
     8
forrest@0
     9
  diri  = "/fis/cgd/cseg/people/jeff/clamp_data/"
forrest@0
    10
  fili  = "MOD15A2_GEO_2000001.nc"
forrest@0
    11
  a  = addfile(diri+fili,"r")
forrest@0
    12
forrest@0
    13
  diro  = "/fis/cgd/cseg/people/jeff/clamp_data/"
forrest@0
    14
  filo  = "LAI_2000001_3.nc"
forrest@0
    15
  c = addfile(diro+filo,"c")
forrest@0
    16
forrest@0
    17
  y = a->Lai_0_05deg
forrest@0
    18
forrest@0
    19
  y@_FillValue = inttobyte(253)
forrest@0
    20
  y@_FillValue = inttobyte(255)
forrest@0
    21
forrest@0
    22
  x = byte2flt(y)
forrest@0
    23
  
forrest@0
    24
; x@_FillValue = -17281                      ; orig fill    
forrest@0
    25
  x@_FillValue =  1.e+36                     ; new fill
forrest@0
    26
forrest@0
    27
  lat  = latGlobeFo(nlat, "lat", "latitude", "degrees_north")
forrest@0
    28
  lat  = (/ lat(::-1) /)                     ; make N->S
forrest@0
    29
  lon  = lonGlobeFo(mlon, "lon", "longitude", "degrees_east")
forrest@0
    30
  lon  = (/ lon - 180. /) ; subtract 180 from all values 
forrest@0
    31
  lon&lon = lon           ; update coordinates
forrest@0
    32
forrest@0
    33
  x!0  = "lat"
forrest@0
    34
  x!1  = "lon"
forrest@0
    35
  x&lat=  lat
forrest@0
    36
  x&lon=  lon
forrest@0
    37
forrest@0
    38
  c->LAI  = x 
forrest@0
    39
end
forrest@0
    40