forrest@0: ;************************************************ forrest@0: ; read from /ptmp/ forrest@0: ; output fire(COL_FIRE_CLOSS), NPP, NEE forrest@0: ;************************************************ 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: ; input data forrest@0: forrest@0: model_name = "i01.10cn" forrest@0: forrest@0: nlat = 64 forrest@0: nlon = 128 forrest@0: forrest@0: year_start = 1991 forrest@0: year_end = 2004 forrest@0: forrest@0: diri = "/ptmp/jeff/"+model_name+"/" forrest@0: forrest@0: system("mkdir "+diri) forrest@0: forrest@0: ; output forrest@0: forrest@0: diro = "/ptmp/jeff/" forrest@0: filo = model_name + "_Fire_C_"+year_start+"-"+year_end+"_monthly.nc" forrest@0: c = addfile(diro+filo,"c") forrest@0: filedimdef(c,"year",-1,True) forrest@0: forrest@0: forrest@0: nyear = year_end - year_start + 1 forrest@0: nmonth = 12 forrest@0: forrest@0: data1 = new((/nyear,nmonth,nlat,nlon/),float) forrest@0: data2 = new((/nyear,nmonth,nlat,nlon/),float) forrest@0: data3 = new((/nyear,nmonth,nlat,nlon/),float) forrest@0: date = new((/nyear,nmonth/),integer) forrest@0: forrest@0: ; input from /ptmp/ forrest@0: forrest@0: forrest@0: do m = 0,nyear-1 forrest@0: year = year_start + m forrest@0: forrest@0: ; text = "mss:/FORREST/CCSM/results/"+model_name+"/lnd/hist/*"+year+"* " forrest@0: ; print (text) forrest@0: forrest@0: ; system("msrcp "+text+diri) forrest@0: ; system("dcswait") forrest@0: print (year) forrest@0: forrest@0: do n = 0,nmonth-1 forrest@0: nn = n+1 forrest@0: date(m,n) = year*100 +nn forrest@0: forrest@0: ; input file forrest@0: if (nn .ge. 10) then forrest@0: fili = model_name+".clm2.h0."+year+"-"+nn+".nc" forrest@0: else forrest@0: fili = model_name+".clm2.h0."+year+"-0"+nn+".nc" forrest@0: end if forrest@0: forrest@0: ; print (fili) forrest@0: forrest@0: g = addfile (diri+fili,"r") forrest@0: forrest@0: b1 = g->COL_FIRE_CLOSS forrest@0: data1(m,n,:,:) = (/b1(0,:,:)/) forrest@0: forrest@0: b2 = g->NPP forrest@0: data2(m,n,:,:) = (/b2(0,:,:)/) forrest@0: forrest@0: b3 = g->NEE forrest@0: data3(m,n,:,:) = (/b3(0,:,:)/) forrest@0: forrest@0: end do forrest@0: forrest@0: ; system("rm "+diri+"*") forrest@0: forrest@0: end do forrest@0: forrest@0: ; name dimensions and assign coordinate variables forrest@0: forrest@0: data1!0 ="year" forrest@0: data1!1 ="month" forrest@0: data1!2 = "lat" forrest@0: data1!3 = "lon" forrest@0: data1@long_name = b1@long_name forrest@0: data1@units = b1@units forrest@0: data1@_FillValue = b1@_FillValue forrest@0: forrest@0: data2!0 ="year" forrest@0: data2!1 ="month" forrest@0: data2!2 = "lat" forrest@0: data2!3 = "lon" forrest@0: data2@long_name = b2@long_name forrest@0: data2@units = b2@units forrest@0: data2@_FillValue = b2@_FillValue forrest@0: forrest@0: data3!0 ="year" forrest@0: data3!1 ="month" forrest@0: data3!2 = "lat" forrest@0: data3!3 = "lon" forrest@0: data3@long_name = b3@long_name forrest@0: data3@units = b3@units forrest@0: data3@_FillValue = b3@_FillValue forrest@0: forrest@0: date!0 ="year" forrest@0: date!1 ="month" forrest@0: date@long_name = "date: yyyymm" forrest@0: forrest@0: c->COL_FIRE_CLOSS = data1 forrest@0: c->NPP = data2 forrest@0: c->NEE = data3 forrest@0: c->date = date forrest@0: c->area = g->area forrest@0: forrest@0: print (date) forrest@0: forrest@0: end