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