1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/npp/14.scatter_bias.ncl Mon Jan 26 22:08:20 2009 -0500
1.3 @@ -0,0 +1,57 @@
1.4 +; ***********************************************
1.5 +; xy_4.ncl
1.6 +; ***********************************************
1.7 +load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
1.8 +load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
1.9 +load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
1.10 +;************************************************
1.11 +begin
1.12 +;************************************************
1.13 +; read in data
1.14 +;************************************************
1.15 + g = addfile ("data.81.nc","r")
1.16 +;g = addfile ("data.933.nc","r")
1.17 + c = g->TNPP_C
1.18 +;c = g->ANPP_C
1.19 +;c = g->BNPP_C
1.20 + xo = g->LONG_DD
1.21 + yo = g->LAT_DD
1.22 +
1.23 +;print (c)
1.24 +
1.25 + nx = dimsizes(xo)
1.26 + do i= 0,nx-1
1.27 + if (xo(i) .lt. 0.) then
1.28 + xo(i) = xo(i)+ 360.
1.29 + end if
1.30 + end do
1.31 +;print (xo)
1.32 +
1.33 + f = addfile ("i01.03cn_1545-1569_ANN_climo.nc","r")
1.34 +;f = addfile ("i01.04casa_1605-1629_ANN_climo.nc","r")
1.35 + b = f->NPP
1.36 +;b = f->AGNPP
1.37 +;b = f->BGNPP
1.38 + xi = f->lon
1.39 + yi = f->lat
1.40 +
1.41 + sec_to_year = 86400.*365.
1.42 +
1.43 + bo = linint2_points(xi,yi,b,True,xo,yo,0) * sec_to_year
1.44 +;print (bo)
1.45 +
1.46 + ccr = esccr(bo,c,0)
1.47 + print (ccr)
1.48 +
1.49 +;old eq
1.50 +;bias = sum(((bo(0,:)-c(:))/c(:))^2)
1.51 +;M = (1. - sqrt(bias/nx))*5.
1.52 +
1.53 +;new eq
1.54 + bias = sum(abs(bo(0,:)-c(:))/(bo(0,:)+c(:)))
1.55 + M = (1. - (bias/nx))*5.
1.56 +
1.57 + print (bias)
1.58 + print (M)
1.59 +
1.60 +end