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: ; final output forrest@0: forrest@0: diro = "/fis/cgd/cseg/people/jeff/clamp_data/model/" forrest@0: filo = "class_pft_T31.nc" forrest@0: c = addfile(diro+filo,"c") forrest@0: forrest@0: ; read model data forrest@0: forrest@0: diri = "/fis/cgd/cseg/people/jeff/surface_data/" forrest@0: fili = "surfdata_48x96_c070501.nc" forrest@0: f = addfile(diri+fili,"r") forrest@0: forrest@0: y = f->PCT_PFT forrest@0: ; printVarSummary(y) forrest@0: forrest@0: ; read model grid data forrest@0: forrest@0: diri = "/fis/cgd/cseg/people/jeff/surface_data/" forrest@0: fili = "lnd_T31.nc" forrest@0: g = addfile(diri+fili,"r") forrest@0: forrest@0: landmask = g->landmask forrest@0: lat = g->lat forrest@0: lon = g->lon forrest@0: forrest@0: nlat = dimsizes(lat) forrest@0: nlon = dimsizes(lon) forrest@0: forrest@0: x = y(0,:,:) forrest@0: forrest@0: x!0 = "lat" forrest@0: x&lat = lat forrest@0: x!1 = "lon" forrest@0: x&lon = lon forrest@0: x@_FillValue = 1.e36 forrest@0: x@long_name = "Model PFT Classes" forrest@0: forrest@0: do j= 0,nlat-1 forrest@0: do i= 0,nlon-1 forrest@0: x(j,i) = maxind(y(:,j,i)) forrest@0: end do forrest@0: end do forrest@0: forrest@0: ; print (x) forrest@0: forrest@0: x = where(landmask .lt. 1.,x@_FillValue,x) forrest@0: forrest@0: c->CLASS_PFT = x forrest@0: c->lat = lat forrest@0: c->lon = lon forrest@0: forrest@0: end