npp/51.zonavg_ob2.ncl
author Forrest Hoffman <forrest@climatemodeling.org>
Mon, 26 Jan 2009 22:08:20 -0500
changeset 0 0c6405ab2ff4
permissions -rw-r--r--
Initial commit of C-LAMP Diagnostics from Jeff Lee
     1 ; ***********************************************
     2 ; xy_1.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  f     = addfile ("Npp_T42_mean.nc","r")
    13  u     = f->NPP
    14 ;************************************************
    15 ; read in model data
    16 ;************************************************
    17  g     = addfile ("i01.03cn_1545-1569_ANN_climo.nc","r")
    18  x     = g->NPP
    19  lat   = g->lat
    20  lon   = g->lon
    21 
    22  delta = 0.00000000001
    23  x0    = x(0,:,:)
    24  u = where(ismissing(u).and.(ismissing(x0).or.(x0.lt.delta)),0.,u)
    25 
    26 ; do j = 0,dimsizes(lat)-1
    27 ; do i = 0,dimsizes(lon)-1     
    28 ;    print(u(j,i))
    29 ;    print(x(0,j,i))
    30 ;    if (ismissing(u(j,i)) .and. (ismissing(x(0,j,i)).or. \
    31 ;                                 x(0,j,i) .lt. 0.00000000001)) then
    32 ;       u(j,i) = 0.
    33 ;    end if
    34 ; end do
    35 ; end do
    36 
    37  v     = zonalAve(u)
    38 
    39  v@long_name = "NPP (gC/m2/year)"        
    40 ;************************************************
    41 ; plotting parameters
    42 ;************************************************
    43  wks   = gsn_open_wks ("png","xy")                
    44 
    45  res                  = True                              
    46  res@tiMainString     = "Observed MODIS MOD 17"         
    47 
    48  plot  = gsn_csm_xy (wks,v&lat,v,res) 
    49 end