npp/51.zonavg_ob2.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_1.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
 f     = addfile ("Npp_T42_mean.nc","r")
forrest@0
    13
 u     = 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
 x     = g->NPP
forrest@0
    19
 lat   = g->lat
forrest@0
    20
 lon   = g->lon
forrest@0
    21
forrest@0
    22
 delta = 0.00000000001
forrest@0
    23
 x0    = x(0,:,:)
forrest@0
    24
 u = where(ismissing(u).and.(ismissing(x0).or.(x0.lt.delta)),0.,u)
forrest@0
    25
forrest@0
    26
; do j = 0,dimsizes(lat)-1
forrest@0
    27
; do i = 0,dimsizes(lon)-1     
forrest@0
    28
;    print(u(j,i))
forrest@0
    29
;    print(x(0,j,i))
forrest@0
    30
;    if (ismissing(u(j,i)) .and. (ismissing(x(0,j,i)).or. \
forrest@0
    31
;                                 x(0,j,i) .lt. 0.00000000001)) then
forrest@0
    32
;       u(j,i) = 0.
forrest@0
    33
;    end if
forrest@0
    34
; end do
forrest@0
    35
; end do
forrest@0
    36
forrest@0
    37
 v     = zonalAve(u)
forrest@0
    38
forrest@0
    39
 v@long_name = "NPP (gC/m2/year)"        
forrest@0
    40
;************************************************
forrest@0
    41
; plotting parameters
forrest@0
    42
;************************************************
forrest@0
    43
 wks   = gsn_open_wks ("png","xy")                
forrest@0
    44
forrest@0
    45
 res                  = True                              
forrest@0
    46
 res@tiMainString     = "Observed MODIS MOD 17"         
forrest@0
    47
forrest@0
    48
 plot  = gsn_csm_xy (wks,v&lat,v,res) 
forrest@0
    49
end