1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/lai/02.read_byte_LAI.ncl Mon Jan 26 22:08:20 2009 -0500
1.3 @@ -0,0 +1,40 @@
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 + diro = "/fis/cgd/cseg/people/jeff/clamp_data/"
1.17 + filo = "LAI_2000001_3.nc"
1.18 + c = addfile(diro+filo,"c")
1.19 +
1.20 + y = a->Lai_0_05deg
1.21 +
1.22 + y@_FillValue = inttobyte(253)
1.23 + y@_FillValue = inttobyte(255)
1.24 +
1.25 + x = byte2flt(y)
1.26 +
1.27 +; x@_FillValue = -17281 ; orig fill
1.28 + x@_FillValue = 1.e+36 ; new fill
1.29 +
1.30 + lat = latGlobeFo(nlat, "lat", "latitude", "degrees_north")
1.31 + lat = (/ lat(::-1) /) ; make N->S
1.32 + lon = lonGlobeFo(mlon, "lon", "longitude", "degrees_east")
1.33 + lon = (/ lon - 180. /) ; subtract 180 from all values
1.34 + lon&lon = lon ; update coordinates
1.35 +
1.36 + x!0 = "lat"
1.37 + x!1 = "lon"
1.38 + x&lat= lat
1.39 + x&lon= lon
1.40 +
1.41 + c->LAI = x
1.42 +end
1.43 +