diff -r 000000000000 -r 0c6405ab2ff4 npp/03.0.05deg_to_T42.ncl.0 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/npp/03.0.05deg_to_T42.ncl.0 Mon Jan 26 22:08:20 2009 -0500 @@ -0,0 +1,77 @@ +; *********************************************** +; interpolate into model grids (T31) +; *********************************************** +load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" +load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" +load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" +;************************************************ +begin +;************************************************ +; output data +;************************************************ + diro = "/fis/cgd/cseg/people/jeff/clamp/" + filo = "Npp_T31_mean.nc" + c = addfile(diro+filo,"c") + +;************************************************ +; read in observed data +;************************************************ + g = addfile ("Npp_0.05deg_mean.nc","r") + bi = g->NPP + xi = g->lon + yi = g->lat + +;************************************************ +; change into 0-360E, 90S-90N +; Observed NPP*scale_factor +;************************************************ + + scale_factor = 0.1 + + yi = (/ yi(::-1) /) + bi = (/ bi(::-1,:) /) + b2 = bi + x2 = xi + + nx = dimsizes(xi) + do i= 0,nx-1 + if (i .lt. 3600) then + p = i + 3600 + xi(p) = x2(i) + 360. + else + p = i - 3600 + xi(p) = x2(i) + end if + bi(:,p)= b2(:,i) * scale_factor + end do + +;print (xi) +;print (yi) +;exit + +;************************************************ +; read in model data +;************************************************ + f = addfile ("i01.03cn_1545-1569_ANN_climo.nc","r") +;f = addfile ("i01.04casa_1605-1629_ANN_climo.nc","r") + + xo = f->lon + yo = f->lat + +; print (xi) +; print (yi) +; print (xo) +; print (yo) + + bo = linint2_Wrap(xi,yi,bi,True,xo,yo,0) + + bo!0 = "lat" + bo!1 = "lon" + bo&lat = yo + bo&lon = xo + bo@units = bi@units + bo@long_name = bi@long_name + bo@_FillValue = bi@_FillValue + + c->NPP = bo +end \ No newline at end of file