forrest@0: ; *********************************************** forrest@0: ; xy_4.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 data forrest@0: ;************************************************ forrest@0: g = addfile ("data.81.nc","r") forrest@0: a = g->SITE_ID forrest@0: xo = g->LONG_DD forrest@0: yo = g->LAT_DD forrest@0: c = g->TNPP_C forrest@0: ;c = g->ANPP_C forrest@0: ;c = g->BNPP_C forrest@0: cp = g->PREC_ANN forrest@0: do i= 0,dimsizes(cp)-1 forrest@0: if (ismissing(cp(i))) then forrest@0: cp (i) = 100 forrest@0: end if forrest@0: end do forrest@0: d = int2flt(c)/int2flt(cp) forrest@0: print (d) forrest@0: forrest@0: nx = dimsizes(xo) forrest@0: do i= 0,nx-1 forrest@0: if (xo(i) .lt. 0.) then forrest@0: xo(i) = xo(i)+ 360. forrest@0: end if forrest@0: end do forrest@0: ;print (xo) 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: b = f->NPP forrest@0: ;b = f->AGNPP forrest@0: ;b = f->BGNPP forrest@0: xi = f->lon forrest@0: yi = f->lat forrest@0: bp = f->RAIN forrest@0: forrest@0: sec_to_year = 86400.*365. forrest@0: forrest@0: bo = linint2_points(xi,yi,b,True,xo,yo,0) * sec_to_year forrest@0: ;print (bo) forrest@0: bq = linint2_points(xi,yi,bp,True,xo,yo,0) * sec_to_year forrest@0: forrest@0: bo = bo/bq forrest@0: forrest@0: ccr = esccr(bo,d,0) forrest@0: print (ccr) forrest@0: bias = sum(((bo(0,:)-d(:))/d(:))^2) forrest@0: print (bias) forrest@0: M = 1. - sqrt(bias/nx) forrest@0: print (M) forrest@0: forrest@0: end