forrest@0: load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" forrest@0: load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" forrest@0: load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" forrest@0: forrest@0: begin forrest@0: ;---------------------------------------------------------- forrest@0: year_start = 2000 forrest@0: year_end = 2005 forrest@0: ;---------------------------------------------------------- forrest@0: diri = "/fis/cgd/cseg/people/jeff/clamp_data/" forrest@0: diro = "/fis/cgd/cseg/people/jeff/clamp_data/" forrest@0: filo1 = "MOD15A2_LAI_"+year_start+"-"+year_end+"_ensemble.nc" forrest@0: filo2 = "MOD15A2_LAI_"+year_start+"-"+year_end+"_mean.nc" forrest@0: c = addfile(diro+filo1,"c") forrest@0: d = addfile(diro+filo2,"c") forrest@0: forrest@0: nyear = year_end - year_start + 1 forrest@0: forrest@0: files = new((/nyear/),"string") forrest@0: forrest@0: do n = year_start,year_end forrest@0: i = n - year_start forrest@0: ; files(i)= diri + "MOD15A2_LAI_" + n + "_monthly.nc" forrest@0: files(i)= diri + "MOD15A2_LAI_" + n + "_monthly_T42.nc" forrest@0: end do forrest@0: print (files) forrest@0: forrest@0: file_list = addfiles(files,"r") forrest@0: ListSetType(file_list,"join") forrest@0: x = addfiles_GetVar(file_list, files, "LAI") forrest@0: printVarSummary (x) forrest@0: forrest@0: y = addfiles_GetVar(file_list, files, "time") forrest@0: time = y(0,:) forrest@0: delete(time@case) forrest@0: delete(y) forrest@0: printVarSummary (time) forrest@0: forrest@0: y = addfiles_GetVar(file_list, files, "lat") forrest@0: lat = y(0,:) forrest@0: delete(lat@case) forrest@0: delete(y) forrest@0: printVarSummary (lat) forrest@0: forrest@0: y = addfiles_GetVar(file_list, files, "lon") forrest@0: lon = y(0,:) forrest@0: delete(lon@case) forrest@0: delete(y) forrest@0: printVarSummary (lon) forrest@0: forrest@0: x!0 = "case" forrest@0: x!1 = "time" forrest@0: x!2 = "lat" forrest@0: x!3 = "lon" forrest@0: forrest@0: y = dim_avg(x(time|:,lat|:,lon|:,case|:)) forrest@0: forrest@0: y!0 = "time" forrest@0: y!1 = "lat" forrest@0: y!2 = "lon" forrest@0: y&time = time forrest@0: y&lat = lat forrest@0: y&lon = lon forrest@0: y@units = "none" forrest@0: y@long_name = "Leaf Area Index" forrest@0: printVarSummary (y) forrest@0: forrest@0: c->LAI = y forrest@0: forrest@0: z = dim_avg(y(lat|:,lon|:,time|:)) forrest@0: forrest@0: z!0 = "lat" forrest@0: z!1 = "lon" forrest@0: z&lat = lat forrest@0: z&lon = lon forrest@0: z@units = "none" forrest@0: z@long_name = "Leaf Area Index" forrest@0: printVarSummary (z) forrest@0: forrest@0: d->LAI = z forrest@0: end forrest@0: