lai/02.read_byte_LAI.ncl.x
changeset 0 0c6405ab2ff4
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/lai/02.read_byte_LAI.ncl.x	Mon Jan 26 22:08:20 2009 -0500
     1.3 @@ -0,0 +1,54 @@
     1.4 +load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"  
     1.5 +load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"  
     1.6 +load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"  
     1.7 +
     1.8 +begin
     1.9 +  nlat  = 3600
    1.10 +  mlon  = 7200
    1.11 +
    1.12 +  diri  = "/fis/cgd/cseg/people/jeff/clamp_data/"
    1.13 +  fili  = "MOD15A2_GEO_2000001.nc"
    1.14 +  a  = addfile(diri+fili,"r")
    1.15 +
    1.16 +  y = a->Lai_0_05deg    ; byte
    1.17 +  y@_FillValue = inttobyte(253)
    1.18 +  y@_FillValue = inttobyte(255)
    1.19 +
    1.20 +  x = byte2flt(y)
    1.21 +  
    1.22 +  x@_FillValue =  1.e+36                     ; new fill
    1.23 +
    1.24 +  lat  = latGlobeFo(nlat, "lat", "latitude", "degrees_north")
    1.25 +  lat  = (/ lat(::-1) /)                     ; make N->S
    1.26 +  lon  = lonGlobeFo(mlon, "lon", "longitude", "degrees_east")
    1.27 +  lon  = (/ lon - 180. /) ; subtract 180 from all values 
    1.28 +  lon&lon = lon           ; update coordinates
    1.29 +
    1.30 +  x!0  = "lat"
    1.31 +  x!1  = "lon"
    1.32 +  x&lat=  lat
    1.33 +  x&lon=  lon
    1.34 +
    1.35 +  y!0  = "lat"
    1.36 +  y!1  = "lon"
    1.37 +  y&lat=  lat
    1.38 +  y&lon=  lon
    1.39 +
    1.40 +  iy   = new (dimsizes(y), "integer", -999)
    1.41 +  iy   = y
    1.42 +
    1.43 +  iy!0  = "lat"
    1.44 +  iy!1  = "lon"
    1.45 +  iy&lat=  lat
    1.46 +  iy&lon=  lon
    1.47 +
    1.48 +  print(y(:,{130})+"   "+ iy(:,{130})+"   "+x(:,{130}))
    1.49 +
    1.50 +
    1.51 +
    1.52 +; diro  = "/fis/cgd/cseg/people/jeff/clamp_data/"
    1.53 +; filo  = "LAI_2000001_2.nc"
    1.54 +; c = addfile(diro+filo,"c")
    1.55 +; c->LAI  = x 
    1.56 +end
    1.57 +