npp/51.zonavg_ob2.ncl
changeset 0 0c6405ab2ff4
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/npp/51.zonavg_ob2.ncl	Mon Jan 26 22:08:20 2009 -0500
     1.3 @@ -0,0 +1,49 @@
     1.4 +; ***********************************************
     1.5 +; xy_1.ncl
     1.6 +; ***********************************************
     1.7 +load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
     1.8 +load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"  
     1.9 +load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"  
    1.10 +;************************************************
    1.11 +begin
    1.12 +;************************************************
    1.13 +; read in data
    1.14 +;************************************************
    1.15 + f     = addfile ("Npp_T42_mean.nc","r")
    1.16 + u     = f->NPP
    1.17 +;************************************************
    1.18 +; read in model data
    1.19 +;************************************************
    1.20 + g     = addfile ("i01.03cn_1545-1569_ANN_climo.nc","r")
    1.21 + x     = g->NPP
    1.22 + lat   = g->lat
    1.23 + lon   = g->lon
    1.24 +
    1.25 + delta = 0.00000000001
    1.26 + x0    = x(0,:,:)
    1.27 + u = where(ismissing(u).and.(ismissing(x0).or.(x0.lt.delta)),0.,u)
    1.28 +
    1.29 +; do j = 0,dimsizes(lat)-1
    1.30 +; do i = 0,dimsizes(lon)-1     
    1.31 +;    print(u(j,i))
    1.32 +;    print(x(0,j,i))
    1.33 +;    if (ismissing(u(j,i)) .and. (ismissing(x(0,j,i)).or. \
    1.34 +;                                 x(0,j,i) .lt. 0.00000000001)) then
    1.35 +;       u(j,i) = 0.
    1.36 +;    end if
    1.37 +; end do
    1.38 +; end do
    1.39 +
    1.40 + v     = zonalAve(u)
    1.41 +
    1.42 + v@long_name = "NPP (gC/m2/year)"        
    1.43 +;************************************************
    1.44 +; plotting parameters
    1.45 +;************************************************
    1.46 + wks   = gsn_open_wks ("png","xy")                
    1.47 +
    1.48 + res                  = True                              
    1.49 + res@tiMainString     = "Observed MODIS MOD 17"         
    1.50 +
    1.51 + plot  = gsn_csm_xy (wks,v&lat,v,res) 
    1.52 +end
    1.53 \ No newline at end of file