npp/41.correlation.ncl
changeset 0 0c6405ab2ff4
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/npp/41.correlation.ncl	Mon Jan 26 22:08:20 2009 -0500
     1.3 @@ -0,0 +1,49 @@
     1.4 +; ***********************************************
     1.5 +; xy_4.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 +;************************************************
    1.10 +begin
    1.11 +;************************************************
    1.12 +; read in data
    1.13 +;************************************************
    1.14 + g     = addfile ("data.81.nc","r")
    1.15 + a     = g->SITE_ID  
    1.16 + xo    = g->LONG_DD  
    1.17 + yo    = g->LAT_DD
    1.18 +;c     = g->TNPP_C
    1.19 +;c     = g->ANPP_C
    1.20 + c     = g->BNPP_C   
    1.21 +
    1.22 + print (xo)
    1.23 + nx = dimsizes(xo)
    1.24 + do i= 0,nx-1
    1.25 +    if (xo(i) .lt. 0.) then
    1.26 +        xo(i) = xo(i)+ 360.
    1.27 +    end if
    1.28 + end do
    1.29 + print (xo)
    1.30 +
    1.31 + a@long_name = "SITE_ID"
    1.32 + 
    1.33 + f     = addfile ("i01.03cn_1545-1569_ANN_climo.nc","r")
    1.34 +;f     = addfile ("i01.04casa_1605-1629_ANN_climo.nc","r")
    1.35 +;b     = f->NPP
    1.36 +;b     = f->AGNPP
    1.37 + b     = f->BGNPP    
    1.38 + xi    = f->lon     
    1.39 + yi    = f->lat      
    1.40 +
    1.41 + sec_to_year = 86400.*365.
    1.42 +
    1.43 + bo = linint2_points(xi,yi,b,True,xo,yo,0) * sec_to_year
    1.44 +;print (bo)
    1.45 +
    1.46 + bo@long_name = "NPP (gC/m2/year)"
    1.47 + 
    1.48 + ccr = esccr(bo,c,0)
    1.49 +
    1.50 + print (ccr)
    1.51 +
    1.52 +end