diff -r 000000000000 -r 0c6405ab2ff4 npp/14.scatter_bias.ncl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/npp/14.scatter_bias.ncl Mon Jan 26 22:08:20 2009 -0500 @@ -0,0 +1,57 @@ +; *********************************************** +; xy_4.ncl +; *********************************************** +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 +;************************************************ +; read in data +;************************************************ + g = addfile ("data.81.nc","r") +;g = addfile ("data.933.nc","r") + c = g->TNPP_C +;c = g->ANPP_C +;c = g->BNPP_C + xo = g->LONG_DD + yo = g->LAT_DD + +;print (c) + + nx = dimsizes(xo) + do i= 0,nx-1 + if (xo(i) .lt. 0.) then + xo(i) = xo(i)+ 360. + end if + end do +;print (xo) + + f = addfile ("i01.03cn_1545-1569_ANN_climo.nc","r") +;f = addfile ("i01.04casa_1605-1629_ANN_climo.nc","r") + b = f->NPP +;b = f->AGNPP +;b = f->BGNPP + xi = f->lon + yi = f->lat + + sec_to_year = 86400.*365. + + bo = linint2_points(xi,yi,b,True,xo,yo,0) * sec_to_year +;print (bo) + + ccr = esccr(bo,c,0) + print (ccr) + +;old eq +;bias = sum(((bo(0,:)-c(:))/c(:))^2) +;M = (1. - sqrt(bias/nx))*5. + +;new eq + bias = sum(abs(bo(0,:)-c(:))/(bo(0,:)+c(:))) + M = (1. - (bias/nx))*5. + + print (bias) + print (M) + +end