npp/41.correlation.ncl
changeset 0 0c6405ab2ff4
equal deleted inserted replaced
-1:000000000000 0:2ddc18419819
       
     1 ; ***********************************************
       
     2 ; xy_4.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 ;************************************************
       
     7 begin
       
     8 ;************************************************
       
     9 ; read in data
       
    10 ;************************************************
       
    11  g     = addfile ("data.81.nc","r")
       
    12  a     = g->SITE_ID  
       
    13  xo    = g->LONG_DD  
       
    14  yo    = g->LAT_DD
       
    15 ;c     = g->TNPP_C
       
    16 ;c     = g->ANPP_C
       
    17  c     = g->BNPP_C   
       
    18 
       
    19  print (xo)
       
    20  nx = dimsizes(xo)
       
    21  do i= 0,nx-1
       
    22     if (xo(i) .lt. 0.) then
       
    23         xo(i) = xo(i)+ 360.
       
    24     end if
       
    25  end do
       
    26  print (xo)
       
    27 
       
    28  a@long_name = "SITE_ID"
       
    29  
       
    30  f     = addfile ("i01.03cn_1545-1569_ANN_climo.nc","r")
       
    31 ;f     = addfile ("i01.04casa_1605-1629_ANN_climo.nc","r")
       
    32 ;b     = f->NPP
       
    33 ;b     = f->AGNPP
       
    34  b     = f->BGNPP    
       
    35  xi    = f->lon     
       
    36  yi    = f->lat      
       
    37 
       
    38  sec_to_year = 86400.*365.
       
    39 
       
    40  bo = linint2_points(xi,yi,b,True,xo,yo,0) * sec_to_year
       
    41 ;print (bo)
       
    42 
       
    43  bo@long_name = "NPP (gC/m2/year)"
       
    44  
       
    45  ccr = esccr(bo,c,0)
       
    46 
       
    47  print (ccr)
       
    48 
       
    49 end