1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/npp/52.zonavg_to_T31.ncl Mon Jan 26 22:08:20 2009 -0500
1.3 @@ -0,0 +1,62 @@
1.4 +; ***********************************************
1.5 +; zonal average plot
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 observed data
1.14 +;************************************************
1.15 + g = addfile ("Npp_0.05deg_mean.nc","r")
1.16 + bi = g->NPP
1.17 + xi = g->lon
1.18 + yi = g->lat
1.19 + yi = (/ yi(::-1) /)
1.20 + bi = (/ bi(::-1,:) /)
1.21 + b2 = bi
1.22 + x2 = xi
1.23 +
1.24 + nx = dimsizes(xi)
1.25 + do i= 0,nx-1
1.26 + if (i .lt. 3600) then
1.27 + p = i + 3600
1.28 + xi(p) = x2(i) + 360.
1.29 + else
1.30 + p = i - 3600
1.31 + xi(p) = x2(i)
1.32 + end if
1.33 + bi(:,p)= b2(:,i)
1.34 + end do
1.35 +;print (xi)
1.36 +;print (yi)
1.37 +;exit
1.38 +
1.39 + f = addfile ("i01.03cn_1545-1569_ANN_climo.nc","r")
1.40 +;f = addfile ("i01.04casa_1605-1629_ANN_climo.nc","r")
1.41 +
1.42 + xo = f->lon
1.43 + yo = f->lat
1.44 +
1.45 + print (xi)
1.46 + print (yi)
1.47 + print (xo)
1.48 + print (yo)
1.49 +
1.50 + bo = linint2_Wrap(xi,yi,bi,True,xo,yo,0)
1.51 +
1.52 + v = zonalAve(bo)
1.53 +
1.54 + v@long_name = "NPP (gC/m2/year)"
1.55 +
1.56 +;************************************************
1.57 +; plotting parameters
1.58 +;************************************************
1.59 + wks = gsn_open_wks ("png","xy") ; open workstation
1.60 +
1.61 + res = True ; plot mods desired
1.62 + res@tiMainString = "Observed T31" ; add title
1.63 +
1.64 + plot = gsn_csm_xy (wks,v&lat,v,res)
1.65 +end