lai/04.lai_ensemble_T42.ncl.x
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
forrest@0
     1
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"  
forrest@0
     2
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"  
forrest@0
     3
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"  
forrest@0
     4
forrest@0
     5
begin 
forrest@0
     6
;----------------------------------------------------------
forrest@0
     7
  year_start = 2000
forrest@0
     8
  year_end   = 2005
forrest@0
     9
;----------------------------------------------------------
forrest@0
    10
  diri  = "/fis/cgd/cseg/people/jeff/clamp_data/"
forrest@0
    11
  diro  = "/fis/cgd/cseg/people/jeff/clamp_data/"
forrest@0
    12
  filo1 = "MOD15A2_LAI_"+year_start+"-"+year_end+"_ensemble.nc"
forrest@0
    13
  filo2 = "MOD15A2_LAI_"+year_start+"-"+year_end+"_mean.nc"
forrest@0
    14
  c = addfile(diro+filo1,"c")
forrest@0
    15
  d = addfile(diro+filo2,"c")
forrest@0
    16
forrest@0
    17
  nyear = year_end - year_start + 1
forrest@0
    18
forrest@0
    19
  files  = new((/nyear/),"string")
forrest@0
    20
forrest@0
    21
  do n = year_start,year_end
forrest@0
    22
     i = n - year_start
forrest@0
    23
;    files(i)= diri + "MOD15A2_LAI_" + n + "_monthly.nc"
forrest@0
    24
     files(i)= diri + "MOD15A2_LAI_" + n + "_monthly_T42.nc"
forrest@0
    25
  end do
forrest@0
    26
  print (files)  
forrest@0
    27
forrest@0
    28
  file_list = addfiles(files,"r")
forrest@0
    29
  ListSetType(file_list,"join")
forrest@0
    30
  x = addfiles_GetVar(file_list, files, "LAI")
forrest@0
    31
  printVarSummary (x)
forrest@0
    32
forrest@0
    33
  y = addfiles_GetVar(file_list, files, "time")
forrest@0
    34
  time = y(0,:)
forrest@0
    35
  delete(time@case)
forrest@0
    36
  delete(y)
forrest@0
    37
  printVarSummary (time)
forrest@0
    38
forrest@0
    39
  y = addfiles_GetVar(file_list, files, "lat")
forrest@0
    40
  lat = y(0,:)
forrest@0
    41
  delete(lat@case)
forrest@0
    42
  delete(y)
forrest@0
    43
  printVarSummary (lat)
forrest@0
    44
forrest@0
    45
  y = addfiles_GetVar(file_list, files, "lon")
forrest@0
    46
  lon = y(0,:)
forrest@0
    47
  delete(lon@case)
forrest@0
    48
  delete(y)
forrest@0
    49
  printVarSummary (lon)
forrest@0
    50
forrest@0
    51
  x!0  = "case"
forrest@0
    52
  x!1  = "time"
forrest@0
    53
  x!2  = "lat"
forrest@0
    54
  x!3  = "lon"
forrest@0
    55
forrest@0
    56
  y = dim_avg(x(time|:,lat|:,lon|:,case|:))
forrest@0
    57
forrest@0
    58
  y!0  = "time"
forrest@0
    59
  y!1  = "lat"
forrest@0
    60
  y!2  = "lon"
forrest@0
    61
  y&time = time
forrest@0
    62
  y&lat  = lat
forrest@0
    63
  y&lon  = lon
forrest@0
    64
  y@units     = "none"
forrest@0
    65
  y@long_name = "Leaf Area Index"
forrest@0
    66
  printVarSummary (y)
forrest@0
    67
forrest@0
    68
  c->LAI  = y
forrest@0
    69
forrest@0
    70
  z = dim_avg(y(lat|:,lon|:,time|:))
forrest@0
    71
forrest@0
    72
  z!0  = "lat"
forrest@0
    73
  z!1  = "lon"
forrest@0
    74
  z&lat  = lat
forrest@0
    75
  z&lon  = lon
forrest@0
    76
  z@units     = "none"
forrest@0
    77
  z@long_name = "Leaf Area Index"
forrest@0
    78
  printVarSummary (z)
forrest@0
    79
  
forrest@0
    80
  d->LAI  = z     
forrest@0
    81
end
forrest@0
    82