forrest@0: ;************************************************* forrest@0: ; ce_1.ncl forrest@0: ;************************************************ forrest@0: load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" forrest@0: load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" forrest@0: load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" forrest@0: ;************************************************ forrest@0: begin forrest@0: ;************************************************ forrest@0: ; read in observed data forrest@0: ;************************************************ forrest@0: diri = "/fis/cgd/cseg/people/jeff/clamp_data/lai/" forrest@0: fili = "LAI_2000-2005_ensemble_T42.nc" forrest@0: f = addfile(diri+fili,"r") forrest@0: forrest@0: z = f->LAI forrest@0: y = z(0,:,:) forrest@0: y@long_name = "Days of Growing Season" forrest@0: forrest@0: dsizes_z = dimsizes(z) forrest@0: ntime = dsizes_z(0) forrest@0: nlat = dsizes_z(1) forrest@0: nlon = dsizes_z(2) forrest@0: forrest@0: day_of_data = (/31,28,31,30,31,30,31,31,30,31,30,31/) forrest@0: forrest@0: do j = 0,nlat-1 forrest@0: do i = 0,nlon-1 forrest@0: nday = 0. forrest@0: do k = 0,ntime-1 forrest@0: if (.not. ismissing(z(k,j,i)) .and. z(k,j,i) .gt. 1.0) then forrest@0: nday = nday + day_of_data(k) forrest@0: end if forrest@0: end do forrest@0: y(j,i) = nday forrest@0: end do forrest@0: end do forrest@0: forrest@0: print (min(y)+"/"+max(y)) forrest@0: forrest@0: ;************************************************ forrest@0: ; read in model data forrest@0: ;************************************************ forrest@0: diri2 = "/fis/cgd/cseg/people/jeff/clamp_data/model/" forrest@0: fili2 = "i01.03cn_1545-1569_ANN_climo.nc" forrest@0: g = addfile(diri2+fili2,"r") forrest@0: x = g->TLAI forrest@0: forrest@0: delta = 0.000001 forrest@0: x0 = x(0,:,:) forrest@0: y = where(ismissing(y).and.(ismissing(x0).or.(x0.lt.delta)),y@_FillValue,y) forrest@0: ;************************************************ forrest@0: ; create default plot forrest@0: ;************************************************ forrest@0: forrest@0: wks = gsn_open_wks("ps","xy") ; open a ps file forrest@0: gsn_define_colormap(wks,"gui_default") ; choose colormap forrest@0: forrest@0: res = True ; Use plot options forrest@0: res@cnFillOn = True ; Turn on color fill forrest@0: res@gsnSpreadColors = True ; use full colormap forrest@0: ; res@cnFillMode = "RasterFill" ; Turn on raster color forrest@0: ; res@lbLabelAutoStride = True forrest@0: res@cnLinesOn = False ; Turn off contourn lines forrest@0: res@mpFillOn = False ; Turn off map fill forrest@0: res@tiMainString = "MODIS MOD 15A2 2000-2005" forrest@0: forrest@0: res@gsnSpreadColors = True ; use full colormap forrest@0: res@cnLevelSelectionMode = "ManualLevels" ; Manual contour invtervals forrest@0: res@cnMinLevelValF = 0. ; Min level forrest@0: res@cnMaxLevelValF = 390. ; Max level forrest@0: res@cnLevelSpacingF = 30. ; interval forrest@0: forrest@0: ; pres = True ; panel plot mods desired forrest@0: ; pres@gsnMaximize = True ; fill the page forrest@0: forrest@0: plot = gsn_csm_contour_map_ce(wks,y,res) ; for observed forrest@0: forrest@0: ; gsn_panel(wks,plot,(/1,1/),pres) ; create panel plot forrest@0: system("convert xy.ps xy.png") forrest@0: end