npp/41.correlation.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
;************************************************
forrest@0
     7
begin
forrest@0
     8
;************************************************
forrest@0
     9
; read in data
forrest@0
    10
;************************************************
forrest@0
    11
 g     = addfile ("data.81.nc","r")
forrest@0
    12
 a     = g->SITE_ID  
forrest@0
    13
 xo    = g->LONG_DD  
forrest@0
    14
 yo    = g->LAT_DD
forrest@0
    15
;c     = g->TNPP_C
forrest@0
    16
;c     = g->ANPP_C
forrest@0
    17
 c     = g->BNPP_C   
forrest@0
    18
forrest@0
    19
 print (xo)
forrest@0
    20
 nx = dimsizes(xo)
forrest@0
    21
 do i= 0,nx-1
forrest@0
    22
    if (xo(i) .lt. 0.) then
forrest@0
    23
        xo(i) = xo(i)+ 360.
forrest@0
    24
    end if
forrest@0
    25
 end do
forrest@0
    26
 print (xo)
forrest@0
    27
forrest@0
    28
 a@long_name = "SITE_ID"
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
 bo@long_name = "NPP (gC/m2/year)"
forrest@0
    44
 
forrest@0
    45
 ccr = esccr(bo,c,0)
forrest@0
    46
forrest@0
    47
 print (ccr)
forrest@0
    48
forrest@0
    49
end