forrest@0: ; *********************************************** forrest@0: ; interpolate into model grids (T31) 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: ; output data forrest@0: ;************************************************ forrest@0: diro = "/fis/cgd/cseg/people/jeff/clamp/" forrest@0: filo = "Npp_T31_mean.nc" forrest@0: c = addfile(diro+filo,"c") forrest@0: forrest@0: ;************************************************ forrest@0: ; read in observed data forrest@0: ;************************************************ forrest@0: g = addfile ("Npp_0.05deg_mean.nc","r") forrest@0: bi = g->NPP forrest@0: xi = g->lon forrest@0: yi = g->lat forrest@0: forrest@0: ;************************************************ forrest@0: ; change into 0-360E, 90S-90N forrest@0: ; Observed NPP*scale_factor forrest@0: ;************************************************ forrest@0: forrest@0: scale_factor = 0.1 forrest@0: forrest@0: yi = (/ yi(::-1) /) forrest@0: bi = (/ bi(::-1,:) /) forrest@0: b2 = bi forrest@0: x2 = xi forrest@0: forrest@0: nx = dimsizes(xi) forrest@0: do i= 0,nx-1 forrest@0: if (i .lt. 3600) then forrest@0: p = i + 3600 forrest@0: xi(p) = x2(i) + 360. forrest@0: else forrest@0: p = i - 3600 forrest@0: xi(p) = x2(i) forrest@0: end if forrest@0: bi(:,p)= b2(:,i) * scale_factor forrest@0: end do forrest@0: forrest@0: ;print (xi) forrest@0: ;print (yi) forrest@0: ;exit forrest@0: forrest@0: ;************************************************ forrest@0: ; read in model data forrest@0: ;************************************************ forrest@0: f = addfile ("i01.03cn_1545-1569_ANN_climo.nc","r") forrest@0: ;f = addfile ("i01.04casa_1605-1629_ANN_climo.nc","r") forrest@0: forrest@0: xo = f->lon forrest@0: yo = f->lat forrest@0: forrest@0: ; print (xi) forrest@0: ; print (yi) forrest@0: ; print (xo) forrest@0: ; print (yo) forrest@0: forrest@0: bo = linint2_Wrap(xi,yi,bi,True,xo,yo,0) forrest@0: forrest@0: bo!0 = "lat" forrest@0: bo!1 = "lon" forrest@0: bo&lat = yo forrest@0: bo&lon = xo forrest@0: bo@units = bi@units forrest@0: bo@long_name = bi@long_name forrest@0: bo@_FillValue = bi@_FillValue forrest@0: forrest@0: c->NPP = bo forrest@0: end