1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/lai/31.contour_ob_grow.ncl Mon Jan 26 22:08:20 2009 -0500
1.3 @@ -0,0 +1,81 @@
1.4 +;*************************************************
1.5 +; ce_1.ncl
1.6 +;************************************************
1.7 +load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
1.8 +load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
1.9 +load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
1.10 +;************************************************
1.11 +begin
1.12 +;************************************************
1.13 +; read in observed data
1.14 +;************************************************
1.15 + diri = "/fis/cgd/cseg/people/jeff/clamp_data/lai/"
1.16 + fili = "LAI_2000-2005_ensemble_T42.nc"
1.17 + f = addfile(diri+fili,"r")
1.18 +
1.19 + z = f->LAI
1.20 + y = z(0,:,:)
1.21 + y@long_name = "Days of Growing Season"
1.22 +
1.23 + dsizes_z = dimsizes(z)
1.24 + ntime = dsizes_z(0)
1.25 + nlat = dsizes_z(1)
1.26 + nlon = dsizes_z(2)
1.27 +
1.28 + day_of_data = (/31,28,31,30,31,30,31,31,30,31,30,31/)
1.29 +
1.30 + do j = 0,nlat-1
1.31 + do i = 0,nlon-1
1.32 + nday = 0.
1.33 + do k = 0,ntime-1
1.34 + if (.not. ismissing(z(k,j,i)) .and. z(k,j,i) .gt. 1.0) then
1.35 + nday = nday + day_of_data(k)
1.36 + end if
1.37 + end do
1.38 + y(j,i) = nday
1.39 + end do
1.40 + end do
1.41 +
1.42 + print (min(y)+"/"+max(y))
1.43 +
1.44 +;************************************************
1.45 +; read in model data
1.46 +;************************************************
1.47 + diri2 = "/fis/cgd/cseg/people/jeff/clamp_data/model/"
1.48 + fili2 = "i01.03cn_1545-1569_ANN_climo.nc"
1.49 + g = addfile(diri2+fili2,"r")
1.50 + x = g->TLAI
1.51 +
1.52 + delta = 0.000001
1.53 + x0 = x(0,:,:)
1.54 + y = where(ismissing(y).and.(ismissing(x0).or.(x0.lt.delta)),y@_FillValue,y)
1.55 +;************************************************
1.56 +; create default plot
1.57 +;************************************************
1.58 +
1.59 + wks = gsn_open_wks("ps","xy") ; open a ps file
1.60 + gsn_define_colormap(wks,"gui_default") ; choose colormap
1.61 +
1.62 + res = True ; Use plot options
1.63 + res@cnFillOn = True ; Turn on color fill
1.64 + res@gsnSpreadColors = True ; use full colormap
1.65 +; res@cnFillMode = "RasterFill" ; Turn on raster color
1.66 +; res@lbLabelAutoStride = True
1.67 + res@cnLinesOn = False ; Turn off contourn lines
1.68 + res@mpFillOn = False ; Turn off map fill
1.69 + res@tiMainString = "MODIS MOD 15A2 2000-2005"
1.70 +
1.71 + res@gsnSpreadColors = True ; use full colormap
1.72 + res@cnLevelSelectionMode = "ManualLevels" ; Manual contour invtervals
1.73 + res@cnMinLevelValF = 0. ; Min level
1.74 + res@cnMaxLevelValF = 390. ; Max level
1.75 + res@cnLevelSpacingF = 30. ; interval
1.76 +
1.77 +; pres = True ; panel plot mods desired
1.78 +; pres@gsnMaximize = True ; fill the page
1.79 +
1.80 + plot = gsn_csm_contour_map_ce(wks,y,res) ; for observed
1.81 +
1.82 +; gsn_panel(wks,plot,(/1,1/),pres) ; create panel plot
1.83 + system("convert xy.ps xy.png")
1.84 +end
1.85 \ No newline at end of file