npp/14.scatter_bias.ncl
changeset 1 4be95183fbcd
equal deleted inserted replaced
-1:000000000000 0:0ec5ff04bf3e
       
     1 ; ***********************************************
       
     2 ; xy_4.ncl
       
     3 ; ***********************************************
       
     4 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
       
     5 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
       
     6 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
       
     7 ;************************************************
       
     8 begin
       
     9 ;************************************************
       
    10 ; read in data
       
    11 ;************************************************
       
    12  g     = addfile ("data.81.nc","r")
       
    13 ;g     = addfile ("data.933.nc","r")  
       
    14  c     = g->TNPP_C
       
    15 ;c     = g->ANPP_C
       
    16 ;c     = g->BNPP_C
       
    17  xo    = g->LONG_DD  
       
    18  yo    = g->LAT_DD   
       
    19 
       
    20 ;print (c)
       
    21 
       
    22  nx = dimsizes(xo)
       
    23  do i= 0,nx-1
       
    24     if (xo(i) .lt. 0.) then
       
    25         xo(i) = xo(i)+ 360.
       
    26     end if
       
    27  end do
       
    28 ;print (xo)
       
    29  
       
    30  f     = addfile ("i01.03cn_1545-1569_ANN_climo.nc","r")
       
    31 ;f     = addfile ("i01.04casa_1605-1629_ANN_climo.nc","r")
       
    32  b     = f->NPP
       
    33 ;b     = f->AGNPP
       
    34 ;b     = f->BGNPP    
       
    35  xi    = f->lon     
       
    36  yi    = f->lat      
       
    37 
       
    38  sec_to_year = 86400.*365.
       
    39 
       
    40  bo = linint2_points(xi,yi,b,True,xo,yo,0) * sec_to_year
       
    41 ;print (bo)
       
    42  
       
    43  ccr = esccr(bo,c,0)
       
    44  print (ccr)
       
    45 
       
    46 ;old eq
       
    47 ;bias = sum(((bo(0,:)-c(:))/c(:))^2)
       
    48 ;M    = (1. - sqrt(bias/nx))*5.
       
    49 
       
    50 ;new eq
       
    51  bias = sum(abs(bo(0,:)-c(:))/(bo(0,:)+c(:)))
       
    52  M    = (1. - (bias/nx))*5.
       
    53 
       
    54  print (bias)
       
    55  print (M)
       
    56 
       
    57 end