npp/42.bias_zonal.nc
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 observed data
forrest@0
    11
;************************************************
forrest@0
    12
 f     = addfile ("Npp_T42_mean.nc","r")
forrest@0
    13
 y     = f->NPP
forrest@0
    14
;************************************************
forrest@0
    15
; read in model data
forrest@0
    16
;************************************************
forrest@0
    17
 g     = addfile ("i01.03cn_1545-1569_ANN_climo.nc","r")
forrest@0
    18
;g     = addfile ("i01.04casa_1605-1629_ANN_climo.nc","r")
forrest@0
    19
 x     = g->NPP
forrest@0
    20
forrest@0
    21
 delta = 0.00000000001
forrest@0
    22
 x0    = x(0,:,:)
forrest@0
    23
 y = where(ismissing(y).and.(ismissing(x0).or.(x0.lt.delta)),0.,y)
forrest@0
    24
forrest@0
    25
 p     = zonalAve(y)        
forrest@0
    26
forrest@0
    27
 sec_to_year = 86400.*365.
forrest@0
    28
 x0 = x0 * sec_to_year
forrest@0
    29
 q = zonalAve(x0)
forrest@0
    30
forrest@0
    31
 good = ind(p .ne. 0.)
forrest@0
    32
 u = p(good)
forrest@0
    33
 v = q(good)
forrest@0
    34
 
forrest@0
    35
 ccr = esccr(u,v,0)
forrest@0
    36
 print (ccr)
forrest@0
    37
 bias = sum(((v-u)/u)^2)
forrest@0
    38
 print (bias)
forrest@0
    39
 M    = 1.- sqrt(bias/dimsizes(u))
forrest@0
    40
 print (M)
forrest@0
    41
forrest@0
    42
end