From fb42ae04f854540c7c0fc4e1ed87b45cb1fb8c4d Mon Sep 17 00:00:00 2001 From: Marcos Longo Date: Tue, 2 Oct 2012 21:18:28 -0400 Subject: [PATCH 1/2] 1. Added more diagnostic variables (mostly radiation) 2. Several disturbance-related variables were not properly initialised, leading to some crazy values in the big leaf model whenever fires happened. 3. Changes in the R scripts. --- ED/Template/Template/plot_eval_ed.r | 732 ++++++++++++------- ED/Template/Template/plot_monthly.r | 127 ++-- ED/Template/bringlast.sh | 153 ++-- ED/Template/check_run.sh | 153 ++-- ED/Template/compare_results.r | 898 ++++++++++++++++++++++++ ED/Template/delall.sh | 153 ++-- ED/Template/epost.sh | 159 +++-- ED/Template/joborder.txt | 214 +++--- ED/Template/nc_check_run.sh | 153 ++-- ED/Template/nc_spawn.sh | 153 ++-- ED/Template/nc_submitter.sh | 153 ++-- ED/Template/reset.sh | 306 ++++---- ED/Template/spawn_poly.sh | 536 +++++++++----- ED/Template/stopalljobs.sh | 153 ++-- ED/Template/submitter.sh | 153 ++-- ED/src/dynamics/radiate_driver.f90 | 142 ++-- ED/src/dynamics/rk4_driver.F90 | 8 + ED/src/dynamics/vegetation_dynamics.f90 | 5 +- ED/src/init/ed_init.f90 | 2 +- ED/src/init/ed_params.f90 | 39 +- ED/src/init/ed_type_init.f90 | 76 +- ED/src/io/average_utils.f90 | 137 ++++ ED/src/io/ed_init_full_history.F90 | 122 +++- ED/src/io/edio.f90 | 8 + ED/src/memory/ed_max_dims.F90 | 4 +- ED/src/memory/ed_state_vars.f90 | 460 +++++++++++- RAPP/build/bin/dependency.mk | 10 +- RAPP/build/bin/generate_deps.sh | 6 +- RAPP/build/bin/include.mk.odyssey | 8 +- 29 files changed, 3695 insertions(+), 1528 deletions(-) create mode 100644 ED/Template/compare_results.r diff --git a/ED/Template/Template/plot_eval_ed.r b/ED/Template/Template/plot_eval_ed.r index b1c838f38..a684a7115 100644 --- a/ED/Template/Template/plot_eval_ed.r +++ b/ED/Template/Template/plot_eval_ed.r @@ -13,6 +13,7 @@ monthbeg = thismontha yearbeg = thisyeara # First year to consider yearend = thisyearz # Maximum year to consider myplaces = c("thispoly") +use.distrib = c("mydistrib") sasmonth.short = c(2,5,8,11) sasmonth.long = 5 nyears.long = 25 @@ -37,12 +38,18 @@ scalleg = 0.20 cex.main = 0.8 # Scale coefficient for the title hourblock.len = 3 # Length of the time blocks, in hours + # +n.quant = 1024 # Number of quantiles to produce the density function. + # We strongly advise to choose a number that is a power + # of two, especially when using EDF (otherwise + # distributions will be interpolated). #------------------------------------------------------------------------------------------# reload.data = TRUE # Reload data? #------------------------------------------------------------------------------------------# + #------------------------------------------------------------------------------------------# #------------------------------------------------------------------------------------------# #------------------------------------------------------------------------------------------# @@ -66,166 +73,105 @@ compvar = list() compvar[[ 1]] = list( vnam = "hflxca" , desc = "Sensible heat flux" , unit = "[W/m2]" - , col.obser = c("gray42","gray21") + , col.obser = c("grey42","grey21") , col.model = c("orange1","chocolate4") , leg.corner = "topleft" )#end list compvar[[ 2]] = list( vnam = "wflxca" , desc = "Water vapour flux" , unit = "[kg/m2/day]" - , col.obser = c("gray42","gray21") + , col.obser = c("grey42","grey21") , col.model = c("deepskyblue","royalblue4") , leg.corner = "topleft" )#end list compvar[[ 3]] = list( vnam = "cflxca" , desc = "Carbon dioxide flux" , unit = "[umol/m2/s]" - , col.obser = c("gray42","gray21") + , col.obser = c("grey42","grey21") , col.model = c("chartreuse2","darkgreen") , leg.corner = "bottomright" )#end list compvar[[ 4]] = list( vnam = "cflxst" , desc = "Carbon dioxide storage" , unit = "[umol/m2/s]" - , col.obser = c("gray42","gray21") + , col.obser = c("grey42","grey21") , col.model = c("lightgoldenrod3","darkorange1") , leg.corner = "topleft" )#end list compvar[[ 5]] = list( vnam = "gpp" , desc = "Gross primary productivity" , unit = "[kgC/m2/yr]" - , col.obser = c("gray42","gray21") + , col.obser = c("grey42","grey21") , col.model = c("green3","darkgreen") , leg.corner = "topleft" )#end list compvar[[ 6]] = list( vnam = "reco" , desc = "Ecosystem respiration" , unit = "[kgC/m2/yr]" - , col.obser = c("gray42","gray21") + , col.obser = c("grey42","grey21") , col.model = c("yellow3","peru") , leg.corner = "topleft" )#end list compvar[[ 7]] = list( vnam = "nep" , desc = "Net ecosystem productivity" , unit = "[kgC/m2/yr]" - , col.obser = c("gray42","gray21") + , col.obser = c("grey42","grey21") , col.model = c("olivedrab2","darkolivegreen4") , leg.corner = "topleft" )#end list compvar[[ 8]] = list( vnam = "nee" , desc = "Net ecosystem exchange" , unit = "[umol/m2/s]" - , col.obser = c("gray42","gray21") + , col.obser = c("grey42","grey21") , col.model = c("chartreuse","chartreuse4") , leg.corner = "bottomright" )#end list compvar[[ 9]] = list( vnam = "ustar" , desc = "Friction velocity" , unit = "[m/s]" - , col.obser = c("gray42","gray21") + , col.obser = c("grey42","grey21") , col.model = c("mediumpurple1","purple4") , leg.corner = "topleft" )#end list -#------------------------------------------------------------------------------------------# - - - -#------------------------------------------------------------------------------------------# -# Plot-level comparisons. # -#------------------------------------------------------------------------------------------# -plotvar = list() -plotvar[[ 1]] = list( vnam.ed = "recr" - , vnam.obs = "recr" - , desc = "Recruitment rate" - , unit = "[%pop/yr]" - , col.obser = c("gray42","gray21") - , col.model = "chartreuse4" +compvar[[10]] = list( vnam = "rlongup" + , desc = "Outgoing longwave radiation" + , unit = "[W/m2]" + , col.obser = c("grey42","grey21") + , col.model = c("gold","orangered") , leg.corner = "topleft" - , plog = TRUE )#end list -plotvar[[ 2]] = list( vnam.ed = "mort.plot" - , vnam.obs = "mort.plot" - , desc = "Total mortality rate" - , unit = "[%pop/yr]" - , col.obser = c("gray42","gray21") - , col.model = "purple4" +compvar[[11]] = list( vnam = "rnet" + , desc = "Net radiation" + , unit = "[W/m2]" + , col.obser = c("grey42","grey21") + , col.model = c("gold","orangered") , leg.corner = "topleft" - , plog = TRUE )#end list -plotvar[[ 3]] = list( vnam.ed = "ddmort.plot" - , vnam.obs = "mort.plot" - , desc = "Density dependent mortality rate" - , unit = "[%pop/yr]" - , col.obser = c("gray42","gray21") - , col.model = "mediumpurple1" +compvar[[12]] = list( vnam = "albedo" + , desc = "Albedo" + , unit = "[--]" + , col.obser = c("grey42","grey21") + , col.model = c("orange1","chocolate4") , leg.corner = "topleft" - , plog = TRUE )#end list -plotvar[[ 4]] = list( vnam.ed = "dimort.plot" - , vnam.obs = "mort.plot" - , desc = "Density independent mortality rate" - , unit = "[%pop/yr]" - , col.obser = c("gray42","gray21") - , col.model = "mediumpurple1" +compvar[[13]] = list( vnam = "parup" + , desc = "Outgoing PAR" + , unit = "[W/m2]" + , col.obser = c("grey42","grey21") + , col.model = c("chartreuse","chartreuse4") , leg.corner = "topleft" - , plog = TRUE )#end list -plotvar[[ 5]] = list( vnam.ed = "growth.plot" - , vnam.obs = "growth.plot" - , desc = "Growth rate" - , unit = "[%DBH/yr]" - , col.obser = c("gray42","gray21") - , col.model = "royalblue4" +compvar[[14]] = list( vnam = "rshortup" + , desc = "Outgoing SW" + , unit = "[W/m2]" + , col.obser = c("grey42","grey21") + , col.model = c("deepskyblue","royalblue3") , leg.corner = "topleft" - , plog = TRUE )#end list #------------------------------------------------------------------------------------------# -#------------------------------------------------------------------------------------------# -# Plot-level comparisons. # -#------------------------------------------------------------------------------------------# -sizevar = list() -sizevar[[ 1]] = list( vnam.ed = "mort.size" - , vnam.obs = "mort.size" - , desc = "Total mortality rate" - , unit = "[%pop/yr]" - , col.obser = c("gray42","gray21") - , col.model = "purple4" - , leg.corner = "topleft" - , plog = TRUE - )#end list -sizevar[[ 2]] = list( vnam.ed = "ddmort.size" - , vnam.obs = "mort.size" - , desc = "Density dependent mortality rate" - , unit = "[%pop/yr]" - , col.obser = c("gray42","gray21") - , col.model = "mediumpurple1" - , leg.corner = "topleft" - , plog = TRUE - )#end list -sizevar[[ 3]] = list( vnam.ed = "dimort.size" - , vnam.obs = "mort.size" - , desc = "Density independent mortality rate" - , unit = "[%pop/yr]" - , col.obser = c("gray42","gray21") - , col.model = "mediumpurple1" - , leg.corner = "topleft" - , plog = TRUE - )#end list -sizevar[[ 4]] = list( vnam.ed = "growth.size" - , vnam.obs = "growth.size" - , desc = "Growth rate" - , unit = "[%DBH/yr]" - , col.obser = c("gray42","gray21") - , col.model = "royalblue4" - , leg.corner = "topleft" - , plog = TRUE - )#end list -#------------------------------------------------------------------------------------------# - - #----- Load some packages. ----------------------------------------------------------------# library(hdf5) library(chron) @@ -234,7 +180,6 @@ library(lattice) library(maps) library(mapdata) library(akima) -library(Hmisc) library(sn) #------------------------------------------------------------------------------------------# @@ -252,8 +197,6 @@ nout = length(outform) #----- Set how many variables we will compare. --------------------------------------------# ncompvar = length(compvar) -nplotvar = length(plotvar) -nsizevar = length(sizevar) #------------------------------------------------------------------------------------------# @@ -272,6 +215,7 @@ source(paste(srcdir,"error.bar.r" ,sep="/")) source(paste(srcdir,"globdims.r" ,sep="/")) source(paste(srcdir,"locations.r" ,sep="/")) source(paste(srcdir,"muitas.r" ,sep="/")) +source(paste(srcdir,"numutils.r" ,sep="/")) source(paste(srcdir,"plotsize.r" ,sep="/")) source(paste(srcdir,"pretty.log.r" ,sep="/")) source(paste(srcdir,"pretty.time.r" ,sep="/")) @@ -361,7 +305,7 @@ for (place in myplaces){ #----- Print a banner to entretain the user. ----------------------------------------# - print(paste(" + Evaluating model for ",lieu,"...",sep="")) + cat(" + Evaluating model for ",lieu,"...","\n") #----- Get the observed variables. --------------------------------------------------# obser = get(obs.name) @@ -370,8 +314,6 @@ for (place in myplaces){ ,meanval=TRUE,imetavg=1,nmean=12,na.rm=TRUE) obser$hr.idx = period.day(obser$when,dtblock=hourblock.len) obser$yr.idx = season(obser$when,add.year=FALSE) - #----- Convert the NEE back to umol/m2/s, normal units for eddy flux. ---------------# - obser$nee = obser$nee * kgCyr.2.umols #------------------------------------------------------------------------------------# @@ -384,12 +326,12 @@ for (place in myplaces){ ed22.rdata = paste(path.data,paste(place,"RData",sep="."),sep="/") if (reload.data && file.exists(ed22.rdata)){ #----- Load the modelled dataset. ------------------------------------------------# - print(paste(" - Loading previous session...",sep="")) + cat(" - Loading previous session...","\n") load(ed22.rdata) if ((! "eddy.complete" %in% ls()) && "complete" %in% ls()) eddy.complete = complete if ((! "eddy.tresume" %in% ls()) && "tresume" %in% ls()) eddy.tresume = tresume }else{ - print(paste(" - Starting new session...",sep="")) + cat(" - Starting new session...","\n") eddy.tresume = 1 eddy.complete = FALSE }#end if @@ -420,6 +362,11 @@ for (place in myplaces){ model$nep = empty model$nee = empty model$ustar = empty + model$rnet = empty + model$rlongup = empty + model$albedo = empty + model$parup = empty + model$rshortup = empty }#end if #---------------------------------------------------------------------------------# @@ -431,7 +378,7 @@ for (place in myplaces){ last.cday = "00" last.cmonth = sprintf("%4.4i",numyears (model$when[eddy.tresume])) last.cyear = sprintf("%4.4i",numyears (model$when[eddy.tresume])) - print(paste(" - Reading in files...",sep="")) + cat(" - Reading in files...","\n") for (tt in eddy.tresume:ntimes){ cyear = sprintf("%4.4i",numyears (model$when[tt])) cmonth = sprintf("%2.2i",nummonths(model$when[tt])) @@ -440,7 +387,7 @@ for (place in myplaces){ cminu = sprintf("%2.2i",minutes (model$when[tt])) myfile = paste(inpref,"-I-",cyear,"-",cmonth,"-",cday,"-",chour,cminu ,"00-g01.h5",sep="") - if (last.cday != cday) print(paste(" * ",basename(myfile),"...",sep="")) + if (last.cday != cday) cat(" * ",basename(myfile),"...","\n") last.cday = cday #------------------------------------------------------------------------------# @@ -452,11 +399,11 @@ for (place in myplaces){ if (! file.exists(myfile)){ eddy.complete = FALSE eddy.tresume = tt - print(paste(" - Simulation not ready yet. Saving partial ED-2.2 data to " - ,basename(ed22.rdata),"...",sep="")) + cat(" - Simulation not ready yet. Saving partial ED-2.2 data to " + ,basename(ed22.rdata),"...","\n") save( list = c("model","eddy.complete","eddy.tresume") , file = ed22.rdata) - print("Quitting") + cat("Quitting","\n") q("no") }else{ myinst = hdf5load(file=myfile,load=FALSE,verbosity=0,tidy=TRUE) @@ -482,22 +429,26 @@ for (place in myplaces){ model$nep [tt] = model$gpp[tt] - model$reco[tt] model$nee [tt] = - model$nep[tt] * kgCyr.2.umols model$ustar [tt] = myinst$AVG.USTAR + model$rlongup [tt] = myinst$AVG.RLONGUP + model$albedo [tt] = myinst$AVG.ALBEDO + model$rnet [tt] = ( (1. - myinst$AVG.ALBEDO) * myinst$AVG.RSHORT + + myinst$AVG.RLONG - myinst$AVG.RLONGUP ) + model$parup [tt] = myinst$AVG.PARUP * Watts.2.Ein * 1.e6 + model$rshortup [tt] = myinst$AVG.RSHORTUP if (tt == ntimes){ eddy.complete = TRUE eddy.tresume = ntimes+1 - print(paste(" - Saving full ED-2.2 data to ",basename(ed22.rdata) - ,"...",sep="")) + cat(" - Saving full ED-2.2 data to ",basename(ed22.rdata),"...","\n") save( list = c("model","eddy.complete","eddy.tresume") , file = ed22.rdata) }else if (last.cyear != cyear){ eddy.complete = FALSE eddy.tresume = tt+1 - print(paste(" - Saving partial ED-2.2 data to ",basename(ed22.rdata) - ,"...",sep="")) + cat(" - Saving partial ED-2.2 data to ",basename(ed22.rdata),"...","\n") save( list = c("model","eddy.complete","eddy.tresume") , file = ed22.rdata) - print("Quitting") + cat("Quitting","\n") q("no") }#end if @@ -513,10 +464,12 @@ for (place in myplaces){ if (! file.exists(outpref)) dir.create(outpref) outboxmain = paste(outpref,"boxplot",sep="/") outpdfmain = paste(outpref,"pdfplot",sep="/") + outqqpmain = paste(outpref,"qqplot" ,sep="/") outlight = paste(outpref,"light" ,sep="/") if (! file.exists(outboxmain)) dir.create(outboxmain) if (! file.exists(outpdfmain)) dir.create(outpdfmain) - if (! file.exists(outlight )) dir.create(outlight) + if (! file.exists(outqqpmain)) dir.create(outqqpmain) + if (! file.exists(outlight )) dir.create(outlight ) #------------------------------------------------------------------------------------# @@ -541,133 +494,155 @@ for (place in myplaces){ #------------------------------------------------------------------------------------# # Compare the light response curve. # #------------------------------------------------------------------------------------# - print(paste(" - Comparing the light response curve...",sep="")) + cat(" - Comparing the light response curve...","\n") for (s in 1:nseasons){ #---------------------------------------------------------------------------------# # Select the data points for which we have observations, then fit the light # # response curve to both observed and modelled GPP. # #---------------------------------------------------------------------------------# sel = ( obser$yr.idx == myseasons[s] & is.finite(obser$gpp) - & (is.finite(obser$rshort) & obser$daytime) ) + & (is.finite(obser$par) & obser$daytime) ) #---------------------------------------------------------------------------------# - # Observations. # - #---------------------------------------------------------------------------------# - #----- Select and sort the data. -------------------------------------------------# - obser.data = data.frame( par = obser$par[sel] - , gpp = obser$gpp[sel] * kgCyr.2.umols) - o = order(obser.data$par) - obser.data = obser.data[o,] - #----- Give more weight to light-limited side. -----------------------------------# - obser.wgts = 1.0 / (( obser.data$par * 0.002 + 3.0) ) - #----- Fit the observations. -----------------------------------------------------# - obser.fit = nls( formula = gpp ~ a1 + a2 * par / (a3 + par) - , data = obser.data - , weights = obser.wgts - , start = list(a1 = 1., a2 = -40., a3 = 500.) ) - #----- Find the light-response curve. --------------------------------------------# - obser.pred = predict(obser.fit) + # Make sure there are some points. # #---------------------------------------------------------------------------------# + if (sum(sel) > 10){ - #---------------------------------------------------------------------------------# - # Model results. # - #-----name----------------------------------------------------------------------------# - #----- Select and sort the data. -------------------------------------------------# - model.data = data.frame( par = model$par[sel] - , gpp = model$gpp[sel] * kgCyr.2.umols) - o = order(model.data$par) - model.data = model.data[o,] - #----- Give more weight to light-limited side. -----------------------------------# - model.wgts = 1.0 / (( model.data$par * 0.002 + 3.0) ) - #----- Fit the modelled results. -------------------------------------------------# - model.fit = nls( formula = gpp ~ a1 + a2 * par / (a3 + par) - , data = model.data - , weights = model.wgts - , start = list(a1 = 1., a2 = -40., a3 = 500.) ) - #----- Find the light-response curve. --------------------------------------------# - model.pred = predict(model.fit) - #---------------------------------------------------------------------------------# - - - #---------------------------------------------------------------------------------# - # Find the X and Y limits. # - #---------------------------------------------------------------------------------# - xlimit = range(c(obser.data$par,model.data$par)) - ylimit = range(c(obser.data$gpp,model.data$gpp)) - #---------------------------------------------------------------------------------# - - - #---------------------------------------------------------------------------------# - # Plot the predicted curves and scatter plot. # - #---------------------------------------------------------------------------------# - for (o in 1:nout){ - #----- Make the file name. ----------------------------------------------------# - fichier = paste(outlight,"/gpp_light","-",ss.name[s],"-",suffix,"." - ,outform[o],sep="") - if (outform[o] == "x11"){ - X11(width=size$width,height=size$height,pointsize=ptsz) - }else if(outform[o] == "png"){ - png(filename=fichier,width=size$width*depth - ,height=size$height*depth,pointsize=ptsz,res=depth) - }else if(outform[o] == "eps"){ - postscript(file=fichier,width=size$width,height=size$height - ,pointsize=ptsz,paper=size$paper) - }else if(outform[o] == "pdf"){ - pdf(file=fichier,onefile=FALSE - ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) + #------------------------------------------------------------------------------# + # Observations. # + #------------------------------------------------------------------------------# + #----- Select and sort the data. ----------------------------------------------# + obser.data = data.frame( par = obser$par[sel] + , gpp = obser$gpp[sel] * kgCyr.2.umols) + o = order(obser.data$par) + obser.data = obser.data[o,] + #----- Give more weight to light-limited side. --------------------------------# + obser.wgts = 1.0 / (( obser.data$par * 0.002 + 3.0) ) + #----- Fit the observations. --------------------------------------------------# + obser.fit = try( expr = nls( formula = gpp ~ a1 + a2 * par / (a3 + par) + , data = obser.data + , weights = obser.wgts + , start = list(a1 = 1., a2 = -40., a3 = 500.) + )#end nls + , silent = TRUE + )#end try + #----- Find the light-response curve. -----------------------------------------# + if ("try-error" %in% is(obser.fit)){ + obser.pred = rep(NA,times=length(obser.data$par)) + }else{ + obser.pred = predict(obser.fit,data=obser.data) }#end if #------------------------------------------------------------------------------# - #------------------------------------------------------------------------------# - # Set up the title and axes labels. # + # Model results. # #------------------------------------------------------------------------------# - letitre = paste(lieu,"\n Polygon-level light response curve - " - ,ss.title[s],sep="") - lex = paste("Photosynthetically Active Radiation [umol/m2/s]") - ley = paste("Gross Primary Productivity [umol/m2/s]") + #----- Select and sort the data. ----------------------------------------------# + model.data = data.frame( par = model$par[sel] + , gpp = model$gpp[sel] * kgCyr.2.umols) + o = order(model.data$par) + model.data = model.data[o,] + #----- Give more weight to light-limited side. --------------------------------# + model.wgts = 1.0 / (( model.data$par * 0.002 + 3.0) ) + #----- Fit the modelled results. ----------------------------------------------# + model.fit = try( expr = nls( formula = gpp ~ a1 + a2 * par / (a3 + par) + , data = model.data + , weights = model.wgts + , start = list(a1 = 1., a2 = -40., a3 = 500.) + )#end nls + , silent = TRUE + )#end try + #----- Find the light-response curve. -----------------------------------------# + if ("try-error" %in% is(model.fit)){ + model.pred = rep(NA,times=length(model.data$par)) + }else{ + model.pred = predict(model.fit,data=model.data) + }#end if #------------------------------------------------------------------------------# - #------------------------------------------------------------------------------# - # Open an empty plotting area. # + # Find the X and Y limits. # #------------------------------------------------------------------------------# - plot(x=obser.data$par,y=obser.data$gpp,type="n",main=letitre,xlab=lex,ylab=ley - ,cex.main=cex.main,ylim=ylimit) - grid(col="gray76",lty="solid") - #----- Add the observations. --------------------------------------------------# - points(x=obser.data$par,y=obser.data$gpp,pch=16,col="gray50") - points(x=model.data$par,y=model.data$gpp,pch=16,col="chartreuse") - #----- Add the density functions. ---------------------------------------------# - lines(x=obser.data$par,y=obser.pred,lwd=3.0,col="gray21") - lines(x=model.data$par,y=model.pred,lwd=3.0,col="chartreuse4") - #----- Add the legend. --------------------------------------------------------# - legend( x = "topleft" - , inset = 0.01 - , legend = c("Observation","Fit - Observation","Model","Fit - Model") - , pch = c(16,NA,16,NA) - , lwd = c(NA, 3,NA, 3) - , col = c("gray50","gray21","chartreuse","chartreuse4") - , bg = "white" - , cex = 1.0) + xlimit = range(c(obser.data$par,model.data$par),na.rm=TRUE) + ylimit = range(c(obser.data$gpp,model.data$gpp),na.rm=TRUE) #------------------------------------------------------------------------------# - #------------------------------------------------------------------------------# - # Close the plotting device. # + # Plot the predicted curves and scatter plot. # #------------------------------------------------------------------------------# - if (outform[o] == "x11"){ - locator(n=1) - dev.off() - }else{ - dev.off() - }#end if + for (o in 1:nout){ + #----- Make the file name. -------------------------------------------------# + fichier = paste(outlight,"/gpp_light","-",ss.name[s],"-",suffix,"." + ,outform[o],sep="") + if (outform[o] == "x11"){ + X11(width=size$width,height=size$height,pointsize=ptsz) + }else if(outform[o] == "png"){ + png(filename=fichier,width=size$width*depth + ,height=size$height*depth,pointsize=ptsz,res=depth) + }else if(outform[o] == "eps"){ + postscript(file=fichier,width=size$width,height=size$height + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) + }#end if + #---------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------# + # Set up the title and axes labels. # + #---------------------------------------------------------------------------# + letitre = paste(lieu,"\n Polygon-level light response curve - " + ,ss.title[s],sep="") + lex = paste("Photosynthetically Active Radiation [umol/m2/s]") + ley = paste("Gross Primary Productivity [umol/m2/s]") + #---------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------# + # Open an empty plotting area. # + #---------------------------------------------------------------------------# + plot(x=obser.data$par,y=obser.data$gpp,type="n",main=letitre + ,xlab=lex,ylab=ley,cex.main=cex.main,ylim=ylimit) + grid(col="grey76",lty="solid") + #----- Add the observations. -----------------------------------------------# + points(x=obser.data$par,y=obser.data$gpp,pch=16,col="grey50") + points(x=model.data$par,y=model.data$gpp,pch=16,col="chartreuse") + #----- Add the density functions. ------------------------------------------# + lines(x=obser.data$par,y=obser.pred,lwd=3.0,col="grey21") + lines(x=model.data$par,y=model.pred,lwd=3.0,col="chartreuse4") + #----- Add the legend. -----------------------------------------------------# + legend( x = "topleft" + , inset = 0.01 + , legend = c("Observation","Fit - Observation","Model","Fit - Model") + , pch = c(16,NA,16,NA) + , lwd = c(NA, 3,NA, 3) + , col = c("grey50","grey21","chartreuse","chartreuse4") + , bg = "white" + , cex = 1.0) + #---------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------# + # Close the plotting device. # + #---------------------------------------------------------------------------# + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + #---------------------------------------------------------------------------# + }#end for #------------------------------------------------------------------------------# - }#end for + }#end if #---------------------------------------------------------------------------------# }#end for #------------------------------------------------------------------------------------# @@ -678,20 +653,59 @@ for (place in myplaces){ # Loop over all variables, and hours blocks, and all seasons to determine the # # distribution of the data. # #------------------------------------------------------------------------------------# - print(paste(" - Comparing season and diurnal distributions...",sep="")) + cat(" - Comparing season and diurnal distributions...","\n") + dist.comp = list() for (cc in 1:ncompvar){ this.comp = compvar[[cc]] this.vnam = this.comp$vnam + this.meas = paste("measured",this.vnam,sep=".") this.desc = this.comp$desc this.unit = this.comp$unit col.obser = this.comp$col.obser col.model = this.comp$col.model leg.corner = this.comp$leg.corner - - print(paste(" * ",this.desc,"...",sep="")) - this.obser = obser[[this.vnam]] - this.model = model[[this.vnam]] + + #---------------------------------------------------------------------------------# + # Grab the variables that we are going to use now. # + #---------------------------------------------------------------------------------# + cat(" * ",this.desc,"...","\n") + this.obser = obser[[this.vnam]] + this.measured = obser[[this.meas]] + this.model = model[[this.vnam]] + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Initialise the list to keep comparisons between model and observations. # + #---------------------------------------------------------------------------------# + comp = list() + mat = matrix( data = NA + , nrow = ndiel+3 + , ncol = nseasons + , dimnames = list( c(dl.name,"night","rise.set","day") + , ss.name + )#end list + )#end matrix + arr = array ( data = NA + , dim = c(ndiel+3,nseasons,4) + , dimnames = list( c(dl.name,"night","rise.set","day") + , ss.name + , c("mean","variance" + ,"skewness","kurtosis") + ) + )#end array + comp$n = mat + comp$bias = mat + comp$rmse = mat + comp$ks.stat = mat + comp$ks.p.value = mat + comp$sn.lnlike = mat + comp$norm.lnlike = mat + comp$obs.moment = arr + comp$mod.moment = arr + #---------------------------------------------------------------------------------# #---------------------------------------------------------------------------------# @@ -699,8 +713,10 @@ for (place in myplaces){ #---------------------------------------------------------------------------------# outboxvar = paste(outboxmain,this.vnam,sep="/") outpdfvar = paste(outpdfmain,this.vnam,sep="/") + outqqpvar = paste(outqqpmain,this.vnam,sep="/") if (! file.exists(outboxvar)) dir.create(outboxvar) if (! file.exists(outpdfvar)) dir.create(outpdfvar) + if (! file.exists(outqqpvar)) dir.create(outqqpvar) #---------------------------------------------------------------------------------# @@ -709,7 +725,7 @@ for (place in myplaces){ # Season block. # #---------------------------------------------------------------------------------# for (s in 1:nseasons){ - print(paste(" # Season: ",ss.name[s],"...",sep="")) + cat(" # Season: ",ss.name[s],"...","\n") bp.list = list() #----- These lists will contain the data for the box plot. --------------------# ylimit.bp = NULL @@ -721,31 +737,43 @@ for (place in myplaces){ # Select the period of the day to plot. # #---------------------------------------------------------------------------# if (d <= ndiel){ - print(paste(" ~ Hour: ",dl.name[d]," UTC...",sep="")) - sel = ( is.finite(this.obser) & obser$yr.idx == myseasons[s] - & obser$hr.idx == mydiel [d] ) + cat(" ~ Hour: ",dl.name[d]," UTC...","\n") + sel = ( this.measured & obser$yr.idx == myseasons[s] + & obser$hr.idx == mydiel [d] ) diel.label = paste("hr",dl.name[d],sep="_") diel.desc = paste("Hours: ",dl.name[d]," UTC",sep="") }else if (d == ndiel+1){ - print(paste(" ~ Night time...",sep="")) - sel = ( is.finite(this.obser) & obser$yr.idx == myseasons[s] - & (is.finite(obser$rshort) & obser$nighttime ) ) + cat(" ~ Night time...","\n") + sel = ( this.measured & obser$yr.idx == myseasons[s] + & obser$nighttime ) diel.label = paste("night") diel.desc = paste("Nighttime",sep="") }else if (d == ndiel+2){ - print(paste(" ~ Sunrise/sunset time...",sep="")) - sel = ( is.finite(this.obser) & obser$yr.idx == myseasons[s] - & (is.finite(obser$rshort) & obser$riseset ) ) + cat(" ~ Sunrise/sunset time...","\n") + sel = ( this.measured & obser$yr.idx == myseasons[s] + & obser$riseset ) diel.label = paste("riseset") diel.desc = paste("Sunrise/sunset time",sep="") }else if (d == ndiel+3){ - print(paste(" ~ Day time...",sep="")) - sel = ( is.finite(this.obser) & obser$yr.idx == myseasons[s] - & (is.finite(obser$rshort) & obser$highsun ) ) + cat(" ~ Day time...","\n") + sel = ( this.measured & obser$yr.idx == myseasons[s] + & obser$highsun ) diel.label = paste("day") diel.desc = paste("Daytime",sep="") }#end if + n.sel = sel + #---------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------# + # Number of observations that we use to build the comparison metrics. # + #---------------------------------------------------------------------------# + n.sel = sel + #---------------------------------------------------------------------------# + + #---------------------------------------------------------------------------# @@ -767,26 +795,110 @@ for (place in myplaces){ #----- Find and plot the distribution function for this hour. -----------# - if (sd(this.obser[sel]) >= 1.e-6){ + sd.obser = sd(this.obser[sel],na.rm=TRUE) + if (is.finite(sd.obser) && sd.obser > 1.0e-6){ + #---------------------------------------------------------------------# + # Find multiple statistics that may be used for finding the # + # support function. # + #---------------------------------------------------------------------# + o.location = sn.location(this.obser[sel],na.rm=TRUE) + o.scale = sn.scale (this.obser[sel],na.rm=TRUE) + o.shape = sn.shape (this.obser[sel],na.rm=TRUE) + o.mean = mean (this.obser[sel],na.rm=TRUE) + o.vari = var (this.obser[sel],na.rm=TRUE) + o.sdev = sd (this.obser[sel],na.rm=TRUE) + o.skew = skew (this.obser[sel],na.rm=TRUE) + o.kurt = kurt (this.obser[sel],na.rm=TRUE) + m.location = sn.location(this.model[sel],na.rm=TRUE) + m.scale = sn.scale (this.model[sel],na.rm=TRUE) + m.shape = sn.shape (this.model[sel],na.rm=TRUE) + m.mean = mean (this.model[sel],na.rm=TRUE) + m.vari = var (this.model[sel],na.rm=TRUE) + m.sdev = sd (this.model[sel],na.rm=TRUE) + m.skew = skew (this.model[sel],na.rm=TRUE) + m.kurt = kurt (this.model[sel],na.rm=TRUE) + #---------------------------------------------------------------------# + + + + #---------------------------------------------------------------------# + # Standardise the quantiles for the density function. Always # + # choose a power of two for the total length, because it reduces the # + # amount of interpolation if we go with the empirical density # + # function. # + #---------------------------------------------------------------------# + qlimit = range(c(this.obser[sel],this.model[sel])) + quant = seq(from=qlimit[1],to=qlimit[2],length.out=n.quant) #---------------------------------------------------------------------# - # Skewed-Gaussian statistics. # + + + #---------------------------------------------------------------------# - o.location = sn.location(this.obser[sel],na.rm=TRUE) - o.scale = sn.scale (this.obser[sel],na.rm=TRUE) - o.shape = sn.shape (this.obser[sel],na.rm=TRUE) - m.location = sn.location(this.model[sel],na.rm=TRUE) - m.scale = sn.scale (this.model[sel],na.rm=TRUE) - m.shape = sn.shape (this.model[sel],na.rm=TRUE) + # Find the distribution curves for model and observations. # #---------------------------------------------------------------------# + if ( use.distrib == "sn"){ + dfunc.obser = dsn(x=quant,dp=c(o.location,o.scale,o.shape)) + dfunc.model = dsn(x=quant,dp=c(m.location,m.scale,m.shape)) + }else if (use.distrib == "norm"){ + dfunc.obser = dnorm(x=quant,mean=o.mean,sd=o.sdev) + dfunc.model = dnorm(x=quant,mean=m.mean,sd=m.sdev) + }else if (use.distrib == "edf"){ + dfunc.obser = density( x = this.obser[sel], n = n.quant + , from = qlimit[1] , to = qlimit[2])$y + dfunc.model = density( x = this.model[sel], n = n.quant + , from = qlimit[1] , to = qlimit[2])$y + }#end if + #---------------------------------------------------------------------# + + + + #---------------------------------------------------------------------# + # Run a Kolgomorov-Smirnov test comparing the two distributions. # + #---------------------------------------------------------------------# + this.ks = ks.test(x=this.obser[sel],y=this.model[sel]) + comp$n [d,s] = sum(sel) + comp$ks.stat [d,s] = this.ks$statistic + comp$ks.p.value [d,s] = this.ks$p.value + comp$norm.lnlike[d,s] = sum( x = dnorm( x = this.obser[sel] + , mean = m.mean + , sd = m.sdev + , log = TRUE + )#end dnorm + , na.rm = TRUE + )#end sum + comp$sn.lnlike [d,s] = sum( x = dsn ( x = this.obser[sel] + , location = m.location + , scale = m.scale + , shape = m.shape + , log = TRUE + )#end dnorm + , na.rm = TRUE + )#end sum + #---------------------------------------------------------------------# + + + + #---------------------------------------------------------------------# + # Find the mean bias and the root mean square error, and the # + # four moments of the distribution for both observations and model. # + #---------------------------------------------------------------------# + comp$bias [d,s ] = bias( x = this.model[sel] + , xexp = this.obser[sel] + , absval = FALSE + )#end bias + comp$rmse [d,s ] = rmse( x = this.model[sel] + , xexp = this.obser[sel] + , absval = FALSE + )#end rmse + comp$obs.moment[d,s,] = c(o.mean,o.vari,o.skew,o.kurt) + comp$mod.moment[d,s,] = c(m.mean,m.vari,m.skew,m.kurt) + #---------------------------------------------------------------------# + #---------------------------------------------------------------------# # Find the range of observations/modelled variables. # #---------------------------------------------------------------------# - qlimit = range(c(this.obser[sel],this.model[sel])) - quant = seq(from=qlimit[1],to=qlimit[2],length.out=1000) - dfunc.obser = dsn(x=quant,dp=c(o.location,o.scale,o.shape)) - dfunc.model = dsn(x=quant,dp=c(m.location,m.scale,m.shape)) xbreaks = pretty(qlimit,n=20) freq.obser = hist(this.obser[sel],breaks=xbreaks,plot=FALSE)$density freq.model = hist(this.model[sel],breaks=xbreaks,plot=FALSE)$density @@ -804,7 +916,20 @@ for (place in myplaces){ #---------------------------------------------------------------------# - # Plot the predicted curves and histograms. # + # Create edges for the histogram rectangles (we use rect instead # + # of hist for histograms because we cannot control the line width in # + # hist). # + #---------------------------------------------------------------------# + xleft = xbreaks[-length(xbreaks)] + xright = xbreaks[-1] + ybottom = 0. * xleft + #---------------------------------------------------------------------# + + + + + #---------------------------------------------------------------------# + # Plot the histograms and density curves. # #---------------------------------------------------------------------# for (o in 1:nout){ #----- Make the file name. ----------------------------------------# @@ -843,12 +968,20 @@ for (place in myplaces){ #------------------------------------------------------------------# plot(x=quant,y=dfunc.obser,type="n",main=letitre,xlab=lex,ylab=ley ,cex.main=cex.main,ylim=ylimit) - grid(col="gray76",lty="solid") - #----- Add the histograms. ----------------------------------------# - hist(this.obser[sel],breaks=xbreaks,freq=FALSE,col=col.obser[1] - ,angle=-45,density=12,add=TRUE) - hist(this.model[sel],breaks=xbreaks,freq=FALSE,col=col.model[1] - ,angle=45,density=12,add=TRUE) + grid(col="grey76",lty="solid") + #------------------------------------------------------------------# + + + + #------------------------------------------------------------------# + # Plot the histograms using "rect. # + #------------------------------------------------------------------# + #----- Observations. ----------------------------------------------# + rect(xleft,ybottom,xright,freq.obser,density=12,angle=-45 + ,col=col.obser[1],border=col.obser[1],lwd=1.6) + #----- Model. -----------------------------------------------------# + rect(xleft,ybottom,xright,freq.model,density=12,angle=+45 + ,col=col.model[1],border=col.model[1],lwd=1.6) #----- Add the density functions. ---------------------------------# lines(x=quant,y=dfunc.obser,lwd=3.0,col=col.obser[2]) lines(x=quant,y=dfunc.model,lwd=3.0,col=col.model[2]) @@ -856,7 +989,7 @@ for (place in myplaces){ legend(x="topleft",inset=0.01,legend=c("Observation","Model") ,fill =c(col.obser[2],col.model[2]) ,border=c(col.obser[2],col.model[2]) - ,angle=c(-45,45),density=30 + ,angle =c(-45,45),density=30 ,lwd=2.0,col=c(col.obser[2],col.model[2]),bg="white" ,cex=1.0) #------------------------------------------------------------------# @@ -873,14 +1006,90 @@ for (place in myplaces){ dev.off() }#end if #------------------------------------------------------------------# - }#end for + }#end for (o in 1:nout) #---------------------------------------------------------------------# - }#end if + + + + + #---------------------------------------------------------------------# + # Organise the quantiles for plotting. # + #---------------------------------------------------------------------# + qq = qqplot(x=this.obser[sel],y=this.model[sel],plot.it=FALSE) + xlimit = range(qq$x) + ylimit = range(qq$y) + #---------------------------------------------------------------------# + + + + #---------------------------------------------------------------------# + # Plot the QQ-Plot of the distributions. # + #---------------------------------------------------------------------# + for (o in 1:nout){ + #----- Make the file name. ----------------------------------------# + fichier = paste(outqqpvar,"/qqplot_",this.vnam,"-",ss.name[s] + ,"-",diel.label,"-",suffix,".",outform[o],sep="") + if (outform[o] == "x11"){ + X11(width=size$width,height=size$height,pointsize=ptsz) + }else if(outform[o] == "png"){ + png(filename=fichier,width=size$width*depth + ,height=size$height*depth,pointsize=ptsz,res=depth) + }else if(outform[o] == "eps"){ + postscript(file=fichier,width=size$width,height=size$height + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz + ,paper=size$paper) + }#end if + #------------------------------------------------------------------# + + + + #------------------------------------------------------------------# + # Set up the title and axes labels. # + #------------------------------------------------------------------# + letitre = paste(lieu,"\n","QQ Plot for ",this.desc + ," - ",ss.title[s]," - ",diel.desc,sep="") + lex = paste("Observations",this.unit,sep=" ") + ley = paste("Model",this.unit,sep=" ") + #------------------------------------------------------------------# + + + + #------------------------------------------------------------------# + # Open an empty plotting area. # + #------------------------------------------------------------------# + plot(x=xlimit,y=ylimit,type="n",main=letitre,xlab=lex,ylab=ley + ,cex.main=cex.main) + grid(col="grey76",lty="solid") + lines(x=qq$y,y=qq$y,type="l",col=col.obser[2],lwd=3.0) + points(x=qq$x,y=qq$y,type="p",pch=16,cex=0.8,col=col.model[1]) + #------------------------------------------------------------------# + + + + #------------------------------------------------------------------# + # Close the plotting device. # + #------------------------------------------------------------------# + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + #------------------------------------------------------------------# + }#end for (o in 1:nout) + #---------------------------------------------------------------------# + + + + }#end if (sd(this.obser[sel]) >= 1.e-6) #------------------------------------------------------------------------# - }#end if + }#end if (any(sel)) #---------------------------------------------------------------------------# - }#end for + }#end for (d in 1:(ndiel+3)) #------------------------------------------------------------------------------# @@ -941,7 +1150,7 @@ for (place in myplaces){ plot(x=xlimit,y=ylimit,type="n",main=letitre,xlab=lex,ylab=ley ,cex.main=cex.main,xaxt="n") axis(side=1,at=xat,labels=dl.name) - abline(h=axTicks(side=2),v=xgrid,col="gray66",lty="solid") + abline(h=axTicks(side=2),v=xgrid,col="grey66",lty="solid") boxplot(x=bp.list,col=bpcolour,notch=TRUE,add=TRUE,show.names=FALSE) legend(x=leg.corner,inset=0.01,legend=c("Observation","Model"),bg="white" ,fill=c(col.obser[1],col.model[1])) @@ -963,12 +1172,21 @@ for (place in myplaces){ #------------------------------------------------------------------------------# }#end for #---------------------------------------------------------------------------------# - }#end for + + + #----- Save the comparison list for this variable. -------------------------------# + dist.comp[[this.vnam]] = comp + #---------------------------------------------------------------------------------# + }#end for (c in 1:ncompvar) #------------------------------------------------------------------------------------# }#end if (obs.name %in% ls()) #---------------------------------------------------------------------------------------# dum = write(x = "Finished",file=paste(here,place,"eval_load_complete.txt",sep="/")) + + stat.rdata = paste(path.data,paste("comp-",place,".RData",sep=""),sep="/") + cat(" + Saving statistics on model comparison to ",basename(stat.rdata),"...","\n") + dum = save(dist.comp,file=stat.rdata) }#end for places #------------------------------------------------------------------------------------------# diff --git a/ED/Template/Template/plot_monthly.r b/ED/Template/Template/plot_monthly.r index c5f2e064e..a8c44a8a7 100644 --- a/ED/Template/Template/plot_monthly.r +++ b/ED/Template/Template/plot_monthly.r @@ -226,6 +226,8 @@ for (place in myplaces){ censusagbpft = matrix(data=0,nrow=totmon,ncol=npft+1) censusbapft = matrix(data=0,nrow=totmon,ncol=npft+1) + + #----- LU arrays. The "+1" column contains the total. --------------------------------# agblu = matrix(data=0,nrow=totmon,ncol=nlu+1) lailu = matrix(data=0,nrow=totmon,ncol=nlu+1) @@ -1158,33 +1160,33 @@ for (place in myplaces){ #---- This is the number of survivors. -------------------------------------# survivor = sum(w.nplant[sel.re2]) previous = sum(w.nplant[sel.re2] * exp(mortconow[sel.re2]) ) - mortpft[m,p] = 100. * log( previous / survivor ) + mortpft[m,p] = log( previous / survivor ) survivor = sum(w.nplant[sel.re2]) previous = sum(w.nplant[sel.re2] * exp(agemortconow[sel.re2]) ) - agemortpft[m,p] = 100. * log( previous / survivor ) + agemortpft[m,p] = log( previous / survivor ) survivor = sum(w.nplant[sel.re2]) previous = sum(w.nplant[sel.re2] * exp(ncbmortconow[sel.re2]) ) - ncbmortpft[m,p] = 100. * log( previous / survivor ) + ncbmortpft[m,p] = log( previous / survivor ) survivor = sum(w.nplant[sel.re2]) previous = sum(w.nplant[sel.re2] * exp(tfallmortconow[sel.re2]) ) - tfallmortpft[m,p] = 100. * log( previous / survivor ) + tfallmortpft[m,p] = log( previous / survivor ) survivor = sum(w.nplant[sel.re2]) previous = sum(w.nplant[sel.re2] * exp(coldmortconow[sel.re2]) ) - coldmortpft[m,p] = 100. * log( previous / survivor ) + coldmortpft[m,p] = log( previous / survivor ) survivor = sum(w.nplant[sel.re2]) previous = sum(w.nplant[sel.re2] * exp(distmortconow[sel.re2]) ) - distmortpft[m,p] = 100. * log( previous / survivor ) + distmortpft[m,p] = log( previous / survivor ) }#end if if (any(sel.dbh) & any(sel.re2)){ #---- This is the number of survivors. -------------------------------------# population = sum(w.nplant[sel.dbh]) established = sum(w.nplant[sel.re2]) - recrpft[m,p] = 100. * log( population / established) / 12.0 + recrpft[m,p] = log( population / established) }#end if #------------------------------------------------------------------------------# @@ -1239,34 +1241,34 @@ for (place in myplaces){ #---- This is the number of survivors. ----------------------------------------# survivor = sum( w.nplant[sel.re2] ) previous = sum( w.nplant[sel.re2] * exp(mortconow[sel.re2])) - mortpft[m,npft+1] = 100. * log( previous / survivor ) + mortpft[m,npft+1] = log( previous / survivor ) survivor = sum( w.nplant[sel.re2] ) previous = sum( w.nplant[sel.re2] * exp(agemortconow[sel.re2])) - agemortpft [m,npft+1] = 100. * log( previous / survivor ) + agemortpft [m,npft+1] = log( previous / survivor ) survivor = sum( w.nplant[sel.re2] ) previous = sum( w.nplant[sel.re2] * exp(ncbmortconow[sel.re2])) - ncbmortpft [m,npft+1] = 100. * log( previous / survivor ) + ncbmortpft [m,npft+1] = log( previous / survivor ) survivor = sum( w.nplant[sel.re2] ) previous = sum( w.nplant[sel.re2] * exp(tfallmortconow[sel.re2])) - tfallmortpft[m,npft+1] = 100. * log( previous / survivor ) + tfallmortpft[m,npft+1] = log( previous / survivor ) survivor = sum( w.nplant[sel.re2] ) previous = sum( w.nplant[sel.re2] * exp(coldmortconow[sel.re2])) - coldmortpft [m,npft+1] = 100. * log( previous / survivor ) + coldmortpft [m,npft+1] = log( previous / survivor ) survivor = sum( w.nplant[sel.re2] ) previous = sum( w.nplant[sel.re2] * exp(distmortconow[sel.re2])) - distmortpft [m,npft+1] = 100. * log( previous / survivor ) + distmortpft [m,npft+1] = log( previous / survivor ) }#end if if (any(sel.dbh) & any(sel.re2)){ #---- This is the number of survivors. ----------------------------------------# population = sum( w.nplant[sel.dbh] ) established = sum( w.nplant[sel.re2] ) - recrpft[m,npft+1] = 100. * log( population / established ) / 12.0 + recrpft[m,npft+1] = log( population / established ) }#end if #---------------------------------------------------------------------------------# @@ -1354,27 +1356,27 @@ for (place in myplaces){ #---- This is the number of survivors and living before. ----------------# survivor = sum( w.nplant[sel] ) previous = sum( w.nplant[sel] * exp(mortconow[sel]) ) - mortpftdbh[m,d,p] = 100. * log( previous / survivor ) + mortpftdbh[m,d,p] = log( previous / survivor ) survivor = sum( w.nplant[sel] ) previous = sum( w.nplant[sel] * exp(agemortconow[sel]) ) - agemortpftdbh [m,d,p] = 100. * log( previous / survivor ) + agemortpftdbh [m,d,p] = log( previous / survivor ) survivor = sum( w.nplant[sel] ) previous = sum( w.nplant[sel] * exp(ncbmortconow[sel]) ) - ncbmortpftdbh [m,d,p] = 100. * log( previous / survivor ) + ncbmortpftdbh [m,d,p] = log( previous / survivor ) survivor = sum( w.nplant[sel] ) previous = sum( w.nplant[sel] * exp(tfallmortconow[sel]) ) - tfallmortpftdbh[m,d,p] = 100. * log( previous / survivor ) + tfallmortpftdbh[m,d,p] = log( previous / survivor ) survivor = sum( w.nplant[sel] ) previous = sum( w.nplant[sel] * exp(coldmortconow[sel]) ) - coldmortpftdbh [m,d,p] = 100. * log( previous / survivor ) + coldmortpftdbh [m,d,p] = log( previous / survivor ) survivor = sum( w.nplant[sel] ) previous = sum( w.nplant[sel] * exp(distmortconow[sel]) ) - distmortpftdbh [m,d,p] = 100. * log( previous / survivor ) + distmortpftdbh [m,d,p] = log( previous / survivor ) }#end if #---------------------------------------------------------------------------# }#end for PFT @@ -1473,29 +1475,29 @@ for (place in myplaces){ sel = pftconow == p & recruitconow == 2 }#end if #---- This is the number of survivors and living before. ----------------------# - survivor = sum( w.nplant[sel] ) - previous = sum( w.nplant[sel] * exp(mortconow[sel]) ) - mortpftdbh[m,ndbh+1,p] = 100. * log( previous / survivor) + survivor = sum( w.nplant[sel] ) + previous = sum( w.nplant[sel] * exp(mortconow[sel]) ) + mortpftdbh[m,ndbh+1,p] = log( previous / survivor) survivor = sum( w.nplant[sel] ) previous = sum( w.nplant[sel] * exp(agemortconow[sel]) ) - agemortpftdbh[m,ndbh+1,p] = 100. * log( previous / survivor) + agemortpftdbh[m,ndbh+1,p] = log( previous / survivor) survivor = sum( w.nplant[sel] ) previous = sum( w.nplant[sel] * exp(ncbmortconow[sel]) ) - ncbmortpftdbh[m,ndbh+1,p] = 100. * log( previous / survivor) + ncbmortpftdbh[m,ndbh+1,p] = log( previous / survivor) survivor = sum( w.nplant[sel] ) previous = sum( w.nplant[sel] * exp(tfallmortconow[sel]) ) - tfallmortpftdbh[m,ndbh+1,p] = 100. * log( previous / survivor) + tfallmortpftdbh[m,ndbh+1,p] = log( previous / survivor) survivor = sum( w.nplant[sel] ) previous = sum( w.nplant[sel] * exp(coldmortconow[sel]) ) - coldmortpftdbh[m,ndbh+1,p] = 100. * log( previous / survivor) + coldmortpftdbh[m,ndbh+1,p] = log( previous / survivor) survivor = sum( w.nplant[sel] ) previous = sum( w.nplant[sel] * exp(distmortconow[sel]) ) - distmortpftdbh[m,ndbh+1,p] = 100. * log( previous / survivor) + distmortpftdbh[m,ndbh+1,p] = log( previous / survivor) }#end for #---------------------------------------------------------------------------------# @@ -1561,17 +1563,20 @@ for (place in myplaces){ bswoodco [[labwhen]] = bswoodconow bstoreco [[labwhen]] = bstoreconow growthco [[labwhen]] = growthconow - mortco [[labwhen]] = mortconow - agemortco [[labwhen]] = agemortconow - ncbmortco [[labwhen]] = ncbmortconow - tfallmortco [[labwhen]] = tfallmortconow - coldmortco [[labwhen]] = coldmortconow - distmortco [[labwhen]] = distmortconow - recruitco [[labwhen]] = recruitconow + mortco [[labwhen]] = 100. * (1.0 - exp(-mortconow )) + agemortco [[labwhen]] = 100. * (1.0 - exp(-agemortconow )) + ncbmortco [[labwhen]] = 100. * (1.0 - exp(-ncbmortconow )) + tfallmortco [[labwhen]] = 100. * (1.0 - exp(-tfallmortconow )) + coldmortco [[labwhen]] = 100. * (1.0 - exp(-coldmortconow )) + distmortco [[labwhen]] = 100. * (1.0 - exp(-distmortconow )) + recruitco [[labwhen]] = 100. * (exp(recruitconow) - 1.0) } #end if month=sasmonth #---------------------------------------------------------------------------------# }# end for, month + #------------------------------------------------------------------------------------# }#end for, year + #---------------------------------------------------------------------------------------# + @@ -1888,6 +1893,22 @@ for (place in myplaces){ nplantpftdbh [empty] = NA #---------------------------------------------------------------------------------------# + #---------------------------------------------------------------------------------------# + #---------------------------------------------------------------------------------------# + mortpftdbh = 100. * (1.0 - exp(- mortpftdbh )) + agemortpftdbh = 100. * (1.0 - exp(- agemortpftdbh )) + ncbmortpftdbh = 100. * (1.0 - exp(- ncbmortpftdbh )) + tfallmortpftdbh = 100. * (1.0 - exp(- tfallmortpftdbh)) + coldmortpftdbh = 100. * (1.0 - exp(- coldmortpftdbh )) + distmortpftdbh = 100. * (1.0 - exp(- distmortpftdbh )) + mortpft = 100. * (1.0 - exp(- mortpft )) + agemortpft = 100. * (1.0 - exp(- agemortpft )) + ncbmortpft = 100. * (1.0 - exp(- ncbmortpft )) + tfallmortpft = 100. * (1.0 - exp(- tfallmortpft )) + coldmortpft = 100. * (1.0 - exp(- coldmortpft )) + distmortpft = 100. * (1.0 - exp(- distmortpft )) + recrpft = 100. * (exp( recrpft ) - 1.0) + #---------------------------------------------------------------------------------------# #----- Find which PFTs, land uses and transitions we need to consider ------------------# @@ -2532,13 +2553,23 @@ for (place in myplaces){ }#end if if (plotsd){ if (is.null(obs.x)){ - err.x = c(mod.x,rev(mod.x)) - err.y = c(mod.ylow,rev(mod.yhigh)) + mod.x.poly = c(mod.x,rev(mod.x)) + mod.y.poly = c(mod.ylow,rev(mod.yhigh)) + mod.keep = is.finite(mod.y.poly) + err.x = mod.x.poly[mod.keep] + err.y = mod.y.poly[mod.keep] polygon(x=err.x,y=err.y,col=errcolours[1],angle=angle[1],density=dens[1] ,lty="solid",lwd=shwd[1]) }else{ - err.x = c(mod.x,rev(mod.x),NA,obs.x,rev(obs.x)) - err.y = c(mod.ylow,rev(mod.yhigh),NA,obs.ylow,rev(obs.yhigh)) + mod.x.poly = c(mod.x,rev(mod.x)) + mod.y.poly = c(mod.ylow,rev(mod.yhigh)) + mod.keep = is.finite(mod.y.poly) + obs.x.poly = c(obs.x,rev(obs.x)) + obs.y.poly = c(obs.ylow,rev(obs.yhigh)) + obs.keep = is.finite(obs.y.poly) + + err.x = c(mod.x.poly[mod.keep],NA,obs.x.poly[obs.keep]) + err.y = c(mod.y.poly[mod.keep],NA,obs.y.poly[obs.keep]) polygon(x=err.x,y=err.y,col=errcolours,angle=angle,density=dens ,lty="solid",lwd=shwd) }#end if @@ -2735,14 +2766,22 @@ for (place in myplaces){ #------------------------------------------------------------------------# if (is.null(obs.x.now)){ - err.x = c(mod.x.now,rev(mod.x.now)) - err.y = c(mod.ylow.now,rev(mod.yhigh.now)) + mod.x.poly = c(mod.x.now,rev(mod.x.now)) + mod.y.poly = c(mod.ylow.now,rev(mod.yhigh.now)) + mod.keep = is.finite(mod.y.poly) + err.x = mod.x.poly[mod.keep] + err.y = mod.y.poly[mod.keep] polygon(x=err.x,y=err.y,col=errcolours[1],angle=angle[1] ,density=dens[1],lty="solid",lwd=shwd[1]) }else{ - err.x = c(mod.x.now,rev(mod.x.now),NA,obs.x.now,rev(obs.x.now)) - err.y = c(mod.ylow.now,rev(mod.yhigh.now),NA - ,obs.ylow.now,rev(obs.yhigh.now)) + mod.x.poly = c(mod.x.now,rev(mod.x.now)) + mod.y.poly = c(mod.ylow.now,rev(mod.yhigh.now)) + mod.keep = is.finite(mod.y.poly) + obs.x.poly = c(obs.x.now,rev(obs.x.now)) + obs.y.poly = c(obs.ylow.now,rev(obs.yhigh.now)) + obs.keep = is.finite(obs.y.poly) + err.x = c(mod.x.poly[mod.keep],NA,obs.x.poly[obs.keep]) + err.y = c(mod.y.poly[mod.keep],NA,obs.y.poly[obs.keep]) polygon(x=err.x,y=err.y,col=errcolours,angle=angle,density=dens ,lty="solid",lwd=shwd) }#end if diff --git a/ED/Template/bringlast.sh b/ED/Template/bringlast.sh index 14136e0e0..36409dd6b 100755 --- a/ED/Template/bringlast.sh +++ b/ED/Template/bringlast.sh @@ -55,81 +55,84 @@ do monthz=`echo ${oi} | awk '{print $10}'` datez=`echo ${oi} | awk '{print $11}'` timez=`echo ${oi} | awk '{print $12}'` - polyisoil=`echo ${oi} | awk '{print $13}'` - polyntext=`echo ${oi} | awk '{print $14}'` - polysand=`echo ${oi} | awk '{print $15}'` - polyclay=`echo ${oi} | awk '{print $16}'` - polydepth=`echo ${oi} | awk '{print $17}'` - polysoilbc=`echo ${oi} | awk '{print $18}'` - polysldrain=`echo ${oi} | awk '{print $19}'` - polycol=`echo ${oi} | awk '{print $20}'` - slzres=`echo ${oi} | awk '{print $21}'` - queue=`echo ${oi} | awk '{print $22}'` - metdriver=`echo ${oi} | awk '{print $23}'` - dtlsm=`echo ${oi} | awk '{print $24}'` - vmfactc3=`echo ${oi} | awk '{print $25}'` - vmfactc4=`echo ${oi} | awk '{print $26}'` - mphototrc3=`echo ${oi} | awk '{print $27}'` - mphototec3=`echo ${oi} | awk '{print $28}'` - mphotoc4=`echo ${oi} | awk '{print $29}'` - bphotoblc3=`echo ${oi} | awk '{print $30}'` - bphotonlc3=`echo ${oi} | awk '{print $31}'` - bphotoc4=`echo ${oi} | awk '{print $32}'` - kwgrass=`echo ${oi} | awk '{print $33}'` - kwtree=`echo ${oi} | awk '{print $34}'` - gammac3=`echo ${oi} | awk '{print $35}'` - gammac4=`echo ${oi} | awk '{print $36}'` - d0grass=`echo ${oi} | awk '{print $37}'` - d0tree=`echo ${oi} | awk '{print $38}'` - alphac3=`echo ${oi} | awk '{print $39}'` - alphac4=`echo ${oi} | awk '{print $40}'` - klowco2=`echo ${oi} | awk '{print $41}'` - decomp=`echo ${oi} | awk '{print $42}'` - rrffact=`echo ${oi} | awk '{print $43}'` - growthresp=`echo ${oi} | awk '{print $44}'` - lwidthgrass=`echo ${oi} | awk '{print $45}'` - lwidthbltree=`echo ${oi} | awk '{print $46}'` - lwidthnltree=`echo ${oi} | awk '{print $47}'` - q10c3=`echo ${oi} | awk '{print $48}'` - q10c4=`echo ${oi} | awk '{print $49}'` - h2olimit=`echo ${oi} | awk '{print $50}'` - imortscheme=`echo ${oi} | awk '{print $51}'` - ddmortconst=`echo ${oi} | awk '{print $52}'` - isfclyrm=`echo ${oi} | awk '{print $53}'` - icanturb=`echo ${oi} | awk '{print $54}'` - ubmin=`echo ${oi} | awk '{print $55}'` - ugbmin=`echo ${oi} | awk '{print $56}'` - ustmin=`echo ${oi} | awk '{print $57}'` - gamm=`echo ${oi} | awk '{print $58}'` - gamh=`echo ${oi} | awk '{print $59}'` - tprandtl=`echo ${oi} | awk '{print $60}'` - ribmax=`echo ${oi} | awk '{print $61}'` - atmco2=`echo ${oi} | awk '{print $62}'` - thcrit=`echo ${oi} | awk '{print $63}'` - smfire=`echo ${oi} | awk '{print $64}'` - ifire=`echo ${oi} | awk '{print $65}'` - fireparm=`echo ${oi} | awk '{print $66}'` - ipercol=`echo ${oi} | awk '{print $67}'` - runoff=`echo ${oi} | awk '{print $68}'` - imetrad=`echo ${oi} | awk '{print $69}'` - ibranch=`echo ${oi} | awk '{print $70}'` - icanrad=`echo ${oi} | awk '{print $71}'` - crown=`echo ${oi} | awk '{print $72}'` - ltransvis=`echo ${oi} | awk '{print $73}'` - lreflectvis=`echo ${oi} | awk '{print $74}'` - ltransnir=`echo ${oi} | awk '{print $75}'` - lreflectnir=`echo ${oi} | awk '{print $76}'` - orienttree=`echo ${oi} | awk '{print $77}'` - orientgrass=`echo ${oi} | awk '{print $78}'` - clumptree=`echo ${oi} | awk '{print $79}'` - clumpgrass=`echo ${oi} | awk '{print $80}'` - ivegtdyn=`echo ${oi} | awk '{print $81}'` - igndvap=`echo ${oi} | awk '{print $82}'` - iphen=`echo ${oi} | awk '{print $83}'` - iallom=`echo ${oi} | awk '{print $84}'` - ibigleaf=`echo ${oi} | awk '{print $85}'` - irepro=`echo ${oi} | awk '{print $86}'` - treefall=`echo ${oi} | awk '{print $87}'` + initmode=`echo ${oi} | awk '{print $13}'` + iscenario=`echo ${oi} | awk '{print $14}'` + isizepft=`echo ${oi} | awk '{print $15}'` + polyisoil=`echo ${oi} | awk '{print $16}'` + polyntext=`echo ${oi} | awk '{print $17}'` + polysand=`echo ${oi} | awk '{print $18}'` + polyclay=`echo ${oi} | awk '{print $19}'` + polydepth=`echo ${oi} | awk '{print $20}'` + polysoilbc=`echo ${oi} | awk '{print $21}'` + polysldrain=`echo ${oi} | awk '{print $22}'` + polycol=`echo ${oi} | awk '{print $23}'` + slzres=`echo ${oi} | awk '{print $24}'` + queue=`echo ${oi} | awk '{print $25}'` + metdriver=`echo ${oi} | awk '{print $26}'` + dtlsm=`echo ${oi} | awk '{print $27}'` + vmfactc3=`echo ${oi} | awk '{print $28}'` + vmfactc4=`echo ${oi} | awk '{print $29}'` + mphototrc3=`echo ${oi} | awk '{print $30}'` + mphototec3=`echo ${oi} | awk '{print $31}'` + mphotoc4=`echo ${oi} | awk '{print $32}'` + bphotoblc3=`echo ${oi} | awk '{print $33}'` + bphotonlc3=`echo ${oi} | awk '{print $34}'` + bphotoc4=`echo ${oi} | awk '{print $35}'` + kwgrass=`echo ${oi} | awk '{print $36}'` + kwtree=`echo ${oi} | awk '{print $37}'` + gammac3=`echo ${oi} | awk '{print $38}'` + gammac4=`echo ${oi} | awk '{print $39}'` + d0grass=`echo ${oi} | awk '{print $40}'` + d0tree=`echo ${oi} | awk '{print $41}'` + alphac3=`echo ${oi} | awk '{print $42}'` + alphac4=`echo ${oi} | awk '{print $43}'` + klowco2=`echo ${oi} | awk '{print $44}'` + decomp=`echo ${oi} | awk '{print $45}'` + rrffact=`echo ${oi} | awk '{print $46}'` + growthresp=`echo ${oi} | awk '{print $47}'` + lwidthgrass=`echo ${oi} | awk '{print $48}'` + lwidthbltree=`echo ${oi} | awk '{print $49}'` + lwidthnltree=`echo ${oi} | awk '{print $50}'` + q10c3=`echo ${oi} | awk '{print $51}'` + q10c4=`echo ${oi} | awk '{print $52}'` + h2olimit=`echo ${oi} | awk '{print $53}'` + imortscheme=`echo ${oi} | awk '{print $54}'` + ddmortconst=`echo ${oi} | awk '{print $55}'` + isfclyrm=`echo ${oi} | awk '{print $56}'` + icanturb=`echo ${oi} | awk '{print $57}'` + ubmin=`echo ${oi} | awk '{print $58}'` + ugbmin=`echo ${oi} | awk '{print $59}'` + ustmin=`echo ${oi} | awk '{print $60}'` + gamm=`echo ${oi} | awk '{print $61}'` + gamh=`echo ${oi} | awk '{print $62}'` + tprandtl=`echo ${oi} | awk '{print $63}'` + ribmax=`echo ${oi} | awk '{print $64}'` + atmco2=`echo ${oi} | awk '{print $65}'` + thcrit=`echo ${oi} | awk '{print $66}'` + smfire=`echo ${oi} | awk '{print $67}'` + ifire=`echo ${oi} | awk '{print $68}'` + fireparm=`echo ${oi} | awk '{print $69}'` + ipercol=`echo ${oi} | awk '{print $70}'` + runoff=`echo ${oi} | awk '{print $71}'` + imetrad=`echo ${oi} | awk '{print $72}'` + ibranch=`echo ${oi} | awk '{print $73}'` + icanrad=`echo ${oi} | awk '{print $74}'` + crown=`echo ${oi} | awk '{print $75}'` + ltransvis=`echo ${oi} | awk '{print $76}'` + lreflectvis=`echo ${oi} | awk '{print $77}'` + ltransnir=`echo ${oi} | awk '{print $78}'` + lreflectnir=`echo ${oi} | awk '{print $79}'` + orienttree=`echo ${oi} | awk '{print $80}'` + orientgrass=`echo ${oi} | awk '{print $81}'` + clumptree=`echo ${oi} | awk '{print $82}'` + clumpgrass=`echo ${oi} | awk '{print $83}'` + ivegtdyn=`echo ${oi} | awk '{print $84}'` + igndvap=`echo ${oi} | awk '{print $85}'` + iphen=`echo ${oi} | awk '{print $86}'` + iallom=`echo ${oi} | awk '{print $87}'` + ibigleaf=`echo ${oi} | awk '{print $88}'` + irepro=`echo ${oi} | awk '{print $89}'` + treefall=`echo ${oi} | awk '{print $90}'` #---------------------------------------------------------------------------------------# diff --git a/ED/Template/check_run.sh b/ED/Template/check_run.sh index f992c3691..f56a8dd75 100755 --- a/ED/Template/check_run.sh +++ b/ED/Template/check_run.sh @@ -59,81 +59,84 @@ do monthz=`echo ${oi} | awk '{print $10}'` datez=`echo ${oi} | awk '{print $11}'` timez=`echo ${oi} | awk '{print $12}'` - polyisoil=`echo ${oi} | awk '{print $13}'` - polyntext=`echo ${oi} | awk '{print $14}'` - polysand=`echo ${oi} | awk '{print $15}'` - polyclay=`echo ${oi} | awk '{print $16}'` - polydepth=`echo ${oi} | awk '{print $17}'` - polysoilbc=`echo ${oi} | awk '{print $18}'` - polysldrain=`echo ${oi} | awk '{print $19}'` - polycol=`echo ${oi} | awk '{print $20}'` - slzres=`echo ${oi} | awk '{print $21}'` - queue=`echo ${oi} | awk '{print $22}'` - metdriver=`echo ${oi} | awk '{print $23}'` - dtlsm=`echo ${oi} | awk '{print $24}'` - vmfactc3=`echo ${oi} | awk '{print $25}'` - vmfactc4=`echo ${oi} | awk '{print $26}'` - mphototrc3=`echo ${oi} | awk '{print $27}'` - mphototec3=`echo ${oi} | awk '{print $28}'` - mphotoc4=`echo ${oi} | awk '{print $29}'` - bphotoblc3=`echo ${oi} | awk '{print $30}'` - bphotonlc3=`echo ${oi} | awk '{print $31}'` - bphotoc4=`echo ${oi} | awk '{print $32}'` - kwgrass=`echo ${oi} | awk '{print $33}'` - kwtree=`echo ${oi} | awk '{print $34}'` - gammac3=`echo ${oi} | awk '{print $35}'` - gammac4=`echo ${oi} | awk '{print $36}'` - d0grass=`echo ${oi} | awk '{print $37}'` - d0tree=`echo ${oi} | awk '{print $38}'` - alphac3=`echo ${oi} | awk '{print $39}'` - alphac4=`echo ${oi} | awk '{print $40}'` - klowco2=`echo ${oi} | awk '{print $41}'` - decomp=`echo ${oi} | awk '{print $42}'` - rrffact=`echo ${oi} | awk '{print $43}'` - growthresp=`echo ${oi} | awk '{print $44}'` - lwidthgrass=`echo ${oi} | awk '{print $45}'` - lwidthbltree=`echo ${oi} | awk '{print $46}'` - lwidthnltree=`echo ${oi} | awk '{print $47}'` - q10c3=`echo ${oi} | awk '{print $48}'` - q10c4=`echo ${oi} | awk '{print $49}'` - h2olimit=`echo ${oi} | awk '{print $50}'` - imortscheme=`echo ${oi} | awk '{print $51}'` - ddmortconst=`echo ${oi} | awk '{print $52}'` - isfclyrm=`echo ${oi} | awk '{print $53}'` - icanturb=`echo ${oi} | awk '{print $54}'` - ubmin=`echo ${oi} | awk '{print $55}'` - ugbmin=`echo ${oi} | awk '{print $56}'` - ustmin=`echo ${oi} | awk '{print $57}'` - gamm=`echo ${oi} | awk '{print $58}'` - gamh=`echo ${oi} | awk '{print $59}'` - tprandtl=`echo ${oi} | awk '{print $60}'` - ribmax=`echo ${oi} | awk '{print $61}'` - atmco2=`echo ${oi} | awk '{print $62}'` - thcrit=`echo ${oi} | awk '{print $63}'` - smfire=`echo ${oi} | awk '{print $64}'` - ifire=`echo ${oi} | awk '{print $65}'` - fireparm=`echo ${oi} | awk '{print $66}'` - ipercol=`echo ${oi} | awk '{print $67}'` - runoff=`echo ${oi} | awk '{print $68}'` - imetrad=`echo ${oi} | awk '{print $69}'` - ibranch=`echo ${oi} | awk '{print $70}'` - icanrad=`echo ${oi} | awk '{print $71}'` - crown=`echo ${oi} | awk '{print $72}'` - ltransvis=`echo ${oi} | awk '{print $73}'` - lreflectvis=`echo ${oi} | awk '{print $74}'` - ltransnir=`echo ${oi} | awk '{print $75}'` - lreflectnir=`echo ${oi} | awk '{print $76}'` - orienttree=`echo ${oi} | awk '{print $77}'` - orientgrass=`echo ${oi} | awk '{print $78}'` - clumptree=`echo ${oi} | awk '{print $79}'` - clumpgrass=`echo ${oi} | awk '{print $80}'` - ivegtdyn=`echo ${oi} | awk '{print $81}'` - igndvap=`echo ${oi} | awk '{print $82}'` - iphen=`echo ${oi} | awk '{print $83}'` - iallom=`echo ${oi} | awk '{print $84}'` - ibigleaf=`echo ${oi} | awk '{print $85}'` - irepro=`echo ${oi} | awk '{print $86}'` - treefall=`echo ${oi} | awk '{print $87}'` + initmode=`echo ${oi} | awk '{print $13}'` + iscenario=`echo ${oi} | awk '{print $14}'` + isizepft=`echo ${oi} | awk '{print $15}'` + polyisoil=`echo ${oi} | awk '{print $16}'` + polyntext=`echo ${oi} | awk '{print $17}'` + polysand=`echo ${oi} | awk '{print $18}'` + polyclay=`echo ${oi} | awk '{print $19}'` + polydepth=`echo ${oi} | awk '{print $20}'` + polysoilbc=`echo ${oi} | awk '{print $21}'` + polysldrain=`echo ${oi} | awk '{print $22}'` + polycol=`echo ${oi} | awk '{print $23}'` + slzres=`echo ${oi} | awk '{print $24}'` + queue=`echo ${oi} | awk '{print $25}'` + metdriver=`echo ${oi} | awk '{print $26}'` + dtlsm=`echo ${oi} | awk '{print $27}'` + vmfactc3=`echo ${oi} | awk '{print $28}'` + vmfactc4=`echo ${oi} | awk '{print $29}'` + mphototrc3=`echo ${oi} | awk '{print $30}'` + mphototec3=`echo ${oi} | awk '{print $31}'` + mphotoc4=`echo ${oi} | awk '{print $32}'` + bphotoblc3=`echo ${oi} | awk '{print $33}'` + bphotonlc3=`echo ${oi} | awk '{print $34}'` + bphotoc4=`echo ${oi} | awk '{print $35}'` + kwgrass=`echo ${oi} | awk '{print $36}'` + kwtree=`echo ${oi} | awk '{print $37}'` + gammac3=`echo ${oi} | awk '{print $38}'` + gammac4=`echo ${oi} | awk '{print $39}'` + d0grass=`echo ${oi} | awk '{print $40}'` + d0tree=`echo ${oi} | awk '{print $41}'` + alphac3=`echo ${oi} | awk '{print $42}'` + alphac4=`echo ${oi} | awk '{print $43}'` + klowco2=`echo ${oi} | awk '{print $44}'` + decomp=`echo ${oi} | awk '{print $45}'` + rrffact=`echo ${oi} | awk '{print $46}'` + growthresp=`echo ${oi} | awk '{print $47}'` + lwidthgrass=`echo ${oi} | awk '{print $48}'` + lwidthbltree=`echo ${oi} | awk '{print $49}'` + lwidthnltree=`echo ${oi} | awk '{print $50}'` + q10c3=`echo ${oi} | awk '{print $51}'` + q10c4=`echo ${oi} | awk '{print $52}'` + h2olimit=`echo ${oi} | awk '{print $53}'` + imortscheme=`echo ${oi} | awk '{print $54}'` + ddmortconst=`echo ${oi} | awk '{print $55}'` + isfclyrm=`echo ${oi} | awk '{print $56}'` + icanturb=`echo ${oi} | awk '{print $57}'` + ubmin=`echo ${oi} | awk '{print $58}'` + ugbmin=`echo ${oi} | awk '{print $59}'` + ustmin=`echo ${oi} | awk '{print $60}'` + gamm=`echo ${oi} | awk '{print $61}'` + gamh=`echo ${oi} | awk '{print $62}'` + tprandtl=`echo ${oi} | awk '{print $63}'` + ribmax=`echo ${oi} | awk '{print $64}'` + atmco2=`echo ${oi} | awk '{print $65}'` + thcrit=`echo ${oi} | awk '{print $66}'` + smfire=`echo ${oi} | awk '{print $67}'` + ifire=`echo ${oi} | awk '{print $68}'` + fireparm=`echo ${oi} | awk '{print $69}'` + ipercol=`echo ${oi} | awk '{print $70}'` + runoff=`echo ${oi} | awk '{print $71}'` + imetrad=`echo ${oi} | awk '{print $72}'` + ibranch=`echo ${oi} | awk '{print $73}'` + icanrad=`echo ${oi} | awk '{print $74}'` + crown=`echo ${oi} | awk '{print $75}'` + ltransvis=`echo ${oi} | awk '{print $76}'` + lreflectvis=`echo ${oi} | awk '{print $77}'` + ltransnir=`echo ${oi} | awk '{print $78}'` + lreflectnir=`echo ${oi} | awk '{print $79}'` + orienttree=`echo ${oi} | awk '{print $80}'` + orientgrass=`echo ${oi} | awk '{print $81}'` + clumptree=`echo ${oi} | awk '{print $82}'` + clumpgrass=`echo ${oi} | awk '{print $83}'` + ivegtdyn=`echo ${oi} | awk '{print $84}'` + igndvap=`echo ${oi} | awk '{print $85}'` + iphen=`echo ${oi} | awk '{print $86}'` + iallom=`echo ${oi} | awk '{print $87}'` + ibigleaf=`echo ${oi} | awk '{print $88}'` + irepro=`echo ${oi} | awk '{print $89}'` + treefall=`echo ${oi} | awk '{print $90}'` #---------------------------------------------------------------------------------------# #---------------------------------------------------------------------------------------# diff --git a/ED/Template/compare_results.r b/ED/Template/compare_results.r new file mode 100644 index 000000000..186af6d51 --- /dev/null +++ b/ED/Template/compare_results.r @@ -0,0 +1,898 @@ +#==========================================================================================# +#==========================================================================================# +# Reset session. # +#------------------------------------------------------------------------------------------# +rm(list=ls()) +graphics.off() +#------------------------------------------------------------------------------------------# + + + + +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +# Here is the user defined variable section. # +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +here = getwd() # Current directory +srcdir = "/n/moorcroft_data/mlongo/util/Rsc" # Script directory +outroot = paste(here,"structure_comp",sep="/") # Output directory + +sites = c("gyf","cax","m34","s67","s77","s83","ban","pnz","rja","fns","pdg") +simul = list() +simul[[1]] = list( name = "pft00_canrad00_sas" + , desc = "5 PFTs + Medvigy + SAS" + , colour = "chartreuse4" + )#end list +simul[[2]] = list( name = "pft00_canrad01_sas" + , desc = "5 PFTs + Zhao and Qualls + SAS" + , colour = "darkolivegreen1" + )#end list +simul[[3]] = list( name = "pft00_canrad00_ble" + , desc = "5 PFTs + Medvigy + Big Leaf" + , colour = "orange1" + )#end list +simul[[4]] = list( name = "pft00_canrad01_ble" + , desc = "5 PFTs + Zhao and Qualls + Big Leaf" + , colour = "firebrick" + )#end list +#------------------------------------------------------------------------------------------# + + + + +#------------------------------------------------------------------------------------------# +# Plot options. # +#------------------------------------------------------------------------------------------# +outform = c("eps","png","pdf") # Formats for output file. Supported formats are: + # - "X11" - for printing on screen + # - "eps" - for postscript printing + # - "png" - for PNG printing + # - "pdf" - for PDF printing + +byeold = TRUE # Remove old files of the given format? + +depth = 96 # PNG resolution, in pixels per inch +paper = "letter" # Paper size, to define the plot shape +ptsz = 14 # Font size. +lwidth = 2.5 # Line width +plotgrid = TRUE # Should I plot the grid in the background? + +legwhere = "topleft" # Where should I place the legend? +inset = 0.01 # Inset between legend and edge of plot region. +legbg = "white" # Legend background colour. +fracexp = 0.40 # Expansion factor for y axis (to fit legend) +cex.main = 0.8 # Scale coefficient for the title +#------------------------------------------------------------------------------------------# + + + +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +# NO NEED TO CHANGE ANYTHING BEYOND THIS POINT UNLESS YOU ARE DEVELOPING THE CODE... # +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# + + + +#------------------------------------------------------------------------------------------# +# Eddy flux comparisons. # +#------------------------------------------------------------------------------------------# +compvar = list() +compvar[[ 1]] = list( vnam = "hflxca" + , desc = "Sensible heat flux" + , unit = "[W/m2]" + , col.obser = c("grey42","grey21") + , col.model = c("orange1","chocolate4") + , leg.corner = "topleft" + )#end list +compvar[[ 2]] = list( vnam = "wflxca" + , desc = "Water vapour flux" + , unit = "[kg/m2/day]" + , col.obser = c("grey42","grey21") + , col.model = c("deepskyblue","royalblue4") + , leg.corner = "topleft" + )#end list +compvar[[ 3]] = list( vnam = "cflxca" + , desc = "Carbon dioxide flux" + , unit = "[umol/m2/s]" + , col.obser = c("grey42","grey21") + , col.model = c("chartreuse2","darkgreen") + , leg.corner = "bottomright" + )#end list +compvar[[ 4]] = list( vnam = "cflxst" + , desc = "Carbon dioxide storage" + , unit = "[umol/m2/s]" + , col.obser = c("grey42","grey21") + , col.model = c("lightgoldenrod3","darkorange1") + , leg.corner = "topleft" + )#end list +compvar[[ 5]] = list( vnam = "gpp" + , desc = "Gross primary productivity" + , unit = "[kgC/m2/yr]" + , col.obser = c("grey42","grey21") + , col.model = c("green3","darkgreen") + , leg.corner = "topleft" + )#end list +compvar[[ 6]] = list( vnam = "reco" + , desc = "Ecosystem respiration" + , unit = "[kgC/m2/yr]" + , col.obser = c("grey42","grey21") + , col.model = c("yellow3","peru") + , leg.corner = "topleft" + )#end list +compvar[[ 7]] = list( vnam = "nep" + , desc = "Net ecosystem productivity" + , unit = "[kgC/m2/yr]" + , col.obser = c("grey42","grey21") + , col.model = c("olivedrab2","darkolivegreen4") + , leg.corner = "topleft" + )#end list +compvar[[ 8]] = list( vnam = "nee" + , desc = "Net ecosystem exchange" + , unit = "[umol/m2/s]" + , col.obser = c("grey42","grey21") + , col.model = c("chartreuse","chartreuse4") + , leg.corner = "bottomright" + )#end list +compvar[[ 9]] = list( vnam = "ustar" + , desc = "Friction velocity" + , unit = "[m/s]" + , col.obser = c("grey42","grey21") + , col.model = c("mediumpurple1","purple4") + , leg.corner = "topleft" + )#end list +compvar[[10]] = list( vnam = "rlongup" + , desc = "Outgoing longwave radiation" + , unit = "[W/m2]" + , col.obser = c("grey42","grey21") + , col.model = c("gold","orangered") + , leg.corner = "topleft" + )#end list +compvar[[11]] = list( vnam = "rnet" + , desc = "Net radiation" + , unit = "[W/m2]" + , col.obser = c("grey42","grey21") + , col.model = c("gold","orangered") + , leg.corner = "topleft" + )#end list +compvar[[12]] = list( vnam = "albedo" + , desc = "Albedo" + , unit = "[--]" + , col.obser = c("grey42","grey21") + , col.model = c("orange1","chocolate4") + , leg.corner = "topleft" + )#end list +compvar[[13]] = list( vnam = "parup" + , desc = "Outgoing PAR" + , unit = "[umol/m2/s]" + , col.obser = c("grey42","grey21") + , col.model = c("chartreuse4","darkolivegreen1") + , leg.corner = "topleft" + )#end list +compvar[[14]] = list( vnam = "rshortup" + , desc = "Outgoing shortwave radiation" + , unit = "[W/m2]" + , col.obser = c("grey42","grey21") + , col.model = c("royalblue4","deepskyblue") + , leg.corner = "topleft" + )#end list +#------------------------------------------------------------------------------------------# + + + +#------------------------------------------------------------------------------------------# +# Input variables. # +#------------------------------------------------------------------------------------------# +control = list() +control[[ 1]] = list( vnam = "rshort" + , desc = "Incoming shortwave radiation" + , unit = "[W/m2]" + )#end list +control[[ 2]] = list( vnam = "rlong" + , desc = "Incoming longwave radiation" + , unit = "[W/m2]" + )#end list +control[[ 3]] = list( vnam = "atm.prss" + , desc = "Air pressure" + , unit = "[hPa]" + )#end list +control[[ 4]] = list( vnam = "atm.temp" + , desc = "Air temperature" + , unit = "[degC]" + )#end list +control[[ 5]] = list( vnam = "atm.shv" + , desc = "Air specific humidity" + , unit = "[g/kg]" + )#end list +control[[ 6]] = list( vnam = "atm.vels" + , desc = "Wind speed" + , unit = "[m/s]" + )#end list +control[[ 7]] = list( vnam = "rain" + , desc = "Precipitation rate" + , unit = "[kg/m2/day]" + )#end list +control[[ 8]] = list( vnam = "bsa" + , desc = "Basal area" + , unit = "[cm2/m2]" + )#end list +control[[ 9]] = list( vnam = "wdens" + , desc = "Mean wood density" + , unit = "[kg/m3]" + )#end list +control[[10]] = list( vnam = "global" + , desc = "Global index" + , unit = "[--]" + )#end list +#------------------------------------------------------------------------------------------# + + + + +#------------------------------------------------------------------------------------------# +# Statistics. # +#------------------------------------------------------------------------------------------# +good = list() +good[[ 1]] = list( vnam = "bias" + , desc = "Mean bias" + )#end list +good[[ 2]] = list( vnam = "rmse" + , desc = "Root mean square error" + )#end list +good[[ 3]] = list( vnam = "ks.stat" + , desc = "Kolmogorov-Smirnov statistic" + )#end list +good[[ 4]] = list( vnam = "sn.lnlike" + , desc = "Scaled support based on skew normal distribution" + )#end list +good[[ 5]] = list( vnam = "norm.lnlike" + , desc = "Scaled support based on normal distribution" + )#end list +#------------------------------------------------------------------------------------------# + + + +#----- Load some packages. ----------------------------------------------------------------# +library(hdf5) +library(chron) +library(scatterplot3d) +library(lattice) +library(maps) +library(mapdata) +library(akima) +library(sn) +#------------------------------------------------------------------------------------------# + + +#----- In case there is some graphic still opened. ----------------------------------------# +graphics.off() +#------------------------------------------------------------------------------------------# + + +#----- Set how many formats we must output. -----------------------------------------------# +outform = tolower(outform) +nout = length(outform) +#------------------------------------------------------------------------------------------# + + + +#------------------------------------------------------------------------------------------# +# List the keys for all dimensions. # +#------------------------------------------------------------------------------------------# +simul.key = apply(X = sapply(X=simul,FUN=c),MARGIN=1,FUN=unlist)[, "name"] +simleg.key = apply(X = sapply(X=simul,FUN=c),MARGIN=1,FUN=unlist)[, "desc"] +simcol.key = apply(X = sapply(X=simul,FUN=c),MARGIN=1,FUN=unlist)[,"colour"] +sites.key = sites +control.key = apply(X = sapply(X=control,FUN=c),MARGIN=1,FUN=unlist)[,"vnam"] +compvar.key = apply(X = sapply(X=compvar,FUN=c),MARGIN=1,FUN=unlist)$vnam +good.key = apply(X = sapply(X=good ,FUN=c),MARGIN=1,FUN=unlist)[,"vnam"] +season.key = c("DJF","MAM","JJA","SON") +diel.key = c("night","rise.set","day") +diel.desc = c("Nighttime","Sun Rise/Set","Daytime") +#------------------------------------------------------------------------------------------# + + + +#----- Set the various dimensions associated with variables, simulations, and sites. ------# +nsites = length(sites.key ) +nsimul = length(simul.key ) +ncompvar = length(compvar.key) +ncontrol = length(control.key) +ngood = length(good.key ) +nseason = length(season.key ) +ndiel = length(diel.key ) +#------------------------------------------------------------------------------------------# + + + +#----- Avoid unecessary and extremely annoying beeps. -------------------------------------# +options(locatorBell=FALSE) +#------------------------------------------------------------------------------------------# + + + + +#----- Load some files with functions. ----------------------------------------------------# +source(paste(srcdir,"atlas.r" ,sep="/")) +source(paste(srcdir,"charutils.r" ,sep="/")) +source(paste(srcdir,"census.r" ,sep="/")) +source(paste(srcdir,"cloudy.r" ,sep="/")) +source(paste(srcdir,"epolygon.r" ,sep="/")) +source(paste(srcdir,"error.bar.r" ,sep="/")) +source(paste(srcdir,"globdims.r" ,sep="/")) +source(paste(srcdir,"locations.r" ,sep="/")) +source(paste(srcdir,"muitas.r" ,sep="/")) +source(paste(srcdir,"numutils.r" ,sep="/")) +source(paste(srcdir,"plotsize.r" ,sep="/")) +source(paste(srcdir,"pretty.box.r" ,sep="/")) +source(paste(srcdir,"pretty.log.r" ,sep="/")) +source(paste(srcdir,"pretty.time.r" ,sep="/")) +source(paste(srcdir,"qapply.r" ,sep="/")) +source(paste(srcdir,"rconstants.r" ,sep="/")) +source(paste(srcdir,"skewnorm.stats.r" ,sep="/")) +source(paste(srcdir,"soilutils.r" ,sep="/")) +source(paste(srcdir,"sombreado.r" ,sep="/")) +source(paste(srcdir,"southammap.r" ,sep="/")) +source(paste(srcdir,"thermlib.r" ,sep="/")) +source(paste(srcdir,"timeutils.r" ,sep="/")) +source(paste(srcdir,"zen.r" ,sep="/")) +#----- These should be called after the others. -------------------------------------------# +source(paste(srcdir,"pft.coms.r" ,sep="/")) +#------------------------------------------------------------------------------------------# + + + +#----- Load observations. -----------------------------------------------------------------# +obser.file = paste(srcdir,"LBA_MIP.nogapfill.RData",sep="/") +load(file=obser.file) +#------------------------------------------------------------------------------------------# + + + +#----- Define plot window size ------------------------------------------------------------# +size = plotsize(proje=FALSE,paper=paper) +#------------------------------------------------------------------------------------------# + + + +#----- Create the output directory in case there isn't one. -------------------------------# +if (! file.exists(outroot)) dir.create(outroot) +#------------------------------------------------------------------------------------------# + + + +#----- Find the best set up for plotting all seasons in the same plot. --------------------# +lo.box = pretty.box(n=nseason) +#------------------------------------------------------------------------------------------# + + + +#------------------------------------------------------------------------------------------# +# Retrieve all data. # +#------------------------------------------------------------------------------------------# +cat (" + Retrieve data for all sites...","\n") +res = list() +for (p in 1:nsites){ + #----- Get the basic information. ------------------------------------------------------# + iata = sites[p] + im = match(iata,poilist$iata) + + this = list() + this$short = poilist$short [im] + this$longname = poilist$longname[im] + this$iata = poilist$iata [im] + this$lon = poilist$lon [im] + this$lat = poilist$lat [im] + this$sim = list() + + cat(" - Site :",this$longname,"...","\n") + for (s in 1:nsimul){ + cat(" * Simulation: ",simul[[s]]$desc,"...","\n") + sim.name = paste("t",iata,"_",simul[[s]]$name,sep="") + sim.path = paste(here,sim.name,sep="/") + sim.file = paste(sim.path,"rdata_hour",paste("comp-",sim.name,".RData",sep="") + ,sep="/") + load(sim.file) + + this$sim[[simul[[s]]$name]] = dist.comp + rm(dist.comp) + }#end for + + res[[iata]] = this + rm(this) +}#end for +#------------------------------------------------------------------------------------------# + + + + +#------------------------------------------------------------------------------------------# +# Plot the various statistics as functions of the site "completion". # +#------------------------------------------------------------------------------------------# +cat (" + Plot statistics as functions of model and fraction of input data...","\n") +performance = array( data = NA + , dim = c(ncompvar,ngood,nsimul) + , dimnames = list(compvar.key,good.key,simul.key) + )#end array +for (v in 1:ncompvar){ + #----- Copy the variable information. --------------------------------------------------# + this.vnam = compvar[[v]]$vnam + this.desc = compvar[[v]]$desc + this.unit = compvar[[v]]$unit + cat(" - ",this.desc,"...","\n") + #---------------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------------# + # Create the output path in case it doesn't exist. # + #---------------------------------------------------------------------------------------# + outcomp = paste(outroot,this.vnam,sep="/") + if (! file.exists(outcomp)) dir.create(outcomp) + outdiel = paste(outcomp,diel.key ,sep="/") + for (d in 1:ndiel) if (! file.exists(outdiel[d])) dir.create(outdiel[d]) + #---------------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------------# + # Loop over all control variables, and get the average score for the plot. # + #---------------------------------------------------------------------------------------# + score = array( data = 0. + , dim = c(ndiel,nseason,ncontrol,nsites) + , dimnames = list(diel.key,season.key,control.key,sites.key) + )#end score + nobs = array( data = 0. + , dim = c(ndiel,nseason,ncontrol,nsites) + , dimnames = list(diel.key,season.key,control.key,sites.key) + )#end score + for (p in 1:nsites){ + obs = get(paste("obs",sites[p],sep=".")) + p.sel = is.finite(obs[[this.vnam]]) + if (! "season" %in% names(obs)) obs$season = season(obs$when) + if (! "diel" %in% names(obs)) obs$diel = (! obs$nighttime) + obs$highsun + for (u in 1:(ncontrol-1)){ + obs.score = obs[[paste("score",control[[u]]$vnam,sep=".")]] + for (e in 1:nseason){ + e.sel = obs$season == e + for (d in 1:ndiel){ + d.sel = obs$diel == d-1 + sel = e.sel & d.sel & p.sel + score[d,e,u,p] = mean(obs.score[sel],na.rm=TRUE) + nobs [d,e,u,p] = sum (sel ,na.rm=TRUE) + }#end for + #------------------------------------------------------------------------------# + }#end for + #---------------------------------------------------------------------------------# + }#end for + #------------------------------------------------------------------------------------# + }#end for + score[,,ncontrol,] = apply( X = score[,,1:(ncontrol-1),] + , MARGIN = c(1,2,4) + , FUN = mean + , na.rm = TRUE + )#end apply + nobs [,,ncontrol,] = apply( X = nobs[,,1:(ncontrol-1),] + , MARGIN = c(1,2,4) + , FUN = sum + , na.rm = TRUE + )#end apply + score[! is.finite(score)] = NA + #---------------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------------# + # Loop over all sites and simulations, and grab the data. # + #---------------------------------------------------------------------------------------# + for (g in 1:ngood){ + this.good = good[[g]]$vnam + desc.good = good[[g]]$desc + cat (" * ",desc.good,"\n") + stat = array( data = NA + , dim = c(ndiel,nseason,nsimul,nsites) + , dimnames = list(diel.key,season.key,simul.key,sites.key) + )#end array + colstat = array( data = NA_character_ + , dim = c(nsimul,nsites) + , dimnames = list(simul.key,sites.key) + )#end array + #------------------------------------------------------------------------------------# + # Loop over all sites and simulations. # + #------------------------------------------------------------------------------------# + for (p in 1:nsites){ + iata = sites[p] + for (s in 1:nsimul){ + colstat[s,p] = simul[[s]]$colour + this = res[[iata]]$sim[[s]][[this.vnam]][[this.good]] + for (e in 1:nseason){ + use.season = paste(sprintf("%2.2i",e),season.key[e],sep="-") + for (d in 1:ndiel){ + if (is.finite(this[diel.key[d],use.season])){ + stat[d,e,s,p] = this[diel.key[d],use.season] + }#end if + }#end for + #---------------------------------------------------------------------------# + }#end for + #------------------------------------------------------------------------------# + }#end for + #---------------------------------------------------------------------------------# + }#end for + #------------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------------# + # Standardise the log-likelihood so the data are more comparable. # + #------------------------------------------------------------------------------------# + if (this.good %in% c("sn.lnlike","norm.lnlike")){ + stat.min = apply(X = stat, MARGIN=c(1,2,4),FUN=min,na.rm=TRUE) + stat.max = apply(X = stat, MARGIN=c(1,2,4),FUN=max,na.rm=TRUE) + stat.orig = stat + for (s in 1:nsimul){ + stat[,,s,] = 100. * ( (stat.orig[,,s,] - stat.max)/ (stat.max - stat.min) ) + }#end for + }#end if + #------------------------------------------------------------------------------------# + + + + + + #------------------------------------------------------------------------------------# + # Plot the box plots. # + #------------------------------------------------------------------------------------# + for (d in 1:ndiel){ + #---------------------------------------------------------------------------------# + # Find the limits for the bar plot. # + #---------------------------------------------------------------------------------# + xlimit = c(0,nsites*(nsimul+1))+0.5 + xat = seq(from=0,to=(nsites-1)*(nsimul+1),by=nsimul+1)+1+0.5*nsimul + xlines = seq(from=0,to=nsites*(nsimul+1),by=nsimul+1)+0.5 + ylimit = range(stat[d,,,],na.rm=TRUE) + if ( any(! is.finite(ylimit)) || (ylimit[1] == ylimit[2] && ylimit[1] == 0)){ + ylimit = c(-1,1) + }else if (ylimit[1] == ylimit[2] ){ + ylimit[1] = ylimit[1] * ( 1. - sign(ylimit[1]) * fracexp) + ylimit[2] = ylimit[2] * ( 1. + sign(ylimit[2]) * fracexp) + }#end if + xleg = xlimit[1] + yleg = ylimit[1] - 0.25 * diff(ylimit) + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Loop over all output formats. # + #---------------------------------------------------------------------------------# + for (o in 1:nout){ + #----- Make the file name. ----------------------------------------------------# + fichier = paste(outdiel[d],"/barplot-",this.vnam,"-",this.good,"-",diel.key[d] + ,".",outform[o],sep="") + if (outform[o] == "x11"){ + X11(width=size$width,height=size$height,pointsize=ptsz) + }else if(outform[o] == "png"){ + png(filename=fichier,width=size$width*depth + ,height=size$height*depth,pointsize=ptsz,res=depth) + }else if(outform[o] == "eps"){ + postscript(file=fichier,width=size$width,height=size$height + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) + }#end if + #------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------# + # Split the window into several smaller windows. Add a bottom row to fit # + # the legend. # + #------------------------------------------------------------------------------# + par.orig = par(no.readonly = TRUE) + mar.orig = par.orig$mar + par(oma = c(0,3,3,0)) + h = 0.4 * par("csi") * 2.54 + layout(mat = rbind(1+lo.box$mat,rep(1,times=lo.box$ncol)) + ,height = c(rep(1,times=lo.box$nrow),h) + )#end layout + #------------------------------------------------------------------------------# + + + + #----- Plot legend. -----------------------------------------------------------# + par(mar=c(0.1,0.1,0.1,0.1)) + plot.new() + plot.window(xlim=c(0,1),ylim=c(0,1),xaxt="n",yaxt="n") + legend ( x = "bottom" + , inset = 0.0 + , legend = simleg.key + , fill = simcol.key + , border = "black" + , bg = "white" + , ncol = min(nsimul,3) + , title = expression(bold("Simulation")) + , cex = 1.0 + )#end legend + #------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------# + # Loop over all seasons, and plot the bar plots. # + #------------------------------------------------------------------------------# + for (e in 1:nseason){ + #----- Find out where is this box going, and set up axes and margins. ------# + left = (e %% lo.box$ncol) == 1 + right = (e %% lo.box$ncol) == 0 + top = e <= lo.box$ncol + bottom = e > (lo.box$nrow - 1) * lo.box$ncol + mar.now = c(1 + 3 * bottom,1 + 1 * left,1 + 2 * top,1 + 1 * right) + 0.1 + #---------------------------------------------------------------------------# + + + #----- Set up the title for each plot. -------------------------------------# + lesub = paste(season.full[e],sep="") + #---------------------------------------------------------------------------# + + + + #----- Plot window and grid. -----------------------------------------------# + par(mar=mar.now,xpd=FALSE,las=2) + plot.new() + plot.window(xlim=xlimit,ylim=ylimit,xaxt="n",yaxt="n") + if (bottom) axis(side=1,at=xat,labels=toupper(sites.key)) + if (left ) axis(side=2) + box() + title(main=lesub) + if (plotgrid) abline(h=axTicks(2),v=xlines,col="grey83",lty="solid") + #---------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------# + # Add the bar plot. # + #---------------------------------------------------------------------------# + barplot(height=stat[d,e,,],col=colstat,beside=TRUE,border="grey22" + ,add=TRUE,axes=FALSE,axisnames=FALSE,xpd=FALSE) + #---------------------------------------------------------------------------# + }#end for + + + + #------------------------------------------------------------------------------# + # Make the title and axis labels. # + #------------------------------------------------------------------------------# + letitre = paste(desc.good," - ",this.desc,"\n",diel.desc[d],sep="") + if (this.good %in% c("bias","rmse")){ + ley = paste(desc.good,this.unit,sep=" ") + }else{ + ley = paste(desc.good," [--]",sep="") + }#end if + lex = "Sites" + #------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------# + # Plot the global title. # + #------------------------------------------------------------------------------# + par(las=0) + mtext(text=ley ,side=2,outer=TRUE,padj=-0.75) + mtext(text=letitre,side=3,outer=TRUE,cex=1.1,font=2) + #------------------------------------------------------------------------------# + + + + #----- Close the device. ------------------------------------------------------# + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + #------------------------------------------------------------------------------# + + }#end for + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Plot the statistics as a function of the quality of the data. # + #---------------------------------------------------------------------------------# + for (u in 1:ncontrol){ + this.qual = control[[u]] + qual.vnam = this.qual$vnam + qual.desc = this.qual$desc + qual.unit = this.qual$unit + + #------------------------------------------------------------------------------# + # Find the limits for the bar plot. # + #------------------------------------------------------------------------------# + xlimit = range(score[d,,u,],na.rm=TRUE) + ylimit = range(stat [d,,, ],na.rm=TRUE) + if ( any(! is.finite(xlimit)) || (xlimit[1] == xlimit[2] && xlimit[1] == 0)){ + xlimit = c(0,10) + }else if (xlimit[1] == xlimit[2] ){ + xlimit[1] = xlimit[1] * ( 1. - sign(xlimit[1]) * fracexp) + xlimit[2] = xlimit[2] * ( 1. + sign(xlimit[2]) * fracexp) + }#end if + if ( any(! is.finite(ylimit)) || (ylimit[1] == ylimit[2] && ylimit[1] == 0)){ + ylimit = c(-1,1) + }else if (ylimit[1] == ylimit[2] ){ + ylimit[1] = ylimit[1] * ( 1. - sign(ylimit[1]) * fracexp) + ylimit[2] = ylimit[2] * ( 1. + sign(ylimit[2]) * fracexp) + }#end if + xleg = xlimit[1] + yleg = ylimit[1] - 0.25 * diff(ylimit) + #------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------# + # Loop over all output formats. # + #------------------------------------------------------------------------------# + for (o in 1:nout){ + #----- Make the file name. -------------------------------------------------# + fichier = paste(outdiel[d],"/qual-",this.vnam,"-",qual.vnam,"-" + ,this.good,"-",diel.key[d],".",outform[o],sep="") + if (outform[o] == "x11"){ + X11(width=size$width,height=size$height,pointsize=ptsz) + }else if(outform[o] == "png"){ + png(filename=fichier,width=size$width*depth + ,height=size$height*depth,pointsize=ptsz,res=depth) + }else if(outform[o] == "eps"){ + postscript(file=fichier,width=size$width,height=size$height + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) + }#end if + #---------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------# + # Split the window into several smaller windows. Add a bottom row to # + # fit the legend. # + #---------------------------------------------------------------------------# + par.orig = par(no.readonly = TRUE) + mar.orig = par.orig$mar + par(oma = c(0,3,3,0)) + h = 0.4 * par("csi") * 2.54 + layout(mat = rbind(1+lo.box$mat,rep(1,times=lo.box$ncol)) + ,height = c(rep(1,times=lo.box$nrow),h) + )#end layout + #---------------------------------------------------------------------------# + + + + #----- Plot legend. --------------------------------------------------------# + par(mar=c(0.1,0.1,0.1,0.1)) + plot.new() + plot.window(xlim=c(0,1),ylim=c(0,1),xaxt="n",yaxt="n") + legend ( x = "bottom" + , inset = 0.0 + , legend = simleg.key + , fill = simcol.key + , border = "black" + , bg = "white" + , ncol = min(nsimul,3) + , title = expression(bold("Simulation")) + , cex = 1.0 + )#end legend + #---------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------# + # Loop over all seasons, and plot the bar plots. # + #---------------------------------------------------------------------------# + for (e in 1:nseason){ + #----- Find out where is this box going, and set up axes and margins. ---# + left = (e %% lo.box$ncol) == 1 + right = (e %% lo.box$ncol) == 0 + top = e <= lo.box$ncol + bottom = e > (lo.box$nrow - 1) * lo.box$ncol + mar.now = c(1 + 3 * bottom,1 + 1 * left,1 + 2 * top,1 + 1 * right) + 0.1 + #------------------------------------------------------------------------# + + + #----- Set up the title for each plot. ----------------------------------# + lesub = paste(season.full[e],sep="") + #------------------------------------------------------------------------# + + + + #----- Plot window and grid. --------------------------------------------# + par(mar=mar.now,xpd=FALSE,las=1) + plot.new() + plot.window(xlim=xlimit,ylim=ylimit,xaxt="n",yaxt="n") + if (bottom) axis(side=1) + if (left ) axis(side=2) + box() + title(main=lesub) + if (plotgrid) grid(col="grey83",lty="solid") + #------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------# + # Add the bar plot. # + #------------------------------------------------------------------------# + for (s in 1:nsimul){ + points(x=score[d,e,u,],y=stat[d,e,s,],pch=15 + ,col=simul[[s]]$colour,cex=1.0) + }#end for + #------------------------------------------------------------------------# + }#end for + #---------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------# + # Make the title and axis labels. # + #---------------------------------------------------------------------------# + letitre = paste(desc.good," - ",this.desc,"\n",diel.desc[d],sep="") + if (this.good %in% c("bias","rmse")){ + ley = paste(desc.good,this.unit,sep=" ") + }else{ + ley = paste(desc.good," [--]",sep="") + }#end if + lex = paste("Quality index - ",qual.desc,sep="") + #---------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------# + # Plot the global title. # + #---------------------------------------------------------------------------# + par(las=0) + mtext(text=lex ,side=1,outer=TRUE,padj=-6.00) + mtext(text=ley ,side=2,outer=TRUE,padj=-0.75) + mtext(text=letitre,side=3,outer=TRUE,cex=1.1,font=2) + #---------------------------------------------------------------------------# + + + + #----- Close the device. ---------------------------------------------------# + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + #---------------------------------------------------------------------------# + }#end for (o in 1:nout) + #------------------------------------------------------------------------------# + }#end for (u in 1:ncontrol) + #---------------------------------------------------------------------------------# + }#end for (d in 1:ndiel) + #------------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------------# + # Find the general score for all variables. # + #------------------------------------------------------------------------------------# + for (s in 1:nsimul){ + performance[v,g,s] = weighted.mean( x = stat [,,s ,] + , w = score[,,ncontrol,] * nobs[,,ncontrol,] + , na.rm = TRUE + )#end weighted.mean + }#end for + #------------------------------------------------------------------------------------# + }#end for (g in 1:ngood) + #---------------------------------------------------------------------------------------# +}#end for (v in 1:ncompvar) +#------------------------------------------------------------------------------------------# diff --git a/ED/Template/delall.sh b/ED/Template/delall.sh index 59e1635b9..5f5be2200 100755 --- a/ED/Template/delall.sh +++ b/ED/Template/delall.sh @@ -115,81 +115,84 @@ do monthz=`echo ${oi} | awk '{print $10}'` datez=`echo ${oi} | awk '{print $11}'` timez=`echo ${oi} | awk '{print $12}'` - polyisoil=`echo ${oi} | awk '{print $13}'` - polyntext=`echo ${oi} | awk '{print $14}'` - polysand=`echo ${oi} | awk '{print $15}'` - polyclay=`echo ${oi} | awk '{print $16}'` - polydepth=`echo ${oi} | awk '{print $17}'` - polysoilbc=`echo ${oi} | awk '{print $18}'` - polysldrain=`echo ${oi} | awk '{print $19}'` - polycol=`echo ${oi} | awk '{print $20}'` - slzres=`echo ${oi} | awk '{print $21}'` - queue=`echo ${oi} | awk '{print $22}'` - metdriver=`echo ${oi} | awk '{print $23}'` - dtlsm=`echo ${oi} | awk '{print $24}'` - vmfactc3=`echo ${oi} | awk '{print $25}'` - vmfactc4=`echo ${oi} | awk '{print $26}'` - mphototrc3=`echo ${oi} | awk '{print $27}'` - mphototec3=`echo ${oi} | awk '{print $28}'` - mphotoc4=`echo ${oi} | awk '{print $29}'` - bphotoblc3=`echo ${oi} | awk '{print $30}'` - bphotonlc3=`echo ${oi} | awk '{print $31}'` - bphotoc4=`echo ${oi} | awk '{print $32}'` - kwgrass=`echo ${oi} | awk '{print $33}'` - kwtree=`echo ${oi} | awk '{print $34}'` - gammac3=`echo ${oi} | awk '{print $35}'` - gammac4=`echo ${oi} | awk '{print $36}'` - d0grass=`echo ${oi} | awk '{print $37}'` - d0tree=`echo ${oi} | awk '{print $38}'` - alphac3=`echo ${oi} | awk '{print $39}'` - alphac4=`echo ${oi} | awk '{print $40}'` - klowco2=`echo ${oi} | awk '{print $41}'` - decomp=`echo ${oi} | awk '{print $42}'` - rrffact=`echo ${oi} | awk '{print $43}'` - growthresp=`echo ${oi} | awk '{print $44}'` - lwidthgrass=`echo ${oi} | awk '{print $45}'` - lwidthbltree=`echo ${oi} | awk '{print $46}'` - lwidthnltree=`echo ${oi} | awk '{print $47}'` - q10c3=`echo ${oi} | awk '{print $48}'` - q10c4=`echo ${oi} | awk '{print $49}'` - h2olimit=`echo ${oi} | awk '{print $50}'` - imortscheme=`echo ${oi} | awk '{print $51}'` - ddmortconst=`echo ${oi} | awk '{print $52}'` - isfclyrm=`echo ${oi} | awk '{print $53}'` - icanturb=`echo ${oi} | awk '{print $54}'` - ubmin=`echo ${oi} | awk '{print $55}'` - ugbmin=`echo ${oi} | awk '{print $56}'` - ustmin=`echo ${oi} | awk '{print $57}'` - gamm=`echo ${oi} | awk '{print $58}'` - gamh=`echo ${oi} | awk '{print $59}'` - tprandtl=`echo ${oi} | awk '{print $60}'` - ribmax=`echo ${oi} | awk '{print $61}'` - atmco2=`echo ${oi} | awk '{print $62}'` - thcrit=`echo ${oi} | awk '{print $63}'` - smfire=`echo ${oi} | awk '{print $64}'` - ifire=`echo ${oi} | awk '{print $65}'` - fireparm=`echo ${oi} | awk '{print $66}'` - ipercol=`echo ${oi} | awk '{print $67}'` - runoff=`echo ${oi} | awk '{print $68}'` - imetrad=`echo ${oi} | awk '{print $69}'` - ibranch=`echo ${oi} | awk '{print $70}'` - icanrad=`echo ${oi} | awk '{print $71}'` - crown=`echo ${oi} | awk '{print $72}'` - ltransvis=`echo ${oi} | awk '{print $73}'` - lreflectvis=`echo ${oi} | awk '{print $74}'` - ltransnir=`echo ${oi} | awk '{print $75}'` - lreflectnir=`echo ${oi} | awk '{print $76}'` - orienttree=`echo ${oi} | awk '{print $77}'` - orientgrass=`echo ${oi} | awk '{print $78}'` - clumptree=`echo ${oi} | awk '{print $79}'` - clumpgrass=`echo ${oi} | awk '{print $80}'` - ivegtdyn=`echo ${oi} | awk '{print $81}'` - igndvap=`echo ${oi} | awk '{print $82}'` - iphen=`echo ${oi} | awk '{print $83}'` - iallom=`echo ${oi} | awk '{print $84}'` - ibigleaf=`echo ${oi} | awk '{print $85}'` - irepro=`echo ${oi} | awk '{print $86}'` - treefall=`echo ${oi} | awk '{print $87}'` + initmode=`echo ${oi} | awk '{print $13}'` + iscenario=`echo ${oi} | awk '{print $14}'` + isizepft=`echo ${oi} | awk '{print $15}'` + polyisoil=`echo ${oi} | awk '{print $16}'` + polyntext=`echo ${oi} | awk '{print $17}'` + polysand=`echo ${oi} | awk '{print $18}'` + polyclay=`echo ${oi} | awk '{print $19}'` + polydepth=`echo ${oi} | awk '{print $20}'` + polysoilbc=`echo ${oi} | awk '{print $21}'` + polysldrain=`echo ${oi} | awk '{print $22}'` + polycol=`echo ${oi} | awk '{print $23}'` + slzres=`echo ${oi} | awk '{print $24}'` + queue=`echo ${oi} | awk '{print $25}'` + metdriver=`echo ${oi} | awk '{print $26}'` + dtlsm=`echo ${oi} | awk '{print $27}'` + vmfactc3=`echo ${oi} | awk '{print $28}'` + vmfactc4=`echo ${oi} | awk '{print $29}'` + mphototrc3=`echo ${oi} | awk '{print $30}'` + mphototec3=`echo ${oi} | awk '{print $31}'` + mphotoc4=`echo ${oi} | awk '{print $32}'` + bphotoblc3=`echo ${oi} | awk '{print $33}'` + bphotonlc3=`echo ${oi} | awk '{print $34}'` + bphotoc4=`echo ${oi} | awk '{print $35}'` + kwgrass=`echo ${oi} | awk '{print $36}'` + kwtree=`echo ${oi} | awk '{print $37}'` + gammac3=`echo ${oi} | awk '{print $38}'` + gammac4=`echo ${oi} | awk '{print $39}'` + d0grass=`echo ${oi} | awk '{print $40}'` + d0tree=`echo ${oi} | awk '{print $41}'` + alphac3=`echo ${oi} | awk '{print $42}'` + alphac4=`echo ${oi} | awk '{print $43}'` + klowco2=`echo ${oi} | awk '{print $44}'` + decomp=`echo ${oi} | awk '{print $45}'` + rrffact=`echo ${oi} | awk '{print $46}'` + growthresp=`echo ${oi} | awk '{print $47}'` + lwidthgrass=`echo ${oi} | awk '{print $48}'` + lwidthbltree=`echo ${oi} | awk '{print $49}'` + lwidthnltree=`echo ${oi} | awk '{print $50}'` + q10c3=`echo ${oi} | awk '{print $51}'` + q10c4=`echo ${oi} | awk '{print $52}'` + h2olimit=`echo ${oi} | awk '{print $53}'` + imortscheme=`echo ${oi} | awk '{print $54}'` + ddmortconst=`echo ${oi} | awk '{print $55}'` + isfclyrm=`echo ${oi} | awk '{print $56}'` + icanturb=`echo ${oi} | awk '{print $57}'` + ubmin=`echo ${oi} | awk '{print $58}'` + ugbmin=`echo ${oi} | awk '{print $59}'` + ustmin=`echo ${oi} | awk '{print $60}'` + gamm=`echo ${oi} | awk '{print $61}'` + gamh=`echo ${oi} | awk '{print $62}'` + tprandtl=`echo ${oi} | awk '{print $63}'` + ribmax=`echo ${oi} | awk '{print $64}'` + atmco2=`echo ${oi} | awk '{print $65}'` + thcrit=`echo ${oi} | awk '{print $66}'` + smfire=`echo ${oi} | awk '{print $67}'` + ifire=`echo ${oi} | awk '{print $68}'` + fireparm=`echo ${oi} | awk '{print $69}'` + ipercol=`echo ${oi} | awk '{print $70}'` + runoff=`echo ${oi} | awk '{print $71}'` + imetrad=`echo ${oi} | awk '{print $72}'` + ibranch=`echo ${oi} | awk '{print $73}'` + icanrad=`echo ${oi} | awk '{print $74}'` + crown=`echo ${oi} | awk '{print $75}'` + ltransvis=`echo ${oi} | awk '{print $76}'` + lreflectvis=`echo ${oi} | awk '{print $77}'` + ltransnir=`echo ${oi} | awk '{print $78}'` + lreflectnir=`echo ${oi} | awk '{print $79}'` + orienttree=`echo ${oi} | awk '{print $80}'` + orientgrass=`echo ${oi} | awk '{print $81}'` + clumptree=`echo ${oi} | awk '{print $82}'` + clumpgrass=`echo ${oi} | awk '{print $83}'` + ivegtdyn=`echo ${oi} | awk '{print $84}'` + igndvap=`echo ${oi} | awk '{print $85}'` + iphen=`echo ${oi} | awk '{print $86}'` + iallom=`echo ${oi} | awk '{print $87}'` + ibigleaf=`echo ${oi} | awk '{print $88}'` + irepro=`echo ${oi} | awk '{print $89}'` + treefall=`echo ${oi} | awk '{print $90}'` #---------------------------------------------------------------------------------------# diff --git a/ED/Template/epost.sh b/ED/Template/epost.sh index 374330498..167a53f57 100755 --- a/ED/Template/epost.sh +++ b/ED/Template/epost.sh @@ -17,6 +17,11 @@ openlava='n' seasonmona=1 #----- Census comparison. -----------------------------------------------------------------# varcycle='TRUE' # Find the average mortality for various cycles (TRUE/FALSE). +#----- Hourly comparison. -----------------------------------------------------------------# +usedistrib='edf' # Which distribution to plot on top of histograms: + # norm -- Normal distribution + # sn -- Skewed normal distribution (requires package sn) + # edf -- Empirical distribution function (function density) #----- Output format. ---------------------------------------------------------------------# outform='c("eps","png","pdf")' # x11 - On screen (deprecated on shell scripts) # png - Portable Network Graphics @@ -160,81 +165,84 @@ do monthz=`echo ${oi} | awk '{print $10}'` datez=`echo ${oi} | awk '{print $11}'` timez=`echo ${oi} | awk '{print $12}'` - polyisoil=`echo ${oi} | awk '{print $13}'` - polyntext=`echo ${oi} | awk '{print $14}'` - polysand=`echo ${oi} | awk '{print $15}'` - polyclay=`echo ${oi} | awk '{print $16}'` - polydepth=`echo ${oi} | awk '{print $17}'` - polysoilbc=`echo ${oi} | awk '{print $18}'` - polysldrain=`echo ${oi} | awk '{print $19}'` - polycol=`echo ${oi} | awk '{print $20}'` - slzres=`echo ${oi} | awk '{print $21}'` - queue=`echo ${oi} | awk '{print $22}'` - metdriver=`echo ${oi} | awk '{print $23}'` - dtlsm=`echo ${oi} | awk '{print $24}'` - vmfactc3=`echo ${oi} | awk '{print $25}'` - vmfactc4=`echo ${oi} | awk '{print $26}'` - mphototrc3=`echo ${oi} | awk '{print $27}'` - mphototec3=`echo ${oi} | awk '{print $28}'` - mphotoc4=`echo ${oi} | awk '{print $29}'` - bphotoblc3=`echo ${oi} | awk '{print $30}'` - bphotonlc3=`echo ${oi} | awk '{print $31}'` - bphotoc4=`echo ${oi} | awk '{print $32}'` - kwgrass=`echo ${oi} | awk '{print $33}'` - kwtree=`echo ${oi} | awk '{print $34}'` - gammac3=`echo ${oi} | awk '{print $35}'` - gammac4=`echo ${oi} | awk '{print $36}'` - d0grass=`echo ${oi} | awk '{print $37}'` - d0tree=`echo ${oi} | awk '{print $38}'` - alphac3=`echo ${oi} | awk '{print $39}'` - alphac4=`echo ${oi} | awk '{print $40}'` - klowco2=`echo ${oi} | awk '{print $41}'` - decomp=`echo ${oi} | awk '{print $42}'` - rrffact=`echo ${oi} | awk '{print $43}'` - growthresp=`echo ${oi} | awk '{print $44}'` - lwidthgrass=`echo ${oi} | awk '{print $45}'` - lwidthbltree=`echo ${oi} | awk '{print $46}'` - lwidthnltree=`echo ${oi} | awk '{print $47}'` - q10c3=`echo ${oi} | awk '{print $48}'` - q10c4=`echo ${oi} | awk '{print $49}'` - h2olimit=`echo ${oi} | awk '{print $50}'` - imortscheme=`echo ${oi} | awk '{print $51}'` - ddmortconst=`echo ${oi} | awk '{print $52}'` - isfclyrm=`echo ${oi} | awk '{print $53}'` - icanturb=`echo ${oi} | awk '{print $54}'` - ubmin=`echo ${oi} | awk '{print $55}'` - ugbmin=`echo ${oi} | awk '{print $56}'` - ustmin=`echo ${oi} | awk '{print $57}'` - gamm=`echo ${oi} | awk '{print $58}'` - gamh=`echo ${oi} | awk '{print $59}'` - tprandtl=`echo ${oi} | awk '{print $60}'` - ribmax=`echo ${oi} | awk '{print $61}'` - atmco2=`echo ${oi} | awk '{print $62}'` - thcrit=`echo ${oi} | awk '{print $63}'` - smfire=`echo ${oi} | awk '{print $64}'` - ifire=`echo ${oi} | awk '{print $65}'` - fireparm=`echo ${oi} | awk '{print $66}'` - ipercol=`echo ${oi} | awk '{print $67}'` - runoff=`echo ${oi} | awk '{print $68}'` - imetrad=`echo ${oi} | awk '{print $69}'` - ibranch=`echo ${oi} | awk '{print $70}'` - icanrad=`echo ${oi} | awk '{print $71}'` - crown=`echo ${oi} | awk '{print $72}'` - ltransvis=`echo ${oi} | awk '{print $73}'` - lreflectvis=`echo ${oi} | awk '{print $74}'` - ltransnir=`echo ${oi} | awk '{print $75}'` - lreflectnir=`echo ${oi} | awk '{print $76}'` - orienttree=`echo ${oi} | awk '{print $77}'` - orientgrass=`echo ${oi} | awk '{print $78}'` - clumptree=`echo ${oi} | awk '{print $79}'` - clumpgrass=`echo ${oi} | awk '{print $80}'` - ivegtdyn=`echo ${oi} | awk '{print $81}'` - igndvap=`echo ${oi} | awk '{print $82}'` - iphen=`echo ${oi} | awk '{print $83}'` - iallom=`echo ${oi} | awk '{print $84}'` - ibigleaf=`echo ${oi} | awk '{print $85}'` - irepro=`echo ${oi} | awk '{print $86}'` - treefall=`echo ${oi} | awk '{print $87}'` + initmode=`echo ${oi} | awk '{print $13}'` + iscenario=`echo ${oi} | awk '{print $14}'` + isizepft=`echo ${oi} | awk '{print $15}'` + polyisoil=`echo ${oi} | awk '{print $16}'` + polyntext=`echo ${oi} | awk '{print $17}'` + polysand=`echo ${oi} | awk '{print $18}'` + polyclay=`echo ${oi} | awk '{print $19}'` + polydepth=`echo ${oi} | awk '{print $20}'` + polysoilbc=`echo ${oi} | awk '{print $21}'` + polysldrain=`echo ${oi} | awk '{print $22}'` + polycol=`echo ${oi} | awk '{print $23}'` + slzres=`echo ${oi} | awk '{print $24}'` + queue=`echo ${oi} | awk '{print $25}'` + metdriver=`echo ${oi} | awk '{print $26}'` + dtlsm=`echo ${oi} | awk '{print $27}'` + vmfactc3=`echo ${oi} | awk '{print $28}'` + vmfactc4=`echo ${oi} | awk '{print $29}'` + mphototrc3=`echo ${oi} | awk '{print $30}'` + mphototec3=`echo ${oi} | awk '{print $31}'` + mphotoc4=`echo ${oi} | awk '{print $32}'` + bphotoblc3=`echo ${oi} | awk '{print $33}'` + bphotonlc3=`echo ${oi} | awk '{print $34}'` + bphotoc4=`echo ${oi} | awk '{print $35}'` + kwgrass=`echo ${oi} | awk '{print $36}'` + kwtree=`echo ${oi} | awk '{print $37}'` + gammac3=`echo ${oi} | awk '{print $38}'` + gammac4=`echo ${oi} | awk '{print $39}'` + d0grass=`echo ${oi} | awk '{print $40}'` + d0tree=`echo ${oi} | awk '{print $41}'` + alphac3=`echo ${oi} | awk '{print $42}'` + alphac4=`echo ${oi} | awk '{print $43}'` + klowco2=`echo ${oi} | awk '{print $44}'` + decomp=`echo ${oi} | awk '{print $45}'` + rrffact=`echo ${oi} | awk '{print $46}'` + growthresp=`echo ${oi} | awk '{print $47}'` + lwidthgrass=`echo ${oi} | awk '{print $48}'` + lwidthbltree=`echo ${oi} | awk '{print $49}'` + lwidthnltree=`echo ${oi} | awk '{print $50}'` + q10c3=`echo ${oi} | awk '{print $51}'` + q10c4=`echo ${oi} | awk '{print $52}'` + h2olimit=`echo ${oi} | awk '{print $53}'` + imortscheme=`echo ${oi} | awk '{print $54}'` + ddmortconst=`echo ${oi} | awk '{print $55}'` + isfclyrm=`echo ${oi} | awk '{print $56}'` + icanturb=`echo ${oi} | awk '{print $57}'` + ubmin=`echo ${oi} | awk '{print $58}'` + ugbmin=`echo ${oi} | awk '{print $59}'` + ustmin=`echo ${oi} | awk '{print $60}'` + gamm=`echo ${oi} | awk '{print $61}'` + gamh=`echo ${oi} | awk '{print $62}'` + tprandtl=`echo ${oi} | awk '{print $63}'` + ribmax=`echo ${oi} | awk '{print $64}'` + atmco2=`echo ${oi} | awk '{print $65}'` + thcrit=`echo ${oi} | awk '{print $66}'` + smfire=`echo ${oi} | awk '{print $67}'` + ifire=`echo ${oi} | awk '{print $68}'` + fireparm=`echo ${oi} | awk '{print $69}'` + ipercol=`echo ${oi} | awk '{print $70}'` + runoff=`echo ${oi} | awk '{print $71}'` + imetrad=`echo ${oi} | awk '{print $72}'` + ibranch=`echo ${oi} | awk '{print $73}'` + icanrad=`echo ${oi} | awk '{print $74}'` + crown=`echo ${oi} | awk '{print $75}'` + ltransvis=`echo ${oi} | awk '{print $76}'` + lreflectvis=`echo ${oi} | awk '{print $77}'` + ltransnir=`echo ${oi} | awk '{print $78}'` + lreflectnir=`echo ${oi} | awk '{print $79}'` + orienttree=`echo ${oi} | awk '{print $80}'` + orientgrass=`echo ${oi} | awk '{print $81}'` + clumptree=`echo ${oi} | awk '{print $82}'` + clumpgrass=`echo ${oi} | awk '{print $83}'` + ivegtdyn=`echo ${oi} | awk '{print $84}'` + igndvap=`echo ${oi} | awk '{print $85}'` + iphen=`echo ${oi} | awk '{print $86}'` + iallom=`echo ${oi} | awk '{print $87}'` + ibigleaf=`echo ${oi} | awk '{print $88}'` + irepro=`echo ${oi} | awk '{print $89}'` + treefall=`echo ${oi} | awk '{print $90}'` #---------------------------------------------------------------------------------------# @@ -500,6 +508,7 @@ do sed -i s@mymonthsdrought@${monthsdrought}@g ${here}/${polyname}/${script} sed -i s@myvarcycle@${varcycle}@g ${here}/${polyname}/${script} sed -i s@thisoutform@${outform}@g ${here}/${polyname}/${script} + sed -i s@mydistrib@${usedistrib}@g ${here}/${polyname}/${script} sed -i s@mymetcyca@${metcyca}@g ${here}/${polyname}/${script} sed -i s@mymetcycz@${metcycz}@g ${here}/${polyname}/${script} diff --git a/ED/Template/joborder.txt b/ED/Template/joborder.txt index 1dd8ff514..ebcbb73a8 100644 --- a/ED/Template/joborder.txt +++ b/ED/Template/joborder.txt @@ -1,107 +1,107 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -POLYGON_NAME IATA LONGITUDE LATITUDE YEARA MONTHA DAYA TIMEA YEARZ MONTHZ DAYZ TIMEZ ISOIL NTEXT SAND CLAY DEPTH ISOILBC SLDRAIN COLOUR SLZRES QUEUE MET_DRIVER DTLSM VMFACT_C3 VMFACT_C4 MPHOTO_TRC3 MPHOTO_TEC3 MPHOTO_C4 BPHOTO_BLC3 BPHOTO_NLC3 BPHOTO_C4 KW_GRASS KW_TREE GAMMA_C3 GAMMA_C4 D0_GRASS D0_TREE ALPHA_C3 ALPHA_C4 KLOWCO2 DECOMP_SCHEME RRFFACT GROWTHRESP LWIDTH_GRASS LWIDTH_BLTREE LWIDTH_NLTREE Q10_C3 Q10_C4 H2O_LIMIT IMORT_SCHEME DDMORT_CONST ISFCLYRM ICANTURB UBMIN UGBMIN USTMIN GAMM GAMH TPRANDTL RIBMAX ATMCO2 THCRIT SM_FIRE IFIRE FIRE_PARM IPERCOL RUNOFF_TIME IMETRAD IBRANCH ICANRAD CROWN_MOD LTRANS_VIS LREFLECT_VIS LTRANS_NIR LREFLECT_NIR ORIENT_TREE ORIENT_GRASS CLUMP_TREE CLUMP_GRASS IVEGTDYN IGNDVAP IPHEN IALLOM IBIGLEAF IREPRO TREEFALL ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -harvard hvd -72.170 42.540 1199 05 01 0000 1700 01 01 0000 2 2 -1.000 -1.000 E 1 90 2 0 moorcroft_6100b Harvard 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -tonzi tzi -120.894 38.427 1199 05 01 0000 1700 01 01 0000 2 5 0.447 0.191 D 1 90 2 0 moorcroft_6100b Tonzi 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -manaus_km34 m34 -60.209 -2.609 1200 01 01 0000 1700 01 01 0000 2 11 0.200 0.680 H 1 90 2 0 moorcroft_6100b Manaus_Km34 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -caxiuana cax -51.458 -1.720 1200 01 01 0000 1700 01 01 0000 2 16 0.380 0.440 D 2 6 2 0 moorcroft_6100b Caxiuana 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -santarem_km67 s67 -54.959 -2.857 1200 01 01 0000 1700 01 01 0000 2 17 -1.000 -1.000 H 1 90 2 0 moorcroft_6100b Santarem_Km67 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -santarem_km83 s83 -54.971 -3.018 1200 01 01 0000 1700 01 01 0000 2 16 0.390 0.590 H 1 90 2 0 moorcroft_6100b Santarem_Km83 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -rebio_jaru rja -61.931 -10.083 1200 01 01 0000 1700 01 01 0000 2 2 0.800 0.100 C 2 6 2 0 moorcroft_6100b Rebio_Jaru 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -pedegigante pdg -47.650 -21.619 1200 01 01 0000 1700 01 01 0000 2 2 0.850 0.030 F 1 90 2 0 moorcroft_6100b Pe-de-Gigante 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -paracou gyf -52.912 5.282 1200 01 01 0000 1700 01 01 0000 2 6 0.562 0.345 C 2 6 2 0 moorcroft_6100b Paracou 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -bananal ban -50.159 -9.824 1200 01 01 0000 1700 01 01 0000 2 9 0.240 0.370 C 1 90 2 0 moorcroft_6100b Bananal 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -petrolina pnz -40.370 -9.165 1200 01 01 0000 1700 01 01 0000 2 2 0.821 0.052 C 2 15 2 0 moorcroft_6100b Petrolina 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -fazendans fns -62.357 -10.762 1200 01 01 0000 1700 01 01 0000 2 2 0.800 0.100 G 1 90 2 0 moorcroft_6100b Fazenda_Nossa_Senhora 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -santarem_km77 s77 -54.537 -3.012 1200 01 01 0000 1700 01 01 0000 2 17 -1.000 -1.000 H 1 90 2 0 moorcroft_6100b Santarem_Km77 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -la_lorena lor -69.991 -3.056 1200 01 01 0000 1700 01 01 0000 2 9 0.380 0.310 A 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -el_zafire zar -69.902 -4.007 1200 01 01 0000 1700 01 01 0000 2 2 0.748 0.006 B 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -allpahuayo alp -73.437 -3.953 1200 01 01 0000 1700 01 01 0000 2 1 0.937 0.026 D 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -tambopata tam -69.271 -12.830 1200 01 01 0000 1700 01 01 0000 2 11 0.400 0.430 B 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -kenia qea -62.730 -16.010 1200 01 01 0000 1700 01 01 0000 2 3 0.760 0.160 D 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -barro_colorado bci -79.850 9.160 1200 01 01 0000 1700 01 01 0000 2 17 0.200 0.420 D 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -cardoso czi -48.010 -25.096 1200 01 01 0000 1700 01 01 0000 2 1 0.950 0.010 C 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -la_selva lzv -84.010 10.430 1200 01 01 0000 1700 01 01 0000 2 6 0.570 0.290 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -la_planada lpn -77.994 1.116 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 H 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -sinop ops -55.325 -11.412 1200 01 01 0000 1700 01 01 0000 2 2 0.840 0.120 E 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -yasuni ysn -76.396 -0.686 1200 01 01 0000 1700 01 01 0000 2 4 0.259 0.255 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -alta_floresta afl -56.100 -9.867 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -angra_dos_reis aei -44.300 -22.970 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -araguaiana ayx -51.810 -15.710 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -araracuara arc -72.398 -0.601 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -asuncion asu -57.560 -25.300 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -belo_horizonte cnf -43.950 -19.850 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -belem bel -48.480 -1.380 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -blumenau bnu -49.060 -26.920 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -boa_vista bvb -60.610 2.920 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -bogota bog -74.100 4.650 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -brasilia bsb -47.910 -15.860 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -cabo_frio cfb -42.070 -22.490 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -cajazeiras cjz -38.570 -6.900 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -calabozo clz -67.420 8.920 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -canarana qnr -52.250 -13.560 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -carajas cks -50.722 -5.786 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -chaiten wch -72.500 -42.500 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -ciudad_guayana cgu -62.762 8.289 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -cochabamba cbb -66.170 -17.420 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -cuiaba cgb -56.100 -15.600 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -curitiba cwb -49.230 -25.410 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -diamantino dmt -56.620 -14.370 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -dourados dou -54.810 -22.220 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -el_triunfo etf -67.000 -13.500 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -erechim erm -52.240 -27.610 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -eunapolis enp -39.580 -16.330 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -fortaleza for -38.530 -3.780 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -iguape igp -47.590 -24.630 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -imperatriz imp -47.460 -5.530 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -iquique iqq -69.970 -20.240 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -itabaiana ibn -37.420 -10.680 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -itapeva ipv -48.880 -23.980 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -jacareacanga jcr -57.777 -6.233 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -jiparana jpr -61.980 -10.860 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -joao_pessoa jpa -34.910 -7.100 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -la_esmeralda lfe -65.540 3.170 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -labrea lbr -64.770 -7.280 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -lencois lec -41.350 -12.480 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -linden lyd -58.302 6.015 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -llochegua llo -73.908 -12.410 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -macapa mcp -51.090 0.330 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -malalcahuello zmh -71.580 -38.470 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -manaus mao -60.020 -3.110 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -manicore mnx -61.280 -5.820 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -maracarume zme -45.954 -2.041 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -maringa mgf -52.010 -23.470 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -mariscal_estagarribia esg -60.624 -22.043 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -montes_claros moc -43.820 -16.710 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -neuquen nqn -68.000 -39.000 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -oeiras oei -42.160 -7.020 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -palmas pmw -48.360 -10.290 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -paramaribo pbm -55.150 5.830 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -piura piu -80.617 -5.207 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -porto_de_moz ptq -52.236 -1.741 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -pucallpa pcl -74.570 -8.380 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -puerto_suarez psz -58.090 -18.580 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -quibdo uib -76.640 5.690 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -recife rec -34.910 -8.070 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -redencao rdc -49.980 -8.030 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -ribeirao_preto rao -47.780 -21.140 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -rio_branco rbr -67.890 -9.870 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -riohacha rch -72.926 11.240 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -salta sla -65.483 -24.850 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -san_pedro zpe -54.110 -26.630 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -sao_felix_araguaia sxo -50.690 -11.630 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -sao_felix_xingu sxx -51.950 -6.640 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -sao_luis slz -44.236 -2.586 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -sao_gabriel sjl -66.980 -0.140 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -santa_fe sfn -60.809 -31.712 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -santarem stm -54.959 -2.857 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -sobral qbx -39.990 -4.010 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -tarauaca trq -70.781 -8.157 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -tefe tff -64.720 -3.380 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -teresina the -42.800 -5.090 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -tirios obi -55.940 2.220 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -tolhuin tqh -67.222 -54.502 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -vina_del_mar kna -71.480 -32.950 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -vilhena bvh -60.100 -12.730 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -vitoria vix -40.390 -20.310 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 -xingu xgu -52.636 -9.692 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +POLYGON_NAME IATA LONGITUDE LATITUDE YEARA MONTHA DAYA TIMEA YEARZ MONTHZ DAYZ TIMEZ INIT_MODE ISCENARIO ISIZEPFT ISOIL NTEXT SAND CLAY DEPTH ISOILBC SLDRAIN COLOUR SLZRES QUEUE MET_DRIVER DTLSM VMFACT_C3 VMFACT_C4 MPHOTO_TRC3 MPHOTO_TEC3 MPHOTO_C4 BPHOTO_BLC3 BPHOTO_NLC3 BPHOTO_C4 KW_GRASS KW_TREE GAMMA_C3 GAMMA_C4 D0_GRASS D0_TREE ALPHA_C3 ALPHA_C4 KLOWCO2 DECOMP_SCHEME RRFFACT GROWTHRESP LWIDTH_GRASS LWIDTH_BLTREE LWIDTH_NLTREE Q10_C3 Q10_C4 H2O_LIMIT IMORT_SCHEME DDMORT_CONST ISFCLYRM ICANTURB UBMIN UGBMIN USTMIN GAMM GAMH TPRANDTL RIBMAX ATMCO2 THCRIT SM_FIRE IFIRE FIRE_PARM IPERCOL RUNOFF_TIME IMETRAD IBRANCH ICANRAD CROWN_MOD LTRANS_VIS LREFLECT_VIS LTRANS_NIR LREFLECT_NIR ORIENT_TREE ORIENT_GRASS CLUMP_TREE CLUMP_GRASS IVEGTDYN IGNDVAP IPHEN IALLOM IBIGLEAF IREPRO TREEFALL +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +harvard hvd -72.170 42.540 1199 05 01 0000 1700 01 01 0000 6 0 0 2 2 -1.000 -1.000 E 1 90 2 0 moorcroft_6100b Harvard 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +tonzi tzi -120.894 38.427 1199 05 01 0000 1700 01 01 0000 6 0 0 2 5 0.447 0.191 D 1 90 2 0 moorcroft_6100b Tonzi 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +manaus_km34 m34 -60.209 -2.609 1200 01 01 0000 1700 01 01 0000 6 0 0 2 11 0.200 0.680 H 1 90 2 0 moorcroft_6100b Manaus_Km34 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +caxiuana cax -51.458 -1.720 1200 01 01 0000 1700 01 01 0000 6 0 0 2 16 0.380 0.440 D 2 6 2 0 moorcroft_6100b Caxiuana 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +santarem_km67 s67 -54.959 -2.857 1200 01 01 0000 1700 01 01 0000 6 0 0 2 17 -1.000 -1.000 H 1 90 2 0 moorcroft_6100b Santarem_Km67 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +santarem_km83 s83 -54.971 -3.018 1200 01 01 0000 1700 01 01 0000 6 0 0 2 16 0.390 0.590 H 1 90 2 0 moorcroft_6100b Santarem_Km83 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +rebio_jaru rja -61.931 -10.083 1200 01 01 0000 1700 01 01 0000 6 0 0 2 2 0.800 0.100 C 2 6 2 0 moorcroft_6100b Rebio_Jaru 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +pedegigante pdg -47.650 -21.619 1200 01 01 0000 1700 01 01 0000 6 0 0 2 2 0.850 0.030 F 1 90 2 0 moorcroft_6100b Pe-de-Gigante 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +paracou gyf -52.912 5.282 1200 01 01 0000 1700 01 01 0000 6 0 0 2 6 0.562 0.345 C 2 6 2 0 moorcroft_6100b Paracou 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +bananal ban -50.159 -9.824 1200 01 01 0000 1700 01 01 0000 6 0 0 2 9 0.240 0.370 C 1 90 2 0 moorcroft_6100b Bananal 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +petrolina pnz -40.370 -9.165 1200 01 01 0000 1700 01 01 0000 6 0 0 2 2 0.821 0.052 C 2 15 2 0 moorcroft_6100b Petrolina 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +fazendans fns -62.357 -10.762 1200 01 01 0000 1700 01 01 0000 6 0 0 2 2 0.800 0.100 G 1 90 2 0 moorcroft_6100b Fazenda_Nossa_Senhora 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +santarem_km77 s77 -54.537 -3.012 1200 01 01 0000 1700 01 01 0000 6 0 0 2 17 -1.000 -1.000 H 1 90 2 0 moorcroft_6100b Santarem_Km77 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +la_lorena lor -69.991 -3.056 1200 01 01 0000 1700 01 01 0000 6 0 0 2 9 0.380 0.310 A 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +el_zafire zar -69.902 -4.007 1200 01 01 0000 1700 01 01 0000 6 0 0 2 2 0.748 0.006 B 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +allpahuayo alp -73.437 -3.953 1200 01 01 0000 1700 01 01 0000 6 0 0 2 1 0.937 0.026 D 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +tambopata tam -69.271 -12.830 1200 01 01 0000 1700 01 01 0000 6 0 0 2 11 0.400 0.430 B 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +kenia qea -62.730 -16.010 1200 01 01 0000 1700 01 01 0000 6 0 0 2 3 0.760 0.160 D 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +barro_colorado bci -79.850 9.160 1200 01 01 0000 1700 01 01 0000 6 0 0 2 17 0.200 0.420 D 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +cardoso czi -48.010 -25.096 1200 01 01 0000 1700 01 01 0000 6 0 0 2 1 0.950 0.010 C 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +la_selva lzv -84.010 10.430 1200 01 01 0000 1700 01 01 0000 6 0 0 2 6 0.570 0.290 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +la_planada lpn -77.994 1.116 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 H 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +sinop ops -55.325 -11.412 1200 01 01 0000 1700 01 01 0000 6 0 0 2 2 0.840 0.120 E 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +yasuni ysn -76.396 -0.686 1200 01 01 0000 1700 01 01 0000 6 0 0 2 4 0.259 0.255 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +alta_floresta afl -56.100 -9.867 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +angra_dos_reis aei -44.300 -22.970 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +araguaiana ayx -51.810 -15.710 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +araracuara arc -72.398 -0.601 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +asuncion asu -57.560 -25.300 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +belo_horizonte cnf -43.950 -19.850 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +belem bel -48.480 -1.380 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +blumenau bnu -49.060 -26.920 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +boa_vista bvb -60.610 2.920 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +bogota bog -74.100 4.650 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +brasilia bsb -47.910 -15.860 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +cabo_frio cfb -42.070 -22.490 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +cajazeiras cjz -38.570 -6.900 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +calabozo clz -67.420 8.920 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +canarana qnr -52.250 -13.560 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +carajas cks -50.722 -5.786 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +chaiten wch -72.500 -42.500 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +ciudad_guayana cgu -62.762 8.289 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +cochabamba cbb -66.170 -17.420 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +cuiaba cgb -56.100 -15.600 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +curitiba cwb -49.230 -25.410 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +diamantino dmt -56.620 -14.370 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +dourados dou -54.810 -22.220 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +el_triunfo etf -67.000 -13.500 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +erechim erm -52.240 -27.610 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +eunapolis enp -39.580 -16.330 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +fortaleza for -38.530 -3.780 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +iguape igp -47.590 -24.630 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +imperatriz imp -47.460 -5.530 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +iquique iqq -69.970 -20.240 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +itabaiana ibn -37.420 -10.680 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +itapeva ipv -48.880 -23.980 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +jacareacanga jcr -57.777 -6.233 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +jiparana jpr -61.980 -10.860 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +joao_pessoa jpa -34.910 -7.100 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +la_esmeralda lfe -65.540 3.170 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +labrea lbr -64.770 -7.280 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +lencois lec -41.350 -12.480 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +linden lyd -58.302 6.015 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +llochegua llo -73.908 -12.410 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +macapa mcp -51.090 0.330 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +malalcahuello zmh -71.580 -38.470 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +manaus mao -60.020 -3.110 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +manicore mnx -61.280 -5.820 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +maracarume zme -45.954 -2.041 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +maringa mgf -52.010 -23.470 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +mariscal_estagarribia esg -60.624 -22.043 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +montes_claros moc -43.820 -16.710 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +neuquen nqn -68.000 -39.000 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +oeiras oei -42.160 -7.020 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +palmas pmw -48.360 -10.290 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +paramaribo pbm -55.150 5.830 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +piura piu -80.617 -5.207 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +porto_de_moz ptq -52.236 -1.741 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +pucallpa pcl -74.570 -8.380 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +puerto_suarez psz -58.090 -18.580 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +quibdo uib -76.640 5.690 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +recife rec -34.910 -8.070 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +redencao rdc -49.980 -8.030 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +ribeirao_preto rao -47.780 -21.140 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +rio_branco rbr -67.890 -9.870 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +riohacha rch -72.926 11.240 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +salta sla -65.483 -24.850 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +san_pedro zpe -54.110 -26.630 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +sao_felix_araguaia sxo -50.690 -11.630 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +sao_felix_xingu sxx -51.950 -6.640 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +sao_luis slz -44.236 -2.586 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +sao_gabriel sjl -66.980 -0.140 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +santa_fe sfn -60.809 -31.712 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +santarem stm -54.959 -2.857 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +sobral qbx -39.990 -4.010 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +tarauaca trq -70.781 -8.157 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +tefe tff -64.720 -3.380 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +teresina the -42.800 -5.090 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +tirios obi -55.940 2.220 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +tolhuin tqh -67.222 -54.502 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +vina_del_mar kna -71.480 -32.950 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +vilhena bvh -60.100 -12.730 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +vitoria vix -40.390 -20.310 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +xingu xgu -52.636 -9.692 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 diff --git a/ED/Template/nc_check_run.sh b/ED/Template/nc_check_run.sh index 7b4442242..623501ee8 100755 --- a/ED/Template/nc_check_run.sh +++ b/ED/Template/nc_check_run.sh @@ -35,81 +35,84 @@ do monthz=`echo ${oi} | awk '{print $10}'` datez=`echo ${oi} | awk '{print $11}'` timez=`echo ${oi} | awk '{print $12}'` - polyisoil=`echo ${oi} | awk '{print $13}'` - polyntext=`echo ${oi} | awk '{print $14}'` - polysand=`echo ${oi} | awk '{print $15}'` - polyclay=`echo ${oi} | awk '{print $16}'` - polydepth=`echo ${oi} | awk '{print $17}'` - polysoilbc=`echo ${oi} | awk '{print $18}'` - polysldrain=`echo ${oi} | awk '{print $19}'` - polycol=`echo ${oi} | awk '{print $20}'` - slzres=`echo ${oi} | awk '{print $21}'` - queue=`echo ${oi} | awk '{print $22}'` - metdriver=`echo ${oi} | awk '{print $23}'` - dtlsm=`echo ${oi} | awk '{print $24}'` - vmfactc3=`echo ${oi} | awk '{print $25}'` - vmfactc4=`echo ${oi} | awk '{print $26}'` - mphototrc3=`echo ${oi} | awk '{print $27}'` - mphototec3=`echo ${oi} | awk '{print $28}'` - mphotoc4=`echo ${oi} | awk '{print $29}'` - bphotoblc3=`echo ${oi} | awk '{print $30}'` - bphotonlc3=`echo ${oi} | awk '{print $31}'` - bphotoc4=`echo ${oi} | awk '{print $32}'` - kwgrass=`echo ${oi} | awk '{print $33}'` - kwtree=`echo ${oi} | awk '{print $34}'` - gammac3=`echo ${oi} | awk '{print $35}'` - gammac4=`echo ${oi} | awk '{print $36}'` - d0grass=`echo ${oi} | awk '{print $37}'` - d0tree=`echo ${oi} | awk '{print $38}'` - alphac3=`echo ${oi} | awk '{print $39}'` - alphac4=`echo ${oi} | awk '{print $40}'` - klowco2=`echo ${oi} | awk '{print $41}'` - decomp=`echo ${oi} | awk '{print $42}'` - rrffact=`echo ${oi} | awk '{print $43}'` - growthresp=`echo ${oi} | awk '{print $44}'` - lwidthgrass=`echo ${oi} | awk '{print $45}'` - lwidthbltree=`echo ${oi} | awk '{print $46}'` - lwidthnltree=`echo ${oi} | awk '{print $47}'` - q10c3=`echo ${oi} | awk '{print $48}'` - q10c4=`echo ${oi} | awk '{print $49}'` - h2olimit=`echo ${oi} | awk '{print $50}'` - imortscheme=`echo ${oi} | awk '{print $51}'` - ddmortconst=`echo ${oi} | awk '{print $52}'` - isfclyrm=`echo ${oi} | awk '{print $53}'` - icanturb=`echo ${oi} | awk '{print $54}'` - ubmin=`echo ${oi} | awk '{print $55}'` - ugbmin=`echo ${oi} | awk '{print $56}'` - ustmin=`echo ${oi} | awk '{print $57}'` - gamm=`echo ${oi} | awk '{print $58}'` - gamh=`echo ${oi} | awk '{print $59}'` - tprandtl=`echo ${oi} | awk '{print $60}'` - ribmax=`echo ${oi} | awk '{print $61}'` - atmco2=`echo ${oi} | awk '{print $62}'` - thcrit=`echo ${oi} | awk '{print $63}'` - smfire=`echo ${oi} | awk '{print $64}'` - ifire=`echo ${oi} | awk '{print $65}'` - fireparm=`echo ${oi} | awk '{print $66}'` - ipercol=`echo ${oi} | awk '{print $67}'` - runoff=`echo ${oi} | awk '{print $68}'` - imetrad=`echo ${oi} | awk '{print $69}'` - ibranch=`echo ${oi} | awk '{print $70}'` - icanrad=`echo ${oi} | awk '{print $71}'` - crown=`echo ${oi} | awk '{print $72}'` - ltransvis=`echo ${oi} | awk '{print $73}'` - lreflectvis=`echo ${oi} | awk '{print $74}'` - ltransnir=`echo ${oi} | awk '{print $75}'` - lreflectnir=`echo ${oi} | awk '{print $76}'` - orienttree=`echo ${oi} | awk '{print $77}'` - orientgrass=`echo ${oi} | awk '{print $78}'` - clumptree=`echo ${oi} | awk '{print $79}'` - clumpgrass=`echo ${oi} | awk '{print $80}'` - ivegtdyn=`echo ${oi} | awk '{print $81}'` - igndvap=`echo ${oi} | awk '{print $82}'` - iphen=`echo ${oi} | awk '{print $83}'` - iallom=`echo ${oi} | awk '{print $84}'` - ibigleaf=`echo ${oi} | awk '{print $85}'` - irepro=`echo ${oi} | awk '{print $86}'` - treefall=`echo ${oi} | awk '{print $87}'` + initmode=`echo ${oi} | awk '{print $13}'` + iscenario=`echo ${oi} | awk '{print $14}'` + isizepft=`echo ${oi} | awk '{print $15}'` + polyisoil=`echo ${oi} | awk '{print $16}'` + polyntext=`echo ${oi} | awk '{print $17}'` + polysand=`echo ${oi} | awk '{print $18}'` + polyclay=`echo ${oi} | awk '{print $19}'` + polydepth=`echo ${oi} | awk '{print $20}'` + polysoilbc=`echo ${oi} | awk '{print $21}'` + polysldrain=`echo ${oi} | awk '{print $22}'` + polycol=`echo ${oi} | awk '{print $23}'` + slzres=`echo ${oi} | awk '{print $24}'` + queue=`echo ${oi} | awk '{print $25}'` + metdriver=`echo ${oi} | awk '{print $26}'` + dtlsm=`echo ${oi} | awk '{print $27}'` + vmfactc3=`echo ${oi} | awk '{print $28}'` + vmfactc4=`echo ${oi} | awk '{print $29}'` + mphototrc3=`echo ${oi} | awk '{print $30}'` + mphototec3=`echo ${oi} | awk '{print $31}'` + mphotoc4=`echo ${oi} | awk '{print $32}'` + bphotoblc3=`echo ${oi} | awk '{print $33}'` + bphotonlc3=`echo ${oi} | awk '{print $34}'` + bphotoc4=`echo ${oi} | awk '{print $35}'` + kwgrass=`echo ${oi} | awk '{print $36}'` + kwtree=`echo ${oi} | awk '{print $37}'` + gammac3=`echo ${oi} | awk '{print $38}'` + gammac4=`echo ${oi} | awk '{print $39}'` + d0grass=`echo ${oi} | awk '{print $40}'` + d0tree=`echo ${oi} | awk '{print $41}'` + alphac3=`echo ${oi} | awk '{print $42}'` + alphac4=`echo ${oi} | awk '{print $43}'` + klowco2=`echo ${oi} | awk '{print $44}'` + decomp=`echo ${oi} | awk '{print $45}'` + rrffact=`echo ${oi} | awk '{print $46}'` + growthresp=`echo ${oi} | awk '{print $47}'` + lwidthgrass=`echo ${oi} | awk '{print $48}'` + lwidthbltree=`echo ${oi} | awk '{print $49}'` + lwidthnltree=`echo ${oi} | awk '{print $50}'` + q10c3=`echo ${oi} | awk '{print $51}'` + q10c4=`echo ${oi} | awk '{print $52}'` + h2olimit=`echo ${oi} | awk '{print $53}'` + imortscheme=`echo ${oi} | awk '{print $54}'` + ddmortconst=`echo ${oi} | awk '{print $55}'` + isfclyrm=`echo ${oi} | awk '{print $56}'` + icanturb=`echo ${oi} | awk '{print $57}'` + ubmin=`echo ${oi} | awk '{print $58}'` + ugbmin=`echo ${oi} | awk '{print $59}'` + ustmin=`echo ${oi} | awk '{print $60}'` + gamm=`echo ${oi} | awk '{print $61}'` + gamh=`echo ${oi} | awk '{print $62}'` + tprandtl=`echo ${oi} | awk '{print $63}'` + ribmax=`echo ${oi} | awk '{print $64}'` + atmco2=`echo ${oi} | awk '{print $65}'` + thcrit=`echo ${oi} | awk '{print $66}'` + smfire=`echo ${oi} | awk '{print $67}'` + ifire=`echo ${oi} | awk '{print $68}'` + fireparm=`echo ${oi} | awk '{print $69}'` + ipercol=`echo ${oi} | awk '{print $70}'` + runoff=`echo ${oi} | awk '{print $71}'` + imetrad=`echo ${oi} | awk '{print $72}'` + ibranch=`echo ${oi} | awk '{print $73}'` + icanrad=`echo ${oi} | awk '{print $74}'` + crown=`echo ${oi} | awk '{print $75}'` + ltransvis=`echo ${oi} | awk '{print $76}'` + lreflectvis=`echo ${oi} | awk '{print $77}'` + ltransnir=`echo ${oi} | awk '{print $78}'` + lreflectnir=`echo ${oi} | awk '{print $79}'` + orienttree=`echo ${oi} | awk '{print $80}'` + orientgrass=`echo ${oi} | awk '{print $81}'` + clumptree=`echo ${oi} | awk '{print $82}'` + clumpgrass=`echo ${oi} | awk '{print $83}'` + ivegtdyn=`echo ${oi} | awk '{print $84}'` + igndvap=`echo ${oi} | awk '{print $85}'` + iphen=`echo ${oi} | awk '{print $86}'` + iallom=`echo ${oi} | awk '{print $87}'` + ibigleaf=`echo ${oi} | awk '{print $88}'` + irepro=`echo ${oi} | awk '{print $89}'` + treefall=`echo ${oi} | awk '{print $90}'` #---------------------------------------------------------------------------------------# diff --git a/ED/Template/nc_spawn.sh b/ED/Template/nc_spawn.sh index cc15cce4e..c9f827c15 100755 --- a/ED/Template/nc_spawn.sh +++ b/ED/Template/nc_spawn.sh @@ -50,81 +50,84 @@ do monthz=`echo ${oi} | awk '{print $10}'` datez=`echo ${oi} | awk '{print $11}'` timez=`echo ${oi} | awk '{print $12}'` - polyisoil=`echo ${oi} | awk '{print $13}'` - polyntext=`echo ${oi} | awk '{print $14}'` - polysand=`echo ${oi} | awk '{print $15}'` - polyclay=`echo ${oi} | awk '{print $16}'` - polydepth=`echo ${oi} | awk '{print $17}'` - polysoilbc=`echo ${oi} | awk '{print $18}'` - polysldrain=`echo ${oi} | awk '{print $19}'` - polycol=`echo ${oi} | awk '{print $20}'` - slzres=`echo ${oi} | awk '{print $21}'` - queue=`echo ${oi} | awk '{print $22}'` - metdriver=`echo ${oi} | awk '{print $23}'` - dtlsm=`echo ${oi} | awk '{print $24}'` - vmfactc3=`echo ${oi} | awk '{print $25}'` - vmfactc4=`echo ${oi} | awk '{print $26}'` - mphototrc3=`echo ${oi} | awk '{print $27}'` - mphototec3=`echo ${oi} | awk '{print $28}'` - mphotoc4=`echo ${oi} | awk '{print $29}'` - bphotoblc3=`echo ${oi} | awk '{print $30}'` - bphotonlc3=`echo ${oi} | awk '{print $31}'` - bphotoc4=`echo ${oi} | awk '{print $32}'` - kwgrass=`echo ${oi} | awk '{print $33}'` - kwtree=`echo ${oi} | awk '{print $34}'` - gammac3=`echo ${oi} | awk '{print $35}'` - gammac4=`echo ${oi} | awk '{print $36}'` - d0grass=`echo ${oi} | awk '{print $37}'` - d0tree=`echo ${oi} | awk '{print $38}'` - alphac3=`echo ${oi} | awk '{print $39}'` - alphac4=`echo ${oi} | awk '{print $40}'` - klowco2=`echo ${oi} | awk '{print $41}'` - decomp=`echo ${oi} | awk '{print $42}'` - rrffact=`echo ${oi} | awk '{print $43}'` - growthresp=`echo ${oi} | awk '{print $44}'` - lwidthgrass=`echo ${oi} | awk '{print $45}'` - lwidthbltree=`echo ${oi} | awk '{print $46}'` - lwidthnltree=`echo ${oi} | awk '{print $47}'` - q10c3=`echo ${oi} | awk '{print $48}'` - q10c4=`echo ${oi} | awk '{print $49}'` - h2olimit=`echo ${oi} | awk '{print $50}'` - imortscheme=`echo ${oi} | awk '{print $51}'` - ddmortconst=`echo ${oi} | awk '{print $52}'` - isfclyrm=`echo ${oi} | awk '{print $53}'` - icanturb=`echo ${oi} | awk '{print $54}'` - ubmin=`echo ${oi} | awk '{print $55}'` - ugbmin=`echo ${oi} | awk '{print $56}'` - ustmin=`echo ${oi} | awk '{print $57}'` - gamm=`echo ${oi} | awk '{print $58}'` - gamh=`echo ${oi} | awk '{print $59}'` - tprandtl=`echo ${oi} | awk '{print $60}'` - ribmax=`echo ${oi} | awk '{print $61}'` - atmco2=`echo ${oi} | awk '{print $62}'` - thcrit=`echo ${oi} | awk '{print $63}'` - smfire=`echo ${oi} | awk '{print $64}'` - ifire=`echo ${oi} | awk '{print $65}'` - fireparm=`echo ${oi} | awk '{print $66}'` - ipercol=`echo ${oi} | awk '{print $67}'` - runoff=`echo ${oi} | awk '{print $68}'` - imetrad=`echo ${oi} | awk '{print $69}'` - ibranch=`echo ${oi} | awk '{print $70}'` - icanrad=`echo ${oi} | awk '{print $71}'` - crown=`echo ${oi} | awk '{print $72}'` - ltransvis=`echo ${oi} | awk '{print $73}'` - lreflectvis=`echo ${oi} | awk '{print $74}'` - ltransnir=`echo ${oi} | awk '{print $75}'` - lreflectnir=`echo ${oi} | awk '{print $76}'` - orienttree=`echo ${oi} | awk '{print $77}'` - orientgrass=`echo ${oi} | awk '{print $78}'` - clumptree=`echo ${oi} | awk '{print $79}'` - clumpgrass=`echo ${oi} | awk '{print $80}'` - ivegtdyn=`echo ${oi} | awk '{print $81}'` - igndvap=`echo ${oi} | awk '{print $82}'` - iphen=`echo ${oi} | awk '{print $83}'` - iallom=`echo ${oi} | awk '{print $84}'` - ibigleaf=`echo ${oi} | awk '{print $85}'` - irepro=`echo ${oi} | awk '{print $86}'` - treefall=`echo ${oi} | awk '{print $87}'` + initmode=`echo ${oi} | awk '{print $13}'` + iscenario=`echo ${oi} | awk '{print $14}'` + isizepft=`echo ${oi} | awk '{print $15}'` + polyisoil=`echo ${oi} | awk '{print $16}'` + polyntext=`echo ${oi} | awk '{print $17}'` + polysand=`echo ${oi} | awk '{print $18}'` + polyclay=`echo ${oi} | awk '{print $19}'` + polydepth=`echo ${oi} | awk '{print $20}'` + polysoilbc=`echo ${oi} | awk '{print $21}'` + polysldrain=`echo ${oi} | awk '{print $22}'` + polycol=`echo ${oi} | awk '{print $23}'` + slzres=`echo ${oi} | awk '{print $24}'` + queue=`echo ${oi} | awk '{print $25}'` + metdriver=`echo ${oi} | awk '{print $26}'` + dtlsm=`echo ${oi} | awk '{print $27}'` + vmfactc3=`echo ${oi} | awk '{print $28}'` + vmfactc4=`echo ${oi} | awk '{print $29}'` + mphototrc3=`echo ${oi} | awk '{print $30}'` + mphototec3=`echo ${oi} | awk '{print $31}'` + mphotoc4=`echo ${oi} | awk '{print $32}'` + bphotoblc3=`echo ${oi} | awk '{print $33}'` + bphotonlc3=`echo ${oi} | awk '{print $34}'` + bphotoc4=`echo ${oi} | awk '{print $35}'` + kwgrass=`echo ${oi} | awk '{print $36}'` + kwtree=`echo ${oi} | awk '{print $37}'` + gammac3=`echo ${oi} | awk '{print $38}'` + gammac4=`echo ${oi} | awk '{print $39}'` + d0grass=`echo ${oi} | awk '{print $40}'` + d0tree=`echo ${oi} | awk '{print $41}'` + alphac3=`echo ${oi} | awk '{print $42}'` + alphac4=`echo ${oi} | awk '{print $43}'` + klowco2=`echo ${oi} | awk '{print $44}'` + decomp=`echo ${oi} | awk '{print $45}'` + rrffact=`echo ${oi} | awk '{print $46}'` + growthresp=`echo ${oi} | awk '{print $47}'` + lwidthgrass=`echo ${oi} | awk '{print $48}'` + lwidthbltree=`echo ${oi} | awk '{print $49}'` + lwidthnltree=`echo ${oi} | awk '{print $50}'` + q10c3=`echo ${oi} | awk '{print $51}'` + q10c4=`echo ${oi} | awk '{print $52}'` + h2olimit=`echo ${oi} | awk '{print $53}'` + imortscheme=`echo ${oi} | awk '{print $54}'` + ddmortconst=`echo ${oi} | awk '{print $55}'` + isfclyrm=`echo ${oi} | awk '{print $56}'` + icanturb=`echo ${oi} | awk '{print $57}'` + ubmin=`echo ${oi} | awk '{print $58}'` + ugbmin=`echo ${oi} | awk '{print $59}'` + ustmin=`echo ${oi} | awk '{print $60}'` + gamm=`echo ${oi} | awk '{print $61}'` + gamh=`echo ${oi} | awk '{print $62}'` + tprandtl=`echo ${oi} | awk '{print $63}'` + ribmax=`echo ${oi} | awk '{print $64}'` + atmco2=`echo ${oi} | awk '{print $65}'` + thcrit=`echo ${oi} | awk '{print $66}'` + smfire=`echo ${oi} | awk '{print $67}'` + ifire=`echo ${oi} | awk '{print $68}'` + fireparm=`echo ${oi} | awk '{print $69}'` + ipercol=`echo ${oi} | awk '{print $70}'` + runoff=`echo ${oi} | awk '{print $71}'` + imetrad=`echo ${oi} | awk '{print $72}'` + ibranch=`echo ${oi} | awk '{print $73}'` + icanrad=`echo ${oi} | awk '{print $74}'` + crown=`echo ${oi} | awk '{print $75}'` + ltransvis=`echo ${oi} | awk '{print $76}'` + lreflectvis=`echo ${oi} | awk '{print $77}'` + ltransnir=`echo ${oi} | awk '{print $78}'` + lreflectnir=`echo ${oi} | awk '{print $79}'` + orienttree=`echo ${oi} | awk '{print $80}'` + orientgrass=`echo ${oi} | awk '{print $81}'` + clumptree=`echo ${oi} | awk '{print $82}'` + clumpgrass=`echo ${oi} | awk '{print $83}'` + ivegtdyn=`echo ${oi} | awk '{print $84}'` + igndvap=`echo ${oi} | awk '{print $85}'` + iphen=`echo ${oi} | awk '{print $86}'` + iallom=`echo ${oi} | awk '{print $87}'` + ibigleaf=`echo ${oi} | awk '{print $88}'` + irepro=`echo ${oi} | awk '{print $89}'` + treefall=`echo ${oi} | awk '{print $90}'` #---------------------------------------------------------------------------------------# diff --git a/ED/Template/nc_submitter.sh b/ED/Template/nc_submitter.sh index ecf40eb69..e403977e9 100755 --- a/ED/Template/nc_submitter.sh +++ b/ED/Template/nc_submitter.sh @@ -34,81 +34,84 @@ do monthz=`echo ${oi} | awk '{print $10}'` datez=`echo ${oi} | awk '{print $11}'` timez=`echo ${oi} | awk '{print $12}'` - polyisoil=`echo ${oi} | awk '{print $13}'` - polyntext=`echo ${oi} | awk '{print $14}'` - polysand=`echo ${oi} | awk '{print $15}'` - polyclay=`echo ${oi} | awk '{print $16}'` - polydepth=`echo ${oi} | awk '{print $17}'` - polysoilbc=`echo ${oi} | awk '{print $18}'` - polysldrain=`echo ${oi} | awk '{print $19}'` - polycol=`echo ${oi} | awk '{print $20}'` - slzres=`echo ${oi} | awk '{print $21}'` - queue=`echo ${oi} | awk '{print $22}'` - metdriver=`echo ${oi} | awk '{print $23}'` - dtlsm=`echo ${oi} | awk '{print $24}'` - vmfactc3=`echo ${oi} | awk '{print $25}'` - vmfactc4=`echo ${oi} | awk '{print $26}'` - mphototrc3=`echo ${oi} | awk '{print $27}'` - mphototec3=`echo ${oi} | awk '{print $28}'` - mphotoc4=`echo ${oi} | awk '{print $29}'` - bphotoblc3=`echo ${oi} | awk '{print $30}'` - bphotonlc3=`echo ${oi} | awk '{print $31}'` - bphotoc4=`echo ${oi} | awk '{print $32}'` - kwgrass=`echo ${oi} | awk '{print $33}'` - kwtree=`echo ${oi} | awk '{print $34}'` - gammac3=`echo ${oi} | awk '{print $35}'` - gammac4=`echo ${oi} | awk '{print $36}'` - d0grass=`echo ${oi} | awk '{print $37}'` - d0tree=`echo ${oi} | awk '{print $38}'` - alphac3=`echo ${oi} | awk '{print $39}'` - alphac4=`echo ${oi} | awk '{print $40}'` - klowco2=`echo ${oi} | awk '{print $41}'` - decomp=`echo ${oi} | awk '{print $42}'` - rrffact=`echo ${oi} | awk '{print $43}'` - growthresp=`echo ${oi} | awk '{print $44}'` - lwidthgrass=`echo ${oi} | awk '{print $45}'` - lwidthbltree=`echo ${oi} | awk '{print $46}'` - lwidthnltree=`echo ${oi} | awk '{print $47}'` - q10c3=`echo ${oi} | awk '{print $48}'` - q10c4=`echo ${oi} | awk '{print $49}'` - h2olimit=`echo ${oi} | awk '{print $50}'` - imortscheme=`echo ${oi} | awk '{print $51}'` - ddmortconst=`echo ${oi} | awk '{print $52}'` - isfclyrm=`echo ${oi} | awk '{print $53}'` - icanturb=`echo ${oi} | awk '{print $54}'` - ubmin=`echo ${oi} | awk '{print $55}'` - ugbmin=`echo ${oi} | awk '{print $56}'` - ustmin=`echo ${oi} | awk '{print $57}'` - gamm=`echo ${oi} | awk '{print $58}'` - gamh=`echo ${oi} | awk '{print $59}'` - tprandtl=`echo ${oi} | awk '{print $60}'` - ribmax=`echo ${oi} | awk '{print $61}'` - atmco2=`echo ${oi} | awk '{print $62}'` - thcrit=`echo ${oi} | awk '{print $63}'` - smfire=`echo ${oi} | awk '{print $64}'` - ifire=`echo ${oi} | awk '{print $65}'` - fireparm=`echo ${oi} | awk '{print $66}'` - ipercol=`echo ${oi} | awk '{print $67}'` - runoff=`echo ${oi} | awk '{print $68}'` - imetrad=`echo ${oi} | awk '{print $69}'` - ibranch=`echo ${oi} | awk '{print $70}'` - icanrad=`echo ${oi} | awk '{print $71}'` - crown=`echo ${oi} | awk '{print $72}'` - ltransvis=`echo ${oi} | awk '{print $73}'` - lreflectvis=`echo ${oi} | awk '{print $74}'` - ltransnir=`echo ${oi} | awk '{print $75}'` - lreflectnir=`echo ${oi} | awk '{print $76}'` - orienttree=`echo ${oi} | awk '{print $77}'` - orientgrass=`echo ${oi} | awk '{print $78}'` - clumptree=`echo ${oi} | awk '{print $79}'` - clumpgrass=`echo ${oi} | awk '{print $80}'` - ivegtdyn=`echo ${oi} | awk '{print $81}'` - igndvap=`echo ${oi} | awk '{print $82}'` - iphen=`echo ${oi} | awk '{print $83}'` - iallom=`echo ${oi} | awk '{print $84}'` - ibigleaf=`echo ${oi} | awk '{print $85}'` - irepro=`echo ${oi} | awk '{print $86}'` - treefall=`echo ${oi} | awk '{print $87}'` + initmode=`echo ${oi} | awk '{print $13}'` + iscenario=`echo ${oi} | awk '{print $14}'` + isizepft=`echo ${oi} | awk '{print $15}'` + polyisoil=`echo ${oi} | awk '{print $16}'` + polyntext=`echo ${oi} | awk '{print $17}'` + polysand=`echo ${oi} | awk '{print $18}'` + polyclay=`echo ${oi} | awk '{print $19}'` + polydepth=`echo ${oi} | awk '{print $20}'` + polysoilbc=`echo ${oi} | awk '{print $21}'` + polysldrain=`echo ${oi} | awk '{print $22}'` + polycol=`echo ${oi} | awk '{print $23}'` + slzres=`echo ${oi} | awk '{print $24}'` + queue=`echo ${oi} | awk '{print $25}'` + metdriver=`echo ${oi} | awk '{print $26}'` + dtlsm=`echo ${oi} | awk '{print $27}'` + vmfactc3=`echo ${oi} | awk '{print $28}'` + vmfactc4=`echo ${oi} | awk '{print $29}'` + mphototrc3=`echo ${oi} | awk '{print $30}'` + mphototec3=`echo ${oi} | awk '{print $31}'` + mphotoc4=`echo ${oi} | awk '{print $32}'` + bphotoblc3=`echo ${oi} | awk '{print $33}'` + bphotonlc3=`echo ${oi} | awk '{print $34}'` + bphotoc4=`echo ${oi} | awk '{print $35}'` + kwgrass=`echo ${oi} | awk '{print $36}'` + kwtree=`echo ${oi} | awk '{print $37}'` + gammac3=`echo ${oi} | awk '{print $38}'` + gammac4=`echo ${oi} | awk '{print $39}'` + d0grass=`echo ${oi} | awk '{print $40}'` + d0tree=`echo ${oi} | awk '{print $41}'` + alphac3=`echo ${oi} | awk '{print $42}'` + alphac4=`echo ${oi} | awk '{print $43}'` + klowco2=`echo ${oi} | awk '{print $44}'` + decomp=`echo ${oi} | awk '{print $45}'` + rrffact=`echo ${oi} | awk '{print $46}'` + growthresp=`echo ${oi} | awk '{print $47}'` + lwidthgrass=`echo ${oi} | awk '{print $48}'` + lwidthbltree=`echo ${oi} | awk '{print $49}'` + lwidthnltree=`echo ${oi} | awk '{print $50}'` + q10c3=`echo ${oi} | awk '{print $51}'` + q10c4=`echo ${oi} | awk '{print $52}'` + h2olimit=`echo ${oi} | awk '{print $53}'` + imortscheme=`echo ${oi} | awk '{print $54}'` + ddmortconst=`echo ${oi} | awk '{print $55}'` + isfclyrm=`echo ${oi} | awk '{print $56}'` + icanturb=`echo ${oi} | awk '{print $57}'` + ubmin=`echo ${oi} | awk '{print $58}'` + ugbmin=`echo ${oi} | awk '{print $59}'` + ustmin=`echo ${oi} | awk '{print $60}'` + gamm=`echo ${oi} | awk '{print $61}'` + gamh=`echo ${oi} | awk '{print $62}'` + tprandtl=`echo ${oi} | awk '{print $63}'` + ribmax=`echo ${oi} | awk '{print $64}'` + atmco2=`echo ${oi} | awk '{print $65}'` + thcrit=`echo ${oi} | awk '{print $66}'` + smfire=`echo ${oi} | awk '{print $67}'` + ifire=`echo ${oi} | awk '{print $68}'` + fireparm=`echo ${oi} | awk '{print $69}'` + ipercol=`echo ${oi} | awk '{print $70}'` + runoff=`echo ${oi} | awk '{print $71}'` + imetrad=`echo ${oi} | awk '{print $72}'` + ibranch=`echo ${oi} | awk '{print $73}'` + icanrad=`echo ${oi} | awk '{print $74}'` + crown=`echo ${oi} | awk '{print $75}'` + ltransvis=`echo ${oi} | awk '{print $76}'` + lreflectvis=`echo ${oi} | awk '{print $77}'` + ltransnir=`echo ${oi} | awk '{print $78}'` + lreflectnir=`echo ${oi} | awk '{print $79}'` + orienttree=`echo ${oi} | awk '{print $80}'` + orientgrass=`echo ${oi} | awk '{print $81}'` + clumptree=`echo ${oi} | awk '{print $82}'` + clumpgrass=`echo ${oi} | awk '{print $83}'` + ivegtdyn=`echo ${oi} | awk '{print $84}'` + igndvap=`echo ${oi} | awk '{print $85}'` + iphen=`echo ${oi} | awk '{print $86}'` + iallom=`echo ${oi} | awk '{print $87}'` + ibigleaf=`echo ${oi} | awk '{print $88}'` + irepro=`echo ${oi} | awk '{print $89}'` + treefall=`echo ${oi} | awk '{print $90}'` #---------------------------------------------------------------------------------------# diff --git a/ED/Template/reset.sh b/ED/Template/reset.sh index 56c25dd31..a4471cac0 100755 --- a/ED/Template/reset.sh +++ b/ED/Template/reset.sh @@ -102,81 +102,84 @@ do monthz=`echo ${oi} | awk '{print $10}'` datez=`echo ${oi} | awk '{print $11}'` timez=`echo ${oi} | awk '{print $12}'` - polyisoil=`echo ${oi} | awk '{print $13}'` - polyntext=`echo ${oi} | awk '{print $14}'` - polysand=`echo ${oi} | awk '{print $15}'` - polyclay=`echo ${oi} | awk '{print $16}'` - polydepth=`echo ${oi} | awk '{print $17}'` - polysoilbc=`echo ${oi} | awk '{print $18}'` - polysldrain=`echo ${oi} | awk '{print $19}'` - polycol=`echo ${oi} | awk '{print $20}'` - slzres=`echo ${oi} | awk '{print $21}'` - queue=`echo ${oi} | awk '{print $22}'` - metdriver=`echo ${oi} | awk '{print $23}'` - dtlsm=`echo ${oi} | awk '{print $24}'` - vmfactc3=`echo ${oi} | awk '{print $25}'` - vmfactc4=`echo ${oi} | awk '{print $26}'` - mphototrc3=`echo ${oi} | awk '{print $27}'` - mphototec3=`echo ${oi} | awk '{print $28}'` - mphotoc4=`echo ${oi} | awk '{print $29}'` - bphotoblc3=`echo ${oi} | awk '{print $30}'` - bphotonlc3=`echo ${oi} | awk '{print $31}'` - bphotoc4=`echo ${oi} | awk '{print $32}'` - kwgrass=`echo ${oi} | awk '{print $33}'` - kwtree=`echo ${oi} | awk '{print $34}'` - gammac3=`echo ${oi} | awk '{print $35}'` - gammac4=`echo ${oi} | awk '{print $36}'` - d0grass=`echo ${oi} | awk '{print $37}'` - d0tree=`echo ${oi} | awk '{print $38}'` - alphac3=`echo ${oi} | awk '{print $39}'` - alphac4=`echo ${oi} | awk '{print $40}'` - klowco2=`echo ${oi} | awk '{print $41}'` - decomp=`echo ${oi} | awk '{print $42}'` - rrffact=`echo ${oi} | awk '{print $43}'` - growthresp=`echo ${oi} | awk '{print $44}'` - lwidthgrass=`echo ${oi} | awk '{print $45}'` - lwidthbltree=`echo ${oi} | awk '{print $46}'` - lwidthnltree=`echo ${oi} | awk '{print $47}'` - q10c3=`echo ${oi} | awk '{print $48}'` - q10c4=`echo ${oi} | awk '{print $49}'` - h2olimit=`echo ${oi} | awk '{print $50}'` - imortscheme=`echo ${oi} | awk '{print $51}'` - ddmortconst=`echo ${oi} | awk '{print $52}'` - isfclyrm=`echo ${oi} | awk '{print $53}'` - icanturb=`echo ${oi} | awk '{print $54}'` - ubmin=`echo ${oi} | awk '{print $55}'` - ugbmin=`echo ${oi} | awk '{print $56}'` - ustmin=`echo ${oi} | awk '{print $57}'` - gamm=`echo ${oi} | awk '{print $58}'` - gamh=`echo ${oi} | awk '{print $59}'` - tprandtl=`echo ${oi} | awk '{print $60}'` - ribmax=`echo ${oi} | awk '{print $61}'` - atmco2=`echo ${oi} | awk '{print $62}'` - thcrit=`echo ${oi} | awk '{print $63}'` - smfire=`echo ${oi} | awk '{print $64}'` - ifire=`echo ${oi} | awk '{print $65}'` - fireparm=`echo ${oi} | awk '{print $66}'` - ipercol=`echo ${oi} | awk '{print $67}'` - runoff=`echo ${oi} | awk '{print $68}'` - imetrad=`echo ${oi} | awk '{print $69}'` - ibranch=`echo ${oi} | awk '{print $70}'` - icanrad=`echo ${oi} | awk '{print $71}'` - crown=`echo ${oi} | awk '{print $72}'` - ltransvis=`echo ${oi} | awk '{print $73}'` - lreflectvis=`echo ${oi} | awk '{print $74}'` - ltransnir=`echo ${oi} | awk '{print $75}'` - lreflectnir=`echo ${oi} | awk '{print $76}'` - orienttree=`echo ${oi} | awk '{print $77}'` - orientgrass=`echo ${oi} | awk '{print $78}'` - clumptree=`echo ${oi} | awk '{print $79}'` - clumpgrass=`echo ${oi} | awk '{print $80}'` - ivegtdyn=`echo ${oi} | awk '{print $81}'` - igndvap=`echo ${oi} | awk '{print $82}'` - iphen=`echo ${oi} | awk '{print $83}'` - iallom=`echo ${oi} | awk '{print $84}'` - ibigleaf=`echo ${oi} | awk '{print $85}'` - irepro=`echo ${oi} | awk '{print $86}'` - treefall=`echo ${oi} | awk '{print $87}'` + initmode=`echo ${oi} | awk '{print $13}'` + iscenario=`echo ${oi} | awk '{print $14}'` + isizepft=`echo ${oi} | awk '{print $15}'` + polyisoil=`echo ${oi} | awk '{print $16}'` + polyntext=`echo ${oi} | awk '{print $17}'` + polysand=`echo ${oi} | awk '{print $18}'` + polyclay=`echo ${oi} | awk '{print $19}'` + polydepth=`echo ${oi} | awk '{print $20}'` + polysoilbc=`echo ${oi} | awk '{print $21}'` + polysldrain=`echo ${oi} | awk '{print $22}'` + polycol=`echo ${oi} | awk '{print $23}'` + slzres=`echo ${oi} | awk '{print $24}'` + queue=`echo ${oi} | awk '{print $25}'` + metdriver=`echo ${oi} | awk '{print $26}'` + dtlsm=`echo ${oi} | awk '{print $27}'` + vmfactc3=`echo ${oi} | awk '{print $28}'` + vmfactc4=`echo ${oi} | awk '{print $29}'` + mphototrc3=`echo ${oi} | awk '{print $30}'` + mphototec3=`echo ${oi} | awk '{print $31}'` + mphotoc4=`echo ${oi} | awk '{print $32}'` + bphotoblc3=`echo ${oi} | awk '{print $33}'` + bphotonlc3=`echo ${oi} | awk '{print $34}'` + bphotoc4=`echo ${oi} | awk '{print $35}'` + kwgrass=`echo ${oi} | awk '{print $36}'` + kwtree=`echo ${oi} | awk '{print $37}'` + gammac3=`echo ${oi} | awk '{print $38}'` + gammac4=`echo ${oi} | awk '{print $39}'` + d0grass=`echo ${oi} | awk '{print $40}'` + d0tree=`echo ${oi} | awk '{print $41}'` + alphac3=`echo ${oi} | awk '{print $42}'` + alphac4=`echo ${oi} | awk '{print $43}'` + klowco2=`echo ${oi} | awk '{print $44}'` + decomp=`echo ${oi} | awk '{print $45}'` + rrffact=`echo ${oi} | awk '{print $46}'` + growthresp=`echo ${oi} | awk '{print $47}'` + lwidthgrass=`echo ${oi} | awk '{print $48}'` + lwidthbltree=`echo ${oi} | awk '{print $49}'` + lwidthnltree=`echo ${oi} | awk '{print $50}'` + q10c3=`echo ${oi} | awk '{print $51}'` + q10c4=`echo ${oi} | awk '{print $52}'` + h2olimit=`echo ${oi} | awk '{print $53}'` + imortscheme=`echo ${oi} | awk '{print $54}'` + ddmortconst=`echo ${oi} | awk '{print $55}'` + isfclyrm=`echo ${oi} | awk '{print $56}'` + icanturb=`echo ${oi} | awk '{print $57}'` + ubmin=`echo ${oi} | awk '{print $58}'` + ugbmin=`echo ${oi} | awk '{print $59}'` + ustmin=`echo ${oi} | awk '{print $60}'` + gamm=`echo ${oi} | awk '{print $61}'` + gamh=`echo ${oi} | awk '{print $62}'` + tprandtl=`echo ${oi} | awk '{print $63}'` + ribmax=`echo ${oi} | awk '{print $64}'` + atmco2=`echo ${oi} | awk '{print $65}'` + thcrit=`echo ${oi} | awk '{print $66}'` + smfire=`echo ${oi} | awk '{print $67}'` + ifire=`echo ${oi} | awk '{print $68}'` + fireparm=`echo ${oi} | awk '{print $69}'` + ipercol=`echo ${oi} | awk '{print $70}'` + runoff=`echo ${oi} | awk '{print $71}'` + imetrad=`echo ${oi} | awk '{print $72}'` + ibranch=`echo ${oi} | awk '{print $73}'` + icanrad=`echo ${oi} | awk '{print $74}'` + crown=`echo ${oi} | awk '{print $75}'` + ltransvis=`echo ${oi} | awk '{print $76}'` + lreflectvis=`echo ${oi} | awk '{print $77}'` + ltransnir=`echo ${oi} | awk '{print $78}'` + lreflectnir=`echo ${oi} | awk '{print $79}'` + orienttree=`echo ${oi} | awk '{print $80}'` + orientgrass=`echo ${oi} | awk '{print $81}'` + clumptree=`echo ${oi} | awk '{print $82}'` + clumpgrass=`echo ${oi} | awk '{print $83}'` + ivegtdyn=`echo ${oi} | awk '{print $84}'` + igndvap=`echo ${oi} | awk '{print $85}'` + iphen=`echo ${oi} | awk '{print $86}'` + iallom=`echo ${oi} | awk '{print $87}'` + ibigleaf=`echo ${oi} | awk '{print $88}'` + irepro=`echo ${oi} | awk '{print $89}'` + treefall=`echo ${oi} | awk '{print $90}'` #---------------------------------------------------------------------------------------# bkill -J ${desc}-${polyname} -q ${queue} @@ -219,81 +222,84 @@ do monthz=`echo ${oi} | awk '{print $10}'` datez=`echo ${oi} | awk '{print $11}'` timez=`echo ${oi} | awk '{print $12}'` - polyisoil=`echo ${oi} | awk '{print $13}'` - polyntext=`echo ${oi} | awk '{print $14}'` - polysand=`echo ${oi} | awk '{print $15}'` - polyclay=`echo ${oi} | awk '{print $16}'` - polydepth=`echo ${oi} | awk '{print $17}'` - polysoilbc=`echo ${oi} | awk '{print $18}'` - polysldrain=`echo ${oi} | awk '{print $19}'` - polycol=`echo ${oi} | awk '{print $20}'` - slzres=`echo ${oi} | awk '{print $21}'` - queue=`echo ${oi} | awk '{print $22}'` - metdriver=`echo ${oi} | awk '{print $23}'` - dtlsm=`echo ${oi} | awk '{print $24}'` - vmfactc3=`echo ${oi} | awk '{print $25}'` - vmfactc4=`echo ${oi} | awk '{print $26}'` - mphototrc3=`echo ${oi} | awk '{print $27}'` - mphototec3=`echo ${oi} | awk '{print $28}'` - mphotoc4=`echo ${oi} | awk '{print $29}'` - bphotoblc3=`echo ${oi} | awk '{print $30}'` - bphotonlc3=`echo ${oi} | awk '{print $31}'` - bphotoc4=`echo ${oi} | awk '{print $32}'` - kwgrass=`echo ${oi} | awk '{print $33}'` - kwtree=`echo ${oi} | awk '{print $34}'` - gammac3=`echo ${oi} | awk '{print $35}'` - gammac4=`echo ${oi} | awk '{print $36}'` - d0grass=`echo ${oi} | awk '{print $37}'` - d0tree=`echo ${oi} | awk '{print $38}'` - alphac3=`echo ${oi} | awk '{print $39}'` - alphac4=`echo ${oi} | awk '{print $40}'` - klowco2=`echo ${oi} | awk '{print $41}'` - decomp=`echo ${oi} | awk '{print $42}'` - rrffact=`echo ${oi} | awk '{print $43}'` - growthresp=`echo ${oi} | awk '{print $44}'` - lwidthgrass=`echo ${oi} | awk '{print $45}'` - lwidthbltree=`echo ${oi} | awk '{print $46}'` - lwidthnltree=`echo ${oi} | awk '{print $47}'` - q10c3=`echo ${oi} | awk '{print $48}'` - q10c4=`echo ${oi} | awk '{print $49}'` - h2olimit=`echo ${oi} | awk '{print $50}'` - imortscheme=`echo ${oi} | awk '{print $51}'` - ddmortconst=`echo ${oi} | awk '{print $52}'` - isfclyrm=`echo ${oi} | awk '{print $53}'` - icanturb=`echo ${oi} | awk '{print $54}'` - ubmin=`echo ${oi} | awk '{print $55}'` - ugbmin=`echo ${oi} | awk '{print $56}'` - ustmin=`echo ${oi} | awk '{print $57}'` - gamm=`echo ${oi} | awk '{print $58}'` - gamh=`echo ${oi} | awk '{print $59}'` - tprandtl=`echo ${oi} | awk '{print $60}'` - ribmax=`echo ${oi} | awk '{print $61}'` - atmco2=`echo ${oi} | awk '{print $62}'` - thcrit=`echo ${oi} | awk '{print $63}'` - smfire=`echo ${oi} | awk '{print $64}'` - ifire=`echo ${oi} | awk '{print $65}'` - fireparm=`echo ${oi} | awk '{print $66}'` - ipercol=`echo ${oi} | awk '{print $67}'` - runoff=`echo ${oi} | awk '{print $68}'` - imetrad=`echo ${oi} | awk '{print $69}'` - ibranch=`echo ${oi} | awk '{print $70}'` - icanrad=`echo ${oi} | awk '{print $71}'` - crown=`echo ${oi} | awk '{print $72}'` - ltransvis=`echo ${oi} | awk '{print $73}'` - lreflectvis=`echo ${oi} | awk '{print $74}'` - ltransnir=`echo ${oi} | awk '{print $75}'` - lreflectnir=`echo ${oi} | awk '{print $76}'` - orienttree=`echo ${oi} | awk '{print $77}'` - orientgrass=`echo ${oi} | awk '{print $78}'` - clumptree=`echo ${oi} | awk '{print $79}'` - clumpgrass=`echo ${oi} | awk '{print $80}'` - ivegtdyn=`echo ${oi} | awk '{print $81}'` - igndvap=`echo ${oi} | awk '{print $82}'` - iphen=`echo ${oi} | awk '{print $83}'` - iallom=`echo ${oi} | awk '{print $84}'` - ibigleaf=`echo ${oi} | awk '{print $85}'` - irepro=`echo ${oi} | awk '{print $86}'` - treefall=`echo ${oi} | awk '{print $87}'` + initmode=`echo ${oi} | awk '{print $13}'` + iscenario=`echo ${oi} | awk '{print $14}'` + isizepft=`echo ${oi} | awk '{print $15}'` + polyisoil=`echo ${oi} | awk '{print $16}'` + polyntext=`echo ${oi} | awk '{print $17}'` + polysand=`echo ${oi} | awk '{print $18}'` + polyclay=`echo ${oi} | awk '{print $19}'` + polydepth=`echo ${oi} | awk '{print $20}'` + polysoilbc=`echo ${oi} | awk '{print $21}'` + polysldrain=`echo ${oi} | awk '{print $22}'` + polycol=`echo ${oi} | awk '{print $23}'` + slzres=`echo ${oi} | awk '{print $24}'` + queue=`echo ${oi} | awk '{print $25}'` + metdriver=`echo ${oi} | awk '{print $26}'` + dtlsm=`echo ${oi} | awk '{print $27}'` + vmfactc3=`echo ${oi} | awk '{print $28}'` + vmfactc4=`echo ${oi} | awk '{print $29}'` + mphototrc3=`echo ${oi} | awk '{print $30}'` + mphototec3=`echo ${oi} | awk '{print $31}'` + mphotoc4=`echo ${oi} | awk '{print $32}'` + bphotoblc3=`echo ${oi} | awk '{print $33}'` + bphotonlc3=`echo ${oi} | awk '{print $34}'` + bphotoc4=`echo ${oi} | awk '{print $35}'` + kwgrass=`echo ${oi} | awk '{print $36}'` + kwtree=`echo ${oi} | awk '{print $37}'` + gammac3=`echo ${oi} | awk '{print $38}'` + gammac4=`echo ${oi} | awk '{print $39}'` + d0grass=`echo ${oi} | awk '{print $40}'` + d0tree=`echo ${oi} | awk '{print $41}'` + alphac3=`echo ${oi} | awk '{print $42}'` + alphac4=`echo ${oi} | awk '{print $43}'` + klowco2=`echo ${oi} | awk '{print $44}'` + decomp=`echo ${oi} | awk '{print $45}'` + rrffact=`echo ${oi} | awk '{print $46}'` + growthresp=`echo ${oi} | awk '{print $47}'` + lwidthgrass=`echo ${oi} | awk '{print $48}'` + lwidthbltree=`echo ${oi} | awk '{print $49}'` + lwidthnltree=`echo ${oi} | awk '{print $50}'` + q10c3=`echo ${oi} | awk '{print $51}'` + q10c4=`echo ${oi} | awk '{print $52}'` + h2olimit=`echo ${oi} | awk '{print $53}'` + imortscheme=`echo ${oi} | awk '{print $54}'` + ddmortconst=`echo ${oi} | awk '{print $55}'` + isfclyrm=`echo ${oi} | awk '{print $56}'` + icanturb=`echo ${oi} | awk '{print $57}'` + ubmin=`echo ${oi} | awk '{print $58}'` + ugbmin=`echo ${oi} | awk '{print $59}'` + ustmin=`echo ${oi} | awk '{print $60}'` + gamm=`echo ${oi} | awk '{print $61}'` + gamh=`echo ${oi} | awk '{print $62}'` + tprandtl=`echo ${oi} | awk '{print $63}'` + ribmax=`echo ${oi} | awk '{print $64}'` + atmco2=`echo ${oi} | awk '{print $65}'` + thcrit=`echo ${oi} | awk '{print $66}'` + smfire=`echo ${oi} | awk '{print $67}'` + ifire=`echo ${oi} | awk '{print $68}'` + fireparm=`echo ${oi} | awk '{print $69}'` + ipercol=`echo ${oi} | awk '{print $70}'` + runoff=`echo ${oi} | awk '{print $71}'` + imetrad=`echo ${oi} | awk '{print $72}'` + ibranch=`echo ${oi} | awk '{print $73}'` + icanrad=`echo ${oi} | awk '{print $74}'` + crown=`echo ${oi} | awk '{print $75}'` + ltransvis=`echo ${oi} | awk '{print $76}'` + lreflectvis=`echo ${oi} | awk '{print $77}'` + ltransnir=`echo ${oi} | awk '{print $78}'` + lreflectnir=`echo ${oi} | awk '{print $79}'` + orienttree=`echo ${oi} | awk '{print $80}'` + orientgrass=`echo ${oi} | awk '{print $81}'` + clumptree=`echo ${oi} | awk '{print $82}'` + clumpgrass=`echo ${oi} | awk '{print $83}'` + ivegtdyn=`echo ${oi} | awk '{print $84}'` + igndvap=`echo ${oi} | awk '{print $85}'` + iphen=`echo ${oi} | awk '{print $86}'` + iallom=`echo ${oi} | awk '{print $87}'` + ibigleaf=`echo ${oi} | awk '{print $88}'` + irepro=`echo ${oi} | awk '{print $89}'` + treefall=`echo ${oi} | awk '{print $90}'` #---------------------------------------------------------------------------------------# diff --git a/ED/Template/spawn_poly.sh b/ED/Template/spawn_poly.sh index e80d1697f..9ec78c03f 100755 --- a/ED/Template/spawn_poly.sh +++ b/ED/Template/spawn_poly.sh @@ -22,17 +22,16 @@ diskthere='/n/moorcroftfs2' sitemetdef='/n/moorcroft_data/mlongo/data/ed2_data/site_met_driver' #----- This is the header with the Sheffield data. ----------------------------------------# shefhead='SHEF_NCEP_DRIVER_DS314' -#----- Should we use pseudo drought data? -------------------------------------------------# -pseudodrought='n' -#----- Path with default pseudo drought drivers. ------------------------------------------# -pdroughtpathdef='/n/moorcroft_data/mlongo/data/ed2_data/drought_met_driver' +#----- Path with default pseudo past drivers. ---------------------------------------------# +scenariopathdef='/n/moorcroft_data/mlongo/data/ed2_data/past_met_driver' #----- Should the met driver be copied to local scratch disks? ----------------------------# copy2scratch='n' #------------------------------------------------------------------------------------------# # In case we should copy, this is the source where the data is organised to go. This # -# will override sitemetdef and pdroughtpath. # +# will override sitemetdef and scenariopath. # #------------------------------------------------------------------------------------------# packdatasrc='/n/moorcroft_data/mlongo/data/2scratch' +#------------------------------------------------------------------------------------------# #------------------------------------------------------------------------------------------# # History run variables. # @@ -49,25 +48,6 @@ timeh='0000' # Hour #----- Default tolerance. -----------------------------------------------------------------# toldef='0.01' -#------------------------------------------------------------------------------------------# -# ED initial mode: currently accepted values are: # -# -1 : true bare ground run. # -# 0 : near bare ground run. # -# 5 : ED-2.1 restart (make sure SFILIN is set correctly in the Template ED2IN # -# 6 : Biomass initialisation files (only for those that we have such data). # -#------------------------------------------------------------------------------------------# -initmode=6 -#------------------------------------------------------------------------------------------# - - -#------------------------------------------------------------------------------------------# -# Which type of under storey should I use? # -# 0 -- No understorey # -# 1 -- Based on sci_005 runs. # -#------------------------------------------------------------------------------------------# -iustein=1 -#------------------------------------------------------------------------------------------# - #------------------------------------------------------------------------------------------# # Name of the unrestricted_parallel scripts: # # callunpa: script that calls callserial.sh for unrestricted_parallel runs. # @@ -98,15 +78,15 @@ execname='ed_2.1-opt' #==========================================================================================# -#----- Set the main path for the site, pseudo drought and Sheffield met drivers. ----------# +#----- Set the main path for the site, pseudo past and Sheffield met drivers. -------------# if [ ${copy2scratch} == 'y' -o ${copy2scratch} == 'Y' ] then sitemet='/scratch/mlongo/met_driver/site_met_driver' - pdroughtpath='/scratch/mlongo/met_driver/drought_met_driver' + scenariopath='/scratch/mlongo/met_driver/past_met_driver' shefpath='/scratch/mlongo/met_driver/sheffield' else sitemet=${sitemetdef} - pdroughtpath=${pdroughtpathdef} + scenariopath=${scenariopathdef} shefpath='' fi #------------------------------------------------------------------------------------------# @@ -259,81 +239,84 @@ do monthz=`echo ${oi} | awk '{print $10}'` datez=`echo ${oi} | awk '{print $11}'` timez=`echo ${oi} | awk '{print $12}'` - polyisoil=`echo ${oi} | awk '{print $13}'` - polyntext=`echo ${oi} | awk '{print $14}'` - polysand=`echo ${oi} | awk '{print $15}'` - polyclay=`echo ${oi} | awk '{print $16}'` - polydepth=`echo ${oi} | awk '{print $17}'` - polysoilbc=`echo ${oi} | awk '{print $18}'` - polysldrain=`echo ${oi} | awk '{print $19}'` - polycol=`echo ${oi} | awk '{print $20}'` - slzres=`echo ${oi} | awk '{print $21}'` - queue=`echo ${oi} | awk '{print $22}'` - metdriver=`echo ${oi} | awk '{print $23}'` - dtlsm=`echo ${oi} | awk '{print $24}'` - vmfactc3=`echo ${oi} | awk '{print $25}'` - vmfactc4=`echo ${oi} | awk '{print $26}'` - mphototrc3=`echo ${oi} | awk '{print $27}'` - mphototec3=`echo ${oi} | awk '{print $28}'` - mphotoc4=`echo ${oi} | awk '{print $29}'` - bphotoblc3=`echo ${oi} | awk '{print $30}'` - bphotonlc3=`echo ${oi} | awk '{print $31}'` - bphotoc4=`echo ${oi} | awk '{print $32}'` - kwgrass=`echo ${oi} | awk '{print $33}'` - kwtree=`echo ${oi} | awk '{print $34}'` - gammac3=`echo ${oi} | awk '{print $35}'` - gammac4=`echo ${oi} | awk '{print $36}'` - d0grass=`echo ${oi} | awk '{print $37}'` - d0tree=`echo ${oi} | awk '{print $38}'` - alphac3=`echo ${oi} | awk '{print $39}'` - alphac4=`echo ${oi} | awk '{print $40}'` - klowco2=`echo ${oi} | awk '{print $41}'` - decomp=`echo ${oi} | awk '{print $42}'` - rrffact=`echo ${oi} | awk '{print $43}'` - growthresp=`echo ${oi} | awk '{print $44}'` - lwidthgrass=`echo ${oi} | awk '{print $45}'` - lwidthbltree=`echo ${oi} | awk '{print $46}'` - lwidthnltree=`echo ${oi} | awk '{print $47}'` - q10c3=`echo ${oi} | awk '{print $48}'` - q10c4=`echo ${oi} | awk '{print $49}'` - h2olimit=`echo ${oi} | awk '{print $50}'` - imortscheme=`echo ${oi} | awk '{print $51}'` - ddmortconst=`echo ${oi} | awk '{print $52}'` - isfclyrm=`echo ${oi} | awk '{print $53}'` - icanturb=`echo ${oi} | awk '{print $54}'` - ubmin=`echo ${oi} | awk '{print $55}'` - ugbmin=`echo ${oi} | awk '{print $56}'` - ustmin=`echo ${oi} | awk '{print $57}'` - gamm=`echo ${oi} | awk '{print $58}'` - gamh=`echo ${oi} | awk '{print $59}'` - tprandtl=`echo ${oi} | awk '{print $60}'` - ribmax=`echo ${oi} | awk '{print $61}'` - atmco2=`echo ${oi} | awk '{print $62}'` - thcrit=`echo ${oi} | awk '{print $63}'` - smfire=`echo ${oi} | awk '{print $64}'` - ifire=`echo ${oi} | awk '{print $65}'` - fireparm=`echo ${oi} | awk '{print $66}'` - ipercol=`echo ${oi} | awk '{print $67}'` - runoff=`echo ${oi} | awk '{print $68}'` - imetrad=`echo ${oi} | awk '{print $69}'` - ibranch=`echo ${oi} | awk '{print $70}'` - icanrad=`echo ${oi} | awk '{print $71}'` - crown=`echo ${oi} | awk '{print $72}'` - ltransvis=`echo ${oi} | awk '{print $73}'` - lreflectvis=`echo ${oi} | awk '{print $74}'` - ltransnir=`echo ${oi} | awk '{print $75}'` - lreflectnir=`echo ${oi} | awk '{print $76}'` - orienttree=`echo ${oi} | awk '{print $77}'` - orientgrass=`echo ${oi} | awk '{print $78}'` - clumptree=`echo ${oi} | awk '{print $79}'` - clumpgrass=`echo ${oi} | awk '{print $80}'` - ivegtdyn=`echo ${oi} | awk '{print $81}'` - igndvap=`echo ${oi} | awk '{print $82}'` - iphen=`echo ${oi} | awk '{print $83}'` - iallom=`echo ${oi} | awk '{print $84}'` - ibigleaf=`echo ${oi} | awk '{print $85}'` - irepro=`echo ${oi} | awk '{print $86}'` - treefall=`echo ${oi} | awk '{print $87}'` + initmode=`echo ${oi} | awk '{print $13}'` + iscenario=`echo ${oi} | awk '{print $14}'` + isizepft=`echo ${oi} | awk '{print $15}'` + polyisoil=`echo ${oi} | awk '{print $16}'` + polyntext=`echo ${oi} | awk '{print $17}'` + polysand=`echo ${oi} | awk '{print $18}'` + polyclay=`echo ${oi} | awk '{print $19}'` + polydepth=`echo ${oi} | awk '{print $20}'` + polysoilbc=`echo ${oi} | awk '{print $21}'` + polysldrain=`echo ${oi} | awk '{print $22}'` + polycol=`echo ${oi} | awk '{print $23}'` + slzres=`echo ${oi} | awk '{print $24}'` + queue=`echo ${oi} | awk '{print $25}'` + metdriver=`echo ${oi} | awk '{print $26}'` + dtlsm=`echo ${oi} | awk '{print $27}'` + vmfactc3=`echo ${oi} | awk '{print $28}'` + vmfactc4=`echo ${oi} | awk '{print $29}'` + mphototrc3=`echo ${oi} | awk '{print $30}'` + mphototec3=`echo ${oi} | awk '{print $31}'` + mphotoc4=`echo ${oi} | awk '{print $32}'` + bphotoblc3=`echo ${oi} | awk '{print $33}'` + bphotonlc3=`echo ${oi} | awk '{print $34}'` + bphotoc4=`echo ${oi} | awk '{print $35}'` + kwgrass=`echo ${oi} | awk '{print $36}'` + kwtree=`echo ${oi} | awk '{print $37}'` + gammac3=`echo ${oi} | awk '{print $38}'` + gammac4=`echo ${oi} | awk '{print $39}'` + d0grass=`echo ${oi} | awk '{print $40}'` + d0tree=`echo ${oi} | awk '{print $41}'` + alphac3=`echo ${oi} | awk '{print $42}'` + alphac4=`echo ${oi} | awk '{print $43}'` + klowco2=`echo ${oi} | awk '{print $44}'` + decomp=`echo ${oi} | awk '{print $45}'` + rrffact=`echo ${oi} | awk '{print $46}'` + growthresp=`echo ${oi} | awk '{print $47}'` + lwidthgrass=`echo ${oi} | awk '{print $48}'` + lwidthbltree=`echo ${oi} | awk '{print $49}'` + lwidthnltree=`echo ${oi} | awk '{print $50}'` + q10c3=`echo ${oi} | awk '{print $51}'` + q10c4=`echo ${oi} | awk '{print $52}'` + h2olimit=`echo ${oi} | awk '{print $53}'` + imortscheme=`echo ${oi} | awk '{print $54}'` + ddmortconst=`echo ${oi} | awk '{print $55}'` + isfclyrm=`echo ${oi} | awk '{print $56}'` + icanturb=`echo ${oi} | awk '{print $57}'` + ubmin=`echo ${oi} | awk '{print $58}'` + ugbmin=`echo ${oi} | awk '{print $59}'` + ustmin=`echo ${oi} | awk '{print $60}'` + gamm=`echo ${oi} | awk '{print $61}'` + gamh=`echo ${oi} | awk '{print $62}'` + tprandtl=`echo ${oi} | awk '{print $63}'` + ribmax=`echo ${oi} | awk '{print $64}'` + atmco2=`echo ${oi} | awk '{print $65}'` + thcrit=`echo ${oi} | awk '{print $66}'` + smfire=`echo ${oi} | awk '{print $67}'` + ifire=`echo ${oi} | awk '{print $68}'` + fireparm=`echo ${oi} | awk '{print $69}'` + ipercol=`echo ${oi} | awk '{print $70}'` + runoff=`echo ${oi} | awk '{print $71}'` + imetrad=`echo ${oi} | awk '{print $72}'` + ibranch=`echo ${oi} | awk '{print $73}'` + icanrad=`echo ${oi} | awk '{print $74}'` + crown=`echo ${oi} | awk '{print $75}'` + ltransvis=`echo ${oi} | awk '{print $76}'` + lreflectvis=`echo ${oi} | awk '{print $77}'` + ltransnir=`echo ${oi} | awk '{print $78}'` + lreflectnir=`echo ${oi} | awk '{print $79}'` + orienttree=`echo ${oi} | awk '{print $80}'` + orientgrass=`echo ${oi} | awk '{print $81}'` + clumptree=`echo ${oi} | awk '{print $82}'` + clumpgrass=`echo ${oi} | awk '{print $83}'` + ivegtdyn=`echo ${oi} | awk '{print $84}'` + igndvap=`echo ${oi} | awk '{print $85}'` + iphen=`echo ${oi} | awk '{print $86}'` + iallom=`echo ${oi} | awk '{print $87}'` + ibigleaf=`echo ${oi} | awk '{print $88}'` + irepro=`echo ${oi} | awk '{print $89}'` + treefall=`echo ${oi} | awk '{print $90}'` #---------------------------------------------------------------------------------------# @@ -487,38 +470,61 @@ do #---------------------------------------------------------------------------------------# - # Determine which PFTs to use based on the "iata" code. # + # Determine which PFTs to use based on the "iata" code and isizepft. # #---------------------------------------------------------------------------------------# - case ${polyiata} in - tzi|zmh|nqn) - pfts='6,7,9,10,11,16,17' - crop=16 - plantation=17 - ;; - hvd|wch|tqh) - pfts='6,8,9,10,11,16,17' - crop=16 - plantation=17 - ;; - asu|cnf|bnu|cwb|erm|iqq|ipv|mgf|rao|sla|zpe|kna|sfn) - pfts='1,2,3,4,16,17' - crop=16 - plantation=17 - ;; - fns*) - pfts='1,16' - crop=1 - plantation=17 - ;; - s77*) - pfts='1,16' - crop=16 - plantation=17 + case ${isizepft} in + 0|1) + case ${polyiata} in + tzi|zmh|nqn) + pfts='6,7,9,10,11,16,17' + crop=16 + plantation=17 + ;; + hvd|wch|tqh) + pfts='6,8,9,10,11,16,17' + crop=16 + plantation=17 + ;; + asu|cnf|bnu|cwb|erm|iqq|ipv|mgf|rao|sla|zpe|kna|sfn) + pfts='1,2,3,4,16,17' + crop=16 + plantation=17 + ;; + fns*) + pfts='1,16' + crop=1 + plantation=17 + ;; + s77*) + pfts='1,16' + crop=16 + plantation=17 + ;; + *) + pfts='1,2,3,4,16' + crop=1 + plantation=3 + ;; + esac ;; - *) - pfts='1,2,3,4,16' - crop=1 - plantation=3 + 2) + case ${polyiata} in + tzi|zmh|nqn|hvd|wch|tqh) + pfts='10,16' + crop=16 + plantation=17 + ;; + fns*|s77*) + pfts='1' + crop=1 + plantation=17 + ;; + *) + pfts='1,3' + crop=1 + plantation=3 + ;; + esac ;; esac #---------------------------------------------------------------------------------------# @@ -556,7 +562,33 @@ do - if [ ${pseudodrought} != 'y' ] && [ ${pseudodrought} != 'Y' ] + #---------------------------------------------------------------------------------------# + # Choose the scenario to use. Iscenario follows the following convention: # + # 0 -- No scenario, this only uses the tower years. # + # -1 -- Gap-filled data for the past 40 years, using historical rain but no sampling # + # 1 -- The gap-filled data is resampled with uniform distribution for probability of # + # picking any year (WITH replacement) # + # # + # For any A other than 0 or 1, a non-uniform probability of picking any year p(y): # + # (A is always positive the minus is just a flag) # + # # + # -A -- p (y) = k * A ^ [1 - 2*q(y)] # + # A -- p (y) = k * A ^ [2*q(y) - 1] # + # # + # where q(y) is the year ranking, q(driest) = 0, q(wettest) = 1) # + # # + # k is just a constant to make the CDF 1 for q>=1, it doesn't really matter, but in # + # case you're curious: # + # # + # 2 * A * ln(A) # + # k = --------------- # + # A^2 - A # + # # + # In summary, Negative A means that dry years are going to be picked more often, # + # whereas positive means that wet years are picked more often. # + # # + #---------------------------------------------------------------------------------------# + if [ ${iscenario} -ne 0 ] then #------------------------------------------------------------------------------------# # Determine which meteorological data set to use. Default is the Sheffield/NCEP # @@ -661,54 +693,104 @@ do #------------------------------------------------------------------------------------# else #------------------------------------------------------------------------------------# - # Run a pseudo-drought simulation. Find which settings to use based on the # - # final part of the job name. # + # Find out which scenario to use. # #------------------------------------------------------------------------------------# - nchar=`echo ${polyname} | wc -m` + if [ ${iscenario} -eq -1 ] + then + whichscen='past' + elif [ ${iscenario} -eq 1 ] + then + whichscen='unif' + elif [ ${iscenario} -gt 1 ] + then + let wetter=100+${iscenario} + whichscen='wet'`echo ${wetter} | awk '{print substr($1,2,2)}'` + elif [ ${iscenario} -lt -1 ] + then + let drier=100-${iscenario} + whichscen='dry'`echo ${drier} | awk '{print substr($1,2,2)}'` + fi + fullscen="${scenariopath}/${whichscen}" #------------------------------------------------------------------------------------# - # There are two ways to define the drought flag. If we define drought just as # - # a on/off flag, or if we turn on and off each of the drought components. We must # - # figure out which one we are doing here. # + + + + #------------------------------------------------------------------------------------# - let next=${nchar}-11 - polyext=`echo ${polyname} | awk '{print substr($1,'${next}',5)}'` - let nseq=${nchar}-5 - polyseq=`echo ${polyname} | awk '{print substr($1,'${nseq}',5)}'` - metdesc="${polyiata}-${polyext}_${polyseq}" - metdriverdb="${pdroughtpath}/${metdesc}/${metdesc}_HEADER" + # Determine which meteorological data set to use. Default is the Sheffield/NCEP # + # dataset, otherwise the site-level tower data is used. # #------------------------------------------------------------------------------------# - - case ${polyiata} in - s67) - case polyseq in - seq00) - metcyc1=2021 - metcycf=2041 - ;; - seq01) - metcyc1=2021 - metcycf=2037 - ;; - esac + case ${metdriver} in + Bananal) + metdriverdb="${fullscen}/Bananal/Bananal_HEADER" + metcyc1=1972 + metcycf=2011 imetavg=1 ;; - gyf) - case polyseq in - seq00) - metcyc1=2021 - metcycf=2032 - ;; - seq01) - metcyc1=2021 - metcycf=2033 - ;; - esac + Caxiuana) + metdriverdb="${fullscen}/Caxiuana/Caxiuana_HEADER" + metcyc1=1972 + metcycf=2011 + imetavg=1 + ;; + Fazenda_Nossa_Senhora) + metdriverdb="${fullscen}/Fazenda_Nossa_Senhora/Fazenda_Nossa_Senhora_HEADER" + metcyc1=1977 + metcycf=2002 + imetavg=1 + ;; + Manaus_Km34) + metdriverdb="${fullscen}/Manaus_Km34/Manaus_Km34_HEADER" + metcyc1=1972 + metcycf=2011 + imetavg=1 + ;; + Paracou) + metdriverdb="${fullscen}/Paracou/Paracou_HEADER" + metcyc1=1972 + metcycf=2011 + imetavg=1 + ;; + Pe-de-Gigante) + metdriverdb="${fullscen}/Pe-de-Gigante/Pe-de-Gigante_HEADER" + metcyc1=1972 + metcycf=2011 + imetavg=1 + ;; + Petrolina) + metdriverdb="${fullscen}/Petrolina/Petrolina_HEADER" + metcyc1=1972 + metcycf=2011 + imetavg=1 + ;; + Rebio_Jaru) + metdriverdb="${fullscen}/Rebio_Jaru/Rebio_Jaru_HEADER" + metcyc1=1977 + metcycf=2002 + imetavg=1 + ;; + Santarem_Km67) + metdriverdb="${fullscen}/Santarem_Km67/Santarem_Km67_HEADER" + metcyc1=1972 + metcycf=2011 + imetavg=1 + ;; + Santarem_Km77) + metdriverdb="${fullscen}/Santarem_Km77/Santarem_Km77_HEADER" + metcyc1=1972 + metcycf=2011 + imetavg=1 + ;; + Santarem_Km83) + metdriverdb="${fullscen}/Santarem_Km83/Santarem_Km83_HEADER" + metcyc1=1972 + metcycf=2011 imetavg=1 ;; *) echo 'Met driver: '${metdriver} - echo 'Sorry, this met driver is not valid for pseudo drought runs' - exit 84 + echo 'Sorry, this met driver is not valid for scenario runs' + exit 85 ;; esac #------------------------------------------------------------------------------------# @@ -1036,19 +1118,70 @@ do elif [ ${runt} == 'INITIAL' ] && [ ${initmode} -eq 6 ] then thissfilin=${fullygrown} - case ${iustein} in + case ${isizepft} in 0) #----- Frankeinstein's understorey for those that have one. ----------------------# case ${polyiata} in + hvd) + thissfilin=${bioinit}'/hvd_default.' + ;; + cax) + thissfilin=${bioinit}'/cax_default.' + ;; + s67) + thissfilin=${bioinit}'/s67_default.' + ;; + s83) + thissfilin=${bioinit}'/s83_default.' + ;; + m34) + thissfilin=${bioinit}'/m34_default.' + ;; + gyf) + thissfilin=${bioinit}'/gyf_default.' + ;; + pdg) + thissfilin=${bioinit}'/pdg_default.' + ;; + rja) + thissfilin=${bioinit}'/rja_default.' + ;; + fns) + thissfilin=${bioinit}'/fns_default.' + ;; + s77) + thissfilin=${bioinit}'/s77_default.' + ;; + pnz) + thissfilin=${bioinit}'/pnz_default.' + ;; + ban) + thissfilin=${bioinit}'/ban_default.' + ;; + *) + echo ' Polygon: '${polyname} + echo ' IATA: '${polyiata} + echo ' ISIZEPFT: '${isizepft} + echo 'This IATA cannot be used by biomass initialisation with this ISIZEPFT!' + exit 59 + ;; + esac + ;; + 1) + #----- New Frankeinstein's under-storey for those that have one. -----------------# + case ${polyiata} in hvd) thissfilin=${bioinit}'/hvd_nounder.' ;; cax) thissfilin=${bioinit}'/cax_nounder.' ;; - s67|s83) + s67) thissfilin=${bioinit}'/s67_nounder.' ;; + s83) + thissfilin=${bioinit}'/s83_nounder.' + ;; m34) thissfilin=${bioinit}'/m34_nounder.' ;; @@ -1065,59 +1198,80 @@ do thissfilin=${bioinit}'/fns_nounder.' ;; s77) - thissfilin=${bioinit}'/fns_nounder.' + thissfilin=${bioinit}'/s77_nounder.' + ;; + pnz) + thissfilin=${bioinit}'/pnz_nounder.' + ;; + ban) + thissfilin=${bioinit}'/ban_nounder.' ;; *) echo ' Polygon: '${polyname} echo ' IATA: '${polyiata} - echo ' IUSTEIN: '${iustein} - echo 'This IATA cannot be used by biomass initialisation with this IUSTEIN!' + echo ' ISIZEPFT: '${isizepft} + echo 'This IATA cannot be used by biomass initialisation with this ISIZEPFT!' exit 59 ;; esac ;; - 1) - #----- New Frankeinstein's under-storey for those that have one. -----------------# + 2) + #----- Same as default, but with only one grass and one tree. --------------------# case ${polyiata} in hvd) - thissfilin=${bioinit}'/hvd_under_sci005.' + thissfilin=${bioinit}'/hvd_twopft.' + ;; + ban) + thissfilin=${bioinit}'/ban_twopft.' ;; cax) - thissfilin=${bioinit}'/cax_under_sci005.' + thissfilin=${bioinit}'/cax_twopft.' ;; - s67|s83) - thissfilin=${bioinit}'/s67_under_sci005.' + s67) + thissfilin=${bioinit}'/s67_twopft.' + ;; + s83) + thissfilin=${bioinit}'/s83_twopft.' ;; m34) - thissfilin=${bioinit}'/m34_under_sci005.' + thissfilin=${bioinit}'/m34_twopft.' ;; gyf) - thissfilin=${bioinit}'/gyf_under_sci005.' + thissfilin=${bioinit}'/gyf_twopft.' ;; pdg) - thissfilin=${bioinit}'/pdg_under_sci005.' + thissfilin=${bioinit}'/pdg_twopft.' + ;; + pnz) + thissfilin=${bioinit}'/pnz_twopft.' ;; rja) - thissfilin=${bioinit}'/rja_under_sci005.' + thissfilin=${bioinit}'/rja_twopft.' ;; fns) - thissfilin=${bioinit}'/fns_under_sci005.' + thissfilin=${bioinit}'/fns_twopft.' ;; s77) - thissfilin=${bioinit}'/s77_under_sci005.' + thissfilin=${bioinit}'/s77_twopft.' + ;; + pnz) + thissfilin=${bioinit}'/pnz_twopft.' + ;; + ban) + thissfilin=${bioinit}'/ban_twopft.' ;; *) echo ' Polygon: '${polyname} echo ' IATA: '${polyiata} - echo ' IUSTEIN: '${iustein} - echo 'This IATA cannot be used by biomass initialisation with this IUSTEIN!' + echo ' ISIZEPFT: '${isizepft} + echo 'This IATA cannot be used by biomass initialisation with this ISIZEPFT!' exit 59 ;; esac ;; *) #----- Bad settings. -------------------------------------------------------------# - echo ' IUSTEIN should be 0, or 1 and yours is set to '${iustein}'...' + echo ' ISIZEPFT should be 0, 1, or 2 and yours is set to '${isizepft}'...' exit 66 ;; esac diff --git a/ED/Template/stopalljobs.sh b/ED/Template/stopalljobs.sh index 5351850f6..41dc8c2b9 100755 --- a/ED/Template/stopalljobs.sh +++ b/ED/Template/stopalljobs.sh @@ -66,81 +66,84 @@ do monthz=`echo ${oi} | awk '{print $10}'` datez=`echo ${oi} | awk '{print $11}'` timez=`echo ${oi} | awk '{print $12}'` - polyisoil=`echo ${oi} | awk '{print $13}'` - polyntext=`echo ${oi} | awk '{print $14}'` - polysand=`echo ${oi} | awk '{print $15}'` - polyclay=`echo ${oi} | awk '{print $16}'` - polydepth=`echo ${oi} | awk '{print $17}'` - polysoilbc=`echo ${oi} | awk '{print $18}'` - polysldrain=`echo ${oi} | awk '{print $19}'` - polycol=`echo ${oi} | awk '{print $20}'` - slzres=`echo ${oi} | awk '{print $21}'` - queue=`echo ${oi} | awk '{print $22}'` - metdriver=`echo ${oi} | awk '{print $23}'` - dtlsm=`echo ${oi} | awk '{print $24}'` - vmfactc3=`echo ${oi} | awk '{print $25}'` - vmfactc4=`echo ${oi} | awk '{print $26}'` - mphototrc3=`echo ${oi} | awk '{print $27}'` - mphototec3=`echo ${oi} | awk '{print $28}'` - mphotoc4=`echo ${oi} | awk '{print $29}'` - bphotoblc3=`echo ${oi} | awk '{print $30}'` - bphotonlc3=`echo ${oi} | awk '{print $31}'` - bphotoc4=`echo ${oi} | awk '{print $32}'` - kwgrass=`echo ${oi} | awk '{print $33}'` - kwtree=`echo ${oi} | awk '{print $34}'` - gammac3=`echo ${oi} | awk '{print $35}'` - gammac4=`echo ${oi} | awk '{print $36}'` - d0grass=`echo ${oi} | awk '{print $37}'` - d0tree=`echo ${oi} | awk '{print $38}'` - alphac3=`echo ${oi} | awk '{print $39}'` - alphac4=`echo ${oi} | awk '{print $40}'` - klowco2=`echo ${oi} | awk '{print $41}'` - decomp=`echo ${oi} | awk '{print $42}'` - rrffact=`echo ${oi} | awk '{print $43}'` - growthresp=`echo ${oi} | awk '{print $44}'` - lwidthgrass=`echo ${oi} | awk '{print $45}'` - lwidthbltree=`echo ${oi} | awk '{print $46}'` - lwidthnltree=`echo ${oi} | awk '{print $47}'` - q10c3=`echo ${oi} | awk '{print $48}'` - q10c4=`echo ${oi} | awk '{print $49}'` - h2olimit=`echo ${oi} | awk '{print $50}'` - imortscheme=`echo ${oi} | awk '{print $51}'` - ddmortconst=`echo ${oi} | awk '{print $52}'` - isfclyrm=`echo ${oi} | awk '{print $53}'` - icanturb=`echo ${oi} | awk '{print $54}'` - ubmin=`echo ${oi} | awk '{print $55}'` - ugbmin=`echo ${oi} | awk '{print $56}'` - ustmin=`echo ${oi} | awk '{print $57}'` - gamm=`echo ${oi} | awk '{print $58}'` - gamh=`echo ${oi} | awk '{print $59}'` - tprandtl=`echo ${oi} | awk '{print $60}'` - ribmax=`echo ${oi} | awk '{print $61}'` - atmco2=`echo ${oi} | awk '{print $62}'` - thcrit=`echo ${oi} | awk '{print $63}'` - smfire=`echo ${oi} | awk '{print $64}'` - ifire=`echo ${oi} | awk '{print $65}'` - fireparm=`echo ${oi} | awk '{print $66}'` - ipercol=`echo ${oi} | awk '{print $67}'` - runoff=`echo ${oi} | awk '{print $68}'` - imetrad=`echo ${oi} | awk '{print $69}'` - ibranch=`echo ${oi} | awk '{print $70}'` - icanrad=`echo ${oi} | awk '{print $71}'` - crown=`echo ${oi} | awk '{print $72}'` - ltransvis=`echo ${oi} | awk '{print $73}'` - lreflectvis=`echo ${oi} | awk '{print $74}'` - ltransnir=`echo ${oi} | awk '{print $75}'` - lreflectnir=`echo ${oi} | awk '{print $76}'` - orienttree=`echo ${oi} | awk '{print $77}'` - orientgrass=`echo ${oi} | awk '{print $78}'` - clumptree=`echo ${oi} | awk '{print $79}'` - clumpgrass=`echo ${oi} | awk '{print $80}'` - ivegtdyn=`echo ${oi} | awk '{print $81}'` - igndvap=`echo ${oi} | awk '{print $82}'` - iphen=`echo ${oi} | awk '{print $83}'` - iallom=`echo ${oi} | awk '{print $84}'` - ibigleaf=`echo ${oi} | awk '{print $85}'` - irepro=`echo ${oi} | awk '{print $86}'` - treefall=`echo ${oi} | awk '{print $87}'` + initmode=`echo ${oi} | awk '{print $13}'` + iscenario=`echo ${oi} | awk '{print $14}'` + isizepft=`echo ${oi} | awk '{print $15}'` + polyisoil=`echo ${oi} | awk '{print $16}'` + polyntext=`echo ${oi} | awk '{print $17}'` + polysand=`echo ${oi} | awk '{print $18}'` + polyclay=`echo ${oi} | awk '{print $19}'` + polydepth=`echo ${oi} | awk '{print $20}'` + polysoilbc=`echo ${oi} | awk '{print $21}'` + polysldrain=`echo ${oi} | awk '{print $22}'` + polycol=`echo ${oi} | awk '{print $23}'` + slzres=`echo ${oi} | awk '{print $24}'` + queue=`echo ${oi} | awk '{print $25}'` + metdriver=`echo ${oi} | awk '{print $26}'` + dtlsm=`echo ${oi} | awk '{print $27}'` + vmfactc3=`echo ${oi} | awk '{print $28}'` + vmfactc4=`echo ${oi} | awk '{print $29}'` + mphototrc3=`echo ${oi} | awk '{print $30}'` + mphototec3=`echo ${oi} | awk '{print $31}'` + mphotoc4=`echo ${oi} | awk '{print $32}'` + bphotoblc3=`echo ${oi} | awk '{print $33}'` + bphotonlc3=`echo ${oi} | awk '{print $34}'` + bphotoc4=`echo ${oi} | awk '{print $35}'` + kwgrass=`echo ${oi} | awk '{print $36}'` + kwtree=`echo ${oi} | awk '{print $37}'` + gammac3=`echo ${oi} | awk '{print $38}'` + gammac4=`echo ${oi} | awk '{print $39}'` + d0grass=`echo ${oi} | awk '{print $40}'` + d0tree=`echo ${oi} | awk '{print $41}'` + alphac3=`echo ${oi} | awk '{print $42}'` + alphac4=`echo ${oi} | awk '{print $43}'` + klowco2=`echo ${oi} | awk '{print $44}'` + decomp=`echo ${oi} | awk '{print $45}'` + rrffact=`echo ${oi} | awk '{print $46}'` + growthresp=`echo ${oi} | awk '{print $47}'` + lwidthgrass=`echo ${oi} | awk '{print $48}'` + lwidthbltree=`echo ${oi} | awk '{print $49}'` + lwidthnltree=`echo ${oi} | awk '{print $50}'` + q10c3=`echo ${oi} | awk '{print $51}'` + q10c4=`echo ${oi} | awk '{print $52}'` + h2olimit=`echo ${oi} | awk '{print $53}'` + imortscheme=`echo ${oi} | awk '{print $54}'` + ddmortconst=`echo ${oi} | awk '{print $55}'` + isfclyrm=`echo ${oi} | awk '{print $56}'` + icanturb=`echo ${oi} | awk '{print $57}'` + ubmin=`echo ${oi} | awk '{print $58}'` + ugbmin=`echo ${oi} | awk '{print $59}'` + ustmin=`echo ${oi} | awk '{print $60}'` + gamm=`echo ${oi} | awk '{print $61}'` + gamh=`echo ${oi} | awk '{print $62}'` + tprandtl=`echo ${oi} | awk '{print $63}'` + ribmax=`echo ${oi} | awk '{print $64}'` + atmco2=`echo ${oi} | awk '{print $65}'` + thcrit=`echo ${oi} | awk '{print $66}'` + smfire=`echo ${oi} | awk '{print $67}'` + ifire=`echo ${oi} | awk '{print $68}'` + fireparm=`echo ${oi} | awk '{print $69}'` + ipercol=`echo ${oi} | awk '{print $70}'` + runoff=`echo ${oi} | awk '{print $71}'` + imetrad=`echo ${oi} | awk '{print $72}'` + ibranch=`echo ${oi} | awk '{print $73}'` + icanrad=`echo ${oi} | awk '{print $74}'` + crown=`echo ${oi} | awk '{print $75}'` + ltransvis=`echo ${oi} | awk '{print $76}'` + lreflectvis=`echo ${oi} | awk '{print $77}'` + ltransnir=`echo ${oi} | awk '{print $78}'` + lreflectnir=`echo ${oi} | awk '{print $79}'` + orienttree=`echo ${oi} | awk '{print $80}'` + orientgrass=`echo ${oi} | awk '{print $81}'` + clumptree=`echo ${oi} | awk '{print $82}'` + clumpgrass=`echo ${oi} | awk '{print $83}'` + ivegtdyn=`echo ${oi} | awk '{print $84}'` + igndvap=`echo ${oi} | awk '{print $85}'` + iphen=`echo ${oi} | awk '{print $86}'` + iallom=`echo ${oi} | awk '{print $87}'` + ibigleaf=`echo ${oi} | awk '{print $88}'` + irepro=`echo ${oi} | awk '{print $89}'` + treefall=`echo ${oi} | awk '{print $90}'` #---------------------------------------------------------------------------------------# bkill -J ${desc}-${polyname} -q ${queue} diff --git a/ED/Template/submitter.sh b/ED/Template/submitter.sh index be8ef2ab8..91ed6f677 100755 --- a/ED/Template/submitter.sh +++ b/ED/Template/submitter.sh @@ -39,81 +39,84 @@ do monthz=`echo ${oi} | awk '{print $10}'` datez=`echo ${oi} | awk '{print $11}'` timez=`echo ${oi} | awk '{print $12}'` - polyisoil=`echo ${oi} | awk '{print $13}'` - polyntext=`echo ${oi} | awk '{print $14}'` - polysand=`echo ${oi} | awk '{print $15}'` - polyclay=`echo ${oi} | awk '{print $16}'` - polydepth=`echo ${oi} | awk '{print $17}'` - polysoilbc=`echo ${oi} | awk '{print $18}'` - polysldrain=`echo ${oi} | awk '{print $19}'` - polycol=`echo ${oi} | awk '{print $20}'` - slzres=`echo ${oi} | awk '{print $21}'` - queue=`echo ${oi} | awk '{print $22}'` - metdriver=`echo ${oi} | awk '{print $23}'` - dtlsm=`echo ${oi} | awk '{print $24}'` - vmfactc3=`echo ${oi} | awk '{print $25}'` - vmfactc4=`echo ${oi} | awk '{print $26}'` - mphototrc3=`echo ${oi} | awk '{print $27}'` - mphototec3=`echo ${oi} | awk '{print $28}'` - mphotoc4=`echo ${oi} | awk '{print $29}'` - bphotoblc3=`echo ${oi} | awk '{print $30}'` - bphotonlc3=`echo ${oi} | awk '{print $31}'` - bphotoc4=`echo ${oi} | awk '{print $32}'` - kwgrass=`echo ${oi} | awk '{print $33}'` - kwtree=`echo ${oi} | awk '{print $34}'` - gammac3=`echo ${oi} | awk '{print $35}'` - gammac4=`echo ${oi} | awk '{print $36}'` - d0grass=`echo ${oi} | awk '{print $37}'` - d0tree=`echo ${oi} | awk '{print $38}'` - alphac3=`echo ${oi} | awk '{print $39}'` - alphac4=`echo ${oi} | awk '{print $40}'` - klowco2=`echo ${oi} | awk '{print $41}'` - decomp=`echo ${oi} | awk '{print $42}'` - rrffact=`echo ${oi} | awk '{print $43}'` - growthresp=`echo ${oi} | awk '{print $44}'` - lwidthgrass=`echo ${oi} | awk '{print $45}'` - lwidthbltree=`echo ${oi} | awk '{print $46}'` - lwidthnltree=`echo ${oi} | awk '{print $47}'` - q10c3=`echo ${oi} | awk '{print $48}'` - q10c4=`echo ${oi} | awk '{print $49}'` - h2olimit=`echo ${oi} | awk '{print $50}'` - imortscheme=`echo ${oi} | awk '{print $51}'` - ddmortconst=`echo ${oi} | awk '{print $52}'` - isfclyrm=`echo ${oi} | awk '{print $53}'` - icanturb=`echo ${oi} | awk '{print $54}'` - ubmin=`echo ${oi} | awk '{print $55}'` - ugbmin=`echo ${oi} | awk '{print $56}'` - ustmin=`echo ${oi} | awk '{print $57}'` - gamm=`echo ${oi} | awk '{print $58}'` - gamh=`echo ${oi} | awk '{print $59}'` - tprandtl=`echo ${oi} | awk '{print $60}'` - ribmax=`echo ${oi} | awk '{print $61}'` - atmco2=`echo ${oi} | awk '{print $62}'` - thcrit=`echo ${oi} | awk '{print $63}'` - smfire=`echo ${oi} | awk '{print $64}'` - ifire=`echo ${oi} | awk '{print $65}'` - fireparm=`echo ${oi} | awk '{print $66}'` - ipercol=`echo ${oi} | awk '{print $67}'` - runoff=`echo ${oi} | awk '{print $68}'` - imetrad=`echo ${oi} | awk '{print $69}'` - ibranch=`echo ${oi} | awk '{print $70}'` - icanrad=`echo ${oi} | awk '{print $71}'` - crown=`echo ${oi} | awk '{print $72}'` - ltransvis=`echo ${oi} | awk '{print $73}'` - lreflectvis=`echo ${oi} | awk '{print $74}'` - ltransnir=`echo ${oi} | awk '{print $75}'` - lreflectnir=`echo ${oi} | awk '{print $76}'` - orienttree=`echo ${oi} | awk '{print $77}'` - orientgrass=`echo ${oi} | awk '{print $78}'` - clumptree=`echo ${oi} | awk '{print $79}'` - clumpgrass=`echo ${oi} | awk '{print $80}'` - ivegtdyn=`echo ${oi} | awk '{print $81}'` - igndvap=`echo ${oi} | awk '{print $82}'` - iphen=`echo ${oi} | awk '{print $83}'` - iallom=`echo ${oi} | awk '{print $84}'` - ibigleaf=`echo ${oi} | awk '{print $85}'` - irepro=`echo ${oi} | awk '{print $86}'` - treefall=`echo ${oi} | awk '{print $87}'` + initmode=`echo ${oi} | awk '{print $13}'` + iscenario=`echo ${oi} | awk '{print $14}'` + isizepft=`echo ${oi} | awk '{print $15}'` + polyisoil=`echo ${oi} | awk '{print $16}'` + polyntext=`echo ${oi} | awk '{print $17}'` + polysand=`echo ${oi} | awk '{print $18}'` + polyclay=`echo ${oi} | awk '{print $19}'` + polydepth=`echo ${oi} | awk '{print $20}'` + polysoilbc=`echo ${oi} | awk '{print $21}'` + polysldrain=`echo ${oi} | awk '{print $22}'` + polycol=`echo ${oi} | awk '{print $23}'` + slzres=`echo ${oi} | awk '{print $24}'` + queue=`echo ${oi} | awk '{print $25}'` + metdriver=`echo ${oi} | awk '{print $26}'` + dtlsm=`echo ${oi} | awk '{print $27}'` + vmfactc3=`echo ${oi} | awk '{print $28}'` + vmfactc4=`echo ${oi} | awk '{print $29}'` + mphototrc3=`echo ${oi} | awk '{print $30}'` + mphototec3=`echo ${oi} | awk '{print $31}'` + mphotoc4=`echo ${oi} | awk '{print $32}'` + bphotoblc3=`echo ${oi} | awk '{print $33}'` + bphotonlc3=`echo ${oi} | awk '{print $34}'` + bphotoc4=`echo ${oi} | awk '{print $35}'` + kwgrass=`echo ${oi} | awk '{print $36}'` + kwtree=`echo ${oi} | awk '{print $37}'` + gammac3=`echo ${oi} | awk '{print $38}'` + gammac4=`echo ${oi} | awk '{print $39}'` + d0grass=`echo ${oi} | awk '{print $40}'` + d0tree=`echo ${oi} | awk '{print $41}'` + alphac3=`echo ${oi} | awk '{print $42}'` + alphac4=`echo ${oi} | awk '{print $43}'` + klowco2=`echo ${oi} | awk '{print $44}'` + decomp=`echo ${oi} | awk '{print $45}'` + rrffact=`echo ${oi} | awk '{print $46}'` + growthresp=`echo ${oi} | awk '{print $47}'` + lwidthgrass=`echo ${oi} | awk '{print $48}'` + lwidthbltree=`echo ${oi} | awk '{print $49}'` + lwidthnltree=`echo ${oi} | awk '{print $50}'` + q10c3=`echo ${oi} | awk '{print $51}'` + q10c4=`echo ${oi} | awk '{print $52}'` + h2olimit=`echo ${oi} | awk '{print $53}'` + imortscheme=`echo ${oi} | awk '{print $54}'` + ddmortconst=`echo ${oi} | awk '{print $55}'` + isfclyrm=`echo ${oi} | awk '{print $56}'` + icanturb=`echo ${oi} | awk '{print $57}'` + ubmin=`echo ${oi} | awk '{print $58}'` + ugbmin=`echo ${oi} | awk '{print $59}'` + ustmin=`echo ${oi} | awk '{print $60}'` + gamm=`echo ${oi} | awk '{print $61}'` + gamh=`echo ${oi} | awk '{print $62}'` + tprandtl=`echo ${oi} | awk '{print $63}'` + ribmax=`echo ${oi} | awk '{print $64}'` + atmco2=`echo ${oi} | awk '{print $65}'` + thcrit=`echo ${oi} | awk '{print $66}'` + smfire=`echo ${oi} | awk '{print $67}'` + ifire=`echo ${oi} | awk '{print $68}'` + fireparm=`echo ${oi} | awk '{print $69}'` + ipercol=`echo ${oi} | awk '{print $70}'` + runoff=`echo ${oi} | awk '{print $71}'` + imetrad=`echo ${oi} | awk '{print $72}'` + ibranch=`echo ${oi} | awk '{print $73}'` + icanrad=`echo ${oi} | awk '{print $74}'` + crown=`echo ${oi} | awk '{print $75}'` + ltransvis=`echo ${oi} | awk '{print $76}'` + lreflectvis=`echo ${oi} | awk '{print $77}'` + ltransnir=`echo ${oi} | awk '{print $78}'` + lreflectnir=`echo ${oi} | awk '{print $79}'` + orienttree=`echo ${oi} | awk '{print $80}'` + orientgrass=`echo ${oi} | awk '{print $81}'` + clumptree=`echo ${oi} | awk '{print $82}'` + clumpgrass=`echo ${oi} | awk '{print $83}'` + ivegtdyn=`echo ${oi} | awk '{print $84}'` + igndvap=`echo ${oi} | awk '{print $85}'` + iphen=`echo ${oi} | awk '{print $86}'` + iallom=`echo ${oi} | awk '{print $87}'` + ibigleaf=`echo ${oi} | awk '{print $88}'` + irepro=`echo ${oi} | awk '{print $89}'` + treefall=`echo ${oi} | awk '{print $90}'` #---------------------------------------------------------------------------------------# diff --git a/ED/src/dynamics/radiate_driver.f90 b/ED/src/dynamics/radiate_driver.f90 index 5623e0974..0856fbf10 100644 --- a/ED/src/dynamics/radiate_driver.f90 +++ b/ED/src/dynamics/radiate_driver.f90 @@ -306,6 +306,8 @@ subroutine sfcrad_ed(cosz,cosaoi,csite,mzg,mzs,ntext_soil,ncol_soil,maxcohort,tu real :: upward_lw_above_incid real :: downward_rshort_below_beam real :: downward_rshort_below_diffuse + real :: upward_rshort_above_beam + real :: upward_rshort_above_diffuse real :: surface_absorbed_longwave_surf real :: surface_absorbed_longwave_incid real :: nir_v_beam @@ -951,6 +953,15 @@ subroutine sfcrad_ed(cosz,cosaoi,csite,mzg,mzs,ntext_soil,ncol_soil,maxcohort,tu + !----- Above-canopy upwelling radiation. --------------------------------------! + upward_rshort_above_beam = upward_par_above_beam & + + upward_nir_above_beam + upward_rshort_above_diffuse = upward_par_above_diffuse & + + upward_nir_above_diffuse + !------------------------------------------------------------------------------! + + + !----- Below-canopy downwelling radiation. ------------------------------------! downward_rshort_below_beam = downward_par_below_beam & + downward_nir_below_beam @@ -961,37 +972,46 @@ subroutine sfcrad_ed(cosz,cosaoi,csite,mzg,mzs,ntext_soil,ncol_soil,maxcohort,tu !----- Soil+sfcwater+veg albedo (different for diffuse and beam radiation). ---! - csite%albedo_beam(ipa) = ( upward_par_above_beam & - + upward_nir_above_beam ) & + csite%albedo_beam(ipa) = upward_rshort_above_beam & / sngloff( par_beam_norm + nir_beam_norm & , tiny_offset ) - csite%albedo_diffuse(ipa) = ( upward_par_above_diffuse & - + upward_nir_above_diffuse ) & + csite%albedo_diffuse(ipa) = upward_rshort_above_diffuse & / sngloff( par_diff_norm + nir_diff_norm & , tiny_offset ) - csite%albedo(ipa) = ( upward_par_above_beam + upward_nir_above_beam & - + upward_par_above_diffuse + upward_nir_above_diffuse ) + csite%albedo(ipa) = ( upward_rshort_above_beam & + + upward_rshort_above_diffuse ) !------------------------------------------------------------------------------! else !----- The code expects values for these, even when it is not daytime. --------! - downward_par_below_beam = par_beam_norm - downward_par_below_diffuse = par_diff_norm - downward_nir_below_beam = nir_beam_norm - downward_nir_below_diffuse = nir_diff_norm - downward_rshort_below_beam = par_beam_norm + nir_beam_norm - downward_rshort_below_diffuse = par_diff_norm + nir_diff_norm - csite%albedo_beam (ipa) = ( albedo_ground_par * par_beam_norm & - + albedo_ground_nir * nir_beam_norm ) & + downward_par_below_beam = par_beam_norm + downward_par_below_diffuse = par_diff_norm + downward_nir_below_beam = nir_beam_norm + downward_nir_below_diffuse = nir_diff_norm + downward_rshort_below_beam = par_beam_norm + nir_beam_norm + downward_rshort_below_diffuse = par_diff_norm + nir_diff_norm + upward_par_above_beam = albedo_ground_par * par_beam_norm + upward_par_above_diffuse = albedo_ground_par * par_diff_norm + upward_nir_above_beam = albedo_ground_nir * nir_beam_norm + upward_nir_above_diffuse = albedo_ground_nir * nir_diff_norm + upward_rshort_above_beam = upward_par_above_beam & + + upward_nir_above_beam + upward_rshort_above_diffuse = upward_par_above_diffuse & + + upward_nir_above_diffuse + csite%albedo_beam (ipa) = ( upward_par_above_beam & + + upward_nir_above_beam ) & / ( par_beam_norm + nir_beam_norm ) - csite%albedo_diffuse (ipa) = ( albedo_ground_par * par_diff_norm & - + albedo_ground_nir * nir_diff_norm ) & + csite%albedo_diffuse (ipa) = ( upward_par_above_diffuse & + + upward_nir_above_diffuse ) & / ( par_diff_norm + nir_diff_norm ) - csite%albedo (ipa) = albedo_ground_par * par_beam_norm & - + albedo_ground_nir * nir_beam_norm & - + albedo_ground_par * par_diff_norm & - + albedo_ground_nir * nir_diff_norm + csite%albedo (ipa) = ( upward_rshort_above_beam & + + upward_rshort_above_diffuse ) + !------------------------------------------------------------------------------! end if + !---------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------! ! Absorption rates of PAR, rshort, and rlong of the vegetation. Here we ! @@ -1200,21 +1220,29 @@ subroutine sfcrad_ed(cosz,cosaoi,csite,mzg,mzs,ntext_soil,ncol_soil,maxcohort,tu downward_nir_below_diffuse = nir_diff_norm downward_rshort_below_beam = par_beam_norm + nir_beam_norm downward_rshort_below_diffuse = par_diff_norm + nir_diff_norm + + upward_par_above_beam = albedo_ground_par * par_beam_norm + upward_par_above_diffuse = albedo_ground_par * par_diff_norm + upward_nir_above_beam = albedo_ground_nir * nir_beam_norm + upward_nir_above_diffuse = albedo_ground_nir * nir_diff_norm + upward_rshort_above_beam = upward_par_above_beam & + + upward_nir_above_beam + upward_rshort_above_diffuse = upward_par_above_diffuse & + + upward_nir_above_diffuse + surface_absorbed_longwave_surf = - emissivity * stefan * T_surface**4 surface_absorbed_longwave_incid = emissivity - csite%albedo_beam (ipa) = ( albedo_ground_par * par_beam_norm & - + albedo_ground_nir * nir_beam_norm ) & + + csite%albedo_beam (ipa) = ( upward_par_above_beam & + + upward_nir_above_beam ) & / ( par_beam_norm + nir_beam_norm ) - csite%albedo_diffuse (ipa) = ( albedo_ground_par * par_diff_norm & - + albedo_ground_nir * nir_diff_norm ) & + csite%albedo_diffuse (ipa) = ( upward_par_above_diffuse & + + upward_nir_above_diffuse ) & / ( par_diff_norm + nir_diff_norm ) - csite%albedo (ipa) = albedo_ground_par * par_beam_norm & - + albedo_ground_nir * nir_beam_norm & - + albedo_ground_par * par_diff_norm & - + albedo_ground_nir * nir_diff_norm + csite%albedo (ipa) = ( upward_rshort_above_beam & + + upward_rshort_above_diffuse ) csite%rlongup (ipa) = - surface_absorbed_longwave_surf csite%rlong_albedo (ipa) = 1.0 - surface_absorbed_longwave_incid - end if !----- Absorption rate of short wave by the soil. -----------------------------------! @@ -1222,7 +1250,11 @@ subroutine sfcrad_ed(cosz,cosaoi,csite,mzg,mzs,ntext_soil,ncol_soil,maxcohort,tu + downward_nir_below_beam * abs_ground_nir csite%rshort_g_diffuse(ipa) = downward_par_below_diffuse * abs_ground_par & + downward_nir_below_diffuse * abs_ground_nir - + csite%parup (ipa) = upward_par_above_beam & + + upward_par_above_diffuse + csite%nirup (ipa) = upward_nir_above_beam & + + upward_nir_above_diffuse + !----- Incident radiation at the ground. --------------------------------------------! csite%par_b_beam (ipa) = downward_par_below_beam csite%nir_b_beam (ipa) = downward_nir_below_beam @@ -1532,11 +1564,15 @@ subroutine scale_ed_radiation(tuco,rshort,rshort_diffuse,rlong,csite) csite%nir_b_beam (ipa) = 0. csite%nir_b_diffuse (ipa) = 0. csite%nir_b (ipa) = 0. + csite%parup (ipa) = 0. + csite%nirup (ipa) = 0. + csite%rshortup (ipa) = 0. + csite%rnet (ipa) = 0. !----- Absorption rate of short wave by the surface water. -----------------------! do k=1,csite%nlev_sfcwater(ipa) - csite%rshort_s_beam(k,ipa) = 0. + csite%rshort_s_beam (k,ipa) = 0. csite%rshort_s_diffuse(k,ipa) = 0. - csite%rshort_s(k,ipa) = 0. + csite%rshort_s (k,ipa) = 0. end do csite%rlong_s_incid(ipa) = 0. csite%rlong_g_incid(ipa) = 0. @@ -1581,23 +1617,31 @@ subroutine scale_ed_radiation(tuco,rshort,rshort_diffuse,rlong,csite) + cpatch%rlong_w_surf(ico) end if end do - csite%par_l_beam_max(ipa) = csite%par_l_beam_max(ipa) * rshort - csite%par_l_diffuse_max(ipa) = csite%par_l_diffuse_max(ipa) * rshort - csite%par_l_max(ipa) = csite%par_l_beam_max(ipa) & - + csite%par_l_diffuse_max(ipa) - - csite%rshort_g_beam(ipa) = csite%rshort_g_beam(ipa) * rshort - csite%rshort_g_diffuse(ipa) = csite%rshort_g_diffuse(ipa) * rshort - csite%rshort_g(ipa) = csite%rshort_g_beam(ipa) + csite%rshort_g_diffuse(ipa) - - csite%par_b_beam(ipa) = csite%par_b_beam(ipa) * rshort - csite%par_b_diffuse(ipa) = csite%par_b_diffuse(ipa) * rshort - csite%par_b(ipa) = csite%par_b_beam(ipa) + csite%par_b_diffuse(ipa) - - csite%nir_b_beam(ipa) = csite%nir_b_beam(ipa) * rshort - csite%nir_b_diffuse(ipa) = csite%nir_b_diffuse(ipa) * rshort - csite%nir_b(ipa) = csite%nir_b_beam(ipa) + csite%nir_b_diffuse(ipa) - + csite%par_l_beam_max (ipa) = csite%par_l_beam_max (ipa) * rshort + csite%par_l_diffuse_max (ipa) = csite%par_l_diffuse_max (ipa) * rshort + csite%par_l_max (ipa) = csite%par_l_beam_max (ipa) & + + csite%par_l_diffuse_max (ipa) + + csite%rshort_g_beam (ipa) = csite%rshort_g_beam (ipa) * rshort + csite%rshort_g_diffuse (ipa) = csite%rshort_g_diffuse (ipa) * rshort + csite%rshort_g (ipa) = csite%rshort_g_beam (ipa) & + + csite%rshort_g_diffuse (ipa) + + csite%par_b_beam (ipa) = csite%par_b_beam (ipa) * rshort + csite%par_b_diffuse (ipa) = csite%par_b_diffuse (ipa) * rshort + csite%par_b (ipa) = csite%par_b_beam (ipa) & + + csite%par_b_diffuse (ipa) + csite%nir_b_beam (ipa) = csite%nir_b_beam (ipa) * rshort + csite%nir_b_diffuse (ipa) = csite%nir_b_diffuse (ipa) * rshort + csite%nir_b (ipa) = csite%nir_b_beam (ipa) & + + csite%nir_b_diffuse (ipa) + csite%parup (ipa) = csite%parup (ipa) * rshort + csite%nirup (ipa) = csite%nirup (ipa) * rshort + csite%rshortup (ipa) = csite%parup (ipa) & + + csite%nirup (ipa) + csite%rnet (ipa) = rshort + rlong & + - csite%rshortup (ipa) & + - csite%rlongup (ipa) !----- Absorption rate of short wave by the surface water. --------------------------! do k=1,csite%nlev_sfcwater(ipa) csite%rshort_s_beam(k,ipa) = csite%rshort_s_beam (k,ipa) * rshort diff --git a/ED/src/dynamics/rk4_driver.F90 b/ED/src/dynamics/rk4_driver.F90 index 770927e3a..08af78b1a 100644 --- a/ED/src/dynamics/rk4_driver.F90 +++ b/ED/src/dynamics/rk4_driver.F90 @@ -502,8 +502,16 @@ subroutine initp2modelp(hdid,initp,csite,ipa,wbudget_loss2atm,ebudget_netrad !---------------------------------------------------------------------------------! ! These variables are integrated here, since they don't change with time. ! !---------------------------------------------------------------------------------! + csite%avg_parup (ipa) = csite%avg_parup (ipa) & + + csite%parup (ipa) * sngl(hdid) + csite%avg_nirup (ipa) = csite%avg_parup (ipa) & + + csite%nirup (ipa) * sngl(hdid) + csite%avg_rshortup (ipa) = csite%avg_rshortup (ipa) & + + csite%rshortup (ipa) * sngl(hdid) csite%avg_rlongup (ipa) = csite%avg_rlongup (ipa) & + csite%rlongup (ipa) * sngl(hdid) + csite%avg_rnet (ipa) = csite%avg_rnet (ipa) & + + csite%rnet (ipa) * sngl(hdid) csite%avg_albedo (ipa) = csite%avg_albedo (ipa) & + csite%albedo (ipa) * sngl(hdid) csite%avg_albedo_beam (ipa) = csite%avg_albedo_beam (ipa) & diff --git a/ED/src/dynamics/vegetation_dynamics.f90 b/ED/src/dynamics/vegetation_dynamics.f90 index 3549051cd..7ecafa832 100644 --- a/ED/src/dynamics/vegetation_dynamics.f90 +++ b/ED/src/dynamics/vegetation_dynamics.f90 @@ -258,10 +258,9 @@ subroutine vegetation_dynamics_eq_0(new_month,new_year) call normalize_ed_dailyNPP_vars(cgrid) !------------------------------------------------------------------------------------! - ! This should be done every day, but after the longer-scale steps. We update ! - ! the carbon and nitrogen pools, and re-set the daily variables. ! + ! This should be done every day, but after the longer-scale steps. We re-set ! + ! the daily variables. ! !------------------------------------------------------------------------------------! - call update_C_and_N_pools(cgrid) call zero_ed_daily_vars(cgrid) !------------------------------------------------------------------------------------! diff --git a/ED/src/init/ed_init.f90 b/ED/src/init/ed_init.f90 index 79e4c5076..fc3abaecb 100644 --- a/ED/src/init/ed_init.f90 +++ b/ED/src/init/ed_init.f90 @@ -341,7 +341,7 @@ subroutine load_ecosystem_state() case (4,7) continue case default - call set_site_defprops() + call set_site_defprops() end select if (mynum < nnodetot) call MPI_Send(ping,1,MPI_INTEGER,sendnum,100,MPI_COMM_WORLD,ierr) diff --git a/ED/src/init/ed_params.f90 b/ED/src/init/ed_params.f90 index 7f3248144..7369bcc1b 100644 --- a/ED/src/init/ed_params.f90 +++ b/ED/src/init/ed_params.f90 @@ -619,26 +619,31 @@ subroutine init_can_rad_params() !---------------------------------------------------------------------------------------! - ! Wood reflectance, using CLM parameters. ! + ! Wood reflectance, using values based on: ! + ! ! + ! Asner, G., 1998: Biophysical and biochemical sources of variability in canopy ! + ! reflectance. Remote Sensing of Environment, 64, 234-253. ! + ! ! + ! Commented values are from CLM, but they were quite high. ! !---------------------------------------------------------------------------------------! !----- Visible (PAR). ------------------------------------------------------------------! - wood_reflect_vis(1) = 3.60d-1 - wood_reflect_vis(2:4) = 1.60d-1 - wood_reflect_vis(5) = 3.60d-1 - wood_reflect_vis(6:11) = 1.60d-1 - wood_reflect_vis(12:13) = 3.60d-1 - wood_reflect_vis(14:15) = 3.60d-1 - wood_reflect_vis(16) = 3.60d-1 - wood_reflect_vis(17) = 1.60d-2 + wood_reflect_vis(1) = 1.60d-1 ! 3.10d-1 + wood_reflect_vis(2:4) = 1.10d-1 ! 1.60d-1 + wood_reflect_vis(5) = 1.60d-1 ! 3.10d-1 + wood_reflect_vis(6:11) = 1.10d-1 ! 1.60d-1 + wood_reflect_vis(12:13) = 1.60d-1 ! 3.10d-1 + wood_reflect_vis(14:15) = 1.10d-1 ! 3.10d-1 + wood_reflect_vis(16) = 1.60d-1 ! 3.10d-1 + wood_reflect_vis(17) = 1.10d-1 ! 1.60d-1 !----- Near infrared. ------------------------------------------------------------------! - wood_reflect_nir(1) = 5.80d-1 - wood_reflect_nir(2:4) = 3.90d-1 - wood_reflect_nir(5) = 5.80d-1 - wood_reflect_nir( 6:11) = 3.90d-1 - wood_reflect_nir(12:13) = 5.80d-1 - wood_reflect_nir(14:15) = 5.80d-1 - wood_reflect_nir(16) = 5.80d-1 - wood_reflect_nir(17) = 3.90d-1 + wood_reflect_nir(1) = 2.50d-1 ! 5.30d-1 + wood_reflect_nir(2:4) = 2.50d-1 ! 3.90d-1 + wood_reflect_nir(5) = 2.50d-1 ! 5.30d-1 + wood_reflect_nir( 6:11) = 2.50d-1 ! 3.90d-1 + wood_reflect_nir(12:13) = 2.50d-1 ! 5.30d-1 + wood_reflect_nir(14:15) = 2.50d-1 ! 5.30d-1 + wood_reflect_nir(16) = 2.50d-1 ! 5.30d-1 + wood_reflect_nir(17) = 2.50d-1 ! 3.90d-1 !---------------------------------------------------------------------------------------! diff --git a/ED/src/init/ed_type_init.f90 b/ED/src/init/ed_type_init.f90 index 8cc7860f5..2291e289a 100644 --- a/ED/src/init/ed_type_init.f90 +++ b/ED/src/init/ed_type_init.f90 @@ -515,6 +515,10 @@ subroutine init_ed_patch_vars(csite,ip1,ip2,lsl) csite%avg_rshort_gnd (ip1:ip2) = 0.0 csite%avg_rlong_gnd (ip1:ip2) = 0.0 csite%avg_rlongup (ip1:ip2) = 0.0 + csite%avg_parup (ip1:ip2) = 0.0 + csite%avg_nirup (ip1:ip2) = 0.0 + csite%avg_rshortup (ip1:ip2) = 0.0 + csite%avg_rnet (ip1:ip2) = 0.0 csite%avg_albedo (ip1:ip2) = 0.0 csite%avg_albedo_beam (ip1:ip2) = 0.0 csite%avg_albedo_diffuse (ip1:ip2) = 0.0 @@ -564,8 +568,12 @@ subroutine init_ed_patch_vars(csite,ip1,ip2,lsl) csite%albedo (ip1:ip2) = 0.0 csite%albedo_beam (ip1:ip2) = 0.0 csite%albedo_diffuse (ip1:ip2) = 0.0 - csite%rlongup (ip1:ip2) = 0.0 csite%rlong_albedo (ip1:ip2) = 0.0 + csite%rlongup (ip1:ip2) = 0.0 + csite%parup (ip1:ip2) = 0.0 + csite%nirup (ip1:ip2) = 0.0 + csite%rshortup (ip1:ip2) = 0.0 + csite%rnet (ip1:ip2) = 0.0 csite%fsc_in (ip1:ip2) = 0.0 csite%ssc_in (ip1:ip2) = 0.0 @@ -643,18 +651,51 @@ subroutine init_ed_site_vars(cpoly, lat) integer , external :: julday !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! + ! Size and PFT tables. ! + !---------------------------------------------------------------------------------------! cpoly%basal_area (1:n_pft, 1:n_dbh, :) = 0.0 + cpoly%agb (1:n_pft, 1:n_dbh, :) = 0.0 + cpoly%pldens (1:n_pft, 1:n_dbh, :) = 0.0 + cpoly%bseeds (1:n_pft, 1:n_dbh, :) = 0.0 + cpoly%basal_area_growth(1:n_pft, 1:n_dbh, :) = 0.0 cpoly%basal_area_mort (1:n_pft, 1:n_dbh, :) = 0.0 cpoly%basal_area_cut (1:n_pft, 1:n_dbh, :) = 0.0 - cpoly%agb (1:n_pft, 1:n_dbh, :) = 0.0 cpoly%agb_growth (1:n_pft, 1:n_dbh, :) = 0.0 cpoly%agb_mort (1:n_pft, 1:n_dbh, :) = 0.0 cpoly%agb_cut (1:n_pft, 1:n_dbh, :) = 0.0 + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Radiation-related variables. ! + !---------------------------------------------------------------------------------------! + cpoly%cosaoi (:) = 0.0 + cpoly%daylight (:) = 0.0 + !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! + ! Hydrology-related variables. ! + !---------------------------------------------------------------------------------------! + cpoly%runoff (:) = 0.0 + !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! + ! Phenology variables (green_leaf_factor should be merged with elongf, as they ! + ! represent the same thing). ! + !---------------------------------------------------------------------------------------! cpoly%green_leaf_factor(1:n_pft,:) = 1.0 cpoly%leaf_aging_factor(1:n_pft,:) = 1.0 + !---------------------------------------------------------------------------------------! + !---------------------------------------------------------------------------------------! ! Initialise the minimum monthly temperature with a very large value, this is ! @@ -663,27 +704,26 @@ subroutine init_ed_site_vars(cpoly, lat) cpoly%min_monthly_temp(:) = huge(1.) !---------------------------------------------------------------------------------------! - cpoly%lambda_fire (1:12,:) = 0.0 + !---------------------------------------------------------------------------------------! + ! Initialise several disturbance- and LU-related variables. ! + !---------------------------------------------------------------------------------------! + cpoly%plantation (:) = 0 + cpoly%agri_stocking_pft (:) = agri_stock + cpoly%agri_stocking_density (:) = 10.0 + cpoly%plantation_stocking_pft (:) = plantation_stock + cpoly%plantation_stocking_density (:) = 4.0 + cpoly%primary_harvest_memory (:) = 0.0 + cpoly%secondary_harvest_memory (:) = 0.0 + cpoly%fire_disturbance_rate (:) = 0.0 + cpoly%ignition_rate (:) = 0.0 + cpoly%lambda_fire (1:12,:) = 0.0 + cpoly%nat_disturbance_rate (:) = 0.0 + cpoly%nat_dist_type (:) = 0 cpoly%disturbance_memory(1:n_dist_types, 1:n_dist_types,:) = 0.0 cpoly%disturbance_rates (1:n_dist_types, 1:n_dist_types,:) = 0.0 - - cpoly%agri_stocking_density(:) = 10.0 - !---------------------------------------------------------------------------------------! - ! (KIM) ! - ! - anyway, this part should be more elaborate for the case ! - ! - that we have different crops/pastures. ! - ! It's now defined in ED2IN, but it assumes only one PFT. It is probably not the ! - ! ideal solution for regional runs... ! - !---------------------------------------------------------------------------------------! - cpoly%agri_stocking_pft(:) = agri_stock - cpoly%plantation_stocking_pft(:) = plantation_stock - - cpoly%plantation_stocking_density(:) = 4.0 - cpoly%primary_harvest_memory(:) = 0.0 - cpoly%secondary_harvest_memory(:) = 0.0 cpoly%rad_avg(:) = 200.0 diff --git a/ED/src/io/average_utils.f90 b/ED/src/io/average_utils.f90 index 340543a00..9bd550b4f 100644 --- a/ED/src/io/average_utils.f90 +++ b/ED/src/io/average_utils.f90 @@ -195,6 +195,10 @@ subroutine normalize_averaged_vars(cgrid,frqsum,dtlsm) csite%avg_rshort_gnd (ipa) = csite%avg_rshort_gnd (ipa) * frqsumi csite%avg_rlong_gnd (ipa) = csite%avg_rlong_gnd (ipa) * frqsumi csite%avg_rlongup (ipa) = csite%avg_rlongup (ipa) * frqsumi + csite%avg_parup (ipa) = csite%avg_parup (ipa) * frqsumi + csite%avg_nirup (ipa) = csite%avg_nirup (ipa) * frqsumi + csite%avg_rshortup (ipa) = csite%avg_rshortup (ipa) * frqsumi + csite%avg_rnet (ipa) = csite%avg_rnet (ipa) * frqsumi csite%avg_albedo (ipa) = csite%avg_albedo (ipa) * frqsumi csite%avg_albedo_beam (ipa) = csite%avg_albedo_beam (ipa) * frqsumi csite%avg_albedo_diffuse (ipa) = csite%avg_albedo_diffuse (ipa) * frqsumi @@ -352,6 +356,10 @@ subroutine reset_averaged_vars(cgrid) cgrid%avg_albedo_diffuse (ipy) = 0.0 cgrid%avg_rlong_albedo (ipy) = 0.0 cgrid%avg_rlongup (ipy) = 0.0 + cgrid%avg_parup (ipy) = 0.0 + cgrid%avg_nirup (ipy) = 0.0 + cgrid%avg_rshortup (ipy) = 0.0 + cgrid%avg_rnet (ipy) = 0.0 cgrid%avg_leaf_energy (ipy) = 0.0 cgrid%avg_leaf_temp (ipy) = 0.0 @@ -542,6 +550,10 @@ subroutine reset_averaged_vars(cgrid) csite%avg_rshort_gnd(ipa) = 0.0 csite%avg_rlong_gnd(ipa) = 0.0 csite%avg_rlongup (ipa) = 0.0 + csite%avg_parup (ipa) = 0.0 + csite%avg_nirup (ipa) = 0.0 + csite%avg_rshortup (ipa) = 0.0 + csite%avg_rnet (ipa) = 0.0 csite%avg_albedo (ipa) = 0.0 csite%avg_albedo_beam (ipa) = 0.0 csite%avg_albedo_diffuse (ipa) = 0.0 @@ -1428,6 +1440,14 @@ subroutine integrate_ed_daily_output_flux(cgrid) + cgrid%avg_rlong_gnd (ipy) cgrid%dmean_rlongup (ipy) = cgrid%dmean_rlongup (ipy) & + cgrid%avg_rlongup (ipy) + cgrid%dmean_parup (ipy) = cgrid%dmean_parup (ipy) & + + cgrid%avg_parup (ipy) + cgrid%dmean_nirup (ipy) = cgrid%dmean_nirup (ipy) & + + cgrid%avg_nirup (ipy) + cgrid%dmean_rshortup (ipy) = cgrid%dmean_rshortup (ipy) & + + cgrid%avg_rshortup (ipy) + cgrid%dmean_rnet (ipy) = cgrid%dmean_rnet (ipy) & + + cgrid%avg_rnet (ipy) cgrid%dmean_rlong_albedo(ipy) = cgrid%dmean_rlong_albedo (ipy) & + cgrid%avg_rlong_albedo (ipy) cgrid%dmean_leaf_resp (ipy) = cgrid%dmean_leaf_resp (ipy) & @@ -1520,6 +1540,14 @@ subroutine integrate_ed_daily_output_flux(cgrid) + cgrid%avg_rlong_gnd (ipy) cgrid%qmean_rlongup (it,ipy) = cgrid%qmean_rlongup (it,ipy) & + cgrid%avg_rlongup (ipy) + cgrid%qmean_parup (it,ipy) = cgrid%qmean_parup (it,ipy) & + + cgrid%avg_parup (ipy) + cgrid%qmean_nirup (it,ipy) = cgrid%qmean_nirup (it,ipy) & + + cgrid%avg_nirup (ipy) + cgrid%qmean_rshortup (it,ipy) = cgrid%qmean_rshortup (it,ipy) & + + cgrid%avg_rshortup (ipy) + cgrid%qmean_rnet (it,ipy) = cgrid%qmean_rnet (it,ipy) & + + cgrid%avg_rnet (ipy) cgrid%qmean_rlong_albedo (it,ipy) = cgrid%qmean_rlong_albedo (it,ipy) & + cgrid%avg_rlong_albedo (ipy) cgrid%qmean_albedo (it,ipy) = cgrid%qmean_albedo (it,ipy) & @@ -1651,6 +1679,34 @@ subroutine integrate_ed_daily_output_flux(cgrid) cgrid%qmsqu_vapor_gc (it,ipy) = cgrid%qmsqu_vapor_gc (it,ipy) & + cgrid%avg_vapor_gc (ipy) & * cgrid%avg_vapor_gc (ipy) + + cgrid%qmsqu_ustar (it,ipy) = cgrid%qmsqu_ustar (it,ipy) & + + cgrid%avg_ustar (ipy) & + * cgrid%avg_ustar (ipy) + + cgrid%qmsqu_rlongup (it,ipy) = cgrid%qmsqu_rlongup (it,ipy) & + + cgrid%avg_rlongup (ipy) & + * cgrid%avg_rlongup (ipy) + + cgrid%qmsqu_parup (it,ipy) = cgrid%qmsqu_parup (it,ipy) & + + cgrid%avg_parup (ipy) & + * cgrid%avg_parup (ipy) + + cgrid%qmsqu_nirup (it,ipy) = cgrid%qmsqu_nirup (it,ipy) & + + cgrid%avg_nirup (ipy) & + * cgrid%avg_nirup (ipy) + + cgrid%qmsqu_rshortup (it,ipy) = cgrid%qmsqu_rshortup (it,ipy) & + + cgrid%avg_rshortup (ipy) & + * cgrid%avg_rshortup (ipy) + + cgrid%qmsqu_rnet (it,ipy) = cgrid%qmsqu_rnet (it,ipy) & + + cgrid%avg_rnet (ipy) & + * cgrid%avg_rnet (ipy) + + cgrid%qmsqu_albedo (it,ipy) = cgrid%qmsqu_albedo (it,ipy) & + + cgrid%avg_albedo (ipy) & + * cgrid%avg_albedo (ipy) end if !------------------------------------------------------------------------------------! end do polyloop @@ -2257,6 +2313,10 @@ subroutine normalize_ed_daily_output_vars(cgrid) cgrid%dmean_rshort_gnd (ipy) = cgrid%dmean_rshort_gnd (ipy) * frqsum_o_daysec cgrid%dmean_rlong_gnd (ipy) = cgrid%dmean_rlong_gnd (ipy) * frqsum_o_daysec cgrid%dmean_rlongup (ipy) = cgrid%dmean_rlongup (ipy) * frqsum_o_daysec + cgrid%dmean_parup (ipy) = cgrid%dmean_parup (ipy) * frqsum_o_daysec + cgrid%dmean_nirup (ipy) = cgrid%dmean_nirup (ipy) * frqsum_o_daysec + cgrid%dmean_rshortup (ipy) = cgrid%dmean_rshortup (ipy) * frqsum_o_daysec + cgrid%dmean_rnet (ipy) = cgrid%dmean_rnet (ipy) * frqsum_o_daysec cgrid%dmean_rlong_albedo(ipy) = cgrid%dmean_rlong_albedo(ipy) * frqsum_o_daysec !------------------------------------------------------------------------------------! @@ -2663,6 +2723,10 @@ subroutine zero_ed_daily_output_vars(cgrid) cgrid%dmean_rshort_gnd (ipy) = 0. cgrid%dmean_rlong_gnd (ipy) = 0. cgrid%dmean_rlongup (ipy) = 0. + cgrid%dmean_parup (ipy) = 0. + cgrid%dmean_nirup (ipy) = 0. + cgrid%dmean_rshortup (ipy) = 0. + cgrid%dmean_rnet (ipy) = 0. cgrid%dmean_rlong_albedo (ipy) = 0. cgrid%dmean_albedo (ipy) = 0. cgrid%dmean_albedo_beam (ipy) = 0. @@ -2855,6 +2919,14 @@ subroutine integrate_ed_monthly_output_vars(cgrid) + cgrid%dmean_rlong_gnd (ipy) cgrid%mmean_rlongup (ipy) = cgrid%mmean_rlongup (ipy) & + cgrid%dmean_rlongup (ipy) + cgrid%mmean_parup (ipy) = cgrid%mmean_parup (ipy) & + + cgrid%dmean_parup (ipy) + cgrid%mmean_nirup (ipy) = cgrid%mmean_nirup (ipy) & + + cgrid%dmean_nirup (ipy) + cgrid%mmean_rshortup (ipy) = cgrid%mmean_rshortup (ipy) & + + cgrid%dmean_rshortup (ipy) + cgrid%mmean_rnet (ipy) = cgrid%mmean_rnet (ipy) & + + cgrid%dmean_rnet (ipy) cgrid%mmean_rlong_albedo (ipy) = cgrid%mmean_rlong_albedo (ipy) & + cgrid%dmean_rlong_albedo (ipy) cgrid%mmean_albedo (ipy) = cgrid%mmean_albedo (ipy) & @@ -3031,6 +3103,27 @@ subroutine integrate_ed_monthly_output_vars(cgrid) cgrid%mmsqu_vapor_gc(ipy) = cgrid%mmsqu_vapor_gc (ipy) & + cgrid%dmean_vapor_gc (ipy) & * cgrid%dmean_vapor_gc (ipy) + cgrid%mmsqu_ustar(ipy) = cgrid%mmsqu_ustar (ipy) & + + cgrid%dmean_ustar (ipy) & + * cgrid%dmean_ustar (ipy) + cgrid%mmsqu_rlongup(ipy) = cgrid%mmsqu_rlongup (ipy) & + + cgrid%dmean_rlongup (ipy) & + * cgrid%dmean_rlongup (ipy) + cgrid%mmsqu_parup(ipy) = cgrid%mmsqu_parup (ipy) & + + cgrid%dmean_parup (ipy) & + * cgrid%dmean_parup (ipy) + cgrid%mmsqu_nirup(ipy) = cgrid%mmsqu_nirup (ipy) & + + cgrid%dmean_nirup (ipy) & + * cgrid%dmean_nirup (ipy) + cgrid%mmsqu_rshortup(ipy) = cgrid%mmsqu_rshortup (ipy) & + + cgrid%dmean_rshortup (ipy) & + * cgrid%dmean_rshortup (ipy) + cgrid%mmsqu_rnet(ipy) = cgrid%mmsqu_rnet (ipy) & + + cgrid%dmean_rnet (ipy) & + * cgrid%dmean_rnet (ipy) + cgrid%mmsqu_albedo(ipy) = cgrid%mmsqu_albedo (ipy) & + + cgrid%dmean_albedo (ipy) & + * cgrid%dmean_albedo (ipy) cpoly => cgrid%polygon(ipy) site_loop: do isi=1,cpoly%nsites @@ -3268,6 +3361,10 @@ subroutine normalize_ed_monthly_output_vars(cgrid) cgrid%mmean_rshort_gnd (ipy) = cgrid%mmean_rshort_gnd (ipy) * ndaysi cgrid%mmean_rlong_gnd (ipy) = cgrid%mmean_rlong_gnd (ipy) * ndaysi cgrid%mmean_rlongup (ipy) = cgrid%mmean_rlongup (ipy) * ndaysi + cgrid%mmean_parup (ipy) = cgrid%mmean_parup (ipy) * ndaysi + cgrid%mmean_nirup (ipy) = cgrid%mmean_nirup (ipy) * ndaysi + cgrid%mmean_rshortup (ipy) = cgrid%mmean_rshortup (ipy) * ndaysi + cgrid%mmean_rnet (ipy) = cgrid%mmean_rnet (ipy) * ndaysi cgrid%mmean_rlong_albedo (ipy) = cgrid%mmean_rlong_albedo (ipy) * ndaysi cgrid%mmean_albedo (ipy) = cgrid%mmean_albedo (ipy) * ndaysi cgrid%mmean_albedo_beam (ipy) = cgrid%mmean_albedo_beam (ipy) * ndaysi @@ -3358,6 +3455,13 @@ subroutine normalize_ed_monthly_output_vars(cgrid) cgrid%mmsqu_vapor_lc (ipy) = cgrid%mmsqu_vapor_lc (ipy) * ndaysi cgrid%mmsqu_vapor_wc (ipy) = cgrid%mmsqu_vapor_wc (ipy) * ndaysi cgrid%mmsqu_vapor_gc (ipy) = cgrid%mmsqu_vapor_gc (ipy) * ndaysi + cgrid%mmsqu_ustar (ipy) = cgrid%mmsqu_ustar (ipy) * ndaysi + cgrid%mmsqu_rlongup (ipy) = cgrid%mmsqu_rlongup (ipy) * ndaysi + cgrid%mmsqu_parup (ipy) = cgrid%mmsqu_parup (ipy) * ndaysi + cgrid%mmsqu_nirup (ipy) = cgrid%mmsqu_nirup (ipy) * ndaysi + cgrid%mmsqu_rshortup (ipy) = cgrid%mmsqu_rshortup (ipy) * ndaysi + cgrid%mmsqu_rnet (ipy) = cgrid%mmsqu_rnet (ipy) * ndaysi + cgrid%mmsqu_albedo (ipy) = cgrid%mmsqu_albedo (ipy) * ndaysi !------------------------------------------------------------------------------------! @@ -3777,6 +3881,10 @@ subroutine normalize_ed_monthly_output_vars(cgrid) cgrid%qmean_rshort_gnd (t,ipy) = cgrid%qmean_rshort_gnd (t,ipy) * ndaysi cgrid%qmean_rlong_gnd (t,ipy) = cgrid%qmean_rlong_gnd (t,ipy) * ndaysi cgrid%qmean_rlongup (t,ipy) = cgrid%qmean_rlongup (t,ipy) * ndaysi + cgrid%qmean_parup (t,ipy) = cgrid%qmean_parup (t,ipy) * ndaysi + cgrid%qmean_nirup (t,ipy) = cgrid%qmean_nirup (t,ipy) * ndaysi + cgrid%qmean_rshortup (t,ipy) = cgrid%qmean_rshortup (t,ipy) * ndaysi + cgrid%qmean_rnet (t,ipy) = cgrid%qmean_rnet (t,ipy) * ndaysi cgrid%qmean_rlong_albedo (t,ipy) = cgrid%qmean_rlong_albedo (t,ipy) * ndaysi cgrid%qmean_albedo (t,ipy) = cgrid%qmean_albedo (t,ipy) * ndaysi cgrid%qmean_albedo_beam (t,ipy) = cgrid%qmean_albedo_beam (t,ipy) * ndaysi @@ -3818,6 +3926,13 @@ subroutine normalize_ed_monthly_output_vars(cgrid) cgrid%qmsqu_vapor_lc (t,ipy) = cgrid%qmsqu_vapor_lc (t,ipy) * ndaysi cgrid%qmsqu_vapor_wc (t,ipy) = cgrid%qmsqu_vapor_wc (t,ipy) * ndaysi cgrid%qmsqu_vapor_gc (t,ipy) = cgrid%qmsqu_vapor_gc (t,ipy) * ndaysi + cgrid%qmsqu_ustar (t,ipy) = cgrid%qmsqu_ustar (t,ipy) * ndaysi + cgrid%qmsqu_rlongup (t,ipy) = cgrid%qmsqu_rlongup (t,ipy) * ndaysi + cgrid%qmsqu_parup (t,ipy) = cgrid%qmsqu_parup (t,ipy) * ndaysi + cgrid%qmsqu_nirup (t,ipy) = cgrid%qmsqu_nirup (t,ipy) * ndaysi + cgrid%qmsqu_rshortup (t,ipy) = cgrid%qmsqu_rshortup (t,ipy) * ndaysi + cgrid%qmsqu_rnet (t,ipy) = cgrid%qmsqu_rnet (t,ipy) * ndaysi + cgrid%qmsqu_albedo (t,ipy) = cgrid%qmsqu_albedo (t,ipy) * ndaysi !------------------------------------------------------------------------------! ! Find the derived average propertiesof the canopy air space. ! @@ -3914,6 +4029,10 @@ subroutine zero_ed_monthly_output_vars(cgrid) cgrid%mmean_rshort_gnd (ipy) = 0. cgrid%mmean_rlong_gnd (ipy) = 0. cgrid%mmean_rlongup (ipy) = 0. + cgrid%mmean_parup (ipy) = 0. + cgrid%mmean_nirup (ipy) = 0. + cgrid%mmean_rshortup (ipy) = 0. + cgrid%mmean_rnet (ipy) = 0. cgrid%mmean_rlong_albedo (ipy) = 0. cgrid%mmean_albedo (ipy) = 0. cgrid%mmean_albedo_beam (ipy) = 0. @@ -3992,6 +4111,13 @@ subroutine zero_ed_monthly_output_vars(cgrid) cgrid%mmsqu_vapor_lc (ipy) = 0. cgrid%mmsqu_vapor_wc (ipy) = 0. cgrid%mmsqu_vapor_gc (ipy) = 0. + cgrid%mmsqu_ustar (ipy) = 0. + cgrid%mmsqu_rlongup (ipy) = 0. + cgrid%mmsqu_parup (ipy) = 0. + cgrid%mmsqu_nirup (ipy) = 0. + cgrid%mmsqu_rshortup (ipy) = 0. + cgrid%mmsqu_rnet (ipy) = 0. + cgrid%mmsqu_albedo (ipy) = 0. cgrid%disturbance_rates (:,:,ipy) = 0. cgrid%mmean_co2_residual (ipy) = 0. @@ -4128,6 +4254,10 @@ subroutine zero_ed_monthly_output_vars(cgrid) cgrid%qmean_rshort_gnd (:,ipy) = 0.0 cgrid%qmean_rlong_gnd (:,ipy) = 0.0 cgrid%qmean_rlongup (:,ipy) = 0.0 + cgrid%qmean_parup (:,ipy) = 0.0 + cgrid%qmean_nirup (:,ipy) = 0.0 + cgrid%qmean_rshortup (:,ipy) = 0.0 + cgrid%qmean_rnet (:,ipy) = 0.0 cgrid%qmean_rlong_albedo (:,ipy) = 0.0 cgrid%qmean_albedo (:,ipy) = 0.0 cgrid%qmean_albedo_beam (:,ipy) = 0.0 @@ -4169,6 +4299,13 @@ subroutine zero_ed_monthly_output_vars(cgrid) cgrid%qmsqu_vapor_lc (:,ipy) = 0.0 cgrid%qmsqu_vapor_wc (:,ipy) = 0.0 cgrid%qmsqu_vapor_gc (:,ipy) = 0.0 + cgrid%qmsqu_ustar (:,ipy) = 0.0 + cgrid%qmsqu_rlongup (:,ipy) = 0.0 + cgrid%qmsqu_parup (:,ipy) = 0.0 + cgrid%qmsqu_nirup (:,ipy) = 0.0 + cgrid%qmsqu_rshortup (:,ipy) = 0.0 + cgrid%qmsqu_rnet (:,ipy) = 0.0 + cgrid%qmsqu_albedo (:,ipy) = 0.0 end if !------------------------------------------------------------------------------------! diff --git a/ED/src/io/ed_init_full_history.F90 b/ED/src/io/ed_init_full_history.F90 index 57c91a193..1f5ea472b 100644 --- a/ED/src/io/ed_init_full_history.F90 +++ b/ED/src/io/ed_init_full_history.F90 @@ -825,6 +825,26 @@ end subroutine hdf_getslab_i call hdf_getslab_r(cgrid%dmean_rlong (ipy:ipy) ,'DMEAN_RLONG ' & ,dsetrank,iparallel,.false.,foundvar) + if (associated(cgrid%dmean_rlongup )) & + call hdf_getslab_r(cgrid%dmean_rlongup (ipy:ipy) ,'DMEAN_RLONGUP ' & + ,dsetrank,iparallel,.false.,foundvar) + + if (associated(cgrid%dmean_parup )) & + call hdf_getslab_r(cgrid%dmean_parup (ipy:ipy) ,'DMEAN_PARUP ' & + ,dsetrank,iparallel,.false.,foundvar) + + if (associated(cgrid%dmean_nirup )) & + call hdf_getslab_r(cgrid%dmean_nirup (ipy:ipy) ,'DMEAN_NIRUP ' & + ,dsetrank,iparallel,.false.,foundvar) + + if (associated(cgrid%dmean_rshortup )) & + call hdf_getslab_r(cgrid%dmean_rshortup (ipy:ipy) ,'DMEAN_RSHORTUP ' & + ,dsetrank,iparallel,.false.,foundvar) + + if (associated(cgrid%dmean_rnet )) & + call hdf_getslab_r(cgrid%dmean_rnet (ipy:ipy) ,'DMEAN_RNET ' & + ,dsetrank,iparallel,.false.,foundvar) + if (associated(cgrid%dmean_rshort_gnd )) & call hdf_getslab_r(cgrid%dmean_rshort_gnd (ipy:ipy) ,'DMEAN_RSHORT_GND ' & ,dsetrank,iparallel,.false.,foundvar) @@ -1093,6 +1113,26 @@ end subroutine hdf_getslab_i if (associated(cgrid%mmean_rlong )) & call hdf_getslab_r(cgrid%mmean_rlong (ipy:ipy) ,'MMEAN_RLONG ' & ,dsetrank,iparallel,.false.,foundvar) + + if (associated(cgrid%mmean_rlongup )) & + call hdf_getslab_r(cgrid%mmean_rlongup (ipy:ipy) ,'MMEAN_RLONGUP ' & + ,dsetrank,iparallel,.false.,foundvar) + + if (associated(cgrid%mmean_parup )) & + call hdf_getslab_r(cgrid%mmean_parup (ipy:ipy) ,'MMEAN_PARUP ' & + ,dsetrank,iparallel,.false.,foundvar) + + if (associated(cgrid%mmean_nirup )) & + call hdf_getslab_r(cgrid%mmean_nirup (ipy:ipy) ,'MMEAN_NIRUP ' & + ,dsetrank,iparallel,.false.,foundvar) + + if (associated(cgrid%mmean_rshortup )) & + call hdf_getslab_r(cgrid%mmean_rshortup (ipy:ipy) ,'MMEAN_RSHORTUP ' & + ,dsetrank,iparallel,.false.,foundvar) + + if (associated(cgrid%mmean_rnet )) & + call hdf_getslab_r(cgrid%mmean_rnet (ipy:ipy) ,'MMEAN_RNET ' & + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_rshort_gnd )) & call hdf_getslab_r(cgrid%mmean_rshort_gnd (ipy:ipy) ,'MMEAN_RSHORT_GND ' & @@ -1222,6 +1262,34 @@ end subroutine hdf_getslab_i call hdf_getslab_r(cgrid%mmsqu_vapor_gc (ipy:ipy) ,'MMSQU_VAPOR_GC ' & ,dsetrank,iparallel,.false.,foundvar) + if (associated(cgrid%mmsqu_ustar )) & + call hdf_getslab_r(cgrid%mmsqu_ustar (ipy:ipy) ,'MMSQU_USTAR ' & + ,dsetrank,iparallel,.false.,foundvar) + + if (associated(cgrid%mmsqu_rlongup )) & + call hdf_getslab_r(cgrid%mmsqu_rlongup (ipy:ipy) ,'MMSQU_RLONGUP ' & + ,dsetrank,iparallel,.false.,foundvar) + + if (associated(cgrid%mmsqu_parup )) & + call hdf_getslab_r(cgrid%mmsqu_parup (ipy:ipy) ,'MMSQU_PARUP ' & + ,dsetrank,iparallel,.false.,foundvar) + + if (associated(cgrid%mmsqu_nirup )) & + call hdf_getslab_r(cgrid%mmsqu_nirup (ipy:ipy) ,'MMSQU_NIRUP ' & + ,dsetrank,iparallel,.false.,foundvar) + + if (associated(cgrid%mmsqu_rshortup )) & + call hdf_getslab_r(cgrid%mmsqu_rshortup (ipy:ipy) ,'MMSQU_RSHORTUP ' & + ,dsetrank,iparallel,.false.,foundvar) + + if (associated(cgrid%mmsqu_rnet )) & + call hdf_getslab_r(cgrid%mmsqu_rnet (ipy:ipy) ,'MMSQU_RNET ' & + ,dsetrank,iparallel,.false.,foundvar) + + if (associated(cgrid%mmsqu_albedo )) & + call hdf_getslab_r(cgrid%mmsqu_albedo (ipy:ipy) ,'MMSQU_ALBEDO ' & + ,dsetrank,iparallel,.false.,foundvar) + ! Variables with 2 dimensions (nzg,npolygons) dsetrank = 2 globdims(1) = int(nzg,8) @@ -1501,6 +1569,26 @@ end subroutine hdf_getslab_i call hdf_getslab_r(cgrid%qmean_rlong (:,ipy) ,'QMEAN_RLONG ' & ,dsetrank,iparallel,.false.,foundvar) + if (associated(cgrid%qmean_rlongup )) & + call hdf_getslab_r(cgrid%qmean_rlongup (:,ipy) ,'QMEAN_RLONGUP ' & + ,dsetrank,iparallel,.false.,foundvar) + + if (associated(cgrid%qmean_parup )) & + call hdf_getslab_r(cgrid%qmean_parup (:,ipy) ,'QMEAN_PARUP ' & + ,dsetrank,iparallel,.false.,foundvar) + + if (associated(cgrid%qmean_nirup )) & + call hdf_getslab_r(cgrid%qmean_nirup (:,ipy) ,'QMEAN_NIRUP ' & + ,dsetrank,iparallel,.false.,foundvar) + + if (associated(cgrid%qmean_rshortup )) & + call hdf_getslab_r(cgrid%qmean_rshortup (:,ipy) ,'QMEAN_RSHORTUP ' & + ,dsetrank,iparallel,.false.,foundvar) + + if (associated(cgrid%qmean_rnet )) & + call hdf_getslab_r(cgrid%qmean_rnet (:,ipy) ,'QMEAN_RNET ' & + ,dsetrank,iparallel,.false.,foundvar) + if (associated(cgrid%qmean_rshort_gnd )) & call hdf_getslab_r(cgrid%qmean_rshort_gnd (:,ipy) ,'QMEAN_RSHORT_GND ' & ,dsetrank,iparallel,.false.,foundvar) @@ -1597,6 +1685,34 @@ end subroutine hdf_getslab_i call hdf_getslab_r(cgrid%qmsqu_vapor_gc (:,ipy) ,'QMSQU_VAPOR_GC ' & ,dsetrank,iparallel,.false.,foundvar) + if (associated(cgrid%qmsqu_ustar )) & + call hdf_getslab_r(cgrid%qmsqu_ustar (:,ipy) ,'QMSQU_USTAR ' & + ,dsetrank,iparallel,.false.,foundvar) + + if (associated(cgrid%qmsqu_rlongup )) & + call hdf_getslab_r(cgrid%qmsqu_rlongup (:,ipy) ,'QMSQU_RLONGUP ' & + ,dsetrank,iparallel,.false.,foundvar) + + if (associated(cgrid%qmsqu_parup )) & + call hdf_getslab_r(cgrid%qmsqu_parup (:,ipy) ,'QMSQU_PARUP ' & + ,dsetrank,iparallel,.false.,foundvar) + + if (associated(cgrid%qmsqu_nirup )) & + call hdf_getslab_r(cgrid%qmsqu_nirup (:,ipy) ,'QMSQU_NIRUP ' & + ,dsetrank,iparallel,.false.,foundvar) + + if (associated(cgrid%qmsqu_rshortup )) & + call hdf_getslab_r(cgrid%qmsqu_rshortup (:,ipy) ,'QMSQU_RSHORTUP ' & + ,dsetrank,iparallel,.false.,foundvar) + + if (associated(cgrid%qmsqu_rnet )) & + call hdf_getslab_r(cgrid%qmsqu_rnet (:,ipy) ,'QMSQU_RNET ' & + ,dsetrank,iparallel,.false.,foundvar) + + if (associated(cgrid%qmsqu_albedo )) & + call hdf_getslab_r(cgrid%qmsqu_albedo (:,ipy) ,'QMSQU_ALBEDO ' & + ,dsetrank,iparallel,.false.,foundvar) + ! Variables with 2 dimensions (n_pft,npolygons) dsetrank = 2 @@ -2236,8 +2352,12 @@ end subroutine hdf_getslab_i call hdf_getslab_r(csite%albedo,'ALBEDO ',dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%albedo_beam,'ALBEDO_BEAM ',dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%albedo_diffuse,'ALBEDO_DIFFUSE ',dsetrank,iparallel,.true.,foundvar) - call hdf_getslab_r(csite%rlongup,'RLONGUP ',dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%rlong_albedo,'RLONG_ALBEDO ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%rlongup,'RLONGUP ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%parup,'PARUP ',dsetrank,iparallel,.false.,foundvar) + call hdf_getslab_r(csite%nirup,'NIRUP ',dsetrank,iparallel,.false.,foundvar) + call hdf_getslab_r(csite%rshortup,'RSHORTUP ',dsetrank,iparallel,.false.,foundvar) + call hdf_getslab_r(csite%rnet,'RNET ',dsetrank,iparallel,.false.,foundvar) call hdf_getslab_r(csite%total_sfcw_depth,'TOTAL_SFCW_DEPTH ',dsetrank,iparallel,.false.,foundvar) call hdf_getslab_r(csite%snowfac,'SNOWFAC ',dsetrank,iparallel,.true.,foundvar) diff --git a/ED/src/io/edio.f90 b/ED/src/io/edio.f90 index 2611159b2..729497eb9 100644 --- a/ED/src/io/edio.f90 +++ b/ED/src/io/edio.f90 @@ -445,6 +445,10 @@ subroutine spatial_averages cpoly%avg_rshort_gnd(isi)= sum(csite%avg_rshort_gnd* csite%area ) * site_area_i cpoly%avg_rlong_gnd(isi) = sum(csite%avg_rlong_gnd * csite%area ) * site_area_i cpoly%avg_rlongup(isi) = sum(csite%avg_rlongup * csite%area ) * site_area_i + cpoly%avg_parup (isi) = sum(csite%avg_parup * csite%area ) * site_area_i + cpoly%avg_nirup (isi) = sum(csite%avg_nirup * csite%area ) * site_area_i + cpoly%avg_rshortup (isi) = sum(csite%avg_rshortup * csite%area ) * site_area_i + cpoly%avg_rnet (isi) = sum(csite%avg_rnet * csite%area ) * site_area_i cpoly%avg_carbon_ac(isi) = sum(csite%avg_carbon_ac * csite%area ) * site_area_i cpoly%avg_carbon_st(isi) = sum(csite%avg_carbon_st * csite%area ) * site_area_i cpoly%avg_vapor_lc(isi) = sum(csite%avg_vapor_lc * csite%area ) * site_area_i @@ -1105,6 +1109,10 @@ subroutine spatial_averages cgrid%avg_rshort_gnd(ipy) = sum(cpoly%avg_rshort_gnd *cpoly%area)*poly_area_i cgrid%avg_rlong_gnd(ipy) = sum(cpoly%avg_rlong_gnd *cpoly%area)*poly_area_i cgrid%avg_rlongup (ipy) = sum(cpoly%avg_rlongup *cpoly%area)*poly_area_i + cgrid%avg_parup (ipy) = sum(cpoly%avg_parup *cpoly%area)*poly_area_i + cgrid%avg_nirup (ipy) = sum(cpoly%avg_nirup *cpoly%area)*poly_area_i + cgrid%avg_rshortup (ipy) = sum(cpoly%avg_rshortup *cpoly%area)*poly_area_i + cgrid%avg_rnet (ipy) = sum(cpoly%avg_rnet *cpoly%area)*poly_area_i cgrid%avg_carbon_ac(ipy) = sum(cpoly%avg_carbon_ac *cpoly%area)*poly_area_i cgrid%avg_carbon_st(ipy) = sum(cpoly%avg_carbon_st *cpoly%area)*poly_area_i cgrid%avg_vapor_lc(ipy) = sum(cpoly%avg_vapor_lc *cpoly%area)*poly_area_i diff --git a/ED/src/memory/ed_max_dims.F90 b/ED/src/memory/ed_max_dims.F90 index 1e9e2ca4d..0d811f74b 100644 --- a/ED/src/memory/ed_max_dims.F90 +++ b/ED/src/memory/ed_max_dims.F90 @@ -214,7 +214,7 @@ module ed_max_dims !---------------------------------------------------------------------------------------! integer, parameter :: huge_polygon = nxpmax * nypmax integer, parameter :: huge_patch = 3600 - integer, parameter :: huge_cohort = 36000 + integer, parameter :: huge_cohort = 50000 integer, parameter :: max_water = 100 !---------------------------------------------------------------------------------------! @@ -236,7 +236,7 @@ module ed_max_dims #if defined(COUPLED) integer, parameter :: maxfiles = brams_maxfiles #else - integer, parameter :: maxfiles = 36000 + integer, parameter :: maxfiles = 50000 #endif !---------------------------------------------------------------------------------------! diff --git a/ED/src/memory/ed_state_vars.f90 b/ED/src/memory/ed_state_vars.f90 index 852335796..e29936165 100644 --- a/ED/src/memory/ed_state_vars.f90 +++ b/ED/src/memory/ed_state_vars.f90 @@ -949,10 +949,22 @@ module ed_state_vars ! Patch albedo, diffuse component real , pointer,dimension(:) :: albedo_diffuse + ! Net radiation at the top of the canopy (W/m2) + real , pointer,dimension(:) :: rnet + ! Upward long wave radiation at the top of the canopy (W/m2) real , pointer,dimension(:) :: rlongup - ! Albedo for long wave radiation + ! Upward PAR radiation at the top of the canopy (W/m2) + real , pointer,dimension(:) :: parup + + ! Upward NIR radiation at the top of the canopy (W/m2) + real , pointer,dimension(:) :: nirup + + ! Upward short wave radiation at the top of the canopy (W/m2) + real , pointer,dimension(:) :: rshortup + + ! Albedo for long wave radiation (whatever it means...) real , pointer,dimension(:) :: rlong_albedo ! Total snow depth as calculated in the radiation scheme. Used for @@ -1044,6 +1056,10 @@ module ed_state_vars real, pointer, dimension(:) :: avg_rshort_gnd ! Absorbed SW rad. of soil + top water/snow layer [ W/m2] real, pointer, dimension(:) :: avg_rlong_gnd ! Emitted LW rad. from soil + top water/snow layer [ W/m2] real, pointer, dimension(:) :: avg_rlongup ! Emitted LW rad. from soil + top water/snow layer [ W/m2] + real, pointer, dimension(:) :: avg_parup ! Reflected PAR at the top of the canopy [ W/m2] + real, pointer, dimension(:) :: avg_nirup ! Reflected NIR at the top of the canopy [ W/m2] + real, pointer, dimension(:) :: avg_rshortup ! Reflected SW rad. at the top of the canopy [ W/m2] + real, pointer, dimension(:) :: avg_rnet ! Net radiation at the top of the canopy [ W/m2] real, pointer, dimension(:) :: avg_albedo ! Albedo [ ----] real, pointer, dimension(:) :: avg_albedo_beam ! Direct Albedo [ ----] real, pointer, dimension(:) :: avg_albedo_diffuse ! Diffuse Albedo [ ----] @@ -1326,6 +1342,11 @@ module ed_state_vars real,pointer,dimension(:) :: avg_albedo real,pointer,dimension(:) :: avg_rlongup + real,pointer,dimension(:) :: avg_parup + real,pointer,dimension(:) :: avg_nirup + real,pointer,dimension(:) :: avg_rshortup + real,pointer,dimension(:) :: avg_rnet + !----- Length of day light, used to average light levels properly. -------------------! real, pointer, dimension(:) :: daylight @@ -1785,6 +1806,10 @@ module ed_state_vars real,pointer,dimension(:) :: avg_albedo_diffuse real,pointer,dimension(:) :: avg_rlong_albedo real,pointer,dimension(:) :: avg_rlongup + real,pointer,dimension(:) :: avg_parup + real,pointer,dimension(:) :: avg_nirup + real,pointer,dimension(:) :: avg_rshortup + real,pointer,dimension(:) :: avg_rnet real,pointer,dimension(:,:,:) :: avg_lai_ebalvars ! This diagnostic partitions energy flux ! variables into LAI regimes. ! The matrix is arranged as follows @@ -1901,6 +1926,10 @@ module ed_state_vars real, pointer, dimension(:) :: dmean_albedo_diffuse! (npolygons) real, pointer, dimension(:) :: dmean_rlong_albedo ! (npolygons) real, pointer, dimension(:) :: dmean_rlongup ! (npolygons) + real, pointer, dimension(:) :: dmean_parup ! (npolygons) + real, pointer, dimension(:) :: dmean_nirup ! (npolygons) + real, pointer, dimension(:) :: dmean_rshortup ! (npolygons) + real, pointer, dimension(:) :: dmean_rnet ! (npolygons) real, pointer, dimension(:,:) :: qmean_pcpg ! [ kg/m²/s] real, pointer, dimension(:,:) :: qmean_runoff ! [ kg/m²/s] @@ -1970,6 +1999,10 @@ module ed_state_vars real, pointer, dimension(:,:) :: qmean_albedo_diffuse ! (ndcycle,npolygons) real, pointer, dimension(:,:) :: qmean_rlong_albedo ! (ndcycle,npolygons) real, pointer, dimension(:,:) :: qmean_rlongup ! (ndcycle,npolygons) + real, pointer, dimension(:,:) :: qmean_parup ! (ndcycle,npolygons) + real, pointer, dimension(:,:) :: qmean_nirup ! (ndcycle,npolygons) + real, pointer, dimension(:,:) :: qmean_rshortup ! (ndcycle,npolygons) + real, pointer, dimension(:,:) :: qmean_rnet ! (ndcycle,npolygons) !-------------------------------------------------------------------------------------! ! These variables have the monthly mean square, We save this instead of the standard ! @@ -1994,6 +2027,13 @@ module ed_state_vars real, pointer, dimension(:,:) :: qmsqu_vapor_lc real, pointer, dimension(:,:) :: qmsqu_vapor_wc real, pointer, dimension(:,:) :: qmsqu_vapor_gc + real, pointer, dimension(:,:) :: qmsqu_ustar + real, pointer, dimension(:,:) :: qmsqu_rlongup + real, pointer, dimension(:,:) :: qmsqu_parup + real, pointer, dimension(:,:) :: qmsqu_nirup + real, pointer, dimension(:,:) :: qmsqu_rshortup + real, pointer, dimension(:,:) :: qmsqu_rnet + real, pointer, dimension(:,:) :: qmsqu_albedo ! Daily average residuals real, pointer, dimension(:) :: dmean_co2_residual ! [umol_CO2/m2] @@ -2112,6 +2152,10 @@ module ed_state_vars real, pointer, dimension(:) :: mmean_albedo_diffuse ! (npolygons) real, pointer, dimension(:) :: mmean_rlong_albedo ! (npolygons) real, pointer, dimension(:) :: mmean_rlongup ! (npolygons) + real, pointer, dimension(:) :: mmean_parup ! (npolygons) + real, pointer, dimension(:) :: mmean_nirup ! (npolygons) + real, pointer, dimension(:) :: mmean_rshortup ! (npolygons) + real, pointer, dimension(:) :: mmean_rnet ! (npolygons) !-------------------------------------------------------------------------------------! ! These variables have the monthly mean square, We save this instead of the standard ! @@ -2136,6 +2180,13 @@ module ed_state_vars real, pointer, dimension(:) :: mmsqu_vapor_lc real, pointer, dimension(:) :: mmsqu_vapor_wc real, pointer, dimension(:) :: mmsqu_vapor_gc + real, pointer, dimension(:) :: mmsqu_ustar + real, pointer, dimension(:) :: mmsqu_rlongup + real, pointer, dimension(:) :: mmsqu_parup + real, pointer, dimension(:) :: mmsqu_nirup + real, pointer, dimension(:) :: mmsqu_rshortup + real, pointer, dimension(:) :: mmsqu_rnet + real, pointer, dimension(:) :: mmsqu_albedo !----- Disturbance rates. ----------------------------------------------! @@ -2527,6 +2578,10 @@ subroutine allocate_edtype(cgrid,npolygons) allocate(cgrid%avg_albedo_diffuse (npolygons)) allocate(cgrid%avg_rlong_albedo (npolygons)) allocate(cgrid%avg_rlongup (npolygons)) + allocate(cgrid%avg_parup (npolygons)) + allocate(cgrid%avg_nirup (npolygons)) + allocate(cgrid%avg_rshortup (npolygons)) + allocate(cgrid%avg_rnet (npolygons)) allocate(cgrid%lai_pft (n_pft ,npolygons)) allocate(cgrid%wai_pft (n_pft ,npolygons)) @@ -2617,6 +2672,10 @@ subroutine allocate_edtype(cgrid,npolygons) allocate(cgrid%dmean_albedo_diffuse ( npolygons)) allocate(cgrid%dmean_rlong_albedo ( npolygons)) allocate(cgrid%dmean_rlongup ( npolygons)) + allocate(cgrid%dmean_parup ( npolygons)) + allocate(cgrid%dmean_nirup ( npolygons)) + allocate(cgrid%dmean_rshortup ( npolygons)) + allocate(cgrid%dmean_rnet ( npolygons)) allocate(cgrid%dmean_co2_residual ( npolygons)) allocate(cgrid%dmean_energy_residual( npolygons)) @@ -2710,6 +2769,10 @@ subroutine allocate_edtype(cgrid,npolygons) allocate(cgrid%mmean_albedo_diffuse ( npolygons)) allocate(cgrid%mmean_rlong_albedo ( npolygons)) allocate(cgrid%mmean_rlongup ( npolygons)) + allocate(cgrid%mmean_parup ( npolygons)) + allocate(cgrid%mmean_nirup ( npolygons)) + allocate(cgrid%mmean_rshortup ( npolygons)) + allocate(cgrid%mmean_rnet ( npolygons)) allocate(cgrid%mmean_atm_shv ( npolygons)) allocate(cgrid%mmean_atm_co2 ( npolygons)) allocate(cgrid%mmean_atm_prss ( npolygons)) @@ -2739,6 +2802,13 @@ subroutine allocate_edtype(cgrid,npolygons) allocate(cgrid%mmsqu_vapor_lc ( npolygons)) allocate(cgrid%mmsqu_vapor_wc ( npolygons)) allocate(cgrid%mmsqu_vapor_gc ( npolygons)) + allocate(cgrid%mmsqu_ustar ( npolygons)) + allocate(cgrid%mmsqu_rlongup ( npolygons)) + allocate(cgrid%mmsqu_parup ( npolygons)) + allocate(cgrid%mmsqu_nirup ( npolygons)) + allocate(cgrid%mmsqu_rshortup ( npolygons)) + allocate(cgrid%mmsqu_rnet ( npolygons)) + allocate(cgrid%mmsqu_albedo ( npolygons)) allocate(cgrid%disturbance_rates (n_dist_types,n_dist_types,npolygons)) @@ -2816,6 +2886,10 @@ subroutine allocate_edtype(cgrid,npolygons) allocate(cgrid%qmean_albedo_diffuse ( ndcycle, npolygons)) allocate(cgrid%qmean_rlong_albedo ( ndcycle, npolygons)) allocate(cgrid%qmean_rlongup ( ndcycle, npolygons)) + allocate(cgrid%qmean_parup ( ndcycle, npolygons)) + allocate(cgrid%qmean_nirup ( ndcycle, npolygons)) + allocate(cgrid%qmean_rshortup ( ndcycle, npolygons)) + allocate(cgrid%qmean_rnet ( ndcycle, npolygons)) allocate(cgrid%qmean_atm_shv ( ndcycle, npolygons)) allocate(cgrid%qmean_atm_co2 ( ndcycle, npolygons)) allocate(cgrid%qmean_atm_prss ( ndcycle, npolygons)) @@ -2839,6 +2913,13 @@ subroutine allocate_edtype(cgrid,npolygons) allocate(cgrid%qmsqu_vapor_lc ( ndcycle, npolygons)) allocate(cgrid%qmsqu_vapor_wc ( ndcycle, npolygons)) allocate(cgrid%qmsqu_vapor_gc ( ndcycle, npolygons)) + allocate(cgrid%qmsqu_ustar ( ndcycle, npolygons)) + allocate(cgrid%qmsqu_rlongup ( ndcycle, npolygons)) + allocate(cgrid%qmsqu_parup ( ndcycle, npolygons)) + allocate(cgrid%qmsqu_nirup ( ndcycle, npolygons)) + allocate(cgrid%qmsqu_rshortup ( ndcycle, npolygons)) + allocate(cgrid%qmsqu_rnet ( ndcycle, npolygons)) + allocate(cgrid%qmsqu_albedo ( ndcycle, npolygons)) end if end if @@ -2940,6 +3021,10 @@ subroutine allocate_polygontype(cpoly,nsites) allocate(cpoly%avg_albedo(nsites)) allocate(cpoly%avg_rlongup(nsites)) + allocate(cpoly%avg_parup(nsites)) + allocate(cpoly%avg_nirup(nsites)) + allocate(cpoly%avg_rshortup(nsites)) + allocate(cpoly%avg_rnet(nsites)) allocate(cpoly%daylight(nsites)) allocate(cpoly%lai (nsites)) @@ -3197,7 +3282,11 @@ subroutine allocate_sitetype(csite,npatches) allocate(csite%albedo(npatches)) allocate(csite%albedo_beam(npatches)) allocate(csite%albedo_diffuse(npatches)) + allocate(csite%rnet(npatches)) allocate(csite%rlongup(npatches)) + allocate(csite%parup(npatches)) + allocate(csite%nirup(npatches)) + allocate(csite%rshortup(npatches)) allocate(csite%rlong_albedo(npatches)) allocate(csite%total_sfcw_depth(npatches)) allocate(csite%snowfac(npatches)) @@ -3244,6 +3333,10 @@ subroutine allocate_sitetype(csite,npatches) allocate(csite%avg_carbon_ac (npatches)) allocate(csite%avg_carbon_st (npatches)) allocate(csite%avg_rlongup (npatches)) + allocate(csite%avg_parup (npatches)) + allocate(csite%avg_nirup (npatches)) + allocate(csite%avg_rshortup (npatches)) + allocate(csite%avg_rnet (npatches)) allocate(csite%avg_albedo (npatches)) allocate(csite%avg_albedo_beam (npatches)) allocate(csite%avg_albedo_diffuse (npatches)) @@ -3807,6 +3900,10 @@ subroutine nullify_edtype(cgrid) nullify(cgrid%avg_albedo_diffuse ) nullify(cgrid%avg_rlong_albedo ) nullify(cgrid%avg_rlongup ) + nullify(cgrid%avg_parup ) + nullify(cgrid%avg_nirup ) + nullify(cgrid%avg_rshortup ) + nullify(cgrid%avg_rnet ) nullify(cgrid%dmean_pcpg ) nullify(cgrid%dmean_runoff ) nullify(cgrid%dmean_drainage ) @@ -3886,6 +3983,10 @@ subroutine nullify_edtype(cgrid) nullify(cgrid%dmean_albedo_diffuse ) nullify(cgrid%dmean_rlong_albedo ) nullify(cgrid%dmean_rlongup ) + nullify(cgrid%dmean_parup ) + nullify(cgrid%dmean_nirup ) + nullify(cgrid%dmean_rshortup ) + nullify(cgrid%dmean_rnet ) nullify(cgrid%dmean_co2_residual ) nullify(cgrid%dmean_energy_residual ) nullify(cgrid%dmean_water_residual ) @@ -3965,6 +4066,10 @@ subroutine nullify_edtype(cgrid) nullify(cgrid%mmean_albedo_diffuse ) nullify(cgrid%mmean_rlong_albedo ) nullify(cgrid%mmean_rlongup ) + nullify(cgrid%mmean_parup ) + nullify(cgrid%mmean_nirup ) + nullify(cgrid%mmean_rshortup ) + nullify(cgrid%mmean_rnet ) nullify(cgrid%mmean_atm_shv ) nullify(cgrid%mmean_atm_co2 ) nullify(cgrid%mmean_atm_prss ) @@ -3998,6 +4103,13 @@ subroutine nullify_edtype(cgrid) nullify(cgrid%mmsqu_vapor_lc ) nullify(cgrid%mmsqu_vapor_wc ) nullify(cgrid%mmsqu_vapor_gc ) + nullify(cgrid%mmsqu_ustar ) + nullify(cgrid%mmsqu_rlongup ) + nullify(cgrid%mmsqu_parup ) + nullify(cgrid%mmsqu_nirup ) + nullify(cgrid%mmsqu_rshortup ) + nullify(cgrid%mmsqu_rnet ) + nullify(cgrid%mmsqu_albedo ) nullify(cgrid%disturbance_rates ) nullify(cgrid%workload ) @@ -4065,6 +4177,10 @@ subroutine nullify_edtype(cgrid) nullify(cgrid%qmean_albedo_diffuse ) nullify(cgrid%qmean_rlong_albedo ) nullify(cgrid%qmean_rlongup ) + nullify(cgrid%qmean_parup ) + nullify(cgrid%qmean_nirup ) + nullify(cgrid%qmean_rshortup ) + nullify(cgrid%qmean_rnet ) nullify(cgrid%qmean_atm_shv ) nullify(cgrid%qmean_atm_co2 ) nullify(cgrid%qmean_atm_prss ) @@ -4088,6 +4204,13 @@ subroutine nullify_edtype(cgrid) nullify(cgrid%qmsqu_vapor_lc ) nullify(cgrid%qmsqu_vapor_wc ) nullify(cgrid%qmsqu_vapor_gc ) + nullify(cgrid%qmsqu_ustar ) + nullify(cgrid%qmsqu_rlongup ) + nullify(cgrid%qmsqu_parup ) + nullify(cgrid%qmsqu_nirup ) + nullify(cgrid%qmsqu_rshortup ) + nullify(cgrid%qmsqu_rnet ) + nullify(cgrid%qmsqu_albedo ) return end subroutine nullify_edtype @@ -4177,6 +4300,10 @@ subroutine nullify_polygontype(cpoly) nullify(cpoly%avg_albedo_diffuse) nullify(cpoly%avg_rlong_albedo) nullify(cpoly%avg_rlongup) + nullify(cpoly%avg_parup) + nullify(cpoly%avg_nirup) + nullify(cpoly%avg_rshortup) + nullify(cpoly%avg_rnet) nullify(cpoly%avg_lma ) nullify(cpoly%daylight) @@ -4439,7 +4566,11 @@ subroutine nullify_sitetype(csite) nullify(csite%albedo) nullify(csite%albedo_beam) nullify(csite%albedo_diffuse) + nullify(csite%rnet) nullify(csite%rlongup) + nullify(csite%parup) + nullify(csite%nirup) + nullify(csite%rshortup) nullify(csite%rlong_albedo) nullify(csite%total_sfcw_depth) nullify(csite%snowfac) @@ -4488,6 +4619,10 @@ subroutine nullify_sitetype(csite) nullify(csite%avg_carbon_ac ) nullify(csite%avg_carbon_st ) nullify(csite%avg_rlongup ) + nullify(csite%avg_parup ) + nullify(csite%avg_nirup ) + nullify(csite%avg_rshortup ) + nullify(csite%avg_rnet ) nullify(csite%avg_albedo ) nullify(csite%avg_albedo_beam ) nullify(csite%avg_albedo_diffuse) @@ -5015,6 +5150,10 @@ subroutine deallocate_edtype(cgrid) if(associated(cgrid%avg_albedo_diffuse )) deallocate(cgrid%avg_albedo_diffuse ) if(associated(cgrid%avg_rlong_albedo )) deallocate(cgrid%avg_rlong_albedo ) if(associated(cgrid%avg_rlongup )) deallocate(cgrid%avg_rlongup ) + if(associated(cgrid%avg_parup )) deallocate(cgrid%avg_parup ) + if(associated(cgrid%avg_nirup )) deallocate(cgrid%avg_nirup ) + if(associated(cgrid%avg_rshortup )) deallocate(cgrid%avg_rshortup ) + if(associated(cgrid%avg_rnet )) deallocate(cgrid%avg_rnet ) if(associated(cgrid%runoff )) deallocate(cgrid%runoff ) @@ -5098,6 +5237,10 @@ subroutine deallocate_edtype(cgrid) if(associated(cgrid%dmean_albedo_diffuse )) deallocate(cgrid%dmean_albedo_diffuse ) if(associated(cgrid%dmean_rlong_albedo )) deallocate(cgrid%dmean_rlong_albedo ) if(associated(cgrid%dmean_rlongup )) deallocate(cgrid%dmean_rlongup ) + if(associated(cgrid%dmean_nirup )) deallocate(cgrid%dmean_nirup ) + if(associated(cgrid%dmean_parup )) deallocate(cgrid%dmean_parup ) + if(associated(cgrid%dmean_rshortup )) deallocate(cgrid%dmean_rshortup ) + if(associated(cgrid%dmean_rnet )) deallocate(cgrid%dmean_rnet ) if(associated(cgrid%dmean_co2_residual )) deallocate(cgrid%dmean_co2_residual ) if(associated(cgrid%dmean_energy_residual )) deallocate(cgrid%dmean_energy_residual ) if(associated(cgrid%dmean_water_residual )) deallocate(cgrid%dmean_water_residual ) @@ -5178,6 +5321,10 @@ subroutine deallocate_edtype(cgrid) if(associated(cgrid%mmean_albedo_diffuse )) deallocate(cgrid%mmean_albedo_diffuse ) if(associated(cgrid%mmean_rlong_albedo )) deallocate(cgrid%mmean_rlong_albedo ) if(associated(cgrid%mmean_rlongup )) deallocate(cgrid%mmean_rlongup ) + if(associated(cgrid%mmean_nirup )) deallocate(cgrid%mmean_nirup ) + if(associated(cgrid%mmean_parup )) deallocate(cgrid%mmean_parup ) + if(associated(cgrid%mmean_rshortup )) deallocate(cgrid%mmean_rshortup ) + if(associated(cgrid%mmean_rnet )) deallocate(cgrid%mmean_rnet ) if(associated(cgrid%mmean_atm_shv )) deallocate(cgrid%mmean_atm_shv ) if(associated(cgrid%mmean_atm_co2 )) deallocate(cgrid%mmean_atm_co2 ) if(associated(cgrid%mmean_atm_prss )) deallocate(cgrid%mmean_atm_prss ) @@ -5212,6 +5359,13 @@ subroutine deallocate_edtype(cgrid) if(associated(cgrid%mmsqu_vapor_lc )) deallocate(cgrid%mmsqu_vapor_lc ) if(associated(cgrid%mmsqu_vapor_wc )) deallocate(cgrid%mmsqu_vapor_wc ) if(associated(cgrid%mmsqu_vapor_gc )) deallocate(cgrid%mmsqu_vapor_gc ) + if(associated(cgrid%mmsqu_ustar )) deallocate(cgrid%mmsqu_ustar ) + if(associated(cgrid%mmsqu_rlongup )) deallocate(cgrid%mmsqu_rlongup ) + if(associated(cgrid%mmsqu_parup )) deallocate(cgrid%mmsqu_parup ) + if(associated(cgrid%mmsqu_nirup )) deallocate(cgrid%mmsqu_nirup ) + if(associated(cgrid%mmsqu_rshortup )) deallocate(cgrid%mmsqu_rshortup ) + if(associated(cgrid%mmsqu_rnet )) deallocate(cgrid%mmsqu_rnet ) + if(associated(cgrid%mmsqu_albedo )) deallocate(cgrid%mmsqu_albedo ) if(associated(cgrid%disturbance_rates )) deallocate(cgrid%disturbance_rates ) if(associated(cgrid%workload )) deallocate(cgrid%workload ) @@ -5279,6 +5433,10 @@ subroutine deallocate_edtype(cgrid) if(associated(cgrid%qmean_albedo_diffuse )) deallocate(cgrid%qmean_albedo_diffuse ) if(associated(cgrid%qmean_rlong_albedo )) deallocate(cgrid%qmean_rlong_albedo ) if(associated(cgrid%qmean_rlongup )) deallocate(cgrid%qmean_rlongup ) + if(associated(cgrid%qmean_parup )) deallocate(cgrid%qmean_parup ) + if(associated(cgrid%qmean_nirup )) deallocate(cgrid%qmean_nirup ) + if(associated(cgrid%qmean_rshortup )) deallocate(cgrid%qmean_rshortup ) + if(associated(cgrid%qmean_rnet )) deallocate(cgrid%qmean_rnet ) if(associated(cgrid%qmean_atm_co2 )) deallocate(cgrid%qmean_atm_co2 ) if(associated(cgrid%qmean_atm_prss )) deallocate(cgrid%qmean_atm_prss ) if(associated(cgrid%qmean_atm_vels )) deallocate(cgrid%qmean_atm_vels ) @@ -5301,6 +5459,13 @@ subroutine deallocate_edtype(cgrid) if(associated(cgrid%qmsqu_vapor_lc )) deallocate(cgrid%qmsqu_vapor_lc ) if(associated(cgrid%qmsqu_vapor_wc )) deallocate(cgrid%qmsqu_vapor_wc ) if(associated(cgrid%qmsqu_vapor_gc )) deallocate(cgrid%qmsqu_vapor_gc ) + if(associated(cgrid%qmsqu_ustar )) deallocate(cgrid%qmsqu_ustar ) + if(associated(cgrid%qmsqu_rlongup )) deallocate(cgrid%qmsqu_rlongup ) + if(associated(cgrid%qmsqu_parup )) deallocate(cgrid%qmsqu_parup ) + if(associated(cgrid%qmsqu_nirup )) deallocate(cgrid%qmsqu_nirup ) + if(associated(cgrid%qmsqu_rshortup )) deallocate(cgrid%qmsqu_rshortup ) + if(associated(cgrid%qmsqu_rnet )) deallocate(cgrid%qmsqu_rnet ) + if(associated(cgrid%qmsqu_albedo )) deallocate(cgrid%qmsqu_albedo ) do ipy=1,cgrid%npolygons call deallocate_polygontype(cgrid%polygon(ipy)) @@ -5398,6 +5563,10 @@ subroutine deallocate_polygontype(cpoly) if(associated(cpoly%avg_rlong_albedo )) deallocate(cpoly%avg_rlong_albedo ) if(associated(cpoly%avg_albedo )) deallocate(cpoly%avg_albedo ) if(associated(cpoly%avg_rlongup )) deallocate(cpoly%avg_rlongup ) + if(associated(cpoly%avg_parup )) deallocate(cpoly%avg_parup ) + if(associated(cpoly%avg_nirup )) deallocate(cpoly%avg_nirup ) + if(associated(cpoly%avg_rshortup )) deallocate(cpoly%avg_rshortup ) + if(associated(cpoly%avg_rnet )) deallocate(cpoly%avg_rnet ) if(associated(cpoly%daylight )) deallocate(cpoly%daylight ) @@ -5667,7 +5836,11 @@ subroutine deallocate_sitetype(csite) if(associated(csite%albedo )) deallocate(csite%albedo ) if(associated(csite%albedo_beam )) deallocate(csite%albedo_beam ) if(associated(csite%albedo_diffuse )) deallocate(csite%albedo_diffuse ) + if(associated(csite%rnet )) deallocate(csite%rnet ) if(associated(csite%rlongup )) deallocate(csite%rlongup ) + if(associated(csite%parup )) deallocate(csite%parup ) + if(associated(csite%nirup )) deallocate(csite%nirup ) + if(associated(csite%rshortup )) deallocate(csite%rshortup ) if(associated(csite%rlong_albedo )) deallocate(csite%rlong_albedo ) if(associated(csite%total_sfcw_depth )) deallocate(csite%total_sfcw_depth ) if(associated(csite%snowfac )) deallocate(csite%snowfac ) @@ -5715,6 +5888,10 @@ subroutine deallocate_sitetype(csite) if(associated(csite%avg_carbon_ac )) deallocate(csite%avg_carbon_ac ) if(associated(csite%avg_carbon_st )) deallocate(csite%avg_carbon_st ) if(associated(csite%avg_rlongup )) deallocate(csite%avg_rlongup ) + if(associated(csite%avg_parup )) deallocate(csite%avg_parup ) + if(associated(csite%avg_nirup )) deallocate(csite%avg_nirup ) + if(associated(csite%avg_rshortup )) deallocate(csite%avg_rshortup ) + if(associated(csite%avg_rnet )) deallocate(csite%avg_rnet ) if(associated(csite%avg_albedo )) deallocate(csite%avg_albedo ) if(associated(csite%avg_albedo_beam )) deallocate(csite%avg_albedo_beam ) if(associated(csite%avg_albedo_diffuse )) deallocate(csite%avg_albedo_diffuse ) @@ -6142,7 +6319,11 @@ subroutine copy_sitetype(isite,osite,ipaa,ipaz,opaa,opaz) osite%albedo(opa) = isite%albedo(ipa) osite%albedo_beam(opa) = isite%albedo_beam(ipa) osite%albedo_diffuse(opa) = isite%albedo_diffuse(ipa) + osite%rnet(opa) = isite%rnet(ipa) osite%rlongup(opa) = isite%rlongup(ipa) + osite%parup(opa) = isite%parup(ipa) + osite%nirup(opa) = isite%nirup(ipa) + osite%rshortup(opa) = isite%rshortup(ipa) osite%rlong_albedo(opa) = isite%rlong_albedo(ipa) osite%total_sfcw_depth(opa) = isite%total_sfcw_depth(ipa) osite%snowfac(opa) = isite%snowfac(ipa) @@ -6191,6 +6372,10 @@ subroutine copy_sitetype(isite,osite,ipaa,ipaz,opaa,opaz) osite%avg_carbon_ac (opa) = isite%avg_carbon_ac (ipa) osite%avg_carbon_st (opa) = isite%avg_carbon_st (ipa) osite%avg_rlongup (opa) = isite%avg_rlongup (ipa) + osite%avg_parup (opa) = isite%avg_parup (ipa) + osite%avg_nirup (opa) = isite%avg_nirup (ipa) + osite%avg_rshortup (opa) = isite%avg_rshortup (ipa) + osite%avg_rnet (opa) = isite%avg_rnet (ipa) osite%avg_albedo (opa) = isite%avg_albedo (ipa) osite%avg_albedo_beam (opa) = isite%avg_albedo_beam (ipa) osite%avg_albedo_diffuse (opa) = isite%avg_albedo_diffuse (ipa) @@ -6451,7 +6636,11 @@ subroutine copy_sitetype_mask(sitein,siteout,logmask,masksz,newsz) siteout%albedo(1:inc) = pack(sitein%albedo,logmask) siteout%albedo_beam(1:inc) = pack(sitein%albedo_beam,logmask) siteout%albedo_diffuse(1:inc) = pack(sitein%albedo_diffuse,logmask) + siteout%rnet(1:inc) = pack(sitein%rnet,logmask) siteout%rlongup(1:inc) = pack(sitein%rlongup,logmask) + siteout%parup(1:inc) = pack(sitein%parup,logmask) + siteout%nirup(1:inc) = pack(sitein%nirup,logmask) + siteout%rshortup(1:inc) = pack(sitein%rshortup,logmask) siteout%rlong_albedo(1:inc) = pack(sitein%rlong_albedo,logmask) siteout%total_sfcw_depth(1:inc) = pack(sitein%total_sfcw_depth,logmask) siteout%snowfac(1:inc) = pack(sitein%snowfac,logmask) @@ -6500,6 +6689,10 @@ subroutine copy_sitetype_mask(sitein,siteout,logmask,masksz,newsz) siteout%avg_carbon_ac (1:inc) = pack(sitein%avg_carbon_ac ,logmask) siteout%avg_carbon_st (1:inc) = pack(sitein%avg_carbon_st ,logmask) siteout%avg_rlongup (1:inc) = pack(sitein%avg_rlongup ,logmask) + siteout%avg_parup (1:inc) = pack(sitein%avg_parup ,logmask) + siteout%avg_nirup (1:inc) = pack(sitein%avg_nirup ,logmask) + siteout%avg_rshortup (1:inc) = pack(sitein%avg_rshortup ,logmask) + siteout%avg_rnet (1:inc) = pack(sitein%avg_rnet ,logmask) siteout%avg_albedo (1:inc) = pack(sitein%avg_albedo ,logmask) siteout%avg_albedo_beam (1:inc) = pack(sitein%avg_albedo_beam ,logmask) siteout%avg_albedo_diffuse (1:inc) = pack(sitein%avg_albedo_diffuse,logmask) @@ -8853,6 +9046,34 @@ subroutine filltab_edtype_p11(cgrid,igr,init,var_len,var_len_global,max_ptrs,nva var_len,var_len_global,max_ptrs,'AVG_RLONGUP :11:hist:anal') call metadata_edio(nvar,igr,'Polygon Average Upwelling Longwave Radiation','[W/m2]','ipoly') end if + + if (associated(cgrid%avg_parup)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%avg_parup,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'AVG_PARUP :11:hist:anal') + call metadata_edio(nvar,igr,'Polygon Average Upwelling PAR','[W/m2]','ipoly') + end if + + if (associated(cgrid%avg_nirup)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%avg_nirup,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'AVG_NIRUP :11:hist:anal') + call metadata_edio(nvar,igr,'Polygon Average Upwelling NIR','[W/m2]','ipoly') + end if + + if (associated(cgrid%avg_rshortup)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%avg_rshortup,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'AVG_RSHORTUP :11:hist:anal') + call metadata_edio(nvar,igr,'Polygon Average Upwelling Shortwave Radiation','[W/m2]','ipoly') + end if + + if (associated(cgrid%avg_rnet)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%avg_rnet,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'AVG_RNET :11:hist:anal') + call metadata_edio(nvar,igr,'Polygon Average Net Radiation','[W/m2]','ipoly') + end if if (associated(cgrid%max_leaf_temp)) then nvar=nvar+1 @@ -9582,6 +9803,34 @@ subroutine filltab_edtype_p11(cgrid,igr,init,var_len,var_len_global,max_ptrs,nva var_len,var_len_global,max_ptrs,'DMEAN_RLONGUP :11:hist:dail') call metadata_edio(nvar,igr,'Daily mean longwave emission from ground','[---]','ipoly') end if + + if(associated(cgrid%dmean_parup)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%dmean_parup,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'DMEAN_PARUP :11:hist:dail') + call metadata_edio(nvar,igr,'Daily mean upwelling PAR at top of canopy','[---]','ipoly') + end if + + if(associated(cgrid%dmean_nirup)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%dmean_nirup,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'DMEAN_NIRUP :11:hist:dail') + call metadata_edio(nvar,igr,'Daily mean upwelling NIR at top of canopy','[---]','ipoly') + end if + + if(associated(cgrid%dmean_rshortup)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%dmean_rshortup,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'DMEAN_RSHORTUP :11:hist:dail') + call metadata_edio(nvar,igr,'Daily mean upwelling SW radiation at top of canopy','[---]','ipoly') + end if + + if(associated(cgrid%dmean_rnet)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%dmean_rnet,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'DMEAN_RNET :11:hist:dail') + call metadata_edio(nvar,igr,'Daily mean net radiation at top of canopy','[---]','ipoly') + end if if(associated(cgrid%dmean_co2_residual)) then nvar=nvar+1 @@ -10059,6 +10308,34 @@ subroutine filltab_edtype_p11(cgrid,igr,init,var_len,var_len_global,max_ptrs,nva call metadata_edio(nvar,igr,'Monthly mean longwave emission from ground','[---]','ipoly') end if + if(associated(cgrid%mmean_parup)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%mmean_parup,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'MMEAN_PARUP :11:hist:mont:dcyc') + call metadata_edio(nvar,igr,'Monthly mean upwelling PAR at top of canopy','[---]','ipoly') + end if + + if(associated(cgrid%mmean_nirup)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%mmean_nirup,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'MMEAN_NIRUP :11:hist:mont:dcyc') + call metadata_edio(nvar,igr,'Monthly mean upwelling NIR at top of canopy','[---]','ipoly') + end if + + if(associated(cgrid%mmean_rshortup)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%mmean_rshortup,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'MMEAN_RSHORTUP :11:hist:mont:dcyc') + call metadata_edio(nvar,igr,'Monthly mean upwelling SW Rad. at top of canopy','[---]','ipoly') + end if + + if(associated(cgrid%mmean_rnet)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%mmean_rnet,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'MMEAN_RNET :11:hist:mont:dcyc') + call metadata_edio(nvar,igr,'Monthly mean Net Rad. at top of canopy','[---]','ipoly') + end if + if(associated(cgrid%mmean_atm_temp)) then nvar=nvar+1 call vtable_edio_r(npts,cgrid%mmean_atm_temp,nvar,igr,init,cgrid%pyglob_id, & @@ -10271,6 +10548,54 @@ subroutine filltab_edtype_p11(cgrid,igr,init,var_len,var_len_global,max_ptrs,nva call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') end if + if(associated(cgrid%mmsqu_ustar)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%mmsqu_ustar,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'MMSQU_USTAR :11:hist:mont:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if(associated(cgrid%mmsqu_rlongup)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%mmsqu_rlongup,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'MMSQU_RLONGUP :11:hist:mont:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if(associated(cgrid%mmsqu_parup)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%mmsqu_parup,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'MMSQU_PARUP :11:hist:mont:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if(associated(cgrid%mmsqu_nirup)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%mmsqu_nirup,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'MMSQU_NIRUP :11:hist:mont:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if(associated(cgrid%mmsqu_rshortup)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%mmsqu_rshortup,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'MMSQU_RSHORTUP :11:hist:mont:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if(associated(cgrid%mmsqu_rnet)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%mmsqu_rnet,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'MMSQU_RNET :11:hist:mont:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if(associated(cgrid%mmsqu_albedo)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%mmsqu_albedo,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'MMSQU_ALBEDO :11:hist:mont:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if !------------------------------------------------------------------------------------! !------------------------------------------------------------------------------------! @@ -10735,6 +11060,34 @@ subroutine filltab_edtype_m11(cgrid,igr,init,var_len,var_len_global,max_ptrs,nva var_len,var_len_global,max_ptrs,'QMEAN_RLONGUP :-11:hist:dcyc') call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') end if + + if(associated(cgrid%qmean_parup)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%qmean_parup,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'QMEAN_PARUP :-11:hist:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if(associated(cgrid%qmean_nirup)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%qmean_nirup,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'QMEAN_NIRUP :-11:hist:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if(associated(cgrid%qmean_rshortup)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%qmean_rshortup,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'QMEAN_RSHORTUP :-11:hist:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if(associated(cgrid%qmean_rnet)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%qmean_rnet,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'QMEAN_RNET :-11:hist:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if if(associated(cgrid%qmean_atm_shv)) then nvar=nvar+1 @@ -10897,6 +11250,55 @@ subroutine filltab_edtype_m11(cgrid,igr,init,var_len,var_len_global,max_ptrs,nva call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') end if + if(associated(cgrid%qmsqu_ustar)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%qmsqu_ustar,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'QMSQU_USTAR :-11:hist:mont:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if(associated(cgrid%qmsqu_rlongup)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%qmsqu_rlongup,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'QMSQU_RLONGUP :-11:hist:mont:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if(associated(cgrid%qmsqu_parup)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%qmsqu_parup,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'QMSQU_PARUP :-11:hist:mont:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if(associated(cgrid%qmsqu_nirup)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%qmsqu_nirup,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'QMSQU_NIRUP :-11:hist:mont:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if(associated(cgrid%qmsqu_rshortup)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%qmsqu_rshortup,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'QMSQU_RSHORTUP :-11:hist:mont:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if(associated(cgrid%qmsqu_rnet)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%qmsqu_rnet,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'QMSQU_RNET :-11:hist:mont:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if(associated(cgrid%qmsqu_albedo)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%qmsqu_albedo,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'QMSQU_ALBEDO :-11:hist:mont:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + !------------------------------------------------------------------------------------! !------------------------------------------------------------------------------------! @@ -12989,6 +13391,13 @@ subroutine filltab_sitetype(igr,ipy,isi,init) call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') end if + if (associated(csite%rnet)) then + nvar=nvar+1 + call vtable_edio_r(npts,csite%rnet,nvar,igr,init,csite%paglob_id, & + var_len,var_len_global,max_ptrs,'RNET :31:hist') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + if (associated(csite%rlongup)) then nvar=nvar+1 call vtable_edio_r(npts,csite%rlongup,nvar,igr,init,csite%paglob_id, & @@ -12996,6 +13405,27 @@ subroutine filltab_sitetype(igr,ipy,isi,init) call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') end if + if (associated(csite%parup)) then + nvar=nvar+1 + call vtable_edio_r(npts,csite%parup,nvar,igr,init,csite%paglob_id, & + var_len,var_len_global,max_ptrs,'PARUP :31:hist') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if (associated(csite%nirup)) then + nvar=nvar+1 + call vtable_edio_r(npts,csite%nirup,nvar,igr,init,csite%paglob_id, & + var_len,var_len_global,max_ptrs,'NIRUP :31:hist') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if (associated(csite%rshortup)) then + nvar=nvar+1 + call vtable_edio_r(npts,csite%rshortup,nvar,igr,init,csite%paglob_id, & + var_len,var_len_global,max_ptrs,'RSHORTUP :31:hist') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + if (associated(csite%rlong_albedo)) then nvar=nvar+1 call vtable_edio_r(npts,csite%rlong_albedo,nvar,igr,init,csite%paglob_id, & @@ -13250,6 +13680,34 @@ subroutine filltab_sitetype(igr,ipy,isi,init) call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') end if + if (associated(csite%avg_parup)) then + nvar=nvar+1 + call vtable_edio_r(npts,csite%avg_parup,nvar,igr,init,csite%paglob_id, & + var_len,var_len_global,max_ptrs,'AVG_PARUP_PA :31:hist') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if (associated(csite%avg_nirup)) then + nvar=nvar+1 + call vtable_edio_r(npts,csite%avg_nirup,nvar,igr,init,csite%paglob_id, & + var_len,var_len_global,max_ptrs,'AVG_NIRUP_PA :31:hist') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if (associated(csite%avg_rshortup)) then + nvar=nvar+1 + call vtable_edio_r(npts,csite%avg_rshortup,nvar,igr,init,csite%paglob_id, & + var_len,var_len_global,max_ptrs,'AVG_RSHORTUP_PA :31:hist') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if (associated(csite%avg_rnet)) then + nvar=nvar+1 + call vtable_edio_r(npts,csite%avg_rnet,nvar,igr,init,csite%paglob_id, & + var_len,var_len_global,max_ptrs,'AVG_RNET_PA :31:hist') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + if (associated(csite%avg_albedo)) then nvar=nvar+1 call vtable_edio_r(npts,csite%avg_albedo,nvar,igr,init,csite%paglob_id, & diff --git a/RAPP/build/bin/dependency.mk b/RAPP/build/bin/dependency.mk index 2385625f4..4aa941720 100644 --- a/RAPP/build/bin/dependency.mk +++ b/RAPP/build/bin/dependency.mk @@ -21,7 +21,7 @@ mod_interp.o: mod_ioopts.mod mod_maxdims.mod mod_ioopts.o: mod_maxdims.mod mod_time.mod mod_model.o: mod_maxdims.mod mod_time.mod mod_namelist.o: mod_maxdims.mod -mod_ncdf_globio.o: mod_ioopts.mod mod_netcdf.mod mod_time.mod +mod_ncdf_globio.o: mod_ioopts.mod mod_ mod_time.mod mod_ncdf_globio.o: rconstants.mod mod_ncep.o: mod_ioopts.mod mod_maxdims.mod mod_time.mod mod_netcdf.o: mod_maxdims.mod mod_time.mod @@ -31,15 +31,15 @@ ncep_alloc.o: rconstants.mod ncep_coordinates.o: mod_grid.mod mod_ioopts.mod mod_model.mod ncep_fill_infotable.o: an_header.mod mod_interp.mod mod_ioopts.mod ncep_fill_infotable.o: mod_maxdims.mod mod_model.mod mod_ncdf_globio.mod -ncep_fill_infotable.o: mod_ncep.mod mod_netcdf.mod +ncep_fill_infotable.o: mod_ncep.mod mod_ ncep_loadvars.o: an_header.mod mod_grid.mod mod_ioopts.mod mod_maxdims.mod -ncep_loadvars.o: mod_model.mod mod_ncdf_globio.mod mod_ncep.mod mod_netcdf.mod +ncep_loadvars.o: mod_model.mod mod_ncdf_globio.mod mod_ncep.mod mod_ ncep_loadvars.o: therm_lib.mod ncep_output.o: hdf5_utils.mod mod_grid.mod mod_interp.mod ncep_output.o: mod_ioopts.mod mod_maxdims.mod mod_model.mod mod_ncep.mod ncep_output.o: mod_time.mod ncepcio.o: mod_ioopts.mod mod_maxdims.mod mod_model.mod mod_ncdf_globio.mod -ncepcio.o: mod_netcdf.mod rconstants.mod +ncepcio.o: mod_ rconstants.mod dateutils.o: mod_time.mod rconstants.mod great_circle.o: rconstants.mod hdf5_utils.o: hdf5_coms.mod @@ -56,7 +56,7 @@ mod_model.mod: mod_model.o mod_namelist.mod: mod_namelist.o mod_ncdf_globio.mod: mod_ncdf_globio.o mod_ncep.mod: mod_ncep.o -mod_netcdf.mod: mod_netcdf.o +mod_: mod_netcdf.o mod_time.mod: mod_time.o rconstants.mod: rconstants.o therm_lib.mod: therm_lib.o diff --git a/RAPP/build/bin/generate_deps.sh b/RAPP/build/bin/generate_deps.sh index 0085b5a07..8ffd0d7d1 100755 --- a/RAPP/build/bin/generate_deps.sh +++ b/RAPP/build/bin/generate_deps.sh @@ -2,8 +2,8 @@ rapproot=${1} includes="-I ${rapproot}/src/include" rappsrc="${rapproot}/src/*/*.f90 ${rapproot}/src/*/*.F90 ${rapproot}/src/*/*.c" -rm -f dependency.mk +/bin/rm -f dependency.mk ./sfmakedepend.pl ${includes} -f dependency.mk ${rappsrc} -cat dependency.mk | sed s@\ hdf5.mod@\ @g > dependency.alt -cat dependency.alt | sed s@\ netcdf.mod@\ @g > dependency.mk +sed -i s@hdf5.mod@@g dependency.mk +sed -i s@netcdf.mod@@g dependency.mk /bin/rm -f dependency.alt dependency.mk.old* diff --git a/RAPP/build/bin/include.mk.odyssey b/RAPP/build/bin/include.mk.odyssey index 320bf9c79..39e4b9c8b 100644 --- a/RAPP/build/bin/include.mk.odyssey +++ b/RAPP/build/bin/include.mk.odyssey @@ -17,7 +17,7 @@ RAPP_ROOT=/n/Moorcroft_Lab/Users/mlongo/EDBRAMS/RAPP #------------------------------------------------------------------------------------------# USE_HDF5=1 HDF5_INCS= -HDF5_LIBS= -lhdf5 -lm -lhdf5_fortran -lhdf5 -lhdf5_hl -lz +HDF5_LIBS=-lm -lz -lhdf5 -lhdf5_fortran -lhdf5_hl #------------------------------------------------------------------------------------------# # NetCDF libraries. You don't have to include them if you don't want to use anything in # @@ -109,9 +109,9 @@ ifeq ($(KIND_COMP),D) endif ifeq ($(KIND_COMP),E) USE_INTERF=1 - F_OPTS= -FR -O3 -recursive -Vaxlib -traceback -axP - C_OPTS= -O3 -DLITTLE -traceback - LOADER_OPTS= -FR -O3 -Vaxlib -traceback -axP + F_OPTS= -FR -O3 -recursive -traceback -static + C_OPTS= -O3 -DLITTLE -traceback -static + LOADER_OPTS= -FR -O3 -traceback C_LOADER_OPTS=-v -traceback #---------------------------------------------------------------------------------------# endif From 212f9c6f82f70f3a9c0f710df3b280e6f15e70f0 Mon Sep 17 00:00:00 2001 From: Marcos Longo Date: Tue, 16 Oct 2012 13:16:06 -0400 Subject: [PATCH 2/2] 319 Marcos Longo 2012-10-16 1. Bug fixes: a. Budget_utils is now a module. Some compilers do not like when functions have pointers as arguments, unless they are inside a module. b. In disturbance.f90, variable mask was not allocated when cpatch%ncohorts was zero, so the debugger would crash if it tried to use mask. c. In average_utils.f90, daylight was used in divisions, but the number can be zero. For me this should happen only in polar nights so it should be fixed anyway, but somehow the number was zero in Petrolina! I could not find why, because daylight is a site-level variable so it should be always found (perhaps the driver is wrong). 2. Modified INCLUDE_FIRE = 3, now the water deficit threshold is relative to the total rainfall instead of the absolute number. 3. Corrected some R scripts --- BRAMS/Template/RAMSIN | 24 +- BRAMS/run/RAMSIN | 24 +- ED/Template/Template/ED2IN | 24 +- ED/Template/Template/plot_census.r | 661 +++--- ED/Template/Template/plot_eval_ed.r | 342 +-- ED/Template/Template/plot_monthly.r | 2505 +++++--------------- ED/Template/Template/plot_ycomp.r | 678 ++++++ ED/Template/Template/plot_yearly.r | 2207 ++++++++++++----- ED/Template/compare_results.r | 545 ++++- ED/Template/compare_scenarios.r | 2437 +++++++++++++++++++ ED/Template/epost.sh | 526 ++-- ED/Template/joborder.txt | 208 +- ED/Template/spawn_poly.sh | 6 +- ED/build/bin/dependency.mk | 87 +- ED/dbgbuild/bin/dependency.mk | 87 +- ED/run/ED2IN | 24 +- ED/src/driver/ed_model.f90 | 1 - ED/src/dynamics/canopy_struct_dynamics.f90 | 2 +- ED/src/dynamics/disturbance.f90 | 10 +- ED/src/dynamics/euler_driver.f90 | 19 +- ED/src/dynamics/events.f90 | 6 +- ED/src/dynamics/fire.f90 | 26 +- ED/src/dynamics/forestry.f90 | 1 + ED/src/dynamics/growth_balive.f90 | 2 +- ED/src/dynamics/heun_driver.f90 | 19 +- ED/src/dynamics/hybrid_driver.f90 | 56 +- ED/src/dynamics/reproduction.f90 | 1 + ED/src/dynamics/rk4_derivs.F90 | 3 +- ED/src/dynamics/rk4_driver.F90 | 20 +- ED/src/init/ed_init_atm.F90 | 1 + ED/src/init/ed_type_init.f90 | 10 + ED/src/io/average_utils.f90 | 14 +- ED/src/io/ed_init_full_history.F90 | 5 +- ED/src/io/ed_opspec.F90 | 4 +- ED/src/memory/ed_state_vars.f90 | 17 +- ED/src/utils/budget_utils.f90 | 1434 +++++------ ED/src/utils/fuse_fiss_utils.f90 | 1 + 37 files changed, 7787 insertions(+), 4250 deletions(-) create mode 100644 ED/Template/Template/plot_ycomp.r create mode 100644 ED/Template/compare_scenarios.r diff --git a/BRAMS/Template/RAMSIN b/BRAMS/Template/RAMSIN index 6090e294f..6328a5dc5 100644 --- a/BRAMS/Template/RAMSIN +++ b/BRAMS/Template/RAMSIN @@ -2526,8 +2526,9 @@ $ED2_INFO ! 2. Fire will be triggered with enough biomass and the total soil ! ! water at the top 75 cm falls below a threshold. ! ! 3. Fire will be triggered with enough biomass and accumulated ! - ! 30-day water deficit exceeds the threshold given by SM_FIRE. ! - ! This is soil independent. ! + ! water deficit exceeds the threshold given by SM_FIRE times. ! + ! the total precipitation of the past 12 months. This method ! + ! does not directly depend on soil texture. ! ! FIRE_PARAMETER -- If fire happens, this will control the intensity of the disturbance ! ! given the amount of fuel (currently the total above-ground ! ! biomass). ! @@ -2540,8 +2541,9 @@ $ED2_INFO ! 1m that will prevent fires to happen. The dry air soil ! ! potential is defined as -3.1 MPa, so make sure SM_FIRE ! ! is greater than this value. ! - ! When INCLUDE_FIRE = 3, only positive values are allowed. This is ! - ! the minimum water deficit, in kg/m2/30 days, to trigger fires. ! + ! When INCLUDE_FIRE = 3, values between 0 and 2 are allowed. This is ! + ! the minimum water deficit relative to the total rainfall, over the ! + ! past 12 months, to trigger fires. ! !---------------------------------------------------------------------------------------! INCLUDE_FIRE = 2, FIRE_PARAMETER = 0.5, @@ -2563,12 +2565,14 @@ $ED2_INFO !---------------------------------------------------------------------------------------! ! ICANTURB -- This flag controls the canopy roughness. ! - ! 0. Based on Leuning et al. (1995), wind is computed using the similarity ! - ! theory for the top cohort, and they are extinguished with cumulative ! - ! LAI. If using CROWN_MOD 1 or 2, this will use local LAI and average ! - ! by crown area. ! - ! 1. The default ED-2.1 scheme, except that it uses the zero-plane ! - ! displacement height. ! + ! 0. Based on Leuning et al. (1995) and LEAF-3 (Walko et al. 2000). ! + ! Roughness and displacement height are found using simple relations ! + ! with vegetation height; wind is computed using the similarity theory ! + ! for the top cohort, then it is assumed that wind extinguishes follow- ! + ! ing an exponential decay with "perceived" cumulative LAI (local LAI ! + ! with finite crown area). ! + ! 1. The default ED-2.1 scheme, similar to option 0, but the wind profile ! + ! is not based on LAI, instead it used the cohort height. ! ! 2. This uses the method of Massman (1997) using constant drag and no ! ! sheltering factor. ! ! 3. This is also based on Massman (1997), but with the option of varying ! diff --git a/BRAMS/run/RAMSIN b/BRAMS/run/RAMSIN index 8ff1749af..d4a8392ac 100644 --- a/BRAMS/run/RAMSIN +++ b/BRAMS/run/RAMSIN @@ -2548,8 +2548,9 @@ $ED2_INFO ! 2. Fire will be triggered with enough biomass and the total soil ! ! water at the top 75 cm falls below a threshold. ! ! 3. Fire will be triggered with enough biomass and accumulated ! - ! 30-day water deficit exceeds the threshold given by SM_FIRE. ! - ! This is soil independent. ! + ! water deficit exceeds the threshold given by SM_FIRE times. ! + ! the total precipitation of the past 12 months. This method ! + ! does not directly depend on soil texture. ! ! FIRE_PARAMETER -- If fire happens, this will control the intensity of the disturbance ! ! given the amount of fuel (currently the total above-ground ! ! biomass). ! @@ -2562,8 +2563,9 @@ $ED2_INFO ! 1m that will prevent fires to happen. The dry air soil ! ! potential is defined as -3.1 MPa, so make sure SM_FIRE ! ! is greater than this value. ! - ! When INCLUDE_FIRE = 3, only positive values are allowed. This is ! - ! the minimum water deficit, in kg/m2/30 days, to trigger fires. ! + ! When INCLUDE_FIRE = 3, values between 0 and 2 are allowed. This is ! + ! the minimum water deficit relative to the total rainfall, over the ! + ! past 12 months, to trigger fires. ! !---------------------------------------------------------------------------------------! INCLUDE_FIRE = 2, FIRE_PARAMETER = 0.5, @@ -2585,12 +2587,14 @@ $ED2_INFO !---------------------------------------------------------------------------------------! ! ICANTURB -- This flag controls the canopy roughness. ! - ! 0. Based on Leuning et al. (1995), wind is computed using the similarity ! - ! theory for the top cohort, and they are extinguished with cumulative ! - ! LAI. If using CROWN_MOD 1 or 2, this will use local LAI and average ! - ! by crown area. ! - ! 1. The default ED-2.1 scheme, except that it uses the zero-plane ! - ! displacement height. ! + ! 0. Based on Leuning et al. (1995) and LEAF-3 (Walko et al. 2000). ! + ! Roughness and displacement height are found using simple relations ! + ! with vegetation height; wind is computed using the similarity theory ! + ! for the top cohort, then it is assumed that wind extinguishes follow- ! + ! ing an exponential decay with "perceived" cumulative LAI (local LAI ! + ! with finite crown area). ! + ! 1. The default ED-2.1 scheme, similar to option 0, but the wind profile ! + ! is not based on LAI, instead it used the cohort height. ! ! 2. This uses the method of Massman (1997) using constant drag and no ! ! sheltering factor. ! ! 3. This is also based on Massman (1997), but with the option of varying ! diff --git a/ED/Template/Template/ED2IN b/ED/Template/Template/ED2IN index fa58f6b8b..53dc2c227 100644 --- a/ED/Template/Template/ED2IN +++ b/ED/Template/Template/ED2IN @@ -1046,8 +1046,9 @@ $ED_NL ! 2. Fire will be triggered with enough biomass and the total soil ! ! water at the top 75 cm falls below a threshold. ! ! 3. Fire will be triggered with enough biomass and accumulated ! - ! 30-day water deficit exceeds the threshold given by SM_FIRE. ! - ! This is soil independent. ! + ! water deficit exceeds the threshold given by SM_FIRE times. ! + ! the total precipitation of the past 12 months. This method ! + ! does not directly depend on soil texture. ! ! FIRE_PARAMETER -- If fire happens, this will control the intensity of the disturbance ! ! given the amount of fuel (currently the total above-ground ! ! biomass). ! @@ -1060,8 +1061,9 @@ $ED_NL ! 1m that will prevent fires to happen. The dry air soil ! ! potential is defined as -3.1 MPa, so make sure SM_FIRE ! ! is greater than this value. ! - ! When INCLUDE_FIRE = 3, only positive values are allowed. This is ! - ! the minimum water deficit, in kg/m2/day, to trigger fires. ! + ! When INCLUDE_FIRE = 3, values between 0 and 2 are allowed. This is ! + ! the minimum water deficit relative to the total rainfall, over the ! + ! past 12 months, to trigger fires. ! !---------------------------------------------------------------------------------------! NL%INCLUDE_FIRE = myfire NL%FIRE_PARAMETER = myfuel @@ -1083,12 +1085,14 @@ $ED_NL !---------------------------------------------------------------------------------------! ! ICANTURB -- This flag controls the canopy roughness. ! - ! 0. Based on Leuning et al. (1995), wind is computed using the similarity ! - ! theory for the top cohort, and they are extinguished with cumulative ! - ! LAI. If using CROWN_MOD 1 or 2, this will use local LAI and average ! - ! by crown area. ! - ! 1. The default ED-2.1 scheme, except that it uses the zero-plane ! - ! displacement height. ! + ! 0. Based on Leuning et al. (1995) and LEAF-3 (Walko et al. 2000). ! + ! Roughness and displacement height are found using simple relations ! + ! with vegetation height; wind is computed using the similarity theory ! + ! for the top cohort, then it is assumed that wind extinguishes follow- ! + ! ing an exponential decay with "perceived" cumulative LAI (local LAI ! + ! with finite crown area). ! + ! 1. The default ED-2.1 scheme, similar to option 0, but the wind profile ! + ! is not based on LAI, instead it used the cohort height. ! ! 2. This uses the method of Massman (1997) using constant drag and no ! ! sheltering factor. ! ! 3. This is also based on Massman (1997), but with the option of varying ! diff --git a/ED/Template/Template/plot_census.r b/ED/Template/Template/plot_census.r index c2ff39676..ddb7e46ce 100644 --- a/ED/Template/Template/plot_census.r +++ b/ED/Template/Template/plot_census.r @@ -1,60 +1,123 @@ +#==========================================================================================# +#==========================================================================================# +# Leave these commands at the beginning. They will refresh the session. # +#------------------------------------------------------------------------------------------# rm(list=ls()) +graphics.off() +#==========================================================================================# +#==========================================================================================# -#------------------------------------------------------------------------------------------# -#------------------------------------------------------------------------------------------# + + +#==========================================================================================# +#==========================================================================================# # Here is the user defined variable section. # #------------------------------------------------------------------------------------------# + +#----- Paths. -----------------------------------------------------------------------------# +here = "thispath" # Current directory. +there = "thatpath" # Directory where analyses/history are +srcdir = "/n/moorcroft_data/mlongo/util/Rsc" # Source directory. +outroot = "thisoutroot" # Directory for figures #------------------------------------------------------------------------------------------# -here = "thispath" # Current directory. -there = "thatpath" # Directory where analyses/history are -srcdir = "/n/moorcroft_data/mlongo/util/Rsc" # Source directory. -outroot = "thisoutroot" + + + + +#----- Time options. ----------------------------------------------------------------------# monthbeg = thismontha yearbeg = thisyeara # First year to consider yearend = thisyearz # Maximum year to consider -metcyca = mymetcyca # First year of the met cycle -metcycz = mymetcycz # Last year of the met cycle +biocyca = mybiocyca # First year of the met cycle +biocycz = mybiocycz # Last year of the met cycle various.cycles = myvarcycle -myplaces = c("thispoly") sasmonth.short = c(2,5,8,11) sasmonth.long = 5 nyears.long = 25 -outform = thisoutform # Formats for output file. Supported formats are: - # - "X11" - for printing on screen - # - "eps" - for postscript printing - # - "png" - for PNG printing - # - "pdf" - for PDF printing - -byeold = TRUE # Remove old files of the given format? - -depth = 96 # PNG resolution, in pixels per inch -paper = "letter" # Paper size, to define the plot shape -ptsz = 14 # Font size. -lwidth = 2.5 # Line width -plotgrid = TRUE # Should I plot the grid in the background? - -legwhere = "topleft" # Where should I place the legend? -inset = 0.01 # inset distance between legend and edge of plot region. -legbg = "white" # Legend background colour. -scalleg = 0.20 -cex.main = 0.8 # Scale coefficient for the title -slz.min = -5.0 # Find the deepest depth that trees access water. #------------------------------------------------------------------------------------------# +#----- Name of the simulations. -----------------------------------------------------------# +myplaces = c("thispoly") #------------------------------------------------------------------------------------------# + + + +#----- Plot options. ----------------------------------------------------------------------# +outform = thisoutform # Formats for output file. Supported formats are: + # - "X11" - for printing on screen + # - "eps" - for postscript printing + # - "png" - for PNG printing + # - "pdf" - for PDF printing +depth = 96 # PNG resolution, in pixels per inch +paper = "letter" # Paper size, to define the plot shape +ptsz = 14 # Font size. +lwidth = 2.5 # Line width +plotgrid = TRUE # Should I plot the grid in the background? +sasfixlimits = FALSE # Use a fixed scale for size and age-structure + # plots? (FALSE will set a suitable scale for + # each plot) +ncolsfc = 200 # Target number of colours for filled contour. +fcgrid = TRUE # Include a grid on the filled contour plots? +ncolshov = 200 # Target number of colours for Hovmoller diagrams. +hovgrid = TRUE # Include a grid on the Hovmoller plots? +legwhere = "topleft" # Where should I place the legend? +inset = 0.01 # Inset between legend and edge of plot region. +legbg = "white" # Legend background colour. +scalleg = 0.40 # Expand y limits by this relative amount to fit + # the legend +cex.main = 0.8 # Scale coefficient for the title +theta = 315. # Azimuth for perspective projection +phi = 30. # Vertical angle for perspective projection +ltheta = -210. # Azimuth angle for light +shade = 0.125 # Shade intensity +expz = 0.5 # Expansion factor for Z axis +gcol = c("lightblue","white") # Colours for the fifties style floor +cexmin = 0.5 # Minimum "head" size of the lollipop +cexmax = 3.0 # Maximum "head" size of the lollipop +ylnudge = 0.05 # Nudging factor for ylimit +ptype = "l" # Type of plot +ptyped = "p" # Type of plot +ptypeb = "o" # Type of plot +mtext.xoff = -7.00 # Offset for the x label +mtext.yoff = -1.00 # Offset for the y label +mtext.xadj = 0.50 # Offset for the x label +mtext.yadj = 0.65 # Offset for the y label +drought.mark = mydroughtmark # Put a background to highlight droughts? +drought.yeara = mydroughtyeara # First year that has drought +drought.yearz = mydroughtyearz # Last year that has drought +months.drought = mymonthsdrought # Months with drought #------------------------------------------------------------------------------------------# + + +#------ Miscellaneous settings. -----------------------------------------------------------# +slz.min = -5.0 # The deepest depth that trees access water. +idbh.type = myidbhtype # Type of DBH class + # 1 -- Every 10 cm until 100cm; > 100cm + # 2 -- 0-10; 10-20; 20-35; 35-50; 50-70; > 70 (cm) #------------------------------------------------------------------------------------------# -#------------------------------------------------------------------------------------------# -#------------------------------------------------------------------------------------------# -#------------------------------------------------------------------------------------------# + + + +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# # NO NEED TO CHANGE ANYTHING BEYOND THIS POINT UNLESS YOU ARE DEVELOPING THE CODE... # -#------------------------------------------------------------------------------------------# -#------------------------------------------------------------------------------------------# -#------------------------------------------------------------------------------------------# -#------------------------------------------------------------------------------------------# -#------------------------------------------------------------------------------------------# +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# + + + +#----- Loading some packages and scripts. -------------------------------------------------# +source(file.path(srcdir,"load.everything.r")) #------------------------------------------------------------------------------------------# @@ -354,34 +417,16 @@ xyzvar$zvar = list( list( vname = "rshort" , log = FALSE )#end list )#end if - - -#----- Load some packages. ----------------------------------------------------------------# -isok = require(hdf5 ) -isok = require(chron ) -isok = require(scatterplot3d) -isok = require(lattice ) -isok = require(maps ) -isok = require(mapdata ) -isok = require(akima ) -isok = require(Hmisc ) -isok = require(sn ) #------------------------------------------------------------------------------------------# -#------------------------------------------------------------------------------------------# -# SHADY BUSINESS... We must unlock grav from package boot and replace by our good # -# old value from rconstants.r. # -#------------------------------------------------------------------------------------------# -envir = as.environment("package:survival") -unlockBinding("tobin",envir) + +#----- Loading some packages and scripts. -------------------------------------------------# +source(file.path(srcdir,"load.everything.r")) #------------------------------------------------------------------------------------------# -#----- In case there is some graphic still opened. ----------------------------------------# -graphics.off() -#------------------------------------------------------------------------------------------# #----- Set how many formats we must output. -----------------------------------------------# @@ -401,37 +446,6 @@ options(locatorBell=FALSE) #------------------------------------------------------------------------------------------# -#----- Load some files with functions. ----------------------------------------------------# -source(paste(srcdir,"atlas.r" ,sep="/")) -source(paste(srcdir,"charutils.r" ,sep="/")) -source(paste(srcdir,"census.r" ,sep="/")) -source(paste(srcdir,"colourmap.r" ,sep="/")) -source(paste(srcdir,"cloudy.r" ,sep="/")) -source(paste(srcdir,"demography.rates.r",sep="/")) -source(paste(srcdir,"epolygon.r" ,sep="/")) -source(paste(srcdir,"error.bar.r" ,sep="/")) -source(paste(srcdir,"globdims.r" ,sep="/")) -source(paste(srcdir,"locations.r" ,sep="/")) -source(paste(srcdir,"muitas.r" ,sep="/")) -source(paste(srcdir,"numutils.r" ,sep="/")) -source(paste(srcdir,"plotsize.r" ,sep="/")) -source(paste(srcdir,"pretty.box.r" ,sep="/")) -source(paste(srcdir,"pretty.log.r" ,sep="/")) -source(paste(srcdir,"pretty.time.r" ,sep="/")) -source(paste(srcdir,"qapply.r" ,sep="/")) -source(paste(srcdir,"rconstants.r" ,sep="/")) -source(paste(srcdir,"skewnorm.stats.r" ,sep="/")) -source(paste(srcdir,"soilutils.r" ,sep="/")) -source(paste(srcdir,"sombreado.r" ,sep="/")) -source(paste(srcdir,"southammap.r" ,sep="/")) -source(paste(srcdir,"thermlib.r" ,sep="/")) -source(paste(srcdir,"timeutils.r" ,sep="/")) -#----- These should be called after the others. -------------------------------------------# -source(paste(srcdir,"pft.coms.r" ,sep="/")) -#------------------------------------------------------------------------------------------# - - - #----- Load census data. ------------------------------------------------------------------# census.file = paste(srcdir,"LBA_MIP.census_summ.RData",sep="/") load(file=census.file) @@ -537,6 +551,8 @@ for (place in myplaces){ x.dbh = c(10,sta$dbh.breaks[seq(from=2,to=n.dbh,by=1)]) dbh.names = dimnames(sta$mort.size$n$median)[[2]] year4 = numyears(sta$when) + biocyca = year4[2] + biocycz = year4[length(year4)] dyear = c(NA,diff(year4)) census.desc = paste(year4-c(NA,diff(year4)),year4,sep="-") @@ -570,7 +586,7 @@ for (place in myplaces){ act.census.year = numyears(sta$when) #------------------------------------------------------------------------------------# - ncyc = metcycz - metcyca + 1 + ncyc = biocycz - biocyca + 1 if (various.cycles){ nfullcyc = 1 + floor( (act.census.yeara - 1 - yeara ) / ncyc ) }else{ @@ -650,8 +666,8 @@ for (place in myplaces){ now.month = (now.month %% 12) + 1 now.year = now.year + as.integer(now.month == 1) year.use = year.use + as.integer(now.month == 1) - print (paste("ED-2.1: ",paste(mon2mmm(now.month,cap1=T),now.year,sep="-") - ,"; Census: ",paste(act.census.year[census.idx[m]]))) + cat("ED-2.1: ",paste(mon2mmm(now.month,cap1=T),now.year,sep="-") + ,"; Census: ",paste(act.census.year[census.idx[m]]),"\n") #----- Build the file name. ---------------------------------------------------# cmonth = sprintf("%2.2i",now.month) @@ -681,7 +697,7 @@ for (place in myplaces){ if (file.exists(myfile)){ #----- Read data and close connection immediately after. -------------------# - #print (paste(" * Reading ",basename(myfile),"...",sep="")) + #cat(" * Reading ",basename(myfile),"...","\n") mymont = hdf5load(file=myfile,load=FALSE,verbosity=0,tidy=TRUE) #---------------------------------------------------------------------------# @@ -1037,9 +1053,7 @@ for (place in myplaces){ }#end for DBH #---------------------------------------------------------------------------# }else{ - print (paste(" * ",basename(myfile)," wasn't found, skipping it..." - ,sep="")) - + cat(" * ",basename(myfile)," wasn't found, skipping it...","\n") }#end if #------------------------------------------------------------------------------# }#end for (m in 1:n.months) @@ -1055,7 +1069,7 @@ for (place in myplaces){ #====================================================================================# # Make the parameter space. # #------------------------------------------------------------------------------------# - print(paste(" - Creating the parameter space...",sep="")) + cat(" - Creating the parameter space...","\n") #----- Make the point and legend name sequence. ----------------------------------# yeara = c(qapply(X=ts.census.year,INDEX=census.idx,DIM=1 ,FUN=min,na.rm=TRUE)) @@ -1281,7 +1295,7 @@ for (place in myplaces){ #------------------------------------------------------------------------------------# # Remove the 4th. dimension for the means. # #------------------------------------------------------------------------------------# - print(paste(" - Averaging the census intervals...",sep="")) + cat(" - Averaging the census intervals...","\n") ms.recr.plot = list() for (v in 1:nrecr.vars){ v.now = recr.vars[v] @@ -1385,7 +1399,7 @@ for (place in myplaces){ # can't switch the factors between observation and statistics because we use # # observations to drive the statistics. # #------------------------------------------------------------------------------------# - print(paste(" - Finding the average rates...",sep="")) + cat(" - Finding the average rates...","\n") ed2 = list() ed2$when = sta$when ed2$taxon = sta$taxon @@ -1410,7 +1424,7 @@ for (place in myplaces){ sizetoo = this.rate$sizetoo desc.rate = this.rate$desc.rate indiv = this.rate$indiv - print(paste(" - Compounding the ",desc.rate," tables..."),sep="") + cat(" - Compounding the ",desc.rate," tables...","\n") #---------------------------------------------------------------------------------# @@ -1447,7 +1461,9 @@ for (place in myplaces){ #------------------------------------------------------------------------------# # Plot-level with all cycles. # #------------------------------------------------------------------------------# - ms.plot = get(paste("ms",ed2.rate,"plot",sep="."))[[v.now]] + ms.plot = get(paste("ms",ed2.rate,"plot",sep="."))[[v.now]] + ms.global = array(ms.plot[npft+1,,],dim=dim(ms.plot)[2:3] ) + ms.use = array(ms.plot[mypfts,,],dim=c(npfts,dim(ms.plot)[2:3])) #------------------------------------------------------------------------------# @@ -1464,36 +1480,36 @@ for (place in myplaces){ ed2[[ed2.plot]][[v.now]]$q025 = NA * sta[[sta.plot]][[v.now]]$q025 ed2[[ed2.plot]][[v.now]]$q975 = NA * sta[[sta.plot]][[v.now]]$q975 #----- Save the global variables. ---------------------------------------------# - ed2[[ed2.plot]][[v.now]]$global[4,yyy] = apply( X = ms.plot[npft+1,,] + ed2[[ed2.plot]][[v.now]]$global[4,yyy] = apply( X = ms.global , MARGIN = 1 , FUN = median , na.rm = TRUE )#end apply - ed2[[ed2.plot]][[v.now]]$global[5,yyy] = apply( X = ms.plot[npft+1,,] + ed2[[ed2.plot]][[v.now]]$global[5,yyy] = apply( X = ms.global , MARGIN = 1 , FUN = quantile , probs = 0.025 , na.rm = TRUE )#end apply - ed2[[ed2.plot]][[v.now]]$global[6,yyy] = apply( X = ms.plot[npft+1,,] + ed2[[ed2.plot]][[v.now]]$global[6,yyy] = apply( X = ms.global , MARGIN = 1 , FUN = quantile , probs = 0.975 , na.rm = TRUE )#end apply #----- Save the PFT statistics. -----------------------------------------------# - ed2[[ed2.plot]][[v.now]]$median[ ,yyy] = apply( X = ms.plot[mypfts,,] + ed2[[ed2.plot]][[v.now]]$median[ ,yyy] = apply( X = ms.use , MARGIN = c(1,2) , FUN = median , na.rm = TRUE )#end apply - ed2[[ed2.plot]][[v.now]]$q025 [ ,yyy] = apply( X = ms.plot[mypfts,,] + ed2[[ed2.plot]][[v.now]]$q025 [ ,yyy] = apply( X = ms.use , MARGIN = c(1,2) , FUN = quantile , probs = 0.025 , na.rm = TRUE )#end apply - ed2[[ed2.plot]][[v.now]]$q975 [ ,yyy] = apply( X = ms.plot[mypfts,,] + ed2[[ed2.plot]][[v.now]]$q975 [ ,yyy] = apply( X = ms.use , MARGIN = c(1,2) , FUN = quantile , probs = 0.975 @@ -1510,7 +1526,9 @@ for (place in myplaces){ #---------------------------------------------------------------------------# # Plot-level with all cycles. # #---------------------------------------------------------------------------# - ms.size = get(paste("ms",ed2.rate,"size",sep="."))[[v.now]] + ms.size = get(paste("ms",ed2.rate,"size",sep="."))[[v.now]] + ms.global = array(ms.size[npft+1,,,],dim=dim(ms.size)[2:4] ) + ms.use = array(ms.size[mypfts,,,],dim=c(npfts,dim(ms.size)[2:4])) #---------------------------------------------------------------------------# @@ -1527,36 +1545,36 @@ for (place in myplaces){ ed2[[ed2.size]][[v.now]]$q025 = NA * sta[[sta.size]][[v.now]]$q025 ed2[[ed2.size]][[v.now]]$q975 = NA * sta[[sta.size]][[v.now]]$q975 #----- Save the global variables. ------------------------------------------# - ed2[[ed2.size]][[v.now]]$global[4,,yyy] = apply( X = ms.size[npft+1,,,] + ed2[[ed2.size]][[v.now]]$global[4,,yyy] = apply( X = ms.global , MARGIN = c(1,2) , FUN = median , na.rm = TRUE )#end apply - ed2[[ed2.size]][[v.now]]$global[5,,yyy] = apply( X = ms.size[npft+1,,,] + ed2[[ed2.size]][[v.now]]$global[5,,yyy] = apply( X = ms.global , MARGIN = c(1,2) , FUN = quantile , probs = 0.025 , na.rm = TRUE )#end apply - ed2[[ed2.size]][[v.now]]$global[6,,yyy] = apply( X = ms.size[npft+1,,,] + ed2[[ed2.size]][[v.now]]$global[6,,yyy] = apply( X = ms.global , MARGIN = c(1,2) , FUN = quantile , probs = 0.975 , na.rm = TRUE )#end apply #----- Save the PFT statistics. --------------------------------------------# - ed2[[ed2.size]][[v.now]]$median[ ,,yyy] = apply( X = ms.size[mypfts,,,] + ed2[[ed2.size]][[v.now]]$median[ ,,yyy] = apply( X = ms.use , MARGIN = c(1,2,3) , FUN = median , na.rm = TRUE )#end apply - ed2[[ed2.size]][[v.now]]$q025 [ ,,yyy] = apply( X = ms.size[mypfts,,,] + ed2[[ed2.size]][[v.now]]$q025 [ ,,yyy] = apply( X = ms.use , MARGIN = c(1,2,3) , FUN = quantile , probs = 0.025 , na.rm = TRUE )#end apply - ed2[[ed2.size]][[v.now]]$q975 [ ,,yyy] = apply( X = ms.size[mypfts,,,] + ed2[[ed2.size]][[v.now]]$q975 [ ,,yyy] = apply( X = ms.use , MARGIN = c(1,2,3) , FUN = quantile , probs = 0.975 @@ -1620,11 +1638,11 @@ for (place in myplaces){ # Loop over all possible types of population count. # #---------------------------------------------------------------------------------# for (i in 1:nindiv){ - print(paste(" - Size level: ",desc.indiv[i],"...")) + cat(" - Size level: ",desc.indiv[i],"...","\n") #----- Build the rate name. ---------------------------------------------------# - print(paste(" + Plotting size-dependent ",desc.rate,"...",sep="")) + cat(" + Plotting size-dependent ",desc.rate,"...","\n") ed2.rate = paste(this.plot$ed2.rate,"size",sep=".") sta.rate = paste(this.plot$sta.rate,"size",sep=".") #------------------------------------------------------------------------------# @@ -1694,27 +1712,41 @@ for (place in myplaces){ # Split the window into several smaller windows. # #---------------------------------------------------------------------------# par.orig = par(no.readonly = TRUE) - par(oma = c(2,2,3,0)) - layout(mat=lo.box$mat) + par(oma = c(0.2,3,4,0)) + layout(mat = rbind(1+lo.box$mat,rep(1,times=lo.box$ncol)) + ,height = c(rep(5/lo.box$nrow,times=lo.box$nrow),1) + )#end layout #---------------------------------------------------------------------------# #---------------------------------------------------------------------------# # Find the plot limit for the y scale. # #---------------------------------------------------------------------------# - yuse = c(sta.q025,sta.q975,ed2.q025,ed2.q975) - if (ylog) yuse = log(yuse) - ylimit = range(yuse,na.rm=TRUE) - if ( any(! is.finite(ylimit)) - || (ylimit[1] == ylimit[2] && ylimit[1] == 0)){ - ylimit = c(-1,1) - }else if (ylimit[1] == ylimit[2] ){ - ylimit[1] = ylimit[1] * ( 1. - sign(ylimit[1]) * 0.25) - ylimit[2] = ylimit[2] * ( 1. + sign(ylimit[2]) * 0.25) - }else{ - ylimit[2] = ylimit[2] + 0.25 * (ylimit[2] - ylimit[1]) - }#end if - if (ylog) ylimit = exp(ylimit) + yuse = c(sta.q025,sta.q975,ed2.q025,ed2.q975) + ylimit = pretty.xylim(u=yuse,fracexp=0.0,is.log=ylog) + #---------------------------------------------------------------------------# + + + + #----- Plot legend. --------------------------------------------------------# + par(mar=c(0.1,0.1,0.1,0.1)) + plot.new() + plot.window(xlim=c(0,1),ylim=c(0,1),xaxt="n",yaxt="n") + legend ( x = "bottom" + , inset = 0.01 + , legend = c("Census","ED-2.2") + , fill = c(col.sta[2],col.ed2[2]) + , border = c(col.sta[2],col.ed2[2]) + , col = c(col.sta[1],col.ed2[1]) + , lwd = 2.0 + , pt.cex = 1.0 + , angle = c(-45,45) + , density = c( 40,40) + , bg = "white" + , ncol = 2 + , title = "(Shaded - 95% C.I.)" + , cex = 1.0 + )#end legend #---------------------------------------------------------------------------# @@ -1727,9 +1759,7 @@ for (place in myplaces){ right = (k %% lo.box$ncol) == 0 top = k <= lo.box$ncol bottom = k > (lo.box$nrow - 1) * lo.box$ncol - mar.now = c(3 + 2 * bottom,2 + 2 * left,2 + 2 * top,2 * right) + 0.1 - if (bottom) xaxt="s" else xaxt="n" - if (left) yaxt="s" else yaxt="n" + mar.now = c(1 + 3 * bottom,1 + 1 * left,1 + 2 * top,1 + 1 * right) + 0.1 @@ -1756,34 +1786,17 @@ for (place in myplaces){ #----- Plotting window and grid. ----------------------------------------# par(mar=mar.now) plot.new() - plot.window(xlim=xlimit,ylim=ylimit,xaxt=xaxt,yaxt,yaxt,log=plog) + plot.window(xlim=xlimit,ylim=ylimit,log=plog) + if (bottom) axis(side=1) + if (left ) axis(side=2) box() title(main=lesub) - if (plotgrid) grid(col="gray83",lty="solid") + if (plotgrid) grid(col="grey83",lty="solid") #----- Plot the taxon rate with confidence interval. --------------------# epolygon(x=size.poly,col=c(col.sta[2],col.ed2[2]),angle=c(-45,45) ,density=40,lty="solid",lwd=1.0) lines(x=x.dbh,y=sta.median[,y],type="o",col=col.sta[1],pch=16,lwd=2.0) lines(x=x.dbh,y=ed2.median[,y],type="o",col=col.ed2[1],pch=16,lwd=2.0) - #----- Plot legend. -----------------------------------------------------# - if (top && right){ - legend ( x = legpos - , inset = 0.01 - , legend = c("Census","ED-2.2") - , fill = c(col.sta[2],col.ed2[2]) - , border = c(col.sta[2],col.ed2[2]) - , col = c(col.sta[1],col.ed2[1]) - , lwd = 2.0 - , pt.cex = 1.0 - , angle = c(-45,45) - , density = c( 40,40) - , bg = "white" - , ncol = 2 - , title = "(Shaded - 95% C.I.)" - , cex = 1.0 - )#end legend - }#end if - #------------------------------------------------------------------------# }#end for #---------------------------------------------------------------------------# @@ -1802,9 +1815,10 @@ for (place in myplaces){ #---------------------------------------------------------------------------# # Plot the global title. # #---------------------------------------------------------------------------# - mtext(text=lex ,side=1,outer=TRUE) - mtext(text=ley ,side=2,outer=TRUE) - mtext(text=letitre,side=3,outer=TRUE,cex=0.8,font=2) + par(las=0) + mtext(text=lex ,side=1,outer=TRUE,adj=mtext.xadj,padj=mtext.xoff) + mtext(text=ley ,side=2,outer=TRUE,adj=mtext.yadj,padj=mtext.yoff) + mtext(text=letitre,side=3,outer=TRUE,cex=cex.main,font=2) par(par.orig) #---------------------------------------------------------------------------# @@ -1853,7 +1867,7 @@ for (place in myplaces){ nindiv = length(indiv) - print(paste(" + Plotting time series of ",desc.rate,"...",sep="")) + cat(" + Plotting time series of ",desc.rate,"...","\n") #---------------------------------------------------------------------------------# # Loop over all possible types of population count. # #---------------------------------------------------------------------------------# @@ -1862,7 +1876,7 @@ for (place in myplaces){ #==============================================================================# # PLOT-LEVEL rates. # #------------------------------------------------------------------------------# - print(paste(" - Plot level: ",desc.indiv[i],"...")) + cat(" - Plot level: ",desc.indiv[i],"...","\n") ed2.rate = paste(this.plot$ed2.rate,"plot",sep=".") sta.rate = paste(this.plot$sta.rate,"plot",sep=".") @@ -1914,18 +1928,7 @@ for (place in myplaces){ # Find the plot limit for the y scale. # #------------------------------------------------------------------------------# yuse = c(sta.q025,sta.q975,ed2.q025,ed2.q975) - if (ylog) yuse = log(yuse) - ylimit = range(yuse[is.finite(yuse)],na.rm=TRUE) - if ( any(! is.finite(ylimit)) - || (ylimit[1] == ylimit[2] && ylimit[1] == 0)){ - ylimit = c(-1,1) - }else if (ylimit[1] == ylimit[2] ){ - ylimit[1] = ylimit[1] * ( 1. - sign(ylimit[1]) * 0.40) - ylimit[2] = ylimit[2] * ( 1. + sign(ylimit[2]) * 0.40) - }else{ - ylimit[2] = ylimit[2] + 0.40 * (ylimit[2] - ylimit[1]) - }#end if - if (ylog) ylimit = exp(ylimit) + ylimit = pretty.xylim(u=yuse,fracexp=scalleg,is.log=ylog) #------------------------------------------------------------------------------# @@ -1970,7 +1973,7 @@ for (place in myplaces){ #----- Plotting window and grid. -------------------------------------------# plot(x=x.years,y=sta.median,xlim=xlimit,ylim=ylimit,type="n",main=letitre ,xlab=lex,ylab=ley,log=plog,cex.main=0.7) - if (plotgrid) grid(col="gray83",lty="solid") + if (plotgrid) grid(col="grey83",lty="solid") #----- Plot the taxon rate with confidence interval. -----------------------# epolygon(x=plot.poly,col=c(col.sta[2],col.ed2[2]),angle=c(-45,45) ,density=40,lty="solid",lwd=1.0) @@ -2014,7 +2017,7 @@ for (place in myplaces){ # DBH-LEVEL rates. # #------------------------------------------------------------------------------# if (sizetoo){ - print(paste(" - DBH classes: ",desc.indiv[i],"...")) + cat(" - DBH classes: ",desc.indiv[i],"...","\n") ed2.rate = paste(this.plot$ed2.rate,"size",sep=".") sta.rate = paste(this.plot$sta.rate,"size",sep=".") @@ -2088,8 +2091,33 @@ for (place in myplaces){ # Split the window into several smaller windows. # #------------------------------------------------------------------------# par.orig = par(no.readonly = TRUE) - par(oma = c(2,2,3,0)) - layout(mat=lo.box$mat) + par(oma = c(0.2,3,4,0)) + layout(mat = rbind(1+lo.box$mat,rep(1,times=lo.box$ncol)) + ,height = c(rep(5/lo.box$nrow,times=lo.box$nrow),1) + )#end layout + #------------------------------------------------------------------------# + + + + #----- Plot legend. -----------------------------------------------------# + par(mar=c(0.1,0.1,0.1,0.1)) + plot.new() + plot.window(xlim=c(0,1),ylim=c(0,1),xaxt="n",yaxt="n") + legend ( x = "bottom" + , inset = 0.01 + , legend = c("Census","ED-2.2") + , fill = c(col.sta[2],col.ed2[2]) + , border = c(col.sta[2],col.ed2[2]) + , col = c(col.sta[1],col.ed2[1]) + , lwd = 2.0 + , pt.cex = 1.0 + , angle = c(-45,45) + , density = c( 40,40) + , bg = "white" + , ncol = 2 + , title = "(Shaded - 95% C.I.)" + , cex = 1.0 + )#end legend #------------------------------------------------------------------------# @@ -2109,18 +2137,7 @@ for (place in myplaces){ # Find the plot limit for the y scale. # #---------------------------------------------------------------------# yuse = c(ed2.q025[d,],ed2.q975[d,],sta.q025[d,],sta.q975[d,]) - if (ylog) yuse = log(yuse) - ylimit = range(yuse[is.finite(yuse)],na.rm=TRUE) - if ( any(! is.finite(ylimit)) - || (ylimit[1] == ylimit[2] && ylimit[1] == 0)){ - ylimit = c(-1,1) - }else if (ylimit[1] == ylimit[2] ){ - ylimit[1] = ylimit[1] * ( 1. - sign(ylimit[1]) * 0.40) - ylimit[2] = ylimit[2] * ( 1. + sign(ylimit[2]) * 0.40) - }else{ - ylimit[2] = ylimit[2] + 0.40 * (ylimit[2] - ylimit[1]) - }#end if - if (ylog) ylimit = exp(ylimit) + ylimit = pretty.xylim(yuse,fracexp=0.0,is.log=ylog) #---------------------------------------------------------------------# @@ -2145,8 +2162,12 @@ for (place in myplaces){ #----- Plot the box plot. --------------------------------------------# par(mar=c(2,2,4,1)+0.1) #----- Plotting window and grid. -------------------------------------# - plot(x=x.years,y=ed2.median[d,],xlim=xlimit,ylim=ylimit,type="n" - ,main=lesub,xlab="",ylab="",log=plog) + plot.new() + plot.window(xlim=xlimit,ylim=ylimit,log=plog) + axis(side=1) + axis(side=2) + box() + title(main=lesub,xlab="",ylab="") if (plotgrid) grid(col="grey83",lty="solid") #----- Plot the taxon rate with confidence interval. -----------------# epolygon(x=size.poly,col=c(col.sta[2],col.ed2[2]),angle=c(-45,45) @@ -2155,24 +2176,6 @@ for (place in myplaces){ ,col=col.sta[1]) lines(x=x.years,y=ed2.median[d,],type="o",pch=16,lwd=2.0 ,col=col.ed2[1]) - #----- Plot legend. --------------------------------------------------# - if (top && right){ - legend ( x = legpos - , inset = 0.01 - , legend = c("Census","ED-2.2") - , fill = c(col.sta[2],col.ed2[2]) - , border = c(col.sta[2],col.ed2[2]) - , col = c(col.sta[1],col.ed2[1]) - , lwd = 2.0 - , pt.cex = 1.0 - , angle = c(-45,45) - , density = c( 40,40) - , bg = "white" - , ncol = 2 - , title = "(Shaded - 95% C.I.)" - , cex = 1.0 - )#end legend - }#end if #---------------------------------------------------------------------# }#end for (d in 1:n.dbh) #------------------------------------------------------------------------# @@ -2183,8 +2186,8 @@ for (place in myplaces){ # Make the title and axis labels. # #------------------------------------------------------------------------# letitre = paste(desc.rate,": ",lieu,sep="") - ley = paste(desc.rate," [% ",desc.indiv[i],"]",sep="") - lex = "Census" + ley = paste(desc.rate," [% ",desc.indiv[i],"]",sep="") + lex = "Census" #------------------------------------------------------------------------# @@ -2192,9 +2195,10 @@ for (place in myplaces){ #------------------------------------------------------------------------# # Split the plotting window. # #------------------------------------------------------------------------# - mtext(text=lex ,side=1,outer=TRUE) - mtext(text=ley ,side=2,outer=TRUE) - mtext(text=letitre,side=3,outer=TRUE,cex=0.8,font=2) + par(las=0) + mtext(text=lex ,side=1,outer=TRUE,adj=mtext.xadj,padj=mtext.xoff) + mtext(text=ley ,side=2,outer=TRUE,adj=mtext.yadj,padj=mtext.yoff) + mtext(text=letitre,side=3,outer=TRUE,cex=cex.main,font=2) par(par.orig) #------------------------------------------------------------------------# @@ -2228,7 +2232,7 @@ for (place in myplaces){ #=======================================================================================# # Plot the monthly mean variables as functions of other 2 environment variables. # #---------------------------------------------------------------------------------------# - print(paste(" + Plotting parameter space...",sep="")) + cat(" + Plotting parameter space...",sep="","\n") #----- Sizes. --------------------------------------------------------------------------# @@ -2260,7 +2264,7 @@ for (place in myplaces){ yleg = this.y$leg ylog = this.y$log sizetoo = this.y$sizetoo - print(paste(" * Y: ",ydesc,"...")) + cat(" * Y: ",ydesc,"...","\n") #------------------------------------------------------------------------------------# @@ -2283,27 +2287,7 @@ for (place in myplaces){ yvar.plot = ymult * ( pspace[[yplot.name]] + yadd ) yvar.size = ymult * ( pspace[[ysize.name]] + yadd ) ley = paste(ydesc," [",yunit,"]",sep="") - - sel = is.finite(yvar.plot) & ( yvar.plot > 0 | (! ylog)) - ylimit.plot = range(yvar.plot[sel],na.rm=TRUE) - if (ylog) ylimit.plot = log(ylimit.plot) - ylimit.plot[2] = ylimit.plot[2] + scalleg * diff(ylimit.plot) - if (ylog) ylimit.plot = exp(ylimit.plot) - - if (sizetoo){ - ylimit.size = matrix(nrow=n.dbh,ncol=2) - for (d in 1:n.dbh){ - sel = ( is.finite(yvar.size[d,]) - & ( yvar.size[d,] > 0 | (! ylog)) ) - ylimit.size[d,] = range(yvar.size[d,sel],na.rm=TRUE) - if (ylog) ylimit.size[d,] = log(ylimit.size[d,]) - ylimit.size[d,2] = ( ylimit.size[d,2] - + scalleg * diff(ylimit.size[d,]) ) - if (ylog) ylimit.size[d,] = exp(ylimit.size[d,]) - }#end for - }else{ - ylimit.size = ylimit.plot - }#end if + ylimit.plot = pretty.xylim(u=yvar.plot,fracexp=scalleg,is.log=ylog) #------------------------------------------------------------------------------------# @@ -2368,7 +2352,7 @@ for (place in myplaces){ zmult = this.z$mult zcscheme = get(this.z$col.scheme) zlog = this.z$log - print(paste(" ~ X:",xdesc," Z: ",zdesc,"...")) + cat(" ~ X:",xdesc," Z: ",zdesc,"...","\n") #------------------------------------------------------------------------------# @@ -2381,15 +2365,14 @@ for (place in myplaces){ #----- Find the range for the scale. ------------------------------------------# - sel = is.finite(zvar) & ( zvar > 0 | (! zlog) ) - zlimit = range(zvar[sel],na.rm=TRUE) + zlimit = pretty.xylim(u=zvar,fracexp=0.0,is.log=zlog) #------------------------------------------------------------------------------# #----- Title. -----------------------------------------------------------------# letitre.plot = paste(lieu,paste(zdesc,"Plot level",sep=" - "),sep="\n") - letitre.size = paste(lieu,paste(zdesc," - DBH Class:",dbh.names,sep="") - ,sep="\n") + letitre.size = paste(lieu,paste(zdesc,"Size level",sep=" - "),sep="\n") + lesub.size = paste("DBH Class: ",dbh.names,sep="") #------------------------------------------------------------------------------# @@ -2399,34 +2382,12 @@ for (place in myplaces){ #------------------------------------------------------------------------------# - #------------------------------------------------------------------------------# - # Make the list of commands for plot.axes. # - #------------------------------------------------------------------------------# - plot.axes = list() - plot.axes[[1]] = list( x.axis = list(side=1) - , y.axis = list(side=2) - , grid = list(col="grey62",lty="solid") - , legend = list( x = leg.pos - , inset = 0.01 - , legend = pspace$leg.label - , col = "black" - , bg = "white" - , pch = pspace$leg.pch - , title = "Census" - , ncol = 2 - , pt.cex = 1./0.9 - , cex = 0.9 - )#end legend - )#end list - #------------------------------------------------------------------------------# - - #------------------------------------------------------------------------------# # Plot the plot-level. # #------------------------------------------------------------------------------# - print(paste(" > Plot-level...")) + cat(" > Plot-level...","\n") for (o in 1:nout){ #----- Open the file. ------------------------------------------------------# fichier = paste(outyvar,"/plot_x_",xvname,"_y_",yvname @@ -2448,14 +2409,36 @@ for (place in myplaces){ #----- Plot the parameter space. -------------------------------------------# - colourmap(x=xvar.plot,y=yvar.plot,z=zvar - ,xlim=xlimit.plot,ylim=ylimit.plot,zlim=zlimit - ,colour.palette=zcscheme,cex=1.6,pch=this.pch,lwd=3,log=plog - ,plot.title=title(main=letitre.plot,xlab=lex,ylab=ley - ,cex.main=cex.main) - ,key.title=title(main=lez,cex.main=0.8),key.log=zlog - ,plot.axes=plot.axes - )#end colourmap + xyz.plot( x = xvar.plot + , y = yvar.plot + , z = zvar + , fixed.xlim = TRUE + , fixed.ylim = TRUE + , xlim = xlimit.plot + , ylim = ylimit.plot + , zlim = zlimit + , colour.palette = zcscheme + , cex = 1.6 + , pch = this.pch + , xy.log = plog + , xyz.main = list(text=letitre.plot,cex=cex.main) + , xyz.xlab = list(text=lex,adj=mtext.xadj,padj=mtext.xoff) + , xyz.ylab = list(text=ley,adj=mtext.yadj,padj=mtext.yoff) + , key.title = list(main=lez,cex.main=0.8) + , key.log = zlog + , xyz.more = list(grid=list(col="grey62",lty="solid")) + , xyz.legend = list( x = "bottom" + , inset = 0.01 + , legend = pspace$leg.label + , col = "black" + , bg = "white" + , pch = pspace$leg.pch + , title = "Census" + , ncol = 2 + , pt.cex = 1./0.9 + , cex = 0.9 + )#end legend + )#end xyz.plot #---------------------------------------------------------------------------# @@ -2479,91 +2462,85 @@ for (place in myplaces){ # Plot the parameter space for the dbh classes if it is supposed to do so. # #------------------------------------------------------------------------------# if (sizetoo){ + xuse.size = split(x=xvar.size,f=col(xvar.size)) + yuse.size = split(x=yvar.size,f=col(yvar.size)) + pch.size = replicate(n=length(xuse.size),expr=c(this.pch),simplify=FALSE) + #---------------------------------------------------------------------------# - # Loop over DBH classes. # + # Plot the bar plot. # #---------------------------------------------------------------------------# - for (d in 1:n.dbh){ - print(paste(" > DBH class: ",dbh.names[d],"...")) - - #------------------------------------------------------------------------# - # Make the label. # - #------------------------------------------------------------------------# - if (d == 1){ - dbh.low = sprintf("%3.3i",0) - }else{ - dbh.low = sprintf("%3.3i",sta$dbh.breaks[ d]) - }#end if - if (d == n.dbh){ - dbh.high = "Inf" - }else{ - dbh.high = sprintf("%3.3i",sta$dbh.breaks[d+1]) + for (o in 1:nout){ + #----- Open the file. ---------------------------------------------------# + fichier = paste(outyvar,"/size_x_",xvname + ,"_y_",yvname,"_z_",zvname,".",outform[o],sep="") + if(outform[o] == "x11"){ + X11(width=size$width,height=size$height,pointsize=ptsz) + }else if(outform[o] == "png"){ + png(filename=fichier,width=size$width*depth + ,height=size$height*depth + ,pointsize=ptsz,res=depth) + }else if(outform[o] == "eps"){ + postscript(file=fichier,width=size$width,height=size$height + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz + ,paper=size$paper) }#end if - dbh.label = paste(dbh.low,dbh.high,sep="-") #------------------------------------------------------------------------# + #----- Plot the parameter space. ----------------------------------------# + xyz.plot( x = xuse.size + , y = yuse.size + , z = zvar + , fixed.xlim = FALSE + , fixed.ylim = FALSE + , zlim = zlimit + , colour.palette = muitas + , cex = 1.6 + , pch = this.pch + , xy.log = plog + , xyz.main = list(text=letitre.size,cex.main=cex.main) + , xyz.xlab = list(text=lex,adj=mtext.xadj,padj=mtext.xoff) + , xyz.ylab = list(text=ley,adj=mtext.yadj,padj=mtext.yoff) + , key.title = list(main=lez,cex.main=0.8) + , key.log = zlog + , xyz.more = list(grid=list(col="grey62",lty="solid")) + , xyz.legend = list( x = "bottom" + , inset = 0.01 + , legend = pspace$leg.label + , col = "black" + , bg = "white" + , pch = pspace$leg.pch + , title = "Census" + , ncol = 2 + , pt.cex = 1./0.9 + , cex = 0.9 + )#end legend + )#end xyz.plot #------------------------------------------------------------------------# - # Plot the bar plot. # - #------------------------------------------------------------------------# - for (o in 1:nout){ - #----- Open the file. ------------------------------------------------# - fichier = paste(outyvar,"/size",dbh.label,"_x_",xvname - ,"_y_",yvname,"_z_",zvname,".",outform[o],sep="") - if(outform[o] == "x11"){ - X11(width=size$width,height=size$height,pointsize=ptsz) - }else if(outform[o] == "png"){ - png(filename=fichier,width=size$width*depth - ,height=size$height*depth - ,pointsize=ptsz,res=depth) - }else if(outform[o] == "eps"){ - postscript(file=fichier,width=size$width,height=size$height - ,pointsize=ptsz,paper=size$paper) - }else if(outform[o] == "pdf"){ - pdf(file=fichier,onefile=FALSE - ,width=size$width,height=size$height,pointsize=ptsz - ,paper=size$paper) - }#end if - #---------------------------------------------------------------------# - - #----- Plot the parameter space. -------------------------------------# - colourmap(x=xvar.size[d,],y=yvar.size[d,],z=zvar - ,xlim=xlimit.size[d,],ylim=ylimit.size[d,],zlim=zlimit - ,colour.palette=muitas,cex=1.6,pch=this.pch,lwd=3,log=plog - ,plot.title=title(main=letitre.size[d],cex.main=cex.main - ,xlab=lex,ylab=ley) - ,key.title=title(main=lez,cex.main=0.8),key.log=zlog - ,plot.axes=plot.axes - )#end colourmap - #---------------------------------------------------------------------# - - - #---------------------------------------------------------------------# - # Close the device. # - #---------------------------------------------------------------------# - if (outform[o] == "x11"){ - locator(n=1) - dev.off() - }else{ - dev.off() - }#end if - #---------------------------------------------------------------------# - }#end for outform #------------------------------------------------------------------------# - }#end for + # Close the device. # + #------------------------------------------------------------------------# + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + #------------------------------------------------------------------------# + }#end for (o in 1:nout) #---------------------------------------------------------------------------# - }#end if + }#end if (sizetoo) #------------------------------------------------------------------------------# - - }#end for + }#end for (x in 1:nxvar) #---------------------------------------------------------------------------------# - - - - }#end for + }#end for (y in 1:nyvar) #------------------------------------------------------------------------------------# }#end for #---------------------------------------------------------------------------------------# diff --git a/ED/Template/Template/plot_eval_ed.r b/ED/Template/Template/plot_eval_ed.r index a684a7115..503b54528 100644 --- a/ED/Template/Template/plot_eval_ed.r +++ b/ED/Template/Template/plot_eval_ed.r @@ -1,30 +1,53 @@ +#==========================================================================================# +#==========================================================================================# +# Leave these commands at the beginning. They will refresh the session. # +#------------------------------------------------------------------------------------------# rm(list=ls()) +graphics.off() +#==========================================================================================# +#==========================================================================================# -#------------------------------------------------------------------------------------------# -#------------------------------------------------------------------------------------------# + + +#==========================================================================================# +#==========================================================================================# # Here is the user defined variable section. # #------------------------------------------------------------------------------------------# + + +#----- Paths. -----------------------------------------------------------------------------# +here = "thispath" # Current directory. +there = "thatpath" # Directory where analyses/history are +srcdir = "/n/moorcroft_data/mlongo/util/Rsc" # Source directory. +outroot = "thisoutroot" # Directory for figures +#------------------------------------------------------------------------------------------# + + +#----- Time options. ----------------------------------------------------------------------# +monthbeg = thismontha # First month to use +yearbeg = thisyeara # First year to consider +yearend = thisyearz # Maximum year to consider +reload.data = TRUE # Should I reload partially loaded data? +sasmonth.short = c(2,5,8,11) # Months for SAS plots (short runs) +sasmonth.long = 5 # Months for SAS plots (long runs) +nyears.long = 25 # Runs longer than this are considered long runs. #------------------------------------------------------------------------------------------# -here = "thispath" # Current directory. -there = "thatpath" # Directory where analyses/history are -srcdir = "/n/moorcroft_data/mlongo/util/Rsc" # Source directory. -outroot = "thisoutroot" -monthbeg = thismontha -yearbeg = thisyeara # First year to consider -yearend = thisyearz # Maximum year to consider + + + +#----- Name of the simulations. -----------------------------------------------------------# myplaces = c("thispoly") -use.distrib = c("mydistrib") -sasmonth.short = c(2,5,8,11) -sasmonth.long = 5 -nyears.long = 25 -outform = thisoutform # Formats for output file. Supported formats are: +#------------------------------------------------------------------------------------------# + + + +#----- Plot options. ----------------------------------------------------------------------# +outform = thisoutform # Formats for output file. Supported formats are: # - "X11" - for printing on screen # - "eps" - for postscript printing # - "png" - for PNG printing # - "pdf" - for PDF printing -byeold = TRUE # Remove old files of the given format? - depth = 96 # PNG resolution, in pixels per inch paper = "letter" # Paper size, to define the plot shape ptsz = 14 # Font size. @@ -36,7 +59,16 @@ inset = 0.01 # inset distance between legend and edge of plot legbg = "white" # Legend background colour. scalleg = 0.20 cex.main = 0.8 # Scale coefficient for the title +#------------------------------------------------------------------------------------------# + + + +#------ Settings for the model assessment. ------------------------------------------------# +use.distrib = "mydistrib" # Which distribution to use. Valid options are: + # - "norm" -- normal distribution + # - "sn" -- skewed normal distribution + # - "edf" -- empirical distribution function hourblock.len = 3 # Length of the time blocks, in hours # n.quant = 1024 # Number of quantiles to produce the density function. @@ -45,24 +77,45 @@ n.quant = 1024 # Number of quantiles to produce the density fun # distributions will be interpolated). #------------------------------------------------------------------------------------------# + + +#------ Reload the data? ------------------------------------------------------------------# reload.data = TRUE # Reload data? #------------------------------------------------------------------------------------------# + +#------ Miscellaneous settings. -----------------------------------------------------------# +slz.min = -5.0 # The deepest depth that trees access water. +idbh.type = myidbhtype # Type of DBH class + # 1 -- Every 10 cm until 100cm; > 100cm + # 2 -- 0-10; 10-20; 20-35; 35-50; 50-70; > 70 (cm) #------------------------------------------------------------------------------------------# -#------------------------------------------------------------------------------------------# -#------------------------------------------------------------------------------------------# -#------------------------------------------------------------------------------------------# -#------------------------------------------------------------------------------------------# -#------------------------------------------------------------------------------------------# + + + +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# # NO NEED TO CHANGE ANYTHING BEYOND THIS POINT UNLESS YOU ARE DEVELOPING THE CODE... # +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# + + + +#----- Load some packages and scripts. ----------------------------------------------------# +source(file.path(srcdir,"load.everything.r")) #------------------------------------------------------------------------------------------# -#------------------------------------------------------------------------------------------# -#------------------------------------------------------------------------------------------# -#------------------------------------------------------------------------------------------# -#------------------------------------------------------------------------------------------# -#------------------------------------------------------------------------------------------# + + @@ -76,6 +129,7 @@ compvar[[ 1]] = list( vnam = "hflxca" , col.obser = c("grey42","grey21") , col.model = c("orange1","chocolate4") , leg.corner = "topleft" + , sunvar = FALSE )#end list compvar[[ 2]] = list( vnam = "wflxca" , desc = "Water vapour flux" @@ -83,6 +137,7 @@ compvar[[ 2]] = list( vnam = "wflxca" , col.obser = c("grey42","grey21") , col.model = c("deepskyblue","royalblue4") , leg.corner = "topleft" + , sunvar = FALSE )#end list compvar[[ 3]] = list( vnam = "cflxca" , desc = "Carbon dioxide flux" @@ -90,6 +145,7 @@ compvar[[ 3]] = list( vnam = "cflxca" , col.obser = c("grey42","grey21") , col.model = c("chartreuse2","darkgreen") , leg.corner = "bottomright" + , sunvar = FALSE )#end list compvar[[ 4]] = list( vnam = "cflxst" , desc = "Carbon dioxide storage" @@ -97,6 +153,7 @@ compvar[[ 4]] = list( vnam = "cflxst" , col.obser = c("grey42","grey21") , col.model = c("lightgoldenrod3","darkorange1") , leg.corner = "topleft" + , sunvar = FALSE )#end list compvar[[ 5]] = list( vnam = "gpp" , desc = "Gross primary productivity" @@ -104,6 +161,7 @@ compvar[[ 5]] = list( vnam = "gpp" , col.obser = c("grey42","grey21") , col.model = c("green3","darkgreen") , leg.corner = "topleft" + , sunvar = TRUE )#end list compvar[[ 6]] = list( vnam = "reco" , desc = "Ecosystem respiration" @@ -111,6 +169,7 @@ compvar[[ 6]] = list( vnam = "reco" , col.obser = c("grey42","grey21") , col.model = c("yellow3","peru") , leg.corner = "topleft" + , sunvar = FALSE )#end list compvar[[ 7]] = list( vnam = "nep" , desc = "Net ecosystem productivity" @@ -118,6 +177,7 @@ compvar[[ 7]] = list( vnam = "nep" , col.obser = c("grey42","grey21") , col.model = c("olivedrab2","darkolivegreen4") , leg.corner = "topleft" + , sunvar = FALSE )#end list compvar[[ 8]] = list( vnam = "nee" , desc = "Net ecosystem exchange" @@ -125,6 +185,7 @@ compvar[[ 8]] = list( vnam = "nee" , col.obser = c("grey42","grey21") , col.model = c("chartreuse","chartreuse4") , leg.corner = "bottomright" + , sunvar = FALSE )#end list compvar[[ 9]] = list( vnam = "ustar" , desc = "Friction velocity" @@ -132,6 +193,7 @@ compvar[[ 9]] = list( vnam = "ustar" , col.obser = c("grey42","grey21") , col.model = c("mediumpurple1","purple4") , leg.corner = "topleft" + , sunvar = FALSE )#end list compvar[[10]] = list( vnam = "rlongup" , desc = "Outgoing longwave radiation" @@ -139,6 +201,7 @@ compvar[[10]] = list( vnam = "rlongup" , col.obser = c("grey42","grey21") , col.model = c("gold","orangered") , leg.corner = "topleft" + , sunvar = FALSE )#end list compvar[[11]] = list( vnam = "rnet" , desc = "Net radiation" @@ -146,6 +209,7 @@ compvar[[11]] = list( vnam = "rnet" , col.obser = c("grey42","grey21") , col.model = c("gold","orangered") , leg.corner = "topleft" + , sunvar = FALSE )#end list compvar[[12]] = list( vnam = "albedo" , desc = "Albedo" @@ -153,6 +217,7 @@ compvar[[12]] = list( vnam = "albedo" , col.obser = c("grey42","grey21") , col.model = c("orange1","chocolate4") , leg.corner = "topleft" + , sunvar = TRUE )#end list compvar[[13]] = list( vnam = "parup" , desc = "Outgoing PAR" @@ -160,6 +225,7 @@ compvar[[13]] = list( vnam = "parup" , col.obser = c("grey42","grey21") , col.model = c("chartreuse","chartreuse4") , leg.corner = "topleft" + , sunvar = TRUE )#end list compvar[[14]] = list( vnam = "rshortup" , desc = "Outgoing SW" @@ -167,28 +233,11 @@ compvar[[14]] = list( vnam = "rshortup" , col.obser = c("grey42","grey21") , col.model = c("deepskyblue","royalblue3") , leg.corner = "topleft" + , sunvar = TRUE )#end list #------------------------------------------------------------------------------------------# - -#----- Load some packages. ----------------------------------------------------------------# -library(hdf5) -library(chron) -library(scatterplot3d) -library(lattice) -library(maps) -library(mapdata) -library(akima) -library(sn) -#------------------------------------------------------------------------------------------# - - -#----- In case there is some graphic still opened. ----------------------------------------# -graphics.off() -#------------------------------------------------------------------------------------------# - - #----- Set how many formats we must output. -----------------------------------------------# outform = tolower(outform) nout = length(outform) @@ -205,34 +254,6 @@ options(locatorBell=FALSE) #------------------------------------------------------------------------------------------# -#----- Load some files with functions. ----------------------------------------------------# -source(paste(srcdir,"atlas.r" ,sep="/")) -source(paste(srcdir,"charutils.r" ,sep="/")) -source(paste(srcdir,"census.r" ,sep="/")) -source(paste(srcdir,"cloudy.r" ,sep="/")) -source(paste(srcdir,"epolygon.r" ,sep="/")) -source(paste(srcdir,"error.bar.r" ,sep="/")) -source(paste(srcdir,"globdims.r" ,sep="/")) -source(paste(srcdir,"locations.r" ,sep="/")) -source(paste(srcdir,"muitas.r" ,sep="/")) -source(paste(srcdir,"numutils.r" ,sep="/")) -source(paste(srcdir,"plotsize.r" ,sep="/")) -source(paste(srcdir,"pretty.log.r" ,sep="/")) -source(paste(srcdir,"pretty.time.r" ,sep="/")) -source(paste(srcdir,"qapply.r" ,sep="/")) -source(paste(srcdir,"rconstants.r" ,sep="/")) -source(paste(srcdir,"skewnorm.stats.r" ,sep="/")) -source(paste(srcdir,"soilutils.r" ,sep="/")) -source(paste(srcdir,"sombreado.r" ,sep="/")) -source(paste(srcdir,"southammap.r" ,sep="/")) -source(paste(srcdir,"thermlib.r" ,sep="/")) -source(paste(srcdir,"timeutils.r" ,sep="/")) -source(paste(srcdir,"zen.r" ,sep="/")) -#----- These should be called after the others. -------------------------------------------# -source(paste(srcdir,"pft.coms.r" ,sep="/")) -#------------------------------------------------------------------------------------------# - - #----- Load observations. -----------------------------------------------------------------# obser.file = paste(srcdir,"LBA_MIP.nogapfill.RData",sep="/") @@ -295,7 +316,9 @@ for (place in myplaces){ obs.name = paste("obs.",iata,sep="") }#end if #---------------------------------------------------------------------------------------# - + + + #---------------------------------------------------------------------------------------# # We only run this part of the code if there are observations to compare with the # @@ -477,10 +500,6 @@ for (place in myplaces){ #------------------------------------------------------------------------------------# # Find out how many diel and seasonal blocks to create. # #------------------------------------------------------------------------------------# - myseasons = sort(unique(obser$yr.idx)) - nseasons = length(myseasons) - ss.name = paste(sprintf("%2.2i",myseasons),season.list[myseasons],sep="-") - ss.title = season.full[myseasons] mydiel = sort(unique(obser$hr.idx)) ndiel = length(mydiel) hr.end = seq(from=hourblock.len,to=day.hr,by=hourblock.len) %% day.hr @@ -500,11 +519,13 @@ for (place in myplaces){ # Select the data points for which we have observations, then fit the light # # response curve to both observed and modelled GPP. # #---------------------------------------------------------------------------------# - sel = ( obser$yr.idx == myseasons[s] & is.finite(obser$gpp) - & (is.finite(obser$par) & obser$daytime) ) + s.sel = obser$yr.idx == s | s == nseasons + sel = s.sel & is.finite(obser$gpp) & is.finite(obser$par) & obser$highsun + #---------------------------------------------------------------------------------# + #---------------------------------------------------------------------------------# - # Make sure there are some points. # + # Make sure there are at least a few points. # #---------------------------------------------------------------------------------# if (sum(sel) > 10){ @@ -576,7 +597,7 @@ for (place in myplaces){ #------------------------------------------------------------------------------# for (o in 1:nout){ #----- Make the file name. -------------------------------------------------# - fichier = paste(outlight,"/gpp_light","-",ss.name[s],"-",suffix,"." + fichier = paste(outlight,"/gpp_light","-",season.label[s],"-",suffix,"." ,outform[o],sep="") if (outform[o] == "x11"){ X11(width=size$width,height=size$height,pointsize=ptsz) @@ -598,7 +619,7 @@ for (place in myplaces){ # Set up the title and axes labels. # #---------------------------------------------------------------------------# letitre = paste(lieu,"\n Polygon-level light response curve - " - ,ss.title[s],sep="") + ,season.full[s],sep="") lex = paste("Photosynthetically Active Radiation [umol/m2/s]") ley = paste("Gross Primary Productivity [umol/m2/s]") #---------------------------------------------------------------------------# @@ -665,6 +686,7 @@ for (place in myplaces){ col.obser = this.comp$col.obser col.model = this.comp$col.model leg.corner = this.comp$leg.corner + sunvar = this.comp$sunvar #---------------------------------------------------------------------------------# # Grab the variables that we are going to use now. # @@ -682,29 +704,38 @@ for (place in myplaces){ #---------------------------------------------------------------------------------# comp = list() mat = matrix( data = NA - , nrow = ndiel+3 + , nrow = ndiel+4 , ncol = nseasons - , dimnames = list( c(dl.name,"night","rise.set","day") - , ss.name + , dimnames = list( c(dl.name,"night","rise.set","day" + ,"all.hrs") + , season.label )#end list )#end matrix arr = array ( data = NA - , dim = c(ndiel+3,nseasons,4) - , dimnames = list( c(dl.name,"night","rise.set","day") - , ss.name + , dim = c(ndiel+4,nseasons,4) + , dimnames = list( c(dl.name,"night","rise.set","day" + ,"all.hrs") + , season.label , c("mean","variance" ,"skewness","kurtosis") ) )#end array comp$n = mat + comp$residuals = rep(NA,times=length(this.obser)) comp$bias = mat comp$rmse = mat + comp$r.squared = mat + comp$fvue = mat + comp$sw.stat = mat + comp$sw.p.value = mat comp$ks.stat = mat comp$ks.p.value = mat + comp$lsq.lnlike = mat comp$sn.lnlike = mat comp$norm.lnlike = mat comp$obs.moment = arr comp$mod.moment = arr + comp$res.moment = arr #---------------------------------------------------------------------------------# @@ -725,51 +756,71 @@ for (place in myplaces){ # Season block. # #---------------------------------------------------------------------------------# for (s in 1:nseasons){ - cat(" # Season: ",ss.name[s],"...","\n") + #------------------------------------------------------------------------------# + # Select the season. # + #------------------------------------------------------------------------------# + cat(" # Season: ",season.full[s],"...","\n") + sel.season = obser$yr.idx == s | s == nseasons + #------------------------------------------------------------------------------# + + bp.list = list() #----- These lists will contain the data for the box plot. --------------------# ylimit.bp = NULL #------------------------------------------------------------------------------# # Diel block. # #------------------------------------------------------------------------------# - for (d in 1:(ndiel+3)){ + for (d in 1:(ndiel+4)){ #---------------------------------------------------------------------------# # Select the period of the day to plot. # #---------------------------------------------------------------------------# if (d <= ndiel){ cat(" ~ Hour: ",dl.name[d]," UTC...","\n") - sel = ( this.measured & obser$yr.idx == myseasons[s] - & obser$hr.idx == mydiel [d] ) + sel.diel = obser$hr.idx == mydiel [d] diel.label = paste("hr",dl.name[d],sep="_") diel.desc = paste("Hours: ",dl.name[d]," UTC",sep="") }else if (d == ndiel+1){ cat(" ~ Night time...","\n") - sel = ( this.measured & obser$yr.idx == myseasons[s] - & obser$nighttime ) + sel.diel = obser$nighttime diel.label = paste("night") diel.desc = paste("Nighttime",sep="") }else if (d == ndiel+2){ cat(" ~ Sunrise/sunset time...","\n") - sel = ( this.measured & obser$yr.idx == myseasons[s] - & obser$riseset ) + sel.diel = obser$riseset diel.label = paste("riseset") diel.desc = paste("Sunrise/sunset time",sep="") }else if (d == ndiel+3){ cat(" ~ Day time...","\n") - sel = ( this.measured & obser$yr.idx == myseasons[s] - & obser$highsun ) + sel.diel = obser$highsun diel.label = paste("day") diel.desc = paste("Daytime",sep="") + }else if (d == ndiel+4){ + cat(" ~ 24 hours...","\n") + sel.diel = rep(TRUE,times=length(obser$hr.idx)) + diel.label = paste("allhrs") + diel.desc = paste("All hours",sep="") }#end if - n.sel = sel #---------------------------------------------------------------------------# + #---------------------------------------------------------------------------# + # Correct sel in case this is a "Sun" variable. We only check Sun # + # variables during daytime. # + #---------------------------------------------------------------------------# + if (sunvar){ + sel.sun = obser$daytime + }else{ + sel.sun = rep(TRUE,times=length(obser$daytime)) + }#end if + #---------------------------------------------------------------------------# + + #---------------------------------------------------------------------------# # Number of observations that we use to build the comparison metrics. # #---------------------------------------------------------------------------# + sel = sel.season & sel.diel & sel.sun & this.measured n.sel = sel #---------------------------------------------------------------------------# @@ -777,7 +828,7 @@ for (place in myplaces){ #---------------------------------------------------------------------------# - # Find the skewed normal distribution of the observed quantities. # + # Find the statistics of the observed quantities. # #---------------------------------------------------------------------------# if (any(sel)){ #------------------------------------------------------------------------# @@ -797,6 +848,12 @@ for (place in myplaces){ #----- Find and plot the distribution function for this hour. -----------# sd.obser = sd(this.obser[sel],na.rm=TRUE) if (is.finite(sd.obser) && sd.obser > 1.0e-6){ + #----- Find the residuals. -------------------------------------------# + this.resid = this.obser - this.model + comp$residuals[sel] = this.resid[sel] + #---------------------------------------------------------------------# + + #---------------------------------------------------------------------# # Find multiple statistics that may be used for finding the # # support function. # @@ -817,6 +874,14 @@ for (place in myplaces){ m.sdev = sd (this.model[sel],na.rm=TRUE) m.skew = skew (this.model[sel],na.rm=TRUE) m.kurt = kurt (this.model[sel],na.rm=TRUE) + r.location = sn.location(this.resid[sel],na.rm=TRUE) + r.scale = sn.scale (this.resid[sel],na.rm=TRUE) + r.shape = sn.shape (this.resid[sel],na.rm=TRUE) + r.mean = mean (this.resid[sel],na.rm=TRUE) + r.vari = var (this.resid[sel],na.rm=TRUE) + r.sdev = sd (this.resid[sel],na.rm=TRUE) + r.skew = skew (this.resid[sel],na.rm=TRUE) + r.kurt = kurt (this.resid[sel],na.rm=TRUE) #---------------------------------------------------------------------# @@ -879,19 +944,31 @@ for (place in myplaces){ #---------------------------------------------------------------------# - # Find the mean bias and the root mean square error, and the # - # four moments of the distribution for both observations and model. # + # Find the mean bias, the root mean square error, the coeffi- # + # cient of determination, and the fraction of variance unexplained # + # for this simulation. # #---------------------------------------------------------------------# - comp$bias [d,s ] = bias( x = this.model[sel] - , xexp = this.obser[sel] - , absval = FALSE - )#end bias - comp$rmse [d,s ] = rmse( x = this.model[sel] - , xexp = this.obser[sel] - , absval = FALSE - )#end rmse - comp$obs.moment[d,s,] = c(o.mean,o.vari,o.skew,o.kurt) + goodness = test.goodness ( x.mod = this.model[sel] + , x.obs = this.obser[sel] + , n.parameters = NULL + )#end test.goodness + comp$bias [d,s ] = goodness$bias + comp$rmse [d,s ] = goodness$rmse + comp$lsq.lnlike[d,s ] = goodness$lsq.lnlike + comp$r.squared [d,s ] = goodness$r.squared + comp$fvue [d,s ] = goodness$fvue + comp$sw.stat [d,s ] = goodness$sw.statistic + comp$sw.pvalue [d,s ] = goodness$sw.pvalue + #---------------------------------------------------------------------# + + + #---------------------------------------------------------------------# + # Find the first four moments of the distribution for # + # observations, model, and residuals. # + #---------------------------------------------------------------------# + comp$obs.moment[d,s,] = c(o.mean,o.vari,o.skew,o.kurt) comp$mod.moment[d,s,] = c(m.mean,m.vari,m.skew,m.kurt) + comp$res.moment[d,s,] = c(r.mean,r.vari,r.skew,r.kurt) #---------------------------------------------------------------------# @@ -902,19 +979,12 @@ for (place in myplaces){ xbreaks = pretty(qlimit,n=20) freq.obser = hist(this.obser[sel],breaks=xbreaks,plot=FALSE)$density freq.model = hist(this.model[sel],breaks=xbreaks,plot=FALSE)$density - ylimit = range(c(dfunc.obser,dfunc.model,freq.obser,freq.model)) - if ( any(! is.finite(ylimit)) - || (ylimit[1] == ylimit[2] && ylimit[1] == 0)){ - ylimit = c(-1,1) - }else if (ylimit[1] == ylimit[2] ){ - ylimit[1] = ylimit[1] * ( 1. - sign(ylimit[1]) * ylnudge) - ylimit[2] = ylimit[2] * ( 1. + sign(ylimit[2]) * ylnudge) - }else{ - ylimit[2] = ylimit[2] + scalleg * (ylimit[2] - ylimit[1]) - }#end if + yrange = c(dfunc.obser,dfunc.model,freq.obser,freq.model) + ylimit = pretty.xylim(u=yrange,fracexp=scalleg,is.log=FALSE) #---------------------------------------------------------------------# + #---------------------------------------------------------------------# # Create edges for the histogram rectangles (we use rect instead # # of hist for histograms because we cannot control the line width in # @@ -933,8 +1003,9 @@ for (place in myplaces){ #---------------------------------------------------------------------# for (o in 1:nout){ #----- Make the file name. ----------------------------------------# - fichier = paste(outpdfvar,"/histcomp_",this.vnam,"-",ss.name[s] - ,"-",diel.label,"-",suffix,".",outform[o],sep="") + fichier = paste(outpdfvar,"/histcomp_",this.vnam,"-" + ,season.label[s],"-",diel.label,"-",suffix,"." + ,outform[o],sep="") if (outform[o] == "x11"){ X11(width=size$width,height=size$height,pointsize=ptsz) }else if(outform[o] == "png"){ @@ -955,7 +1026,7 @@ for (place in myplaces){ #------------------------------------------------------------------# # Set up the title and axes labels. # #------------------------------------------------------------------# - letitre = paste(lieu,"\n",this.desc," - ",ss.title[s] + letitre = paste(lieu,"\n",this.desc," - ",season.full[s] ," - ",diel.desc,sep="") lex = paste(this.desc,this.unit,sep=" ") ley = "Density function [ ]" @@ -1027,7 +1098,7 @@ for (place in myplaces){ #---------------------------------------------------------------------# for (o in 1:nout){ #----- Make the file name. ----------------------------------------# - fichier = paste(outqqpvar,"/qqplot_",this.vnam,"-",ss.name[s] + fichier = paste(outqqpvar,"/qqplot_",this.vnam,"-",season.label[s] ,"-",diel.label,"-",suffix,".",outform[o],sep="") if (outform[o] == "x11"){ X11(width=size$width,height=size$height,pointsize=ptsz) @@ -1050,7 +1121,7 @@ for (place in myplaces){ # Set up the title and axes labels. # #------------------------------------------------------------------# letitre = paste(lieu,"\n","QQ Plot for ",this.desc - ," - ",ss.title[s]," - ",diel.desc,sep="") + ," - ",season.full[s]," - ",diel.desc,sep="") lex = paste("Observations",this.unit,sep=" ") ley = paste("Model",this.unit,sep=" ") #------------------------------------------------------------------# @@ -1089,7 +1160,7 @@ for (place in myplaces){ }#end if (any(sel)) #---------------------------------------------------------------------------# - }#end for (d in 1:(ndiel+3)) + }#end for (d in 1:(ndiel+4)) #------------------------------------------------------------------------------# @@ -1100,8 +1171,8 @@ for (place in myplaces){ if (length(bp.list) > 0){ for (o in 1:nout){ #----- Make the file name. ----------------------------------------------# - fichier = paste(outboxvar,"/bpcomp_",this.vnam,"-",ss.name[s],"-",suffix - ,".",outform[o],sep="") + fichier = paste(outboxvar,"/bpcomp_",this.vnam,"-",season.label[s] + ,"-",suffix,".",outform[o],sep="") if (outform[o] == "x11"){ X11(width=size$width,height=size$height,pointsize=ptsz) }else if(outform[o] == "png"){ @@ -1120,16 +1191,7 @@ for (place in myplaces){ #----- Set up some plot defaults. ---------------------------------------# xlimit = c(0,2*ndiel) - ylimit = range(bp.list) - if ( any(! is.finite(ylimit)) - || (ylimit[1] == ylimit[2] && ylimit[1] == 0)){ - ylimit = c(-1,1) - }else if (ylimit[1] == ylimit[2] ){ - ylimit[1] = ylimit[1] * ( 1. - sign(ylimit[1]) * ylnudge) - ylimit[2] = ylimit[2] * ( 1. + sign(ylimit[2]) * ylnudge) - }else{ - ylimit[2] = ylimit[2] + scalleg * (ylimit[2] - ylimit[1]) - }#end if + ylimit = pretty.xylim(u=bp.list,fracexp=scalleg,is.log=FALSE) bpcolour = rep(c(col.obser[1],col.model[1]),times=ndiel) xat = seq(from=1.5,to=2*ndiel-0.5,by=2) xgrid = seq(from=0.5,to=2*ndiel+0.5,by=2) @@ -1138,7 +1200,7 @@ for (place in myplaces){ #----- Set up the title and axes labels. --------------------------------# - letitre = paste(lieu,"\n",this.desc," - ",ss.title[s],sep="") + letitre = paste(lieu,"\n",this.desc," - ",season.full[s],sep="") lex = paste(hourblock.len,"-hour period [UTC]",sep="") ley = paste(this.desc,this.unit,sep=" ") #------------------------------------------------------------------------# diff --git a/ED/Template/Template/plot_monthly.r b/ED/Template/Template/plot_monthly.r index a8c44a8a7..269095524 100644 --- a/ED/Template/Template/plot_monthly.r +++ b/ED/Template/Template/plot_monthly.r @@ -1,114 +1,137 @@ -#----- Here is the user-defined variable section. -----------------------------------------# -here = "thispath" # Current directory. -there = "thatpath" # Directory where analyses/history are -srcdir = "/n/moorcroft_data/mlongo/util/Rsc" # Source directory. -outroot = "thisoutroot" -monthbeg = thismontha -yearbeg = thisyeara # First year to consider -yearend = thisyearz # Maximum year to consider -myplaces = c("thispoly") -sasmonth.short = c(2,5,8,11) -sasmonth.long = 5 -nyears.long = 25 -outform = thisoutform # Formats for output file. Supported formats are: - # - "X11" - for printing on screen - # - "eps" - for postscript printing - # - "png" - for PNG printing - # - "pdf" - for PDF printing - -byeold = TRUE # Remove old files of the given format? - -depth = 96 # PNG resolution, in pixels per inch -paper = "letter" # Paper size, to define the plot shape -ptsz = 14 # Font size. -lwidth = 2.5 # Line width -plotgrid = TRUE # Should I plot the grid in the background? - -sasfixlimits = FALSE # Should I use a fixed scale for size and age-structure - # plots? (FALSE will set a suitable scale for each year) - -ncolsfc = 200 # Target number of colours for filled contour plots. -fcgrid = TRUE # Should I include a grid on the filled contour plots? - -ncolshov = 200 # Target number of colours for Hovmoller diagrams. -hovgrid = TRUE # Should I include a grid on the Hovmoller plots? - -legwhere = "topleft" # Where should I place the legend? -inset = 0.01 # inset distance between legend and edge of plot region. -legbg = "white" # Legend background colour. -scalleg = 0.20 -cex.main = 0.8 # Scale coefficient for the title -slz.min = -5.0 # Find the deepest depth that trees access water. - -theta = 315. # Azimuth for perspective projection -phi = 30. # Vertical angle for perspective projection -ltheta = -210. # Azimuth angle for light -shade = 0.125 # Shade intensity -expz = 0.5 # Expansion factor for Z axis -gcol = c("lightblue","white") # Colours for the 50's style floor -cexmin = 0.5 # Minimum "head" size of the lollipop -cexmax = 3.0 # Maximum "head" size of the lollipop - -ylnudge = 0.05 # Nudging factor for ylimit -ptype = "l" # Type of plot -ptyped = "p" # Type of plot -ptypeb = "o" # Type of plot - -tserdist = TRUE # Time series of disturbance rates - -drought.mark = mydroughtmark -drought.yeara = mydroughtyeara -drought.yearz = mydroughtyearz -months.drought = mymonthsdrought - -#----- Loading some packages. -------------------------------------------------------------# -library(hdf5) -library(chron) -library(scatterplot3d) -library(lattice) -library(maps) -library(mapdata) -library(akima) -library(Hmisc) - -#----- In case there is some graphic still opened. ----------------------------------------# +#==========================================================================================# +#==========================================================================================# +# Leave these commands at the beginning. They will refresh the session. # +#------------------------------------------------------------------------------------------# +rm(list=ls()) graphics.off() +#==========================================================================================# +#==========================================================================================# + + + +#==========================================================================================# +#==========================================================================================# +# Here is the user defined variable section. # +#------------------------------------------------------------------------------------------# + +#----- Paths. -----------------------------------------------------------------------------# +here = "thispath" # Current directory. +there = "thatpath" # Directory where analyses/history are +srcdir = "/n/moorcroft_data/mlongo/util/Rsc" # Source directory. +outroot = "thisoutroot" # Directory for figures +#------------------------------------------------------------------------------------------# + + +#----- Time options. ----------------------------------------------------------------------# +monthbeg = thismontha # First month to use +yearbeg = thisyeara # First year to consider +yearend = thisyearz # Maximum year to consider +reload.data = TRUE # Should I reload partially loaded data? +sasmonth.short = c(2,5,8,11) # Months for SAS plots (short runs) +sasmonth.long = 5 # Months for SAS plots (long runs) +nyears.long = 25 # Runs longer than this are considered long runs. +#------------------------------------------------------------------------------------------# + + + +#----- Name of the simulations. -----------------------------------------------------------# +myplaces = c("thispoly") +#------------------------------------------------------------------------------------------# + + + +#----- Plot options. ----------------------------------------------------------------------# +outform = thisoutform # Formats for output file. Supported formats are: + # - "X11" - for printing on screen + # - "eps" - for postscript printing + # - "png" - for PNG printing + # - "pdf" - for PDF printing +depth = 96 # PNG resolution, in pixels per inch +paper = "letter" # Paper size, to define the plot shape +ptsz = 14 # Font size. +lwidth = 2.5 # Line width +plotgrid = TRUE # Should I plot the grid in the background? +sasfixlimits = FALSE # Use a fixed scale for size and age-structure + # plots? (FALSE will set a suitable scale for + # each plot) +ncolsfc = 200 # Target number of colours for filled contour. +fcgrid = TRUE # Include a grid on the filled contour plots? +ncolshov = 200 # Target number of colours for Hovmoller diagrams. +hovgrid = TRUE # Include a grid on the Hovmoller plots? +legwhere = "topleft" # Where should I place the legend? +inset = 0.01 # Inset between legend and edge of plot region. +legbg = "white" # Legend background colour. +scalleg = 0.40 # Expand y limits by this relative amount to fit + # the legend +cex.main = 0.8 # Scale coefficient for the title +theta = 315. # Azimuth for perspective projection +phi = 30. # Vertical angle for perspective projection +ltheta = -210. # Azimuth angle for light +shade = 0.125 # Shade intensity +expz = 0.5 # Expansion factor for Z axis +gcol = c("lightblue","white") # Colours for the fifties style floor +cexmin = 0.5 # Minimum "head" size of the lollipop +cexmax = 3.0 # Maximum "head" size of the lollipop +ylnudge = 0.05 # Nudging factor for ylimit +ptype = "l" # Type of plot +ptyped = "p" # Type of plot +ptypeb = "o" # Type of plot +drought.mark = mydroughtmark # Put a background to highlight droughts? +drought.yeara = mydroughtyeara # First year that has drought +drought.yearz = mydroughtyearz # Last year that has drought +months.drought = mymonthsdrought # Months with drought +#------------------------------------------------------------------------------------------# + + +#------ Miscellaneous settings. -----------------------------------------------------------# +slz.min = -5.0 # The deepest depth that trees access water. +idbh.type = myidbhtype # Type of DBH class + # 1 -- Every 10 cm until 100cm; > 100cm + # 2 -- 0-10; 10-20; 20-35; 35-50; 50-70; > 70 (cm) +#------------------------------------------------------------------------------------------# + + + +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# +# NO NEED TO CHANGE ANYTHING BEYOND THIS POINT UNLESS YOU ARE DEVELOPING THE CODE... # +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# + + + +#----- Loading some packages and scripts. -------------------------------------------------# +source(file.path(srcdir,"load.everything.r")) +#------------------------------------------------------------------------------------------# + + #----- Set how many formats we must output. -----------------------------------------------# outform = tolower(outform) -nout = length(outform) +nout = length (outform) +#------------------------------------------------------------------------------------------# + #----- Avoid unecessary and extremely annoying beeps. -------------------------------------# options(locatorBell=FALSE) +#------------------------------------------------------------------------------------------# -#----- Load some files with functions. ----------------------------------------------------# -source(paste(srcdir,"atlas.r" ,sep="/")) -source(paste(srcdir,"charutils.r" ,sep="/")) -source(paste(srcdir,"census.r" ,sep="/")) -source(paste(srcdir,"cloudy.r" ,sep="/")) -source(paste(srcdir,"error.bar.r" ,sep="/")) -source(paste(srcdir,"globdims.r" ,sep="/")) -source(paste(srcdir,"locations.r" ,sep="/")) -source(paste(srcdir,"muitas.r" ,sep="/")) -source(paste(srcdir,"plotsize.r" ,sep="/")) -source(paste(srcdir,"pmonthly_varlist.r",sep="/")) -source(paste(srcdir,"pretty.log.r" ,sep="/")) -source(paste(srcdir,"pretty.time.r" ,sep="/")) -source(paste(srcdir,"qapply.r" ,sep="/")) -source(paste(srcdir,"rconstants.r" ,sep="/")) -source(paste(srcdir,"soilutils.r" ,sep="/")) -source(paste(srcdir,"sombreado.r" ,sep="/")) -source(paste(srcdir,"southammap.r" ,sep="/")) -source(paste(srcdir,"thermlib.r" ,sep="/")) -source(paste(srcdir,"timeutils.r" ,sep="/")) -#----- These should be called after the others. --------------------------------------------# -source(paste(srcdir,"pft.coms.r" ,sep="/")) - #----- Load observations. -----------------------------------------------------------------# obsrfile = paste(srcdir,"LBA_MIP.v8.RData",sep="/") load(file=obsrfile) +#------------------------------------------------------------------------------------------# + + #----- Define plot window size ------------------------------------------------------------# size = plotsize(proje=FALSE,paper=paper) @@ -139,257 +162,73 @@ for (place in myplaces){ yeara = thispoi$yeara yearz = thispoi$yearz meszz = thispoi$monz + #---------------------------------------------------------------------------------------# + + + + #----- Create the directories in case they don't exist. --------------------------------# + if (! file.exists(outmain)) dir.create(outmain) + if (! file.exists(outpref)) dir.create(outpref) + #---------------------------------------------------------------------------------------# + + #----- Decide how frequently the cohort-level variables should be saved. ---------------# - if (yearz - yeara + 1 <= nyears.long){ + if (yearend - yearbeg + 1 <= nyears.long){ sasmonth = sasmonth.short }else{ sasmonth = sasmonth.long }#end if + #---------------------------------------------------------------------------------------# - #----- Create the directories in case they don't exist. --------------------------------# - if (! file.exists(outmain)) dir.create(outmain) - if (! file.exists(outpref)) dir.create(outpref) + #---------------------------------------------------------------------------------------# + # Find the total number of months that can be loaded this time. # + #---------------------------------------------------------------------------------------# + ntimes = (yearz-yeara-1)*12+meszz+(12-monthbeg+1) + #---------------------------------------------------------------------------------------# + + #----- Print a banner to entretain the user. -------------------------------------------# - print(paste(" + Post-processing output from ",lieu,"...",sep="")) - - - #---------------------------------------------------------------------------------------# - # Flush all variables that will hold the data. # - #---------------------------------------------------------------------------------------# - totmon = (yearz-yeara-1)*12+meszz+(12-monthbeg+1) - #----- Size (DBH) and age arrays. ------------------------------------------------------# - agbpftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) - laipftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) - waipftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) - taipftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) - gpppftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) - npppftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) - mcopftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) - cbapftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) - cbalightpftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) - cbamoistpftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) - cbarelpftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) - ldrpftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) - fsopftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) - demandpftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) - supplypftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) - nplantpftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) - mortpftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) - agemortpftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) - ncbmortpftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) - tfallmortpftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) - coldmortpftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) - distmortpftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) - growthpftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) - #----- PFT arrays. The "+1" column contains the total. -------------------------------# - agbpft = matrix(data=0,nrow=totmon,ncol=npft+1) - bseedspft = matrix(data=0,nrow=totmon,ncol=npft+1) - nplantpft = matrix(data=0,nrow=totmon,ncol=npft+1) - laipft = matrix(data=0,nrow=totmon,ncol=npft+1) - waipft = matrix(data=0,nrow=totmon,ncol=npft+1) - taipft = matrix(data=0,nrow=totmon,ncol=npft+1) - gpppft = matrix(data=0,nrow=totmon,ncol=npft+1) - npppft = matrix(data=0,nrow=totmon,ncol=npft+1) - mcopft = matrix(data=0,nrow=totmon,ncol=npft+1) - cbapft = matrix(data=0,nrow=totmon,ncol=npft+1) - cbalightpft = matrix(data=0,nrow=totmon,ncol=npft+1) - cbamoistpft = matrix(data=0,nrow=totmon,ncol=npft+1) - cbarelpft = matrix(data=0,nrow=totmon,ncol=npft+1) - ldroppft = matrix(data=0,nrow=totmon,ncol=npft+1) - fsopft = matrix(data=0,nrow=totmon,ncol=npft+1) - balivepft = matrix(data=0,nrow=totmon,ncol=npft+1) - bdeadpft = matrix(data=0,nrow=totmon,ncol=npft+1) - bleafpft = matrix(data=0,nrow=totmon,ncol=npft+1) - brootpft = matrix(data=0,nrow=totmon,ncol=npft+1) - bswoodpft = matrix(data=0,nrow=totmon,ncol=npft+1) - bstorepft = matrix(data=0,nrow=totmon,ncol=npft+1) - basareapft = matrix(data=0,nrow=totmon,ncol=npft+1) - leafresppft = matrix(data=0,nrow=totmon,ncol=npft+1) - rootresppft = matrix(data=0,nrow=totmon,ncol=npft+1) - growthresppft = matrix(data=0,nrow=totmon,ncol=npft+1) - mortpft = matrix(data=0,nrow=totmon,ncol=npft+1) - agemortpft = matrix(data=0,nrow=totmon,ncol=npft+1) - ncbmortpft = matrix(data=0,nrow=totmon,ncol=npft+1) - tfallmortpft = matrix(data=0,nrow=totmon,ncol=npft+1) - coldmortpft = matrix(data=0,nrow=totmon,ncol=npft+1) - distmortpft = matrix(data=0,nrow=totmon,ncol=npft+1) - recrpft = matrix(data=0,nrow=totmon,ncol=npft+1) - growthpft = matrix(data=0,nrow=totmon,ncol=npft+1) - censusnplantpft = matrix(data=0,nrow=totmon,ncol=npft+1) - censuslaipft = matrix(data=0,nrow=totmon,ncol=npft+1) - censuswaipft = matrix(data=0,nrow=totmon,ncol=npft+1) - censustaipft = matrix(data=0,nrow=totmon,ncol=npft+1) - censusagbpft = matrix(data=0,nrow=totmon,ncol=npft+1) - censusbapft = matrix(data=0,nrow=totmon,ncol=npft+1) - - - - #----- LU arrays. The "+1" column contains the total. --------------------------------# - agblu = matrix(data=0,nrow=totmon,ncol=nlu+1) - lailu = matrix(data=0,nrow=totmon,ncol=nlu+1) - gpplu = matrix(data=0,nrow=totmon,ncol=nlu+1) - npplu = matrix(data=0,nrow=totmon,ncol=nlu+1) - arealu = matrix(data=0,nrow=totmon,ncol=nlu+1) - basarealu = matrix(data=0,nrow=totmon,ncol=nlu+1) - #----- Miscellaneous arrays. -----------------------------------------------------------# - dist = array(NA,dim=c(totmon,nlu,nlu)) - #----- Polygon level vectors. ----------------------------------------------------------# - fast.soil.c = NULL - slow.soil.c = NULL - struct.soil.c = NULL - gpp = NULL - npp = NULL - plresp = NULL - leaf.resp = NULL - root.resp = NULL - growth.resp = NULL - hetresp = NULL - cwdresp = NULL - reco = NULL - mco = NULL - npp = NULL - cba = NULL - cbalight = NULL - cbamoist = NULL - cbarel = NULL - ldrop = NULL - nep = NULL - nee = NULL - cflxca = NULL - cflxst = NULL - evap = NULL - transp = NULL - ustar = NULL - atm.vels = NULL - atm.prss = NULL - atm.temp = NULL - can.prss = NULL - can.temp = NULL - atm.co2 = NULL - can.co2 = NULL - leaf.temp = NULL - wood.temp = NULL - atm.shv = NULL - can.shv = NULL - atm.vpd = NULL - can.vpd = NULL - leaf.vpd = NULL - can.co2 = NULL - hflxca = NULL - qwflxca = NULL - wflxca = NULL - agb = NULL - nplant = NULL - lai = NULL - wai = NULL - tai = NULL - area = NULL - rain = NULL - gnd.temp = NULL - gnd.shv = NULL - workload = NULL - specwork = NULL - fs.open = NULL - hflxgc = NULL - hflxlc = NULL - hflxwc = NULL - wflxgc = NULL - wflxlc = NULL - wflxwc = NULL - et = NULL - rshort = NULL - rshort.beam = NULL - rshort.diff = NULL - rlong = NULL - rshort.gnd = NULL - rlong.gnd = NULL - rlongup = NULL - albedo = NULL - albedo.beam = NULL - albedo.diff = NULL - rlong.albedo = NULL - paw = NULL - smpot = NULL - npat.global = NULL - ncoh.global = NULL - mmsqu.gpp = NULL - mmsqu.plresp = NULL - mmsqu.leaf.resp = NULL - mmsqu.root.resp = NULL - mmsqu.plresp = NULL - mmsqu.hetresp = NULL - mmsqu.cwdresp = NULL - mmsqu.reco = NULL - mmsqu.cflxca = NULL - mmsqu.cflxst = NULL - mmsqu.hflxca = NULL - mmsqu.hflxlc = NULL - mmsqu.hflxwc = NULL - mmsqu.hflxgc = NULL - mmsqu.wflxca = NULL - mmsqu.qwflxca = NULL - mmsqu.wflxlc = NULL - mmsqu.wflxwc = NULL - mmsqu.wflxgc = NULL - mmsqu.evap = NULL - mmsqu.transp = NULL - water.deficit = NULL - - #----- Cohort level lists. -------------------------------------------------------------# - lightco = list() - lightbeamco = list() - lightdiffco = list() - parlco = list() - gppco = list() - gpplco = list() - respco = list() - nppco = list() - cbaco = list() - cbarelco = list() - cbalightco = list() - cbamoistco = list() - mcostco = list() - ldropco = list() - agbco = list() - fsoco = list() - nplantco = list() - pftco = list() - dbhco = list() - laico = list() - waico = list() - taico = list() - ageco = list() - areaco = list() - demandco = list() - supplyco = list() - heightco = list() - baco = list() - baliveco = list() - bdeadco = list() - bleafco = list() - brootco = list() - bswoodco = list() - bstoreco = list() - growthco = list() - mortco = list() - agemortco = list() - ncbmortco = list() - tfallmortco = list() - coldmortco = list() - distmortco = list() - recruitco = list() - - n = 0 - m = 0 - thismonth = NULL - monnum = NULL - myear = NULL - - first.time = TRUE + cat(" + Post-processing output from ",lieu,"...","\n") + #---------------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------------# + # Make the RData file name, then we check whether we must read the files again # + # or use the stored RData. # + #---------------------------------------------------------------------------------------# + path.data = paste(here,place,"rdata_month",sep="/") + if (! file.exists(path.data)) dir.create(path.data) + ed22.rdata = paste(path.data,paste(place,"RData",sep="."),sep="/") + if (reload.data && file.exists(ed22.rdata)){ + #----- Load the modelled dataset. ---------------------------------------------------# + cat(" - Loading previous session...","\n") + load(ed22.rdata) + tresume = datum$ntimes + 1 + datum = update.monthly( new.ntimes = ntimes + , old.datum = datum + , montha = monthbeg + , yeara = yeara + , inpref = inpref + , slz.min = slz.min + )#end update.monthly + }else{ + cat(" - Starting new session...","\n") + tresume = 1 + datum = create.monthly( ntimes = ntimes + , montha = monthbeg + , yeara = yeara + , inpref = inpref + , slz.min = slz.min + )#end create.monthly + }#end if + #---------------------------------------------------------------------------------------# + + #---------------------------------------------------------------------------------------# @@ -420,1238 +259,139 @@ for (place in myplaces){ - - #----- Loop over years. ----------------------------------------------------------------# - for (year in yeara:yearz){ - if (year == yeara){ - firstmonth = monthbeg - }else{ - firstmonth = 1 - }#end if - if (year == yearz){ - lastmonth = meszz - }else{ - lastmonth = 12 - }#end if - print (paste(" - Reading data from year ",year,"...",sep="")) - - #----- Loop over months. -----------------------------------------------------------# - for (month in firstmonth:lastmonth){ - m = m + 1 - - #----- Find out the previous month. ---------------------------------------------# - lastmonth = 12 * (month == 1) + month - 1 - - #----- Build the month and year vector. -----------------------------------------# - monnum = c(monnum,month) - myear = c(myear,year) - - #----- Build the file name. -----------------------------------------------------# - cmonth = substring(100+month,2,3) - ddd = daymax(month,year) - myfile = paste(inpref,"-Q-",year,"-",cmonth,"-00-000000-g01.h5",sep="") - #--------------------------------------------------------------------------------# - - - - #----- Read data and close connection immediately after. ------------------------# - mymont = hdf5load(file=myfile,load=FALSE,verbosity=0,tidy=TRUE) - #--------------------------------------------------------------------------------# - - - #----- Build the time. ----------------------------------------------------------# - thismonth = c(thismonth,chron(paste(month,1,year,sep="/"),times="0:0:0")) - #--------------------------------------------------------------------------------# - - - #----- Define the number of soil layers. ----------------------------------------# - nzg = mymont$NZG - nzs = mymont$NZS - ndcycle = mymont$NDCYCLE - #--------------------------------------------------------------------------------# - - - #--------------------------------------------------------------------------------# - # If this is the first time, allocate and initialise the mean diurnal cycle # - # arrays. # - #--------------------------------------------------------------------------------# - if (first.time){ - first.time = FALSE - - #----- Find which soil are we solving, and save properties into soil.prop. ---# - isoilflg = mymont$ISOILFLG - slz = mymont$SLZ - slxsand = mymont$SLXSAND - slxclay = mymont$SLXCLAY - ntext = mymont$NTEXT.SOIL[nzg] - - soil.prop = soil.params(ntext,isoilflg,slxsand,slxclay) - dslz = diff(c(slz,0)) - soil.depth = rev(cumsum(rev(dslz))) - soil.dry = rev(cumsum(rev(soil.prop$soilcp * wdns * dslz))) - soil.poro = rev(cumsum(rev(soil.prop$slmsts * wdns * dslz))) - - - #----- Find the layers we care about. ----------------------------------------# - sel = slz < slz.min - if (any(sel)){ - ka = which.max(slz[sel]) - }else{ - ka = 1 - }#end if - kz = nzg - #-----------------------------------------------------------------------------# - - - - #----- Mean diurnal cycle. ---------------------------------------------------# - dcycmean = list() - dcycmean$gpp = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$npp = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$plresp = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$leaf.resp = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$root.resp = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$growth.resp = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$hetresp = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$cwdresp = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$nep = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$nee = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$reco = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$cflxca = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$cflxst = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$hflxca = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$hflxlc = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$hflxwc = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$hflxgc = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$qwflxca = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$wflxca = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$wflxlc = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$wflxwc = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$wflxgc = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$evap = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$transp = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$atm.temp = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$can.temp = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$leaf.temp = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$wood.temp = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$gnd.temp = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$atm.shv = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$can.shv = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$gnd.shv = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$atm.vpd = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$can.vpd = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$leaf.vpd = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$atm.co2 = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$can.co2 = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$atm.prss = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$can.prss = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$atm.vels = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$ustar = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$fs.open = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$rain = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$rshort = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$rshort.beam = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$rshort.diff = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$rlong = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$rshort.gnd = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$rlong.gnd = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$rlongup = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$albedo = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$albedo.beam = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$albedo.diff = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$rlong.albedo = matrix(data=0,nrow=totmon,ncol=ndcycle) - - dcycmsqu = list() - dcycmsqu$gpp = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmsqu$npp = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmsqu$plresp = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmsqu$leaf.resp = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmsqu$root.resp = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmsqu$hetresp = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmsqu$cwdresp = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmsqu$nep = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmsqu$nee = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmsqu$reco = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmsqu$cflxca = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmsqu$cflxst = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmsqu$hflxca = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmsqu$hflxlc = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmsqu$hflxwc = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmsqu$hflxgc = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmsqu$qwflxca = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmsqu$wflxca = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmsqu$wflxlc = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmsqu$wflxwc = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmsqu$wflxgc = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmsqu$transp = matrix(data=0,nrow=totmon,ncol=ndcycle) - - soil.water = matrix(data=0,nrow=totmon,ncol=nzg) - soil.temp = matrix(data=0,nrow=totmon,ncol=nzg) - soil.mstpot = matrix(data=0,nrow=totmon,ncol=nzg) - - }#end if - #--------------------------------------------------------------------------------# - - #----- Load the total number of patches and cohorts. ----------------------------# - npat.global = c(npat.global, mymont$NPATCHES.GLOBAL) - ncoh.global = c(ncoh.global, mymont$NCOHORTS.GLOBAL) - #--------------------------------------------------------------------------------# - - - - #----- Load the simple variables. -----------------------------------------------# - gpp = c(gpp , mymont$MMEAN.GPP ) - plresp = c(plresp , mymont$MMEAN.PLRESP ) - leaf.resp = c(leaf.resp , mymont$MMEAN.LEAF.RESP ) - root.resp = c(root.resp , mymont$MMEAN.ROOT.RESP ) - growth.resp = c(growth.resp , mymont$MMEAN.GROWTH.RESP ) - hetresp = c(hetresp , mymont$MMEAN.RH ) - cwdresp = c(cwdresp , mymont$MMEAN.CWD.RH ) - nep = c(nep , mymont$MMEAN.NEP ) - nee = c(nee , - mymont$MMEAN.CARBON.AC - + mymont$MMEAN.CARBON.ST ) - reco = c(reco , mymont$MMEAN.PLRESP - + mymont$MMEAN.RH ) - cflxca = c(cflxca , - mymont$MMEAN.CARBON.AC ) - cflxst = c(cflxst , mymont$MMEAN.CARBON.ST ) - hflxca = c(hflxca , - mymont$MMEAN.SENSIBLE.AC ) - hflxlc = c(hflxlc , mymont$MMEAN.SENSIBLE.LC ) - hflxwc = c(hflxwc , mymont$MMEAN.SENSIBLE.WC ) - hflxgc = c(hflxgc , mymont$MMEAN.SENSIBLE.GC ) - qwflxca = c(qwflxca , - mymont$MMEAN.VAPOR.AC - * alvli(mymont$MMEAN.CAN.TEMP) ) - wflxca = c(wflxca , - mymont$MMEAN.VAPOR.AC * day.sec ) - wflxlc = c(wflxlc , mymont$MMEAN.VAPOR.LC * day.sec ) - wflxwc = c(wflxwc , mymont$MMEAN.VAPOR.WC * day.sec ) - wflxgc = c(wflxgc , mymont$MMEAN.VAPOR.GC * day.sec ) - evap = c(evap , mymont$MMEAN.EVAP * day.sec ) - transp = c(transp , mymont$MMEAN.TRANSP * day.sec ) - - mmsqu.gpp = c(mmsqu.gpp , mymont$MMSQU.GPP ) - mmsqu.plresp = c(mmsqu.plresp , mymont$MMSQU.PLRESP ) - mmsqu.leaf.resp = c(mmsqu.leaf.resp , mymont$MMSQU.PLRESP ) - mmsqu.root.resp = c(mmsqu.root.resp , mymont$MMSQU.PLRESP ) - mmsqu.hetresp = c(mmsqu.hetresp , mymont$MMSQU.RH ) - mmsqu.cwdresp = c(mmsqu.cwdresp , mymont$MMSQU.CWD.RH ) - mmsqu.cflxca = c(mmsqu.cflxca , mymont$MMSQU.CARBON.AC ) - mmsqu.cflxst = c(mmsqu.cflxst , mymont$MMSQU.CARBON.ST ) - mmsqu.hflxca = c(mmsqu.hflxca , mymont$MMSQU.SENSIBLE.AC ) - mmsqu.hflxlc = c(mmsqu.hflxlc , mymont$MMSQU.SENSIBLE.LC ) - mmsqu.hflxwc = c(mmsqu.hflxwc , mymont$MMSQU.SENSIBLE.WC ) - mmsqu.hflxgc = c(mmsqu.hflxgc , mymont$MMSQU.SENSIBLE.GC ) - mmsqu.wflxca = c(mmsqu.wflxca , mymont$MMSQU.VAPOR.AC - * day.sec * day.sec ) - mmsqu.qwflxca = c(mmsqu.qwflxca , mymont$MMSQU.VAPOR.AC - * alvli(mymont$MMEAN.CAN.TEMP) - * alvli(mymont$MMEAN.CAN.TEMP) ) - mmsqu.wflxlc = c(mmsqu.wflxlc , mymont$MMSQU.VAPOR.LC - * day.sec * day.sec ) - mmsqu.wflxwc = c(mmsqu.wflxwc , mymont$MMSQU.VAPOR.WC - * day.sec * day.sec ) - mmsqu.wflxgc = c(mmsqu.wflxgc , mymont$MMSQU.VAPOR.GC - * day.sec * day.sec ) - mmsqu.evap = c(mmsqu.evap , mymont$MMSQU.EVAP - * day.sec * day.sec ) - mmsqu.transp = c(mmsqu.transp , mymont$MMSQU.TRANSP - * day.sec * day.sec ) - - ustar = c(ustar ,mymont$MMEAN.USTAR ) - - atm.vels = c(atm.vels ,mymont$MMEAN.ATM.VELS ) - atm.prss = c(atm.prss ,mymont$MMEAN.ATM.PRSS * 0.01 ) - atm.temp = c(atm.temp ,mymont$MMEAN.ATM.TEMP - t00 ) - atm.shv = c(atm.shv ,mymont$MMEAN.ATM.SHV * kg2g ) - atm.co2 = c(atm.co2 ,mymont$MMEAN.ATM.CO2 ) - atm.vpd = c(atm.vpd ,mymont$MMEAN.ATM.VPDEF * 0.01 ) - - can.prss = c(can.prss ,mymont$MMEAN.CAN.PRSS * 0.01 ) - can.temp = c(can.temp ,mymont$MMEAN.CAN.TEMP - t00 ) - can.shv = c(can.shv ,mymont$MMEAN.CAN.SHV * kg2g ) - can.co2 = c(can.co2 ,mymont$MMEAN.CAN.CO2 ) - can.vpd = c(can.vpd ,mymont$MMEAN.CAN.VPDEF * 0.01 ) - - gnd.temp = c(gnd.temp ,mymont$MMEAN.GND.TEMP - t00 ) - gnd.shv = c(gnd.shv ,mymont$MMEAN.GND.SHV * kg2g ) - - leaf.temp = c(leaf.temp ,mymont$MMEAN.LEAF.TEMP - t00 ) - leaf.vpd = c(leaf.vpd ,mymont$MMEAN.LEAF.VPDEF * 0.01 ) - wood.temp = c(wood.temp ,mymont$MMEAN.WOOD.TEMP - t00 ) - rain = c(rain ,mymont$MMEAN.PCPG*ddd * day.sec ) - - fs.open = c(fs.open ,mymont$MMEAN.FS.OPEN ) - rshort = c(rshort ,mymont$MMEAN.RSHORT ) - rshort.beam = c(rshort.beam ,mymont$MMEAN.RSHORT - mymont$MMEAN.RSHORT.DIFF ) - rshort.diff = c(rshort.diff ,mymont$MMEAN.RSHORT.DIFF ) - rlong = c(rlong ,mymont$MMEAN.RLONG ) - rshort.gnd = c(rshort.gnd ,mymont$MMEAN.RSHORT.GND ) - rlong.gnd = c(rlong.gnd ,mymont$MMEAN.RLONG.GND ) - rlongup = c(rlongup ,mymont$MMEAN.RLONGUP ) - albedo = c(albedo ,mymont$MMEAN.ALBEDO ) - albedo.beam = c(albedo.beam ,mymont$MMEAN.ALBEDO.BEAM ) - albedo.diff = c(albedo.diff ,mymont$MMEAN.ALBEDO.DIFFUSE ) - rlong.albedo = c(rlong.albedo ,mymont$MMEAN.RLONG.ALBEDO ) - #--------------------------------------------------------------------------------# - - - #----- Find averaged soil properties. -------------------------------------------# - swater.now = rev(cumsum(rev(mymont$MMEAN.SOIL.WATER * wdns * dslz))) - smoist.avg = swater.now / (wdns * soil.depth) - paw.now = 100. * ( ( swater.now[ka] - soil.dry [ka] ) - / ( soil.poro [ka] - soil.dry [ka] ) ) - smpot.now = ( - smoist2mpot(smoist=smoist.avg[ka],mysoil=soil.prop) - * 0.001 * grav ) - paw = c( paw, paw.now ) - smpot = c( smpot, smpot.now ) - #--------------------------------------------------------------------------------# - - - #------ Read in soil properties. ------------------------------------------------# - soil.temp [m,] = mymont$MMEAN.SOIL.TEMP - t00 - soil.water [m,] = mymont$MMEAN.SOIL.WATER - soil.mstpot[m,] = - mymont$MMEAN.SOIL.MSTPOT - #--------------------------------------------------------------------------------# - - - - #----- Read workload, and retrieve only the current month. ----------------------# - workload = c(workload , mymont$WORKLOAD[month]) - specwork = c(specwork , mymont$WORKLOAD[month]/sum(mymont$SIPA.N,na.rm=TRUE)) - #--------------------------------------------------------------------------------# - - - - #----- Disturbance rates. -------------------------------------------------------# - dist [m,1:nlu,1:nlu] = mymont$DISTURBANCE.RATES[,1:nlu,1:nlu] - #--------------------------------------------------------------------------------# - - - #--------------------------------------------------------------------------------# - # Read the mean diurnal cycle and the mean sum of the squares. # - #--------------------------------------------------------------------------------# - dcycmean$gpp [m,] = mymont$QMEAN.GPP - dcycmean$plresp [m,] = mymont$QMEAN.PLRESP - dcycmean$npp [m,] = mymont$QMEAN.GPP - mymont$QMEAN.PLRESP - dcycmean$leaf.resp [m,] = mymont$QMEAN.LEAF.RESP - dcycmean$root.resp [m,] = mymont$QMEAN.ROOT.RESP - dcycmean$hetresp [m,] = mymont$QMEAN.RH - dcycmean$cwdresp [m,] = mymont$QMEAN.CWD.RH - dcycmean$nep [m,] = mymont$QMEAN.NEP - dcycmean$nee [m,] = - mymont$QMEAN.CARBON.AC + mymont$QMEAN.CARBON.ST - dcycmean$reco [m,] = mymont$QMEAN.PLRESP + mymont$QMEAN.RH - dcycmean$cflxca [m,] = - mymont$QMEAN.CARBON.AC - dcycmean$cflxst [m,] = - mymont$QMEAN.CARBON.ST - dcycmean$hflxca [m,] = - mymont$QMEAN.SENSIBLE.AC - dcycmean$hflxlc [m,] = mymont$QMEAN.SENSIBLE.LC - dcycmean$hflxwc [m,] = mymont$QMEAN.SENSIBLE.WC - dcycmean$hflxgc [m,] = mymont$QMEAN.SENSIBLE.GC - dcycmean$wflxca [m,] = - mymont$QMEAN.VAPOR.AC * day.sec - dcycmean$qwflxca [m,] = ( - mymont$QMEAN.VAPOR.AC - * alvli(mymont$QMEAN.CAN.TEMP) ) - dcycmean$wflxlc [m,] = mymont$QMEAN.VAPOR.LC * day.sec - dcycmean$wflxwc [m,] = mymont$QMEAN.VAPOR.WC * day.sec - dcycmean$wflxgc [m,] = mymont$QMEAN.VAPOR.GC * day.sec - dcycmean$evap [m,] = ( mymont$QMEAN.VAPOR.GC - + mymont$QMEAN.VAPOR.WC - + mymont$QMEAN.VAPOR.LC ) * day.sec - dcycmean$transp [m,] = mymont$QMEAN.TRANSP * day.sec - dcycmean$atm.temp [m,] = mymont$QMEAN.ATM.TEMP - t00 - dcycmean$can.temp [m,] = mymont$QMEAN.CAN.TEMP - t00 - dcycmean$leaf.temp [m,] = mymont$QMEAN.LEAF.TEMP - t00 - dcycmean$wood.temp [m,] = mymont$QMEAN.WOOD.TEMP - t00 - dcycmean$gnd.temp [m,] = mymont$QMEAN.GND.TEMP - t00 - dcycmean$atm.shv [m,] = mymont$QMEAN.ATM.SHV * kg2g - dcycmean$can.shv [m,] = mymont$QMEAN.CAN.SHV * kg2g - dcycmean$gnd.shv [m,] = mymont$QMEAN.GND.SHV * kg2g - dcycmean$atm.vpd [m,] = mymont$QMEAN.ATM.VPDEF * 0.01 - dcycmean$can.vpd [m,] = mymont$QMEAN.CAN.VPDEF * 0.01 - dcycmean$leaf.vpd [m,] = mymont$QMEAN.LEAF.VPDEF * 0.01 - dcycmean$atm.co2 [m,] = mymont$QMEAN.ATM.CO2 - dcycmean$can.co2 [m,] = mymont$QMEAN.CAN.CO2 - dcycmean$atm.vels [m,] = mymont$QMEAN.ATM.VELS - dcycmean$ustar [m,] = mymont$QMEAN.USTAR - dcycmean$atm.prss [m,] = mymont$QMEAN.ATM.PRSS * 0.01 - dcycmean$can.prss [m,] = mymont$QMEAN.CAN.PRSS * 0.01 - dcycmean$fs.open [m,] = mymont$QMEAN.FS.OPEN - dcycmean$rain [m,] = mymont$QMEAN.PCPG * day.sec - dcycmean$rshort [m,] = mymont$QMEAN.RSHORT - dcycmean$rshort.beam [m,] = mymont$QMEAN.RSHORT - mymont$QMEAN.RSHORT.DIFF - dcycmean$rshort.diff [m,] = mymont$QMEAN.RSHORT.DIFF - dcycmean$rlong [m,] = mymont$QMEAN.RLONG - dcycmean$rshort.gnd [m,] = mymont$QMEAN.RSHORT.GND - dcycmean$rlong.gnd [m,] = mymont$QMEAN.RLONG.GND - dcycmean$rlongup [m,] = mymont$QMEAN.RLONGUP - dcycmean$albedo [m,] = mymont$QMEAN.ALBEDO - dcycmean$albedo.beam [m,] = mymont$QMEAN.ALBEDO.BEAM - dcycmean$albedo.diff [m,] = mymont$QMEAN.ALBEDO.DIFFUSE - dcycmean$rlong.albedo[m,] = mymont$QMEAN.RLONG.ALBEDO - - dcycmsqu$gpp [m,] = mymont$QMSQU.GPP - dcycmsqu$plresp [m,] = mymont$QMSQU.PLRESP - dcycmsqu$leaf.resp [m,] = mymont$QMSQU.LEAF.RESP - dcycmsqu$root.resp [m,] = mymont$QMSQU.ROOT.RESP - dcycmsqu$hetresp [m,] = mymont$QMSQU.RH - dcycmsqu$cwdresp [m,] = mymont$QMSQU.CWD.RH - dcycmsqu$nep [m,] = mymont$QMSQU.NEP - dcycmsqu$cflxca [m,] = mymont$QMSQU.CARBON.AC - dcycmsqu$cflxst [m,] = mymont$QMSQU.CARBON.ST - dcycmsqu$hflxca [m,] = mymont$QMSQU.SENSIBLE.AC - dcycmsqu$hflxlc [m,] = mymont$QMSQU.SENSIBLE.LC - dcycmsqu$hflxwc [m,] = mymont$QMSQU.SENSIBLE.WC - dcycmsqu$hflxgc [m,] = mymont$QMSQU.SENSIBLE.GC - dcycmsqu$wflxca [m,] = mymont$QMSQU.VAPOR.AC * day.sec * day.sec - dcycmsqu$qwflxca [m,] = ( mymont$QMSQU.VAPOR.AC - * alvli(mymont$QMEAN.CAN.TEMP) - * alvli(mymont$QMEAN.CAN.TEMP) ) - dcycmsqu$wflxlc [m,] = mymont$QMSQU.VAPOR.WC * day.sec * day.sec - dcycmsqu$wflxwc [m,] = mymont$QMSQU.VAPOR.LC * day.sec * day.sec - dcycmsqu$wflxgc [m,] = mymont$QMSQU.VAPOR.GC * day.sec * day.sec - dcycmsqu$transp [m,] = mymont$QMSQU.TRANSP * day.sec * day.sec - #--------------------------------------------------------------------------------# - - - #---- Read in the site-level area. ----------------------------------------------# - areasi = mymont$AREA.SI - npatches = mymont$SIPA.N - #--------------------------------------------------------------------------------# - - - #----- Read a few patch-level variables. ----------------------------------------# - areapa = mymont$AREA * rep(areasi,times=npatches) - lupa = mymont$DIST.TYPE - agepa = mymont$AGE - #--------------------------------------------------------------------------------# - - - #--------------------------------------------------------------------------------# - # Get the soil carbon. # - #--------------------------------------------------------------------------------# - fast.soil.c = c(fast.soil.c ,sum(mymont$FAST.SOIL.C * areapa)) - slow.soil.c = c(slow.soil.c ,sum(mymont$SLOW.SOIL.C * areapa)) - struct.soil.c = c(struct.soil.c,sum(mymont$STRUCTURAL.SOIL.C * areapa)) - #--------------------------------------------------------------------------------# - - - #--------------------------------------------------------------------------------# - # Get the water deficit. # - #--------------------------------------------------------------------------------# - water.deficit = c(water.deficit,sum(mymont$AVG.MONTHLY.WATERDEF * areapa)) - #--------------------------------------------------------------------------------# - - - #--------------------------------------------------------------------------------# - # If this is a biomass initialisation, or a run with anthropogenic # - # disturbance, we must jitter the age so we can distinguish the patches. # - #--------------------------------------------------------------------------------# - sameage = duplicated(agepa) - agepa[sameage] = jitter(x=agepa[sameage],amount=0.4) - #--------------------------------------------------------------------------------# - - - #--------------------------------------------------------------------------------# - # Read the cohort-level variables. Because empty patchs do exist (deserts), # - # we must check whether there is any cohort to be read. If not, assign NA to # - # all variables. # - #--------------------------------------------------------------------------------# - ncohorts = mymont$PACO.N - if (any (ncohorts > 0)){ - areaconow = rep(areapa,times=ncohorts) - - #----- Define the land use classes. ------------------------------------------# - luconow = rep(lupa,times=ncohorts) - - #----- Define the DBH classes. -----------------------------------------------# - dbhconow = mymont$DBH - dbhbks = c(-Inf,seq(from=ddbh,to=(ndbh-1)*ddbh,by=ddbh),Inf) - dbhcut = cut(dbhconow,breaks=dbhbks) - dbhlevs = levels(dbhcut) - dbhfac = match(dbhcut,dbhlevs) - - #----- Define the age classes. -----------------------------------------------# - ageconow = rep(x=agepa,times=ncohorts) - agebks = c(-Inf,seq(from=dage,to=(nage-1)*dage,by=dage),Inf) - agecut = cut(ageconow,breaks=agebks) - agelevs = levels(agecut) - agefac = match(agecut,agelevs) - - agepacut = cut(agepa,breaks=agebks) - agepafac = match(agepacut,agelevs) - areapaage = tapply(X=areapa,INDEX=agepafac,sum,na.rm=TRUE) - areaage = areapaage[as.character(agefac)] - - pftconow = mymont$PFT - nplantconow = mymont$NPLANT - heightconow = mymont$HITE - baconow = mymont$BA.CO - agbconow = mymont$AGB.CO - bseedsconow = mymont$BSEEDS.CO - laiconow = mymont$LAI.CO - waiconow = mymont$WAI.CO - taiconow = laiconow + waiconow - gppconow = mymont$MMEAN.GPP.CO - leafrespconow = mymont$MMEAN.LEAF.RESP.CO - rootrespconow = mymont$MMEAN.ROOT.RESP.CO - growthrespconow = mymont$MMEAN.GROWTH.RESP.CO - respconow = ( mymont$MMEAN.LEAF.RESP.CO + mymont$MMEAN.ROOT.RESP.CO - + mymont$MMEAN.GROWTH.RESP.CO + mymont$MMEAN.STORAGE.RESP.CO - + mymont$MMEAN.VLEAF.RESP.CO ) - nppconow = gppconow-respconow - cbaconow = mymont$MMEAN.CB - cbalightconow = mymont$CB.LIGHTMAX[,lastmonth] - cbamoistconow = mymont$CB.MOISTMAX[,lastmonth] - cbarelconow = mymont$CBR.BAR - mcostconow = ( mymont$MMEAN.LEAF.MAINTENANCE - + mymont$MMEAN.ROOT.MAINTENANCE ) - ldropconow = mymont$MMEAN.LEAF.DROP.CO - fsoconow = mymont$MMEAN.FS.OPEN.CO - lightconow = mymont$MMEAN.LIGHT.LEVEL - lightbeamconow = mymont$MMEAN.LIGHT.LEVEL.BEAM - lightdiffconow = mymont$MMEAN.LIGHT.LEVEL.DIFF - parlconow = mymont$MMEAN.PAR.L - - baliveconow = mymont$BALIVE - bdeadconow = mymont$BDEAD - bleafconow = mymont$BLEAF - brootconow = mymont$BROOT - bswoodconow = mymont$BSAPWOODA+mymont$BSAPWOODB - bstoreconow = mymont$BSTORAGE - - - sel = laiconow > 1.e-10 - demandconow = mymont$MMEAN.PSI.OPEN * laiconow * day.sec - supplyconow = mymont$MMEAN.WATER.SUPPLY * day.sec - gpplconow = gppconow - gpplconow [sel] = nplantconow[sel] * gppconow[sel] / laiconow[sel] - gpplconow [!sel] = 0. - - - mortconow = rowSums(mymont$MMEAN.MORT.RATE) - agemortconow = mymont$MMEAN.MORT.RATE[,1] - ncbmortconow = mymont$MMEAN.MORT.RATE[,2] - tfallmortconow = mymont$MMEAN.MORT.RATE[,3] - coldmortconow = mymont$MMEAN.MORT.RATE[,4] - distmortconow = mymont$MMEAN.MORT.RATE[,5] - recruitconow = mymont$RECRUIT.DBH - growthconow = 100. * mymont$DLNDBH.DT - #-----------------------------------------------------------------------------# - }else{ - #----- Make everything NA. ---------------------------------------------------# - areaconow = NA - luconow = NA - dbhconow = NA - dbhbks = NA - dbhcut = NA - dbhlevs = NA - dbhfac = NA - ageconow = NA - agebks = NA - agecut = NA - agelevs = NA - agefac = NA - agepacut = NA - agepafac = NA - areapaage = NA - areaage = NA - pftconow = NA - nplantconow = NA - heightconow = NA - agbconow = NA - baconow = NA - bseedsconow = NA - laiconow = NA - waiconow = NA - taiconow = NA - gppconow = NA - gpplconow = NA - leafrespconow = NA - rootrespconow = NA - growthrespconow = NA - respconow = NA - nppconow = NA - cbaconow = NA - cbalightconow = NA - cbamoistconow = NA - mcostconow = NA - ldropconow = NA - cbarelconow = NA - fsoconow = NA - lightconow = NA - lightbeamconow = NA - lightdiffconow = NA - parlconow = NA - demandconow = NA - supplyconow = NA - baliveconow = NA - bdeadconow = NA - bleafconow = NA - brootconow = NA - bswoodconow = NA - bstoreconow = NA - mortconow = NA - agemortconow = NA - ncbmortconow = NA - tfallmortconow = NA - coldmortconow = NA - distmortconow = NA - recruitconow = NA - growthconow = NA - }#end if - #--------------------------------------------------------------------------------# - - - #--------------------------------------------------------------------------------# - # The following two variables are used to scale "intensive" properties # - # (whatever/plant) to "extensive" (whatever/m2). Sometimes they may be used to # - # build weighted averages. # - #--------------------------------------------------------------------------------# - w.nplant = nplantconow * areaconow - w.lai = laiconow * areaconow - #--------------------------------------------------------------------------------# - - - #----- Define some classes that can be defined even when no cohorts exist. ------# - agebks = c(-Inf,seq(from=dage,to=(nage-1)*dage,by=dage),Inf) - agepacut = cut(agepa,breaks=agebks) - agepafac = match(agepacut,agelevs) - areapaage = tapply(X=areapa,INDEX=agepafac,sum,na.rm=TRUE) - areaage = areapaage[as.character(agefac)] - #--------------------------------------------------------------------------------# - - - - #--------------------------------------------------------------------------------# - # Build the PFT arrays. # - #--------------------------------------------------------------------------------# - for (p in 1:npft){ - if (all(is.na(pftconow))){ - sel = rep(FALSE,times=length(pftconow)) - }else{ - sel = pftconow == p - }#end if - if (any(sel)){ - - #----- "Extensive" variables, add them. -----------------------------------# - nplantpft [m,p] = sum(nplantconow[sel] * areaconow[sel]) - laipft [m,p] = sum(laiconow [sel] * areaconow[sel]) - waipft [m,p] = sum(waiconow [sel] * areaconow[sel]) - taipft [m,p] = sum(taiconow [sel] * areaconow[sel]) - #--------------------------------------------------------------------------# - - #----- "Intensive" variables, use nplant or LAI to make them extensive. ---# - basareapft [m,p] = sum( w.nplant[sel] * baconow [sel] ) - agbpft [m,p] = sum( w.nplant[sel] * agbconow [sel] ) - bseedspft [m,p] = sum( w.nplant[sel] * bseedsconow [sel] ) - gpppft [m,p] = sum( w.nplant[sel] * gppconow [sel] ) - npppft [m,p] = sum( w.nplant[sel] * nppconow [sel] ) - mcopft [m,p] = sum( w.nplant[sel] * mcostconow [sel] ) - cbapft [m,p] = sum( w.nplant[sel] * cbaconow [sel] ) - cbalightpft [m,p] = sum( w.nplant[sel] * cbalightconow [sel] ) - cbamoistpft [m,p] = sum( w.nplant[sel] * cbamoistconow [sel] ) - ldroppft [m,p] = sum( w.nplant[sel] * ldropconow [sel] ) - balivepft [m,p] = sum( w.nplant[sel] * baliveconow [sel] ) - bdeadpft [m,p] = sum( w.nplant[sel] * bdeadconow [sel] ) - bleafpft [m,p] = sum( w.nplant[sel] * bleafconow [sel] ) - brootpft [m,p] = sum( w.nplant[sel] * brootconow [sel] ) - bswoodpft [m,p] = sum( w.nplant[sel] * bswoodconow [sel] ) - bstorepft [m,p] = sum( w.nplant[sel] * bstoreconow [sel] ) - leafresppft [m,p] = sum( w.nplant[sel] * leafrespconow [sel] ) - rootresppft [m,p] = sum( w.nplant[sel] * rootrespconow [sel] ) - growthresppft[m,p] = sum( w.nplant[sel] * growthrespconow[sel] ) - - #----- Fso is added here, but it will be scaled back to intensive. --------# - fsopft [m,p] = sum( w.lai [sel] * fsoconow [sel] ) - #--------------------------------------------------------------------------# - - #----- cbarel is added here, but it will be scaled back to intensive. -----# - cbarelpft [m,p] = sum( w.nplant[sel] * cbarelconow [sel] ) - #--------------------------------------------------------------------------# - }#end if (any(sel)) - }#end for (p in 1:npft) - #------ Find the total. ---------------------------------------------------------# - nplantpft [m,npft+1] = sum(nplantpft [m,1:npft],na.rm=TRUE) - laipft [m,npft+1] = sum(laipft [m,1:npft],na.rm=TRUE) - waipft [m,npft+1] = sum(waipft [m,1:npft],na.rm=TRUE) - taipft [m,npft+1] = sum(taipft [m,1:npft],na.rm=TRUE) - agbpft [m,npft+1] = sum(agbpft [m,1:npft],na.rm=TRUE) - bseedspft [m,npft+1] = sum(bseedspft [m,1:npft],na.rm=TRUE) - gpppft [m,npft+1] = sum(gpppft [m,1:npft],na.rm=TRUE) - npppft [m,npft+1] = sum(npppft [m,1:npft],na.rm=TRUE) - mcopft [m,npft+1] = sum(mcopft [m,1:npft],na.rm=TRUE) - cbapft [m,npft+1] = sum(cbapft [m,1:npft],na.rm=TRUE) - ldroppft [m,npft+1] = sum(ldroppft [m,1:npft],na.rm=TRUE) - balivepft [m,npft+1] = sum(balivepft [m,1:npft],na.rm=TRUE) - bdeadpft [m,npft+1] = sum(bdeadpft [m,1:npft],na.rm=TRUE) - bleafpft [m,npft+1] = sum(bleafpft [m,1:npft],na.rm=TRUE) - brootpft [m,npft+1] = sum(brootpft [m,1:npft],na.rm=TRUE) - bswoodpft [m,npft+1] = sum(bswoodpft [m,1:npft],na.rm=TRUE) - bstorepft [m,npft+1] = sum(bstorepft [m,1:npft],na.rm=TRUE) - basareapft [m,npft+1] = sum(basareapft [m,1:npft],na.rm=TRUE) - leafresppft [m,npft+1] = sum(leafresppft [m,1:npft],na.rm=TRUE) - rootresppft [m,npft+1] = sum(rootresppft [m,1:npft],na.rm=TRUE) - growthresppft[m,npft+1] = sum(growthresppft[m,1:npft],na.rm=TRUE) - #--------------------------------------------------------------------------------# - - - #----- Find the average Fsopen for each PFT. -------------------------------------# - for (p in 1:npft){ - if (laipft[m,p] != 0){ - fsopft[m,p] = fsopft[m,p] / laipft[m,p] - }#end if - }#end for - if (laipft[m,npft+1] != 0){ - fsopft[m,npft+1] = sum(fsopft[m,1:npft] * laipft[m,1:npft]) / laipft[m,npft+1] - }#end for - #---------------------------------------------------------------------------------# - - - #----- Find the average Fsopen for each PFT. -------------------------------------# - for (p in 1:npft){ - if (nplantpft[m,p] != 0){ - cbarelpft[m,p] = cbarelpft[m,p] / nplantpft[m,p] - }#end if - }#end for - if (nplantpft[m,npft+1] != 0){ - cbarelpft[m,npft+1] = ( sum(cbarelpft[m,1:npft] * nplantpft[m,1:npft]) - / nplantpft[m,npft+1] ) - }#end for - #---------------------------------------------------------------------------------# - - - - #---------------------------------------------------------------------------------# - # Find the growth, mortality, and recruitment rates for each PFT, and the # - # global rates. We only use the cohorts that were flagged as 1 or 2 (which means # - # that their DBH is greater than 10 cm). # - #---------------------------------------------------------------------------------# - for (p in 1:npft){ - if (all(is.na(pftconow))){ - sel.hgt = rep(FALSE,times=length(pftconow)) - sel.dbh = rep(FALSE,times=length(pftconow)) - sel.re2 = rep(FALSE,times=length(pftconow)) - }else{ - sel.hgt = pftconow == p & heightconow > 1.5 - sel.dbh = pftconow == p & recruitconow > 0 - sel.re2 = pftconow == p & recruitconow == 2 - }#end if - #------------------------------------------------------------------------------# - - - #----- Census LAI, WAI, and TAI neglect plants shorter than 1.5m. -------------# - if (any(sel.hgt)){ - censuslaipft [m,p] = sum(laiconow[sel.hgt] * areaconow[sel.hgt]) - censuswaipft [m,p] = sum(waiconow[sel.hgt] * areaconow[sel.hgt]) - censustaipft [m,p] = sum(taiconow[sel.hgt] * areaconow[sel.hgt]) - }#end if - #------------------------------------------------------------------------------# - - - - #----- Census AGB and Basal area ignore plants whose DBH is less than 10cm. ---# - if (any(sel.dbh)){ - censusbapft [m,p] = sum( w.nplant[sel.dbh] * baconow [sel.dbh] ) - censusagbpft[m,p] = sum( w.nplant[sel.dbh] * agbconow [sel.dbh] ) - }#end if - #------------------------------------------------------------------------------# - - - #------------------------------------------------------------------------------# - # Find the PFT-level mortality rates. # - #------------------------------------------------------------------------------# - if (any(sel.re2)){ - #---- This is the number of survivors. -------------------------------------# - survivor = sum(w.nplant[sel.re2]) - previous = sum(w.nplant[sel.re2] * exp(mortconow[sel.re2]) ) - mortpft[m,p] = log( previous / survivor ) - - survivor = sum(w.nplant[sel.re2]) - previous = sum(w.nplant[sel.re2] * exp(agemortconow[sel.re2]) ) - agemortpft[m,p] = log( previous / survivor ) - - survivor = sum(w.nplant[sel.re2]) - previous = sum(w.nplant[sel.re2] * exp(ncbmortconow[sel.re2]) ) - ncbmortpft[m,p] = log( previous / survivor ) - - survivor = sum(w.nplant[sel.re2]) - previous = sum(w.nplant[sel.re2] * exp(tfallmortconow[sel.re2]) ) - tfallmortpft[m,p] = log( previous / survivor ) - - survivor = sum(w.nplant[sel.re2]) - previous = sum(w.nplant[sel.re2] * exp(coldmortconow[sel.re2]) ) - coldmortpft[m,p] = log( previous / survivor ) - - survivor = sum(w.nplant[sel.re2]) - previous = sum(w.nplant[sel.re2] * exp(distmortconow[sel.re2]) ) - distmortpft[m,p] = log( previous / survivor ) - }#end if - if (any(sel.dbh) & any(sel.re2)){ - #---- This is the number of survivors. -------------------------------------# - population = sum(w.nplant[sel.dbh]) - established = sum(w.nplant[sel.re2]) - recrpft[m,p] = log( population / established) - }#end if - #------------------------------------------------------------------------------# - - - - #------------------------------------------------------------------------------# - # Growth rates are found only for established cohorts. # - #------------------------------------------------------------------------------# - if (any(sel.re2)){ - censusnplantpft [m,p] = sum( w.nplant[sel.re2] ) - growthpft[m,p] = sum( w.nplant[sel.re2] * growthconow [sel.re2] ) - }#end if - #------------------------------------------------------------------------------# - }#end for - #---------------------------------------------------------------------------------# - - - - - #---------------------------------------------------------------------------------# - # Find the total or the mean amongst all PFTs. # - #---------------------------------------------------------------------------------# - #----- "Extensive" properties, just add them up. ---------------------------------# - censusnplantpft [m,npft+1] = sum(censusnplantpft [m,1:npft],na.rm=TRUE) - censuslaipft [m,npft+1] = sum(censuslaipft [m,1:npft],na.rm=TRUE) - censuswaipft [m,npft+1] = sum(censuswaipft [m,1:npft],na.rm=TRUE) - censustaipft [m,npft+1] = sum(censustaipft [m,1:npft],na.rm=TRUE) - censusagbpft [m,npft+1] = sum(censusagbpft [m,1:npft],na.rm=TRUE) - censusbapft [m,npft+1] = sum(censusbapft [m,1:npft],na.rm=TRUE) - #----- Growth rates are averaged, not added. -------------------------------------# - if (censusnplantpft[m,npft+1] > 0.){ - growthpft[m,npft+1] = ( sum(growthpft[m,1:npft] * censusnplantpft[m,1:npft]) - / censusnplantpft[m,npft+1] ) - }#end if - #---------------------------------------------------------------------------------# - # Mortality and recruitment rates are done by looking at the entire # - # population rather than averaged. # - #---------------------------------------------------------------------------------# - if (all(is.na(pftconow))){ - sel.dbh = rep(FALSE,times=length(pftconow)) - sel.re2 = rep(FALSE,times=length(pftconow)) - }else{ - sel.dbh = recruitconow > 0 - sel.re2 = recruitconow == 2 - }#end if - - #----- w.nplant will convert intensive variables into extensive. -----------------# - w.nplant = nplantconow * areaconow - #---------------------------------------------------------------------------------# - - if (any(sel.re2)){ - #---- This is the number of survivors. ----------------------------------------# - survivor = sum( w.nplant[sel.re2] ) - previous = sum( w.nplant[sel.re2] * exp(mortconow[sel.re2])) - mortpft[m,npft+1] = log( previous / survivor ) - - survivor = sum( w.nplant[sel.re2] ) - previous = sum( w.nplant[sel.re2] * exp(agemortconow[sel.re2])) - agemortpft [m,npft+1] = log( previous / survivor ) - - survivor = sum( w.nplant[sel.re2] ) - previous = sum( w.nplant[sel.re2] * exp(ncbmortconow[sel.re2])) - ncbmortpft [m,npft+1] = log( previous / survivor ) - - survivor = sum( w.nplant[sel.re2] ) - previous = sum( w.nplant[sel.re2] * exp(tfallmortconow[sel.re2])) - tfallmortpft[m,npft+1] = log( previous / survivor ) - - survivor = sum( w.nplant[sel.re2] ) - previous = sum( w.nplant[sel.re2] * exp(coldmortconow[sel.re2])) - coldmortpft [m,npft+1] = log( previous / survivor ) - - survivor = sum( w.nplant[sel.re2] ) - previous = sum( w.nplant[sel.re2] * exp(distmortconow[sel.re2])) - distmortpft [m,npft+1] = log( previous / survivor ) - }#end if - - if (any(sel.dbh) & any(sel.re2)){ - #---- This is the number of survivors. ----------------------------------------# - population = sum( w.nplant[sel.dbh] ) - established = sum( w.nplant[sel.re2] ) - recrpft[m,npft+1] = log( population / established ) - }#end if - #---------------------------------------------------------------------------------# - - - - - - - #---------------------------------------------------------------------------------# - # Build the LU arrays. # - #---------------------------------------------------------------------------------# - for (l in 1:nlu){ - selpa = lupa == l - if (all(is.na(luconow))){ - sel = rep(FALSE,times=length(luconow)) - }else{ - sel = luconow == l - }#end if - - if (any(sel)){ - lailu [m,l] = sum( laiconow[sel] * areaconow[sel] ) - basarealu[m,l] = sum( w.nplant[sel] * baconow [sel] ) - agblu [m,l] = sum( w.nplant[sel] * agbconow [sel] ) - gpplu [m,l] = sum( w.nplant[sel] * gppconow [sel] ) - npplu [m,l] = sum( w.nplant[sel] * nppconow [sel] ) - }#end if - arealu [m,l] = arealu [m,l] + sum(areapa[selpa]) - }#end for - #------ Find the total. ----------------------------------------------------------# - lailu [m,nlu+1] = sum(lailu [m,1:nlu], na.rm=TRUE) - basarealu[m,nlu+1] = sum(basarealu[m,1:nlu], na.rm=TRUE) - agblu [m,nlu+1] = sum(agblu [m,1:nlu], na.rm=TRUE) - gpplu [m,nlu+1] = sum(gpplu [m,1:nlu], na.rm=TRUE) - npplu [m,nlu+1] = sum(npplu [m,1:nlu], na.rm=TRUE) - arealu [m,nlu+1] = sum(arealu [m,1:nlu], na.rm=TRUE) - #---------------------------------------------------------------------------------# - - - - - #---------------------------------------------------------------------------------# - # Build the size (DBH) structure arrays. # - #---------------------------------------------------------------------------------# - for (d in 1:ndbh){ - if (all(is.na(dbhfac))){ - seldbh = rep(FALSE,times=length(dbhfac)) - }else{ - seldbh = dbhfac == d - }#end if - for (p in 1:npft){ - selpft = pftconow == p - sel = selpft & seldbh - if (any(sel)){ - #----- Extensive properties. --------------------------------------------# - laipftdbh [m,d,p] = sum( laiconow [sel] * areaconow [sel] ) - waipftdbh [m,d,p] = sum( waiconow [sel] * areaconow [sel] ) - taipftdbh [m,d,p] = sum( taiconow [sel] * areaconow [sel] ) - nplantpftdbh [m,d,p] = sum( nplantconow [sel] * areaconow [sel] ) - demandpftdbh [m,d,p] = sum( demandconow [sel] * areaconow [sel] ) - supplypftdbh [m,d,p] = sum( supplyconow [sel] * areaconow [sel] ) - #----- Intensive properties, use nplant to make them extensive. ---------# - agbpftdbh [m,d,p] = sum( w.nplant [sel] * agbconow [sel] ) - gpppftdbh [m,d,p] = sum( w.nplant [sel] * gppconow [sel] ) - npppftdbh [m,d,p] = sum( w.nplant [sel] * nppconow [sel] ) - mcopftdbh [m,d,p] = sum( w.nplant [sel] * mcostconow [sel] ) - cbapftdbh [m,d,p] = sum( w.nplant [sel] * cbaconow [sel] ) - cbalightpftdbh [m,d,p] = sum( w.nplant [sel] * cbalightconow [sel] ) - cbamoistpftdbh [m,d,p] = sum( w.nplant [sel] * cbamoistconow [sel] ) - ldrpftdbh [m,d,p] = sum( w.nplant [sel] * ldropconow [sel] ) - #----- FSO, use LAI to scale them, we will normalise outside the loop. --# - fsopftdbh [m,d,p] = sum( laiconow [sel] * fsoconow [sel] ) - #----- CBAREL, like FSO, but we use nplant to scale them. ---------------# - cbarelpftdbh [m,d,p] = sum( nplantconow [sel] * cbarelconow [sel] ) - #------------------------------------------------------------------------# - }#end if - - #---------------------------------------------------------------------------# - # For mortality and growth, we keep deleting the tiny guys because they # - # skew the rates quite significantly. # - #---------------------------------------------------------------------------# - sel = sel & recruitconow == 2 - if (any(sel)){ - growthpftdbh [m,d,p] = sum( w.nplant [sel] * growthconow [sel] ) - - #---- This is the number of survivors and living before. ----------------# - survivor = sum( w.nplant[sel] ) - previous = sum( w.nplant[sel] * exp(mortconow[sel]) ) - mortpftdbh[m,d,p] = log( previous / survivor ) - - survivor = sum( w.nplant[sel] ) - previous = sum( w.nplant[sel] * exp(agemortconow[sel]) ) - agemortpftdbh [m,d,p] = log( previous / survivor ) - - survivor = sum( w.nplant[sel] ) - previous = sum( w.nplant[sel] * exp(ncbmortconow[sel]) ) - ncbmortpftdbh [m,d,p] = log( previous / survivor ) - - survivor = sum( w.nplant[sel] ) - previous = sum( w.nplant[sel] * exp(tfallmortconow[sel]) ) - tfallmortpftdbh[m,d,p] = log( previous / survivor ) - - survivor = sum( w.nplant[sel] ) - previous = sum( w.nplant[sel] * exp(coldmortconow[sel]) ) - coldmortpftdbh [m,d,p] = log( previous / survivor ) - - survivor = sum( w.nplant[sel] ) - previous = sum( w.nplant[sel] * exp(distmortconow[sel]) ) - distmortpftdbh [m,d,p] = log( previous / survivor ) - }#end if - #---------------------------------------------------------------------------# - }#end for PFT - #------------------------------------------------------------------------------# - }#end for DBH - #---------------------------------------------------------------------------------# - - - - #---------------------------------------------------------------------------------# - # Either sum or normalise variables. # - #---------------------------------------------------------------------------------# - for (p in 1:npft){ - - #---- Find the total for this PFT and store at class ndbh + 1... --------------# - laipftdbh [m,ndbh+1,p] = sum(laipftdbh [m,1:ndbh,p]) - waipftdbh [m,ndbh+1,p] = sum(waipftdbh [m,1:ndbh,p]) - taipftdbh [m,ndbh+1,p] = sum(taipftdbh [m,1:ndbh,p]) - nplantpftdbh [m,ndbh+1,p] = sum(nplantpftdbh [m,1:ndbh,p]) - agbpftdbh [m,ndbh+1,p] = sum(agbpftdbh [m,1:ndbh,p]) - gpppftdbh [m,ndbh+1,p] = sum(gpppftdbh [m,1:ndbh,p]) - npppftdbh [m,ndbh+1,p] = sum(npppftdbh [m,1:ndbh,p]) - mcopftdbh [m,ndbh+1,p] = sum(mcopftdbh [m,1:ndbh,p]) - cbapftdbh [m,ndbh+1,p] = sum(cbapftdbh [m,1:ndbh,p]) - ldrpftdbh [m,ndbh+1,p] = sum(ldrpftdbh [m,1:ndbh,p]) - demandpftdbh [m,ndbh+1,p] = sum(demandpftdbh [m,1:ndbh,p]) - supplypftdbh [m,ndbh+1,p] = sum(supplypftdbh [m,1:ndbh,p]) - #------------------------------------------------------------------------------# - - - #------------------------------------------------------------------------------# - # Find the average Fsopen for each DBH class and amongst all classes. # - #------------------------------------------------------------------------------# - for (d in 1:ndbh){ - #---------------------------------------------------------------------------# - # FSopen is scaled by LAI. # - #---------------------------------------------------------------------------# - if (laipftdbh[m,d,p] != 0){ - fsopftdbh[m,d,p] = fsopftdbh[m,d,p] / laipftdbh[m,d,p] - }#end if - }#end for - if (laipftdbh[m,ndbh+1,p] != 0){ - fsopftdbh[m,ndbh+1,p] = ( sum( fsopftdbh[m,1:ndbh,p] - * laipftdbh[m,1:ndbh,p] ) - / laipftdbh[m,ndbh+1,p] ) - }#end for - #------------------------------------------------------------------------------# - - - #------------------------------------------------------------------------------# - # Find the average relative carbon balance for each DBH class and amongst # - # all classes. # - #------------------------------------------------------------------------------# - for (d in 1:ndbh){ - #---------------------------------------------------------------------------# - # CBAREL is scaled by Nplant. # - #---------------------------------------------------------------------------# - if (nplantpftdbh[m,d,p] != 0){ - cbarelpftdbh[m,d,p] = cbarelpftdbh[m,d,p] / nplantpftdbh[m,d,p] - }#end if - }#end for - if (nplantpftdbh[m,ndbh+1,p] != 0){ - cbarelpftdbh[m,ndbh+1,p] = ( sum( cbarelpftdbh[m,1:ndbh,p] - * nplantpftdbh[m,1:ndbh,p] ) - / nplantpftdbh[m,ndbh+1,p] ) - }#end for - #------------------------------------------------------------------------------# + #---------------------------------------------------------------------------------------# + # Check whether we have anything to update. # + #---------------------------------------------------------------------------------------# + complete = tresume > ntimes + #---------------------------------------------------------------------------------------# - for (d in 2:ndbh){ - #---------------------------------------------------------------------------# - # Growth rate is scaled by NPlant. # - #---------------------------------------------------------------------------# - nplant.use = 0. - if (nplantpftdbh[m,d,p] != 0){ - nplant.use = nplant.use + nplantpftdbh[m,d,p] - growthpftdbh[m,d,p] = growthpftdbh[m,d,p] / nplantpftdbh[m,d,p] - }#end if - }#end for - if (nplant.use != 0){ - growthpftdbh[m,ndbh+1,p] = ( sum( growthpftdbh[m,2:ndbh,p] - * nplantpftdbh[m,2:ndbh,p] ) - / nplant.use ) - }#end for - #------------------------------------------------------------------------------# + #----- Copy some dimensions to scalars. ------------------------------------------------# + nzg = datum$nzg + nzs = datum$nzs + ndcycle = datum$ndcycle + isoilflg = datum$isoilflg + slz = datum$slz + slxsand = datum$slxsand + slxclay = datum$slxclay + ntext = datum$ntext + soil.prop = datum$soil.prop + dslz = datum$dslz + soil.depth = datum$soil.depth + soil.dry = datum$soil.dry + soil.poro = datum$soil.poro + ka = datum$ka + kz = datum$kz + #---------------------------------------------------------------------------------------# - #------------------------------------------------------------------------------# - # Find the mortality amongst all DBH classes for this PFT. This will # - # include the small cohorts too. # - #------------------------------------------------------------------------------# - if (all(is.na(pftconow))){ - sel = rep(FALSE,times=length(pftconow)) - }else{ - sel = pftconow == p & recruitconow == 2 - }#end if - #---- This is the number of survivors and living before. ----------------------# - survivor = sum( w.nplant[sel] ) - previous = sum( w.nplant[sel] * exp(mortconow[sel]) ) - mortpftdbh[m,ndbh+1,p] = log( previous / survivor) - - survivor = sum( w.nplant[sel] ) - previous = sum( w.nplant[sel] * exp(agemortconow[sel]) ) - agemortpftdbh[m,ndbh+1,p] = log( previous / survivor) - - survivor = sum( w.nplant[sel] ) - previous = sum( w.nplant[sel] * exp(ncbmortconow[sel]) ) - ncbmortpftdbh[m,ndbh+1,p] = log( previous / survivor) - - survivor = sum( w.nplant[sel] ) - previous = sum( w.nplant[sel] * exp(tfallmortconow[sel]) ) - tfallmortpftdbh[m,ndbh+1,p] = log( previous / survivor) - - survivor = sum( w.nplant[sel] ) - previous = sum( w.nplant[sel] * exp(coldmortconow[sel]) ) - coldmortpftdbh[m,ndbh+1,p] = log( previous / survivor) - - survivor = sum( w.nplant[sel] ) - previous = sum( w.nplant[sel] * exp(distmortconow[sel]) ) - distmortpftdbh[m,ndbh+1,p] = log( previous / survivor) - }#end for - #---------------------------------------------------------------------------------# + #---------------------------------------------------------------------------------------# + # Loop over all times in case there is anything new to be read. # + #---------------------------------------------------------------------------------------# + if (! complete){ + #------------------------------------------------------------------------------------# + # This function will read the files. # + #------------------------------------------------------------------------------------# + datum = read.q.files(datum=datum,ntimes=ntimes,tresume=tresume,sasmonth=sasmonth) + #------------------------------------------------------------------------------------# - #---------------------------------------------------------------------------------# - # Build the derived variables. # - #---------------------------------------------------------------------------------# - npp = c(npp ,sum(npppft [m,1:npft]) ) - mco = c(mco ,sum(mcopft [m,1:npft]) ) - cba = c(cba ,sum(cbapft [m,1:npft]) ) - nplant = c(nplant,sum(nplantpft[m,1:npft]) ) - lai = c(lai ,sum(laipft [m,1:npft]) ) - wai = c(wai ,sum(waipft [m,1:npft]) ) - tai = c(tai ,sum(taipft [m,1:npft]) ) - agb = c(agb ,sum(agbpft [m,1:npft]) ) - ldrop = c(ldrop ,sum(ldroppft [m,1:npft]) ) - #---------------------------------------------------------------------------------# - - - - - #---------------------------------------------------------------------------------# - # Build the cohort-level lists if this is the right month. # - #---------------------------------------------------------------------------------# - if (month %in% sasmonth){ - cyear = substring(10000 + year,2,5) - cmonth = substring(100+month,2,3) - labwhen = paste("y",cyear,"m",cmonth,sep="") - #----- Binding the current cohorts. -------------------------------------------# - lightco [[labwhen]] = lightconow - lightbeamco [[labwhen]] = lightbeamconow - lightdiffco [[labwhen]] = lightdiffconow - parlco [[labwhen]] = parlconow - gppco [[labwhen]] = gppconow - gpplco [[labwhen]] = gpplconow - respco [[labwhen]] = respconow - nppco [[labwhen]] = nppconow - cbaco [[labwhen]] = cbaconow - cbalightco [[labwhen]] = cbalightconow - cbamoistco [[labwhen]] = cbamoistconow - cbarelco [[labwhen]] = cbarelconow - mcostco [[labwhen]] = mcostconow - agbco [[labwhen]] = agbconow - fsoco [[labwhen]] = fsoconow - nplantco [[labwhen]] = nplantconow * areaconow - heightco [[labwhen]] = heightconow - baco [[labwhen]] = nplantconow * baconow * areaconow - pftco [[labwhen]] = pftconow - dbhco [[labwhen]] = dbhconow - laico [[labwhen]] = laiconow - waico [[labwhen]] = waiconow - taico [[labwhen]] = taiconow - ageco [[labwhen]] = ageconow - areaco [[labwhen]] = areaconow - demandco [[labwhen]] = demandconow - supplyco [[labwhen]] = supplyconow - baliveco [[labwhen]] = baliveconow - bdeadco [[labwhen]] = bdeadconow - bleafco [[labwhen]] = bleafconow - brootco [[labwhen]] = brootconow - bswoodco [[labwhen]] = bswoodconow - bstoreco [[labwhen]] = bstoreconow - growthco [[labwhen]] = growthconow - mortco [[labwhen]] = 100. * (1.0 - exp(-mortconow )) - agemortco [[labwhen]] = 100. * (1.0 - exp(-agemortconow )) - ncbmortco [[labwhen]] = 100. * (1.0 - exp(-ncbmortconow )) - tfallmortco [[labwhen]] = 100. * (1.0 - exp(-tfallmortconow )) - coldmortco [[labwhen]] = 100. * (1.0 - exp(-coldmortconow )) - distmortco [[labwhen]] = 100. * (1.0 - exp(-distmortconow )) - recruitco [[labwhen]] = 100. * (exp(recruitconow) - 1.0) - } #end if month=sasmonth - #---------------------------------------------------------------------------------# - }# end for, month + #------ Save the data to the R object. ----------------------------------------------# + cat(" + Saving data to ",basename(ed22.rdata),"...","\n") + save(datum,file=ed22.rdata) #------------------------------------------------------------------------------------# - }#end for, year + }#end if (! complete) #---------------------------------------------------------------------------------------# - #----- Find the date variables. --------------------------------------------------------# - thismonth = chron(thismonth,out.format=c(dates="day-mon-yr",times=NULL)) - mmonth = months(thismonth) - mfac = nummonths(thismonth) - moncensus = census(pop=mfac,categ=seq(from=1,to=12,by=1)) - moncnt = matrix(data=rep(moncensus,times=ndcycle),nrow=12) + #----- Make some shorter versions of some variables. -----------------------------------# + mfac = datum$month + dcycmean = datum$dcycmean + dcycmsqu = datum$dcycmsqu + #---------------------------------------------------------------------------------------# #---------------------------------------------------------------------------------------# # Here we find the monthly means for month, then compute the standard deviation. # #---------------------------------------------------------------------------------------# - print (" - Finding the monthly mean...") - print (" * Aggregating the monthly mean...") + cat (" - Finding the monthly mean...","\n") + cat (" * Aggregating the monthly mean...","\n") mont12mn = list() - mont12mn$gpp = tapply(X=gpp ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12mn$npp = tapply(X=npp ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12mn$nep = tapply(X=nep ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12mn$plresp = tapply(X=plresp ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12mn$leaf.resp = tapply(X=leaf.resp ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12mn$root.resp = tapply(X=root.resp ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12mn$growth.resp = tapply(X=growth.resp ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12mn$hetresp = tapply(X=hetresp ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12mn$cwdresp = tapply(X=cwdresp ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12mn$cflxca = tapply(X=cflxca ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12mn$cflxst = tapply(X=cflxst ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12mn$nee = tapply(X=nee ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12mn$reco = tapply(X=reco ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12mn$hflxca = tapply(X=hflxca ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12mn$hflxlc = tapply(X=hflxlc ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12mn$hflxwc = tapply(X=hflxwc ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12mn$hflxgc = tapply(X=hflxgc ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12mn$wflxca = tapply(X=wflxca ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12mn$qwflxca = tapply(X=qwflxca ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12mn$wflxlc = tapply(X=wflxlc ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12mn$wflxwc = tapply(X=wflxwc ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12mn$wflxgc = tapply(X=wflxgc ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12mn$evap = tapply(X=evap ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12mn$transp = tapply(X=transp ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12mn$rain = tapply(X=rain ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12mn$atm.temp = tapply(X=atm.temp ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12mn$rshort = tapply(X=rshort ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12mn$rlong = tapply(X=rlong ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12mn$atm.shv = tapply(X=atm.shv ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12mn$atm.co2 = tapply(X=atm.co2 ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12mn$atm.prss = tapply(X=atm.prss ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12mn$atm.vels = tapply(X=atm.vels ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12mn$ustar = tapply(X=ustar ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12mn$soil.temp = qapply(X=soil.temp ,INDEX=mfac,DIM=1,FUN=mean,na.rm=TRUE) - mont12mn$soil.water = qapply(X=soil.water ,INDEX=mfac,DIM=1,FUN=mean,na.rm=TRUE) - mont12mn$soil.mstpot = qapply(X=soil.mstpot ,INDEX=mfac,DIM=1,FUN=mean,na.rm=TRUE) + mont12mn$gpp = tapply(X=datum$gpp ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$npp = tapply(X=datum$npp ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$nep = tapply(X=datum$nep ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$plresp = tapply(X=datum$plresp ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$leaf.resp = tapply(X=datum$leaf.resp ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$root.resp = tapply(X=datum$root.resp ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$growth.resp = tapply(X=datum$growth.resp ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$hetresp = tapply(X=datum$hetresp ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$cwdresp = tapply(X=datum$cwdresp ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$cflxca = tapply(X=datum$cflxca ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$cflxst = tapply(X=datum$cflxst ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$nee = tapply(X=datum$nee ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$reco = tapply(X=datum$reco ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$hflxca = tapply(X=datum$hflxca ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$hflxlc = tapply(X=datum$hflxlc ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$hflxwc = tapply(X=datum$hflxwc ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$hflxgc = tapply(X=datum$hflxgc ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$wflxca = tapply(X=datum$wflxca ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$qwflxca = tapply(X=datum$qwflxca ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$wflxlc = tapply(X=datum$wflxlc ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$wflxwc = tapply(X=datum$wflxwc ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$wflxgc = tapply(X=datum$wflxgc ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$evap = tapply(X=datum$evap ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$transp = tapply(X=datum$transp ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$rain = tapply(X=datum$rain ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$atm.temp = tapply(X=datum$atm.temp ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$rshort = tapply(X=datum$rshort ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$rshortup = tapply(X=datum$rshortup ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$rlong = tapply(X=datum$rlong ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$rlongup = tapply(X=datum$rlongup ,INDEX=mfac ,FUN=mean,na.rm=T) + # mont12mn$par.tot = tapply(X=datum$par.tot ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$parup = tapply(X=datum$parup ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$rnet = tapply(X=datum$rnet ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$albedo = tapply(X=datum$albedo ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$atm.shv = tapply(X=datum$atm.shv ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$atm.co2 = tapply(X=datum$atm.co2 ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$atm.prss = tapply(X=datum$atm.prss ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$atm.vels = tapply(X=datum$atm.vels ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$ustar = tapply(X=datum$ustar ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$soil.temp = qapply(X=datum$soil.temp ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) + mont12mn$soil.water = qapply(X=datum$soil.water ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) + mont12mn$soil.mstpot = qapply(X=datum$soil.mstpot ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) #----- Find the mean sum of squares. ---------------------------------------------------# - print (" * Aggregating the monthly mean sum of squares...") + cat (" * Aggregating the monthly mean sum of squares...","\n") mont12sq = list() - mont12sq$gpp = tapply(X=mmsqu.gpp ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12sq$plresp = tapply(X=mmsqu.plresp ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12sq$leaf.resp = tapply(X=mmsqu.leaf.resp ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12sq$root.resp = tapply(X=mmsqu.root.resp ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12sq$hetresp = tapply(X=mmsqu.hetresp ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12sq$cwdresp = tapply(X=mmsqu.cwdresp ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12sq$cflxca = tapply(X=mmsqu.cflxca ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12sq$cflxst = tapply(X=mmsqu.cflxst ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12sq$hflxca = tapply(X=mmsqu.hflxca ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12sq$hflxlc = tapply(X=mmsqu.hflxlc ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12sq$hflxwc = tapply(X=mmsqu.hflxwc ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12sq$hflxgc = tapply(X=mmsqu.hflxgc ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12sq$wflxca = tapply(X=mmsqu.wflxca ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12sq$qwflxca = tapply(X=mmsqu.qwflxca ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12sq$wflxlc = tapply(X=mmsqu.wflxlc ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12sq$wflxwc = tapply(X=mmsqu.wflxwc ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12sq$wflxgc = tapply(X=mmsqu.wflxgc ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12sq$evap = tapply(X=mmsqu.evap ,INDEX=mfac ,FUN=mean,na.rm=TRUE) - mont12sq$transp = tapply(X=mmsqu.transp ,INDEX=mfac ,FUN=mean,na.rm=TRUE) + mont12sq$gpp = tapply(X=datum$mmsqu.gpp ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12sq$plresp = tapply(X=datum$mmsqu.plresp ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12sq$leaf.resp = tapply(X=datum$mmsqu.leaf.resp ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12sq$root.resp = tapply(X=datum$mmsqu.root.resp ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12sq$hetresp = tapply(X=datum$mmsqu.hetresp ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12sq$cwdresp = tapply(X=datum$mmsqu.cwdresp ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12sq$cflxca = tapply(X=datum$mmsqu.cflxca ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12sq$cflxst = tapply(X=datum$mmsqu.cflxst ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12sq$hflxca = tapply(X=datum$mmsqu.hflxca ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12sq$hflxlc = tapply(X=datum$mmsqu.hflxlc ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12sq$hflxwc = tapply(X=datum$mmsqu.hflxwc ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12sq$hflxgc = tapply(X=datum$mmsqu.hflxgc ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12sq$wflxca = tapply(X=datum$mmsqu.wflxca ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12sq$qwflxca = tapply(X=datum$mmsqu.qwflxca ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12sq$wflxlc = tapply(X=datum$mmsqu.wflxlc ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12sq$wflxwc = tapply(X=datum$mmsqu.wflxwc ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12sq$wflxgc = tapply(X=datum$mmsqu.wflxgc ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12sq$evap = tapply(X=datum$mmsqu.evap ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12sq$transp = tapply(X=datum$mmsqu.transp ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12sq$ustar = tapply(X=datum$mmsqu.ustar ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12sq$albedo = tapply(X=datum$mmsqu.albedo ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12sq$rshortup = tapply(X=datum$mmsqu.rshortup ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12sq$rlongup = tapply(X=datum$mmsqu.rlongup ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12sq$parup = tapply(X=datum$mmsqu.parup ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12sq$rnet = tapply(X=datum$mmsqu.rnet ,INDEX=mfac ,FUN=mean,na.rm=T) #---------------------------------------------------------------------------------------# # Here we convert the sum of squares into standard deviation. The standard devi- # # ation can be written in two different ways, and we will use the latter because it # @@ -1664,8 +404,8 @@ for (place in myplaces){ # srnonm1 is the square root of 1 / (1 - 1/N) # # Find the standard deviation. # #---------------------------------------------------------------------------------------# - print (" * Finding the standard deviation...") - srnorm1 = sqrt(1./(1. - 1. / moncensus)) + cat (" * Finding the standard deviation...","\n") + srnorm1 = sqrt(1./(1. - 1. / datum$montable)) srnorm1[!is.finite(srnorm1)] = 0. mont12sd = list() mont12sd$gpp = sqrt(mont12sq$gpp - mont12mn$gpp^2 ) * srnorm1 @@ -1687,30 +427,42 @@ for (place in myplaces){ mont12sd$wflxgc = sqrt(mont12sq$wflxgc - mont12mn$wflxgc^2 ) * srnorm1 mont12sd$evap = sqrt(mont12sq$evap - mont12mn$evap^2 ) * srnorm1 mont12sd$transp = sqrt(mont12sq$transp - mont12mn$transp^2 ) * srnorm1 + mont12sd$ustar = sqrt(mont12sq$ustar - mont12mn$ustar^2 ) * srnorm1 + mont12sd$albedo = sqrt(mont12sq$albedo - mont12mn$albedo^2 ) * srnorm1 + mont12sd$rshortup = sqrt(mont12sq$rshortup - mont12mn$rshortup^2 ) * srnorm1 + mont12sd$rlongup = sqrt(mont12sq$rlongup - mont12mn$rlongup^2 ) * srnorm1 + mont12sd$parup = sqrt(mont12sq$parup - mont12mn$parup^2 ) * srnorm1 + mont12sd$rnet = sqrt(mont12sq$rnet - mont12mn$rnet^2 ) * srnorm1 #---------------------------------------------------------------------------------------# # Set standard deviations that became NaN to 0. This usually happens when we run # # the post-processing script when the simulation hasn't run for more than 2 years. We # # can't find the standard deviation because the number of degrees of freedom becomes 0. # #---------------------------------------------------------------------------------------# - mont12sd$gpp [!is.finite(mont12mn$gpp )] = 0. - mont12sd$plresp [!is.finite(mont12mn$plresp )] = 0. - mont12sd$leaf.resp [!is.finite(mont12mn$leaf.resp )] = 0. - mont12sd$root.resp [!is.finite(mont12mn$root.resp )] = 0. - mont12sd$hetresp [!is.finite(mont12mn$hetresp )] = 0. - mont12sd$cwdresp [!is.finite(mont12mn$cwdresp )] = 0. - mont12sd$cflxca [!is.finite(mont12mn$cflxca )] = 0. - mont12sd$cflxst [!is.finite(mont12mn$cflxst )] = 0. - mont12sd$hflxca [!is.finite(mont12mn$hflxca )] = 0. - mont12sd$hflxlc [!is.finite(mont12mn$hflxlc )] = 0. - mont12sd$hflxlc [!is.finite(mont12mn$hflxwc )] = 0. - mont12sd$hflxgc [!is.finite(mont12mn$hflxgc )] = 0. - mont12sd$wflxca [!is.finite(mont12mn$wflxca )] = 0. - mont12sd$qwflxca [!is.finite(mont12mn$qwflxca )] = 0. - mont12sd$wflxlc [!is.finite(mont12mn$wflxlc )] = 0. - mont12sd$wflxwc [!is.finite(mont12mn$wflxwc )] = 0. - mont12sd$wflxgc [!is.finite(mont12mn$wflxgc )] = 0. - mont12sd$evap [!is.finite(mont12mn$evap )] = 0. - mont12sd$transp [!is.finite(mont12mn$transp )] = 0. + mont12sd$gpp [!is.finite(mont12sd$gpp )] = 0. + mont12sd$plresp [!is.finite(mont12sd$plresp )] = 0. + mont12sd$leaf.resp [!is.finite(mont12sd$leaf.resp )] = 0. + mont12sd$root.resp [!is.finite(mont12sd$root.resp )] = 0. + mont12sd$hetresp [!is.finite(mont12sd$hetresp )] = 0. + mont12sd$cwdresp [!is.finite(mont12sd$cwdresp )] = 0. + mont12sd$cflxca [!is.finite(mont12sd$cflxca )] = 0. + mont12sd$cflxst [!is.finite(mont12sd$cflxst )] = 0. + mont12sd$hflxca [!is.finite(mont12sd$hflxca )] = 0. + mont12sd$hflxlc [!is.finite(mont12sd$hflxlc )] = 0. + mont12sd$hflxlc [!is.finite(mont12sd$hflxwc )] = 0. + mont12sd$hflxgc [!is.finite(mont12sd$hflxgc )] = 0. + mont12sd$wflxca [!is.finite(mont12sd$wflxca )] = 0. + mont12sd$qwflxca [!is.finite(mont12sd$qwflxca )] = 0. + mont12sd$wflxlc [!is.finite(mont12sd$wflxlc )] = 0. + mont12sd$wflxwc [!is.finite(mont12sd$wflxwc )] = 0. + mont12sd$wflxgc [!is.finite(mont12sd$wflxgc )] = 0. + mont12sd$evap [!is.finite(mont12sd$evap )] = 0. + mont12sd$transp [!is.finite(mont12sd$transp )] = 0. + mont12sd$ustar [!is.finite(mont12sd$ustar )] = 0. + mont12sd$albedo [!is.finite(mont12sd$albedo )] = 0. + mont12sd$rshortup [!is.finite(mont12sd$rshortup )] = 0. + mont12sd$rlongup [!is.finite(mont12sd$rlongup )] = 0. + mont12sd$parup [!is.finite(mont12sd$parup )] = 0. + mont12sd$rnet [!is.finite(mont12sd$rnet )] = 0. #---------------------------------------------------------------------------------------# # Estimate the standard deviation of NPP, NEP, NEE, and REco. # #---------------------------------------------------------------------------------------# @@ -1725,7 +477,7 @@ for (place in myplaces){ # Here we find the Mean diurnal cycle for each month, then compute the standard # # deviation. # #---------------------------------------------------------------------------------------# - print (" - Aggregating the monthly mean of the diurnal cycle...") + cat (" - Aggregating the monthly mean of the diurnal cycle...","\n") dcyc12mn =list() dcyc12mn$gpp =qapply(X=dcycmean$gpp ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) dcyc12mn$npp =qapply(X=dcycmean$npp ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) @@ -1772,17 +524,24 @@ for (place in myplaces){ dcyc12mn$rshort =qapply(X=dcycmean$rshort ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) dcyc12mn$rshort.beam =qapply(X=dcycmean$rshort.beam ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) dcyc12mn$rshort.diff =qapply(X=dcycmean$rshort.diff ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) - dcyc12mn$rlong =qapply(X=dcycmean$rlong ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) dcyc12mn$rshort.gnd =qapply(X=dcycmean$rshort.gnd ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$rshortup =qapply(X=dcycmean$rshortup ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$rlong =qapply(X=dcycmean$rlong ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) dcyc12mn$rlong.gnd =qapply(X=dcycmean$rlong.gnd ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) dcyc12mn$rlongup =qapply(X=dcycmean$rlongup ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) + # dcyc12mn$par.tot =qapply(X=dcycmean$par.tot ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) + # dcyc12mn$par.beam =qapply(X=dcycmean$par.beam ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) + # dcyc12mn$par.diff =qapply(X=dcycmean$par.diff ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) + # dcyc12mn$par.gnd =qapply(X=dcycmean$par.gnd ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$parup =qapply(X=dcycmean$parup ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$rnet =qapply(X=dcycmean$rnet ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) dcyc12mn$albedo =qapply(X=dcycmean$albedo ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) dcyc12mn$albedo.beam =qapply(X=dcycmean$albedo.beam ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) dcyc12mn$albedo.diff =qapply(X=dcycmean$albedo.diff ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) dcyc12mn$rlong.albedo=qapply(X=dcycmean$rlong.albedo,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) #----- Find the mean sum of squares. ---------------------------------------------------# - print (" - Aggregating the monthly mean sum of squares...") + cat (" - Aggregating the monthly mean sum of squares...","\n") dcyc12sq = list() dcyc12sq$gpp = qapply(X=dcycmsqu$gpp ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) dcyc12sq$plresp = qapply(X=dcycmsqu$plresp ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) @@ -1803,6 +562,12 @@ for (place in myplaces){ dcyc12sq$wflxwc = qapply(X=dcycmsqu$wflxwc ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) dcyc12sq$wflxgc = qapply(X=dcycmsqu$wflxgc ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) dcyc12sq$transp = qapply(X=dcycmsqu$transp ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) + dcyc12sq$ustar = qapply(X=dcycmsqu$ustar ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) + dcyc12sq$albedo = qapply(X=dcycmsqu$albedo ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) + dcyc12sq$rshortup = qapply(X=dcycmsqu$rshortup ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) + dcyc12sq$rlongup = qapply(X=dcycmsqu$rlongup ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) + dcyc12sq$parup = qapply(X=dcycmsqu$parup ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) + dcyc12sq$rnet = qapply(X=dcycmsqu$rnet ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) #---------------------------------------------------------------------------------------# # Here we convert the sum of squares into standard deviation. The standard devi- # @@ -1816,53 +581,65 @@ for (place in myplaces){ # srnonm1 is the square root of 1 / (1 - 1/N) # # Find the standard deviation. # #---------------------------------------------------------------------------------------# - print (" - Finding the standard deviation...") - srnorm1 = sqrt(1./(1. - 1. / moncnt)) + cat (" - Finding the standard deviation...","\n") + srnorm1 = sqrt(1./(1. - 1. / datum$moncnt)) srnorm1[!is.finite(srnorm1)] = 0. dcyc12sd = list() - dcyc12sd$gpp = sqrt(dcyc12sq$gpp -dcyc12mn$gpp^2 )*srnorm1 - dcyc12sd$plresp = sqrt(dcyc12sq$plresp -dcyc12mn$plresp^2 )*srnorm1 - dcyc12sd$leaf.resp = sqrt(dcyc12sq$leaf.resp-dcyc12mn$leaf.resp^2 )*srnorm1 - dcyc12sd$root.resp = sqrt(dcyc12sq$root.resp-dcyc12mn$root.resp^2 )*srnorm1 - dcyc12sd$hetresp = sqrt(dcyc12sq$hetresp -dcyc12mn$hetresp^2 )*srnorm1 - dcyc12sd$cwdresp = sqrt(dcyc12sq$cwdresp -dcyc12mn$cwdresp^2 )*srnorm1 - dcyc12sd$nep = sqrt(dcyc12sq$nep -dcyc12mn$nep^2 )*srnorm1 - dcyc12sd$cflxca = sqrt(dcyc12sq$cflxca -dcyc12mn$cflxca^2 )*srnorm1 - dcyc12sd$cflxst = sqrt(dcyc12sq$cflxst -dcyc12mn$cflxst^2 )*srnorm1 - dcyc12sd$hflxca = sqrt(dcyc12sq$hflxca -dcyc12mn$hflxca^2 )*srnorm1 - dcyc12sd$hflxlc = sqrt(dcyc12sq$hflxlc -dcyc12mn$hflxlc^2 )*srnorm1 - dcyc12sd$hflxwc = sqrt(dcyc12sq$hflxwc -dcyc12mn$hflxwc^2 )*srnorm1 - dcyc12sd$hflxgc = sqrt(dcyc12sq$hflxgc -dcyc12mn$hflxgc^2 )*srnorm1 - dcyc12sd$wflxca = sqrt(dcyc12sq$wflxca -dcyc12mn$wflxca^2 )*srnorm1 - dcyc12sd$qwflxca = sqrt(dcyc12sq$qwflxca -dcyc12mn$qwflxca^2 )*srnorm1 - dcyc12sd$wflxlc = sqrt(dcyc12sq$wflxlc -dcyc12mn$wflxlc^2 )*srnorm1 - dcyc12sd$wflxwc = sqrt(dcyc12sq$wflxwc -dcyc12mn$wflxwc^2 )*srnorm1 - dcyc12sd$wflxgc = sqrt(dcyc12sq$wflxgc -dcyc12mn$wflxgc^2 )*srnorm1 - dcyc12sd$transp = sqrt(dcyc12sq$transp -dcyc12mn$transp^2 )*srnorm1 + dcyc12sd$gpp = sqrt(dcyc12sq$gpp - dcyc12mn$gpp^2 )*srnorm1 + dcyc12sd$plresp = sqrt(dcyc12sq$plresp - dcyc12mn$plresp^2 )*srnorm1 + dcyc12sd$leaf.resp = sqrt(dcyc12sq$leaf.resp - dcyc12mn$leaf.resp^2 )*srnorm1 + dcyc12sd$root.resp = sqrt(dcyc12sq$root.resp - dcyc12mn$root.resp^2 )*srnorm1 + dcyc12sd$hetresp = sqrt(dcyc12sq$hetresp - dcyc12mn$hetresp^2 )*srnorm1 + dcyc12sd$cwdresp = sqrt(dcyc12sq$cwdresp - dcyc12mn$cwdresp^2 )*srnorm1 + dcyc12sd$nep = sqrt(dcyc12sq$nep - dcyc12mn$nep^2 )*srnorm1 + dcyc12sd$cflxca = sqrt(dcyc12sq$cflxca - dcyc12mn$cflxca^2 )*srnorm1 + dcyc12sd$cflxst = sqrt(dcyc12sq$cflxst - dcyc12mn$cflxst^2 )*srnorm1 + dcyc12sd$hflxca = sqrt(dcyc12sq$hflxca - dcyc12mn$hflxca^2 )*srnorm1 + dcyc12sd$hflxlc = sqrt(dcyc12sq$hflxlc - dcyc12mn$hflxlc^2 )*srnorm1 + dcyc12sd$hflxwc = sqrt(dcyc12sq$hflxwc - dcyc12mn$hflxwc^2 )*srnorm1 + dcyc12sd$hflxgc = sqrt(dcyc12sq$hflxgc - dcyc12mn$hflxgc^2 )*srnorm1 + dcyc12sd$wflxca = sqrt(dcyc12sq$wflxca - dcyc12mn$wflxca^2 )*srnorm1 + dcyc12sd$qwflxca = sqrt(dcyc12sq$qwflxca - dcyc12mn$qwflxca^2 )*srnorm1 + dcyc12sd$wflxlc = sqrt(dcyc12sq$wflxlc - dcyc12mn$wflxlc^2 )*srnorm1 + dcyc12sd$wflxwc = sqrt(dcyc12sq$wflxwc - dcyc12mn$wflxwc^2 )*srnorm1 + dcyc12sd$wflxgc = sqrt(dcyc12sq$wflxgc - dcyc12mn$wflxgc^2 )*srnorm1 + dcyc12sd$transp = sqrt(dcyc12sq$transp - dcyc12mn$transp^2 )*srnorm1 + dcyc12sd$ustar = sqrt(dcyc12sq$ustar - dcyc12mn$ustar^2 )*srnorm1 + dcyc12sd$albedo = sqrt(dcyc12sq$albedo - dcyc12mn$albedo^2 )*srnorm1 + dcyc12sd$rshortup = sqrt(dcyc12sq$rshortup - dcyc12mn$rshortup^2 )*srnorm1 + dcyc12sd$rlongup = sqrt(dcyc12sq$rlongup - dcyc12mn$rlongup^2 )*srnorm1 + dcyc12sd$parup = sqrt(dcyc12sq$parup - dcyc12mn$parup^2 )*srnorm1 + dcyc12sd$rnet = sqrt(dcyc12sq$rnet - dcyc12mn$rnet^2 )*srnorm1 #---------------------------------------------------------------------------------------# # Set standard deviations that became NaN to 0. This usually happens when we run # # the post-processing script when the simulation hasn't run for more than 2 years. We # # can't find the standard deviation because the number of degrees of freedom becomes 0. # #---------------------------------------------------------------------------------------# - dcyc12sd$gpp [!is.finite(dcyc12sd$gpp )] = 0. - dcyc12sd$plresp [!is.finite(dcyc12sd$plresp )] = 0. - dcyc12sd$leaf.resp [!is.finite(dcyc12sd$leaf.resp )] = 0. - dcyc12sd$root.resp [!is.finite(dcyc12sd$root.resp )] = 0. - dcyc12sd$hetresp [!is.finite(dcyc12sd$hetresp )] = 0. - dcyc12sd$cwdresp [!is.finite(dcyc12sd$cwdresp )] = 0. - dcyc12sd$nep [!is.finite(dcyc12sd$nep )] = 0. - dcyc12sd$cflxca [!is.finite(dcyc12sd$cflxca )] = 0. - dcyc12sd$cflxst [!is.finite(dcyc12sd$cflxst )] = 0. - dcyc12sd$hflxca [!is.finite(dcyc12sd$hflxca )] = 0. - dcyc12sd$hflxlc [!is.finite(dcyc12sd$hflxlc )] = 0. - dcyc12sd$hflxwc [!is.finite(dcyc12sd$hflxwc )] = 0. - dcyc12sd$hflxgc [!is.finite(dcyc12sd$hflxgc )] = 0. - dcyc12sd$wflxca [!is.finite(dcyc12sd$wflxca )] = 0. - dcyc12sd$qwflxca [!is.finite(dcyc12sd$qwflxca )] = 0. - dcyc12sd$wflxlc [!is.finite(dcyc12sd$wflxlc )] = 0. - dcyc12sd$wflxwc [!is.finite(dcyc12sd$wflxwc )] = 0. - dcyc12sd$wflxgc [!is.finite(dcyc12sd$wflxgc )] = 0. - dcyc12sd$transp [!is.finite(dcyc12sd$transp )] = 0. + dcyc12sd$gpp [! is.finite(dcyc12sd$gpp )] = 0. + dcyc12sd$plresp [! is.finite(dcyc12sd$plresp )] = 0. + dcyc12sd$leaf.resp [! is.finite(dcyc12sd$leaf.resp )] = 0. + dcyc12sd$root.resp [! is.finite(dcyc12sd$root.resp )] = 0. + dcyc12sd$hetresp [! is.finite(dcyc12sd$hetresp )] = 0. + dcyc12sd$cwdresp [! is.finite(dcyc12sd$cwdresp )] = 0. + dcyc12sd$nep [! is.finite(dcyc12sd$nep )] = 0. + dcyc12sd$cflxca [! is.finite(dcyc12sd$cflxca )] = 0. + dcyc12sd$cflxst [! is.finite(dcyc12sd$cflxst )] = 0. + dcyc12sd$hflxca [! is.finite(dcyc12sd$hflxca )] = 0. + dcyc12sd$hflxlc [! is.finite(dcyc12sd$hflxlc )] = 0. + dcyc12sd$hflxwc [! is.finite(dcyc12sd$hflxwc )] = 0. + dcyc12sd$hflxgc [! is.finite(dcyc12sd$hflxgc )] = 0. + dcyc12sd$wflxca [! is.finite(dcyc12sd$wflxca )] = 0. + dcyc12sd$qwflxca [! is.finite(dcyc12sd$qwflxca )] = 0. + dcyc12sd$wflxlc [! is.finite(dcyc12sd$wflxlc )] = 0. + dcyc12sd$wflxwc [! is.finite(dcyc12sd$wflxwc )] = 0. + dcyc12sd$wflxgc [! is.finite(dcyc12sd$wflxgc )] = 0. + dcyc12sd$transp [! is.finite(dcyc12sd$transp )] = 0. + dcyc12sd$ustar [! is.finite(dcyc12sd$ustar )] = 0. + dcyc12sd$albedo [! is.finite(dcyc12sd$albedo )] = 0. + dcyc12sd$rshortup [! is.finite(dcyc12sd$rshortup )] = 0. + dcyc12sd$rlongup [! is.finite(dcyc12sd$rlongup )] = 0. + dcyc12sd$parup [! is.finite(dcyc12sd$parup )] = 0. + dcyc12sd$rnet [! is.finite(dcyc12sd$rnet )] = 0. #---------------------------------------------------------------------------------------# # Estimate NPP and NEE standard deviation. # #---------------------------------------------------------------------------------------# @@ -1877,65 +654,78 @@ for (place in myplaces){ # Remove all elements of the DBH/PFT class that do not have a single valid cohort # # at any given time. # #---------------------------------------------------------------------------------------# - empty = nplantpftdbh == 0 - agbpftdbh [empty] = NA - laipftdbh [empty] = NA - waipftdbh [empty] = NA - taipftdbh [empty] = NA - gpppftdbh [empty] = NA - npppftdbh [empty] = NA - mcopftdbh [empty] = NA - cbapftdbh [empty] = NA - ldrpftdbh [empty] = NA - fsopftdbh [empty] = NA - demandpftdbh [empty] = NA - supplypftdbh [empty] = NA - nplantpftdbh [empty] = NA - #---------------------------------------------------------------------------------------# - - #---------------------------------------------------------------------------------------# - #---------------------------------------------------------------------------------------# - mortpftdbh = 100. * (1.0 - exp(- mortpftdbh )) - agemortpftdbh = 100. * (1.0 - exp(- agemortpftdbh )) - ncbmortpftdbh = 100. * (1.0 - exp(- ncbmortpftdbh )) - tfallmortpftdbh = 100. * (1.0 - exp(- tfallmortpftdbh)) - coldmortpftdbh = 100. * (1.0 - exp(- coldmortpftdbh )) - distmortpftdbh = 100. * (1.0 - exp(- distmortpftdbh )) - mortpft = 100. * (1.0 - exp(- mortpft )) - agemortpft = 100. * (1.0 - exp(- agemortpft )) - ncbmortpft = 100. * (1.0 - exp(- ncbmortpft )) - tfallmortpft = 100. * (1.0 - exp(- tfallmortpft )) - coldmortpft = 100. * (1.0 - exp(- coldmortpft )) - distmortpft = 100. * (1.0 - exp(- distmortpft )) - recrpft = 100. * (exp( recrpft ) - 1.0) + empty = datum$nplantpftdbh == 0 + datum$agbpftdbh [empty] = NA + datum$basareapftdbh [empty] = NA + datum$laipftdbh [empty] = NA + datum$waipftdbh [empty] = NA + datum$taipftdbh [empty] = NA + datum$gpppftdbh [empty] = NA + datum$npppftdbh [empty] = NA + datum$mcopftdbh [empty] = NA + datum$cbapftdbh [empty] = NA + datum$cbalightpftdbh [empty] = NA + datum$cbamoistpftdbh [empty] = NA + datum$cbarelpftdbh [empty] = NA + datum$ldroppftdbh [empty] = NA + datum$fsopftdbh [empty] = NA + datum$demandpftdbh [empty] = NA + datum$supplypftdbh [empty] = NA + datum$mortpftdbh [empty] = NA + datum$agemortpftdbh [empty] = NA + datum$ncbmortpftdbh [empty] = NA + datum$tfallmortpftdbh [empty] = NA + datum$coldmortpftdbh [empty] = NA + datum$distmortpftdbh [empty] = NA + datum$growthpftdbh [empty] = NA + datum$nplantpftdbh [empty] = NA + #---------------------------------------------------------------------------------------# + + + #---------------------------------------------------------------------------------------# + # Replace the mortality and recruitment exponential rates by the "interests" rates. # + #---------------------------------------------------------------------------------------# + datum$mortpftdbh = 100. * (1.0 - exp(- datum$mortpftdbh )) + datum$agemortpftdbh = 100. * (1.0 - exp(- datum$agemortpftdbh )) + datum$ncbmortpftdbh = 100. * (1.0 - exp(- datum$ncbmortpftdbh )) + datum$tfallmortpftdbh = 100. * (1.0 - exp(- datum$tfallmortpftdbh)) + datum$coldmortpftdbh = 100. * (1.0 - exp(- datum$coldmortpftdbh )) + datum$distmortpftdbh = 100. * (1.0 - exp(- datum$distmortpftdbh )) + datum$mortpft = 100. * (1.0 - exp(- datum$mortpft )) + datum$agemortpft = 100. * (1.0 - exp(- datum$agemortpft )) + datum$ncbmortpft = 100. * (1.0 - exp(- datum$ncbmortpft )) + datum$tfallmortpft = 100. * (1.0 - exp(- datum$tfallmortpft )) + datum$coldmortpft = 100. * (1.0 - exp(- datum$coldmortpft )) + datum$distmortpft = 100. * (1.0 - exp(- datum$distmortpft )) + datum$recrpft = 100. * (exp( datum$recrpft ) - 1.0) #---------------------------------------------------------------------------------------# #----- Find which PFTs, land uses and transitions we need to consider ------------------# - pftave = colMeans(agbpft,na.rm=TRUE) - luave = colMeans(agblu ,na.rm=TRUE) + pftave = colMeans(datum$agbpft,na.rm=TRUE) + luave = colMeans(datum$agblu ,na.rm=TRUE) distave = matrix(NA,nrow=3,ncol=3) for (jlu in 1:nlu){ for (ilu in 1:nlu){ - distave[ilu,jlu] = mean(dist[,ilu,jlu]) + distave[ilu,jlu] = mean(datum$dist[,ilu,jlu]) }#end for }#end for selpft = pftave > 0. sellu = luave > 0. seldist = distave > 0. + #---------------------------------------------------------------------------------------# - #----- Determine the last data available. ----------------------------------------------# - tlast = length(thismonth) #---------------------------------------------------------------------------------------# - # Define a suitable scale for those time series that uses thismonth... # + # Define a suitable scale for those time series that uses datum$tomonth... # #---------------------------------------------------------------------------------------# - whenplot6 = pretty.time(thismonth,n=6) - whenplot8 = pretty.time(thismonth,n=8) + whenplot6 = pretty.time(datum$tomonth,n=6) + whenplot8 = pretty.time(datum$tomonth,n=8) #---------------------------------------------------------------------------------------# + #---------------------------------------------------------------------------------------# # Define a suitable scale for diurnal cycle... # #---------------------------------------------------------------------------------------# @@ -1983,7 +773,7 @@ for (place in myplaces){ #=======================================================================================# # Plotting section begins here... # #---------------------------------------------------------------------------------------# - print (" - Plotting figures...") + cat (" - Plotting figures...","\n") #---------------------------------------------------------------------------------------# @@ -2007,10 +797,10 @@ for (place in myplaces){ #---------------------------------------------------------------------------------# outdir = paste(outpref,"tspft",sep="/") if (! file.exists(outdir)) dir.create(outdir) - print (paste(" +",description,"time series for all PFTs...")) + cat(" + ",description," time series for all PFTs...","\n") #----- Load variable -------------------------------------------------------------# - thisvar = get(vnam) + thisvar = datum[[vnam]] if (plog){ #----- Eliminate non-positive values in case it is a log plot. ----------------# thisvar[thisvar <= 0] = NA @@ -2040,32 +830,15 @@ for (place in myplaces){ # Find the limit, make some room for the legend, and in case the field is # # a constant, nudge the limits so the plot command will not complain. # #------------------------------------------------------------------------------# + ylimit = pretty.xylim(u=thisvar[,selpft],fracexp=scalleg,is.log=plog) if (plog){ - xylog = "y" - ylimit = range(log(thisvar[,selpft]),na.rm=TRUE) - if (any(! is.finite(ylimit)) || (ylimit[1] == ylimit[2] && ylimit[1] == 0)){ - ylimit = c(-1,1) - }else if (ylimit[1] == ylimit[2] ){ - ylimit[1] = ylimit[1] * ( 1. - sign(ylimit[1]) * ylnudge) - ylimit[2] = ylimit[2] * ( 1. + sign(ylimit[2]) * ylnudge) - }else{ - ylimit[2] = ylimit[2] + scalleg * (ylimit[2] - ylimit[1]) - }#end if - ydrought = c(ylimit[1] - 0.5 * (ylimit[2]-ylimit[1]) - ,ylimit[2] + 0.5 * (ylimit[2]-ylimit[1])) - ylimit = exp(ylimit) + xylog = "y" + ydrought = c( exp(ylimit[1] * sqrt(ylimit[1]/ylimit[2])) + , exp(ylimit[2] * sqrt(ylimit[2]/ylimit[1])) + )#end c }else{ - ylimit = range(thisvar[,selpft],na.rm=TRUE) - xylog="" - if (ylimit[1] == ylimit[2] && ylimit[1] == 0){ - ylimit = c(-1,1) - }else if(ylimit[1] == ylimit[2] ){ - ylimit[1] = ylimit[1] * ( 1. - sign(ylimit[1]) * ylnudge) - ylimit[2] = ylimit[2] * ( 1. + sign(ylimit[2]) * ylnudge) - }#end if - ylimit[2] = ylimit[2] + scalleg * (ylimit[2] - ylimit[1]) - ydrought = c(ylimit[1] - 0.5 * (ylimit[2]-ylimit[1]) - ,ylimit[2] + 0.5 * (ylimit[2]-ylimit[1])) + xylog = "" + ydrought = c(ylimit[1] - 0.5 * diff(ylimit), ylimit[2] + 0.5 * diff(ylimit)) }#end if #------------------------------------------------------------------------------# @@ -2074,7 +847,7 @@ for (place in myplaces){ letitre = paste(description,lieu,sep=" - ") cols = pft$colour[selpft] legs = pft$name [selpft] - plot(x=thismonth,y=thisvar[,1],type="n",main=letitre,ylim=ylimit + plot(x=datum$tomonth,y=thisvar[,1],type="n",main=letitre,ylim=ylimit ,xlab="Time",xaxt="n",ylab=unit,cex.main=0.7,log=xylog) axis(side=1,at=whenplot8$levels,labels=whenplot8$labels,padj=whenplot8$padj) @@ -2091,7 +864,7 @@ for (place in myplaces){ }#end if for (n in 1:(npft+1)){ if (selpft[n]){ - lines(thismonth,thisvar[,n],type="l",col=pft$colour[n],lwd=lwidth) + lines(datum$tomonth,thisvar[,n],type="l",col=pft$colour[n],lwd=lwidth) }#end if }#end for legend(x=legwhere,inset=inset,bg=legbg,legend=legs,col=cols,lwd=lwidth) @@ -2114,17 +887,18 @@ for (place in myplaces){ # Time series by DBH, by PFT. # #---------------------------------------------------------------------------------------# #----- Find the PFTs to plot. ----------------------------------------------------------# - pftuse = which(apply(X=agbpftdbh,MARGIN=3,FUN=sum,na.rm=TRUE) > 0.) + pftuse = which(apply(X=datum$agbpftdbh,MARGIN=3,FUN=sum,na.rm=TRUE) > 0.) + pftuse = pftuse[pftuse != (npft+1)] for (v in 1:ntspftdbh){ thistspftdbh = tspftdbh[[v]] - vnam = thistspftdbh$vnam - description = thistspftdbh$desc - unit = thistspftdbh$unit - plog = thistspftdbh$plog - plotit = thistspftdbh$plt + vnam = thistspftdbh$vnam + description = thistspftdbh$desc + unit = thistspftdbh$unit + plog = thistspftdbh$plog + plotit = thistspftdbh$plt #----- Load variable ----------------------------------------------------------------# - thisvar = get(vnam) + thisvar = datum[[vnam]] if (plog){ xylog="y" thisvar[thisvar <= 0] = NA @@ -2143,39 +917,22 @@ for (place in myplaces){ if (! file.exists(outvar)) dir.create(outvar) #---------------------------------------------------------------------------------# - print (paste(" +",description,"time series for DBH class...")) + cat(" + ",description," time series for DBH class...","\n") #---------------------------------------------------------------------------------# # Find the limit, make some room for the legend, and in case the field is a # # constant, nudge the limits so the plot command will not complain. # #---------------------------------------------------------------------------------# + ylimit = pretty.xylim(u=thisvar[,,pftuse],fracexp=scalleg,is.log=plog) if (plog){ - xylog = "y" - ylimit = range(log(thisvar[,,pftuse]),na.rm=TRUE) - if (any(! is.finite(ylimit)) || (ylimit[1] == ylimit[2] && ylimit[1] == 0)){ - ylimit = c(-1,1) - }else if (ylimit[1] == ylimit[2] ){ - ylimit[1] = ylimit[1] * ( 1. - sign(ylimit[1]) * ylnudge) - ylimit[2] = ylimit[2] * ( 1. + sign(ylimit[2]) * ylnudge) - }else{ - ylimit[2] = ylimit[2] + scalleg * (ylimit[2] - ylimit[1]) - }#end if - ydrought = c(ylimit[1] - 0.5 * (ylimit[2]-ylimit[1]) - ,ylimit[2] + 0.5 * (ylimit[2]-ylimit[1])) - ylimit = exp(ylimit) + xylog = "y" + ydrought = c( exp(ylimit[1] * sqrt(ylimit[1]/ylimit[2])) + , exp(ylimit[2] * sqrt(ylimit[2]/ylimit[1])) + )#end c }else{ - ylimit = range(thisvar[,,pftuse],na.rm=TRUE) - xylog="" - if (ylimit[1] == ylimit[2] && ylimit[1] == 0){ - ylimit = c(-1,1) - }else if(ylimit[1] == ylimit[2] ){ - ylimit[1] = ylimit[1] * ( 1. - sign(ylimit[1]) * ylnudge) - ylimit[2] = ylimit[2] * ( 1. + sign(ylimit[2]) * ylnudge) - }#end if - ylimit[2] = ylimit[2] + scalleg * (ylimit[2] - ylimit[1]) - ydrought = c(ylimit[1] - 0.5 * (ylimit[2]-ylimit[1]) - ,ylimit[2] + 0.5 * (ylimit[2]-ylimit[1])) + xylog = "" + ydrought = c(ylimit[1] - 0.5 * diff(ylimit), ylimit[2] + 0.5 * diff(ylimit)) }#end if #---------------------------------------------------------------------------------# @@ -2184,7 +941,7 @@ for (place in myplaces){ cpp = substring(100+p,2,3) pftlab = paste("pft-",cpp,sep="") - print (paste(" -",pft$name[p])) + cat(" - ",pft$name[p],"\n") #----- Loop over output formats. ----------------------------------------------# @@ -2204,7 +961,7 @@ for (place in myplaces){ }#end if letitre = paste(description,pft$name[p],lieu,sep=" - ") - plot(x=thismonth,y=thisvar[,1,p],type="n",main=letitre,ylim=ylimit + plot(x=datum$tomonth,y=thisvar[,1,p],type="n",main=letitre,ylim=ylimit ,xlab="Time",xaxt="n",ylab=unit,cex.main=0.7,log=xylog) axis(side=1,at=whenplot8$levels,labels=whenplot8$labels,padj=whenplot8$padj) if (drought.mark){ @@ -2218,7 +975,7 @@ for (place in myplaces){ abline(v=whenplot8$levels,h=axTicks(side=2),col="gray52",lty="solid") }#end if for (d in seq(from=1,to=ndbh+1,by=1)){ - lines(thismonth,thisvar[,d,p],type="l",col=dbhcols[d],lwd=lwidth) + lines(datum$tomonth,thisvar[,d,p],type="l",col=dbhcols[d],lwd=lwidth) }#end for legend(x=legwhere,inset=inset,bg=legbg,legend=dbhnames,col=dbhcols ,ncol=2,title="DBH class",lwd=lwidth,cex=0.8) @@ -2241,7 +998,7 @@ for (place in myplaces){ #---------------------------------------------------------------------------------------# # Plot the comparison between observations and model. # #---------------------------------------------------------------------------------------# - print(paste(" + Comparisons of time series (model vs. observations)...")) + cat(" + Comparisons of time series (model vs. observations)...","\n") for (cc in 1:ncompemean){ #----- Retrieve variable information from the list. ---------------------------------# @@ -2279,7 +1036,7 @@ for (place in myplaces){ if (plotit){ thisobs = get(obsnow) obswhen = thisobs$tomonth - sel = thismonth >= min(obswhen) & thismonth <= max(obswhen) + sel = datum$tomonth >= min(obswhen) & datum$tomonth <= max(obswhen) plotit = any(sel) }#end if #------------------------------------------------------------------------------------# @@ -2307,31 +1064,20 @@ for (place in myplaces){ #---------------------------------------------------------------------------------# outdir = paste(outpref,"compemean",sep="/") if (! file.exists(outdir)) dir.create(outdir) - print (paste(" - ",description,"comparison...")) + cat(" - ",description," comparison...","\n") #---------------------------------------------------------------------------------# #----- Define the number of layers. ----------------------------------------------# - thiswhen = thismonth [sel] - thismean = get(vname)[sel] + thiswhen = datum$tomonth [sel] + thismean = datum[[vname]][sel] #---------------------------------------------------------------------------------# #----- Find the plot range. ------------------------------------------------------# - ylimit = range(c(thismean,obsmean),na.rm=TRUE) - #----- Expand the upper range in so the legend doesn't hide things. --------------# - if (ylimit[1] == ylimit[2] & ylimit[1] == 0){ - ylimit[1] = -1 - ylimit[2] = 1 - }else if (ylimit[1] == ylimit[2] & ylimit[1] > 0){ - ylimit[2] = (1.0+scalleg) * ylimit[1] - }else if (ylimit[1] == ylimit[2] & ylimit[1] < 0){ - ylimit[2] = (1.0-scalleg) * ylimit[1] - }else{ - ylimit[2] = ylimit[2] + scalleg * (ylimit[2] - ylimit[1]) - }#end if + ylimit = pretty.xylim(u=c(thismean,obsmean),fracexp=scalleg,is.log=FALSE) #---------------------------------------------------------------------------------# @@ -2377,7 +1123,7 @@ for (place in myplaces){ ,pch=16,cex=1.0) points(x=obswhen,y=obsmean ,col=lcolours[2],lwd=llwd[2],type=ltype ,pch=16,cex=1.0) - legend(x=legpos,inset=0.01,legend=c("Model","Observation") + legend(x=legpos,inset=inset,legend=c("Model","Observation") ,col=lcolours,lwd=llwd,cex=1.0,pch=16) if (outform[o] == "x11"){ locator(n=1) @@ -2396,7 +1142,7 @@ for (place in myplaces){ #---------------------------------------------------------------------------------------# # Plot the comparison between observations and model. # #---------------------------------------------------------------------------------------# - print(paste(" + Comparisons of monthly means (model vs. observations)...")) + cat(" + Comparisons of monthly means (model vs. observations)...","\n") for (cc in 1:ncompmmean){ #----- Retrieve variable information from the list. ---------------------------------# @@ -2478,7 +1224,7 @@ for (place in myplaces){ #---------------------------------------------------------------------------------# outdir = paste(outpref,"compmmean",sep="/") if (! file.exists(outdir)) dir.create(outdir) - print (paste(" - ",description,"comparison...")) + cat(" - ",description," comparison...","\n") #---------------------------------------------------------------------------------# @@ -2503,21 +1249,11 @@ for (place in myplaces){ #----- Find the plot range. ------------------------------------------------------# if (plotsd){ - ylimit = range(c(mod.ylow,mod.yhigh,obs.ylow,obs.yhigh),na.rm=TRUE) - }else{ - ylimit = range(c(thismean,obsmean),na.rm=TRUE) - }#end if - #----- Expand the upper range in so the legend doesn't hide things. --------------# - if (ylimit[1] == ylimit[2] & ylimit[1] == 0){ - ylimit[1] = -1 - ylimit[2] = 1 - }else if (ylimit[1] == ylimit[2] & ylimit[1] > 0){ - ylimit[2] = (1.0+scalleg) * ylimit[1] - }else if (ylimit[1] == ylimit[2] & ylimit[1] < 0){ - ylimit[2] = (1.0-scalleg) * ylimit[1] + ylimit = c(mod.ylow,mod.yhigh,obs.ylow,obs.yhigh) }else{ - ylimit[2] = ylimit[2] + scalleg * (ylimit[2] - ylimit[1]) + ylimit = c(thismean,obsmean) }#end if + ylimit = pretty.xylim(u=ylimit,fracexp=scalleg,is.log=FALSE) #---------------------------------------------------------------------------------# @@ -2579,11 +1315,11 @@ for (place in myplaces){ points(x=montmont,y=obsmean ,col=lcolours[2],lwd=llwd[2],type=ltype ,pch=16,cex=1.0) if (plotsd){ - legend(x=legpos,inset=0.05,legend=c("Model","Observation") + legend(x=legpos,inset=inset,legend=c("Model","Observation") ,fill=errcolours,angle=angle,density=dens,lwd=llwd,col=lcolours ,bg="white",title="Shaded areas = 1 SD",cex=1.0,pch=16) }else{ - legend(x=legpos,inset=0.05,legend=c("Model","Observation") + legend(x=legpos,inset=inset,legend=c("Model","Observation") ,col=lcolours,lwd=llwd,cex=1.0,pch=16) }#end if if (outform[o] == "x11"){ @@ -2603,7 +1339,7 @@ for (place in myplaces){ #---------------------------------------------------------------------------------------# # Plot the comparison between observations and model. # #---------------------------------------------------------------------------------------# - print(paste(" * Comparisons of mean diurnal cycle (model vs. observations)...")) + cat(" * Comparisons of mean diurnal cycle (model vs. observations)...","\n") for (cc in 1:ncompdcyc){ #----- Retrieve variable information from the list. ---------------------------------# @@ -2676,8 +1412,8 @@ for (place in myplaces){ if (! file.exists(outdir)) dir.create(outdir) outtheme = paste(outdir,vname,sep="/") if (! file.exists(outtheme)) dir.create(outtheme) - print (paste(" +",description,"comparison...")) - #---------------------------------------------------------------------------------# + cat(" + ",description," comparison...","\n") + #---------------------------------------------------------------------------------# @@ -2702,10 +1438,11 @@ for (place in myplaces){ #----- Find the plot range. ------------------------------------------------------# if (plotsd){ - ylimit = range(c(mod.ylow,mod.yhigh,obs.ylow,obs.yhigh),na.rm=TRUE) + ylimit = c(mod.ylow,mod.yhigh,obs.ylow,obs.yhigh) }else{ - ylimit = range(c(thismean,obsmean),na.rm=TRUE) + ylimit = c(thismean,obsmean) }#end if + ylimit = pretty.xylim(u=ylimit,fracexp=scalleg,is.log=FALSE) #---------------------------------------------------------------------------------# @@ -2719,7 +1456,7 @@ for (place in myplaces){ #------------------------------------------------------------------------------# # Check if the directory exists. If not, create it. # #------------------------------------------------------------------------------# - print (paste(" > ",description," time series - ",namemon,"...",sep="")) + cat(" > ",description," time series - ",namemon,"...","\n") #----- Loop over formats. -----------------------------------------------------# for (o in 1:nout){ @@ -2791,11 +1528,11 @@ for (place in myplaces){ points(x=thisday,y=obsmean[pmon,],col=lcolours[2] ,lwd=llwd[2],type=ltype,pch=16,cex=1.0) if (plotsd){ - legend(x=legpos,inset=0.05,legend=c("Model","Observation") + legend(x=legpos,inset=inset,legend=c("Model","Observation") ,fill=errcolours,angle=angle,density=dens,lwd=llwd,col=lcolours ,bg="white",title="Shaded areas = 1 SD",cex=1.0,pch=16) }else{ - legend(x=legpos,inset=0.05,legend=c("Model","Observation") + legend(x=legpos,inset=inset,legend=c("Model","Observation") ,col=lcolours,lwd=llwd,cex=1.0,pch=16) }#end if if (outform[o] == "x11"){ @@ -2832,12 +1569,12 @@ for (place in myplaces){ #---------------------------------------------------------------------------------# outdir = paste(outpref,"tslu",sep="/") if (! file.exists(outdir)) dir.create(outdir) - print (paste(" +",description,"time series for all LUs...")) + cat(" + ",description," time series for all LUs...","\n") #----- Load variable -------------------------------------------------------------# - thisvar = get(vnam) + thisvar = datum[[vnam]] if (plog){ #----- Eliminate non-positive values in case it is a log plot. ----------------# thisvar[thisvar <= 0] = NA @@ -2865,39 +1602,22 @@ for (place in myplaces){ # Find the limit, make some room for the legend, and in case the field is # # a constant, nudge the limits so the plot command will not complain. # #------------------------------------------------------------------------------# + ylimit = pretty.xylim(thisvar[,selpft],fracexp=scalleg,is.log=plog) if (plog){ - xylog = "y" - ylimit = range(log(thisvar[,selpft]),na.rm=TRUE) - if (any(! is.finite(ylimit)) || (ylimit[1] == ylimit[2] && ylimit[1] == 0)){ - ylimit = c(-1,1) - }else if (ylimit[1] == ylimit[2] ){ - ylimit[1] = ylimit[1] * ( 1. - sign(ylimit[1]) * ylnudge) - ylimit[2] = ylimit[2] * ( 1. + sign(ylimit[2]) * ylnudge) - }else{ - ylimit[2] = ylimit[2] + scalleg * (ylimit[2] - ylimit[1]) - }#end if - ydrought = c(ylimit[1] - 0.5 * (ylimit[2]-ylimit[1]) - ,ylimit[2] + 0.5 * (ylimit[2]-ylimit[1])) - ylimit = exp(ylimit) + xylog = "y" + ydrought = c( exp(ylimit[1] * sqrt(ylimit[1]/ylimit[2])) + , exp(ylimit[2] * sqrt(ylimit[2]/ylimit[1])) + )#end c }else{ - ylimit = range(thisvar[,selpft],na.rm=TRUE) - xylog="" - if (ylimit[1] == ylimit[2] && ylimit[1] == 0){ - ylimit = c(-1,1) - }else if(ylimit[1] == ylimit[2] ){ - ylimit[1] = ylimit[1] * ( 1. - sign(ylimit[1]) * ylnudge) - ylimit[2] = ylimit[2] * ( 1. + sign(ylimit[2]) * ylnudge) - }#end if - ylimit[2] = ylimit[2] + scalleg * (ylimit[2] - ylimit[1]) - ydrought = c(ylimit[1] - 0.5 * (ylimit[2]-ylimit[1]) - ,ylimit[2] + 0.5 * (ylimit[2]-ylimit[1])) + xylog = "" + ydrought = c(ylimit[1] - 0.5 * diff(ylimit), ylimit[2] + 0.5 * diff(ylimit)) }#end if #------------------------------------------------------------------------------# letitre = paste(description,lieu,sep=" - ") cols = lucols[sellu] legs = lunames[sellu] - plot(thismonth,thisvar[,1],type="n",main=letitre,ylim=ylimit + plot(datum$tomonth,thisvar[,1],type="n",main=letitre,ylim=ylimit ,xlab="Time",ylab=unit,xaxt="n",cex.main=0.7) axis(side=1,at=whenplot8$levels,labels=whenplot8$labels,padj=whenplot8$padj) @@ -2913,7 +1633,7 @@ for (place in myplaces){ }#end if for (n in 1:(nlu+1)){ if (sellu[n]){ - lines(thismonth,thisvar[,n],type="l",col=lucols[n],lwd=lwidth) + lines(datum$tomonth,thisvar[,n],type="l",col=lucols[n],lwd=lwidth) }#end if }#end for legend(x=legwhere,inset=inset,bg=legbg,legend=legs,col=cols,lwd=lwidth) @@ -2937,7 +1657,7 @@ for (place in myplaces){ # Plot disturbance rate by disturbance transition. # #---------------------------------------------------------------------------------------# if (tserdist && any(seldist)){ - print (paste(" + Disturbance rate time series for all disturbances...")) + cat(" + Disturbance rate time series for all disturbances...","\n") for (o in 1:nout){ fichier = paste(outpref,"/disturb-",suffix,".",outform[o],sep="") if (outform[o] == "x11"){ @@ -2960,24 +1680,19 @@ for (place in myplaces){ ylimit = NULL for (jlu in 1:nlu){ for (ilu in 1:nlu){ - if (seldist[ilu,jlu]) ylimit = range(c(ylimit,dist[,ilu,jlu]),na.rm=TRUE) + if (seldist[ilu,jlu]){ + ylimit = c(ylimit,datum$dist[,ilu,jlu]) + }#end if }#end for }#end for - if (ylimit[1] == ylimit[2] && ylimit[1] == 0){ - ylimit = c(-1,1) - }else if(ylimit[1] == ylimit[2] ){ - ylimit[1] = ylimit[1] * ( 1. - sign(ylimit[1]) * ylnudge) - ylimit[2] = ylimit[2] * ( 1. + sign(ylimit[2]) * ylnudge) - }#end if - ylimit[2] = ylimit[2] + scalleg * (ylimit[2] - ylimit[1]) - ydrought = c(ylimit[1] - 0.5 * (ylimit[2]-ylimit[1]) - ,ylimit[2] + 0.5 * (ylimit[2]-ylimit[1])) + ylimit = pretty.xylim(u=ylimit,fracexp=scalleg,is.log=FALSE) + ydrought = c(ylimit[1] - 0.5 * diff(ylimit), ylimit[2] + 0.5 * diff(ylimit)) #---------------------------------------------------------------------------------# letitre = paste("Disturbance rates",lieu,sep=" - ") cols = NULL legs = NULL - plot(thismonth,dist[,1,1],type="n",main=letitre,ylim=ylimit + plot(datum$tomonth,datum$dist[,1,1],type="n",main=letitre,ylim=ylimit ,xlab="Time",ylab="[1/yr]",xaxt="n",cex.main=0.7) axis(side=1,at=whenplot8$levels,labels=whenplot8$labels,padj=whenplot8$padj) if (drought.mark){ @@ -2997,7 +1712,8 @@ for (place in myplaces){ if (seldist[ilu,jlu]){ cols = c(cols,distcols[n]) legs = c(legs,distnames[n]) - lines(thismonth,dist[,ilu,jlu],type="l",col=distcols[n],lwd=lwidth) + lines(datum$tomonth,datum$dist[,ilu,jlu],type="l" + ,col=distcols[n],lwd=lwidth) }#end if }#end for }#end for @@ -3019,7 +1735,7 @@ for (place in myplaces){ #---------------------------------------------------------------------------------------# # Plot the time series diagrams showing months and years. # #---------------------------------------------------------------------------------------# - print(paste(" * Plot some time series figures...")) + cat(" * Plot some time series figures...","\n") for (hh in 1:ntser){ #----- Retrieve variable information from the list. ---------------------------------# @@ -3043,7 +1759,7 @@ for (place in myplaces){ #---------------------------------------------------------------------------------# outdir = paste(outpref,"tseries",sep="/") if (! file.exists(outdir)) dir.create(outdir) - print (paste(" +",theme,"time series for several variables...")) + cat(" + ",theme," time series for several variables...","\n") #----- Define the number of layers. ----------------------------------------------# @@ -3057,35 +1773,16 @@ for (place in myplaces){ # constant, nudge the limits so the plot command will not complain. # #---------------------------------------------------------------------------------# ylimit = NULL - for (l in 1:nlayers){ - thisvar = get(vnames[l]) - ylimit = range(c(ylimit,thisvar),na.rm=TRUE) - }#end for + for (l in 1:nlayers) ylimit = c(ylimit,datum[[vnames[l]]]) + ylimit = pretty.xylim(u=ylimit,fracexp=scalleg,is.log=plog) if (plog){ - xylog = "y" - ylimit = range(ylimit,na.rm=TRUE) - if (any(! is.finite(ylimit)) || (ylimit[1] == ylimit[2] && ylimit[1] == 0)){ - ylimit = c(-1,1) - }else if (ylimit[1] == ylimit[2] ){ - ylimit[1] = ylimit[1] * ( 1. - sign(ylimit[1]) * ylnudge) - ylimit[2] = ylimit[2] * ( 1. + sign(ylimit[2]) * ylnudge) - }else{ - ylimit[2] = ylimit[2] + scalleg * (ylimit[2] - ylimit[1]) - }#end if - ydrought = c(ylimit[1] - 0.5 * (ylimit[2]-ylimit[1]) - ,ylimit[2] + 0.5 * (ylimit[2]-ylimit[1])) - ylimit = exp(ylimit) + xylog = "y" + ydrought = c( exp(ylimit[1] * sqrt(ylimit[1]/ylimit[2])) + , exp(ylimit[2] * sqrt(ylimit[2]/ylimit[1])) + )#end c }else{ - xylog="" - if (ylimit[1] == ylimit[2] && ylimit[1] == 0){ - ylimit = c(-1,1) - }else if(ylimit[1] == ylimit[2] ){ - ylimit[1] = ylimit[1] * ( 1. - sign(ylimit[1]) * ylnudge) - ylimit[2] = ylimit[2] * ( 1. + sign(ylimit[2]) * ylnudge) - }#end if - ylimit[2] = ylimit[2] + scalleg * (ylimit[2] - ylimit[1]) - ydrought = c(ylimit[1] - 0.5 * (ylimit[2]-ylimit[1]) - ,ylimit[2] + 0.5 * (ylimit[2]-ylimit[1])) + xylog = "" + ydrought = c(ylimit[1] - 0.5 * diff(ylimit), ylimit[2] + 0.5 * diff(ylimit)) }#end if #---------------------------------------------------------------------------------# @@ -3094,7 +1791,7 @@ for (place in myplaces){ #---------------------------------------------------------------------------------# # Check if the directory exists. If not, create it. # #---------------------------------------------------------------------------------# - print (paste(" > ",theme," time series ...",sep="")) + cat(" > ",theme," time series ...","\n") #----- Loop over formats. --------------------------------------------------------# for (o in 1:nout){ @@ -3113,11 +1810,11 @@ for (place in myplaces){ }#end if #----- Load variable ----------------------------------------------------------# - thisvar = get(vnames[1]) + thisvar = datum[[vnames[1]]] letitre = paste(theme," - ",lieu," \n"," Time series: ",theme,sep="") - plot(x=thismonth,y=thisvar,type="n",main=letitre,xlab="Time" + plot(x=datum$tomonth,y=thisvar,type="n",main=letitre,xlab="Time" ,ylim=ylimit,ylab=paste("[",unit,"]",sep=""),log=xylog,xaxt="n" ,cex.main=cex.main) axis(side=1,at=whenplot8$levels,labels=whenplot8$labels,padj=whenplot8$padj) @@ -3132,11 +1829,11 @@ for (place in myplaces){ abline(v=whenplot8$levels,h=axTicks(side=2),col="gray52",lty="solid") }#end if for (l in 1:nlayers){ - thisvar = get(vnames[l]) - points(x=thismonth,y=thisvar,col=lcolours[l] + thisvar = datum[[vnames[l]]] + points(x=datum$tomonth,y=thisvar,col=lcolours[l] ,lwd=llwd[l],type=ltype,pch=16,cex=0.8) }#end for - legend(x=legpos,inset=0.05,legend=description,col=lcolours,lwd=llwd,cex=0.8) + legend(x=legpos,inset=inset,legend=description,col=lcolours,lwd=llwd,cex=0.8) if (outform[o] == "x11"){ locator(n=1) dev.off() @@ -3154,7 +1851,7 @@ for (place in myplaces){ #---------------------------------------------------------------------------------------# # Plot the climatology of the mean diurnal cycle. # #---------------------------------------------------------------------------------------# - print(paste(" * Plot some climatology of diurnal cycle...")) + cat(" * Plot some climatology of diurnal cycle...","\n") for (hh in 1:nclim){ #----- Retrieve variable information from the list. ---------------------------------# @@ -3180,26 +1877,14 @@ for (place in myplaces){ if (! file.exists(outdir)) dir.create(outdir) outtheme = paste(outdir,prefix,sep="/") if (! file.exists(outtheme)) dir.create(outtheme) - print (paste(" +",description,"diurnal cycle for several variables...")) + cat(" + ",description," diurnal cycle for several variables...","\n") #----- Define the number of layers. ----------------------------------------------# nlayers = length(vnames) ylimit = NULL - for (l in 1:nlayers){ - thisvar = dcyc12mn[[vnames[l]]] - ylimit = range(c(ylimit,thisvar),na.rm=TRUE) - }#end for - if (ylimit[1] == ylimit[2] & ylimit[1] == 0){ - ylimit[1] = -1 - ylimit[2] = 1 - }else if (ylimit[1] == ylimit[2] & ylimit[1] > 0){ - ylimit[2] = (1.0+scalleg) * ylimit[1] - }else if (ylimit[1] == ylimit[2] & ylimit[1] < 0){ - ylimit[2] = (1.0-scalleg) * ylimit[1] - }else{ - ylimit[2] = ylimit[2] + scalleg * (ylimit[2] - ylimit[1]) - }#end if + for (l in 1:nlayers) ylimit = c(ylimit,dcyc12mn[[vnames[l]]]) + ylimit = pretty.xylim(u=ylimit,fracexp=scalleg,is.log=FALSE) #---------------------------------------------------------------------------------# @@ -3213,7 +1898,7 @@ for (place in myplaces){ #------------------------------------------------------------------------------# # Check if the directory exists. If not, create it. # #------------------------------------------------------------------------------# - print (paste(" > ",theme," time series - ",namemon,"...",sep="")) + cat(" > ",theme," time series - ",namemon,"...","\n") #----- Loop over formats. -----------------------------------------------------# for (o in 1:nout){ @@ -3252,7 +1937,7 @@ for (place in myplaces){ points(x=thisday,y=thisvar[pmon,],col=lcolours[l] ,lwd=llwd[l],type=ltype,pch=16,cex=0.8) }#end for - legend(x=legpos,inset=0.05,legend=description,col=lcolours,lwd=llwd) + legend(x=legpos,inset=inset,legend=description,col=lcolours,lwd=llwd) if (outform[o] == "x11"){ locator(n=1) dev.off() @@ -3290,10 +1975,10 @@ for (place in myplaces){ #---------------------------------------------------------------------------------# outdir = paste(outpref,"soilclim",sep="/") if (! file.exists(outdir)) dir.create(outdir) - print (paste(" + Climatology profile of ",description,"...")) + cat(" + Climatology profile of ",description,"...","\n") #----- Find the number of rows and columns, and the axes. ------------------------# - monaxis = sort(unique(monnum)) + monaxis = sort(unique(datum$month)) soilaxis = slz nmon = length(monaxis) nsoil = nzg @@ -3400,22 +2085,22 @@ for (place in myplaces){ #---------------------------------------------------------------------------------# outdir = paste(outpref,"soilts",sep="/") if (! file.exists(outdir)) dir.create(outdir) - print (paste(" + Time series profile of ",description,"...")) + cat(" + Time series profile of ",description,"...","\n") #----- Find the number of rows and columns, and the axes. ------------------------# - timeaxis = thismonth + timeaxis = datum$tomonth soilaxis = slz nmon = length(timeaxis) nsoil = nzg #----- Convert the vector data into an array. ------------------------------------# - vararr = get(vnam) + vararr = datum[[vnam]] #----- Copy Decembers ans Januaries to make the edges buffered. ------------------# first = vararr[1,] first = c(first,first[nzg],first[nzg]) - last = vararr[totmon,] + last = vararr[ntimes,] last = c(last[1],last[1],last) #----- Bind first and last year to the array, to make the edges buffered. --------# @@ -3426,10 +2111,10 @@ for (place in myplaces){ # Expand the month and year axes. Make the first and last time equal time # # steps. # #---------------------------------------------------------------------------------# - dwhen = as.numeric(thismonth[2]-thismonth[1]) - whenaxis = c(chron(as.numeric(thismonth[1]-dwhen)) + dwhen = as.numeric(datum$tomonth[2]-datum$tomonth[1]) + whenaxis = c(chron(as.numeric(datum$tomonth[1]-dwhen)) ,timeaxis - ,chron(as.numeric(thismonth[totmon]+dwhen))) + ,chron(as.numeric(datum$tomonth[ntimes]+dwhen))) soilaxis = -log(-1.0 * c( slz[1]*(slz[1]/slz[2]) , soilaxis , slz[nzg]*(slz[nzg]/slz[nzg-1]) )) @@ -3520,7 +2205,7 @@ for (place in myplaces){ }else{ yearzz = yearz - 1 }#end if - sel = myear >= yearaa & myear <= yearzz + sel = datum$year >= yearaa & datum$year <= yearzz twoyears = sum(sel) >= 24 if (plotit && twoyears){ @@ -3530,14 +2215,14 @@ for (place in myplaces){ #---------------------------------------------------------------------------------# outdir = paste(outpref,"hovmoller",sep="/") if (! file.exists(outdir)) dir.create(outdir) - print (paste(" +",description,"Hovmoller time series ...")) + cat(" + ",description," Hovmoller time series ...","\n") #----- Load this variable into "thisvar". ----------------------------------------# - thisvar = get(vnam) + thisvar = datum[[vnam]] #----- Find the number of rows and columns, and the axes. ------------------------# - monaxis = sort(unique(monnum[sel])) - yraxis = sort(unique(myear[sel])) + monaxis = sort(unique(datum$month[sel])) + yraxis = sort(unique(datum$year[sel])) nmon = length(monaxis) nyear = length(yraxis) @@ -3639,26 +2324,26 @@ for (place in myplaces){ #---------------------------------------------------------------------------------# outdir = paste(outpref,"hovdcycle",sep="/") if (! file.exists(outdir)) dir.create(outdir) - print (paste(" +",description,"time series of diurnal cycle...")) + cat(" + ",description," time series of diurnal cycle...","\n") #----- Load this variable into "thisvar". ----------------------------------------# vararr = dcycmean[[vnam]] #----- Copy Decembers ans Januaries to make the edges buffered. ------------------# firsthr = vararr[,1] - firsthr = c(firsthr,firsthr[totmon],firsthr[totmon]) + firsthr = c(firsthr,firsthr[ntimes],firsthr[ntimes]) lasthr = vararr[,ndcycle] lasthr = c(lasthr[1],lasthr[1],lasthr) #----- Bind first and last year to the array, to make the edges buffered. --------# - varbuff = rbind(vararr[1,],vararr,vararr[totmon,]) + varbuff = rbind(vararr[1,],vararr,vararr[ntimes,]) varbuff = cbind(lasthr,varbuff,firsthr) #----- Expand the month and year axes. -------------------------------------------# hraxis = seq(from=0,to=ndcycle+1,by=1) * 24 / ndcycle - dwhen = thismonth[2]-thismonth[1] - whenaxis = c(thismonth[1]-dwhen,thismonth,thismonth[totmon]+dwhen) + dwhen = datum$tomonth[2]-datum$tomonth[1] + whenaxis = c(datum$tomonth[1]-dwhen,datum$tomonth,datum$tomonth[ntimes]+dwhen) hdcycplot = pretty.time(whenaxis,n=8) vrange = range(varbuff,na.rm=TRUE) @@ -3716,7 +2401,7 @@ for (place in myplaces){ for (v in 1:nbox){ #----- Retrieve variable information from the list. ---------------------------------# - thisbplot = bplot[[v]] + thisbplot = pm.bplot[[v]] vnam = thisbplot$vnam description = thisbplot$desc unit = thisbplot$unit @@ -3728,10 +2413,10 @@ for (place in myplaces){ #---------------------------------------------------------------------------------# outdir = paste(outpref,"boxplot",sep="/") if (! file.exists(outdir)) dir.create(outdir) - print (paste(" +",description,"box plot...")) + cat(" + ",description," box plot...","\n") #----- Load this variable into "thisvar". ----------------------------------------# - thisvar = get(vnam) + thisvar = datum[[vnam]] for (o in 1:nout){ fichier = paste(outdir,"/",vnam,"-",suffix,".",outform[o],sep="") @@ -3747,13 +2432,9 @@ for (place in myplaces){ pdf(file=fichier,onefile=FALSE ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) }#end if - ylimit = range(thisvar, na.rm=TRUE) - if (ylimit[1] == ylimit[2] && ylimit[1] == 0){ - ylimit = c(-1,1) - }else if(ylimit[1] == ylimit[2] ){ - ylimit[1] = ylimit[1] * ( 1. - sign(ylimit[1]) * ylnudge) - ylimit[2] = ylimit[2] * ( 1. + sign(ylimit[2]) * ylnudge) - }#end if + + + ylimit = pretty.xylim(u=thisvar,fracexp=0.0,is.log=FALSE) letitre = paste(description,lieu,sep=" - ") plot(mmonth,thisvar,main=letitre,ylim=ylimit,cex.main=0.7 ,xlab="Time",ylab=paste("[",unit,"]",sep="")) @@ -3777,10 +2458,11 @@ for (place in myplaces){ #---------------------------------------------------------------------------------------# # Bar plot by DBH class. # #---------------------------------------------------------------------------------------# - print(paste(" + Bar plot by DBH classes...")) - monbplot = which(nummonths(thismonth) %in% sasmonth) + cat(" + Bar plot by DBH classes...","\n") + monbplot = which(nummonths(datum$tomonth) %in% sasmonth) nmonbplot = length(monbplot) - pftuse = which(apply(X=nplantpftdbh,MARGIN=3,FUN=sum,na.rm=TRUE) > 0.) + pftuse = which(apply(X=datum$nplantpftdbh,MARGIN=3,FUN=sum,na.rm=TRUE) > 0.) + pftuse = pftuse[pftuse != (npft+1)] npftuse = length(pftuse) pftname.use = pft$name [pftuse] pftcol.use = pft$colour[pftuse] @@ -3792,6 +2474,13 @@ for (place in myplaces){ unit = thisbar$unit stacked = thisbar$stack plotit = thisbar$plt + plog = thisbar$plog + if (plog){ + xylog = "y" + stacked = FALSE + }else{ + xylog = "" + }#end if #------------------------------------------------------------------------------------# @@ -3799,18 +2488,18 @@ for (place in myplaces){ # Check whether to plot this #------------------------------------------------------------------------------------# if (plotit){ - print (paste(" - ",description,"...")) + cat(" - ",description,"...","\n") #---------------------------------------------------------------------------------# # Retrieve the variable, and keep only the part that is usable. # #---------------------------------------------------------------------------------# - thisvnam = get(vnam)[monbplot,,] + thisvnam = datum[[vnam]][monbplot,,] thisvnam = thisvnam [,,pftuse] thisvnam = thisvnam [,-(ndbh+1),] thisvnam[is.na(thisvnam)] = 0. - thiswhen = thismonth[monbplot] + thiswhen = datum$tomonth[monbplot] #---------------------------------------------------------------------------------# @@ -3823,17 +2512,7 @@ for (place in myplaces){ }else{ ylimit = range(x=thisvnam,na.rm=TRUE) }#end if - #----- Expand the upper range in so the legend doesn't hide things. --------------# - if (ylimit[1] == ylimit[2] & ylimit[1] == 0){ - ylimit[1] = -1 - ylimit[2] = 1 - }else if (ylimit[1] == ylimit[2] & ylimit[1] > 0){ - ylimit[2] = (1.0+scalleg) * ylimit[1] - }else if (ylimit[1] == ylimit[2] & ylimit[1] < 0){ - ylimit[2] = (1.0-scalleg) * ylimit[1] - }else{ - ylimit[2] = ylimit[2] + scalleg * (ylimit[2] - ylimit[1]) - }#end if + ylimit = pretty.xylim(u=ylimit,fracexp=scalleg,is.log=plog) #---------------------------------------------------------------------------------# @@ -3893,14 +2572,14 @@ for (place in myplaces){ #----- Plot all monthly means together. ------------------------------------# barplot(height=t(thisvnam[m,,]),names.arg=dbhnames[1:ndbh],width=1.0 ,main=letitre,xlab=lexlab,ylab=leylab,ylim=ylimit,legend.text=FALSE - ,beside=(! stacked),col=pftcol.use + ,beside=(! stacked),col=pftcol.use,log=xylog ,border="gray23",xpd=FALSE,cex.main=cex.main) if (plotgrid & (! stacked)){ xgrid=0.5+(1:ndbh)*(1+npftuse) abline(v=xgrid,col="gray46",lty="solid") }#end if box() - legend(x="topleft",inset=0.01,legend=pftname.use,fill=pftcol.use + legend(x="topleft",inset=inset,legend=pftname.use,fill=pftcol.use ,ncol=1,title="PFT",cex=1.0,bg="white") #---------------------------------------------------------------------------# @@ -3943,7 +2622,7 @@ for (place in myplaces){ #----- If this variable is to be plotted, then go through this if block. ------------# if (plotit){ - print (paste(" +",description,"size and age structure plot...")) + cat(" + ",description," size and age structure plot...","\n") #---------------------------------------------------------------------------------# # Check if the directory exists. If not, create it. # @@ -3954,10 +2633,10 @@ for (place in myplaces){ if (! file.exists(outdir)) dir.create(outdir) #----- Load this list into "thislist". -------------------------------------------# - varco = get(vnam) + varco = datum[[vnam]] - for (ww in names(ageco)){ + for (ww in names(datum$ageco)){ #----- Find which year we are plotting. ---------------------------------------# cmonth = substring(ww,7,8) @@ -3966,11 +2645,11 @@ for (place in myplaces){ yy = as.numeric(thisyear) #----- Retrieve variable list, age, DBH, and PFT for this year. ---------------# - ageww = ageco[[ww]] - dbhww = dbhco[[ww]] - pftww = pftco[[ww]] - varww = varco[[ww]] - popww = nplantco[[ww]] * areaco[[ww]] + ageww = datum$ageco[[ww]] + dbhww = datum$dbhco[[ww]] + pftww = datum$pftco[[ww]] + varww = datum$varco[[ww]] + popww = datum$nplantco[[ww]] * datum$areaco[[ww]] #------------------------------------------------------------------------------# # We only plot the SAS figures when the polygon is not an absolute desert. # @@ -3981,11 +2660,11 @@ for (place in myplaces){ # the global range, otherwise, simply use the range for this year. # #---------------------------------------------------------------------------# if (sasfixlimits){ - xlimit = range(ageco , na.rm=TRUE) - ylimit = range(dbhco , na.rm=TRUE) - zlimit = range(varco , na.rm=TRUE) - popmin = min (nplantco * areaco, na.rm=TRUE) - popmax = max (nplantco * areaco, na.rm=TRUE) + xlimit = range(datum$ageco , na.rm=TRUE) + ylimit = range(datum$dbhco , na.rm=TRUE) + zlimit = range(datum$varco , na.rm=TRUE) + popmin = min (datum$nplantco * datum$areaco, na.rm=TRUE) + popmax = max (datum$nplantco * datum$areaco, na.rm=TRUE) }else{ xlimit = range(ageww ,na.rm=TRUE) ylimit = range(dbhww ,na.rm=TRUE) @@ -4071,7 +2750,7 @@ for (place in myplaces){ ,col="gray29",lwd=2) points(trans3d(x=ageww,y=dbhww,z=varww,pmat=pout),type="p" ,pch=pchww,col=colww,cex=cexww) - legend(x="bottomright",inset=0.01,legend=pftleg,fill=colleg + legend(x="bottomright",inset=inset,legend=pftleg,fill=colleg ,ncol=1,bg="white",cex=0.9) diff --git a/ED/Template/Template/plot_ycomp.r b/ED/Template/Template/plot_ycomp.r new file mode 100644 index 000000000..2274f0fc6 --- /dev/null +++ b/ED/Template/Template/plot_ycomp.r @@ -0,0 +1,678 @@ +#==========================================================================================# +#==========================================================================================# +# Leave these commands at the beginning. They will refresh the session. # +#------------------------------------------------------------------------------------------# +rm(list=ls()) +graphics.off() +#==========================================================================================# +#==========================================================================================# + + + +#==========================================================================================# +#==========================================================================================# +# Here is the user defined variable section. # +#------------------------------------------------------------------------------------------# + +#----- Paths. -----------------------------------------------------------------------------# +here = "thispath" # Current directory. +there = "thatpath" # Directory where analyses/history are +srcdir = "/n/moorcroft_data/mlongo/util/Rsc" # Source directory. +outroot = "thisoutroot" +#------------------------------------------------------------------------------------------# + + +#----- Time options. ----------------------------------------------------------------------# +monthbeg = thismontha +yearbeg = thisyeara # First year to consider +yearend = thisyearz # Maximum year to consider +season.mona = thisseasonmona # First month for year by year comparison +reload.data = TRUE # Should I reload partially loaded data? +sasmonth.short = c(2,5,8,11) # Months for SAS plots (short runs) +sasmonth.long = 5 # Months for SAS plots (long runs) +nyears.long = 25 # Runs longer than this are considered long runs. +#------------------------------------------------------------------------------------------# + + + +#----- Name of the simulations. -----------------------------------------------------------# +myplaces = c("thispoly") +#------------------------------------------------------------------------------------------# + + + +#----- Plot options. ----------------------------------------------------------------------# +outform = thisoutform # Formats for output file. Supported formats are: + # - "X11" - for printing on screen + # - "eps" - for postscript printing + # - "png" - for PNG printing + # - "pdf" - for PDF printing +depth = 96 # PNG resolution, in pixels per inch +paper = "letter" # Paper size, to define the plot shape +ptsz = 14 # Font size. +lwidth = 2.5 # Line width +plotgrid = TRUE # Should I plot the grid in the background? +sasfixlimits = FALSE # Use a fixed scale for size and age-structure + # plots? (FALSE will set a suitable scale for + # each plot) +ncolsfc = 200 # Target number of colours for filled contour. +fcgrid = TRUE # Include a grid on the filled contour plots? +ncolshov = 200 # Target number of colours for Hovmoller diagrams. +hovgrid = TRUE # Include a grid on the Hovmoller plots? +legwhere = "topleft" # Where should I place the legend? +inset = 0.01 # Inset between legend and edge of plot region. +legbg = "white" # Legend background colour. +scalleg = 0.40 # Expand y limits by this relative amount to fit + # the legend +cex.main = 0.8 # Scale coefficient for the title +theta = 315. # Azimuth for perspective projection +phi = 30. # Vertical angle for perspective projection +ltheta = -210. # Azimuth angle for light +shade = 0.125 # Shade intensity +expz = 0.5 # Expansion factor for Z axis +gcol = c("lightblue","white") # Colours for the fifties style floor +cexmin = 0.5 # Minimum "head" size of the lollipop +cexmax = 3.0 # Maximum "head" size of the lollipop +ylnudge = 0.05 # Nudging factor for ylimit +#------------------------------------------------------------------------------------------# + + +#------ Miscellaneous settings. -----------------------------------------------------------# +slz.min = -5.0 # The deepest depth that trees access water. +idbh.type = myidbhtype # Type of DBH class + # 1 -- Every 10 cm until 100cm; > 100cm + # 2 -- 0-10; 10-20; 20-35; 35-50; 50-70; > 70 (cm) +#------------------------------------------------------------------------------------------# + + + +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# +# NO NEED TO CHANGE ANYTHING BEYOND THIS POINT UNLESS YOU ARE DEVELOPING THE CODE... # +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# + + + +#----- Load some packages and scripts. ----------------------------------------------------# +source(file.path(srcdir,"load.everything.r")) +#------------------------------------------------------------------------------------------# + + + +#----- Set how many formats we must output. -----------------------------------------------# +outform = tolower(outform) +nout = length (outform) +#------------------------------------------------------------------------------------------# + +#----- Avoid unecessary and extremely annoying beeps. -------------------------------------# +options(locatorBell=FALSE) + + +#----- Load observations. -----------------------------------------------------------------# +obsrfile = paste(srcdir,"LBA_MIP.v8.RData",sep="/") +load(file=obsrfile) +#------------------------------------------------------------------------------------------# + + +#----- Define plot window size ------------------------------------------------------------# +size = plotsize(proje=FALSE,paper=paper) +#------------------------------------------------------------------------------------------# + + + +#---- Create the main output directory in case there is none. -----------------------------# +if (! file.exists(outroot)) dir.create(outroot) +#------------------------------------------------------------------------------------------# + + + +#------------------------------------------------------------------------------------------# +# Big place loop starts here... # +#------------------------------------------------------------------------------------------# +for (place in myplaces){ + + #----- Retrieve default information about this place and set up some variables. --------# + thispoi = locations(where=place,here=there,yearbeg=yearbeg,yearend=yearend + ,monthbeg=monthbeg) + inpref = thispoi$pathin + outmain = paste(outroot,place,sep="/") + outpref = paste(outmain,"ycomp",sep="/") + lieu = thispoi$lieu + iata = thispoi$iata + suffix = thispoi$iata + yeara = thispoi$yeara + yearz = thispoi$yearz + meszz = thispoi$monz + #---------------------------------------------------------------------------------------# + + + + #----- Create the directories in case they don't exist. --------------------------------# + if (! file.exists(outmain)) dir.create(outmain) + if (! file.exists(outpref)) dir.create(outpref) + #---------------------------------------------------------------------------------------# + + + + #----- Print a banner to entretain the user. -------------------------------------------# + cat(" + Post-processing output from ",lieu,"...","\n") + #---------------------------------------------------------------------------------------# + + + + #----- Decide how frequently the cohort-level variables should be saved. ---------------# + if (yearend - yearbeg + 1 <= nyears.long){ + sasmonth = sasmonth.short + }else{ + sasmonth = sasmonth.long + }#end if + #---------------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------------# + # Find the total number of months that can be loaded this time. # + #---------------------------------------------------------------------------------------# + ntimes = (yearz-yeara-1)*12+meszz+(12-monthbeg+1) + #---------------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------------# + # Make the RData file name, then we check whether we must read the files again # + # or use the stored RData. # + #---------------------------------------------------------------------------------------# + path.data = paste(here,place,"rdata_ycomp",sep="/") + if (! file.exists(path.data)) dir.create(path.data) + ed22.rdata = paste(path.data,paste(place,"RData",sep="."),sep="/") + if (reload.data && file.exists(ed22.rdata)){ + #----- Load the modelled dataset. ---------------------------------------------------# + cat(" - Loading previous session...","\n") + load(ed22.rdata) + tresume = datum$ntimes + 1 + datum = update.monthly( new.ntimes = ntimes + , old.datum = datum + , montha = monthbeg + , yeara = yeara + , inpref = inpref + , slz.min = slz.min + )#end update.monthly + }else{ + cat(" - Starting new session...","\n") + tresume = 1 + datum = create.monthly( ntimes = ntimes + , montha = monthbeg + , yeara = yeara + , inpref = inpref + , slz.min = slz.min + )#end create.monthly + }#end if + #---------------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------------# + # Check whether we have anything to update. # + #---------------------------------------------------------------------------------------# + complete = tresume > ntimes + #---------------------------------------------------------------------------------------# + + + + #----- Copy some dimensions to scalars. ------------------------------------------------# + nzg = datum$nzg + nzs = datum$nzs + ndcycle = datum$ndcycle + isoilflg = datum$isoilflg + slz = datum$slz + slxsand = datum$slxsand + slxclay = datum$slxclay + ntext = datum$ntext + soil.prop = datum$soil.prop + dslz = datum$dslz + soil.depth = datum$soil.depth + soil.dry = datum$soil.dry + soil.poro = datum$soil.poro + ka = datum$ka + kz = datum$kz + #---------------------------------------------------------------------------------------# + + + + + #---------------------------------------------------------------------------------------# + # Loop over all times in case there is anything new to be read. # + #---------------------------------------------------------------------------------------# + if (! complete){ + + #------------------------------------------------------------------------------------# + # This function will read the files. # + #------------------------------------------------------------------------------------# + datum = read.q.files(datum=datum,ntimes=ntimes,tresume=tresume,sasmonth=sasmonth) + #------------------------------------------------------------------------------------# + + #------ Save the data to the R object. ----------------------------------------------# + cat(" + Saving data to ",basename(ed22.rdata),"...","\n") + save(datum,file=ed22.rdata) + #------------------------------------------------------------------------------------# + }#end if (! complete) + #---------------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------------# + # Create a list with unique years. # + #---------------------------------------------------------------------------------------# + print (paste(" - Finding the years and seasons...",sep="")) + if (season.mona == 1){ + nyears = length(datum$toyear) + 1 + year4 = c(datum$toyear,2*datum$toyear[nyears-1] - datum$toyear[nyears-2]) + }else{ + nyears = length(datum$toyear) + year4 = datum$toyear + }#end if + year.desc = paste(year4-c(diff(year4)[1],diff(year4)),year4,sep="-") + year.col = eft.col[match(year4,eft.year)] + #----- Year for seasonal means. --------------------------------------------------------# + yr3mon = datum$toyear + nyr3mon = length(yr3mon) + yr3mon.desc = paste("Dec",sprintf("%2.2i" + ,(yr3mon-c(diff(yr3mon)[1],diff(yr3mon))) %% 100 ) + ,"-Nov",sprintf("%2.2i",yr3mon %% 100),sep="") + yr3mon.col = eft.col[match(yr3mon,eft.year)] + yr3mon.pch = eft.pch[match(yr3mon,eft.year)] + #---------------------------------------------------------------------------------------# + + + dwhena = as.numeric(chron(paste(season.mona,1,year4[2],sep="/"))) + dwhenz = as.numeric(chron(paste(season.mona,1,year4[3],sep="/"))) + sel = datum$tomonth >= dwhena & datum$tomonth <= dwhenz + month.when = datum$tomonth[sel] + + for (tt in 1:nyc.tvar){ + thisvar = yc.tvar[[tt]] + vname = thisvar$vnam + desc = thisvar$desc + if (vname == "rain"){ + unit = "mm/month" + }else{ + unit = thisvar$unit + }#end if + add0 = thisvar$add + mult0 = thisvar$mult + colmean = thisvar$colmean + colerr = thisvar$colerr + coledge = thisvar$coledge + plotit = thisvar$plt + cumul = thisvar$cumul + if (cumul){ + plttype = "l" + }else{ + plttype = "o" + }#end if + + + + + if (plotit){ + print(paste(" * ",desc,"...")) + + + #----- Create the directories. ---------------------------------------------------# + outtser = paste(outpref,"tseries",sep="/") + outbplot = paste(outpref,"bplot" ,sep="/") + if (! file.exists(outtser )) dir.create(outtser ) + if (! file.exists(outbplot)) dir.create(outbplot) + #---------------------------------------------------------------------------------# + + + #---------------------------------------------------------------------------------# + # Create the list of data. # + #---------------------------------------------------------------------------------# + outplot = list() + ylimit = NULL + for (y in 2:nyears){ + whena.now = chron(paste(season.mona,1,year4[y-1],sep="/")) + whenz.now = chron(paste(season.mona,1,year4[y] ,sep="/")) + sel = datum$tomonth >= whena.now & datum$tomonth <= whenz.now + nsel = sum(sel) + outplot[[y]] = list() + outplot[[y]]$x = month.when + if (cumul){ + copy.datum = datum[[vname]][sel] + copy.datum[is.na(copy.datum)] = 0 + outplot[[y]]$y = cumsum(copy.datum) + }else{ + outplot[[y]]$y = datum[[vname]][sel] + }#end if + + #----- Update range. ----------------------------------------------------------# + if (any(is.finite(outplot[[y]]$y)) ){ + y.min = min(outplot[[y]]$y,na.rm=TRUE) + y.max = max(outplot[[y]]$y,na.rm=TRUE) + ylimit = range(c(ylimit,y.min,y.max)) + }#end if + #------------------------------------------------------------------------------# + }#end for + #----- Make a dummy limit in case everything is empty. ---------------------------# + if (is.null(ylimit)){ + ylimit = c(-1,1) + }else{ + ylimit[2] = ylimit[2] + scalleg * (ylimit[2] - ylimit[1]) + }#end if + #---------------------------------------------------------------------------------# + + #---------------------------------------------------------------------------------# + # Make the time axis. # + #---------------------------------------------------------------------------------# + whenplot = pretty.time(chron(c(dwhena,dwhenz)),n=8) + whenplot$labels = substring(mlist[nummonths(whenplot$levels)],1,3) + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Plot the data. # + #---------------------------------------------------------------------------------# + for (o in 1:nout){ + fichier = paste(outtser,"/ycomp-",vname,"-",suffix,".",outform[o],sep="") + if(outform[o] == "x11"){ + X11(width=size$width,height=size$height,pointsize=ptsz) + }else if(outform[o] == "png"){ + png(filename=fichier,width=size$width*depth,height=size$height*depth + ,pointsize=ptsz,res=depth) + }else if(outform[o] == "eps"){ + postscript(file=fichier,width=size$width,height=size$height + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) + }#end if + + letitre = paste(lieu," \n",desc,sep="") + lex = "Months" + ley = paste(desc," [",unit,"]") + + + plot(x=outplot[[2]]$x,y=outplot[[2]]$y,type="n",main=letitre,xlab=lex,ylab=ley + ,ylim=ylimit,cex.main=cex.main,xaxt="n") + axis(side=1,at=whenplot$levels,labels=whenplot$labels,padj=whenplot$padj) + if (plotgrid){ + abline(v=whenplot$levels,h=axTicks(side=2),col="gray62",lty="solid") + }#end if + for (y in 2:nyears){ + lines(x=outplot[[y]]$x,y=outplot[[y]]$y,type=plttype,pch=16,cex=1.0 + ,lwd=2.5,col=year.col[y]) + }#end for + legend(x="topleft",inset=0.01,legend=year.desc[2:nyears] + ,lwd=2.5,col=year.col[2:nyears],title="Period",cex=0.9,ncol=3) + + + #----- Close the device. ------------------------------------------------------# + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + #------------------------------------------------------------------------------# + }#end for + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Split the data into seasonal means. # + #---------------------------------------------------------------------------------# + print(paste(" * Seasonal bar plot: ",desc,"...")) + this.season = season(datum$tomonth,add.year=TRUE) + #---------------------------------------------------------------------------------# + + + #---------------------------------------------------------------------------------# + # Make the last December become part of the first year. # + #---------------------------------------------------------------------------------# + sel = this.season == paste(max(yr3mon)+1,"01",sep="") + this.season[sel] = paste(min(yr3mon),"01",sep="") + yr.season = as.numeric(substring(this.season,1,4)) + #---------------------------------------------------------------------------------# + + #---------------------------------------------------------------------------------# + # Find the seasonality matrix. # + #---------------------------------------------------------------------------------# + this.var = datum[[vname]] + if (cumul){ + season.vec = tapply(X=this.var,INDEX=this.season,FUN=sum) + }else{ + season.vec = tapply(X=this.var,INDEX=this.season,FUN=mean) + }#end if + season.mat = matrix( data = season.vec + , ncol = 4 + , nrow = nyr3mon + , dimnames = list(yr3mon.desc,season.list) + , byrow = TRUE + )#end matrix + if (vname == "rain"){ + ylimit = c(0,1.25 * max(season.vec,na.rm=TRUE)) + }else{ + yl.try = range(season.vec,na.rm=TRUE) + if (any(! is.finite(yl.try)) || ( yl.try[1] == yl.try[2] && yl.try[1] == 0)){ + ylimit = c(-1,1) + leg.pos = "topright" + }else if (yl.try[1] == yl.try[2]){ + ylimit = yl.try + ylimit[1] = yl.try[1] - 0.30 * abs(yl.try[1]) + ylimit[2] = yl.try[2] + 0.30 * abs(yl.try[2]) + leg.pos = "topright" + }else if(yl.try[2] > 0){ + ylimit = yl.try + ylimit[1] = yl.try[1] - 0.05 * (yl.try[2] - yl.try[1]) + ylimit[2] = yl.try[2] + 0.40 * (yl.try[2] - yl.try[1]) + leg.pos = "topright" + }else{ + ylimit = yl.try + ylimit[1] = yl.try[1] - 0.40 * (yl.try[2] - yl.try[1]) + ylimit[2] = yl.try[2] + 0.05 * (yl.try[2] - yl.try[1]) + leg.pos = "bottomright" + }#end if + }#end if + #---------------------------------------------------------------------------------# + + + #---------------------------------------------------------------------------------# + # Plot the bar plot. # + #---------------------------------------------------------------------------------# + for (o in 1:nout){ + fichier = paste(outbplot,"/bp_season_",vname,"-",suffix,".",outform[o],sep="") + if(outform[o] == "x11"){ + X11(width=size$width,height=size$height,pointsize=ptsz) + }else if(outform[o] == "png"){ + png(filename=fichier,width=size$width*depth,height=size$height*depth + ,pointsize=ptsz,res=depth) + }else if(outform[o] == "eps"){ + postscript(file=fichier,width=size$width,height=size$height + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) + }#end if + + letitre = paste(lieu," \n Year comparison: ",desc,sep="") + lex = "Season" + ley = paste(desc," [",unit,"]") + + + barplot(season.mat,col=yr3mon.col,main=letitre,xlab=lex,ylab=ley + ,cex.main=cex.main,ylim=ylimit,legend.text=FALSE,beside=TRUE + ,border="gray23",xpd=FALSE) + box() + legend(x=leg.pos,inset=0.01,legend=yr3mon.desc,fill=yr3mon.col + ,title="Period",cex=0.9,ncol=2) + + + #----- Close the device. ------------------------------------------------------# + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + #------------------------------------------------------------------------------# + }#end for + #---------------------------------------------------------------------------------# + }#end if + #------------------------------------------------------------------------------------# + }#end for + #---------------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------------# + # Plot the monthly mean variables as functions of other 2 environment variables. # + #---------------------------------------------------------------------------------------# + print(paste(" + Plotting parameter space: ",lieu,"...",sep="")) + for (z in 1:nyc.zvar){ + zvname = yc.xyzvar$zvar[[z]]$vname + zdesc = yc.xyzvar$zvar[[z]]$desc + zkey = yc.xyzvar$zvar[[z]]$key + zunit = yc.xyzvar$zvar[[z]]$unit + + #----- Create the directories. ------------------------------------------------------# + outxyzp = paste(outpref,"xyzplot",sep="/") + outzvar = paste(outxyzp,zvname ,sep="/") + if (! file.exists(outxyzp )) dir.create(outxyzp ) + if (! file.exists(outzvar )) dir.create(outzvar ) + #------------------------------------------------------------------------------------# + + + #------------------------------------------------------------------------------------# + # Loop over all x and y axes. # + #------------------------------------------------------------------------------------# + print(paste(" * Z: ",zdesc,"...")) + for (y in 1:nyc.yvar){ + yvname = yc.xyzvar$yvar[[y]]$vname + ydesc = yc.xyzvar$yvar[[y]]$desc + yunit = yc.xyzvar$yvar[[y]]$unit + yleg = yc.xyzvar$yvar[[y]]$leg + + for (x in 1:nyc.xvar){ + xvname = yc.xyzvar$xvar[[x]]$vname + xdesc = yc.xyzvar$xvar[[x]]$desc + xunit = yc.xyzvar$xvar[[x]]$unit + xleg = yc.xyzvar$xvar[[x]]$leg + + + print(paste(" ~ X: ",xdesc," Y: ",ydesc,"...")) + + #----- Title. -----------------------------------------------------------------# + letitre = paste(lieu,zdesc,sep="\n") + #----- Attribute symbols according to the year. -------------------------------# + this.pch = eft.pch[match(yr.season,eft.year)] + #----- Expand the edges of the x axis. ----------------------------------------# + xvar = datum[[xvname]] + lex = paste(xdesc," [",xunit,"]",sep="") + xrange = range(xvar,na.rm=TRUE) + xlimit = xrange + xlimit[1] = xrange[1] - 0.05 * (xrange[2] - xrange[1]) + xlimit[2] = xrange[2] + 0.05 * (xrange[2] - xrange[1]) + #----- Expand the edges of the y axis. ----------------------------------------# + yvar = datum[[yvname]] + ley = paste(ydesc," [",yunit[y],"]",sep="") + yrange = range(yvar,na.rm=TRUE) + ylimit = yrange + ylimit[1] = yrange[1] - 0.05 * (yrange[2] - yrange[1]) + ylimit[2] = yrange[2] + 0.40 * (yrange[2] - yrange[1]) + #----- Annotation for the colour map ("Z" axis). ------------------------------# + zvar = datum[[zvname]] + lez = paste(zkey,"\n [",zunit,"]",sep="") + #----- Find the position to plot the legend. ----------------------------------# + leg.pos = paste(yleg,xleg,sep="") + + + + #------------------------------------------------------------------------------# + # Make lists for colourmap. # + #------------------------------------------------------------------------------# + ptitle = list() + ptitle[[1]] = list(main=letitre,xlab=lex,ylab=ley,cex.main=cex.main) + paxes = list() + paxes[[1]] = list( x.axis = list(side=1) + , y.axis = list(side=2) + , grid = list(col="gray62",lty="solid") + , legend = list( x = leg.pos + , inset = 0.01 + , legend = yr3mon.desc + , col = "black" + , bg = "white" + , pch = yr3mon.pch + , title = "Period" + , ncol = 2 + , pt.cex = 1./0.9 + , cex = 0.9 + )#end legend + )#end list + #------------------------------------------------------------------------------# + + + #------------------------------------------------------------------------------# + # Plot the bar plot. # + #------------------------------------------------------------------------------# + for (o in 1:nout){ + fichier = paste(outzvar,"/cmap_x_",xvname,"_y_",yvname + ,"_z_",zvname,"-",suffix,".",outform[o],sep="") + if(outform[o] == "x11"){ + X11(width=size$width,height=size$height,pointsize=ptsz) + }else if(outform[o] == "png"){ + png(filename=fichier,width=size$width*depth,height=size$height*depth + ,pointsize=ptsz,res=depth) + }else if(outform[o] == "eps"){ + postscript(file=fichier,width=size$width,height=size$height + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) + }#end if + + + + #----- Plot the parameter space. -------------------------------------------# + colourmap(x=xvar,y=yvar,z=zvar,xlim=xlimit,ylim=ylimit + ,colour.palette=muitas,cex=1.6,pch=this.pch,lwd=2 + ,plot.title=ptitle + ,key.title=title(main=lez,cex.main=0.8) + ,plot.axes=paxes + )#end colourmap + #---------------------------------------------------------------------------# + + + #---------------------------------------------------------------------------# + # Close the device. # + #---------------------------------------------------------------------------# + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + #---------------------------------------------------------------------------# + }#end for outform + #------------------------------------------------------------------------------# + }#end for + #---------------------------------------------------------------------------------# + }#end for + #------------------------------------------------------------------------------------# + }#end for + #---------------------------------------------------------------------------------------# +}#end for places +#------------------------------------------------------------------------------------------# + +#q("no") diff --git a/ED/Template/Template/plot_yearly.r b/ED/Template/Template/plot_yearly.r index a51d53788..1fdd797cf 100644 --- a/ED/Template/Template/plot_yearly.r +++ b/ED/Template/Template/plot_yearly.r @@ -1,106 +1,120 @@ -#----- Here is the user-defined variable section. -----------------------------------------# -here = "thispath" # Current directory. -there = "thatpath" # Directory where analyses/history are -srcdir = "/n/moorcroft_data/mlongo/util/Rsc" # Source directory. -outroot = "thisoutroot" -monthbeg = thismontha -yearbeg = thisyeara # First year to consider -yearend = thisyearz # Maximum year to consider -season.mona = thisseasonmona -myplaces = c("thispoly") -outform = thisoutform # Formats for output file. Supported formats are: - # - "X11" - for printing on screen - # - "eps" - for postscript printing - # - "png" - for PNG printing - # - "pdf" - for PDF printing - -byeold = TRUE # Remove old files of the given format? - -depth = 96 # PNG resolution, in pixels per inch -paper = "letter" # Paper size, to define the plot shape -ptsz = 14 # Font size. -lwidth = 2.5 # Line width -plotgrid = TRUE # Should I plot the grid in the background? - -sasfixlimits = FALSE # Should I use a fixed scale for size and age-structure - # plots? (FALSE will set a suitable scale for each year) - -ncolsfc = 200 # Target number of colours for filled contour plots. -fcgrid = TRUE # Should I include a grid on the filled contour plots? - -ncolshov = 200 # Target number of colours for Hovmoller diagrams. -hovgrid = TRUE # Should I include a grid on the Hovmoller plots? - -legwhere = "topleft" # Where should I place the legend? -inset = 0.01 # inset distance between legend and edge of plot region. -legbg = "white" # Legend background colour. -scalleg = 0.20 -cex.main = 0.8 # Scale coefficient for the title - -theta = 315. # Azimuth for perspective projection -phi = 30. # Vertical angle for perspective projection -ltheta = -210. # Azimuth angle for light -shade = 0.125 # Shade intensity -expz = 0.5 # Expansion factor for Z axis -gcol = c("lightblue","white") # Colours for the 50's style floor -cexmin = 0.5 # Minimum "head" size of the lollipop -cexmax = 3.0 # Maximum "head" size of the lollipop - -fracexp = 0.40 # Nudging factor for ylimit -ptype = "l" # Type of plot -ptyped = "p" # Type of plot -ptypeb = "o" # Type of plot - - - -#----- Loading some packages. -------------------------------------------------------------# -library(hdf5) -library(chron) -library(scatterplot3d) -library(lattice) -library(maps) -library(mapdata) -library(akima) -library(Hmisc) - -#----- In case there is some graphic still opened. ----------------------------------------# +#==========================================================================================# +#==========================================================================================# +# Leave these commands at the beginning. They will refresh the session. # +#------------------------------------------------------------------------------------------# +rm(list=ls()) graphics.off() +#==========================================================================================# +#==========================================================================================# + + + +#==========================================================================================# +#==========================================================================================# +# Here is the user defined variable section. # +#------------------------------------------------------------------------------------------# + +#----- Paths. -----------------------------------------------------------------------------# +here = "thispath" # Current directory. +there = "thatpath" # Directory where analyses/history are +srcdir = "/n/moorcroft_data/mlongo/util/Rsc" # Source directory. +outroot = "thisoutroot" # Directory for figures +#------------------------------------------------------------------------------------------# + + +#----- Time options. ----------------------------------------------------------------------# +monthbeg = thismontha # First month to use +yearbeg = thisyeara # First year to consider +yearend = thisyearz # Maximum year to consider +reload.data = TRUE # Should I reload partially loaded data? +sasmonth.short = c(2,5,8,11) # Months for SAS plots (short runs) +sasmonth.long = 5 # Months for SAS plots (long runs) +nyears.long = 25 # Runs longer than this are considered long runs. +#------------------------------------------------------------------------------------------# + + + +#----- Name of the simulations. -----------------------------------------------------------# +myplaces = c("thispoly") +#------------------------------------------------------------------------------------------# + + + +#----- Plot options. ----------------------------------------------------------------------# +outform = thisoutform # Formats for output file. Supported formats are: + # - "X11" - for printing on screen + # - "eps" - for postscript printing + # - "png" - for PNG printing + # - "pdf" - for PDF printing +depth = 96 # PNG resolution, in pixels per inch +paper = "letter" # Paper size, to define the plot shape +ptsz = 14 # Font size. +lwidth = 2.5 # Line width +plotgrid = TRUE # Should I plot the grid in the background? +fcgrid = TRUE # Include a grid on the filled contour plots? +ncolshov = 200 # Target number of colours for Hovmoller diagrams. +hovgrid = TRUE # Include a grid on the Hovmoller plots? +legwhere = "topleft" # Where should I place the legend? +inset = 0.01 # Inset between legend and edge of plot region. +legbg = "white" # Legend background colour. +scalleg = 0.40 # Expand y limits by this relative amount to fit + # the legend +cex.main = 0.8 # Scale coefficient for the title +ylnudge = 0.05 # Nudging factor for ylimit +ptype = "l" # Type of plot +ptyped = "p" # Type of plot +ptypeb = "o" # Type of plot +drought.mark = mydroughtmark # Put a background to highlight droughts? +drought.yeara = mydroughtyeara # First year that has drought +drought.yearz = mydroughtyearz # Last year that has drought +months.drought = mymonthsdrought # Months with drought +#------------------------------------------------------------------------------------------# + + + +#------ Miscellaneous settings. -----------------------------------------------------------# +slz.min = -5.0 # The deepest depth that trees access water. +idbh.type = myidbhtype # Type of DBH class + # 1 -- Every 10 cm until 100cm; > 100cm + # 2 -- 0-10; 10-20; 20-35; 35-50; 50-70; > 70 (cm) +#------------------------------------------------------------------------------------------# + + + +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# +# NO NEED TO CHANGE ANYTHING BEYOND THIS POINT UNLESS YOU ARE DEVELOPING THE CODE... # +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# + + + +#----- Load some packages and scripts. ----------------------------------------------------# +source(file.path(srcdir,"load.everything.r")) +#------------------------------------------------------------------------------------------# + #----- Set how many formats we must output. -----------------------------------------------# outform = tolower(outform) -nout = length(outform) +nout = length (outform) +#------------------------------------------------------------------------------------------# + #----- Avoid unecessary and extremely annoying beeps. -------------------------------------# options(locatorBell=FALSE) - - -#----- Load some files with functions. ----------------------------------------------------# -source(paste(srcdir,"atlas.r" ,sep="/")) -source(paste(srcdir,"charutils.r" ,sep="/")) -source(paste(srcdir,"census.r" ,sep="/")) -source(paste(srcdir,"cloudy.r" ,sep="/")) -source(paste(srcdir,"colourmap.r" ,sep="/")) -source(paste(srcdir,"error.bar.r" ,sep="/")) -source(paste(srcdir,"globdims.r" ,sep="/")) -source(paste(srcdir,"locations.r" ,sep="/")) -source(paste(srcdir,"muitas.r" ,sep="/")) -source(paste(srcdir,"plotsize.r" ,sep="/")) -source(paste(srcdir,"pretty.log.r" ,sep="/")) -source(paste(srcdir,"pretty.time.r" ,sep="/")) -source(paste(srcdir,"qapply.r" ,sep="/")) -source(paste(srcdir,"rconstants.r" ,sep="/")) -source(paste(srcdir,"soilutils.r" ,sep="/")) -source(paste(srcdir,"sombreado.r" ,sep="/")) -source(paste(srcdir,"southammap.r" ,sep="/")) -source(paste(srcdir,"thermlib.r" ,sep="/")) -source(paste(srcdir,"timeutils.r" ,sep="/")) -#----- These should be called after the others. --------------------------------------------# -source(paste(srcdir,"pft.coms.r" ,sep="/")) -source(paste(srcdir,"pyearly_varlist.r" ,sep="/")) +#------------------------------------------------------------------------------------------# #----- Load observations. -----------------------------------------------------------------# -obsrfile = paste(srcdir,"LBA_MIP.v7.RData",sep="/") +obsrfile = paste(srcdir,"LBA_MIP.v8.RData",sep="/") load(file=obsrfile) #----- Define plot window size ------------------------------------------------------------# @@ -133,397 +147,1096 @@ for (place in myplaces){ yearz = thispoi$yearz meszz = thispoi$monz + #---------------------------------------------------------------------------------------# + # Make sure we only deal with full years. # + #---------------------------------------------------------------------------------------# + if (monthbeg > 1) yeara = yeara + 1 + if (meszz < 12) yearz = yearz - 1 + monthbeg = 1 + meszz = 12 + if (yeara > yearz){ + cat(" - Yeara: ",yeara,"\n") + cat(" - Yearz: ",yearz,"\n") + cat(" - Prefix: ",inpref,"\n") + cat(" - Invalid years, will not process data...","\n") + q("no") + }#end if + #---------------------------------------------------------------------------------------# #----- Create the directories in case they don't exist. --------------------------------# if (! file.exists(outmain)) dir.create(outmain) if (! file.exists(outpref)) dir.create(outpref) + #---------------------------------------------------------------------------------------# + + + + #----- Decide how frequently the cohort-level variables should be saved. ---------------# + if (yearend - yearbeg + 1 <= nyears.long){ + sasmonth = sasmonth.short + }else{ + sasmonth = sasmonth.long + }#end if + #---------------------------------------------------------------------------------------# + + + #----- Print a banner to entretain the user. -------------------------------------------# - print(paste(" + Post-processing output from ",lieu,"...",sep="")) + cat(" + Post-processing output from ",lieu,"...","\n") #---------------------------------------------------------------------------------------# # Flush all variables that will hold the data. # #---------------------------------------------------------------------------------------# - totmon = (yearz-yeara-1)*12+meszz+(12-monthbeg+1) - #----- Polygon level vectors. ----------------------------------------------------------# - fast.soil.c = rep(NA,times=totmon) - slow.soil.c = rep(NA,times=totmon) - struct.soil.c = rep(NA,times=totmon) - nep = rep(NA,times=totmon) - nee = rep(NA,times=totmon) - gpp = rep(NA,times=totmon) - npp = rep(NA,times=totmon) - plresp = rep(NA,times=totmon) - leaf.resp = rep(NA,times=totmon) - root.resp = rep(NA,times=totmon) - growth.resp = rep(NA,times=totmon) - hetresp = rep(NA,times=totmon) - reco = rep(NA,times=totmon) - mco = rep(NA,times=totmon) - npp = rep(NA,times=totmon) - cba = rep(NA,times=totmon) - ldrop = rep(NA,times=totmon) - cflxca = rep(NA,times=totmon) - cflxst = rep(NA,times=totmon) - evap = rep(NA,times=totmon) - transp = rep(NA,times=totmon) - ustar = rep(NA,times=totmon) - atm.vels = rep(NA,times=totmon) - atm.prss = rep(NA,times=totmon) - atm.temp = rep(NA,times=totmon) - can.prss = rep(NA,times=totmon) - can.temp = rep(NA,times=totmon) - atm.co2 = rep(NA,times=totmon) - can.co2 = rep(NA,times=totmon) - leaf.temp = rep(NA,times=totmon) - wood.temp = rep(NA,times=totmon) - atm.shv = rep(NA,times=totmon) - can.shv = rep(NA,times=totmon) - can.co2 = rep(NA,times=totmon) - hflxca = rep(NA,times=totmon) - qwflxca = rep(NA,times=totmon) - wflxca = rep(NA,times=totmon) - agb = rep(NA,times=totmon) - basarea = rep(NA,times=totmon) - nplant = rep(NA,times=totmon) - lai = rep(NA,times=totmon) - wai = rep(NA,times=totmon) - tai = rep(NA,times=totmon) - rain = rep(NA,times=totmon) - gnd.temp = rep(NA,times=totmon) - gnd.shv = rep(NA,times=totmon) - fs.open = rep(NA,times=totmon) - hflxgc = rep(NA,times=totmon) - hflxlc = rep(NA,times=totmon) - hflxwc = rep(NA,times=totmon) - wflxgc = rep(NA,times=totmon) - wflxlc = rep(NA,times=totmon) - wflxwc = rep(NA,times=totmon) - rshort = rep(NA,times=totmon) - rshort.beam = rep(NA,times=totmon) - rshort.diff = rep(NA,times=totmon) - rlong = rep(NA,times=totmon) - rshort.gnd = rep(NA,times=totmon) - rlong.gnd = rep(NA,times=totmon) - rlongup = rep(NA,times=totmon) - rlong.albedo = rep(NA,times=totmon) - demand = rep(NA,times=totmon) - - n = 0 - tomonth = rep(NA,times=totmon) - - now.month = monthbeg - 1 + 12 * as.integer(monthbeg == 1) - now.year = yeara - as.integer(monthbeg == 1) - - #----- Loop over years. ----------------------------------------------------------------# - for (m in 1:totmon){ - now.month = (now.month %% 12) + 1 - now.year = now.year + as.integer(now.month == 1) - - #----- Build the file name. ---------------------------------------------------------# - cmonth = sprintf("%2.2i",now.month) - cyear = sprintf("%4.4i",now.year ) - ddd = daymax(now.month,now.year) - myfile = paste(inpref,"-Q-",cyear,"-",cmonth,"-00-000000-g01.h5",sep="") - print (paste(" - Reading data from file ",basename(myfile),"...",sep="")) - #------------------------------------------------------------------------------------# + ntimes = (yearz-yeara-1)*12+meszz+(12-monthbeg+1) + nyears = yearz-yeara+1 + #---------------------------------------------------------------------------------------# - #----- Read data and close connection immediately after. ----------------------------# - mymont = hdf5load(file=myfile,load=FALSE,verbosity=0,tidy=TRUE) - #------------------------------------------------------------------------------------# + #---------------------------------------------------------------------------------------# + # Make the RData file name, then we check whether we must read the files again # + # or use the stored RData. Notice that the path is the same for plot_ycomp.r and # + # plot_monthly, so you don't need to read in the data twice. # + #---------------------------------------------------------------------------------------# + path.data = paste(here,place,"rdata_month",sep="/") + if (! file.exists(path.data)) dir.create(path.data) + ed22.rdata = paste(path.data,paste(place,"RData",sep="."),sep="/") + if (reload.data && file.exists(ed22.rdata)){ + #----- Load the modelled dataset. ---------------------------------------------------# + cat(" - Loading previous session...","\n") + load(ed22.rdata) + tresume = datum$ntimes + 1 + datum = update.monthly( new.ntimes = ntimes + , old.datum = datum + , montha = monthbeg + , yeara = yeara + , inpref = inpref + , slz.min = slz.min + )#end update.monthly + }else{ + cat(" - Starting new session...","\n") + tresume = 1 + datum = create.monthly( ntimes = ntimes + , montha = monthbeg + , yeara = yeara + , inpref = inpref + , slz.min = slz.min + )#end create.monthly + }#end if + #---------------------------------------------------------------------------------------# - #----- Build the time. --------------------------------------------------------------# - tomonth [m] = as.numeric(chron(dates=paste(now.month,1,now.year,sep="/") - ,times="0:0:0") ) - #------------------------------------------------------------------------------------# + #---------------------------------------------------------------------------------------# + # Check whether we have anything to update. # + #---------------------------------------------------------------------------------------# + complete = tresume > ntimes + #---------------------------------------------------------------------------------------# - #----- Load the simple variables. ---------------------------------------------------# - gpp [m] = mymont$MMEAN.GPP - plresp [m] = mymont$MMEAN.PLRESP - leaf.resp [m] = mymont$MMEAN.LEAF.RESP - root.resp [m] = mymont$MMEAN.ROOT.RESP - growth.resp [m] = mymont$MMEAN.GROWTH.RESP - hetresp [m] = mymont$MMEAN.RH - reco [m] = plresp[m] + hetresp[m] - nep [m] = mymont$MMEAN.NEP - nee [m] = ( - mymont$MMEAN.CARBON.AC + mymont$MMEAN.CARBON.ST ) * yr.sec - cflxca [m] = - mymont$MMEAN.CARBON.AC - cflxst [m] = mymont$MMEAN.CARBON.ST - hflxca [m] = - mymont$MMEAN.SENSIBLE.AC - hflxlc [m] = mymont$MMEAN.SENSIBLE.LC - hflxwc [m] = mymont$MMEAN.SENSIBLE.WC - hflxgc [m] = mymont$MMEAN.SENSIBLE.GC - qwflxca [m] = - mymont$MMEAN.VAPOR.AC * alvli(mymont$MMEAN.CAN.TEMP) - wflxca [m] = - mymont$MMEAN.VAPOR.AC * day.sec - wflxlc [m] = mymont$MMEAN.VAPOR.LC * day.sec - wflxwc [m] = mymont$MMEAN.VAPOR.WC * day.sec - wflxgc [m] = mymont$MMEAN.VAPOR.GC * day.sec - evap [m] = mymont$MMEAN.EVAP * day.sec - transp [m] = mymont$MMEAN.TRANSP * day.sec - ustar [m] = mymont$MMEAN.USTAR - atm.vels [m] = mymont$MMEAN.ATM.VELS - atm.prss [m] = mymont$MMEAN.ATM.PRSS * 0.01 - atm.temp [m] = mymont$MMEAN.ATM.TEMP - t00 - atm.shv [m] = mymont$MMEAN.ATM.SHV * kg2g - atm.co2 [m] = mymont$MMEAN.ATM.CO2 - can.prss [m] = mymont$MMEAN.CAN.PRSS * 0.01 - can.temp [m] = mymont$MMEAN.CAN.TEMP - t00 - can.shv [m] = mymont$MMEAN.CAN.SHV * kg2g - can.co2 [m] = mymont$MMEAN.CAN.CO2 - gnd.temp [m] = mymont$MMEAN.GND.TEMP - t00 - gnd.shv [m] = mymont$MMEAN.GND.SHV * kg2g - leaf.temp [m] = mymont$MMEAN.LEAF.TEMP -t00 - wood.temp [m] = mymont$MMEAN.WOOD.TEMP -t00 - rain [m] = mymont$MMEAN.PCPG*ddd * day.sec - fs.open [m] = mymont$MMEAN.FS.OPEN - rshort [m] = mymont$MMEAN.RSHORT - rshort.beam [m] = mymont$MMEAN.RSHORT - mymont$MMEAN.RSHORT.DIFF - rshort.diff [m] = mymont$MMEAN.RSHORT.DIFF - rlong [m] = mymont$MMEAN.RLONG - rshort.gnd [m] = mymont$MMEAN.RSHORT.GND - rlong.gnd [m] = mymont$MMEAN.RLONG.GND - rlongup [m] = mymont$MMEAN.RLONGUP - rlong.albedo [m] = mymont$MMEAN.RLONG.ALBEDO - #------------------------------------------------------------------------------------# + #----- Copy some dimensions to scalars. ------------------------------------------------# + nzg = datum$nzg + nzs = datum$nzs + ndcycle = datum$ndcycle + isoilflg = datum$isoilflg + slz = datum$slz + slxsand = datum$slxsand + slxclay = datum$slxclay + ntext = datum$ntext + soil.prop = datum$soil.prop + dslz = datum$dslz + soil.depth = datum$soil.depth + soil.dry = datum$soil.dry + soil.poro = datum$soil.poro + ka = datum$ka + kz = datum$kz + #---------------------------------------------------------------------------------------# - #---- Read in the site-level area. --------------------------------------------------# - areasi = mymont$AREA.SI - npatches = mymont$SIPA.N - #------------------------------------------------------------------------------------# - #----- Read a few patch-level variables. --------------------------------------------# - areapa = mymont$AREA * rep(areasi,times=npatches) - #------------------------------------------------------------------------------------# + #---------------------------------------------------------------------------------------# + # Loop over all times in case there is anything new to be read. # + #---------------------------------------------------------------------------------------# + if (! complete){ #------------------------------------------------------------------------------------# - # Get the soil carbon. # + # This function will read the files. # #------------------------------------------------------------------------------------# - fast.soil.c [m] = sum(mymont$FAST.SOIL.C * areapa) - slow.soil.c [m] = sum(mymont$SLOW.SOIL.C * areapa) - struct.soil.c [m] = sum(mymont$STRUCTURAL.SOIL.C * areapa) + datum = read.q.files(datum=datum,ntimes=ntimes,tresume=tresume,sasmonth=sasmonth) #------------------------------------------------------------------------------------# - + #------ Save the data to the R object. ----------------------------------------------# + cat(" + Saving data to ",basename(ed22.rdata),"...","\n") + save(datum,file=ed22.rdata) #------------------------------------------------------------------------------------# - # Read the cohort-level variables. Because empty patchs do exist (deserts), # - # we must check whether there is any cohort to be read. If not, assign NA to # - # all variables. # - #------------------------------------------------------------------------------------# - ncohorts = mymont$PACO.N - if (any (ncohorts > 0)){ - areaconow = rep(areapa,times=ncohorts) - nplantconow = mymont$NPLANT - baconow = mymont$BA.CO - agbconow = mymont$AGB.CO - laiconow = mymont$LAI.CO - waiconow = mymont$WAI.CO - taiconow = laiconow + waiconow - gppconow = mymont$MMEAN.GPP.CO - leafrespconow = mymont$MMEAN.LEAF.RESP.CO - rootrespconow = mymont$MMEAN.ROOT.RESP.CO - growthrespconow = mymont$MMEAN.GROWTH.RESP.CO - respconow = ( mymont$MMEAN.LEAF.RESP.CO + mymont$MMEAN.ROOT.RESP.CO - + mymont$MMEAN.GROWTH.RESP.CO + mymont$MMEAN.STORAGE.RESP.CO - + mymont$MMEAN.VLEAF.RESP.CO ) - nppconow = gppconow-respconow - cbaconow = mymont$MMEAN.CB - mcostconow = ( mymont$MMEAN.LEAF.MAINTENANCE - + mymont$MMEAN.ROOT.MAINTENANCE ) - ldropconow = mymont$MMEAN.LEAF.DROP.CO - demandconow = mymont$MMEAN.PSI.OPEN * day.sec + }#end if (! complete) + #---------------------------------------------------------------------------------------# - #---------------------------------------------------------------------------------# - }else{ - #----- Make everything NA. -------------------------------------------------------# - areaconow = NA - nplantconow = NA - baconow = NA - agbconow = NA - laiconow = NA - waiconow = NA - taiconow = NA - gppconow = NA - leafrespconow = NA - rootrespconow = NA - growthrespconow = NA - respconow = NA - nppconow = NA - cbaconow = NA - mcostconow = NA - ldropconow = NA - demandconow = NA - }#end if - #------------------------------------------------------------------------------------# - #------------------------------------------------------------------------------------# - # The following two variables are used to scale "intensive" properties # - # (whatever/plant) to "extensive" (whatever/m2). Sometimes they may be used to # - # build weighted averages. # - #------------------------------------------------------------------------------------# - w.nplant = nplantconow * areaconow - w.lai = laiconow * areaconow - w.wai = laiconow * areaconow - w.tai = laiconow * areaconow - #------------------------------------------------------------------------------------# + + #----- Make some shorter versions of some variables. -----------------------------------# + mfac = datum$month + yfac = datum$year + dcycmean = datum$dcycmean + dcycmsqu = datum$dcycmsqu + #---------------------------------------------------------------------------------------# + #---------------------------------------------------------------------------------------# + # Consolidate the yearly means for the long-term dynamics (the PFT and DBH/PFT # + # stuff). # + #---------------------------------------------------------------------------------------# + cat (" - Finding the annual statistics for multi-dimensional variables...","\n") + cat (" * Aggregating the annual mean of PFT-DBH variables...","\n") + datum$agbpftdbh = qapply(X=datum$agbpftdbh ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$basareapftdbh = qapply(X=datum$basareapftdbh ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$laipftdbh = qapply(X=datum$laipftdbh ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$waipftdbh = qapply(X=datum$waipftdbh ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$taipftdbh = qapply(X=datum$taipftdbh ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$gpppftdbh = qapply(X=datum$gpppftdbh ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$npppftdbh = qapply(X=datum$npppftdbh ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$mcopftdbh = qapply(X=datum$mcopftdbh ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$cbapftdbh = qapply(X=datum$cbapftdbh ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$cbalightpftdbh = qapply(X=datum$cbalightpftdbh ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$cbamoistpftdbh = qapply(X=datum$cbamoistpftdbh ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$cbarelpftdbh = qapply(X=datum$cbarelpftdbh ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$ldroppftdbh = qapply(X=datum$ldroppftdbh ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$fsopftdbh = qapply(X=datum$fsopftdbh ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$demandpftdbh = qapply(X=datum$demandpftdbh ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$supplypftdbh = qapply(X=datum$supplypftdbh ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$nplantpftdbh = qapply(X=datum$nplantpftdbh ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$mortpftdbh = qapply(X=datum$mortpftdbh ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$agemortpftdbh = qapply(X=datum$agemortpftdbh ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$ncbmortpftdbh = qapply(X=datum$ncbmortpftdbh ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$tfallmortpftdbh = qapply(X=datum$tfallmortpftdbh,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$coldmortpftdbh = qapply(X=datum$coldmortpftdbh ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$distmortpftdbh = qapply(X=datum$distmortpftdbh ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$growthpftdbh = qapply(X=datum$growthpftdbh ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + #----- PFT arrays. The "+1" column contains the total. -------------------------------# + cat (" * Aggregating the annual mean of PFT variables...","\n") + datum$agbpft = qapply(X=datum$agbpft ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$bseedspft = qapply(X=datum$bseedspft ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$nplantpft = qapply(X=datum$nplantpft ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$laipft = qapply(X=datum$laipft ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$waipft = qapply(X=datum$waipft ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$taipft = qapply(X=datum$taipft ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$gpppft = qapply(X=datum$gpppft ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$npppft = qapply(X=datum$npppft ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$mcopft = qapply(X=datum$mcopft ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$cbapft = qapply(X=datum$cbapft ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$cbalightpft = qapply(X=datum$cbalightpft ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$cbamoistpft = qapply(X=datum$cbamoistpft ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$cbarelpft = qapply(X=datum$cbarelpft ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$ldroppft = qapply(X=datum$ldroppft ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$fsopft = qapply(X=datum$fsopft ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$balivepft = qapply(X=datum$balivepft ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$bdeadpft = qapply(X=datum$bdeadpft ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$bleafpft = qapply(X=datum$bleafpft ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$brootpft = qapply(X=datum$brootpft ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$bswoodpft = qapply(X=datum$bswoodpft ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$bstorepft = qapply(X=datum$bstorepft ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$basareapft = qapply(X=datum$basareapft ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$leafresppft = qapply(X=datum$leafresppft ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$rootresppft = qapply(X=datum$rootresppft ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$growthresppft = qapply(X=datum$growthresppft ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$mortpft = qapply(X=datum$mortpft ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$agemortpft = qapply(X=datum$agemortpft ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$ncbmortpft = qapply(X=datum$ncbmortpft ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$tfallmortpft = qapply(X=datum$tfallmortpft ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$coldmortpft = qapply(X=datum$coldmortpft ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$distmortpft = qapply(X=datum$distmortpft ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$recrpft = qapply(X=datum$recrpft ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$growthpft = qapply(X=datum$growthpft ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$censusnplantpft = qapply(X=datum$censusnplantpft,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$censuslaipft = qapply(X=datum$censuslaipft ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$censuswaipft = qapply(X=datum$censuswaipft ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$censustaipft = qapply(X=datum$censustaipft ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$censusagbpft = qapply(X=datum$censusagbpft ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$censusbapft = qapply(X=datum$censusbapft ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + #----- LU arrays. The "+1" column contains the total. --------------------------------# + cat (" * Aggregating the annual mean of LU variables...","\n") + datum$agblu = qapply(X=datum$agblu ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$lailu = qapply(X=datum$lailu ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$gpplu = qapply(X=datum$gpplu ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$npplu = qapply(X=datum$npplu ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$arealu = qapply(X=datum$arealu ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + datum$basarealu = qapply(X=datum$basarealu ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + #----- Miscellaneous arrays. -----------------------------------------------------------# + cat (" * Aggregating the annual mean of DIST variables...","\n") + datum$dist = qapply(X=datum$dist ,DIM=1,INDEX=yfac,FUN=mean,na.rm=T) + #---------------------------------------------------------------------------------------# - #------------------------------------------------------------------------------------# - # Build the derived variables. # - #------------------------------------------------------------------------------------# - npp [m] = sum( w.nplant * nppconow ) - mco [m] = sum( w.nplant * mcostconow ) - cba [m] = sum( w.nplant * cbaconow ) - nplant [m] = sum( w.nplant ) - lai [m] = sum( w.lai ) - wai [m] = sum( w.wai ) - tai [m] = sum( w.tai ) - agb [m] = sum( w.nplant * agbconow ) - basarea [m] = sum( w.nplant * baconow ) - demand [m] = sum( w.lai * demandconow) - #------------------------------------------------------------------------------------# - }#end for, year + #---------------------------------------------------------------------------------------# + # Here we find the monthly means for month, then compute the standard deviation. # + #---------------------------------------------------------------------------------------# + cat (" - Finding the monthly mean...","\n") + cat (" * Aggregating the monthly mean...","\n") + mont12mn = list() + mont12mn$gpp = tapply(X=datum$gpp ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$npp = tapply(X=datum$npp ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$nep = tapply(X=datum$nep ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$plresp = tapply(X=datum$plresp ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$leaf.resp = tapply(X=datum$leaf.resp ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$root.resp = tapply(X=datum$root.resp ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$growth.resp = tapply(X=datum$growth.resp ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$hetresp = tapply(X=datum$hetresp ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$cwdresp = tapply(X=datum$cwdresp ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$cflxca = tapply(X=datum$cflxca ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$cflxst = tapply(X=datum$cflxst ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$nee = tapply(X=datum$nee ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$reco = tapply(X=datum$reco ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$hflxca = tapply(X=datum$hflxca ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$hflxlc = tapply(X=datum$hflxlc ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$hflxwc = tapply(X=datum$hflxwc ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$hflxgc = tapply(X=datum$hflxgc ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$wflxca = tapply(X=datum$wflxca ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$qwflxca = tapply(X=datum$qwflxca ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$wflxlc = tapply(X=datum$wflxlc ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$wflxwc = tapply(X=datum$wflxwc ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$wflxgc = tapply(X=datum$wflxgc ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$evap = tapply(X=datum$evap ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$transp = tapply(X=datum$transp ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$rain = tapply(X=datum$rain ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$atm.temp = tapply(X=datum$atm.temp ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$rshort = tapply(X=datum$rshort ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$rshortup = tapply(X=datum$rshortup ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$rlong = tapply(X=datum$rlong ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$rlongup = tapply(X=datum$rlongup ,INDEX=mfac ,FUN=mean,na.rm=T) + # mont12mn$par.tot = tapply(X=datum$par.tot ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$parup = tapply(X=datum$parup ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$rnet = tapply(X=datum$rnet ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$albedo = tapply(X=datum$albedo ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$atm.shv = tapply(X=datum$atm.shv ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$atm.co2 = tapply(X=datum$atm.co2 ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$atm.prss = tapply(X=datum$atm.prss ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$atm.vels = tapply(X=datum$atm.vels ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$ustar = tapply(X=datum$ustar ,INDEX=mfac ,FUN=mean,na.rm=T) + mont12mn$soil.temp = qapply(X=datum$soil.temp ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) + mont12mn$soil.water = qapply(X=datum$soil.water ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) + mont12mn$soil.mstpot = qapply(X=datum$soil.mstpot ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) + #----- Find the mean sum of squares. ---------------------------------------------------# + cat (" * Standard deviation of the monthly means...","\n") + mont12sd = list() + mont12sd$gpp = tapply(X=datum$gpp ,INDEX=mfac ,FUN=sd ,na.rm=T) + mont12sd$npp = tapply(X=datum$npp ,INDEX=mfac ,FUN=sd ,na.rm=T) + mont12sd$nep = tapply(X=datum$nep ,INDEX=mfac ,FUN=sd ,na.rm=T) + mont12sd$plresp = tapply(X=datum$plresp ,INDEX=mfac ,FUN=sd ,na.rm=T) + mont12sd$leaf.resp = tapply(X=datum$leaf.resp ,INDEX=mfac ,FUN=sd ,na.rm=T) + mont12sd$root.resp = tapply(X=datum$root.resp ,INDEX=mfac ,FUN=sd ,na.rm=T) + mont12sd$growth.resp = tapply(X=datum$growth.resp ,INDEX=mfac ,FUN=sd ,na.rm=T) + mont12sd$hetresp = tapply(X=datum$hetresp ,INDEX=mfac ,FUN=sd ,na.rm=T) + mont12sd$cwdresp = tapply(X=datum$cwdresp ,INDEX=mfac ,FUN=sd ,na.rm=T) + mont12sd$cflxca = tapply(X=datum$cflxca ,INDEX=mfac ,FUN=sd ,na.rm=T) + mont12sd$cflxst = tapply(X=datum$cflxst ,INDEX=mfac ,FUN=sd ,na.rm=T) + mont12sd$nee = tapply(X=datum$nee ,INDEX=mfac ,FUN=sd ,na.rm=T) + mont12sd$reco = tapply(X=datum$reco ,INDEX=mfac ,FUN=sd ,na.rm=T) + mont12sd$hflxca = tapply(X=datum$hflxca ,INDEX=mfac ,FUN=sd ,na.rm=T) + mont12sd$hflxlc = tapply(X=datum$hflxlc ,INDEX=mfac ,FUN=sd ,na.rm=T) + mont12sd$hflxwc = tapply(X=datum$hflxwc ,INDEX=mfac ,FUN=sd ,na.rm=T) + mont12sd$hflxgc = tapply(X=datum$hflxgc ,INDEX=mfac ,FUN=sd ,na.rm=T) + mont12sd$wflxca = tapply(X=datum$wflxca ,INDEX=mfac ,FUN=sd ,na.rm=T) + mont12sd$qwflxca = tapply(X=datum$qwflxca ,INDEX=mfac ,FUN=sd ,na.rm=T) + mont12sd$wflxlc = tapply(X=datum$wflxlc ,INDEX=mfac ,FUN=sd ,na.rm=T) + mont12sd$wflxwc = tapply(X=datum$wflxwc ,INDEX=mfac ,FUN=sd ,na.rm=T) + mont12sd$wflxgc = tapply(X=datum$wflxgc ,INDEX=mfac ,FUN=sd ,na.rm=T) + mont12sd$evap = tapply(X=datum$evap ,INDEX=mfac ,FUN=sd ,na.rm=T) + mont12sd$transp = tapply(X=datum$transp ,INDEX=mfac ,FUN=sd ,na.rm=T) + mont12sd$rain = tapply(X=datum$rain ,INDEX=mfac ,FUN=sd ,na.rm=T) + mont12sd$atm.temp = tapply(X=datum$atm.temp ,INDEX=mfac ,FUN=sd ,na.rm=T) + mont12sd$rshort = tapply(X=datum$rshort ,INDEX=mfac ,FUN=sd ,na.rm=T) + mont12sd$rshortup = tapply(X=datum$rshortup ,INDEX=mfac ,FUN=sd ,na.rm=T) + mont12sd$rlong = tapply(X=datum$rlong ,INDEX=mfac ,FUN=sd ,na.rm=T) + mont12sd$rlongup = tapply(X=datum$rlongup ,INDEX=mfac ,FUN=sd ,na.rm=T) + # mont12sd$par.tot = tapply(X=datum$par.tot ,INDEX=mfac ,FUN=sd ,na.rm=T) + mont12sd$parup = tapply(X=datum$parup ,INDEX=mfac ,FUN=sd ,na.rm=T) + mont12sd$rnet = tapply(X=datum$rnet ,INDEX=mfac ,FUN=sd ,na.rm=T) + mont12sd$albedo = tapply(X=datum$albedo ,INDEX=mfac ,FUN=sd ,na.rm=T) + mont12sd$atm.shv = tapply(X=datum$atm.shv ,INDEX=mfac ,FUN=sd ,na.rm=T) + mont12sd$atm.co2 = tapply(X=datum$atm.co2 ,INDEX=mfac ,FUN=sd ,na.rm=T) + mont12sd$atm.prss = tapply(X=datum$atm.prss ,INDEX=mfac ,FUN=sd ,na.rm=T) + mont12sd$atm.vels = tapply(X=datum$atm.vels ,INDEX=mfac ,FUN=sd ,na.rm=T) + mont12sd$ustar = tapply(X=datum$ustar ,INDEX=mfac ,FUN=sd ,na.rm=T) + mont12sd$soil.temp = qapply(X=datum$soil.temp ,INDEX=mfac,DIM=1,FUN=sd ,na.rm=T) + mont12sd$soil.water = qapply(X=datum$soil.water ,INDEX=mfac,DIM=1,FUN=sd ,na.rm=T) + mont12sd$soil.mstpot = qapply(X=datum$soil.mstpot ,INDEX=mfac,DIM=1,FUN=sd ,na.rm=T) #---------------------------------------------------------------------------------------# #---------------------------------------------------------------------------------------# - # Convert tomonth back to chron. # + # Here we find the monthly means for month, then compute the standard deviation. # #---------------------------------------------------------------------------------------# - print (paste(" - Finding times...",sep="")) - tomonth = chron(tomonth) + cat (" - Finding the annual mean...","\n") + cat (" * Aggregating the annual mean...","\n") + year12mn = list() + year12mn$gpp = tapply(X=datum$gpp ,INDEX=yfac ,FUN=mean,na.rm=T) + year12mn$npp = tapply(X=datum$npp ,INDEX=yfac ,FUN=mean,na.rm=T) + year12mn$nep = tapply(X=datum$nep ,INDEX=yfac ,FUN=mean,na.rm=T) + year12mn$plresp = tapply(X=datum$plresp ,INDEX=yfac ,FUN=mean,na.rm=T) + year12mn$leaf.resp = tapply(X=datum$leaf.resp ,INDEX=yfac ,FUN=mean,na.rm=T) + year12mn$root.resp = tapply(X=datum$root.resp ,INDEX=yfac ,FUN=mean,na.rm=T) + year12mn$growth.resp = tapply(X=datum$growth.resp ,INDEX=yfac ,FUN=mean,na.rm=T) + year12mn$hetresp = tapply(X=datum$hetresp ,INDEX=yfac ,FUN=mean,na.rm=T) + year12mn$cwdresp = tapply(X=datum$cwdresp ,INDEX=yfac ,FUN=mean,na.rm=T) + year12mn$cflxca = tapply(X=datum$cflxca ,INDEX=yfac ,FUN=mean,na.rm=T) + year12mn$cflxst = tapply(X=datum$cflxst ,INDEX=yfac ,FUN=mean,na.rm=T) + year12mn$nee = tapply(X=datum$nee ,INDEX=yfac ,FUN=mean,na.rm=T) + year12mn$reco = tapply(X=datum$reco ,INDEX=yfac ,FUN=mean,na.rm=T) + year12mn$hflxca = tapply(X=datum$hflxca ,INDEX=yfac ,FUN=mean,na.rm=T) + year12mn$hflxlc = tapply(X=datum$hflxlc ,INDEX=yfac ,FUN=mean,na.rm=T) + year12mn$hflxwc = tapply(X=datum$hflxwc ,INDEX=yfac ,FUN=mean,na.rm=T) + year12mn$hflxgc = tapply(X=datum$hflxgc ,INDEX=yfac ,FUN=mean,na.rm=T) + year12mn$wflxca = tapply(X=datum$wflxca ,INDEX=yfac ,FUN=mean,na.rm=T) + year12mn$qwflxca = tapply(X=datum$qwflxca ,INDEX=yfac ,FUN=mean,na.rm=T) + year12mn$wflxlc = tapply(X=datum$wflxlc ,INDEX=yfac ,FUN=mean,na.rm=T) + year12mn$wflxwc = tapply(X=datum$wflxwc ,INDEX=yfac ,FUN=mean,na.rm=T) + year12mn$wflxgc = tapply(X=datum$wflxgc ,INDEX=yfac ,FUN=mean,na.rm=T) + year12mn$evap = tapply(X=datum$evap ,INDEX=yfac ,FUN=mean,na.rm=T) + year12mn$transp = tapply(X=datum$transp ,INDEX=yfac ,FUN=mean,na.rm=T) + year12mn$rain = tapply(X=datum$rain ,INDEX=yfac ,FUN=sum ,na.rm=T) + year12mn$atm.temp = tapply(X=datum$atm.temp ,INDEX=yfac ,FUN=mean,na.rm=T) + year12mn$rshort = tapply(X=datum$rshort ,INDEX=yfac ,FUN=mean,na.rm=T) + year12mn$rshortup = tapply(X=datum$rshortup ,INDEX=yfac ,FUN=mean,na.rm=T) + year12mn$rlong = tapply(X=datum$rlong ,INDEX=yfac ,FUN=mean,na.rm=T) + year12mn$rlongup = tapply(X=datum$rlongup ,INDEX=yfac ,FUN=mean,na.rm=T) + # year12mn$par.tot = tapply(X=datum$par.tot ,INDEX=yfac ,FUN=mean,na.rm=T) + year12mn$parup = tapply(X=datum$parup ,INDEX=yfac ,FUN=mean,na.rm=T) + year12mn$rnet = tapply(X=datum$rnet ,INDEX=yfac ,FUN=mean,na.rm=T) + year12mn$albedo = tapply(X=datum$albedo ,INDEX=yfac ,FUN=mean,na.rm=T) + year12mn$atm.shv = tapply(X=datum$atm.shv ,INDEX=yfac ,FUN=mean,na.rm=T) + year12mn$atm.co2 = tapply(X=datum$atm.co2 ,INDEX=yfac ,FUN=mean,na.rm=T) + year12mn$atm.prss = tapply(X=datum$atm.prss ,INDEX=yfac ,FUN=mean,na.rm=T) + year12mn$atm.vels = tapply(X=datum$atm.vels ,INDEX=yfac ,FUN=mean,na.rm=T) + year12mn$ustar = tapply(X=datum$ustar ,INDEX=yfac ,FUN=mean,na.rm=T) + year12mn$soil.temp = qapply(X=datum$soil.temp ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + year12mn$soil.water = qapply(X=datum$soil.water ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + year12mn$soil.mstpot = qapply(X=datum$soil.mstpot ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + cat (" * Standard deviation of the annual mean...","\n") + year12sd = list() + year12sd$gpp = tapply(X=datum$gpp ,INDEX=yfac ,FUN=sd ,na.rm=T) + year12sd$npp = tapply(X=datum$npp ,INDEX=yfac ,FUN=sd ,na.rm=T) + year12sd$nep = tapply(X=datum$nep ,INDEX=yfac ,FUN=sd ,na.rm=T) + year12sd$plresp = tapply(X=datum$plresp ,INDEX=yfac ,FUN=sd ,na.rm=T) + year12sd$leaf.resp = tapply(X=datum$leaf.resp ,INDEX=yfac ,FUN=sd ,na.rm=T) + year12sd$root.resp = tapply(X=datum$root.resp ,INDEX=yfac ,FUN=sd ,na.rm=T) + year12sd$growth.resp = tapply(X=datum$growth.resp ,INDEX=yfac ,FUN=sd ,na.rm=T) + year12sd$hetresp = tapply(X=datum$hetresp ,INDEX=yfac ,FUN=sd ,na.rm=T) + year12sd$cwdresp = tapply(X=datum$cwdresp ,INDEX=yfac ,FUN=sd ,na.rm=T) + year12sd$cflxca = tapply(X=datum$cflxca ,INDEX=yfac ,FUN=sd ,na.rm=T) + year12sd$cflxst = tapply(X=datum$cflxst ,INDEX=yfac ,FUN=sd ,na.rm=T) + year12sd$nee = tapply(X=datum$nee ,INDEX=yfac ,FUN=sd ,na.rm=T) + year12sd$reco = tapply(X=datum$reco ,INDEX=yfac ,FUN=sd ,na.rm=T) + year12sd$hflxca = tapply(X=datum$hflxca ,INDEX=yfac ,FUN=sd ,na.rm=T) + year12sd$hflxlc = tapply(X=datum$hflxlc ,INDEX=yfac ,FUN=sd ,na.rm=T) + year12sd$hflxwc = tapply(X=datum$hflxwc ,INDEX=yfac ,FUN=sd ,na.rm=T) + year12sd$hflxgc = tapply(X=datum$hflxgc ,INDEX=yfac ,FUN=sd ,na.rm=T) + year12sd$wflxca = tapply(X=datum$wflxca ,INDEX=yfac ,FUN=sd ,na.rm=T) + year12sd$qwflxca = tapply(X=datum$qwflxca ,INDEX=yfac ,FUN=sd ,na.rm=T) + year12sd$wflxlc = tapply(X=datum$wflxlc ,INDEX=yfac ,FUN=sd ,na.rm=T) + year12sd$wflxwc = tapply(X=datum$wflxwc ,INDEX=yfac ,FUN=sd ,na.rm=T) + year12sd$wflxgc = tapply(X=datum$wflxgc ,INDEX=yfac ,FUN=sd ,na.rm=T) + year12sd$evap = tapply(X=datum$evap ,INDEX=yfac ,FUN=sd ,na.rm=T) + year12sd$transp = tapply(X=datum$transp ,INDEX=yfac ,FUN=sd ,na.rm=T) + year12sd$rain = tapply(X=datum$rain*12 ,INDEX=yfac ,FUN=sd ,na.rm=T) + year12sd$atm.temp = tapply(X=datum$atm.temp ,INDEX=yfac ,FUN=sd ,na.rm=T) + year12sd$rshort = tapply(X=datum$rshort ,INDEX=yfac ,FUN=sd ,na.rm=T) + year12sd$rshortup = tapply(X=datum$rshortup ,INDEX=yfac ,FUN=sd ,na.rm=T) + year12sd$rlong = tapply(X=datum$rlong ,INDEX=yfac ,FUN=sd ,na.rm=T) + year12sd$rlongup = tapply(X=datum$rlongup ,INDEX=yfac ,FUN=sd ,na.rm=T) + # year12sd$par.tot = tapply(X=datum$par.tot ,INDEX=yfac ,FUN=sd ,na.rm=T) + year12sd$parup = tapply(X=datum$parup ,INDEX=yfac ,FUN=sd ,na.rm=T) + year12sd$rnet = tapply(X=datum$rnet ,INDEX=yfac ,FUN=sd ,na.rm=T) + year12sd$albedo = tapply(X=datum$albedo ,INDEX=yfac ,FUN=sd ,na.rm=T) + year12sd$atm.shv = tapply(X=datum$atm.shv ,INDEX=yfac ,FUN=sd ,na.rm=T) + year12sd$atm.co2 = tapply(X=datum$atm.co2 ,INDEX=yfac ,FUN=sd ,na.rm=T) + year12sd$atm.prss = tapply(X=datum$atm.prss ,INDEX=yfac ,FUN=sd ,na.rm=T) + year12sd$atm.vels = tapply(X=datum$atm.vels ,INDEX=yfac ,FUN=sd ,na.rm=T) + year12sd$ustar = tapply(X=datum$ustar ,INDEX=yfac ,FUN=sd ,na.rm=T) + year12sd$soil.temp = qapply(X=datum$soil.temp ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + year12sd$soil.water = qapply(X=datum$soil.water ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + year12sd$soil.mstpot = qapply(X=datum$soil.mstpot ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) #---------------------------------------------------------------------------------------# + + #---------------------------------------------------------------------------------------# - # Create a list with unique years. # + # Here we find the Mean diurnal cycle for each month, then compute the standard # + # deviation. # #---------------------------------------------------------------------------------------# - print (paste(" - Finding the years and seasons...",sep="")) - year.all = unique(numyears(tomonth)) - if (season.mona == 1){ - nyears = length(year.all) + 1 - year4 = c(year.all,2*year.all[nyears-1] - year.all[nyears-2]) - }else{ - nyears = length(year.all) - year4 = year.all - }#end if - year.desc = paste(year4-c(diff(year4)[1],diff(year4)),year4,sep="-") - year.col = eft.col[match(year4,eft.year)] - #----- Year for seasonal means. --------------------------------------------------------# - yr3mon = year.all - nyr3mon = length(yr3mon) - yr3mon.desc = paste("Dec",sprintf("%2.2i" - ,(yr3mon-c(diff(yr3mon)[1],diff(yr3mon))) %% 100 ) - ,"-Nov",sprintf("%2.2i",yr3mon %% 100),sep="") - yr3mon.col = eft.col[match(yr3mon,eft.year)] - yr3mon.pch = eft.pch[match(yr3mon,eft.year)] - #---------------------------------------------------------------------------------------# - - - dwhena = as.numeric(chron(paste(season.mona,1,year4[2],sep="/"))) - dwhenz = as.numeric(chron(paste(season.mona,1,year4[3],sep="/"))) - sel = tomonth >= dwhena & tomonth <= dwhenz - month.when = tomonth[sel] - - for (tt in 1:ntvar){ - thisvar = tvar[[tt]] - vname = thisvar$vnam - desc = thisvar$desc - if (vname == "rain"){ - unit = "mm/month" - }else{ - unit = thisvar$unit - }#end if - add0 = thisvar$add - mult0 = thisvar$mult - colmean = thisvar$colmean - colerr = thisvar$colerr - coledge = thisvar$coledge - plotit = thisvar$plt - cumul = thisvar$cumul - if (cumul){ - plttype = "l" - }else{ - plttype = "o" - }#end if + cat (" - Aggregating the annual mean of the diurnal cycle...","\n") + dcyc12mn =list() + dcyc12mn$gpp =qapply(X=dcycmean$gpp ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$npp =qapply(X=dcycmean$npp ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$plresp =qapply(X=dcycmean$plresp ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$leaf.resp =qapply(X=dcycmean$leaf.resp ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$root.resp =qapply(X=dcycmean$root.resp ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$hetresp =qapply(X=dcycmean$hetresp ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$cwdresp =qapply(X=dcycmean$cwdresp ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$nep =qapply(X=dcycmean$nep ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$nee =qapply(X=dcycmean$nee ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$reco =qapply(X=dcycmean$reco ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$cflxca =qapply(X=dcycmean$cflxca ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$cflxst =qapply(X=dcycmean$cflxst ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$hflxca =qapply(X=dcycmean$hflxca ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$hflxlc =qapply(X=dcycmean$hflxlc ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$hflxwc =qapply(X=dcycmean$hflxwc ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$hflxgc =qapply(X=dcycmean$hflxgc ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$wflxca =qapply(X=dcycmean$wflxca ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$qwflxca =qapply(X=dcycmean$qwflxca ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$wflxlc =qapply(X=dcycmean$wflxlc ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$wflxwc =qapply(X=dcycmean$wflxwc ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$wflxgc =qapply(X=dcycmean$wflxgc ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$evap =qapply(X=dcycmean$evap ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$transp =qapply(X=dcycmean$transp ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$atm.temp =qapply(X=dcycmean$atm.temp ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$can.temp =qapply(X=dcycmean$can.temp ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$leaf.temp =qapply(X=dcycmean$leaf.temp ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$wood.temp =qapply(X=dcycmean$wood.temp ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$gnd.temp =qapply(X=dcycmean$gnd.temp ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$atm.shv =qapply(X=dcycmean$atm.shv ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$can.shv =qapply(X=dcycmean$can.shv ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$gnd.shv =qapply(X=dcycmean$gnd.shv ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$atm.vpd =qapply(X=dcycmean$atm.vpd ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$can.vpd =qapply(X=dcycmean$can.vpd ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$leaf.vpd =qapply(X=dcycmean$leaf.vpd ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$atm.co2 =qapply(X=dcycmean$atm.co2 ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$can.co2 =qapply(X=dcycmean$can.co2 ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$atm.prss =qapply(X=dcycmean$atm.prss ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$can.prss =qapply(X=dcycmean$can.prss ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$atm.vels =qapply(X=dcycmean$atm.vels ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$ustar =qapply(X=dcycmean$ustar ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$fs.open =qapply(X=dcycmean$fs.open ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$rain =qapply(X=dcycmean$rain ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$rshort =qapply(X=dcycmean$rshort ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$rshort.beam =qapply(X=dcycmean$rshort.beam ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$rshort.diff =qapply(X=dcycmean$rshort.diff ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$rshort.gnd =qapply(X=dcycmean$rshort.gnd ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$rshortup =qapply(X=dcycmean$rshortup ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$rlong =qapply(X=dcycmean$rlong ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$rlong.gnd =qapply(X=dcycmean$rlong.gnd ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$rlongup =qapply(X=dcycmean$rlongup ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + # dcyc12mn$par.tot =qapply(X=dcycmean$par.tot ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + # dcyc12mn$par.beam =qapply(X=dcycmean$par.beam ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + # dcyc12mn$par.diff =qapply(X=dcycmean$par.diff ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + # dcyc12mn$par.gnd =qapply(X=dcycmean$par.gnd ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$parup =qapply(X=dcycmean$parup ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$rnet =qapply(X=dcycmean$rnet ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$albedo =qapply(X=dcycmean$albedo ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$albedo.beam =qapply(X=dcycmean$albedo.beam ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$albedo.diff =qapply(X=dcycmean$albedo.diff ,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$rlong.albedo=qapply(X=dcycmean$rlong.albedo,INDEX=yfac,DIM=1,FUN=mean,na.rm=T) + #----- Find the mean sum of squares. ---------------------------------------------------# + dcyc12sd =list() + dcyc12sd$gpp =qapply(X=dcycmean$gpp ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$npp =qapply(X=dcycmean$npp ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$plresp =qapply(X=dcycmean$plresp ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$leaf.resp =qapply(X=dcycmean$leaf.resp ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$root.resp =qapply(X=dcycmean$root.resp ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$hetresp =qapply(X=dcycmean$hetresp ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$cwdresp =qapply(X=dcycmean$cwdresp ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$nep =qapply(X=dcycmean$nep ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$nee =qapply(X=dcycmean$nee ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$reco =qapply(X=dcycmean$reco ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$cflxca =qapply(X=dcycmean$cflxca ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$cflxst =qapply(X=dcycmean$cflxst ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$hflxca =qapply(X=dcycmean$hflxca ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$hflxlc =qapply(X=dcycmean$hflxlc ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$hflxwc =qapply(X=dcycmean$hflxwc ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$hflxgc =qapply(X=dcycmean$hflxgc ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$wflxca =qapply(X=dcycmean$wflxca ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$qwflxca =qapply(X=dcycmean$qwflxca ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$wflxlc =qapply(X=dcycmean$wflxlc ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$wflxwc =qapply(X=dcycmean$wflxwc ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$wflxgc =qapply(X=dcycmean$wflxgc ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$evap =qapply(X=dcycmean$evap ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$transp =qapply(X=dcycmean$transp ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$atm.temp =qapply(X=dcycmean$atm.temp ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$can.temp =qapply(X=dcycmean$can.temp ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$leaf.temp =qapply(X=dcycmean$leaf.temp ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$wood.temp =qapply(X=dcycmean$wood.temp ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$gnd.temp =qapply(X=dcycmean$gnd.temp ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$atm.shv =qapply(X=dcycmean$atm.shv ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$can.shv =qapply(X=dcycmean$can.shv ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$gnd.shv =qapply(X=dcycmean$gnd.shv ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$atm.vpd =qapply(X=dcycmean$atm.vpd ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$can.vpd =qapply(X=dcycmean$can.vpd ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$leaf.vpd =qapply(X=dcycmean$leaf.vpd ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$atm.co2 =qapply(X=dcycmean$atm.co2 ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$can.co2 =qapply(X=dcycmean$can.co2 ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$atm.prss =qapply(X=dcycmean$atm.prss ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$can.prss =qapply(X=dcycmean$can.prss ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$atm.vels =qapply(X=dcycmean$atm.vels ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$ustar =qapply(X=dcycmean$ustar ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$fs.open =qapply(X=dcycmean$fs.open ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$rain =qapply(X=dcycmean$rain ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$rshort =qapply(X=dcycmean$rshort ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$rshort.beam =qapply(X=dcycmean$rshort.beam ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$rshort.diff =qapply(X=dcycmean$rshort.diff ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$rshort.gnd =qapply(X=dcycmean$rshort.gnd ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$rshortup =qapply(X=dcycmean$rshortup ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$rlong =qapply(X=dcycmean$rlong ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$rlong.gnd =qapply(X=dcycmean$rlong.gnd ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$rlongup =qapply(X=dcycmean$rlongup ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + # dcyc12sd$par.tot =qapply(X=dcycmean$par.tot ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + # dcyc12sd$par.beam =qapply(X=dcycmean$par.beam ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + # dcyc12sd$par.diff =qapply(X=dcycmean$par.diff ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + # dcyc12sd$par.gnd =qapply(X=dcycmean$par.gnd ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$parup =qapply(X=dcycmean$parup ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$rnet =qapply(X=dcycmean$rnet ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$albedo =qapply(X=dcycmean$albedo ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$albedo.beam =qapply(X=dcycmean$albedo.beam ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$albedo.diff =qapply(X=dcycmean$albedo.diff ,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + dcyc12sd$rlong.albedo=qapply(X=dcycmean$rlong.albedo,INDEX=yfac,DIM=1,FUN=sd ,na.rm=T) + #---------------------------------------------------------------------------------------# + + #---------------------------------------------------------------------------------------# + # Remove all elements of the DBH/PFT class that do not have a single valid cohort # + # at any given time. # + #---------------------------------------------------------------------------------------# + empty = datum$nplantpftdbh == 0 + datum$agbpftdbh [empty] = NA + datum$basareapftdbh [empty] = NA + datum$laipftdbh [empty] = NA + datum$waipftdbh [empty] = NA + datum$taipftdbh [empty] = NA + datum$gpppftdbh [empty] = NA + datum$npppftdbh [empty] = NA + datum$mcopftdbh [empty] = NA + datum$cbapftdbh [empty] = NA + datum$cbalightpftdbh [empty] = NA + datum$cbamoistpftdbh [empty] = NA + datum$cbarelpftdbh [empty] = NA + datum$ldroppftdbh [empty] = NA + datum$fsopftdbh [empty] = NA + datum$demandpftdbh [empty] = NA + datum$supplypftdbh [empty] = NA + datum$mortpftdbh [empty] = NA + datum$agemortpftdbh [empty] = NA + datum$ncbmortpftdbh [empty] = NA + datum$tfallmortpftdbh [empty] = NA + datum$coldmortpftdbh [empty] = NA + datum$distmortpftdbh [empty] = NA + datum$growthpftdbh [empty] = NA + datum$nplantpftdbh [empty] = NA + #---------------------------------------------------------------------------------------# - if (plotit){ - print(paste(" * ",desc,"...")) + #---------------------------------------------------------------------------------------# + # Convert mortality and recruitment so it is scaled between 0 and 100%. # + #---------------------------------------------------------------------------------------# + datum$mortpftdbh = 100. * (1.0 - exp(- datum$mortpftdbh )) + datum$agemortpftdbh = 100. * (1.0 - exp(- datum$agemortpftdbh )) + datum$ncbmortpftdbh = 100. * (1.0 - exp(- datum$ncbmortpftdbh )) + datum$tfallmortpftdbh = 100. * (1.0 - exp(- datum$tfallmortpftdbh)) + datum$coldmortpftdbh = 100. * (1.0 - exp(- datum$coldmortpftdbh )) + datum$distmortpftdbh = 100. * (1.0 - exp(- datum$distmortpftdbh )) + datum$mortpft = 100. * (1.0 - exp(- datum$mortpft )) + datum$agemortpft = 100. * (1.0 - exp(- datum$agemortpft )) + datum$ncbmortpft = 100. * (1.0 - exp(- datum$ncbmortpft )) + datum$tfallmortpft = 100. * (1.0 - exp(- datum$tfallmortpft )) + datum$coldmortpft = 100. * (1.0 - exp(- datum$coldmortpft )) + datum$distmortpft = 100. * (1.0 - exp(- datum$distmortpft )) + datum$recrpft = 100. * (exp( datum$recrpft ) - 1.0) + #---------------------------------------------------------------------------------------# - #----- Create the directories. ---------------------------------------------------# - outtser = paste(outpref,"tseries",sep="/") - outbplot = paste(outpref,"bplot" ,sep="/") - if (! file.exists(outtser )) dir.create(outtser ) - if (! file.exists(outbplot)) dir.create(outbplot) - #---------------------------------------------------------------------------------# + #----- Find which PFTs, land uses and transitions we need to consider ------------------# + pftave = colMeans(datum$agbpft,na.rm=TRUE) + luave = colMeans(datum$agblu ,na.rm=TRUE) + distave = matrix(NA,nrow=3,ncol=3) + for (jlu in 1:nlu){ + for (ilu in 1:nlu){ + distave[ilu,jlu] = mean(datum$dist[,ilu,jlu]) + }#end for + }#end for + selpft = pftave > 0. + sellu = luave > 0. + seldist = distave > 0. + #---------------------------------------------------------------------------------------# + + #---------------------------------------------------------------------------------------# + # Define a suitable scale for diurnal cycle... # + #---------------------------------------------------------------------------------------# + thisday = seq(from=0,to=ndcycle,by=1) * 24 / ndcycle + dcycplot = list() + dcycplot$levels = c(0,4,8,12,16,20,24) + dcycplot$n = 7 + dcycplot$scale = "hours" + dcycplot$padj = rep(0,times=dcycplot$n) + #---------------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------------# + # Define a suitable scale for soil profile layers... # + #---------------------------------------------------------------------------------------# + znice = -pretty.log(-slz,n=8) + znice = sort(c(znice,slz[1],slz[nzg])) + sel = znice >= slz[1] & znice <= slz[nzg] + znice = znice[sel] + zat = -log(-znice) + nznice = length(znice) + znice = sprintf("%.2f",znice) + #---------------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------------# + # Define a suitable scale for monthly means... # + #---------------------------------------------------------------------------------------# + montmont = seq(from=1,to=12,by=1) + montplot = list() + montplot$levels = montmont + montplot$labels = capwords(mon2mmm(montmont)) + montplot$n = 12 + montplot$scale = "months" + montplot$padj = rep(0,times=dcycplot$n) + #---------------------------------------------------------------------------------------# + + + + + + #=======================================================================================# + #=======================================================================================# + #=======================================================================================# + # Plotting section begins here... # + #---------------------------------------------------------------------------------------# + cat (" - Plotting figures...","\n") + #---------------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------------# + # Time series by PFT. # + #---------------------------------------------------------------------------------------# + for (v in 1:ntspft){ + thistspft = tspft[[v]] + vnam = thistspft$vnam + description = thistspft$desc + unit = thistspft$unit + plog = thistspft$plog + plotit = thistspft$plt + + #----- Check whether the user wants to have this variable plotted. ------------------# + if (plotit && any(selpft)){ + #---------------------------------------------------------------------------------# - # Create the list of data. # + # Check whether the time series directory exists. If not, create it. # #---------------------------------------------------------------------------------# - outplot = list() - ylimit = NULL - for (y in 2:nyears){ - whena.now = chron(paste(season.mona,1,year4[y-1],sep="/")) - whenz.now = chron(paste(season.mona,1,year4[y] ,sep="/")) - sel = tomonth >= whena.now & tomonth <= whenz.now - nsel = sum(sel) - outplot[[y]] = list() - outplot[[y]]$x = month.when - if (cumul){ - datum = get(vname)[sel] - datum[is.na(datum)] = 0 - outplot[[y]]$y = cumsum(datum) - }else{ - outplot[[y]]$y = get(vname)[sel] + outdir = paste(outpref,"tspft",sep="/") + if (! file.exists(outdir)) dir.create(outdir) + cat(" +",description,"time series for all PFTs...","\n") + + #----- Load variable -------------------------------------------------------------# + if (vnam %in% names(datum)){ + thisvar = datum[[vnam]] + if (plog){ + #----- Eliminate non-positive values in case it is a log plot. -------------# + thisvar[thisvar <= 0] = NA }#end if + }else{ + thisvar = matrix(NA,ncol=npft+1,nrow=nyears) + }#end if + #---------------------------------------------------------------------------------# + - #----- Update range. ----------------------------------------------------------# - if (any(is.finite(outplot[[y]]$y)) ){ - y.min = min(outplot[[y]]$y,na.rm=TRUE) - y.max = max(outplot[[y]]$y,na.rm=TRUE) - ylimit = range(c(ylimit,y.min,y.max)) + + #----- Loop over output formats. -------------------------------------------------# + for (o in 1:nout){ + fichier = paste(outdir,"/",vnam,"-",suffix,".",outform[o],sep="") + if(outform[o] == "x11"){ + X11(width=size$width,height=size$height,pointsize=ptsz) + }else if(outform[o] == "png"){ + png(filename=fichier,width=size$width*depth,height=size$height*depth + ,pointsize=ptsz,res=depth) + }else if(outform[o] == "eps"){ + postscript(file=fichier,width=size$width,height=size$height + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) }#end if + + #------------------------------------------------------------------------------# - }#end for - #----- Make a dummy limit in case everything is empty. ---------------------------# - if (is.null(ylimit)){ - ylimit = c(-1,1) + # Find the limit, make some room for the legend, and in case the field is # + # a constant, nudge the limits so the plot command will not complain. # + #------------------------------------------------------------------------------# + ylimit = pretty.xylim(u = thisvar[,selpft],fracexp=scalleg,is.log=plog) + if (plog){ + xylog = "y" + ydrought = c( exp(sqrt(ylimit[1]^3/ylimit[2])) + , exp(sqrt(ylimit[2]^3/ylimit[1])) + )#end c + }else{ + xylog = "" + ydrought = c( ylimit[1] - 0.5 * diff(ylimit),ylimit[2] + 0.5 * diff(ylimit) ) + }#end if + #------------------------------------------------------------------------------# + + + + letitre = paste(description,lieu,sep=" - ") + cols = pft$colour[selpft] + legs = pft$name [selpft] + plot(x=datum$toyear,y=thisvar[,1],type="n",main=letitre,ylim=ylimit + ,xlab="Year",ylab=unit,cex.main=0.7,log=xylog) + + if (drought.mark){ + for (n in 1:ndrought){ + rect(xleft = drought[[n]][1],ybottom = ydrought[1] + ,xright = drought[[n]][2],ytop = ydrought[2] + ,col = "gray84",border=NA) + }#end for + }#end if + + if (plotgrid){ + abline(v=axTicks(side=1),h=axTicks(side=2),col="gray52",lty="solid") + }#end if + for (n in 1:(npft+1)){ + if (selpft[n]){ + lines(datum$toyear,thisvar[,n],type="l",col=pft$colour[n],lwd=lwidth) + }#end if + }#end for + legend(x=legwhere,inset=inset,bg=legbg,legend=legs,col=cols,lwd=lwidth) + + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + } #end for outform + }#end if (tseragbpft) + } #end for tseries + #---------------------------------------------------------------------------------------# + + + + + #---------------------------------------------------------------------------------------# + # Time series by DBH, by PFT. # + #---------------------------------------------------------------------------------------# + #----- Find the PFTs to plot. ----------------------------------------------------------# + pftuse = which(apply(X=datum$agbpftdbh,MARGIN=3,FUN=sum,na.rm=TRUE) > 0.) + pftuse = pftuse[pftuse != (npft+1)] + for (v in 1:ntspftdbh){ + thistspftdbh = tspftdbh[[v]] + vnam = thistspftdbh$vnam + description = thistspftdbh$desc + unit = thistspftdbh$unit + plog = thistspftdbh$plog + plotit = thistspftdbh$plt + + #----- Load variable ----------------------------------------------------------------# + if (vnam %in% names(datum)){ + thisvar = datum[[vnam]] + if (plog){ + xylog="y" + thisvar[thisvar <= 0] = NA }else{ - ylimit[2] = ylimit[2] + fracexp * (ylimit[2] - ylimit[1]) + xylog="" }#end if + }else{ + thisvar = array(NA,dim=c(nyears,ndbh+1,npft+1)) + }#end if + #----- Check whether the user wants to have this variable plotted. ------------------# + if (plotit && length(pftuse) > 0 && any(is.finite(thisvar))){ + #---------------------------------------------------------------------------------# + # Check whether the time series directory exists. If not, create it. # + #---------------------------------------------------------------------------------# + outdir = paste(outpref,"tsdbh",sep="/") + if (! file.exists(outdir)) dir.create(outdir) + outvar = paste(outdir,vnam,sep="/") + if (! file.exists(outvar)) dir.create(outvar) + #---------------------------------------------------------------------------------# + + cat(" +",description,"time series for DBH class...","\n") + #---------------------------------------------------------------------------------# - # Make the time axis. # + # Find the limit, make some room for the legend, and in case the field is a # + # constant, nudge the limits so the plot command will not complain. # #---------------------------------------------------------------------------------# - whenplot = pretty.time(chron(c(dwhena,dwhenz)),n=8) - whenplot$labels = substring(mlist[nummonths(whenplot$levels)],1,3) + ylimit = pretty.xylim(u=thisvar[,,pftuse],fracexp=scalleg,is.log=plog) + if (plog){ + xylog = "y" + ydrought = c( exp(sqrt(ylimit[1]^3/ylimit[2])) + , exp(sqrt(ylimit[2]^3/ylimit[1])) + )#end c + }else{ + xylog = "" + ydrought = c( ylimit[1] - 0.5 * diff(ylimit),ylimit[2] + 0.5 * diff(ylimit) ) + }#end if #---------------------------------------------------------------------------------# + for (p in pftuse){ + + cpp = substring(100+p,2,3) + pftlab = paste("pft-",cpp,sep="") + + cat(" - ",pft$name[p],"\n") + + + #----- Loop over output formats. ----------------------------------------------# + for (o in 1:nout){ + fichier = paste(outvar,"/",vnam,"-",pftlab,"-",suffix,".",outform[o],sep="") + if(outform[o] == "x11"){ + X11(width=size$width,height=size$height,pointsize=ptsz) + }else if(outform[o] == "png"){ + png(filename=fichier,width=size$width*depth,height=size$height*depth + ,pointsize=ptsz,res=depth) + }else if(outform[o] == "eps"){ + postscript(file=fichier,width=size$width,height=size$height + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) + }#end if + letitre = paste(description,pft$name[p],lieu,sep=" - ") + plot(x=datum$toyear,y=thisvar[,1,p],type="n",main=letitre,ylim=ylimit + ,xlab="Time",ylab=unit,cex.main=0.7,log=xylog) + if (drought.mark){ + for (n in 1:ndrought){ + rect(xleft = drought[[n]][1],ybottom = ydrought[1] + ,xright = drought[[n]][2],ytop = ydrought[2] + ,col = "gray84",border=NA) + }#end for + }#end if + if (plotgrid){ + abline(v=axTicks(side=1),h=axTicks(side=2),col="gray52",lty="solid") + }#end if + for (d in seq(from=1,to=ndbh+1,by=1)){ + lines(datum$toyear,thisvar[,d,p],type="l",col=dbhcols[d],lwd=lwidth) + }#end for + legend(x=legwhere,inset=inset,bg=legbg,legend=dbhnames,col=dbhcols + ,ncol=2,title="DBH class",lwd=lwidth,cex=0.8) + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + } #end for outform + }#end for (p in pftuse) + }#end if (tseragbpft) + } #end for tseries + #---------------------------------------------------------------------------------------# + + + + + #---------------------------------------------------------------------------------------# + # Plot the comparison between observations and model. # + #---------------------------------------------------------------------------------------# + cat(" + Year-by-year comparisons of monthly means...","\n") + for (cc in 1:ncompmmean){ + + #----- Retrieve variable information from the list. ---------------------------------# + compnow = compmmean[[cc]] + vname = compnow$vnam + description = compnow$desc + unit = compnow$unit + plotsd = compnow$plotsd + lcolours = compnow$colour + errcolours = compnow$errcol + angle = compnow$angle + dens = compnow$dens + llwd = compnow$lwd + shwd = compnow$shwd + llwd = compnow$lwd + ltype = compnow$type + plog = compnow$plog + legpos = compnow$legpos + plotit = compnow$plt + + plotit = plotit && vname %in% ls() && vname %in% names(mont12mn) + + if (plotit){ + #---------------------------------------------------------------------------------# + # Copy the observations to a scratch variable. # + #---------------------------------------------------------------------------------# + thisvar = datum[[vname]] + thismean = mont12mn[[vname]] + thissdev = mont12sd[[vname]] + if (length(mont12sd[[vname]]) == 0){ + thissdev = 0. * thismean + }else{ + thissdev = mont12sd[[vname]] + }#end if + mod.x = montmont + mod.ylow = thismean - thissdev + mod.yhigh = thismean + thissdev + mod.x.poly = c(mod.x,rev(mod.x)) + mod.y.poly = c(mod.ylow,rev(mod.yhigh)) + mod.keep = is.finite(mod.y.poly) + mod.x.poly = mod.x.poly[mod.keep] + mod.y.poly = mod.y.poly[mod.keep] #---------------------------------------------------------------------------------# - # Plot the data. # + + + + #---------------------------------------------------------------------------------# + # Check whether the time series directory exists. If not, create it. # + #---------------------------------------------------------------------------------# + outdir = paste(outpref,"ycomp",sep="/") + outvar = paste(outdir,vname,sep="/") + if (! file.exists(outdir)) dir.create(outdir) + if (! file.exists(outvar)) dir.create(outvar) + cat(" - ",description,"comparison...","\n") + #---------------------------------------------------------------------------------# + + + + #----- Find the plot range. ------------------------------------------------------# + if (plotsd){ + ylimit = range(c(mod.ylow,mod.yhigh,thisvar),na.rm=TRUE) + }else{ + ylimit = range(thisvar,na.rm=TRUE) + }#end if + #----- Expand the upper range in so the legend doesn't hide things. --------------# + ylimit = pretty.xylim(u=ylimit,fracexp=scalleg,is.log=FALSE) + #---------------------------------------------------------------------------------# + + + #---------------------------------------------------------------------------------# + # Loop over all years, and make one plot per year. # + #---------------------------------------------------------------------------------# + for (y in 1:nyears){ + #----- Retrieve the year and the variable for this year. ----------------------# + year.now = datum$toyear[y] + cyear = sprintf("%4.4i",year.now) + var.year = thisvar[yfac == year.now] + #------------------------------------------------------------------------------# + + + #----- Loop over formats. -----------------------------------------------------# + for (o in 1:nout){ + fichier = paste(outvar,"/",vname,"-",cyear,".",outform[o],sep="") + if(outform[o] == "x11"){ + X11(width=size$width,height=size$height,pointsize=ptsz) + }else if(outform[o] == "png"){ + png(filename=fichier,width=size$width*depth,height=size$height*depth + ,pointsize=ptsz,res=depth) + }else if(outform[o] == "eps"){ + postscript(file=fichier,width=size$width,height=size$height + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) + }#end if + + + #----- Load variable -------------------------------------------------------# + letitre = paste(description," - ",lieu,"\n","Monthly mean - ",cyear,sep="") + plot(x=montmont,y=var.year,type="n",main=letitre,xlab="Time" + ,ylim=ylimit,ylab=paste("[",unit,"]",sep=""),log=plog,xaxt="n" + ,cex.main=cex.main) + axis(side=1,at=montplot$levels,labels=montplot$labels,padj=montplot$padj) + if (plotgrid){ + abline(v=montplot$levels,h=axTicks(side=2),col="gray52",lty="solid") + }#end if + if (plotsd){ + polygon(x=mod.x.poly,y=mod.y.poly,col=errcolours[2],angle=angle[2] + ,density=dens[1],lty="solid",lwd=shwd[1]) + }#end if + points(x=montmont,y=var.year,col=lcolours[1],lwd=llwd[1],type=ltype + ,pch=16,cex=1.0) + points(x=montmont,y=thismean,col=lcolours[2],lwd=llwd[2],type=ltype + ,pch=16,cex=1.0) + if (plotsd){ + legend( x = legpos + , inset = 0.01 + , legend = c(cyear,paste("Mean: ",yeara,"-",yearz,sep="")) + , fill = errcolours + , angle = angle + , density = dens + , lwd = llwd + , col = lcolours + , bg = "white" + , title = "Shaded areas = 1 SD" + , cex = 1.0 + , pch = 16 + )#end legend + }else{ + legend( x = legpos + , inset = 0.05 + , legend = c(cyear,paste("Mean: ",yeara,"-",yearz,sep="")) + , col = lcolours + , lwd = llwd + , cex = 1.0 + , pch = 16 + )#end legend + }#end if + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + #---------------------------------------------------------------------------# + } #end for outform + #------------------------------------------------------------------------------# + }#end for years + #---------------------------------------------------------------------------------# + }#end if plotit + #------------------------------------------------------------------------------------# + }#end for ncompare + #---------------------------------------------------------------------------------------# + + + + + #---------------------------------------------------------------------------------------# + # Time series by LU. # + #---------------------------------------------------------------------------------------# + for (v in 1:ntslu){ + thistslu = tslu[[v]] + vnam = thistslu$vnam + description = thistslu$desc + unit = thistslu$unit + plog = thistslu$plog + plotit = thistslu$plt + + #----- Check whether the user wants to have this variable plotted. ------------------# + if (plotit && any(sellu)){ + + #---------------------------------------------------------------------------------# + # Check whether the time series directory exists. If not, create it. # + #---------------------------------------------------------------------------------# + outdir = paste(outpref,"tslu",sep="/") + if (! file.exists(outdir)) dir.create(outdir) + cat(" +",description,"time series for all LUs...","\n") + + + + #----- Load variable -------------------------------------------------------------# + thisvar = datum[[vnam]] + if (plog){ + #----- Eliminate non-positive values in case it is a log plot. ----------------# + thisvar[thisvar <= 0] = NA + }#end if + #---------------------------------------------------------------------------------# + + #----- Loop over output formats. -------------------------------------------------# for (o in 1:nout){ - fichier = paste(outtser,"/ycomp-",vname,"-",suffix,".",outform[o],sep="") + fichier = paste(outdir,"/",vnam,"-",suffix,".",outform[o],sep="") if(outform[o] == "x11"){ X11(width=size$width,height=size$height,pointsize=ptsz) }else if(outform[o] == "png"){ @@ -536,102 +1249,208 @@ for (place in myplaces){ pdf(file=fichier,onefile=FALSE ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) }#end if - - letitre = paste(lieu," \n",desc,sep="") - lex = "Months" - ley = paste(desc," [",unit,"]") - plot(x=outplot[[2]]$x,y=outplot[[2]]$y,type="n",main=letitre,xlab=lex,ylab=ley - ,ylim=ylimit,cex.main=cex.main,xaxt="n") - axis(side=1,at=whenplot$levels,labels=whenplot$labels,padj=whenplot$padj) + #------------------------------------------------------------------------------# + # Find the limit, make some room for the legend, and in case the field is # + # a constant, nudge the limits so the plot command will not complain. # + #------------------------------------------------------------------------------# + ylimit = pretty.xylim(u=thisvar[,sellu],fracexp=scalleg,is.log=plog) + if (plog){ + xylog = "y" + ydrought = c( exp(sqrt(ylimit[1]^3/ylimit[2])) + , exp(sqrt(ylimit[2]^3/ylimit[1])) + )#end c + }else{ + xylog = "" + ydrought = c( ylimit[1] - 0.5 * diff(ylimit),ylimit[2] + 0.5 * diff(ylimit) ) + }#end if + #------------------------------------------------------------------------------# + + letitre = paste(description,lieu,sep=" - ") + cols = lucols[sellu] + legs = lunames[sellu] + plot(datum$toyear,thisvar[,1],type="n",main=letitre,ylim=ylimit + ,xlab="Year",ylab=unit,cex.main=0.7) + + if (drought.mark){ + for (n in 1:ndrought){ + rect(xleft = drought[[n]][1],ybottom = ydrought[1] + ,xright = drought[[n]][2],ytop = ydrought[2] + ,col = "gray84",border=NA) + }#end for + }#end if if (plotgrid){ - abline(v=whenplot$levels,h=axTicks(side=2),col="gray62",lty="solid") + abline(v=axTicks(side=1),h=axTicks(side=2),col="gray52",lty="solid") }#end if - for (y in 2:nyears){ - lines(x=outplot[[y]]$x,y=outplot[[y]]$y,type=plttype,pch=16,cex=1.0 - ,lwd=2.5,col=year.col[y]) + for (n in 1:(nlu+1)){ + if (sellu[n]){ + lines(datum$toyear,thisvar[,n],type="l",col=lucols[n],lwd=lwidth) + }#end if }#end for - legend(x="topleft",inset=0.01,legend=year.desc[2:nyears] - ,lwd=2.5,col=year.col[2:nyears],title="Period",cex=0.9,ncol=3) - + legend(x=legwhere,inset=inset,bg=legbg,legend=legs,col=cols,lwd=lwidth) - #----- Close the device. ------------------------------------------------------# if (outform[o] == "x11"){ locator(n=1) dev.off() }else{ dev.off() }#end if - #------------------------------------------------------------------------------# - }#end for - #---------------------------------------------------------------------------------# + } #end for outform + }#end if (tseragbpft) + } #end for tseries + #---------------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------------# + # Plot disturbance rate by disturbance transition. # + #---------------------------------------------------------------------------------------# + if (tserdist && any(seldist)){ + cat(" + Disturbance rate time series for all disturbances...","\n") + for (o in 1:nout){ + fichier = paste(outpref,"/disturb-",suffix,".",outform[o],sep="") + if (outform[o] == "x11"){ + X11(width=size$width,height=size$height,pointsize=ptsz) + }else if(outform[o] == "png"){ + png(filename=fichier,width=size$width*depth,height=size$height*depth + ,pointsize=ptsz,res=depth) + }else if(outform[o] == "eps"){ + postscript(file=fichier,width=size$width,height=size$height + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) + }#end if #---------------------------------------------------------------------------------# - # Split the data into seasonal means. # + # Find the limit, make some room for the legend, and in case the field is a # + # constant, nudge the limits so the plot command will not complain. # #---------------------------------------------------------------------------------# - print(paste(" * Seasonal bar plot: ",desc,"...")) - this.season = season(tomonth,add.year=TRUE) + ylimit = NULL + for (jlu in 1:nlu){ + for (ilu in 1:nlu){ + if (seldist[ilu,jlu]){ + ylimit = range(c(ylimit,datum$dist[,ilu,jlu]),na.rm=TRUE) + }#end if + }#end for + }#end for + ylimit = pretty.xylim(u=ylimit,fracexp=scalleg,is.log=FALSE) + ydrought = c( ylimit[1] - 0.5 * diff(ylimit), ylimit[2] + 0.5 * diff(ylimit) ) #---------------------------------------------------------------------------------# + letitre = paste("Disturbance rates",lieu,sep=" - ") + cols = NULL + legs = NULL + plot(datum$toyear,datum$dist[,1,1],type="n",main=letitre,ylim=ylimit + ,xlab="Year",ylab="[1/yr]",cex.main=0.7) + if (drought.mark){ + for (n in 1:ndrought){ + rect(xleft = drought[[n]][1],ybottom = ydrought[1] + ,xright = drought[[n]][2],ytop = ydrought[2] + ,col = "gray84",border=NA) + }#end for + }#end if + if (plotgrid){ + abline(v=axTicks(side=1),h=axTicks(side=2),col="gray52",lty="solid") + }#end if + n = 0 + for (jlu in 1:nlu){ + for (ilu in 1:nlu){ + n = n + 1 + if (seldist[ilu,jlu]){ + cols = c(cols,distcols[n]) + legs = c(legs,distnames[n]) + lines(datum$toyear,datum$dist[,ilu,jlu],type="l" + ,col=distcols[n],lwd=lwidth) + }#end if + }#end for + }#end for + legend(x=legwhere,inset=inset,bg=legbg,legend=legs,col=cols,lwd=lwidth) + + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + } #end for outform + #------------------------------------------------------------------------------------# + }#end if + #---------------------------------------------------------------------------------------# + + + + + #---------------------------------------------------------------------------------------# + # Plot the time series diagrams showing annual means. # + #---------------------------------------------------------------------------------------# + cat(" * Plot some time series...","\n") + for (hh in 1:ntser){ + + #----- Retrieve variable information from the list. ---------------------------------# + tsernow = tser[[hh]] + vnames = tsernow$vnam + description = tsernow$desc + lcolours = tsernow$colour + llwd = tsernow$lwd + ltype = tsernow$type + plog = tsernow$plog + prefix = tsernow$prefix + theme = tsernow$theme + unit = tsernow$unit + legpos = tsernow$legpos + plotit = tsernow$plt & all(vnames %in% names(year12mn)) + + if (plotit){ #---------------------------------------------------------------------------------# - # Make the last December become part of the first year. # + # Check whether the time series directory exists. If not, create it. # #---------------------------------------------------------------------------------# - sel = this.season == paste(max(yr3mon)+1,"01",sep="") - this.season[sel] = paste(min(yr3mon),"01",sep="") - yr.season = as.numeric(substring(this.season,1,4)) + outdir = paste(outpref,"tseries",sep="/") + if (! file.exists(outdir)) dir.create(outdir) + cat(" +",theme,"time series for several variables...","\n") + + + #----- Define the number of layers. ----------------------------------------------# + nlayers = length(vnames) #---------------------------------------------------------------------------------# + + #---------------------------------------------------------------------------------# - # Find the seasonality matrix. # + # Find the limit, make some room for the legend, and in case the field is a # + # constant, nudge the limits so the plot command will not complain. # #---------------------------------------------------------------------------------# - this.var = get(vname) - if (cumul){ - season.vec = tapply(X=this.var,INDEX=this.season,FUN=sum) - }else{ - season.vec = tapply(X=this.var,INDEX=this.season,FUN=mean) - }#end if - season.mat = matrix( data = season.vec - , ncol = 4 - , nrow = nyr3mon - , dimnames = list(yr3mon.desc,season.list) - , byrow = TRUE - )#end matrix - if (vname == "rain"){ - ylimit = c(0,1.25 * max(season.vec,na.rm=TRUE)) + ylimit = NULL + for (l in 1:nlayers){ + thisvar = year12mn[[vnames[l]]] + ylimit = range(c(ylimit,thisvar),na.rm=TRUE) + }#end for + ylimit = pretty.xylim(u=ylimit,fracexp=scalleg,is.log=plog) + if (plog) { + xylog = "y" + ydrought = c( exp(sqrt(ylimit[1]^3/ylimit[2])) + , exp(sqrt(ylimit[2]^3/ylimit[1])) + )#end c }else{ - yl.try = range(season.vec,na.rm=TRUE) - if (any(! is.finite(yl.try)) || ( yl.try[1] == yl.try[2] && yl.try[1] == 0)){ - ylimit = c(-1,1) - leg.pos = "topright" - }else if (yl.try[1] == yl.try[2]){ - ylimit = yl.try - ylimit[1] = yl.try[1] - 0.30 * abs(yl.try[1]) - ylimit[2] = yl.try[2] + 0.30 * abs(yl.try[2]) - leg.pos = "topright" - }else if(yl.try[2] > 0){ - ylimit = yl.try - ylimit[1] = yl.try[1] - 0.05 * (yl.try[2] - yl.try[1]) - ylimit[2] = yl.try[2] + 0.40 * (yl.try[2] - yl.try[1]) - leg.pos = "topright" - }else{ - ylimit = yl.try - ylimit[1] = yl.try[1] - 0.40 * (yl.try[2] - yl.try[1]) - ylimit[2] = yl.try[2] + 0.05 * (yl.try[2] - yl.try[1]) - leg.pos = "bottomright" - }#end if + xylog = "" + ydrought = c(ylimit[1]-0.5*diff(ylimit),ylimit[2]+0.5*diff(ylimit)) }#end if #---------------------------------------------------------------------------------# + #---------------------------------------------------------------------------------# - # Plot the bar plot. # + # Check if the directory exists. If not, create it. # #---------------------------------------------------------------------------------# + cat(" > ",theme," time series ...","\n") + + #----- Loop over formats. --------------------------------------------------------# for (o in 1:nout){ - fichier = paste(outbplot,"/bp_season_",vname,"-",suffix,".",outform[o],sep="") + fichier = paste(outdir,"/",prefix,"-",suffix,".",outform[o],sep="") if(outform[o] == "x11"){ X11(width=size$width,height=size$height,pointsize=ptsz) }else if(outform[o] == "png"){ @@ -644,21 +1463,30 @@ for (place in myplaces){ pdf(file=fichier,onefile=FALSE ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) }#end if - - letitre = paste(lieu," \n Year comparison: ",desc,sep="") - lex = "Season" - ley = paste(desc," [",unit,"]") - - barplot(season.mat,col=yr3mon.col,main=letitre,xlab=lex,ylab=ley - ,cex.main=cex.main,ylim=ylimit,legend.text=FALSE,beside=TRUE - ,border="gray23",xpd=FALSE) - box() - legend(x=leg.pos,inset=0.01,legend=yr3mon.desc,fill=yr3mon.col - ,title="Period",cex=0.9,ncol=2) + #----- Load variable ----------------------------------------------------------# + thisvar = year12mn[[vnames[1]]] + letitre = paste(theme," - ",lieu," \n"," Time series: ",theme,sep="") - #----- Close the device. ------------------------------------------------------# + plot(x=datum$toyear,y=thisvar,type="n",main=letitre,xlab="Year" + ,ylim=ylimit,ylab=paste("[",unit,"]",sep=""),log=xylog,cex.main=cex.main) + if (drought.mark){ + for (n in 1:ndrought){ + rect(xleft = drought[[n]][1],ybottom = ydrought[1] + ,xright = drought[[n]][2],ytop = ydrought[2] + ,col = "gray84",border=NA) + }#end for + }#end if + if (plotgrid){ + abline(v=axTicks(side=1),h=axTicks(side=2),col="gray52",lty="solid") + }#end if + for (l in 1:nlayers){ + thisvar = year12mn[[vnames[l]]] + points(x=datum$toyear,y=thisvar,col=lcolours[l],lwd=llwd[l],type=ltype + ,pch=16,cex=0.8) + }#end for + legend(x=legpos,inset=inset,legend=description,col=lcolours,lwd=llwd,cex=0.8) if (outform[o] == "x11"){ locator(n=1) dev.off() @@ -666,112 +1494,328 @@ for (place in myplaces){ dev.off() }#end if #------------------------------------------------------------------------------# + } #end for outform + #---------------------------------------------------------------------------------# + }#end if plotit + #------------------------------------------------------------------------------------# + }#end for ntser + #---------------------------------------------------------------------------------------# + + + + + #---------------------------------------------------------------------------------------# + # Plot the climatology of the mean diurnal cycle. # + #---------------------------------------------------------------------------------------# + cat(" * Plot some climatology of diurnal cycle...","\n") + for (hh in 1:nclim){ + + #----- Retrieve variable information from the list. ---------------------------------# + climnow = clim[[hh]] + vnames = climnow$vnam + description = climnow$desc + lcolours = climnow$colour + llwd = climnow$lwd + ltype = climnow$type + plog = climnow$plog + prefix = climnow$prefix + theme = climnow$theme + unit = climnow$unit + legpos = climnow$legpos + plotit = climnow$plt + + if (plotit){ + + #---------------------------------------------------------------------------------# + # Check whether the time series directory exists. If not, create it. # + #---------------------------------------------------------------------------------# + outdir = paste(outpref,"climdcyc",sep="/") + if (! file.exists(outdir)) dir.create(outdir) + outtheme = paste(outdir,prefix,sep="/") + if (! file.exists(outtheme)) dir.create(outtheme) + cat(" +",theme,"diurnal cycle for several variables...","\n") + + + #----- Define the number of layers. ----------------------------------------------# + nlayers = length(vnames) + ylimit = NULL + for (l in 1:nlayers){ + thisvar = dcyc12mn[[vnames[l]]] + ylimit = c(ylimit,thisvar) }#end for + ylimit = pretty.xylim(u=ylimit,fracexp=scalleg,is.log=length(grep("y",plog)) > 0) #---------------------------------------------------------------------------------# - }#end if + + + #---------------------------------------------------------------------------------# + # Loop over all months. # + #---------------------------------------------------------------------------------# + for (pmon in 1:12){ + cmon = sprintf("%2.2i",pmon) + namemon = mlist[pmon] + + #------------------------------------------------------------------------------# + # Check if the directory exists. If not, create it. # + #------------------------------------------------------------------------------# + cat(" > ",theme," time series - ",namemon,"...","\n") + + #----- Loop over formats. -----------------------------------------------------# + for (o in 1:nout){ + fichier = paste(outtheme,"/",prefix,"-",cmon,"-",suffix,".",outform[o] + ,sep="") + if(outform[o] == "x11"){ + X11(width=size$width,height=size$height,pointsize=ptsz) + }else if(outform[o] == "png"){ + png(filename=fichier,width=size$width*depth,height=size$height*depth + ,pointsize=ptsz,res=depth) + }else if(outform[o] == "eps"){ + postscript(file=fichier,width=size$width,height=size$height + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) + }#end if + + #----- Load variable -------------------------------------------------------# + thisvar = dcyc12mn[[vnames[1]]] + thisvar = cbind(thisvar[,ndcycle],thisvar) + + letitre = paste(theme," - ",lieu,"\n" + ,"Mean diurnal cycle - ",namemon,sep="") + + plot(x=thisday,y=thisvar[pmon,],type="n",main=letitre,xlab="Time" + ,ylim=ylimit,ylab=paste("[",unit,"]",sep=""),log=plog,xaxt="n" + ,cex.main=cex.main) + axis(side=1,at=dcycplot$levels,labels=dcycplot$labels,padj=dcycplot$padj) + if (plotgrid){ + abline(v=dcycplot$levels,h=axTicks(side=2),col="gray52",lty="solid") + }#end if + for (l in 1:nlayers){ + thisvar = dcyc12mn[[vnames[l]]] + thisvar = cbind(thisvar[,ndcycle],thisvar) + points(x=thisday,y=thisvar[pmon,],col=lcolours[l] + ,lwd=llwd[l],type=ltype,pch=16,cex=0.8) + }#end for + legend(x=legpos,inset=0.05,legend=description,col=lcolours,lwd=llwd) + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + #---------------------------------------------------------------------------# + }#end for outform + #------------------------------------------------------------------------------# + }#end for pmon + #---------------------------------------------------------------------------------# + }#end if plotit #------------------------------------------------------------------------------------# - }#end for + }#end for ntser #---------------------------------------------------------------------------------------# + + #---------------------------------------------------------------------------------------# - # Plot the monthly mean variables as functions of other 2 environment variables. # + # Plot the climatology of the soil properties. # + #---------------------------------------------------------------------------------------# + for (v in 1:nsoilclim){ + + #----- Retrieve variable information from the list. ---------------------------------# + thisclim = soilclim[[v]] + vnam = thisclim$vnam + description = thisclim$desc + unit = thisclim$unit + vcscheme = thisclim$csch + pnlog = thisclim$pnlog + plotit = thisclim$plt + + if (plotit){ + + #---------------------------------------------------------------------------------# + # Check if the directory exists. If not, create it. # + #---------------------------------------------------------------------------------# + outdir = paste(outpref,"soilclim",sep="/") + if (! file.exists(outdir)) dir.create(outdir) + cat(" + Climatology profile of ",description,"...","\n") + + #----- Find the number of rows and columns, and the axes. ------------------------# + monaxis = sort(unique(datum$year)) + soilaxis = slz + nmon = length(monaxis) + nsoil = nzg + + #----- Convert the vector data into an array. ------------------------------------# + vararr = year12mn[[vnam]] + + #----- Copy the first and the last year to make the edges buffered. --------------# + first = vararr[1,] + first = c(first,first[nzg],first[nzg]) + + last = vararr[nyears,] + last = c(last[1],last[1],last) + #----------------------------------------------------------------------------------# + + + + #----- Bind first and last year to the array, to make the edges buffered. ---------# + varbuff = cbind(vararr[,1],vararr,vararr[,nzg]) + varbuff = rbind(last,varbuff,first) + #----------------------------------------------------------------------------------# + + + + #----------------------------------------------------------------------------------# + # Expand the month and year axes. Make the -------------------------------------------# + yearaxis = c(yeara-1,datum$toyear,yearz+1) + soilaxis = -log(-1.0 * c( slz[1]*(slz[1]/slz[2]) + , soilaxis + , slz[nzg]*(slz[nzg]/slz[nzg-1]) )) + + if (pnlog){ + vrange = range(varbuff,na.rm=TRUE) + vlevels = pretty.log(x=vrange,n=ncolshov) + vnlev = length(vlevels) + }else{ + vrange = range(varbuff,na.rm=TRUE) + vlevels = pretty(x=vrange,n=ncolshov) + vnlev = length(vlevels) + }#end if + + #----- Loop over formats. --------------------------------------------------------# + for (o in 1:nout){ + fichier = paste(outdir,"/",vnam,"-",suffix,".",outform[o],sep="") + if(outform[o] == "x11"){ + X11(width=size$width,height=size$height,pointsize=ptsz) + }else if(outform[o] == "png"){ + png(filename=fichier,width=size$width*depth,height=size$height*depth + ,pointsize=ptsz,res=depth) + }else if(outform[o] == "eps"){ + postscript(file=fichier,width=size$width,height=size$height + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) + }#end if + + letitre = paste(description," - ",lieu,sep="") + sombreado(x=yearaxis,y=soilaxis,z=varbuff,levels=vlevels,nlevels=vnlev + ,color.palette=get(vcscheme) + ,plot.title=title(main=letitre,xlab="Month",ylab="Soil depth [m]" + ,cex.main=0.7) + ,key.title=title(main=unit,cex.main=0.8) + ,key.log=pnlog + ,plot.axes={axis(side=1) + axis(side=2,at=zat,labels=znice) + if (hovgrid){ + abline(h=zat,v=axTicks(1),col="gray52",lty="dotted") + }#end if hovgrid + }#end plot.axes + ) + + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + } #end for outform + }#end if plotit + }#end for nhov #---------------------------------------------------------------------------------------# - print(paste(" + Plotting parameter space: ",lieu,"...",sep="")) - for (xyz in 1:nxyzvar){ - this.xyz = xyzvar[[xyz]] - zvname = this.xyz$zvname - zdesc = this.xyz$zdesc - zkey = this.xyz$zkey - zunit = this.xyz$zunit - xvname = this.xyz$xvname - xdesc = this.xyz$xdesc - xunit = this.xyz$xunit - xleg = this.xyz$xleg - yvname = this.xyz$yvname - ydesc = this.xyz$ydesc - yunit = this.xyz$yunit - yleg = this.xyz$yleg - #----- Create the directories. -------------------------------------------------------# - outxyzp = paste(outpref,"xyzplot",sep="/") - outzvar = paste(outxyzp,zvname ,sep="/") - if (! file.exists(outxyzp )) dir.create(outxyzp ) - if (! file.exists(outzvar )) dir.create(outzvar ) - #-------------------------------------------------------------------------------------# - #----- Number of x and y axes. ------------------------------------------------------# - nxvars = length(xvname) - nyvars = length(yvname) + + + + #---------------------------------------------------------------------------------------# + # Bar plot by DBH class. # + #---------------------------------------------------------------------------------------# + cat(" + Bar plot by DBH classes...","\n") + pftuse = which(apply(X=datum$nplantpftdbh,MARGIN=3,FUN=sum,na.rm=TRUE) > 0.) + pftuse = pftuse[pftuse != (npft+1)] + npftuse = length(pftuse) + pftname.use = pft$name [pftuse] + pftcol.use = pft$colour[pftuse] + for (v in 1:nbarplotdbh){ + #----- Load settings for this variable.----------------------------------------------# + thisbar = barplotdbh[[v]] + vnam = thisbar$vnam + description = thisbar$desc + unit = thisbar$unit + stacked = thisbar$stack + plotit = thisbar$plt + plog = thisbar$plog + if (plog){ + stacked = FALSE + xylog = "y" + }else{ + xylog = "" + }#end if #------------------------------------------------------------------------------------# + #------------------------------------------------------------------------------------# - # Loop over all x and y axes. # + # Check whether to plot this #------------------------------------------------------------------------------------# - print(paste(" * Z: ",zdesc,"...")) - for (y in 1:nyvars){ - for (x in 1:nxvars){ - print(paste(" ~ X: ",xdesc[x]," Y: ",ydesc[y],"...")) - - #----- Title. -----------------------------------------------------------------# - letitre = paste(lieu,zdesc,sep="\n") - #----- Attribute symbols according to the year. -------------------------------# - this.pch = eft.pch[match(yr.season,eft.year)] - #----- Expand the edges of the x axis. ----------------------------------------# - xvar = get(xvname[x]) - lex = paste(xdesc[x]," [",xunit[x],"]",sep="") - xrange = range(xvar,na.rm=TRUE) - xlimit = xrange - xlimit[1] = xrange[1] - 0.05 * (xrange[2] - xrange[1]) - xlimit[2] = xrange[2] + 0.05 * (xrange[2] - xrange[1]) - #----- Expand the edges of the y axis. ----------------------------------------# - yvar = get(yvname[y]) - ley = paste(ydesc[y]," [",yunit[y],"]",sep="") - yrange = range(yvar,na.rm=TRUE) - ylimit = yrange - ylimit[1] = yrange[1] - 0.05 * (yrange[2] - yrange[1]) - ylimit[2] = yrange[2] + 0.40 * (yrange[2] - yrange[1]) - #----- Annotation for the colour map ("Z" axis). ------------------------------# - zvar = get(zvname) - lez = paste(zkey,"\n [",zunit,"]",sep="") - #----- Find the position to plot the legend. ----------------------------------# - leg.pos = paste(yleg[y],xleg[x],sep="") + if (plotit){ + cat(" - ",description,"...","\n") + #---------------------------------------------------------------------------------# + # Retrieve the variable, and keep only the part that is usable. # + #---------------------------------------------------------------------------------# + thisvnam = datum[[vnam]] + thisvnam = thisvnam [,,pftuse] + thisvnam = thisvnam [,-(ndbh+1),] + + thisvnam[is.na(thisvnam)] = 0. + #---------------------------------------------------------------------------------# - #------------------------------------------------------------------------------# - # Make lists for colourmap. # - #------------------------------------------------------------------------------# - ptitle = list() - ptitle[[1]] = list(main=letitre,xlab=lex,ylab=ley,cex.main=cex.main) - paxes = list() - paxes[[1]] = list( x.axis = list(side=1) - , y.axis = list(side=2) - , grid = list(col="gray62",lty="solid") - , legend = list( x = leg.pos - , inset = 0.01 - , legend = yr3mon.desc - , col = "black" - , bg = "white" - , pch = yr3mon.pch - , title = "Period" - , ncol = 2 - , pt.cex = 1./0.9 - , cex = 0.9 - )#end legend - )#end list - #------------------------------------------------------------------------------# + #---------------------------------------------------------------------------------# + # Find the limits for the plots. We use the same axis so it is easier to # + # compare different times. # + #---------------------------------------------------------------------------------# + if (stacked){ + ylimit = c(0,max(apply(X=thisvnam,MARGIN=c(1,2),FUN=sum,na.rm=TRUE))) + }else{ + ylimit = range(x=thisvnam,na.rm=TRUE) + }#end if + ylimit = pretty.xylim(u=ylimit,fracexp=scalleg,is.log=plog) + #---------------------------------------------------------------------------------# + + + #---------------------------------------------------------------------------------# + # Check if the directory exists. If not, create it. # + #---------------------------------------------------------------------------------# + barplotdir = paste(outpref,"barplotdbh",sep="/") + if (! file.exists(barplotdir)) dir.create(barplotdir) + outdir = paste(barplotdir,vnam,sep="/") + if (! file.exists(outdir)) dir.create(outdir) + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Loop over all possible months. # + #---------------------------------------------------------------------------------# + for (y in 1:nyears){ + + #----- Find which year we are plotting. ---------------------------------------# + cyear = sprintf("%4.4i",datum$toyear[y]) + yy = as.numeric(cyear) #------------------------------------------------------------------------------# - # Plot the bar plot. # - #------------------------------------------------------------------------------# + + + #----- Loop over output formats. ----------------------------------------------# for (o in 1:nout){ - fichier = paste(outzvar,"/cmap_x_",xvname[x],"_y_",yvname[y] - ,"_z_",zvname,"-",suffix,".",outform[o],sep="") - if(outform[o] == "x11"){ + #------ Open the plot. -----------------------------------------------------# + fichier = paste(outdir,"/",vnam,"-",cyear,"-",suffix,".",outform[o],sep="") + if (outform[o] == "x11"){ X11(width=size$width,height=size$height,pointsize=ptsz) }else if(outform[o] == "png"){ png(filename=fichier,width=size$width*depth,height=size$height*depth @@ -783,19 +1827,32 @@ for (place in myplaces){ pdf(file=fichier,onefile=FALSE ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) }#end if + #---------------------------------------------------------------------------# + #------ Set up the title and axis labels. ----------------------------------# + letitre = paste(lieu,"\n",description," - Year : ",cyear,sep="") + lexlab = "DBH Classes" + leylab = paste(description," [",unit,"]",sep="") + #---------------------------------------------------------------------------# + - #----- Plot the parameter space. -------------------------------------------# - colourmap(x=xvar,y=yvar,z=zvar,xlim=xlimit,ylim=ylimit - ,colour.palette=muitas,cex=1.6,pch=this.pch,lwd=2 - ,plot.title=ptitle - ,key.title=title(main=lez,cex.main=0.8) - ,plot.axes=paxes - )#end colourmap + #----- Plot all monthly means together. ------------------------------------# + barplot(height=t(thisvnam[y,,]),names.arg=dbhnames[1:ndbh],width=1.0 + ,main=letitre,xlab=lexlab,ylab=leylab,ylim=ylimit,legend.text=FALSE + ,beside=(! stacked),col=pftcol.use,log=xylog + ,border="gray23",xpd=FALSE,cex.main=cex.main) + if (plotgrid & (! stacked)){ + xgrid=0.5+(1:ndbh)*(1+npftuse) + abline(v=xgrid,col="gray46",lty="solid") + }#end if + box() + legend(x="topleft",inset=0.01,legend=pftname.use,fill=pftcol.use + ,ncol=1,title="PFT",cex=1.0,bg="white") #---------------------------------------------------------------------------# + #---------------------------------------------------------------------------# # Close the device. # #---------------------------------------------------------------------------# @@ -806,15 +1863,13 @@ for (place in myplaces){ dev.off() }#end if #---------------------------------------------------------------------------# - }#end for outform + } #end for outform #------------------------------------------------------------------------------# }#end for #---------------------------------------------------------------------------------# - }#end for + }#end if #------------------------------------------------------------------------------------# }#end for #---------------------------------------------------------------------------------------# }#end for places -#------------------------------------------------------------------------------------------# - #q("no") diff --git a/ED/Template/compare_results.r b/ED/Template/compare_results.r index 186af6d51..fe1c1479c 100644 --- a/ED/Template/compare_results.r +++ b/ED/Template/compare_results.r @@ -16,24 +16,24 @@ graphics.off() #------------------------------------------------------------------------------------------# here = getwd() # Current directory srcdir = "/n/moorcroft_data/mlongo/util/Rsc" # Script directory -outroot = paste(here,"structure_comp",sep="/") # Output directory +outroot = paste(here,"sizepft_comp",sep="/") # Output directory sites = c("gyf","cax","m34","s67","s77","s83","ban","pnz","rja","fns","pdg") simul = list() -simul[[1]] = list( name = "pft00_canrad00_sas" - , desc = "5 PFTs + Medvigy + SAS" - , colour = "chartreuse4" +simul[[1]] = list( name = "pft02_canrad01_sas" + , desc = "2 PFTs + SAS" + , colour = "chartreuse" )#end list simul[[2]] = list( name = "pft00_canrad01_sas" - , desc = "5 PFTs + Zhao and Qualls + SAS" - , colour = "darkolivegreen1" + , desc = "5 PFTs + SAS" + , colour = "chartreuse4" )#end list -simul[[3]] = list( name = "pft00_canrad00_ble" - , desc = "5 PFTs + Medvigy + Big Leaf" - , colour = "orange1" +simul[[3]] = list( name = "pft02_canrad01_ble" + , desc = "2 PFTs + Big Leaf" + , colour = "darkorange" )#end list simul[[4]] = list( name = "pft00_canrad01_ble" - , desc = "5 PFTs + Zhao and Qualls + Big Leaf" + , desc = "5 PFTs + Big Leaf" , colour = "firebrick" )#end list #------------------------------------------------------------------------------------------# @@ -248,13 +248,28 @@ good[[ 1]] = list( vnam = "bias" good[[ 2]] = list( vnam = "rmse" , desc = "Root mean square error" )#end list -good[[ 3]] = list( vnam = "ks.stat" +good[[ 3]] = list( vnam = "r.squared" + , desc = "Coefficient of determination" + )#end list +good[[ 4]] = list( vnam = "fvue" + , desc = "Fraction of variability unexplained" + )#end list +good[[ 5]] = list( vnam = "sw.p.value" + , desc = "Shapiro-Wilk p-value" + )#end list +good[[ 6]] = list( vnam = "sw.stat" + , desc = "Shapiro-Wilk statistic" + )#end list +good[[ 7]] = list( vnam = "ks.stat" , desc = "Kolmogorov-Smirnov statistic" )#end list -good[[ 4]] = list( vnam = "sn.lnlike" +good[[ 8]] = list( vnam = "lsq.lnlike" + , desc = "Scaled support based on least squares" + )#end list +good[[ 9]] = list( vnam = "sn.lnlike" , desc = "Scaled support based on skew normal distribution" )#end list -good[[ 5]] = list( vnam = "norm.lnlike" +good[[10]] = list( vnam = "norm.lnlike" , desc = "Scaled support based on normal distribution" )#end list #------------------------------------------------------------------------------------------# @@ -262,14 +277,7 @@ good[[ 5]] = list( vnam = "norm.lnlike" #----- Load some packages. ----------------------------------------------------------------# -library(hdf5) -library(chron) -library(scatterplot3d) -library(lattice) -library(maps) -library(mapdata) -library(akima) -library(sn) +source(file.path(srcdir,"load.everything.r")) #------------------------------------------------------------------------------------------# @@ -295,9 +303,9 @@ sites.key = sites control.key = apply(X = sapply(X=control,FUN=c),MARGIN=1,FUN=unlist)[,"vnam"] compvar.key = apply(X = sapply(X=compvar,FUN=c),MARGIN=1,FUN=unlist)$vnam good.key = apply(X = sapply(X=good ,FUN=c),MARGIN=1,FUN=unlist)[,"vnam"] -season.key = c("DJF","MAM","JJA","SON") -diel.key = c("night","rise.set","day") -diel.desc = c("Nighttime","Sun Rise/Set","Daytime") +season.key = season.list +diel.key = c("night","rise.set","day","all.hrs") +diel.desc = c("Nighttime","Sun Rise/Set","Daytime","All hours") #------------------------------------------------------------------------------------------# @@ -320,37 +328,6 @@ options(locatorBell=FALSE) - -#----- Load some files with functions. ----------------------------------------------------# -source(paste(srcdir,"atlas.r" ,sep="/")) -source(paste(srcdir,"charutils.r" ,sep="/")) -source(paste(srcdir,"census.r" ,sep="/")) -source(paste(srcdir,"cloudy.r" ,sep="/")) -source(paste(srcdir,"epolygon.r" ,sep="/")) -source(paste(srcdir,"error.bar.r" ,sep="/")) -source(paste(srcdir,"globdims.r" ,sep="/")) -source(paste(srcdir,"locations.r" ,sep="/")) -source(paste(srcdir,"muitas.r" ,sep="/")) -source(paste(srcdir,"numutils.r" ,sep="/")) -source(paste(srcdir,"plotsize.r" ,sep="/")) -source(paste(srcdir,"pretty.box.r" ,sep="/")) -source(paste(srcdir,"pretty.log.r" ,sep="/")) -source(paste(srcdir,"pretty.time.r" ,sep="/")) -source(paste(srcdir,"qapply.r" ,sep="/")) -source(paste(srcdir,"rconstants.r" ,sep="/")) -source(paste(srcdir,"skewnorm.stats.r" ,sep="/")) -source(paste(srcdir,"soilutils.r" ,sep="/")) -source(paste(srcdir,"sombreado.r" ,sep="/")) -source(paste(srcdir,"southammap.r" ,sep="/")) -source(paste(srcdir,"thermlib.r" ,sep="/")) -source(paste(srcdir,"timeutils.r" ,sep="/")) -source(paste(srcdir,"zen.r" ,sep="/")) -#----- These should be called after the others. -------------------------------------------# -source(paste(srcdir,"pft.coms.r" ,sep="/")) -#------------------------------------------------------------------------------------------# - - - #----- Load observations. -----------------------------------------------------------------# obser.file = paste(srcdir,"LBA_MIP.nogapfill.RData",sep="/") load(file=obser.file) @@ -371,7 +348,7 @@ if (! file.exists(outroot)) dir.create(outroot) #----- Find the best set up for plotting all seasons in the same plot. --------------------# -lo.box = pretty.box(n=nseason) +lo.box = pretty.box(n=nseason-1) #------------------------------------------------------------------------------------------# @@ -433,60 +410,112 @@ for (v in 1:ncompvar){ - #---------------------------------------------------------------------------------------# - # Create the output path in case it doesn't exist. # - #---------------------------------------------------------------------------------------# - outcomp = paste(outroot,this.vnam,sep="/") - if (! file.exists(outcomp)) dir.create(outcomp) - outdiel = paste(outcomp,diel.key ,sep="/") - for (d in 1:ndiel) if (! file.exists(outdiel[d])) dir.create(outdiel[d]) - #---------------------------------------------------------------------------------------# - - #---------------------------------------------------------------------------------------# - # Loop over all control variables, and get the average score for the plot. # + # Loop over all sites, seasons, and diel and get the average score for all input # + # variables for when the observations are valid. # #---------------------------------------------------------------------------------------# - score = array( data = 0. - , dim = c(ndiel,nseason,ncontrol,nsites) - , dimnames = list(diel.key,season.key,control.key,sites.key) - )#end score - nobs = array( data = 0. - , dim = c(ndiel,nseason,ncontrol,nsites) - , dimnames = list(diel.key,season.key,control.key,sites.key) - )#end score + input.score = array( data = 0. + , dim = c(ndiel,nseason,ncontrol,nsites) + , dimnames = list(diel.key,season.key,control.key,sites.key) + )#end score + output.nobs = array( data = 0. + , dim = c(ndiel,nseason,nsites) + , dimnames = list(diel.key,season.key,sites.key) + )#end score for (p in 1:nsites){ + #----- Grab the observation. --------------------------------------------------------# obs = get(paste("obs",sites[p],sep=".")) - p.sel = is.finite(obs[[this.vnam]]) + #------------------------------------------------------------------------------------# + + + #----- Create some variables to describe season and time of the day. ----------------# if (! "season" %in% names(obs)) obs$season = season(obs$when) if (! "diel" %in% names(obs)) obs$diel = (! obs$nighttime) + obs$highsun - for (u in 1:(ncontrol-1)){ - obs.score = obs[[paste("score",control[[u]]$vnam,sep=".")]] - for (e in 1:nseason){ - e.sel = obs$season == e - for (d in 1:ndiel){ - d.sel = obs$diel == d-1 - sel = e.sel & d.sel & p.sel - score[d,e,u,p] = mean(obs.score[sel],na.rm=TRUE) - nobs [d,e,u,p] = sum (sel ,na.rm=TRUE) + #------------------------------------------------------------------------------------# + + + + #----- Find out when this output variable is finite. --------------------------------# + p.sel = is.finite(obs[[this.vnam]]) + #------------------------------------------------------------------------------------# + + + #------------------------------------------------------------------------------------# + # Loop over all seasons. # + #------------------------------------------------------------------------------------# + for (e in 1:nseason){ + #----- Select this season (or everything for all seasons). -----------------------# + e.sel = obs$season == e | e == nseason + #---------------------------------------------------------------------------------# + + + #---------------------------------------------------------------------------------# + # Loop over all parts of the day. # + #---------------------------------------------------------------------------------# + for (d in 1:ndiel){ + #----- Select this diel (or everything for all day). --------------------------# + d.sel = obs$diel == (d-1) | d == ndiel + #------------------------------------------------------------------------------# + + #------------------------------------------------------------------------------# + # Combine the selections. # + #------------------------------------------------------------------------------# + sel = e.sel & d.sel & p.sel + #------------------------------------------------------------------------------# + + + #------------------------------------------------------------------------------# + # Loop over all control variables (except the "global" one). # + #------------------------------------------------------------------------------# + for (u in 1:(ncontrol-1)){ + #---- Get the score for this variable. -------------------------------------# + control.vnam = paste("score",control[[u]]$vnam,sep=".") + obs.score = obs[[control.vnam]] + #---------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------# + # Combine all the selections and find the mean score. # + #---------------------------------------------------------------------------# + input.score[d,e,u,p] = mean(obs.score[sel],na.rm=TRUE) + #---------------------------------------------------------------------------# }#end for #------------------------------------------------------------------------------# + + + #------------------------------------------------------------------------------# + # Find the general score and number of observations. # + #------------------------------------------------------------------------------# + input.score[d,e,ncontrol,p] = mean(input.score[d,e,1:(ncontrol-1),p],na.rm=TRUE) + output.nobs[d,e,p] = sum(sel,na.rm=TRUE) + #------------------------------------------------------------------------------# }#end for #---------------------------------------------------------------------------------# }#end for #------------------------------------------------------------------------------------# - }#end for - score[,,ncontrol,] = apply( X = score[,,1:(ncontrol-1),] - , MARGIN = c(1,2,4) - , FUN = mean - , na.rm = TRUE - )#end apply - nobs [,,ncontrol,] = apply( X = nobs[,,1:(ncontrol-1),] - , MARGIN = c(1,2,4) - , FUN = sum - , na.rm = TRUE - )#end apply - score[! is.finite(score)] = NA + }#end for (p in 1:nsites) + #---------------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------------# + # Make sure that non-finite scores are NA. # + #---------------------------------------------------------------------------------------# + input.score[! is.finite(input.score)] = NA + #---------------------------------------------------------------------------------------# + + + + + #---------------------------------------------------------------------------------------# + # Create the output path in case it doesn't exist. # + #---------------------------------------------------------------------------------------# + outcomp = paste(outroot,this.vnam,sep="/") + if (! file.exists(outcomp)) dir.create(outcomp) + outdiel = paste(outcomp,diel.key ,sep="/") + for (d in 1:ndiel) if (! file.exists(outdiel[d])) dir.create(outdiel[d]) #---------------------------------------------------------------------------------------# @@ -502,6 +531,10 @@ for (v in 1:ncompvar){ , dim = c(ndiel,nseason,nsimul,nsites) , dimnames = list(diel.key,season.key,simul.key,sites.key) )#end array + nvars = array( data = NA + , dim = c(ndiel,nseason,nsites) + , dimnames = list(diel.key,season.key,sites.key) + )#end array colstat = array( data = NA_character_ , dim = c(nsimul,nsites) , dimnames = list(simul.key,sites.key) @@ -511,6 +544,7 @@ for (v in 1:ncompvar){ #------------------------------------------------------------------------------------# for (p in 1:nsites){ iata = sites[p] + obs = get(paste("obs",sites[p],sep=".")) for (s in 1:nsimul){ colstat[s,p] = simul[[s]]$colour this = res[[iata]]$sim[[s]][[this.vnam]][[this.good]] @@ -519,7 +553,7 @@ for (v in 1:ncompvar){ for (d in 1:ndiel){ if (is.finite(this[diel.key[d],use.season])){ stat[d,e,s,p] = this[diel.key[d],use.season] - }#end if + }#end if }#end for #---------------------------------------------------------------------------# }#end for @@ -534,7 +568,7 @@ for (v in 1:ncompvar){ #------------------------------------------------------------------------------------# # Standardise the log-likelihood so the data are more comparable. # #------------------------------------------------------------------------------------# - if (this.good %in% c("sn.lnlike","norm.lnlike")){ + if (this.good %in% c("lsq.lnlike","sn.lnlike","norm.lnlike")){ stat.min = apply(X = stat, MARGIN=c(1,2,4),FUN=min,na.rm=TRUE) stat.max = apply(X = stat, MARGIN=c(1,2,4),FUN=max,na.rm=TRUE) stat.orig = stat @@ -558,15 +592,23 @@ for (v in 1:ncompvar){ xlimit = c(0,nsites*(nsimul+1))+0.5 xat = seq(from=0,to=(nsites-1)*(nsimul+1),by=nsimul+1)+1+0.5*nsimul xlines = seq(from=0,to=nsites*(nsimul+1),by=nsimul+1)+0.5 - ylimit = range(stat[d,,,],na.rm=TRUE) - if ( any(! is.finite(ylimit)) || (ylimit[1] == ylimit[2] && ylimit[1] == 0)){ - ylimit = c(-1,1) - }else if (ylimit[1] == ylimit[2] ){ - ylimit[1] = ylimit[1] * ( 1. - sign(ylimit[1]) * fracexp) - ylimit[2] = ylimit[2] * ( 1. + sign(ylimit[2]) * fracexp) + if (this.good %in% c("r.squared")){ + y.nobs = 0.90 + ylimit = c(-1,1) + }else{ + ylimit = range(stat[d,,,],na.rm=TRUE) + if ( any(! is.finite(ylimit)) || (ylimit[1] == ylimit[2] && ylimit[1] == 0)){ + y.nobs = 0.90 + ylimit = c(-1,1) + }else if (ylimit[1] == ylimit[2] ){ + y.nobs = ylimit[2] * ( 1. + sign(ylimit[2]) * 0.50 * fracexp ) + ylimit[1] = ylimit[1] * ( 1. - sign(ylimit[1]) * fracexp ) + ylimit[2] = ylimit[2] * ( 1. + sign(ylimit[2]) * fracexp ) + }else{ + y.nobs = ylimit[2] + 0.15 * fracexp * diff(ylimit) + ylimit[2] = ylimit[2] + 0.30 * fracexp * diff(ylimit) + }#end if }#end if - xleg = xlimit[1] - yleg = ylimit[1] - 0.25 * diff(ylimit) #---------------------------------------------------------------------------------# @@ -574,10 +616,12 @@ for (v in 1:ncompvar){ #---------------------------------------------------------------------------------# # Loop over all output formats. # #---------------------------------------------------------------------------------# + out.barplot = paste(outdiel[d],"barplot",sep="/") + if (! file.exists(out.barplot)) dir.create(out.barplot) for (o in 1:nout){ #----- Make the file name. ----------------------------------------------------# - fichier = paste(outdiel[d],"/barplot-",this.vnam,"-",this.good,"-",diel.key[d] - ,".",outform[o],sep="") + fichier = paste(out.barplot,"/bplot-byseason-",this.vnam,"-",this.good,"-" + ,diel.key[d],".",outform[o],sep="") if (outform[o] == "x11"){ X11(width=size$width,height=size$height,pointsize=ptsz) }else if(outform[o] == "png"){ @@ -619,7 +663,7 @@ for (v in 1:ncompvar){ , fill = simcol.key , border = "black" , bg = "white" - , ncol = min(nsimul,3) + , ncol = min(3,pretty.box(nsimul)$ncol) , title = expression(bold("Simulation")) , cex = 1.0 )#end legend @@ -630,13 +674,13 @@ for (v in 1:ncompvar){ #------------------------------------------------------------------------------# # Loop over all seasons, and plot the bar plots. # #------------------------------------------------------------------------------# - for (e in 1:nseason){ + for (e in 1:(nseason-1)){ #----- Find out where is this box going, and set up axes and margins. ------# left = (e %% lo.box$ncol) == 1 right = (e %% lo.box$ncol) == 0 top = e <= lo.box$ncol bottom = e > (lo.box$nrow - 1) * lo.box$ncol - mar.now = c(1 + 3 * bottom,1 + 1 * left,1 + 2 * top,1 + 1 * right) + 0.1 + mar.now = c(4 + 0 * bottom,1 + 1 * left,3 + 0 * top,1 + 1 * right) + 0.1 #---------------------------------------------------------------------------# @@ -645,12 +689,20 @@ for (v in 1:ncompvar){ #---------------------------------------------------------------------------# + #---------------------------------------------------------------------------# + # Order the sites by amount of information. # + #---------------------------------------------------------------------------# + nobs = output.nobs[d,e,] + op = order(nobs) + #---------------------------------------------------------------------------# + + #----- Plot window and grid. -----------------------------------------------# par(mar=mar.now,xpd=FALSE,las=2) plot.new() plot.window(xlim=xlimit,ylim=ylimit,xaxt="n",yaxt="n") - if (bottom) axis(side=1,at=xat,labels=toupper(sites.key)) + axis(side=1,at=xat,labels=toupper(sites.key[op])) if (left ) axis(side=2) box() title(main=lesub) @@ -662,8 +714,9 @@ for (v in 1:ncompvar){ #---------------------------------------------------------------------------# # Add the bar plot. # #---------------------------------------------------------------------------# - barplot(height=stat[d,e,,],col=colstat,beside=TRUE,border="grey22" + barplot(height=stat[d,e,,op],col=colstat,beside=TRUE,border="grey22" ,add=TRUE,axes=FALSE,axisnames=FALSE,xpd=FALSE) + text (x=xat,y=y.nobs,labels=nobs[op],cex=0.7) #---------------------------------------------------------------------------# }#end for @@ -707,34 +760,158 @@ for (v in 1:ncompvar){ + #---------------------------------------------------------------------------------# + # Plot all seasons together. # + #---------------------------------------------------------------------------------# + #----- Make the title and axis labels. -------------------------------------------# + letitre = paste(desc.good," - ",this.desc,"\n",diel.desc[d]," - All seasons" + ,sep="") + if (this.good %in% c("bias","rmse")){ + ley = paste(desc.good,this.unit,sep=" ") + }else{ + ley = paste(desc.good," [--]",sep="") + }#end if + lex = "Sites" + #----- Order the sites by amount of information. --------------------------------# + nobs = output.nobs[d,nseason,] + op = order(nobs) + #----- Loop over all formats. ----------------------------------------------------# + for (o in 1:nout){ + #----- Make the file name. ----------------------------------------------------# + fichier = paste(out.barplot,"/bplot-allyear-",this.vnam,"-",this.good,"-" + ,diel.key[d],".",outform[o],sep="") + if (outform[o] == "x11"){ + X11(width=size$width,height=size$height,pointsize=ptsz) + }else if(outform[o] == "png"){ + png(filename=fichier,width=size$width*depth + ,height=size$height*depth,pointsize=ptsz,res=depth) + }else if(outform[o] == "eps"){ + postscript(file=fichier,width=size$width,height=size$height + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) + }#end if + #------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------# + # Split the window into several smaller windows. Add a bottom row to fit # + # the legend. # + #------------------------------------------------------------------------------# + par.orig = par(no.readonly = TRUE) + mar.orig = par.orig$mar + h = 0.4 * par("csi") * 2.54 + layout(mat = rbind(2,1), height = c(1,h)) + #------------------------------------------------------------------------------# + + + + #----- Plot legend. -----------------------------------------------------------# + par(mar=c(1.1,4.1,0.1,4.1)) + plot.new() + plot.window(xlim=c(0,1),ylim=c(0,1),xaxt="n",yaxt="n") + legend ( x = "top" + , inset = 0.0 + , legend = simleg.key + , fill = simcol.key + , border = "black" + , bg = "white" + , ncol = min(3,pretty.box(nsimul)$ncol) + , title = expression(bold("Simulation")) + , cex = 0.7 + )#end legend + #------------------------------------------------------------------------------# + + + #----- Set up the title for each plot. ----------------------------------------# + lesub = paste("All seasons",sep="") + #------------------------------------------------------------------------------# + + + + #----- Plot window and grid. --------------------------------------------------# + par(mar=c(5,4,3,2)+0.1,xpd=FALSE,las=2) + plot.new() + plot.window(xlim=xlimit,ylim=ylimit,xaxt="n",yaxt="n") + title(main=letitre,xlab=lex,ylab=ley) + axis(side=1,at=xat,labels=toupper(sites.key[op])) + axis(side=2) + box() + if (plotgrid) abline(h=axTicks(2),v=xlines,col="grey83",lty="solid") + #------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------# + # Add the bar plot. # + #------------------------------------------------------------------------------# + barplot(height=stat[d,nseason,,op],col=colstat,beside=TRUE,border="grey22" + ,add=TRUE,axes=FALSE,axisnames=FALSE,xpd=FALSE) + text(x=xat,y=y.nobs,labels=nobs[op]) + #------------------------------------------------------------------------------# + + + + #----- Close the device. ------------------------------------------------------# + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + #------------------------------------------------------------------------------# + + }#end for + #---------------------------------------------------------------------------------# + + + #---------------------------------------------------------------------------------# # Plot the statistics as a function of the quality of the data. # #---------------------------------------------------------------------------------# + out.quality = paste(outdiel[d],"quality",sep="/") + if (! file.exists(out.quality)) dir.create(out.quality) for (u in 1:ncontrol){ this.qual = control[[u]] qual.vnam = this.qual$vnam qual.desc = this.qual$desc qual.unit = this.qual$unit + + #------------------------------------------------------------------------------# + # Create the path for the quality due to this particular variable. # + #------------------------------------------------------------------------------# + out.qualnow = paste(out.quality,qual.vnam,sep="/") + if (! file.exists(out.qualnow)) dir.create(out.qualnow) + #------------------------------------------------------------------------------# + + + #------------------------------------------------------------------------------# # Find the limits for the bar plot. # #------------------------------------------------------------------------------# - xlimit = range(score[d,,u,],na.rm=TRUE) - ylimit = range(stat [d,,, ],na.rm=TRUE) + xlimit = range(input.score[d,,u,],na.rm=TRUE) + ylimit = range(stat [d,,, ],na.rm=TRUE) if ( any(! is.finite(xlimit)) || (xlimit[1] == xlimit[2] && xlimit[1] == 0)){ xlimit = c(0,10) }else if (xlimit[1] == xlimit[2] ){ xlimit[1] = xlimit[1] * ( 1. - sign(xlimit[1]) * fracexp) xlimit[2] = xlimit[2] * ( 1. + sign(xlimit[2]) * fracexp) }#end if - if ( any(! is.finite(ylimit)) || (ylimit[1] == ylimit[2] && ylimit[1] == 0)){ - ylimit = c(-1,1) - }else if (ylimit[1] == ylimit[2] ){ - ylimit[1] = ylimit[1] * ( 1. - sign(ylimit[1]) * fracexp) - ylimit[2] = ylimit[2] * ( 1. + sign(ylimit[2]) * fracexp) + if (this.good %in% c("r.squared")){ + ylimit = c(-1,1) + }else{ + ylimit = range(stat[d,,,],na.rm=TRUE) + if ( any(! is.finite(ylimit)) + || (ylimit[1] == ylimit[2] && ylimit[1] == 0) ){ + ylimit = c(-1,1) + }else if (ylimit[1] == ylimit[2] ){ + ylimit[1] = ylimit[1] * ( 1. - sign(ylimit[1]) * fracexp) + ylimit[2] = ylimit[2] * ( 1. + sign(ylimit[2]) * fracexp) + }#end if }#end if - xleg = xlimit[1] - yleg = ylimit[1] - 0.25 * diff(ylimit) #------------------------------------------------------------------------------# @@ -744,7 +921,7 @@ for (v in 1:ncompvar){ #------------------------------------------------------------------------------# for (o in 1:nout){ #----- Make the file name. -------------------------------------------------# - fichier = paste(outdiel[d],"/qual-",this.vnam,"-",qual.vnam,"-" + fichier = paste(out.qualnow,"/qual-byseason-",this.vnam,"-",qual.vnam,"-" ,this.good,"-",diel.key[d],".",outform[o],sep="") if (outform[o] == "x11"){ X11(width=size$width,height=size$height,pointsize=ptsz) @@ -787,7 +964,7 @@ for (v in 1:ncompvar){ , fill = simcol.key , border = "black" , bg = "white" - , ncol = min(nsimul,3) + , ncol = min(3,pretty.box(nsimul)$ncol) , title = expression(bold("Simulation")) , cex = 1.0 )#end legend @@ -798,7 +975,7 @@ for (v in 1:ncompvar){ #---------------------------------------------------------------------------# # Loop over all seasons, and plot the bar plots. # #---------------------------------------------------------------------------# - for (e in 1:nseason){ + for (e in 1:(nseason-1)){ #----- Find out where is this box going, and set up axes and margins. ---# left = (e %% lo.box$ncol) == 1 right = (e %% lo.box$ncol) == 0 @@ -831,7 +1008,7 @@ for (v in 1:ncompvar){ # Add the bar plot. # #------------------------------------------------------------------------# for (s in 1:nsimul){ - points(x=score[d,e,u,],y=stat[d,e,s,],pch=15 + points(x=input.score[d,e,u,],y=stat[d,e,s,],pch=15 ,col=simul[[s]]$colour,cex=1.0) }#end for #------------------------------------------------------------------------# @@ -875,6 +1052,115 @@ for (v in 1:ncompvar){ #---------------------------------------------------------------------------# }#end for (o in 1:nout) #------------------------------------------------------------------------------# + + + + + + + #------------------------------------------------------------------------------# + # Plot the combined data for all seasons. # + #------------------------------------------------------------------------------# + #----- Make the title and axis labels. ----------------------------------------# + letitre = paste(desc.good," - ",this.desc,"\n",diel.desc[d]," - All seasons" + ,sep="") + if (this.good %in% c("bias","rmse")){ + ley = paste(desc.good,this.unit,sep=" ") + }else{ + ley = paste(desc.good," [--]",sep="") + }#end if + lex = paste("Quality index - ",qual.desc,sep="") + #----- Loop over all output formats. ------------------------------------------# + for (o in 1:nout){ + #----- Make the file name. -------------------------------------------------# + fichier = paste(out.qualnow,"/qual-allyear-",this.vnam,"-",qual.vnam,"-" + ,this.good,"-",diel.key[d],".",outform[o],sep="") + if (outform[o] == "x11"){ + X11(width=size$width,height=size$height,pointsize=ptsz) + }else if(outform[o] == "png"){ + png(filename=fichier,width=size$width*depth + ,height=size$height*depth,pointsize=ptsz,res=depth) + }else if(outform[o] == "eps"){ + postscript(file=fichier,width=size$width,height=size$height + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) + }#end if + #---------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------# + # Split the window into several smaller windows. Add a bottom row to # + # fit the legend. # + #---------------------------------------------------------------------------# + par.orig = par(no.readonly = TRUE) + mar.orig = par.orig$mar + h = 0.4 * par("csi") * 2.54 + layout(mat=rbind(2,1),height=c(1,h)) + #---------------------------------------------------------------------------# + + + + #----- Plot legend. --------------------------------------------------------# + par(mar=c(1.1,4.1,0.1,4.1)) + plot.new() + plot.window(xlim=c(0,1),ylim=c(0,1),xaxt="n",yaxt="n") + legend ( x = "top" + , inset = 0.0 + , legend = simleg.key + , fill = simcol.key + , border = "black" + , bg = "white" + , ncol = min(3,pretty.box(nsimul)$ncol) + , title = expression(bold("Simulation")) + , cex = 0.7 + )#end legend + #---------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------# + # Plot the annual data, with not distinction between day and night. # + #---------------------------------------------------------------------------# + #----- Plot window and grid. -----------------------------------------------# + par(mar=c(5,4,3,2)+0.1,xpd=FALSE,las=1) + plot.new() + plot.window(xlim=xlimit,ylim=ylimit,xaxt="n",yaxt="n") + title(main=letitre,xlab=lex,ylab=ley) + axis(side=1) + axis(side=2) + box() + if (plotgrid) grid(col="grey83",lty="solid") + #---------------------------------------------------------------------------# + + + + #---- Add the bar plot. ----------------------------------------------------# + for (s in 1:nsimul){ + points(x=input.score[d,nseason,u,],y=stat[d,nseason,s,],pch=15 + ,col=simul[[s]]$colour,cex=1.0) + }#end for + #---------------------------------------------------------------------------# + + + + #----- Close the device. ---------------------------------------------------# + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + #---------------------------------------------------------------------------# + }#end for (o in 1:nout) + #------------------------------------------------------------------------------# + + + + + }#end for (u in 1:ncontrol) #---------------------------------------------------------------------------------# }#end for (d in 1:ndiel) @@ -886,8 +1172,9 @@ for (v in 1:ncompvar){ # Find the general score for all variables. # #------------------------------------------------------------------------------------# for (s in 1:nsimul){ - performance[v,g,s] = weighted.mean( x = stat [,,s ,] - , w = score[,,ncontrol,] * nobs[,,ncontrol,] + performance[v,g,s] = weighted.mean( x = stat [,,s ,] + , w = input.score[,,ncontrol,] + * output.nobs[,, ] , na.rm = TRUE )#end weighted.mean }#end for diff --git a/ED/Template/compare_scenarios.r b/ED/Template/compare_scenarios.r new file mode 100644 index 000000000..9d1336e1e --- /dev/null +++ b/ED/Template/compare_scenarios.r @@ -0,0 +1,2437 @@ +#==========================================================================================# +#==========================================================================================# +# Reset session. # +#------------------------------------------------------------------------------------------# +rm(list=ls()) +graphics.off() +#------------------------------------------------------------------------------------------# + + + + + +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +# Here is the user defined variable section. # +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +here = getwd() # Current directory +srcdir = "/n/moorcroft_data/mlongo/util/Rsc" # Script directory +outroot = paste(here,"scenario_evergreen",sep="/") # Output directory + +sites = c("gyf","s67","m34","rja","cax","pdg","ban","pnz") +simul = list() +simul[[1]] = list( name = "iscen-01_phen-01_canrad01" + , key = "past" + , desc = "Historical rainfall" + , colour = "royalblue4" + , pch = 15 + )#end list +simul[[2]] = list( name = "iscen+01_phen-01_canrad01" + , key = "unif" + , desc = "Uniform resampling" + , colour = "steelblue3" + , pch = 17 + )#end list +simul[[3]] = list( name = "iscen-02_phen-01_canrad01" + , key = "dry02" + , desc = "Dry bias (A = -2)" + , colour = "orange1" + , pch = 9 + )#end list +simul[[4]] = list( name = "iscen-06_phen-01_canrad01" + , key = "dry06" + , desc = "Dry bias (A = -6)" + , colour = "firebrick" + , pch = 13 + )#end list +#------------------------------------------------------------------------------------------# + + + + + +#------ Miscellaneous settings. -----------------------------------------------------------# +yeara = 1972 # First year we will include +yearz = 2011 # Last year we will include +slz.min = -5.0 # The deepest depth that trees access water. +idbh.type = 2 # Type of DBH class + # 1 -- Every 10 cm until 100cm; > 100cm + # 2 -- 0-10; 10-20; 20-35; 35-50; 50-70; > 70 (cm) +#------------------------------------------------------------------------------------------# + + + + +#------------------------------------------------------------------------------------------# +# Plot options. # +#------------------------------------------------------------------------------------------# +outform = c("eps","png","pdf") # Formats for output file. Supported formats are: + # - "X11" - for printing on screen + # - "eps" - for postscript printing + # - "png" - for PNG printing + # - "pdf" - for PDF printing + +byeold = TRUE # Remove old files of the given format? + +depth = 96 # PNG resolution, in pixels per inch +paper = "letter" # Paper size, to define the plot shape +ptsz = 14 # Font size. +lwidth = 2.5 # Line width +plotgrid = TRUE # Should I plot the grid in the background? + +legwhere = "topleft" # Where should I place the legend? +inset = 0.01 # Inset between legend and edge of plot region. +legbg = "white" # Legend background colour. +fracexp = 0.40 # Expansion factor for y axis (to fit legend) +cex.main = 0.8 # Scale coefficient for the title +xyz.ncolour = 20 # Number of colours for the xyz +notch = FALSE # Add notches to the box plots. +mtext.xoff = -7.00 # Offset for the x label +mtext.yoff = -1.00 # Offset for the y label +mtext.xadj = 0.50 # Offset for the x label +mtext.yadj = 0.65 # Offset for the y label +barplot.lwd = 2.00 # Line width for the bar plots +#------------------------------------------------------------------------------------------# + + + +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +# NO NEED TO CHANGE ANYTHING BEYOND THIS POINT UNLESS YOU ARE DEVELOPING THE CODE... # +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# + + + + +#----- Load some packages and scripts. ----------------------------------------------------# +source(file.path(srcdir,"load.everything.r")) +#------------------------------------------------------------------------------------------# + + + +#----- Set how many formats we must output. -----------------------------------------------# +outform = tolower(outform) +nout = length (outform) +#------------------------------------------------------------------------------------------# + + + +#----- Set some dimensions associated with the simulations. -------------------------------# +n.sites = length(sites) +n.simul = length(simul) +#------------------------------------------------------------------------------------------# + + + + +#------------------------------------------------------------------------------------------# +# Replace the list by a data frame. # +#------------------------------------------------------------------------------------------# +simul = data.frame( apply( X = sapply(X=simul,FUN=c), MARGIN = 1, FUN = unlist ) + , stringsAsFactors = FALSE + )#end data.frame +for (nn in c("pch")) simul[[nn]] = as.numeric(simul[[nn]]) +#------------------------------------------------------------------------------------------# + + + + +#----- Avoid unecessary and extremely annoying beeps. -------------------------------------# +options(locatorBell=FALSE) +#------------------------------------------------------------------------------------------# + + + +#==========================================================================================# +#==========================================================================================# +# Create the output paths. # +#------------------------------------------------------------------------------------------# + + #----- Make sure that the base directory exists. ---------------------------------------# + if (! file.exists(outroot)) dir.create(outroot) + #---------------------------------------------------------------------------------------# + + + + + #----- Create the paths by type of plot. -----------------------------------------------# + root.ts.season = file.path(outroot,"ts_season" ) + root.ts.year = file.path(outroot,"ts_year" ) + root.tspft.season = file.path(outroot,"tspft_season" ) + root.tspft.year = file.path(outroot,"tspft_year" ) + root.boxpft.season = file.path(outroot,"boxpft_season" ) + root.boxpft.year = file.path(outroot,"boxpft_year" ) + root.boxpftdbh = file.path(outroot,"boxpftdbh" ) + root.barplot.season = file.path(outroot,"barplot_season") + root.barplot.year = file.path(outroot,"barplot_year" ) + root.xyz.season = file.path(outroot,"xyz_season" ) + root.xyz.pft = file.path(outroot,"xyz_pft" ) + if (! file.exists(root.ts.season )) dir.create(root.ts.season ) + if (! file.exists(root.ts.year )) dir.create(root.ts.year ) + if (! file.exists(root.tspft.season )) dir.create(root.tspft.season ) + if (! file.exists(root.tspft.year )) dir.create(root.tspft.year ) + if (! file.exists(root.boxpft.season )) dir.create(root.boxpft.season ) + if (! file.exists(root.boxpft.year )) dir.create(root.boxpft.year ) + if (! file.exists(root.boxpftdbh )) dir.create(root.boxpftdbh ) + if (! file.exists(root.barplot.season)) dir.create(root.barplot.season) + if (! file.exists(root.barplot.year )) dir.create(root.barplot.year ) + if (! file.exists(root.xyz.season )) dir.create(root.xyz.season ) + if (! file.exists(root.xyz.pft )) dir.create(root.xyz.pft ) + #---------------------------------------------------------------------------------------# + + + + + #----- Generate the names of the sub-sub-directories by variable. ----------------------# + out.ts.season = file.path(root.ts.season ,scen.ts$vname ) + out.ts.year = file.path(root.ts.year ,scen.ts$vname ) + out.tspft.season = file.path(root.tspft.season ,scen.ts$vname ) + out.tspft.year = file.path(root.tspft.year ,scen.ts$vname ) + out.boxpft.season = file.path(root.boxpft.season ,scen.szpft$vname ) + out.boxpft.year = file.path(root.boxpft.year ,scen.szpft$vname ) + out.boxpftdbh = file.path(root.boxpftdbh ,scen.szpft$vname ) + out.barplot.season = file.path(root.barplot.season,scen.barplot$vname ) + out.barplot.year = file.path(root.barplot.year ,scen.barplot$vname ) + out.xyz.season = file.path(root.xyz.season ,scen.xyz$yvar$vname) + out.xyz.pft = file.path(root.xyz.pft ,scen.xyz$yvar$vname) + #---------------------------------------------------------------------------------------# + + + + #----- Loop over all time series variables and create the paths as needed. -------------# + for (n in 1:nscen.ts){ + #----- Check whether this variable is to be plotted. --------------------------------# + if (scen.ts$plt[n]){ + if (! file.exists(out.ts.season[n])) dir.create(out.ts.season[n]) + if (! file.exists(out.ts.year [n])) dir.create(out.ts.year [n]) + }#end if + #------------------------------------------------------------------------------------# + + + #----- Check whether this variable is to be plotted by PFT. -------------------------# + if (scen.ts$plt[n] && scen.ts$pftvar[n]){ + if (! file.exists(out.tspft.season[n])) dir.create(out.tspft.season[n]) + if (! file.exists(out.tspft.year [n])) dir.create(out.tspft.year [n]) + }#end if + #------------------------------------------------------------------------------------# + }#end for + #---------------------------------------------------------------------------------------# + + + + #----- Loop over all box plot variables and create the paths as needed. ----------------# + for (n in 1:nscen.szpft){ + #----- Check whether this variable is to be plotted. --------------------------------# + if (scen.szpft$plt[n]){ + if (! file.exists(out.boxpft.season[n])) dir.create(out.boxpft.season[n]) + if (! file.exists(out.boxpft.year [n])) dir.create(out.boxpft.year [n]) + }#end if + #------------------------------------------------------------------------------------# + + + #----- Check whether this variable is to be plotted by PFT. -------------------------# + if (scen.szpft$plt[n] && scen.szpft$dbhvar[n]){ + if (! file.exists(out.boxpftdbh[n])) dir.create(out.boxpftdbh[n]) + }#end if + #------------------------------------------------------------------------------------# + }#end for + #---------------------------------------------------------------------------------------# + + + + #----- Loop over all bar plot variables and create the paths as needed. ----------------# + for (n in 1:nscen.barplot){ + #----- Check whether this variable is to be plotted. --------------------------------# + if (scen.barplot$plt[n]){ + if (! file.exists(out.barplot.season[n])) dir.create(out.barplot.season[n]) + if (! file.exists(out.barplot.year [n])) dir.create(out.barplot.year [n]) + }#end if + #------------------------------------------------------------------------------------# + }#end for + #---------------------------------------------------------------------------------------# + + + + #----- Loop over all parameter space variables (Y) and create the paths as needed. -----# + for (n in 1:nscen.yvar){ + if (! file.exists(out.xyz.season[n])) dir.create(out.xyz.season[n]) + if (! file.exists(out.xyz.pft [n])) dir.create(out.xyz.pft [n]) + }#end for + #---------------------------------------------------------------------------------------# +#==========================================================================================# +#==========================================================================================# + + + +#----- Load observations. -----------------------------------------------------------------# +obsrfile = paste(srcdir,"LBA_MIP.v8.RData",sep="/") +load(file=obsrfile) +#------------------------------------------------------------------------------------------# + + + +#----- Define plot window size ------------------------------------------------------------# +size = plotsize(proje=FALSE,paper=paper) +#------------------------------------------------------------------------------------------# + + + +#------------------------------------------------------------------------------------------# +# Define some dimensions. # +#------------------------------------------------------------------------------------------# +pft.use = c( 1, 2, 3, 4,16, 18) # PFT classes to include (add PFT=18, the total) +pft.mp = c( F, T, T, T, F, T) # Include the PFT on multi-panel plots? +pft.key = pft$key [pft.use ] # PFT keys (for dimnames) +pft.desc = pft$name [pft.use ] # PFT names (for titles) +pft.colour = pft$colour [pft.use ] # PFT colours +dbh.use = seq(from=2,to=ndbh,by=1) # DBH classes that we will use +dbh.key = dbhkeys [dbh.use ] # DBH keys (for dimnames) +dbh.desc = dbhnames [dbh.use ] # DBH names (for titles) +dbh.colour = dbhcols [dbh.use ] # DBH colours +season.use = c(1,2,3,4,5) # Seasons to include (add season=5, the total) +season.key = season.list[season.use] # Keys for the seasons. +season.desc = season.full[season.use] # Full names of all seasons. +season.colour = season.cols[season.use] # Colours for seasons. +year.use = yeara:yearz # Years to use +year.key = year.use # Year keys (for dimnames) +year.desc = year.use # Year names (for titles) +#------------------------------------------------------------------------------------------# + + + +#------------------------------------------------------------------------------------------# +# Transform pft.mp into an index linked to pft.use and associated variables. # +#------------------------------------------------------------------------------------------# +pft.mp = which(pft.mp) +pft.bp = sequence(length(pft.use)-1) +season.mp = season.use [-length(season.use)] +season.mp.key = season.key [-length(season.use)] +season.mp.desc = season.desc [-length(season.use)] +season.mp.colour = season.colour[-length(season.use)] +#------------------------------------------------------------------------------------------# + + +#------ Size of the useful dimensions. ----------------------------------------------------# +n.pft = length(pft.use) # Number of PFTs +n.pft.mp = length(pft.mp) # Number of PFTs for multiple panels +n.pft.bp = length(pft.bp) # Number of PFTs for box plots by season +n.dbh = length(dbh.use) # Number of DBH classes +n.season = length(season.use) # Number of seasons +n.season.mp = n.season-1 # Number of seasons for multiple panels +n.year = length(year.use) # Number of years +#------------------------------------------------------------------------------------------# + + + +#------------------------------------------------------------------------------------------# +# Find the best set up for plotting all seasons and all PFTs in the same plot. # +#------------------------------------------------------------------------------------------# +lo.season = pretty.box(n=n.season.mp) +lo.pft = pretty.box(n=n.pft.mp ) +#------------------------------------------------------------------------------------------# + + + +#------------------------------------------------------------------------------------------# +# Loop over all sites. # +#------------------------------------------------------------------------------------------# +for (p in 1:n.sites){ + #----- Retrieve the site information. --------------------------------------------------# + pidx = match(sites[p],poilist$iata) + short = poilist$short [pidx] + longname = poilist$longname[pidx] + iata = poilist$iata [pidx] + lon = poilist$lon [pidx] + lat = poilist$lat [pidx] + cat(" + Comparing simulations for ",longname,"...","\n",sep="") + #---------------------------------------------------------------------------------------# + + + #---------------------------------------------------------------------------------------# + # Initialise the list of variables. # + #---------------------------------------------------------------------------------------# + eft = list() + #---------------------------------------------------------------------------------------# + + + #---------------------------------------------------------------------------------------# + # Create a general time stamp that works for all simulations. # + #---------------------------------------------------------------------------------------# + #----- Get all times. ------------------------------------------------------------------# + eft$when = c(chron(paste(12,1,yeara-1,sep="/")) + ,chron(paste(rep(1:12,times=n.year),1,rep(year.use,each=12),sep="/")) + )#end c + eft$when = eft$when[-length(eft$when)] + eft$year = numyears (eft$when) + eft$month = nummonths(eft$when) + n.when = length(eft$when) + #---- Find the seasons. ----------------------------------------------------------------# + eft$season = season(eft$when,add.year=TRUE,dec.next=TRUE) + eft$ss.year = as.numeric(substring(eft$season,1,4)) + eft$ss.season = as.numeric(substring(eft$season,5,6)) + #---- Find unique identifiers for seasons and years based on season, not months. -------# + eft$toseason = unique(eft$season) + eft$toyear = unique(eft$ss.year) + #---------------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------------# + # Make some arrays with the right dimensions. # + #---------------------------------------------------------------------------------------# + empty = rep (NA,times=n.when) + empty.pft = array(NA,dim=c(n.when,n.pft)) + empty.pftdbh = array(NA,dim=c(n.when,n.dbh,n.pft)) + ts.array = array( data = NA + , dim = c ( n.year, n.season, n.simul) + , dimnames = list(year.key,season.key,simul$key) + )#end array + tspft.array = array( data = NA + , dim = c ( n.year, n.season, n.pft, n.simul) + , dimnames = list(year.key,season.key,pft.key,simul$key) + )#end array + tspftdbh.array = array( data = NA + , dim = c ( n.year, n.season, n.dbh, n.pft, n.simul) + , dimnames = list( year.key,season.key,dbh.key,pft.key,simul$key) + )#end array + #---------------------------------------------------------------------------------------# + + + + + #=======================================================================================# + #=======================================================================================# + # Initialise all variables. # + #---------------------------------------------------------------------------------------# + for (v in 1:nscen.ts){ + #----- Copy variable info. ----------------------------------------------------------# + var.vname = scen.ts$vname[v] + var.desc = scen.ts$desc [v] + var.quant = scen.ts$quant[v] + is.pft = scen.ts$pft [v] + is.dbh = scen.ts$dbh [v] + var.pft = paste(var.vname,"pft" ,sep="") + var.pftdbh = paste(var.vname,"pftdbh",sep="") + cat (" * Creating data holders for ",var.desc,"...","\n") + + #----- Append the lists to a common name. -------------------------------------------# + eft[[var.vname]] = list() + eft[[var.vname]]$ts = ts.array + if (is.pft) eft[[var.vname]]$tspft = tspft.array + if (is.dbh) eft[[var.vname]]$tspftdbh = tspftdbh.array + #------------------------------------------------------------------------------------# + }#end for (v in 1:nscen.ts) + #=======================================================================================# + #=======================================================================================# + + + + + + + #=======================================================================================# + #=======================================================================================# + # Loop over the simulations. # + #---------------------------------------------------------------------------------------# + for (s in 1:n.simul){ + #---- Copy the settings to local variables. -----------------------------------------# + sim.name = simul$name [s] + sim.desc = simul$desc [s] + sim.colour = simul$colour[s] + sim.pch = simul$pch [s] + sim.full = paste("t",iata,"_",sim.name,sep="") + #------------------------------------------------------------------------------------# + + + #------------------------------------------------------------------------------------# + # Load the data set. # + #------------------------------------------------------------------------------------# + rdata.simul = paste(here,"/",sim.full,"/rdata_month/",sim.full,".RData",sep="") + cat (" - Load data from file ",basename(rdata.simul),"...","\n") + load (rdata.simul) + #------------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------------# + # Find the indices for mapping the data from the original data set to the # + # combined one. # + #------------------------------------------------------------------------------------# + idx = match(eft$when,datum$when) + sel = is.finite(idx) + idx = idx[sel] + #------------------------------------------------------------------------------------# + + + + + #------------------------------------------------------------------------------------# + # These are shorter versions of the season indices. # + #------------------------------------------------------------------------------------# + ee = sequence(n.season.mp) + e5 = n.season + #------------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------------# + # Copy the time variables to the consolidated list. # + #------------------------------------------------------------------------------------# + for (v in 1:nscen.ts){ + #----- Copy variable info. -------------------------------------------------------# + var.vname = scen.ts$vname [v] + var.desc = scen.ts$desc [v] + var.f.aggr = get(scen.ts$f.aggr[v]) + is.pft = scen.ts$pft [v] + is.dbh = scen.ts$dbh [v] + is.mort = scen.ts$mort [v] + is.recr = scen.ts$recr [v] + var.pft = paste(var.vname,"pft" ,sep="") + var.pftdbh = paste(var.vname,"pftdbh",sep="") + cat (" * Processing ",var.desc,"...","\n") + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Grab the time series. # + #---------------------------------------------------------------------------------# + var.now = empty + if (is.pft){ + var.now[sel] = datum[[var.pft]][idx,pft.use[n.pft]] + }else{ + var.now[sel] = datum[[var.vname]][idx] + }#end if (is.pft) + #------ Find the means/sum by year and by season. --------------------------------# + eft[[var.vname]]$ts[,ee,s] = tapply( X = var.now + , INDEX = list(eft$ss.year,eft$ss.season) + , FUN = var.f.aggr + , na.rm = TRUE + )#end tapply + eft[[var.vname]]$ts[,e5,s] = tapply( X = var.now + , INDEX = eft$ss.year + , FUN = var.f.aggr + , na.rm = TRUE + )#end tapply + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Check what to do depending on whether the variable is a PFT and/or DBH. # + #---------------------------------------------------------------------------------# + if (is.pft){ + var.now = empty.pft + var.now[sel,] = datum[[var.pft]][idx,pft.use] + + #----- Find the means/sum by year and by season. ------------------------------# + eft[[var.vname]]$tspft[,ee,,s] = qapply( X = var.now + , INDEX = list( eft$ss.year + , eft$ss.season + )#end list + , DIM = 1 + , FUN = var.f.aggr + , na.rm = TRUE + )#end qapply + eft[[var.vname]]$tspft[,e5,,s] = qapply( X = var.now + , INDEX = eft$ss.year + , DIM = 1 + , FUN = var.f.aggr + , na.rm = TRUE + )#end qapply + #------------------------------------------------------------------------------# + }#end if (var.pft) + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Check what to do depending on whether the variable is a PFT and/or DBH. # + #---------------------------------------------------------------------------------# + if (is.dbh){ + var.now = empty.pftdbh + var.now[sel,,] = datum[[var.pftdbh]][idx,dbh.use,pft.use] + + #----- Find the means/sum by year and by season. ------------------------------# + eft[[var.vname]]$tspftdbh[,ee,,,s] = qapply( X = var.now + , INDEX = list( eft$ss.year + , eft$ss.season + )#end list + , DIM = 1 + , FUN = var.f.aggr + , na.rm = TRUE + )#end qapply + eft[[var.vname]]$tspftdbh[,e5,,,s] = qapply( X = var.now + , INDEX = eft$ss.year + , DIM = 1 + , FUN = var.f.aggr + , na.rm = TRUE + )#end qapply + #------------------------------------------------------------------------------# + }#end if (var.dbh) + #---------------------------------------------------------------------------------# + }#end for (v in 1:nscen.ts) + #------------------------------------------------------------------------------------# + }#end for (s in 1:n.simul) + #=======================================================================================# + #=======================================================================================# + + + + + + + #=======================================================================================# + #=======================================================================================# + # Loop over variables and find the ones that are mortality or recruitment. We # + # must transform them so they are always between 0 and 100. # + #---------------------------------------------------------------------------------------# + cat (" * Transforming mortality and recruitment variables...","\n") + for (v in 1:nscen.ts){ + #----- Copy variable info. ----------------------------------------------------------# + var.vname = scen.ts$vname[v] + var.desc = scen.ts$desc [v] + is.pft = scen.ts$pft [v] + is.dbh = scen.ts$dbh [v] + is.mort = scen.ts$mort [v] + is.recr = scen.ts$recr [v] + cat (" * Creating data holders for ",var.desc,"...","\n") + + #----- Transform mortality data. ----------------------------------------------------# + if (is.mort){ + eft[[var.vname]]$ts = 100.*(1. - exp(-eft[[var.vname]]$ts )) + if(is.pft) eft[[var.vname]]$tspft = 100.*(1. - exp(-eft[[var.vname]]$tspft )) + if(is.dbh) eft[[var.vname]]$tspftdbh = 100.*(1. - exp(-eft[[var.vname]]$tspftdbh)) + }#end if + #------------------------------------------------------------------------------------# + + + + #----- Transform recruitment data. --------------------------------------------------# + if (is.recr){ + eft[[var.vname]]$ts = 100.*(exp(eft[[var.vname]]$ts ) - 1.0) + if(is.pft) eft[[var.vname]]$tspft = 100.*(exp(eft[[var.vname]]$tspft ) - 1.0) + if(is.dbh) eft[[var.vname]]$tspftdbh = 100.*(exp(eft[[var.vname]]$tspftdbh) - 1.0) + }#end if + #------------------------------------------------------------------------------------# + }#end for (v in 1:nscen.ts) + #=======================================================================================# + #=======================================================================================# + + + + + + + #=======================================================================================# + #=======================================================================================# + # Plot the comparison between time series, by season. # + #---------------------------------------------------------------------------------------# + cat (" - Plotting the time series...","\n") + for (v in 1:nscen.ts){ + #----- Copy variable info. ----------------------------------------------------------# + var.vname = scen.ts$vname [v] + var.desc = scen.ts$desc [v] + var.unit = scen.ts$unit [v] + is.pft = scen.ts$pftvar[v] + var.plog = scen.ts$plog [v] + var.plt = scen.ts$plt [v] + if (var.plog){ + var.xylog = "y" + }else{ + var.xylog = "" + }#end if + + if (var.plt){ + cat (" - ",var.desc,"...","\n") + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + # Plot the variable by season. # + #---------------------------------------------------------------------------------# + + + #----- Load variable. ------------------------------------------------------------# + this = eft[[var.vname]]$ts + xlimit = pretty.xylim(year.use ,fracexp=0.0,is.log=FALSE ) + ylimit = pretty.xylim(this[,1:n.season.mp,],fracexp=0.0,is.log=var.plog) + #---------------------------------------------------------------------------------# + + + + #----- Set the title. ------------------------------------------------------------# + letitre = paste(var.desc," (Seasonal means) - ",longname,sep="") + lex = paste("Year") + ley = paste(var.desc," [",var.unit,"]",sep=" ") + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Loop over all formats. # + #---------------------------------------------------------------------------------# + for (o in 1:nout){ + #----- Open file or display. --------------------------------------------------# + fichier = paste(out.ts.season[v],"/",var.vname,"-",iata,"-ts_season." + ,outform[o],sep="") + if (outform[o] == "x11"){ + X11(width=size$width,height=size$height,pointsize=ptsz) + }else if(outform[o] == "png"){ + png(filename=fichier,width=size$width*depth,height=size$height*depth + ,pointsize=ptsz,res=depth) + }else if(outform[o] == "eps"){ + postscript(file=fichier,width=size$width,height=size$height,pointsize=ptsz + ,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE,width=size$width,height=size$height + ,pointsize=ptsz,paper=size$paper) + }#end if + #------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------# + # Split the window into several smaller windows. Add a bottom row to fit # + # the legend. # + #------------------------------------------------------------------------------# + par.orig = par(no.readonly = TRUE) + mar.orig = par.orig$mar + par(oma = c(0.2,3,4,0)) + layout(mat = rbind(1+lo.season$mat,rep(1,times=lo.season$ncol)) + ,height = c(rep(5/lo.season$nrow,times=lo.season$nrow),1) + )#end layout + #------------------------------------------------------------------------------# + + + + #----- Plot legend. -----------------------------------------------------------# + par(mar=c(0.1,0.1,0.1,0.1)) + plot.new() + plot.window(xlim=c(0,1),ylim=c(0,1),xaxt="n",yaxt="n") + legend ( x = "bottom" + , inset = 0.0 + , legend = simul$desc + , col = simul$colour + , lwd = 2.0 + , pch = 16 + , bg = "white" + , ncol = min(3,pretty.box(n.simul)$ncol) + , title = expression(bold("Simulation")) + , cex = 1.0 + )#end legend + #------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------# + # Loop over all seasons, and plot the bar plots. # + #------------------------------------------------------------------------------# + for (e in 1:n.season.mp){ + #----- Find out where is this box going, and set up axes and margins. ------# + left = (e %% lo.season$ncol) == 1 + right = (e %% lo.season$ncol) == 0 + top = e <= lo.season$ncol + bottom = e > (lo.season$nrow - 1) * lo.season$ncol + mar.now = c(1 + 3 * bottom,1 + 1 * left,1 + 2 * top,1 + 1 * right) + 0.1 + #---------------------------------------------------------------------------# + + + #----- Set up the title for each plot. -------------------------------------# + lesub = paste(season.desc[e],sep="") + #---------------------------------------------------------------------------# + + + + #----- Plot window and grid. -----------------------------------------------# + par(mar=mar.now) + plot.new() + plot.window(xlim=xlimit,ylim=ylimit,xaxt="n",yaxt="n") + if (bottom) axis(side=1) + if (left ) axis(side=2) + box() + title(main=lesub) + if (plotgrid) grid(col="grey83",lty="solid") + + #----- Plot the lines. -----------------------------------------------------# + for (s in 1:n.simul){ + points(x=year.use,y=this[,e,s],type="o",pch=16,col=simul$colour[s] + ,lwd=2.0) + }#end for + #---------------------------------------------------------------------------# + }#end for (e in 1:n.season.mp) + #------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------# + # Plot the global title. # + #------------------------------------------------------------------------------# + par(las=0) + mtext(text=lex ,side=1,outer=TRUE,adj=mtext.xadj,padj=mtext.xoff) + mtext(text=ley ,side=2,outer=TRUE,adj=mtext.yadj,padj=mtext.yoff) + mtext(text=letitre,side=3,outer=TRUE,cex=1.1,font=2) + #------------------------------------------------------------------------------# + + + + #----- Close the device. ------------------------------------------------------# + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + #------------------------------------------------------------------------------# + }#end for (o in 1:nout) + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + + + + + + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + # Now we plot the annual data. # + #---------------------------------------------------------------------------------# + + + #----- Update limits. ------------------------------------------------------------# + xlimit = pretty.xylim(year.use ,fracexp=0.0 ,is.log=FALSE ) + ylimit = pretty.xylim(this[,n.season,],fracexp=fracexp,is.log=var.plog) + #---------------------------------------------------------------------------------# + + + + #----- Set the title. ------------------------------------------------------------# + letitre = paste(var.desc," (Annual means) ",longname,sep="") + lex = paste("Year") + ley = paste(var.desc," [",var.unit,"]",sep=" ") + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Loop over all formats. # + #---------------------------------------------------------------------------------# + for (o in 1:nout){ + #----- Open file or display. --------------------------------------------------# + fichier = paste(out.ts.year[v],"/",var.vname,"-",iata,"-ts_year." + ,outform[o],sep="") + if (outform[o] == "x11"){ + X11(width=size$width,height=size$height,pointsize=ptsz) + }else if(outform[o] == "png"){ + png(filename=fichier,width=size$width*depth,height=size$height*depth + ,pointsize=ptsz,res=depth) + }else if(outform[o] == "eps"){ + postscript(file=fichier,width=size$width,height=size$height,pointsize=ptsz + ,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE,width=size$width,height=size$height + ,pointsize=ptsz,paper=size$paper) + }#end if + #------------------------------------------------------------------------------# + + + + #----- Plot window and grid. --------------------------------------------------# + plot.new() + plot.window(xlim=xlimit,ylim=ylimit) + axis(side=1) + axis(side=2) + box() + title(main=letitre,xlab=lex,ylab=ley) + if (plotgrid) grid(col="grey83",lty="solid") + #------------------------------------------------------------------------------# + + + + #----- Plot the lines. --------------------------------------------------------# + for (s in 1:n.simul){ + points(x=year.use,y=this[,n.season,s],type="o",pch=16,col=simul$colour[s] + ,lwd=2.0) + }#end for + #------------------------------------------------------------------------------# + + + + #---- Add the legend. ---------------------------------------------------------# + legend ( x = "topright" + , inset = inset + , legend = simul$desc + , col = simul$colour + , lwd = 2.0 + , pch = 16 + , bg = "white" + , ncol = min(3,pretty.box(n.simul)$ncol) + , title = expression(bold("Simulation")) + , cex = 1.0 + )#end legend + #------------------------------------------------------------------------------# + + + + #----- Close the device. ------------------------------------------------------# + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + #------------------------------------------------------------------------------# + }#end for (o in 1:nout) + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + }#end if (var.plt) + #------------------------------------------------------------------------------------# + + + + + #------------------------------------------------------------------------------------# + # If this is a PFT variable, plot the time series by PFT and season. # + #------------------------------------------------------------------------------------# + if (var.plt && is.pft){ + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + # Plot the seasonal time series for each PFT. # + #---------------------------------------------------------------------------------# + for (f in 1:(n.pft-1)){ + cpft = sprintf("%2.2i",pft.use[f]) + + #----- Load variable. ---------------------------------------------------------# + this = eft[[var.vname]]$tspft + xlimit = pretty.xylim(year.use ,fracexp=0.0,is.log=FALSE ) + ylimit = pretty.xylim(this[,1:n.season.mp,f,],fracexp=0.0,is.log=var.plog) + #------------------------------------------------------------------------------# + + + + #----- Set the title. ---------------------------------------------------------# + letitre = paste(var.desc," (Seasonal means) - ",longname + ,"\n",pft.desc[f],sep="") + lex = paste("Year") + ley = paste(var.desc," [",var.unit,"]",sep=" ") + #------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------# + # Loop over all formats. # + #------------------------------------------------------------------------------# + for (o in 1:nout){ + #----- Open file or display. -----------------------------------------------# + fichier = paste(out.tspft.season[v],"/",var.vname,"-",iata,"-",cpft + ,"-ts_season.",outform[o],sep="") + if (outform[o] == "x11"){ + X11(width=size$width,height=size$height,pointsize=ptsz) + }else if(outform[o] == "png"){ + png(filename=fichier,width=size$width*depth,height=size$height*depth + ,pointsize=ptsz,res=depth) + }else if(outform[o] == "eps"){ + postscript(file=fichier,width=size$width,height=size$height + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE,width=size$width,height=size$height + ,pointsize=ptsz,paper=size$paper) + }#end if + #---------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------# + # Split the window into several smaller windows. Add a bottom row to # + # fit the legend. # + #---------------------------------------------------------------------------# + par.orig = par(no.readonly = TRUE) + mar.orig = par.orig$mar + par(oma = c(0.2,3,4,0)) + layout(mat = rbind(1+lo.season$mat,rep(1,times=lo.season$ncol)) + ,height = c(rep(5/lo.season$nrow,times=lo.season$nrow),1) + )#end layout + #---------------------------------------------------------------------------# + + + + #----- Plot legend. --------------------------------------------------------# + par(mar=c(0.1,0.1,0.1,0.1)) + plot.new() + plot.window(xlim=c(0,1),ylim=c(0,1),xaxt="n",yaxt="n") + legend ( x = "bottom" + , inset = 0.0 + , legend = simul$desc + , col = simul$colour + , lwd = 2.0 + , pch = 16 + , bg = "white" + , ncol = min(3,pretty.box(n.simul)$ncol) + , title = expression(bold("Simulation")) + , cex = 1.0 + )#end legend + #---------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------# + # Loop over all seasons, and plot the bar plots. # + #---------------------------------------------------------------------------# + for (e in 1:n.season.mp){ + #----- Find out where is this box going, and set up axes and margins. ---# + left = (e %% lo.season$ncol) == 1 + right = (e %% lo.season$ncol) == 0 + top = e <= lo.season$ncol + bottom = e > (lo.season$nrow - 1) * lo.season$ncol + mar.now = c(1 + 3 * bottom,1 + 1 * left,1 + 2 * top,1 + 1 * right) + 0.1 + #------------------------------------------------------------------------# + + + #----- Set up the title for each plot. ----------------------------------# + lesub = paste(season.desc[e],sep="") + #------------------------------------------------------------------------# + + + + #----- Plot window and grid. --------------------------------------------# + par(mar=mar.now) + plot.new() + plot.window(xlim=xlimit,ylim=ylimit,xaxt="n",yaxt="n") + if (bottom) axis(side=1) + if (left ) axis(side=2) + box() + title(main=lesub) + if (plotgrid) grid(col="grey83",lty="solid") + + #----- Plot the lines. --------------------------------------------------# + for (s in 1:n.simul){ + points(x=year.use,y=this[,e,f,s],type="o",pch=16,col=simul$colour[s] + ,lwd=2.0) + }#end for + #------------------------------------------------------------------------# + }#end for (e in 1:n.season.mp) + #---------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------# + # Plot the global title. # + #---------------------------------------------------------------------------# + par(las=0) + mtext(text=lex ,side=1,outer=TRUE,adj=mtext.xadj,padj=mtext.xoff) + mtext(text=ley ,side=2,outer=TRUE,adj=mtext.yadj,padj=mtext.yoff) + mtext(text=letitre,side=3,outer=TRUE,cex=1.1,font=2) + #---------------------------------------------------------------------------# + + + + #----- Close the device. ---------------------------------------------------# + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + #---------------------------------------------------------------------------# + }#end for (o in 1:nout) + #------------------------------------------------------------------------------# + }#end for (f in 1:(n.pft-1)) + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + + + + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + # Plot the time series by PFT (annual, one panel for each PFT). # + #---------------------------------------------------------------------------------# + + + #----- Reset limits. -------------------------------------------------------------# + this = eft[[var.vname]]$tspft + xlimit = pretty.xylim(year.use ,fracexp=0.0,is.log=FALSE ) + ylimit = pretty.xylim(this[,n.season,pft.mp,],fracexp=0.0,is.log=var.plog) + #---------------------------------------------------------------------------------# + + + + #----- Set the title. ------------------------------------------------------------# + letitre = paste(var.desc," (Annual means) - ",longname,sep="") + lex = paste("Year") + ley = paste(var.desc," [",var.unit,"]",sep=" ") + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Loop over all formats. # + #---------------------------------------------------------------------------------# + for (o in 1:nout){ + #----- Open file or display. --------------------------------------------------# + fichier = paste(out.tspft.year[v],"/",var.vname,"-",iata,"-tspft_year." + ,outform[o],sep="") + if (outform[o] == "x11"){ + X11(width=size$width,height=size$height,pointsize=ptsz) + }else if(outform[o] == "png"){ + png(filename=fichier,width=size$width*depth,height=size$height*depth + ,pointsize=ptsz,res=depth) + }else if(outform[o] == "eps"){ + postscript(file=fichier,width=size$width,height=size$height,pointsize=ptsz + ,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE,width=size$width,height=size$height + ,pointsize=ptsz,paper=size$paper) + }#end if + #------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------# + # Split the window into several smaller windows. Add a bottom row to fit # + # the legend. # + #------------------------------------------------------------------------------# + par.orig = par(no.readonly = TRUE) + mar.orig = par.orig$mar + par(oma = c(0.2,3,4,0)) + layout(mat = rbind(1+lo.pft$mat,rep(1,times=lo.pft$ncol)) + ,height = c(rep(5/lo.pft$nrow,times=lo.pft$nrow),1) + )#end layout + #------------------------------------------------------------------------------# + + + + #----- Plot legend. -----------------------------------------------------------# + par(mar=c(0.1,0.1,0.1,0.1)) + plot.new() + plot.window(xlim=c(0,1),ylim=c(0,1),xaxt="n",yaxt="n") + legend ( x = "bottom" + , inset = 0.0 + , legend = simul$desc + , col = simul$colour + , lwd = 2.0 + , pch = 16 + , bg = "white" + , ncol = min(3,pretty.box(n.simul)$ncol) + , title = expression(bold("Simulation")) + , cex = 1.0 + )#end legend + #------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------# + # Loop over all seasons, and plot the bar plots. # + #------------------------------------------------------------------------------# + for (f in 1:n.pft.mp){ + + #----- Find out where is this box going, and set up axes and margins. ------# + left = (f %% lo.pft$ncol) == 1 + right = (f %% lo.pft$ncol) == 0 + top = f <= lo.pft$ncol + bottom = f > (lo.pft$nrow - 1) * lo.pft$ncol + mar.now = c(1 + 3 * bottom,1 + 1 * left,1 + 2 * top,1 + 1 * right) + 0.1 + #---------------------------------------------------------------------------# + + + #----- Set up the title for each plot. -------------------------------------# + lesub = paste(pft.desc[pft.mp[f]],sep="") + #---------------------------------------------------------------------------# + + + + #----- Plot window and grid. -----------------------------------------------# + par(mar=mar.now) + plot.new() + plot.window(xlim=xlimit,ylim=ylimit,xaxt="n",yaxt="n") + if (bottom) axis(side=1) + if (left ) axis(side=2) + box() + title(main=lesub) + if (plotgrid) grid(col="grey83",lty="solid") + + #----- Plot the lines. -----------------------------------------------------# + for (s in 1:n.simul){ + points(x=year.use,y=this[,n.season,pft.mp[f],s],type="o",pch=16 + ,col=simul$colour[s],lwd=2.0) + }#end for + #---------------------------------------------------------------------------# + }#end for (e in 1:n.pft) + #------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------# + # Plot the global title. # + #------------------------------------------------------------------------------# + par(las=0) + mtext(text=lex ,side=1,outer=TRUE,adj=mtext.xadj,padj=mtext.xoff) + mtext(text=ley ,side=2,outer=TRUE,adj=mtext.yadj,padj=mtext.yoff) + mtext(text=letitre,side=3,outer=TRUE,cex=1.1,font=2) + #------------------------------------------------------------------------------# + + + + #----- Close the device. ------------------------------------------------------# + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + #------------------------------------------------------------------------------# + }#end for (o in 1:nout) + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + }#end if (is.pft && var.plt) + #------------------------------------------------------------------------------------# + + }#end for (v in 1:nscen.ts) + #=======================================================================================# + #=======================================================================================# + + + + + + + + + #=======================================================================================# + #=======================================================================================# + # Plot the box plots. # + #---------------------------------------------------------------------------------------# + cat (" - Plotting the box plots...","\n") + for (v in 1:nscen.szpft){ + #----- Copy variable info. ----------------------------------------------------------# + var.vname = scen.szpft$vname [v] + var.desc = scen.szpft$desc [v] + var.unit = scen.szpft$unit [v] + is.pft = scen.szpft$pftvar[v] + is.dbh = scen.szpft$dbhvar[v] + var.plog = scen.szpft$plog [v] + var.plt = scen.szpft$plt [v] + if (var.plog){ + var.xylog = "y" + }else{ + var.xylog = "" + }#end if + #------------------------------------------------------------------------------------# + + + if (var.plt){ + cat (" - ",var.desc,"...","\n") + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + # Plot the box plot by PFT and by season. # + #---------------------------------------------------------------------------------# + xlimit = c(0,n.pft.bp*n.simul) + 0.5 + xat = seq(from=1 + 0.5*(n.simul-1), to=n.pft.bp*n.simul, by=n.simul) + xgrid = seq(from=0.5, to=(n.pft.bp+1)*n.simul - 0.5*(n.simul-1), by=n.simul) + #---------------------------------------------------------------------------------# + + + #----- Load variable and set y axis. ---------------------------------------------# + this = eft[[var.vname]]$tspft[,1:n.season.mp,pft.bp,] + ylimit = pretty.xylim(u=this,fracexp=0.0,is.log=var.plog) + #---------------------------------------------------------------------------------# + + + + #----- Set the title. ------------------------------------------------------------# + letitre = paste(var.desc," (Seasonal means) - ",longname,sep="") + lex = paste("Plant functional type") + ley = paste(var.desc," [",var.unit,"]",sep=" ") + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Set up the box plot colour. # + #---------------------------------------------------------------------------------# + bp.colour = rep(simul$colour,times=n.pft.bp) + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Loop over all formats. # + #---------------------------------------------------------------------------------# + for (o in 1:nout){ + #----- Open file or display. --------------------------------------------------# + fichier = paste(out.boxpft.season[v],"/",var.vname,"-",iata,"-boxplot_season." + ,outform[o],sep="") + if (outform[o] == "x11"){ + X11(width=size$width,height=size$height,pointsize=ptsz) + }else if(outform[o] == "png"){ + png(filename=fichier,width=size$width*depth,height=size$height*depth + ,pointsize=ptsz,res=depth) + }else if(outform[o] == "eps"){ + postscript(file=fichier,width=size$width,height=size$height,pointsize=ptsz + ,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE,width=size$width,height=size$height + ,pointsize=ptsz,paper=size$paper) + }#end if + #------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------# + # Split the window into several smaller windows. Add a bottom row to fit # + # the legend. # + #------------------------------------------------------------------------------# + par.orig = par(no.readonly = TRUE) + mar.orig = par.orig$mar + par(oma = c(0.2,3,4,0)) + layout(mat = rbind(1+lo.season$mat,rep(1,times=lo.season$ncol)) + ,height = c(rep(5/lo.season$nrow,times=lo.season$nrow),1) + )#end layout + #------------------------------------------------------------------------------# + + + + #----- Plot legend. -----------------------------------------------------------# + par(mar=c(0.1,0.1,0.1,0.1)) + plot.new() + plot.window(xlim=c(0,1),ylim=c(0,1),xaxt="n",yaxt="n") + legend ( x = "bottom" + , inset = 0.0 + , legend = simul$desc + , fill = simul$colour + , border = "black" + , bg = "white" + , ncol = min(3,pretty.box(n.simul)$ncol) + , title = expression(bold("Simulation")) + , cex = 1.0 + )#end legend + #------------------------------------------------------------------------------# + + + + + #------------------------------------------------------------------------------# + # Loop over all seasons, and plot the bar plots. # + #------------------------------------------------------------------------------# + for (e in 1:n.season.mp){ + + #----- Find out where is this box going, and set up axes and margins. ------# + left = (e %% lo.season$ncol) == 1 + right = (e %% lo.season$ncol) == 0 + top = e <= lo.season$ncol + bottom = e > (lo.season$nrow - 1) * lo.season$ncol + mar.now = c(1 + 3 * bottom,1 + 1 * left,1 + 2 * top,1 + 1 * right) + 0.1 + #---------------------------------------------------------------------------# + + + #----- Set up the title for each plot. -------------------------------------# + lesub = paste(season.desc[e],sep="") + #---------------------------------------------------------------------------# + + + + #----- Create the temporary box plot list. ---------------------------------# + ss.this = this[,e,,] + ai = arrayInd(sequence(length(ss.this)),.dim=dim(ss.this)) + bp.plot = split(x=ss.this,f=list(ai[,3],ai[,2])) + #---------------------------------------------------------------------------# + + + + #----- Plot window and grid. -----------------------------------------------# + par(mar=mar.now) + plot.new() + plot.window(xlim=xlimit,ylim=ylimit,xaxt="n",yaxt="n") + if (bottom) axis(side=1,at=xat,labels=pft.key[pft.bp]) + if (left ) axis(side=2) + box() + title(main=lesub) + if (plotgrid) abline(v=xgrid,h=axTicks(2),col="grey40",lty="solid") + + #----- Add the box plot, without the x axis. -------------------------------# + boxplot(x=bp.plot,col=bp.colour,notch=notch,add=TRUE,show.names=FALSE + ,yaxt="n") + #---------------------------------------------------------------------------# + }#end for (e in 1:n.season.mp) + #------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------# + # Plot the global title. # + #------------------------------------------------------------------------------# + par(las=0) + mtext(text=lex ,side=1,outer=TRUE,adj=mtext.xadj,padj=mtext.xoff) + mtext(text=ley ,side=2,outer=TRUE,adj=mtext.yadj,padj=mtext.yoff) + mtext(text=letitre,side=3,outer=TRUE,cex=1.1,font=2) + #------------------------------------------------------------------------------# + + + + #----- Close the device. ------------------------------------------------------# + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + #------------------------------------------------------------------------------# + }#end for (o in 1:nout) + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + + + + + + + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + # Plot the box plot by PFT and by season. # + #---------------------------------------------------------------------------------# + xlimit = c(0,n.pft.bp*n.simul) + 0.5 + xat = seq(from=1 + 0.5*(n.simul-1), to=n.pft.bp*n.simul, by=n.simul) + xgrid = seq(from=0.5, to=(n.pft.bp+1)*n.simul - 0.5*(n.simul-1), by=n.simul) + #---------------------------------------------------------------------------------# + + + #----- Load variable and set y axis. ---------------------------------------------# + this = eft[[var.vname]]$tspft[,n.season,pft.bp,] + ylimit = pretty.xylim(u=this,fracexp=fracexp,is.log=var.plog) + #---------------------------------------------------------------------------------# + + + + #----- Set the title. ------------------------------------------------------------# + letitre = paste(var.desc," (Annual means) - ",longname,sep="") + lex = paste("Plant functional type") + ley = paste(var.desc," [",var.unit,"]",sep=" ") + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Set up the box plot colour. # + #---------------------------------------------------------------------------------# + bp.colour = rep(simul$colour,times=n.pft.bp) + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Loop over all formats. # + #---------------------------------------------------------------------------------# + for (o in 1:nout){ + #----- Open file or display. --------------------------------------------------# + fichier = paste(out.boxpft.year[v],"/",var.vname,"-",iata,"-boxplot_year." + ,outform[o],sep="") + if (outform[o] == "x11"){ + X11(width=size$width,height=size$height,pointsize=ptsz) + }else if(outform[o] == "png"){ + png(filename=fichier,width=size$width*depth,height=size$height*depth + ,pointsize=ptsz,res=depth) + }else if(outform[o] == "eps"){ + postscript(file=fichier,width=size$width,height=size$height,pointsize=ptsz + ,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE,width=size$width,height=size$height + ,pointsize=ptsz,paper=size$paper) + }#end if + #------------------------------------------------------------------------------# + + + + #----- Create the temporary box plot list. ------------------------------------# + ai = arrayInd(sequence(length(this)),.dim=dim(this)) + bp.plot = split(x=ss.this,f=list(ai[,3],ai[,2])) + #------------------------------------------------------------------------------# + + + + #----- Plot window and grid. --------------------------------------------------# + plot.new() + plot.window(xlim=xlimit,ylim=ylimit,xaxt="n",yaxt="n") + if (bottom) axis(side=1,at=xat,labels=pft.key[pft.bp]) + if (left ) axis(side=2) + box() + title(main=lesub) + if (plotgrid) abline(v=xgrid,h=axTicks(2),col="grey40",lty="solid") + + #----- Add the box plot, without the x axis. ----------------------------------# + boxplot(x=bp.plot,col=bp.colour,notch=notch,add=TRUE,show.names=FALSE,yaxt="n") + #------------------------------------------------------------------------------# + + + + #----- Add the legend. --------------------------------------------------------# + legend ( x = "topright" + , inset = inset + , legend = simul$desc + , fill = simul$colour + , border = "black" + , bg = "white" + , ncol = min(3,pretty.box(n.simul)$ncol) + , title = expression(bold("Simulation")) + , cex = 1.0 + )#end legend + #------------------------------------------------------------------------------# + + + + #----- Close the device. ------------------------------------------------------# + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + #------------------------------------------------------------------------------# + }#end for (o in 1:nout) + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + }#end if (var.plt) + #------------------------------------------------------------------------------------# + + + + + + + + #------------------------------------------------------------------------------------# + # DBH plots by season. # + #------------------------------------------------------------------------------------# + if (var.plt & is.dbh){ + #---------------------------------------------------------------------------------# + # Loop over each season. # + #---------------------------------------------------------------------------------# + for (e in 1:n.season){ + cseason=paste(sprintf("%2.2i",e),season.key[e],sep="-") + + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + # Plot the box plot by PFT and by season. # + #------------------------------------------------------------------------------# + xlimit = c(0,n.pft.bp*n.simul) + 0.5 + xat = seq(from=1 + 0.5*(n.simul-1), to=n.pft.bp*n.simul, by=n.simul) + xgrid = seq(from=0.5, to=(n.pft.bp+1)*n.simul - 0.5*(n.simul-1), by=n.simul) + #------------------------------------------------------------------------------# + + + #----- Load variable and set y axis. ------------------------------------------# + this = eft[[var.vname]]$tspftdbh[,e,,pft.mp,] + ylimit = pretty.xylim(u=this,fracexp=0.0,is.log=var.plog) + #------------------------------------------------------------------------------# + + + + #----- Set the title. ---------------------------------------------------------# + letitre = paste(var.desc," - ",longname,"\n"," Season: ",season.desc[e],sep="") + lex = paste("DBH Class [cm]") + ley = paste(var.desc," [",var.unit,"]",sep=" ") + #------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------# + # Set up the box plot colour. # + #------------------------------------------------------------------------------# + bp.colour = rep(simul$colour,times=n.dbh) + #------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------# + # Loop over all formats. # + #------------------------------------------------------------------------------# + for (o in 1:nout){ + #----- Open file or display. -----------------------------------------------# + fichier = paste(out.boxpftdbh[v],"/",var.vname,"-",iata,"-",cseason + ,"-boxplot.",outform[o],sep="") + if (outform[o] == "x11"){ + X11(width=size$width,height=size$height,pointsize=ptsz) + }else if(outform[o] == "png"){ + png(filename=fichier,width=size$width*depth,height=size$height*depth + ,pointsize=ptsz,res=depth) + }else if(outform[o] == "eps"){ + postscript(file=fichier,width=size$width,height=size$height + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE,width=size$width,height=size$height + ,pointsize=ptsz,paper=size$paper) + }#end if + #---------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------# + # Split the window into several smaller windows. Add a bottom row to # + # fit the legend. # + #---------------------------------------------------------------------------# + par.orig = par(no.readonly = TRUE) + mar.orig = par.orig$mar + par(oma = c(0.2,3,4,0)) + layout(mat = rbind(1+lo.pft$mat,rep(1,times=lo.pft$ncol)) + ,height = c(rep(5/lo.pft$nrow,times=lo.pft$nrow),1) + )#end layout + #---------------------------------------------------------------------------# + + + + #----- Plot legend. --------------------------------------------------------# + par(mar=c(0.1,0.1,0.1,0.1)) + plot.new() + plot.window(xlim=c(0,1),ylim=c(0,1),xaxt="n",yaxt="n") + legend ( x = "bottom" + , inset = 0.0 + , legend = simul$desc + , fill = simul$colour + , border = "black" + , bg = "white" + , ncol = min(3,pretty.box(n.simul)$ncol) + , title = expression(bold("Simulation")) + , cex = 1.0 + )#end legend + #---------------------------------------------------------------------------# + + + + + #---------------------------------------------------------------------------# + # Loop over all seasons, and plot the bar plots. # + #---------------------------------------------------------------------------# + for (f in 1:n.pft.mp){ + + #----- Find out where is this box going, and set up axes and margins. ---# + left = (f %% lo.pft$ncol) == 1 + right = (f %% lo.pft$ncol) == 0 + top = f <= lo.pft$ncol + bottom = f > (lo.pft$nrow - 1) * lo.pft$ncol + mar.now = c(1 + 3 * bottom,1 + 1 * left,1 + 2 * top,1 + 1 * right) + 0.1 + #------------------------------------------------------------------------# + + + #----- Set up the title for each plot. ----------------------------------# + lesub = paste(pft.desc[pft.mp[f]],sep="") + #------------------------------------------------------------------------# + + + + #----- Create the temporary box plot list. ------------------------------# + ss.this = this[,,f,] + ai = arrayInd(sequence(length(ss.this)),.dim=dim(ss.this)) + bp.plot = split(x=ss.this,f=list(ai[,3],ai[,2])) + #------------------------------------------------------------------------# + + + + #----- Plot window and grid. --------------------------------------------# + par(mar=mar.now) + plot.new() + plot.window(xlim=xlimit,ylim=ylimit,xaxt="n",yaxt="n") + if (bottom) axis(side=1,at=xat,labels=dbh.key) + if (left ) axis(side=2) + box() + title(main=lesub) + if (plotgrid) abline(v=xgrid,h=axTicks(2),col="grey40",lty="solid") + + #----- Add the box plot, without the x axis. ----------------------------# + boxplot(x=bp.plot,col=bp.colour,notch=notch,add=TRUE,show.names=FALSE + ,yaxt="n") + #------------------------------------------------------------------------# + }#end for (f in 1:n.pft.mp) + #---------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------# + # Plot the global title. # + #---------------------------------------------------------------------------# + par(las=0) + mtext(text=lex ,side=1,outer=TRUE,adj=mtext.xadj,padj=mtext.xoff) + mtext(text=ley ,side=2,outer=TRUE,adj=mtext.yadj,padj=mtext.yoff) + mtext(text=letitre,side=3,outer=TRUE,cex=1.1,font=2) + #---------------------------------------------------------------------------# + + + + #----- Close the device. ---------------------------------------------------# + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + #---------------------------------------------------------------------------# + }#end for (o in 1:nout) + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + }#end for (e in 1:n.season) + #---------------------------------------------------------------------------------# + }#end if (var.plt && is.dbh) + #------------------------------------------------------------------------------------# + }#end for + #=======================================================================================# + #=======================================================================================# + + + + + + + + + #=======================================================================================# + #=======================================================================================# + # Plot the bar plots. # + #---------------------------------------------------------------------------------------# + cat (" - Plotting the bar plots...","\n") + for (v in 1:nscen.barplot){ + #----- Copy variable info. ----------------------------------------------------------# + var.vname = scen.barplot$vname [v] + var.desc = scen.barplot$desc [v] + var.unit = scen.barplot$unit [v] + is.pft = scen.barplot$pftvar[v] + is.dbh = scen.barplot$dbhvar[v] + var.plog = scen.barplot$plog [v] + var.plt = scen.barplot$plt [v] + if (var.plog){ + var.xylog = "y" + }else{ + var.xylog = "" + }#end if + #------------------------------------------------------------------------------------# + + + if (var.plt){ + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + # Plot the bar plot by PFT, DBH class, and season. # + #---------------------------------------------------------------------------------# + cat (" - ",var.desc,"...","\n") + #---------------------------------------------------------------------------------# + + + #----- Load variable and set y axis. ---------------------------------------------# + this.5d = eft[[var.vname]]$tspftdbh[,1:n.season.mp,,pft.bp,] + this = apply(X=this.5d,MARGIN=c(2,3,4,5),FUN=mean,na.rm=TRUE) + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Stack the PFT data. # + #---------------------------------------------------------------------------------# + this = apply(X=this,MARGIN=c(1,2,4),FUN=cumsum) + this = aperm(a=this,perm=c(4,3,1,2)) + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Combine simulation and size into one dimension. # + #---------------------------------------------------------------------------------# + dth = dim(this) + dnth = list( paste(rep(dimnames(this)[[1]],times=dth[2]) + ,rep(dimnames(this)[[2]],each =dth[1]) + ,sep=".") + , dimnames(this)[[3]] + , dimnames(this)[[4]] + )#end list + this = array(data= this,dim=c(dth[1]*dth[2],dth[3],dth[4]),dimnames=dnth) + #---------------------------------------------------------------------------------# + + + #----- Set the title. ------------------------------------------------------------# + letitre = paste(var.desc," (Seasonal means) - ",longname,sep="") + lex = paste("DBH class [cm]") + ley = paste(var.desc," [",var.unit,"]",sep=" ") + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Find the x dimensions. # + #---------------------------------------------------------------------------------# + xleft = ( rep(sequence(n.simul),times=n.dbh) + + rep((n.simul+1)*(sequence(n.dbh)-1),each=n.simul) ) - 0.9 + xright = xleft + 0.8 + xat = seq(from=0.5*n.simul,by=n.simul+1,length.out=n.dbh) + xgrid = seq(from=0,by=n.dbh,length.out=n.simul+2)-0.5 + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Find out the colour filling. # + #---------------------------------------------------------------------------------# + fill.col = array( data = rep(pft.colour[pft.bp],each=dim(this)[1]) + , dim = dim(this)[1:2] + , dimnames = dimnames(this)[1:2] + )#end array + border.col = array( data = rep(simul$colour,times=dim(this)[2]) + , dim = dim(this)[1:2] + , dimnames = dimnames(this)[1:2] + )#end array + xleft = array( data = xleft + , dim = dim(this)[1:2] + , dimnames = dimnames(this)[1:2] + )#end array + xright = array( data = xright + , dim = dim(this)[1:2] + , dimnames = dimnames(this)[1:2] + )#end array + ybottom = this; ybottom[,-1,] = ybottom[,-dim(ybottom)[2],]; ybottom[,1,] = 0 + ytop = this + #---------------------------------------------------------------------------------# + + + + + #----- Find the limits for the plot. ---------------------------------------------# + xlimit = range(c(xat,xgrid)) + ylimit = pretty.xylim(u=this,fracexp=0.0,is.log=var.plog) + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Loop over all formats. # + #---------------------------------------------------------------------------------# + for (o in 1:nout){ + #----- Open file or display. --------------------------------------------------# + fichier = paste(out.barplot.season[v],"/",var.vname,"-",iata + ,"-barplot_season.",outform[o],sep="") + if (outform[o] == "x11"){ + X11(width=size$width,height=size$height,pointsize=ptsz) + }else if(outform[o] == "png"){ + png(filename=fichier,width=size$width*depth,height=size$height*depth + ,pointsize=ptsz,res=depth) + }else if(outform[o] == "eps"){ + postscript(file=fichier,width=size$width,height=size$height,pointsize=ptsz + ,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE,width=size$width,height=size$height + ,pointsize=ptsz,paper=size$paper) + }#end if + #------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------# + # Split the window into several smaller windows. Add a bottom row to fit # + # the legend. # + #------------------------------------------------------------------------------# + par.orig = par(no.readonly = TRUE) + mar.orig = par.orig$mar + par(oma = c(0.2,3,4,0)) + + emat = matrix( data = c( rep(2+t(lo.season$mat),each=2) + , rep(1,times=lo.season$ncol) + , rep(2,times=lo.season$ncol) + )#end c + , ncol = 2*lo.season$ncol + , nrow = 1+lo.season$nrow + , byrow = TRUE + )#end matrix + + layout(mat = emat + ,heights = c(rep(5/lo.season$nrow,times=lo.season$nrow),1) + )#end layout + #------------------------------------------------------------------------------# + + + + #----- Plot simulation legend. ------------------------------------------------# + par(mar=c(0.1,0.1,0.1,0.1)) + plot.new() + plot.window(xlim=c(0,1),ylim=c(0,1),xaxt="n",yaxt="n") + legend ( x = "bottom" + , inset = 0.0 + , legend = simul$desc + , fill = simul$colour + , bg = "white" + , ncol = min(3,pretty.box(n.simul)$ncol) + , title = expression(bold("Simulation")) + , cex = 1.0 + )#end legend + #------------------------------------------------------------------------------# + + + + #----- Plot PFT legend. -------------------------------------------------------# + par(mar=c(0.1,0.1,0.1,0.1)) + plot.new() + plot.window(xlim=c(0,1),ylim=c(0,1),xaxt="n",yaxt="n") + legend ( x = "bottom" + , inset = 0.0 + , legend = pft.desc [pft.bp] + , fill = pft.colour[pft.bp] + , border = "black" + , bg = "white" + , ncol = min(3,pretty.box(n.pft.bp)$ncol) + , title = expression(bold("Plant Functional Type")) + , cex = 1.0 + )#end legend + #------------------------------------------------------------------------------# + + + + + #------------------------------------------------------------------------------# + # Loop over all seasons, and plot the bar plots. # + #------------------------------------------------------------------------------# + for (e in 1:n.season.mp){ + + #----- Find out where is this box going, and set up axes and margins. ------# + left = (e %% lo.season$ncol) == 1 + right = (e %% lo.season$ncol) == 0 + top = e <= lo.season$ncol + bottom = e > (lo.season$nrow - 1) * lo.season$ncol + mar.now = c(1 + 3 * bottom,1 + 1 * left,1 + 2 * top,1 + 1 * right) + 0.1 + #---------------------------------------------------------------------------# + + + #----- Set up the title for each plot. -------------------------------------# + lesub = paste(season.desc[e],sep="") + #---------------------------------------------------------------------------# + + + + #----- Plot window and grid. -----------------------------------------------# + par(mar=mar.now) + plot.new() + plot.window(xlim=xlimit,ylim=ylimit,xaxt="n",yaxt="n") + if (bottom) axis(side=1,at=xat,labels=dbh.key) + if (left ) axis(side=2) + box() + title(main=lesub) + if (plotgrid) abline(v=xgrid,h=axTicks(2),col="grey40",lty="solid") + + #----- Add the bar plot using rect, so we can change the line width. -------# + rect( xleft = xleft + , ybottom = ybottom [,,e] + , xright = xright + , ytop = ytop [,,e] + , density = -1 + , col = fill.col + , border = border.col + , lwd = barplot.lwd + )#end rect + #---------------------------------------------------------------------------# + }#end for (e in 1:n.season.mp) + #------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------# + # Plot the global title. # + #------------------------------------------------------------------------------# + par(las=0) + mtext(text=lex ,side=1,outer=TRUE,adj=mtext.xadj,padj=mtext.xoff) + mtext(text=ley ,side=2,outer=TRUE,adj=mtext.yadj,padj=mtext.yoff) + mtext(text=letitre,side=3,outer=TRUE,cex=1.1,font=2) + #------------------------------------------------------------------------------# + + + + #----- Close the device. ------------------------------------------------------# + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + #------------------------------------------------------------------------------# + }#end for (o in 1:nout) + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + + + + + + + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + # Plot the bar plot by PFT, DBH class, using annual means. # + #---------------------------------------------------------------------------------# + + + #----- Load variable and set y axis. ---------------------------------------------# + this.4d = eft[[var.vname]]$tspftdbh[,n.season,,pft.bp,] + this = apply(X=this.4d,MARGIN=c(2,3,4),FUN=mean,na.rm=TRUE) + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Stack the PFT data. # + #---------------------------------------------------------------------------------# + this = apply(X=this,MARGIN=c(1,3),FUN=cumsum) + this = aperm(a=this,perm=c(3,2,1)) + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Combine simulation and size into one dimension. # + #---------------------------------------------------------------------------------# + dth = dim(this) + dnth = list( paste(rep(dimnames(this)[[1]],times=dth[2]) + ,rep(dimnames(this)[[2]],each =dth[1]) + ,sep=".") + , dimnames(this)[[3]] + )#end list + this = array(data= this,dim=c(dth[1]*dth[2],dth[3]),dimnames=dnth) + #---------------------------------------------------------------------------------# + + + #----- Set the title. ------------------------------------------------------------# + letitre = paste(var.desc," (Annual means) - ",longname,sep="") + lex = paste("DBH class [cm]") + ley = paste(var.desc," [",var.unit,"]",sep=" ") + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Find the x dimensions. # + #---------------------------------------------------------------------------------# + xleft = ( rep(sequence(n.simul),times=n.dbh) + + rep((n.simul+1)*(sequence(n.dbh)-1),each=n.simul) ) - 0.9 + xright = xleft + 0.8 + xat = seq(from=0.5*n.simul,by=n.simul+1,length.out=n.dbh) + xgrid = seq(from=0,by=n.dbh,length.out=n.simul+2)-0.5 + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Find out the colour filling. # + #---------------------------------------------------------------------------------# + fill.col = array( data = rep(pft.colour[pft.bp],each=dim(this)[1]) + , dim = dim(this)[1:2] + , dimnames = dimnames(this)[1:2] + )#end array + border.col = array( data = rep(simul$colour,times=dim(this)[2]) + , dim = dim(this)[1:2] + , dimnames = dimnames(this)[1:2] + )#end array + xleft = array( data = xleft + , dim = dim(this)[1:2] + , dimnames = dimnames(this)[1:2] + )#end array + xright = array( data = xright + , dim = dim(this)[1:2] + , dimnames = dimnames(this)[1:2] + )#end array + ybottom = this; ybottom[,-1] = ybottom[,-dim(ybottom)[2]]; ybottom[,1] = 0 + ytop = this + #---------------------------------------------------------------------------------# + + + + + #----- Find the limits for the plot. ---------------------------------------------# + xlimit = range(c(xat,xgrid)) + ylimit = pretty.xylim(u=this,fracexp=0.0,is.log=var.plog) + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Loop over all formats. # + #---------------------------------------------------------------------------------# + for (o in 1:nout){ + #----- Open file or display. --------------------------------------------------# + fichier = paste(out.barplot.year[v],"/",var.vname,"-",iata + ,"-barplot_year.",outform[o],sep="") + if (outform[o] == "x11"){ + X11(width=size$width,height=size$height,pointsize=ptsz) + }else if(outform[o] == "png"){ + png(filename=fichier,width=size$width*depth,height=size$height*depth + ,pointsize=ptsz,res=depth) + }else if(outform[o] == "eps"){ + postscript(file=fichier,width=size$width,height=size$height,pointsize=ptsz + ,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE,width=size$width,height=size$height + ,pointsize=ptsz,paper=size$paper) + }#end if + #------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------# + # Split the window into several smaller windows. Add a bottom row to fit # + # the legend. # + #------------------------------------------------------------------------------# + par.orig = par(no.readonly = TRUE) + emat = matrix(c(3,3,1,2),ncol=2,nrow=2,byrow=T) + layout(mat=emat,heights=c(5,1)) + #------------------------------------------------------------------------------# + + + + #----- Plot simulation legend. ------------------------------------------------# + par(mar=c(0.1,0.1,0.1,0.1)) + plot.new() + plot.window(xlim=c(0,1),ylim=c(0,1),xaxt="n",yaxt="n") + legend ( x = "bottom" + , inset = 0.0 + , legend = simul$desc + , fill = simul$colour + , bg = "white" + , ncol = min(3,pretty.box(n.simul)$ncol) + , title = expression(bold("Simulation")) + , cex = 1.0 + )#end legend + #------------------------------------------------------------------------------# + + + + #----- Plot PFT legend. -------------------------------------------------------# + par(mar=c(0.1,0.1,0.1,0.1)) + plot.new() + plot.window(xlim=c(0,1),ylim=c(0,1),xaxt="n",yaxt="n") + legend ( x = "bottom" + , inset = 0.0 + , legend = pft.desc [pft.bp] + , fill = pft.colour[pft.bp] + , border = "black" + , bg = "white" + , ncol = min(3,pretty.box(n.pft.bp)$ncol) + , title = expression(bold("Plant Functional Type")) + , cex = 1.0 + )#end legend + #------------------------------------------------------------------------------# + + + + + #----- Plot window and grid. --------------------------------------------------# + par(mar=mar.orig) + plot.new() + plot.window(xlim=xlimit,ylim=ylimit,xaxt="n",yaxt="n") + axis(side=1,at=xat,labels=dbh.key) + axis(side=2) + box() + title(main=letitre,xlab=lex,ylab=ley) + if (plotgrid) abline(v=xgrid,h=axTicks(2),col="grey40",lty="solid") + #------------------------------------------------------------------------------# + + + + #----- Add the bar plot using rect, so we can change the line width. ----------# + rect( xleft = xleft + , ybottom = ybottom + , xright = xright + , ytop = ytop + , density = -1 + , col = fill.col + , border = border.col + , lwd = 2.5 + )#end rect + #------------------------------------------------------------------------------# + + + + #----- Close the device. ------------------------------------------------------# + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + #------------------------------------------------------------------------------# + }#end for (o in 1:nout) + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + }#end if (var.plt) + #------------------------------------------------------------------------------------# + }#end for (v in 1:nscen.barplot) + #=======================================================================================# + #=======================================================================================# + + + + + + #=======================================================================================# + #=======================================================================================# + # Plot the parameter space. # + #---------------------------------------------------------------------------------------# + cat (" - Plotting the parameter space...","\n") + #---------------------------------------------------------------------------------------# + # Loop over Y variables. # + #---------------------------------------------------------------------------------------# + for (y in 1:nscen.yvar){ + y.vname = scen.xyz$yvar$vname[y] + y.desc = scen.xyz$yvar$desc [y] + y.unit = scen.xyz$yvar$unit [y] + y.plog = scen.xyz$yvar$plog [y] + y.leg = scen.xyz$yvar$leg [y] + y.ts = eft[[y.vname]]$ts [,season.mp,] + y.tspft = eft[[y.vname]]$tspft[,n.season,pft.mp,] + + + #----- Create indices to split the arrays into lists. -------------------------------# + ai.ts = arrayInd(sequence(length(y.ts )),.dim=dim(y.ts )) + ai.tspft = arrayInd(sequence(length(y.tspft)),.dim=dim(y.tspft)) + #------------------------------------------------------------------------------------# + + + + #----- Find the format of the points for the plots. ---------------------------------# + pch.ts = array( data = simul$pch[arrayInd(1:length(y.ts ),.dim=dim(y.ts ))[,3]] + , dim = dim(y.ts) + )#end array + pch.tspft = array( data = simul$pch[arrayInd(1:length(y.tspft),.dim=dim(y.tspft))[,3]] + , dim = dim(y.tspft) + )#end array + #------------------------------------------------------------------------------------# + + + + + cat(" * ",y.desc,"\n") + #------------------------------------------------------------------------------------# + # Loop over X variables. # + #------------------------------------------------------------------------------------# + for (x in 1:nscen.xvar){ + x.vname = scen.xyz$xvar$vname[x] + x.desc = scen.xyz$xvar$desc [x] + x.unit = scen.xyz$xvar$unit [x] + x.plog = scen.xyz$xvar$plog [x] + x.leg = scen.xyz$xvar$leg [x] + x.ts = eft[[x.vname]]$ts [,season.mp,] + x.tspft = eft[[x.vname]]$tspft[,n.season,pft.mp,] + #---------------------------------------------------------------------------------# + + + #----- Build the log info. -------------------------------------------------------# + xy.plog="" + if (x.plog) xy.plog=paste(xy.plog,"x",sep="") + if (y.plog) xy.plog=paste(xy.plog,"y",sep="") + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Loop over Z variables. # + #---------------------------------------------------------------------------------# + for (z in 1:nscen.zvar){ + z.vname = scen.xyz$zvar$vname [z] + z.desc = scen.xyz$zvar$desc [z] + z.unit = scen.xyz$zvar$unit [z] + z.plog = scen.xyz$zvar$plog [z] + z.pft = scen.xyz$zvar$pftvar [z] + z.cscheme = get(scen.xyz$zvar$col.scheme[z]) + z.ts = eft[[z.vname]]$ts [,season.mp,] + if (z.pft){ + z.tspft = eft[[z.vname]]$tspft[,n.season,pft.mp,] + }else{ + z.tspft = array(NA,dim=dim(y.tspft),dimnames=dimnames(y.tspft)) + for (f in 1:n.pft.mp){ + z.tspft[,f,] = eft[[z.vname]]$ts [,n.season,] + }#end z.tspft + }#end + + cat(" ~ X = ",x.desc," Z = ",z.desc,"\n") + + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + # Split the arrays into lists. # + #------------------------------------------------------------------------------# + x.list = split(x=x.ts ,f=ai.ts[,2]) + y.list = split(x=y.ts ,f=ai.ts[,2]) + z.list = split(x=z.ts ,f=ai.ts[,2]) + pch.list = split(x=pch.ts,f=ai.ts[,2]) + #------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------# + # Fix the titles. # + #------------------------------------------------------------------------------# + letitre = paste("Seasonal means - ",z.desc,"\n",longname,sep="") + lex = paste(x.desc," [",x.unit,"]",sep="") + ley = paste(y.desc," [",y.unit,"]",sep="") + lacle = paste("[",z.unit,"]",sep="") + #------------------------------------------------------------------------------# + + + + + #------------------------------------------------------------------------------# + # Plot the parameter space by season. # + #------------------------------------------------------------------------------# + for (o in 1:nout){ + #----- Open file or display. -----------------------------------------------# + fichier = paste(out.xyz.season[y],"/y-",y.vname,"_x-",x.vname,"_z-",z.vname + ,"-",iata,"-season.",outform[o],sep="") + if (outform[o] == "x11"){ + X11(width=size$width,height=size$height,pointsize=ptsz) + }else if(outform[o] == "png"){ + png(filename=fichier,width=size$width*depth,height=size$height*depth + ,pointsize=ptsz,res=depth) + }else if(outform[o] == "eps"){ + postscript(file=fichier,width=size$width,height=size$height + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE,width=size$width,height=size$height + ,pointsize=ptsz,paper=size$paper) + }#end if + #---------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------# + # Plot the boxes. # + #---------------------------------------------------------------------------# + xyz.plot( x = x.list + , y = y.list + , z = z.list + , fixed.xlim = TRUE + , fixed.ylim = TRUE + , xy.log = xy.plog + , pch = pch.list + , cex = 1.2 + , nlevels = xyz.ncolour + , colour.palette = z.cscheme + , xyz.main = list(text=letitre) + , xyz.sub = season.mp.desc + , xyz.xlab = list(text=lex,adj=mtext.xadj,padj=mtext.xoff) + , xyz.ylab = list(text=ley,adj=mtext.yadj,padj=mtext.yoff) + , xyz.more = list(grid=list(col="grey83",lty="solid")) + , key.log = z.plog + , key.title = list(main=lacle,cex.main=0.8) + , xyz.legend = list( x = "bottom" + , inset = 0.0 + , legend = simul$desc + , pch = simul$pch + , col = "grey16" + , border = "black" + , bg = "white" + , ncol = min(3,pretty.box(n.simul)$ncol) + , title = expression(bold("Simulation")) + , cex = 1.0 + )#end legend + )#end xyz.plot + #---------------------------------------------------------------------------# + + + + #----- Close the device. ---------------------------------------------------# + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + #---------------------------------------------------------------------------# + }#end for + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + + + + + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + # Split the arrays into lists. # + #------------------------------------------------------------------------------# + x.list = split(x=x.tspft ,f=ai.tspft[,2]) + y.list = split(x=y.tspft ,f=ai.tspft[,2]) + z.list = split(x=z.tspft ,f=ai.tspft[,2]) + pch.list = split(x=pch.tspft,f=ai.tspft[,2]) + #------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------# + # Fix the titles. # + #------------------------------------------------------------------------------# + letitre = paste("Seasonal means - ",z.desc,"\n",longname,sep="") + lex = paste(x.desc," [",x.unit,"]",sep="") + ley = paste(y.desc," [",y.unit,"]",sep="") + lacle = paste("[",z.unit,"]",sep="") + #------------------------------------------------------------------------------# + + + + + #------------------------------------------------------------------------------# + # Plot the parameter space by season. # + #------------------------------------------------------------------------------# + for (o in 1:nout){ + #----- Open file or display. -----------------------------------------------# + fichier = paste(out.xyz.pft[y],"/y-",y.vname,"_x-",x.vname,"_z-",z.vname + ,"-",iata,"-pft.",outform[o],sep="") + if (outform[o] == "x11"){ + X11(width=size$width,height=size$height,pointsize=ptsz) + }else if(outform[o] == "png"){ + png(filename=fichier,width=size$width*depth,height=size$height*depth + ,pointsize=ptsz,res=depth) + }else if(outform[o] == "eps"){ + postscript(file=fichier,width=size$width,height=size$height + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE,width=size$width,height=size$height + ,pointsize=ptsz,paper=size$paper) + }#end if + #---------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------# + # Plot the boxes. # + #---------------------------------------------------------------------------# + xyz.plot( x = x.list + , y = y.list + , z = z.list + , fixed.xlim = FALSE + , fixed.ylim = TRUE + , xy.log = xy.plog + , pch = pch.list + , cex = 1.2 + , nlevels = xyz.ncolour + , colour.palette = z.cscheme + , xyz.main = list(text=letitre) + , xyz.sub = pft.desc[pft.mp] + , xyz.xlab = list(text=lex,adj=mtext.xadj,padj=mtext.xoff) + , xyz.ylab = list(text=ley,adj=mtext.yadj,padj=mtext.yoff) + , xyz.more = list(grid=list(col="grey83",lty="solid")) + , key.log = z.plog + , key.title = list(main=lacle,cex.main=0.8) + , xyz.legend = list( x = "bottom" + , inset = 0.0 + , legend = simul$desc + , pch = simul$pch + , col = "grey16" + , border = "black" + , bg = "white" + , ncol = min(3,pretty.box(n.simul)$ncol) + , title = expression(bold("Simulation")) + , cex = 1.0 + )#end legend + )#end xyz.plot + #---------------------------------------------------------------------------# + + + + #----- Close the device. ---------------------------------------------------# + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + #---------------------------------------------------------------------------# + }#end for + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + + + + }#end for + #---------------------------------------------------------------------------------# + }#end for + #------------------------------------------------------------------------------------# + }#end for + #=======================================================================================# + #=======================================================================================# + +}#end for (p in 1:n.sites) +#------------------------------------------------------------------------------------------# + + diff --git a/ED/Template/epost.sh b/ED/Template/epost.sh index 167a53f57..45e0ef2c1 100755 --- a/ED/Template/epost.sh +++ b/ED/Template/epost.sh @@ -2,15 +2,18 @@ . ${HOME}/.bashrc here=`pwd` # ! Main path diskthere='/n/moorcroftfs2' # ! Disk where the output files are -thisqueue='moorcroft2b' # ! Queue where jobs should be submitted +thisqueue='moorcroft_6100b' # ! Queue where jobs should be submitted lonlat=${here}'/joborder.txt' # ! File with the job instructions #----- Outroot is the main output directory. ----------------------------------------------# -outroot='/n/moorcroftfs2/mlongo/diary/XXXXXXXXXXX/figures/xxx_XXX/xxxxxxxx' +outroot='/n/moorcroftfs2/mlongo/diary/final_ed/biophysics/figures/short_term/size+diversity+canturb' submit='y' # y = Submit the script; n = Copy the script #----- Plot only one meteorological cycle. ------------------------------------------------# -onemetcycle='n' # Plot only one met cycle only (ignored by plot_eval_ed.r/plot_census.r) -shiftiata='' # Places that we must shift the cycle -shiftcycle=-5 # In case your met driver doesn't match the model simulation +useperiod='t' # Which bounds should I use? (Ignored by plot_eval_ed.r) + # 'a' -- All period + # 't' -- One eddy flux tower met cycle + # 'u' -- User defined period, defined by the variables below. +yusera=1972 # First year to use +yuserz=2011 # Last year to use #----- Check whether to use openlava or typical job submission. ---------------------------# openlava='n' #----- Yearly comparison . ----------------------------------------------------------------# @@ -27,8 +30,46 @@ outform='c("eps","png","pdf")' # x11 - On screen (deprecated on shell scripts) # png - Portable Network Graphics # eps - Encapsulated Post Script # pdf - Portable Document Format +#----- DBH classes. -----------------------------------------------------------------------# +idbhtype=2 # Type of DBH class + # 1 -- Every 10 cm until 100cm; > 100cm + # 2 -- 0-10; 10-20; 20-35; 35-50; 50-70; > 70 (cm) #------------------------------------------------------------------------------------------# + +#------------------------------------------------------------------------------------------# +# Which scripts to run. # +# # +# - plot_monthly.r - This creates several plots based on the monthly mean output. # +# - plot_yearly.r - This creates plots with year time series. # +# - plot_ycomp.r - This creates yearly comparisons based on the monthly mean output. # +# - plot_rk4.r - This creates plots from the detailed output for Runge-Kutta. # +# (patch-level only). # +# - plot_photo.r - This creates plots from the detailed output for Farquhar-Leuning. # +# - plot_rk4pc.r - This creates plots from the detailed output for Runge-Kutta. # +# (patch- and cohort-level). # +# - plot_budget.r - This creates plots from the detailed budget for Runge-Kutta. # +# (patch-level only). # +# - plot_eval_ed.r - This creates plots comparing model with eddy flux observations. # +# - plot_census.r - This creates plots comparing model with biometric data. # +# # +# The following scripts should work too, but I haven't tested them. # +# - plot_daily.r - This creates plots from the daily mean output. # +# - plot_fast.r - This creates plots from the analysis files. # +# - patchprops.r - This creates simple plots showing the patch structure. # +# - reject_ed.r - This tracks the number of steps that were rejected, and what caused # +# the step to be rejected. # +#------------------------------------------------------------------------------------------# +rscripts="plot_yearly.r" +#rscripts="plot_monthly.r" +#rscripts="plot_census.r" +#rscripts="plot_ycomp.r" +#rscripts="plot_eval_ed.r" +#------------------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------------------# # Tell whether to plot pseudo-drought or not. # #------------------------------------------------------------------------------------------# @@ -113,33 +154,9 @@ echo 'Number of polygons: '${npolys}'...' -#------------------------------------------------------------------------------------------# -# List all the R scripts you want to run. # -# - plot_yearly.r - This creates yearly comparisons based on the monthly mean output. # -# - plot_monthly.r - This creates several plots based on the monthly mean output. # -# - plot_rk4.r - This creates plots from the detailed output for Runge-Kutta. # -# (patch-level only). # -# - plot_photo.r - This creates plots from the detailed output for Farquhar-Leuning. # -# - plot_rk4pc.r - This creates plots from the detailed output for Runge-Kutta. # -# (patch- and cohort-level). # -# - plot_budget.r - This creates plots from the detailed budget for Runge-Kutta. # -# (patch-level only). # -# - plot_eval_ed.r - This creates plots comparing model with eddy flux observations. # -# - plot_census.r - This creates plots comparing model with biometric data. # -# # -# The following scripts should work too, but I haven't tested them. # -# - plot_daily.r - This creates plots from the daily mean output. # -# - plot_fast.r - This creates plots from the analysis files. # -# - patchprops.r - This creates simple plots showing the patch structure. # -# - reject_ed.r - This tracks the number of steps that were rejected, and what caused # -# the step to be rejected. # -#------------------------------------------------------------------------------------------# -rscripts="plot_census.r" # plot_monthly.r plot_yearly.r" -#rscripts="patchprops.r plot_photo.r" -#rscripts="patchprops.r" #------------------------------------------------------------------------------------------# -# Loop over all polygons. # +# Loop over all polygons. # #------------------------------------------------------------------------------------------# ff=0 while [ ${ff} -lt ${npolys} ] @@ -261,53 +278,72 @@ do metcycz=`grep -i NL%METCYCF ${here}/${polyname}/ED2IN | awk '{print $3}'` #---------------------------------------------------------------------------------------# + + #---- Find the forest inventory cycle. -------------------------------------------------# + case ${polyiata} in + gyf|s67) + biocyca=2004 + biocycz=2009 + subcens=1 + ;; + s67) + biocyca=2001 + biocycz=2011 + subcens=1 + ;; + *) + biocyca=${metcyca} + biocycz=${metcycz} + subcens=0 + ;; + esac + #---------------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------------# + # Switch years in case this is a specific drought run. # + #---------------------------------------------------------------------------------------# if [ ${droughtmark} == "TRUE" ] then let yeara=${droughtyeara}-1 let yearz=${droughtyearz}+1 fi + #---------------------------------------------------------------------------------------# + + #---------------------------------------------------------------------------------------# + # Loop over all scripts. # + #---------------------------------------------------------------------------------------# for script in ${rscripts} do - if [ 'x'${submit} == 'xy' ] || [ 'x'${submit} == 'xY' ] + #----- Print a banner. --------------------------------------------------------------# + if [ ${script} == 'plot_census.r' ] && [ ${subcens} -eq 0 ] + then + "Skipping submission of ${script} for polygon: ${polyname}..." + elif [ 'x'${submit} == 'xy' ] || [ 'x'${submit} == 'xY' ] then echo "Submitting script ${script} for polygon: ${polyname}..." else echo "Copying script ${script} to polygon: ${polyname}..." fi + #------------------------------------------------------------------------------------# + + + #------------------------------------------------------------------------------------# + # Set up the time and output variables according to the script. # + #------------------------------------------------------------------------------------# case ${script} in - plot_yearly.r) - if [ ${metdriver} != 'Sheffield' ] - then - thisyeara=${metcyca} - thisyearz=${metcycz} - for i in ${shiftiata} - do - if [ 'x'${i} == 'x'${polyiata} ] - then - echo ' -> Shifting met cycle' - let metcycle=${metcycz}-${metcyca}+1 - let deltayr=${shiftcycle}*${metcycle} - let thisyeara=${metcyca}+${deltayr} - let thisyearz=${metcycz}+${deltayr} - fi # end [ ${i} == ${iata} ] - done #end for i in ${shiftiata} - else - thisyeara=${metcyca} - thisyearz=${metcycz} - fi # end [ ${metdriver} != 'Sheffield' ] - thismontha=${montha} - thismonthz=${monthz} - thisdatea=${datea} - epostout='pyrs_epost.out' - epostsh='pyrs_epost.sh' - epostlsf='pyrs_epost.lsf' - epostjob='eb-pyrs-'${polyname} - ;; - plot_monthly.r) - if [ ${onemetcycle} == 'y' ] + plot_monthly.r|plot_yearly.r|plot_ycomp.r|plot_census.r) + #---------------------------------------------------------------------------------# + # Scripts that are based on monthly means. The set up is the same, the only # + # difference is in the output names. # + #---------------------------------------------------------------------------------# + #------ Check which period to use. -----------------------------------------------# + if [ ${useperiod} == 't' ] then + #------ One meteorological cycle. Check the type of meteorological driver. ---# if [ ${metdriver} != 'Sheffield' ] then thisyeara=${metcyca} @@ -327,162 +363,302 @@ do thisyeara=${metcyca} thisyearz=${metcycz} fi # end [ ${metdriver} != 'Sheffield' ] - else - let thisyeara=${yeara}+0 + #------------------------------------------------------------------------------# + + elif [ ${useperiod} == 'u' ] + then + #----- The user said which period to use. -------------------------------------# + thisyeara=${yusera} + thisyearz=${yuserz} + #------------------------------------------------------------------------------# + else + #----- Grab all years that the simulation is supposed to run. -----------------# + thisyeara=${yeara} thisyearz=${yearz} - fi # end [ ${onemetcycle} == 'y' ] + #------------------------------------------------------------------------------# + fi # end [ ${useperiod} == 't' ] + #---------------------------------------------------------------------------------# + + + + #----- Set up months and days. ---------------------------------------------------# thismontha=${montha} thismonthz=${monthz} thisdatea=${datea} - epostout='pmon_epost.out' - epostsh='pmon_epost.sh' - epostlsf='pmon_epost.lsf' - epostjob='eb-pmon-'${polyname} + #---------------------------------------------------------------------------------# + + + #---------------------------------------------------------------------------------# + # Define the job name, and the names of the output files. # + #---------------------------------------------------------------------------------# + case ${script} in + plot_monthly.r) + epostout='pmon_epost.out' + epostsh='pmon_epost.sh' + epostlsf='pmon_epost.lsf' + epostjob='eb-pmon-'${polyname} + ;; + plot_yearly.r) + epostout='pyrs_epost.out' + epostsh='pyrs_epost.sh' + epostlsf='pyrs_epost.lsf' + epostjob='eb-pyrs-'${polyname} + ;; + plot_ycomp.r) + epostout='pycp_epost.out' + epostsh='pycp_epost.sh' + epostlsf='pycp_epost.lsf' + epostjob='eb-pycp-'${polyname} + ;; + plot_census.r) + epostout='pcen_epost.out' + epostsh='pcen_epost.sh' + epostlsf='pcen_epost.lsf' + epostjob='eb-pcen-'${polyname} + ;; + esac + #---------------------------------------------------------------------------------# ;; + + plot_eval_ed.r) - if [ ${metdriver} != 'Sheffield' ] - then - thisyeara=${metcyca} - thisyearz=${metcycz} - for i in ${shiftiata} - do - if [ 'x'${i} == 'x'${polyiata} ] - then - echo ' -> Shifting met cycle' - let metcycle=${metcycz}-${metcyca}+1 - let deltayr=${shiftcycle}*${metcycle} - let thisyeara=${metcyca}+${deltayr} - let thisyearz=${metcycz}+${deltayr} - fi # end [ ${i} == ${iata} ] - done #end for i in ${shiftiata} + #---------------------------------------------------------------------------------# + # Cheat by changing metcyca and metcycz in case the meteorological driver is # + # Petrolina (output variables exist only for 2004, so we don't need to process # + # all years). # + #---------------------------------------------------------------------------------# + if [ ${metdriver} == "Petrolina" ] + then + thismetcyca=2004 + thismetcycz=2004 else - thisyeara=${metcyca} - thisyearz=${metcycz} - fi # end [ ${metdriver} != 'Sheffield' ] + thismetcyca=${metcyca} + thismetcycz=${metcycz} + fi + #---------------------------------------------------------------------------------# + + + #---------------------------------------------------------------------------------# + # The period should be equivalent to one meteorological driver period, so we # + # compare apples to apples. The ED2 years don't need to match as long as we pick # + # one cycle. # + #---------------------------------------------------------------------------------# + thisyeara=${thismetcyca} + thisyearz=${thismetcycz} + for i in ${shiftiata} + do + if [ 'x'${i} == 'x'${polyiata} ] + then + #----- Always use the true met driver to find the cycle shift. -------------# + echo ' -> Shifting met cycle' + let metcycle=${metcycz}-${metcyca}+1 + let deltayr=${shiftcycle}*${metcycle} + let thisyeara=${thismetcyca}+${deltayr} + let thisyearz=${thismetcycz}+${deltayr} + #---------------------------------------------------------------------------# + fi # end [ ${i} == ${iata} ] + done #end for i in ${shiftiata} + #---------------------------------------------------------------------------------# + + + + #----- Set up months and days. ---------------------------------------------------# thismontha=1 thismonthz=12 thisdatea=${datea} + #---------------------------------------------------------------------------------# + + + #----- Define the job name, and the names of the output files. -------------------# epostout='peed_epost.out' epostsh='peed_epost.sh' epostlsf='peed_epost.lsf' epostjob='eb-peed-'${polyname} - ;; - plot_census.r) - thismontha=${montha} - thismontha=${monthz} - let thisyeara=${yeara}+15 - thisyearz=${yearz} + #---------------------------------------------------------------------------------# - thisdatea=${datea} - epostout='pcen_epost.out' - epostsh='pcen_epost.sh' - epostlsf='pcen_epost.lsf' - epostjob='eb-pcen-'${polyname} ;; - plot_budget.r) - thisyeara=${yeara} - thisyearz=${yearz} - thismontha=${montha} - thismonthz=${monthz} - let thisdatea=${datea}+1 - epostout='pbdg_epost.out' - epostsh='pbdg_epost.sh' - epostlsf='pbdg_epost.lsf' - epostjob='eb-pbdg-'${polyname} - ;; - plot_rk4.r) - thisyeara=${yeara} - thisyearz=${yearz} - thismontha=${montha} - thismonthz=${monthz} - let thisdatea=${datea}+1 - epostout='prk4_epost.out' - epostsh='prk4_epost.sh' - epostlsf='prk4_epost.lsf' - epostjob='eb-prk4-'${polyname} - ;; - plot_rk4pc.r) - thisyeara=${yeara} - thisyearz=${yearz} - thismontha=${montha} - thismonthz=${monthz} - let thisdatea=${datea}+1 - epostout='prpc_epost.out' - epostsh='prpc_epost.sh' - epostlsf='prpc_epost.lsf' - epostjob='eb-prpc-'${polyname} - ;; - plot_photo.r) - thisyeara=${yeara} - thisyearz=${yearz} + + plot_budget.r|plot_rk4.r|plot_rk4pc.r|plot_photo.r|reject_ed.r) + #---------------------------------------------------------------------------------# + # Scripts with very high frequency output (dtlsm or shorter). The first day # + # usually has initialisation problems (for example incoming longwave may be zero # + # at the first time step), so we normally skip the first day. # + #---------------------------------------------------------------------------------# + #----- Check whether to use the user choice of year or the default. --------------# + if [ ${useperiod} == 'u' ] + then + thisyeara=${yusera} + thisyearz=${yuserz} + else + thisyeara=${yeara} + thisyearz=${yearz} + fi + #---------------------------------------------------------------------------------# + + + + #----- Set up months and days. ---------------------------------------------------# thismontha=${montha} thismonthz=${monthz} let thisdatea=${datea}+1 - epostout='ppht_epost.out' - epostsh='ppht_epost.sh' - epostlsf='ppht_epost.lsf' - epostjob='eb-ppht-'${polyname} + #---------------------------------------------------------------------------------# + + + + #----- Define the job name, and the names of the output files. -------------------# + case ${script} in + plot_budget) + epostout='pbdg_epost.out' + epostsh='pbdg_epost.sh' + epostlsf='pbdg_epost.lsf' + epostjob='eb-pbdg-'${polyname} + ;; + plot_rk4.r) + epostout='prk4_epost.out' + epostsh='prk4_epost.sh' + epostlsf='prk4_epost.lsf' + epostjob='eb-prk4-'${polyname} + ;; + plot_rk4pc.r) + epostout='prpc_epost.out' + epostsh='prpc_epost.sh' + epostlsf='prpc_epost.lsf' + epostjob='eb-prpc-'${polyname} + ;; + plot_photo.r) + epostout='ppht_epost.out' + epostsh='ppht_epost.sh' + epostlsf='ppht_epost.lsf' + epostjob='eb-ppht-'${polyname} + ;; + reject_ed.r) + epostout='prej_epost.out' + epostsh='prej_epost.sh' + epostlsf='prej_epost.lsf' + epostjob='eb-prej-'${polyname} + ;; + esac + #---------------------------------------------------------------------------------# ;; + + patchprops.r) - thisyeara=${yeara} - thisyearz=${yearz} + #---------------------------------------------------------------------------------# + # Script with time-independent patch properties. No need to skip anything. # + #---------------------------------------------------------------------------------# + #----- Check whether to use the user choice of year or the default. --------------# + if [ ${useperiod} == 'u' ] + then + thisyeara=${yusera} + thisyearz=${yuserz} + else + thisyeara=${yeara} + thisyearz=${yearz} + fi + #---------------------------------------------------------------------------------# + + + + #----- Set up months and days. ---------------------------------------------------# thismontha=${montha} thismonthz=${monthz} thisdatea=${datea} + #---------------------------------------------------------------------------------# + + + + #----- Define the job name, and the names of the output files. -------------------# epostout='ppro_epost.out' epostsh='ppro_epost.sh' epostlsf='ppro_epost.lsf' epostjob='eb-ppro-'${polyname} + #---------------------------------------------------------------------------------# ;; plot_daily.r) - thisyeara=${yeara} - thisyearz=${yearz} + #---------------------------------------------------------------------------------# + # Script with daily means. No need to skip anything. # + #---------------------------------------------------------------------------------# + #----- Check whether to use the user choice of year or the default. --------------# + if [ ${useperiod} == 'u' ] + then + thisyeara=${yusera} + thisyearz=${yuserz} + else + thisyeara=${yeara} + thisyearz=${yearz} + fi + #---------------------------------------------------------------------------------# + + + + #----- Set up months and days. ---------------------------------------------------# thismontha=${montha} thismonthz=${monthz} thisdatea=${datea} + #---------------------------------------------------------------------------------# + + + + #----- Define the job name, and the names of the output files. -------------------# epostout='pday_epost.out' epostsh='pday_epost.sh' epostlsf='pday_epost.lsf' epostjob='eb-pday-'${polyname} + #---------------------------------------------------------------------------------# ;; + plot_fast.r) - thisyeara=${yeara} - thisyearz=${yearz} + #---------------------------------------------------------------------------------# + # Script with short-term averages (usually hourly). No need to skip any- # + # thing. # + #---------------------------------------------------------------------------------# + if [ ${useperiod} == 'u' ] + then + thisyeara=${yusera} + thisyearz=${yuserz} + else + thisyeara=${yeara} + thisyearz=${yearz} + fi + #---------------------------------------------------------------------------------# + + + + #----- Set up months and days. ---------------------------------------------------# thismontha=${montha} thismonthz=${monthz} thisdatea=${datea} + #---------------------------------------------------------------------------------# + + + + #----- Define the job name, and the names of the output files. -------------------# epostout='pfst_epost.out' epostsh='pfst_epost.sh' epostlsf='pfst_epost.lsf' epostjob='eb-pfst-'${polyname} - ;; - reject_ed.r) - thisyeara=${yeara} - thisyearz=${yearz} - thismontha=${montha} - thismonthz=${monthz} - thisdatea=${datea} - epostout='prej_epost.out' - epostsh='prej_epost.sh' - epostlsf='prej_epost.lsf' - epostjob='eb-prej-'${polyname} + #---------------------------------------------------------------------------------# + ;; *) - thisyeara=${yeara} - thisyearz=${yearz} - thismontha=${montha} - thismonthz=${monthz} - thisdatea=${datea} - epostout='pidn_epost.out' - epostsh='pidn_epost.sh' - epostlsf='pidn_epost.lsf' - epostjob='eb-pidn-'${polyname} + #---------------------------------------------------------------------------------# + # If the script is here, then it could not find the script... And this should # + # never happen, crash! # + #---------------------------------------------------------------------------------# + echo " Script ${script} is not recognised by epost.sh!" + exit 193 + #---------------------------------------------------------------------------------# ;; esac + #------------------------------------------------------------------------------------# + #----- Copy the R script from the Template folder to the local path. ----------------# cp -f ${here}/Template/${script} ${here}/${polyname} + #------------------------------------------------------------------------------------# + + #----- Switch the keywords by the current settings. ---------------------------------# sed -i s@thispoly@${polyname}@g ${here}/${polyname}/${script} @@ -511,10 +687,19 @@ do sed -i s@mydistrib@${usedistrib}@g ${here}/${polyname}/${script} sed -i s@mymetcyca@${metcyca}@g ${here}/${polyname}/${script} sed -i s@mymetcycz@${metcycz}@g ${here}/${polyname}/${script} + sed -i s@mybiocyca@${biocyca}@g ${here}/${polyname}/${script} + sed -i s@mybiocycz@${biocycz}@g ${here}/${polyname}/${script} + sed -i s@myidbhtype@${idbhtype}@g ${here}/${polyname}/${script} + #------------------------------------------------------------------------------------# + + #----- Run R to get the plots. ------------------------------------------------------# rbin="R CMD BATCH --no-save --no-restore" comm="${rbin} ${here}/${polyname}/${script} ${here}/${polyname}/${epostout}" + #------------------------------------------------------------------------------------# + + #------------------------------------------------------------------------------------# # plot_eval_ed won't run all at once due to the sheer number of HDF5 files. # @@ -542,11 +727,23 @@ do + #----- Make sure this is not the census script for a site we don't have census. -----# + if [ ${script} == "plot_census.r" ] && [ ${subcens} -eq 0 ] + then + submitnow='n' + else + submitnow=${submit} + fi + #------------------------------------------------------------------------------------# + + + #------------------------------------------------------------------------------------# # Submit the job according to the style (LSF or openlava). # #------------------------------------------------------------------------------------# - if [ 'x'${submit} == 'xy' ] || [ 'x'${submit} == 'xY' ] + if [ 'x'${submitnow} == 'xy' ] || [ 'x'${submitnow} == 'xY' ] then + #------ Check whether to use openlava or LSF. ------------------------------------# if [ 'x'${openlava} == 'xy' ] || [ 'x'${openlava} == 'xY' ] then bsub="iobsub -J ${epostjob} -o ${here}/${polyname}/${epostlsf}" @@ -555,6 +752,7 @@ do bsub="bsub -q ${thisqueue} -J ${epostjob} -o ${polyname}/${epostlsf}" bsub="${bsub} ${here}/${polyname}/${epostsh} 1> /dev/null 2> /dev/null" fi + #---------------------------------------------------------------------------------# ${bsub} fi #------------------------------------------------------------------------------------# diff --git a/ED/Template/joborder.txt b/ED/Template/joborder.txt index ebcbb73a8..8b5a4575d 100644 --- a/ED/Template/joborder.txt +++ b/ED/Template/joborder.txt @@ -1,107 +1,107 @@ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- POLYGON_NAME IATA LONGITUDE LATITUDE YEARA MONTHA DAYA TIMEA YEARZ MONTHZ DAYZ TIMEZ INIT_MODE ISCENARIO ISIZEPFT ISOIL NTEXT SAND CLAY DEPTH ISOILBC SLDRAIN COLOUR SLZRES QUEUE MET_DRIVER DTLSM VMFACT_C3 VMFACT_C4 MPHOTO_TRC3 MPHOTO_TEC3 MPHOTO_C4 BPHOTO_BLC3 BPHOTO_NLC3 BPHOTO_C4 KW_GRASS KW_TREE GAMMA_C3 GAMMA_C4 D0_GRASS D0_TREE ALPHA_C3 ALPHA_C4 KLOWCO2 DECOMP_SCHEME RRFFACT GROWTHRESP LWIDTH_GRASS LWIDTH_BLTREE LWIDTH_NLTREE Q10_C3 Q10_C4 H2O_LIMIT IMORT_SCHEME DDMORT_CONST ISFCLYRM ICANTURB UBMIN UGBMIN USTMIN GAMM GAMH TPRANDTL RIBMAX ATMCO2 THCRIT SM_FIRE IFIRE FIRE_PARM IPERCOL RUNOFF_TIME IMETRAD IBRANCH ICANRAD CROWN_MOD LTRANS_VIS LREFLECT_VIS LTRANS_NIR LREFLECT_NIR ORIENT_TREE ORIENT_GRASS CLUMP_TREE CLUMP_GRASS IVEGTDYN IGNDVAP IPHEN IALLOM IBIGLEAF IREPRO TREEFALL ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -harvard hvd -72.170 42.540 1199 05 01 0000 1700 01 01 0000 6 0 0 2 2 -1.000 -1.000 E 1 90 2 0 moorcroft_6100b Harvard 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -tonzi tzi -120.894 38.427 1199 05 01 0000 1700 01 01 0000 6 0 0 2 5 0.447 0.191 D 1 90 2 0 moorcroft_6100b Tonzi 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -manaus_km34 m34 -60.209 -2.609 1200 01 01 0000 1700 01 01 0000 6 0 0 2 11 0.200 0.680 H 1 90 2 0 moorcroft_6100b Manaus_Km34 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -caxiuana cax -51.458 -1.720 1200 01 01 0000 1700 01 01 0000 6 0 0 2 16 0.380 0.440 D 2 6 2 0 moorcroft_6100b Caxiuana 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -santarem_km67 s67 -54.959 -2.857 1200 01 01 0000 1700 01 01 0000 6 0 0 2 17 -1.000 -1.000 H 1 90 2 0 moorcroft_6100b Santarem_Km67 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -santarem_km83 s83 -54.971 -3.018 1200 01 01 0000 1700 01 01 0000 6 0 0 2 16 0.390 0.590 H 1 90 2 0 moorcroft_6100b Santarem_Km83 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -rebio_jaru rja -61.931 -10.083 1200 01 01 0000 1700 01 01 0000 6 0 0 2 2 0.800 0.100 C 2 6 2 0 moorcroft_6100b Rebio_Jaru 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -pedegigante pdg -47.650 -21.619 1200 01 01 0000 1700 01 01 0000 6 0 0 2 2 0.850 0.030 F 1 90 2 0 moorcroft_6100b Pe-de-Gigante 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -paracou gyf -52.912 5.282 1200 01 01 0000 1700 01 01 0000 6 0 0 2 6 0.562 0.345 C 2 6 2 0 moorcroft_6100b Paracou 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -bananal ban -50.159 -9.824 1200 01 01 0000 1700 01 01 0000 6 0 0 2 9 0.240 0.370 C 1 90 2 0 moorcroft_6100b Bananal 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -petrolina pnz -40.370 -9.165 1200 01 01 0000 1700 01 01 0000 6 0 0 2 2 0.821 0.052 C 2 15 2 0 moorcroft_6100b Petrolina 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -fazendans fns -62.357 -10.762 1200 01 01 0000 1700 01 01 0000 6 0 0 2 2 0.800 0.100 G 1 90 2 0 moorcroft_6100b Fazenda_Nossa_Senhora 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -santarem_km77 s77 -54.537 -3.012 1200 01 01 0000 1700 01 01 0000 6 0 0 2 17 -1.000 -1.000 H 1 90 2 0 moorcroft_6100b Santarem_Km77 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -la_lorena lor -69.991 -3.056 1200 01 01 0000 1700 01 01 0000 6 0 0 2 9 0.380 0.310 A 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -el_zafire zar -69.902 -4.007 1200 01 01 0000 1700 01 01 0000 6 0 0 2 2 0.748 0.006 B 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -allpahuayo alp -73.437 -3.953 1200 01 01 0000 1700 01 01 0000 6 0 0 2 1 0.937 0.026 D 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -tambopata tam -69.271 -12.830 1200 01 01 0000 1700 01 01 0000 6 0 0 2 11 0.400 0.430 B 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -kenia qea -62.730 -16.010 1200 01 01 0000 1700 01 01 0000 6 0 0 2 3 0.760 0.160 D 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -barro_colorado bci -79.850 9.160 1200 01 01 0000 1700 01 01 0000 6 0 0 2 17 0.200 0.420 D 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -cardoso czi -48.010 -25.096 1200 01 01 0000 1700 01 01 0000 6 0 0 2 1 0.950 0.010 C 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -la_selva lzv -84.010 10.430 1200 01 01 0000 1700 01 01 0000 6 0 0 2 6 0.570 0.290 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -la_planada lpn -77.994 1.116 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 H 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -sinop ops -55.325 -11.412 1200 01 01 0000 1700 01 01 0000 6 0 0 2 2 0.840 0.120 E 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -yasuni ysn -76.396 -0.686 1200 01 01 0000 1700 01 01 0000 6 0 0 2 4 0.259 0.255 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -alta_floresta afl -56.100 -9.867 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -angra_dos_reis aei -44.300 -22.970 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -araguaiana ayx -51.810 -15.710 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -araracuara arc -72.398 -0.601 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -asuncion asu -57.560 -25.300 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -belo_horizonte cnf -43.950 -19.850 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -belem bel -48.480 -1.380 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -blumenau bnu -49.060 -26.920 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -boa_vista bvb -60.610 2.920 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -bogota bog -74.100 4.650 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -brasilia bsb -47.910 -15.860 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -cabo_frio cfb -42.070 -22.490 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -cajazeiras cjz -38.570 -6.900 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -calabozo clz -67.420 8.920 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -canarana qnr -52.250 -13.560 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -carajas cks -50.722 -5.786 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -chaiten wch -72.500 -42.500 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -ciudad_guayana cgu -62.762 8.289 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -cochabamba cbb -66.170 -17.420 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -cuiaba cgb -56.100 -15.600 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -curitiba cwb -49.230 -25.410 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -diamantino dmt -56.620 -14.370 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -dourados dou -54.810 -22.220 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -el_triunfo etf -67.000 -13.500 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -erechim erm -52.240 -27.610 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -eunapolis enp -39.580 -16.330 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -fortaleza for -38.530 -3.780 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -iguape igp -47.590 -24.630 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -imperatriz imp -47.460 -5.530 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -iquique iqq -69.970 -20.240 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -itabaiana ibn -37.420 -10.680 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -itapeva ipv -48.880 -23.980 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -jacareacanga jcr -57.777 -6.233 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -jiparana jpr -61.980 -10.860 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -joao_pessoa jpa -34.910 -7.100 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -la_esmeralda lfe -65.540 3.170 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -labrea lbr -64.770 -7.280 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -lencois lec -41.350 -12.480 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -linden lyd -58.302 6.015 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -llochegua llo -73.908 -12.410 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -macapa mcp -51.090 0.330 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -malalcahuello zmh -71.580 -38.470 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -manaus mao -60.020 -3.110 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -manicore mnx -61.280 -5.820 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -maracarume zme -45.954 -2.041 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -maringa mgf -52.010 -23.470 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -mariscal_estagarribia esg -60.624 -22.043 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -montes_claros moc -43.820 -16.710 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -neuquen nqn -68.000 -39.000 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -oeiras oei -42.160 -7.020 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -palmas pmw -48.360 -10.290 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -paramaribo pbm -55.150 5.830 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -piura piu -80.617 -5.207 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -porto_de_moz ptq -52.236 -1.741 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -pucallpa pcl -74.570 -8.380 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -puerto_suarez psz -58.090 -18.580 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -quibdo uib -76.640 5.690 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -recife rec -34.910 -8.070 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -redencao rdc -49.980 -8.030 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -ribeirao_preto rao -47.780 -21.140 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -rio_branco rbr -67.890 -9.870 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -riohacha rch -72.926 11.240 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -salta sla -65.483 -24.850 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -san_pedro zpe -54.110 -26.630 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -sao_felix_araguaia sxo -50.690 -11.630 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -sao_felix_xingu sxx -51.950 -6.640 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -sao_luis slz -44.236 -2.586 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -sao_gabriel sjl -66.980 -0.140 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -santa_fe sfn -60.809 -31.712 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -santarem stm -54.959 -2.857 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -sobral qbx -39.990 -4.010 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -tarauaca trq -70.781 -8.157 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -tefe tff -64.720 -3.380 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -teresina the -42.800 -5.090 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -tirios obi -55.940 2.220 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -tolhuin tqh -67.222 -54.502 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -vina_del_mar kna -71.480 -32.950 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -vilhena bvh -60.100 -12.730 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -vitoria vix -40.390 -20.310 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 -xingu xgu -52.636 -9.692 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 600.0 3 0.5 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +harvard hvd -72.170 42.540 1199 05 01 0000 1700 01 01 0000 6 0 0 2 2 -1.000 -1.000 E 1 90 14 0 moorcroft_6100b Harvard 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +tonzi tzi -120.894 38.427 1199 05 01 0000 1700 01 01 0000 6 0 0 2 5 0.447 0.191 D 1 90 14 0 moorcroft_6100b Tonzi 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +manaus_km34 m34 -60.209 -2.609 1200 01 01 0000 1700 01 01 0000 6 0 0 2 11 0.200 0.680 H 1 90 14 0 moorcroft_6100b Manaus_Km34 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +caxiuana cax -51.458 -1.720 1200 01 01 0000 1700 01 01 0000 6 0 0 2 16 0.380 0.440 D 2 6 14 0 moorcroft_6100b Caxiuana 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +santarem_km67 s67 -54.959 -2.857 1200 01 01 0000 1700 01 01 0000 6 0 0 2 17 -1.000 -1.000 H 1 90 14 0 moorcroft_6100b Santarem_Km67 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +santarem_km83 s83 -54.971 -3.018 1200 01 01 0000 1700 01 01 0000 6 0 0 2 16 0.390 0.590 H 1 90 14 0 moorcroft_6100b Santarem_Km83 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +rebio_jaru rja -61.931 -10.083 1200 01 01 0000 1700 01 01 0000 6 0 0 2 2 0.800 0.100 C 2 6 14 0 moorcroft_6100b Rebio_Jaru 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +pedegigante pdg -47.650 -21.619 1200 01 01 0000 1700 01 01 0000 6 0 0 2 2 0.850 0.030 F 1 90 14 0 moorcroft_6100b Pe-de-Gigante 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +paracou gyf -52.912 5.282 1200 01 01 0000 1700 01 01 0000 6 0 0 2 6 0.562 0.345 C 2 6 14 0 moorcroft_6100b Paracou 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +bananal ban -50.159 -9.824 1200 01 01 0000 1700 01 01 0000 6 0 0 2 9 0.240 0.370 C 1 90 14 0 moorcroft_6100b Bananal 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +petrolina pnz -40.370 -9.165 1200 01 01 0000 1700 01 01 0000 6 0 0 2 2 0.821 0.052 C 2 15 14 0 moorcroft_6100b Petrolina 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +fazendans fns -62.357 -10.762 1200 01 01 0000 1700 01 01 0000 6 0 0 2 2 0.800 0.100 G 1 90 14 0 moorcroft_6100b Fazenda_Nossa_Senhora 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +santarem_km77 s77 -54.537 -3.012 1200 01 01 0000 1700 01 01 0000 6 0 0 2 17 -1.000 -1.000 H 1 90 14 0 moorcroft_6100b Santarem_Km77 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +la_lorena lor -69.991 -3.056 1200 01 01 0000 1700 01 01 0000 6 0 0 2 9 0.380 0.310 A 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +el_zafire zar -69.902 -4.007 1200 01 01 0000 1700 01 01 0000 6 0 0 2 2 0.748 0.006 B 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +allpahuayo alp -73.437 -3.953 1200 01 01 0000 1700 01 01 0000 6 0 0 2 1 0.937 0.026 D 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +tambopata tam -69.271 -12.830 1200 01 01 0000 1700 01 01 0000 6 0 0 2 11 0.400 0.430 B 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +kenia qea -62.730 -16.010 1200 01 01 0000 1700 01 01 0000 6 0 0 2 3 0.760 0.160 D 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +barro_colorado bci -79.850 9.160 1200 01 01 0000 1700 01 01 0000 6 0 0 2 17 0.200 0.420 D 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +cardoso czi -48.010 -25.096 1200 01 01 0000 1700 01 01 0000 6 0 0 2 1 0.950 0.010 C 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +la_selva lzv -84.010 10.430 1200 01 01 0000 1700 01 01 0000 6 0 0 2 6 0.570 0.290 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +la_planada lpn -77.994 1.116 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 H 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +sinop ops -55.325 -11.412 1200 01 01 0000 1700 01 01 0000 6 0 0 2 2 0.840 0.120 E 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +yasuni ysn -76.396 -0.686 1200 01 01 0000 1700 01 01 0000 6 0 0 2 4 0.259 0.255 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +alta_floresta afl -56.100 -9.867 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +angra_dos_reis aei -44.300 -22.970 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +araguaiana ayx -51.810 -15.710 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +araracuara arc -72.398 -0.601 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +asuncion asu -57.560 -25.300 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +belo_horizonte cnf -43.950 -19.850 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +belem bel -48.480 -1.380 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +blumenau bnu -49.060 -26.920 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +boa_vista bvb -60.610 2.920 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +bogota bog -74.100 4.650 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +brasilia bsb -47.910 -15.860 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +cabo_frio cfb -42.070 -22.490 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +cajazeiras cjz -38.570 -6.900 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +calabozo clz -67.420 8.920 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +canarana qnr -52.250 -13.560 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +carajas cks -50.722 -5.786 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +chaiten wch -72.500 -42.500 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +ciudad_guayana cgu -62.762 8.289 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +cochabamba cbb -66.170 -17.420 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +cuiaba cgb -56.100 -15.600 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +curitiba cwb -49.230 -25.410 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +diamantino dmt -56.620 -14.370 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +dourados dou -54.810 -22.220 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +el_triunfo etf -67.000 -13.500 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +erechim erm -52.240 -27.610 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +eunapolis enp -39.580 -16.330 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +fortaleza for -38.530 -3.780 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +iguape igp -47.590 -24.630 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +imperatriz imp -47.460 -5.530 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +iquique iqq -69.970 -20.240 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +itabaiana ibn -37.420 -10.680 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +itapeva ipv -48.880 -23.980 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +jacareacanga jcr -57.777 -6.233 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +jiparana jpr -61.980 -10.860 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +joao_pessoa jpa -34.910 -7.100 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +la_esmeralda lfe -65.540 3.170 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +labrea lbr -64.770 -7.280 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +lencois lec -41.350 -12.480 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +linden lyd -58.302 6.015 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +llochegua llo -73.908 -12.410 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +macapa mcp -51.090 0.330 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +malalcahuello zmh -71.580 -38.470 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +manaus mao -60.020 -3.110 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +manicore mnx -61.280 -5.820 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +maracarume zme -45.954 -2.041 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +maringa mgf -52.010 -23.470 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +mariscal_estagarribia esg -60.624 -22.043 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +montes_claros moc -43.820 -16.710 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +neuquen nqn -68.000 -39.000 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +oeiras oei -42.160 -7.020 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +palmas pmw -48.360 -10.290 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +paramaribo pbm -55.150 5.830 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +piura piu -80.617 -5.207 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +porto_de_moz ptq -52.236 -1.741 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +pucallpa pcl -74.570 -8.380 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +puerto_suarez psz -58.090 -18.580 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +quibdo uib -76.640 5.690 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +recife rec -34.910 -8.070 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +redencao rdc -49.980 -8.030 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +ribeirao_preto rao -47.780 -21.140 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +rio_branco rbr -67.890 -9.870 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +riohacha rch -72.926 11.240 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +salta sla -65.483 -24.850 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +san_pedro zpe -54.110 -26.630 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +sao_felix_araguaia sxo -50.690 -11.630 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +sao_felix_xingu sxx -51.950 -6.640 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +sao_luis slz -44.236 -2.586 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +sao_gabriel sjl -66.980 -0.140 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +santa_fe sfn -60.809 -31.712 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +santarem stm -54.959 -2.857 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +sobral qbx -39.990 -4.010 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +tarauaca trq -70.781 -8.157 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +tefe tff -64.720 -3.380 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +teresina the -42.800 -5.090 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +tirios obi -55.940 2.220 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +tolhuin tqh -67.222 -54.502 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +vina_del_mar kna -71.480 -32.950 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +vilhena bvh -60.100 -12.730 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +vitoria vix -40.390 -20.310 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 +xingu xgu -52.636 -9.692 1200 01 01 0000 1700 01 01 0000 6 0 0 1 1 -1.000 -1.000 F 1 90 14 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.0145 0.035 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 1 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.5 3 0.5 0 3600. 2 1 1 0 0.050 0.100 0.230 0.460 0.100 0.000 0.800 1.000 1 0 -1 2 0 2 0.0111 diff --git a/ED/Template/spawn_poly.sh b/ED/Template/spawn_poly.sh index 9ec78c03f..0fc433327 100755 --- a/ED/Template/spawn_poly.sh +++ b/ED/Template/spawn_poly.sh @@ -23,7 +23,7 @@ sitemetdef='/n/moorcroft_data/mlongo/data/ed2_data/site_met_driver' #----- This is the header with the Sheffield data. ----------------------------------------# shefhead='SHEF_NCEP_DRIVER_DS314' #----- Path with default pseudo past drivers. ---------------------------------------------# -scenariopathdef='/n/moorcroft_data/mlongo/data/ed2_data/past_met_driver' +scenariopathdef='/n/moorcroft_data/mlongo/data/ed2_data/scenario_met_driver' #----- Should the met driver be copied to local scratch disks? ----------------------------# copy2scratch='n' #------------------------------------------------------------------------------------------# @@ -82,7 +82,7 @@ execname='ed_2.1-opt' if [ ${copy2scratch} == 'y' -o ${copy2scratch} == 'Y' ] then sitemet='/scratch/mlongo/met_driver/site_met_driver' - scenariopath='/scratch/mlongo/met_driver/past_met_driver' + scenariopath='/scratch/mlongo/met_driver/scenario_met_driver' shefpath='/scratch/mlongo/met_driver/sheffield' else sitemet=${sitemetdef} @@ -588,7 +588,7 @@ do # whereas positive means that wet years are picked more often. # # # #---------------------------------------------------------------------------------------# - if [ ${iscenario} -ne 0 ] + if [ ${iscenario} -eq 0 ] then #------------------------------------------------------------------------------------# # Determine which meteorological data set to use. Default is the Sheffield/NCEP # diff --git a/ED/build/bin/dependency.mk b/ED/build/bin/dependency.mk index bc9b9da9f..5070cd322 100644 --- a/ED/build/bin/dependency.mk +++ b/ED/build/bin/dependency.mk @@ -17,38 +17,42 @@ canopy_struct_dynamics.o: canopy_layer_coms.mod consts_coms.mod ed_misc_coms.mod canopy_struct_dynamics.o: ed_state_vars.mod grid_coms.mod met_driver_coms.mod canopy_struct_dynamics.o: pft_coms.mod phenology_coms.mod physiology_coms.mod canopy_struct_dynamics.o: rk4_coms.mod soil_coms.mod therm_lib.mod -disturbance.o: allometry.mod consts_coms.mod decomp_coms.mod disturb_coms.mod -disturbance.o: ed_max_dims.mod ed_misc_coms.mod ed_state_vars.mod -disturbance.o: ed_therm_lib.mod fuse_fiss_utils.mod grid_coms.mod -disturbance.o: mem_polygons.mod mortality.mod pft_coms.mod phenology_aux.mod -disturbance.o: phenology_coms.mod -euler_driver.o: canopy_air_coms.mod consts_coms.mod ed_max_dims.mod -euler_driver.o: ed_misc_coms.mod ed_state_vars.mod grid_coms.mod +disturbance.o: allometry.mod budget_utils.mod consts_coms.mod decomp_coms.mod +disturbance.o: disturb_coms.mod ed_max_dims.mod ed_misc_coms.mod +disturbance.o: ed_state_vars.mod ed_therm_lib.mod fuse_fiss_utils.mod +disturbance.o: grid_coms.mod mem_polygons.mod mortality.mod pft_coms.mod +disturbance.o: phenology_aux.mod phenology_coms.mod +euler_driver.o: budget_utils.mod canopy_air_coms.mod consts_coms.mod +euler_driver.o: ed_max_dims.mod ed_misc_coms.mod ed_state_vars.mod grid_coms.mod euler_driver.o: hydrology_coms.mod met_driver_coms.mod rk4_coms.mod euler_driver.o: rk4_driver.mod rk4_stepper.mod soil_coms.mod therm_lib.mod euler_driver.o: therm_lib8.mod -events.o: allometry.mod consts_coms.mod decomp_coms.mod disturbance_utils.mod -events.o: ed_misc_coms.mod ed_state_vars.mod ed_therm_lib.mod -events.o: fuse_fiss_utils.mod grid_coms.mod pft_coms.mod therm_lib.mod +events.o: allometry.mod budget_utils.mod consts_coms.mod decomp_coms.mod +events.o: disturbance_utils.mod ed_misc_coms.mod ed_state_vars.mod +events.o: ed_therm_lib.mod fuse_fiss_utils.mod grid_coms.mod pft_coms.mod +events.o: therm_lib.mod farq_leuning.o: c34constants.mod consts_coms.mod pft_coms.mod phenology_coms.mod farq_leuning.o: physiology_coms.mod rk4_coms.mod therm_lib8.mod fire.o: consts_coms.mod disturb_coms.mod ed_misc_coms.mod ed_state_vars.mod fire.o: grid_coms.mod soil_coms.mod -forestry.o: disturb_coms.mod disturbance_utils.mod ed_max_dims.mod -forestry.o: ed_misc_coms.mod ed_state_vars.mod fuse_fiss_utils.mod grid_coms.mod -growth_balive.o: allometry.mod consts_coms.mod decomp_coms.mod ed_max_dims.mod -growth_balive.o: ed_misc_coms.mod ed_state_vars.mod ed_therm_lib.mod -growth_balive.o: fuse_fiss_utils.mod grid_coms.mod mortality.mod pft_coms.mod -growth_balive.o: phenology_coms.mod physiology_coms.mod -heun_driver.o: canopy_air_coms.mod consts_coms.mod ed_max_dims.mod -heun_driver.o: ed_misc_coms.mod ed_state_vars.mod grid_coms.mod +forestry.o: budget_utils.mod disturb_coms.mod disturbance_utils.mod +forestry.o: ed_max_dims.mod ed_misc_coms.mod ed_state_vars.mod +forestry.o: fuse_fiss_utils.mod grid_coms.mod +growth_balive.o: allometry.mod budget_utils.mod consts_coms.mod decomp_coms.mod +growth_balive.o: ed_max_dims.mod ed_misc_coms.mod ed_state_vars.mod +growth_balive.o: ed_therm_lib.mod fuse_fiss_utils.mod grid_coms.mod +growth_balive.o: mortality.mod pft_coms.mod phenology_coms.mod +growth_balive.o: physiology_coms.mod +heun_driver.o: budget_utils.mod canopy_air_coms.mod consts_coms.mod +heun_driver.o: ed_max_dims.mod ed_misc_coms.mod ed_state_vars.mod grid_coms.mod heun_driver.o: hydrology_coms.mod met_driver_coms.mod rk4_coms.mod heun_driver.o: rk4_driver.mod rk4_stepper.mod soil_coms.mod therm_lib.mod heun_driver.o: therm_lib8.mod -hybrid_driver.o: consts_coms.mod ed_max_dims.mod ed_misc_coms.mod -hybrid_driver.o: ed_state_vars.mod grid_coms.mod hydrology_coms.mod -hybrid_driver.o: met_driver_coms.mod rk4_coms.mod rk4_driver.mod rk4_stepper.mod -hybrid_driver.o: soil_coms.mod therm_lib.mod therm_lib8.mod +hybrid_driver.o: budget_utils.mod consts_coms.mod ed_max_dims.mod +hybrid_driver.o: ed_misc_coms.mod ed_state_vars.mod grid_coms.mod +hybrid_driver.o: hydrology_coms.mod met_driver_coms.mod rk4_coms.mod +hybrid_driver.o: rk4_driver.mod rk4_stepper.mod soil_coms.mod therm_lib.mod +hybrid_driver.o: therm_lib8.mod lsm_hyd.o: consts_coms.mod ed_misc_coms.mod ed_node_coms.mod ed_state_vars.mod lsm_hyd.o: grid_coms.mod hydrology_coms.mod hydrology_constants.mod pft_coms.mod lsm_hyd.o: soil_coms.mod therm_lib.mod @@ -70,15 +74,17 @@ photosyn_driv.o: soil_coms.mod therm_lib.mod radiate_driver.o: allometry.mod canopy_layer_coms.mod canopy_radiation_coms.mod radiate_driver.o: consts_coms.mod ed_max_dims.mod ed_misc_coms.mod radiate_driver.o: ed_state_vars.mod grid_coms.mod soil_coms.mod -reproduction.o: allometry.mod consts_coms.mod decomp_coms.mod ed_max_dims.mod -reproduction.o: ed_misc_coms.mod ed_state_vars.mod ed_therm_lib.mod -reproduction.o: fuse_fiss_utils.mod grid_coms.mod mem_polygons.mod pft_coms.mod -reproduction.o: phenology_aux.mod phenology_coms.mod -rk4_derivs.o: canopy_struct_dynamics.mod consts_coms.mod ed_max_dims.mod -rk4_derivs.o: ed_misc_coms.mod ed_state_vars.mod grid_coms.mod pft_coms.mod -rk4_derivs.o: physiology_coms.mod rk4_coms.mod soil_coms.mod therm_lib8.mod -rk4_driver.o: allometry.mod canopy_air_coms.mod consts_coms.mod disturb_coms.mod -rk4_driver.o: ed_misc_coms.mod ed_state_vars.mod grid_coms.mod +reproduction.o: allometry.mod budget_utils.mod consts_coms.mod decomp_coms.mod +reproduction.o: ed_max_dims.mod ed_misc_coms.mod ed_state_vars.mod +reproduction.o: ed_therm_lib.mod fuse_fiss_utils.mod grid_coms.mod +reproduction.o: mem_polygons.mod pft_coms.mod phenology_aux.mod +reproduction.o: phenology_coms.mod +rk4_derivs.o: budget_utils.mod canopy_struct_dynamics.mod consts_coms.mod +rk4_derivs.o: ed_max_dims.mod ed_misc_coms.mod ed_state_vars.mod grid_coms.mod +rk4_derivs.o: pft_coms.mod physiology_coms.mod rk4_coms.mod soil_coms.mod +rk4_derivs.o: therm_lib8.mod +rk4_driver.o: allometry.mod budget_utils.mod canopy_air_coms.mod consts_coms.mod +rk4_driver.o: disturb_coms.mod ed_misc_coms.mod ed_state_vars.mod grid_coms.mod rk4_driver.o: met_driver_coms.mod phenology_coms.mod rk4_coms.mod soil_coms.mod rk4_driver.o: therm_lib.mod rk4_integ_utils.o: canopy_air_coms.mod consts_coms.mod ed_max_dims.mod @@ -107,10 +113,10 @@ ed_bigleaf_init.o: fuse_fiss_utils.mod pft_coms.mod ed_init.o: consts_coms.mod ed_max_dims.mod ed_misc_coms.mod ed_node_coms.mod ed_init.o: ed_state_vars.mod ed_work_vars.mod grid_coms.mod mem_polygons.mod ed_init.o: phenology_coms.mod phenology_startup.mod rk4_coms.mod soil_coms.mod -ed_init_atm.o: canopy_struct_dynamics.mod consts_coms.mod ed_misc_coms.mod -ed_init_atm.o: ed_node_coms.mod ed_state_vars.mod ed_therm_lib.mod -ed_init_atm.o: fuse_fiss_utils.mod grid_coms.mod met_driver_coms.mod -ed_init_atm.o: pft_coms.mod soil_coms.mod therm_lib.mod +ed_init_atm.o: budget_utils.mod canopy_struct_dynamics.mod consts_coms.mod +ed_init_atm.o: ed_misc_coms.mod ed_node_coms.mod ed_state_vars.mod +ed_init_atm.o: ed_therm_lib.mod fuse_fiss_utils.mod grid_coms.mod +ed_init_atm.o: met_driver_coms.mod pft_coms.mod soil_coms.mod therm_lib.mod ed_nbg_init.o: allometry.mod consts_coms.mod ed_max_dims.mod ed_misc_coms.mod ed_nbg_init.o: ed_state_vars.mod fuse_fiss_utils.mod grid_coms.mod pft_coms.mod ed_nbg_init.o: physiology_coms.mod @@ -224,11 +230,11 @@ ed_therm_lib.o: canopy_air_coms.mod consts_coms.mod ed_max_dims.mod ed_therm_lib.o: ed_misc_coms.mod ed_state_vars.mod grid_coms.mod pft_coms.mod ed_therm_lib.o: rk4_coms.mod soil_coms.mod therm_lib.mod therm_lib8.mod fatal_error.o: ed_node_coms.mod -fuse_fiss_utils.o: allometry.mod canopy_layer_coms.mod decomp_coms.mod -fuse_fiss_utils.o: disturb_coms.mod ed_max_dims.mod ed_misc_coms.mod -fuse_fiss_utils.o: ed_node_coms.mod ed_state_vars.mod fusion_fission_coms.mod -fuse_fiss_utils.o: grid_coms.mod mem_polygons.mod pft_coms.mod soil_coms.mod -fuse_fiss_utils.o: therm_lib.mod +fuse_fiss_utils.o: allometry.mod budget_utils.mod canopy_layer_coms.mod +fuse_fiss_utils.o: decomp_coms.mod disturb_coms.mod ed_max_dims.mod +fuse_fiss_utils.o: ed_misc_coms.mod ed_node_coms.mod ed_state_vars.mod +fuse_fiss_utils.o: fusion_fission_coms.mod grid_coms.mod mem_polygons.mod +fuse_fiss_utils.o: pft_coms.mod soil_coms.mod therm_lib.mod great_circle.o: consts_coms.mod hdf5_utils.o: hdf5_coms.mod invmondays.o: ed_misc_coms.mod @@ -248,6 +254,7 @@ utils_c.o: /n/Moorcroft_Lab/Users/mlongo/EDBRAMS/ED/src/include/utils_sub_names. utils_c.o: allometry.mod: allometry.o an_header.mod: an_header.o +budget_utils.mod: budget_utils.o c34constants.mod: c34constants.o canopy_air_coms.mod: canopy_air_coms.o canopy_layer_coms.mod: canopy_layer_coms.o diff --git a/ED/dbgbuild/bin/dependency.mk b/ED/dbgbuild/bin/dependency.mk index bc9b9da9f..5070cd322 100644 --- a/ED/dbgbuild/bin/dependency.mk +++ b/ED/dbgbuild/bin/dependency.mk @@ -17,38 +17,42 @@ canopy_struct_dynamics.o: canopy_layer_coms.mod consts_coms.mod ed_misc_coms.mod canopy_struct_dynamics.o: ed_state_vars.mod grid_coms.mod met_driver_coms.mod canopy_struct_dynamics.o: pft_coms.mod phenology_coms.mod physiology_coms.mod canopy_struct_dynamics.o: rk4_coms.mod soil_coms.mod therm_lib.mod -disturbance.o: allometry.mod consts_coms.mod decomp_coms.mod disturb_coms.mod -disturbance.o: ed_max_dims.mod ed_misc_coms.mod ed_state_vars.mod -disturbance.o: ed_therm_lib.mod fuse_fiss_utils.mod grid_coms.mod -disturbance.o: mem_polygons.mod mortality.mod pft_coms.mod phenology_aux.mod -disturbance.o: phenology_coms.mod -euler_driver.o: canopy_air_coms.mod consts_coms.mod ed_max_dims.mod -euler_driver.o: ed_misc_coms.mod ed_state_vars.mod grid_coms.mod +disturbance.o: allometry.mod budget_utils.mod consts_coms.mod decomp_coms.mod +disturbance.o: disturb_coms.mod ed_max_dims.mod ed_misc_coms.mod +disturbance.o: ed_state_vars.mod ed_therm_lib.mod fuse_fiss_utils.mod +disturbance.o: grid_coms.mod mem_polygons.mod mortality.mod pft_coms.mod +disturbance.o: phenology_aux.mod phenology_coms.mod +euler_driver.o: budget_utils.mod canopy_air_coms.mod consts_coms.mod +euler_driver.o: ed_max_dims.mod ed_misc_coms.mod ed_state_vars.mod grid_coms.mod euler_driver.o: hydrology_coms.mod met_driver_coms.mod rk4_coms.mod euler_driver.o: rk4_driver.mod rk4_stepper.mod soil_coms.mod therm_lib.mod euler_driver.o: therm_lib8.mod -events.o: allometry.mod consts_coms.mod decomp_coms.mod disturbance_utils.mod -events.o: ed_misc_coms.mod ed_state_vars.mod ed_therm_lib.mod -events.o: fuse_fiss_utils.mod grid_coms.mod pft_coms.mod therm_lib.mod +events.o: allometry.mod budget_utils.mod consts_coms.mod decomp_coms.mod +events.o: disturbance_utils.mod ed_misc_coms.mod ed_state_vars.mod +events.o: ed_therm_lib.mod fuse_fiss_utils.mod grid_coms.mod pft_coms.mod +events.o: therm_lib.mod farq_leuning.o: c34constants.mod consts_coms.mod pft_coms.mod phenology_coms.mod farq_leuning.o: physiology_coms.mod rk4_coms.mod therm_lib8.mod fire.o: consts_coms.mod disturb_coms.mod ed_misc_coms.mod ed_state_vars.mod fire.o: grid_coms.mod soil_coms.mod -forestry.o: disturb_coms.mod disturbance_utils.mod ed_max_dims.mod -forestry.o: ed_misc_coms.mod ed_state_vars.mod fuse_fiss_utils.mod grid_coms.mod -growth_balive.o: allometry.mod consts_coms.mod decomp_coms.mod ed_max_dims.mod -growth_balive.o: ed_misc_coms.mod ed_state_vars.mod ed_therm_lib.mod -growth_balive.o: fuse_fiss_utils.mod grid_coms.mod mortality.mod pft_coms.mod -growth_balive.o: phenology_coms.mod physiology_coms.mod -heun_driver.o: canopy_air_coms.mod consts_coms.mod ed_max_dims.mod -heun_driver.o: ed_misc_coms.mod ed_state_vars.mod grid_coms.mod +forestry.o: budget_utils.mod disturb_coms.mod disturbance_utils.mod +forestry.o: ed_max_dims.mod ed_misc_coms.mod ed_state_vars.mod +forestry.o: fuse_fiss_utils.mod grid_coms.mod +growth_balive.o: allometry.mod budget_utils.mod consts_coms.mod decomp_coms.mod +growth_balive.o: ed_max_dims.mod ed_misc_coms.mod ed_state_vars.mod +growth_balive.o: ed_therm_lib.mod fuse_fiss_utils.mod grid_coms.mod +growth_balive.o: mortality.mod pft_coms.mod phenology_coms.mod +growth_balive.o: physiology_coms.mod +heun_driver.o: budget_utils.mod canopy_air_coms.mod consts_coms.mod +heun_driver.o: ed_max_dims.mod ed_misc_coms.mod ed_state_vars.mod grid_coms.mod heun_driver.o: hydrology_coms.mod met_driver_coms.mod rk4_coms.mod heun_driver.o: rk4_driver.mod rk4_stepper.mod soil_coms.mod therm_lib.mod heun_driver.o: therm_lib8.mod -hybrid_driver.o: consts_coms.mod ed_max_dims.mod ed_misc_coms.mod -hybrid_driver.o: ed_state_vars.mod grid_coms.mod hydrology_coms.mod -hybrid_driver.o: met_driver_coms.mod rk4_coms.mod rk4_driver.mod rk4_stepper.mod -hybrid_driver.o: soil_coms.mod therm_lib.mod therm_lib8.mod +hybrid_driver.o: budget_utils.mod consts_coms.mod ed_max_dims.mod +hybrid_driver.o: ed_misc_coms.mod ed_state_vars.mod grid_coms.mod +hybrid_driver.o: hydrology_coms.mod met_driver_coms.mod rk4_coms.mod +hybrid_driver.o: rk4_driver.mod rk4_stepper.mod soil_coms.mod therm_lib.mod +hybrid_driver.o: therm_lib8.mod lsm_hyd.o: consts_coms.mod ed_misc_coms.mod ed_node_coms.mod ed_state_vars.mod lsm_hyd.o: grid_coms.mod hydrology_coms.mod hydrology_constants.mod pft_coms.mod lsm_hyd.o: soil_coms.mod therm_lib.mod @@ -70,15 +74,17 @@ photosyn_driv.o: soil_coms.mod therm_lib.mod radiate_driver.o: allometry.mod canopy_layer_coms.mod canopy_radiation_coms.mod radiate_driver.o: consts_coms.mod ed_max_dims.mod ed_misc_coms.mod radiate_driver.o: ed_state_vars.mod grid_coms.mod soil_coms.mod -reproduction.o: allometry.mod consts_coms.mod decomp_coms.mod ed_max_dims.mod -reproduction.o: ed_misc_coms.mod ed_state_vars.mod ed_therm_lib.mod -reproduction.o: fuse_fiss_utils.mod grid_coms.mod mem_polygons.mod pft_coms.mod -reproduction.o: phenology_aux.mod phenology_coms.mod -rk4_derivs.o: canopy_struct_dynamics.mod consts_coms.mod ed_max_dims.mod -rk4_derivs.o: ed_misc_coms.mod ed_state_vars.mod grid_coms.mod pft_coms.mod -rk4_derivs.o: physiology_coms.mod rk4_coms.mod soil_coms.mod therm_lib8.mod -rk4_driver.o: allometry.mod canopy_air_coms.mod consts_coms.mod disturb_coms.mod -rk4_driver.o: ed_misc_coms.mod ed_state_vars.mod grid_coms.mod +reproduction.o: allometry.mod budget_utils.mod consts_coms.mod decomp_coms.mod +reproduction.o: ed_max_dims.mod ed_misc_coms.mod ed_state_vars.mod +reproduction.o: ed_therm_lib.mod fuse_fiss_utils.mod grid_coms.mod +reproduction.o: mem_polygons.mod pft_coms.mod phenology_aux.mod +reproduction.o: phenology_coms.mod +rk4_derivs.o: budget_utils.mod canopy_struct_dynamics.mod consts_coms.mod +rk4_derivs.o: ed_max_dims.mod ed_misc_coms.mod ed_state_vars.mod grid_coms.mod +rk4_derivs.o: pft_coms.mod physiology_coms.mod rk4_coms.mod soil_coms.mod +rk4_derivs.o: therm_lib8.mod +rk4_driver.o: allometry.mod budget_utils.mod canopy_air_coms.mod consts_coms.mod +rk4_driver.o: disturb_coms.mod ed_misc_coms.mod ed_state_vars.mod grid_coms.mod rk4_driver.o: met_driver_coms.mod phenology_coms.mod rk4_coms.mod soil_coms.mod rk4_driver.o: therm_lib.mod rk4_integ_utils.o: canopy_air_coms.mod consts_coms.mod ed_max_dims.mod @@ -107,10 +113,10 @@ ed_bigleaf_init.o: fuse_fiss_utils.mod pft_coms.mod ed_init.o: consts_coms.mod ed_max_dims.mod ed_misc_coms.mod ed_node_coms.mod ed_init.o: ed_state_vars.mod ed_work_vars.mod grid_coms.mod mem_polygons.mod ed_init.o: phenology_coms.mod phenology_startup.mod rk4_coms.mod soil_coms.mod -ed_init_atm.o: canopy_struct_dynamics.mod consts_coms.mod ed_misc_coms.mod -ed_init_atm.o: ed_node_coms.mod ed_state_vars.mod ed_therm_lib.mod -ed_init_atm.o: fuse_fiss_utils.mod grid_coms.mod met_driver_coms.mod -ed_init_atm.o: pft_coms.mod soil_coms.mod therm_lib.mod +ed_init_atm.o: budget_utils.mod canopy_struct_dynamics.mod consts_coms.mod +ed_init_atm.o: ed_misc_coms.mod ed_node_coms.mod ed_state_vars.mod +ed_init_atm.o: ed_therm_lib.mod fuse_fiss_utils.mod grid_coms.mod +ed_init_atm.o: met_driver_coms.mod pft_coms.mod soil_coms.mod therm_lib.mod ed_nbg_init.o: allometry.mod consts_coms.mod ed_max_dims.mod ed_misc_coms.mod ed_nbg_init.o: ed_state_vars.mod fuse_fiss_utils.mod grid_coms.mod pft_coms.mod ed_nbg_init.o: physiology_coms.mod @@ -224,11 +230,11 @@ ed_therm_lib.o: canopy_air_coms.mod consts_coms.mod ed_max_dims.mod ed_therm_lib.o: ed_misc_coms.mod ed_state_vars.mod grid_coms.mod pft_coms.mod ed_therm_lib.o: rk4_coms.mod soil_coms.mod therm_lib.mod therm_lib8.mod fatal_error.o: ed_node_coms.mod -fuse_fiss_utils.o: allometry.mod canopy_layer_coms.mod decomp_coms.mod -fuse_fiss_utils.o: disturb_coms.mod ed_max_dims.mod ed_misc_coms.mod -fuse_fiss_utils.o: ed_node_coms.mod ed_state_vars.mod fusion_fission_coms.mod -fuse_fiss_utils.o: grid_coms.mod mem_polygons.mod pft_coms.mod soil_coms.mod -fuse_fiss_utils.o: therm_lib.mod +fuse_fiss_utils.o: allometry.mod budget_utils.mod canopy_layer_coms.mod +fuse_fiss_utils.o: decomp_coms.mod disturb_coms.mod ed_max_dims.mod +fuse_fiss_utils.o: ed_misc_coms.mod ed_node_coms.mod ed_state_vars.mod +fuse_fiss_utils.o: fusion_fission_coms.mod grid_coms.mod mem_polygons.mod +fuse_fiss_utils.o: pft_coms.mod soil_coms.mod therm_lib.mod great_circle.o: consts_coms.mod hdf5_utils.o: hdf5_coms.mod invmondays.o: ed_misc_coms.mod @@ -248,6 +254,7 @@ utils_c.o: /n/Moorcroft_Lab/Users/mlongo/EDBRAMS/ED/src/include/utils_sub_names. utils_c.o: allometry.mod: allometry.o an_header.mod: an_header.o +budget_utils.mod: budget_utils.o c34constants.mod: c34constants.o canopy_air_coms.mod: canopy_air_coms.o canopy_layer_coms.mod: canopy_layer_coms.o diff --git a/ED/run/ED2IN b/ED/run/ED2IN index cf1744928..ff5d19563 100644 --- a/ED/run/ED2IN +++ b/ED/run/ED2IN @@ -1040,8 +1040,9 @@ $ED_NL ! 2. Fire will be triggered with enough biomass and the total soil ! ! water at the top 75 cm falls below a threshold. ! ! 3. Fire will be triggered with enough biomass and accumulated ! - ! 30-day water deficit exceeds the threshold given by SM_FIRE. ! - ! This is soil independent. ! + ! water deficit exceeds the threshold given by SM_FIRE times. ! + ! the total precipitation of the past 12 months. This method ! + ! does not directly depend on soil texture. ! ! FIRE_PARAMETER -- If fire happens, this will control the intensity of the disturbance ! ! given the amount of fuel (currently the total above-ground ! ! biomass). ! @@ -1054,8 +1055,9 @@ $ED_NL ! 1m that will prevent fires to happen. The dry air soil ! ! potential is defined as -3.1 MPa, so make sure SM_FIRE ! ! is greater than this value. ! - ! When INCLUDE_FIRE = 3, only positive values are allowed. This is ! - ! the minimum water deficit, in kg/m2/30 days, to trigger fires. ! + ! When INCLUDE_FIRE = 3, values between 0 and 2 are allowed. This is ! + ! the minimum water deficit relative to the total rainfall, over the ! + ! past 12 months, to trigger fires. ! !---------------------------------------------------------------------------------------! NL%INCLUDE_FIRE = 0 NL%FIRE_PARAMETER = 0.5 @@ -1077,12 +1079,14 @@ $ED_NL !---------------------------------------------------------------------------------------! ! ICANTURB -- This flag controls the canopy roughness. ! - ! 0. Based on Leuning et al. (1995), wind is computed using the similarity ! - ! theory for the top cohort, and they are extinguished with cumulative ! - ! LAI. If using CROWN_MOD 1 or 2, this will use local LAI and average ! - ! by crown area. ! - ! 1. The default ED-2.1 scheme, except that it uses the zero-plane ! - ! displacement height. ! + ! 0. Based on Leuning et al. (1995) and LEAF-3 (Walko et al. 2000). ! + ! Roughness and displacement height are found using simple relations ! + ! with vegetation height; wind is computed using the similarity theory ! + ! for the top cohort, then it is assumed that wind extinguishes follow- ! + ! ing an exponential decay with "perceived" cumulative LAI (local LAI ! + ! with finite crown area). ! + ! 1. The default ED-2.1 scheme, similar to option 0, but the wind profile ! + ! is not based on LAI, instead it used the cohort height. ! ! 2. This uses the method of Massman (1997) using constant drag and no ! ! sheltering factor. ! ! 3. This is also based on Massman (1997), but with the option of varying ! diff --git a/ED/src/driver/ed_model.f90 b/ED/src/driver/ed_model.f90 index d18c4a5f7..a6ab0ceeb 100644 --- a/ED/src/driver/ed_model.f90 +++ b/ED/src/driver/ed_model.f90 @@ -105,7 +105,6 @@ subroutine ed_model() ! can find out which node is the ! slow one !----- External functions. -------------------------------------------------------------! - integer , external :: julday ! Get the elapsed # of days since ED time origin. real , external :: walltime ! Wall time integer , external :: num_days ! Number of days in the current month !---------------------------------------------------------------------------------------! diff --git a/ED/src/dynamics/canopy_struct_dynamics.f90 b/ED/src/dynamics/canopy_struct_dynamics.f90 index bc854c864..ab399a026 100644 --- a/ED/src/dynamics/canopy_struct_dynamics.f90 +++ b/ED/src/dynamics/canopy_struct_dynamics.f90 @@ -68,7 +68,7 @@ module canopy_struct_dynamics ! above plant canopies of arbitrary structure. Boundary Layer Meteorology, 91, ! ! 81-107. ! ! ! - ! 4. This option is almost the same as option 1, except that the ground conductance ! + ! 4. This option is almost the same as option 0, except that the ground conductance ! ! beneath a vegetated canopy is found in a similar way as the CLM technical note, ! ! equations (5.98-5.100). The conductance for bare ground is still found the same ! ! way as in the similarity theory. ! diff --git a/ED/src/dynamics/disturbance.f90 b/ED/src/dynamics/disturbance.f90 index c4315838f..15e1cb5e2 100644 --- a/ED/src/dynamics/disturbance.f90 +++ b/ED/src/dynamics/disturbance.f90 @@ -56,6 +56,7 @@ subroutine apply_disturbances(cgrid) use allometry , only : area_indices ! ! function use mortality , only : disturbance_mortality ! ! subroutine use consts_coms , only : lnexp_max ! ! intent(in) + use budget_utils , only : update_budget ! ! sub-routine implicit none !----- Arguments. -------------------------------------------------------------------! type(edtype) , target :: cgrid @@ -1539,6 +1540,7 @@ subroutine insert_survivors(csite, np, cp, q, area_fac,poly_dest_type,mindbh_har logical , dimension(:) , allocatable :: mask integer :: ico integer :: nco + integer :: addco real :: n_survivors real :: survival_fac !------------------------------------------------------------------------------------! @@ -1566,6 +1568,9 @@ subroutine insert_survivors(csite, np, cp, q, area_fac,poly_dest_type,mindbh_har !----- If something survived, make a new cohort. ------------------------------! mask(ico) = n_survivors > 0.0 end do survivalloop + addco = count(mask) + else + addco = 0 end if !------------------------------------------------------------------------------------! @@ -1579,13 +1584,14 @@ subroutine insert_survivors(csite, np, cp, q, area_fac,poly_dest_type,mindbh_har !------------------------------------------------------------------------------------! if (npatch%ncohorts > 0) then nco = npatch%ncohorts - call allocate_patchtype(tpatch,count(mask) + npatch%ncohorts) + call allocate_patchtype(tpatch,addco + npatch%ncohorts) call copy_patchtype(npatch,tpatch,1,npatch%ncohorts,1,npatch%ncohorts) call deallocate_patchtype(npatch) else nco = 0 - call allocate_patchtype(tpatch,count(mask)) + call allocate_patchtype(tpatch,addco) end if + !------------------------------------------------------------------------------------! cohortloop: do ico = 1,cpatch%ncohorts diff --git a/ED/src/dynamics/euler_driver.f90 b/ED/src/dynamics/euler_driver.f90 index cfaebf24e..5eab8d5e9 100644 --- a/ED/src/dynamics/euler_driver.f90 +++ b/ED/src/dynamics/euler_driver.f90 @@ -16,11 +16,14 @@ subroutine euler_timestep(cgrid) use met_driver_coms , only : met_driv_state ! ! structure use grid_coms , only : nzg & ! intent(in) , nzs ! ! intent(in) - use ed_misc_coms , only : dtlsm ! ! intent(in) + use ed_misc_coms , only : current_time & ! intent(in) + , dtlsm ! ! intent(in) use ed_max_dims , only : n_dbh ! ! intent(in) use soil_coms , only : soil_rough & ! intent(in) , snow_rough ! ! intent(in) use therm_lib , only : tq2enthalpy ! ! function + use budget_utils , only : update_budget & ! function + , compute_budget ! ! function implicit none !----- Arguments -----------------------------------------------------------------------! type(edtype) , target :: cgrid @@ -34,6 +37,7 @@ subroutine euler_timestep(cgrid) integer :: ipa integer :: ico integer :: nsteps + integer :: imon real :: thetaatm real :: thetacan real :: rasveg @@ -55,8 +59,6 @@ subroutine euler_timestep(cgrid) real :: old_can_temp real :: old_can_prss real :: fm - !----- External functions. -------------------------------------------------------------! - real, external :: compute_netrad !---------------------------------------------------------------------------------------! polyloop: do ipy = 1,cgrid%npolygons @@ -66,6 +68,14 @@ subroutine euler_timestep(cgrid) csite => cpoly%site(isi) cmet => cpoly%met(isi) + !---------------------------------------------------------------------------------! + ! Update the monthly rainfall. ! + !---------------------------------------------------------------------------------! + imon = current_time%month + cpoly%avg_monthly_pcpg(imon,isi) = cpoly%avg_monthly_pcpg(imon,isi) & + + cmet%pcpg * dtlsm + !---------------------------------------------------------------------------------! + patchloop: do ipa = 1,csite%npatches cpatch => csite%patch(ipa) @@ -207,8 +217,11 @@ subroutine euler_timestep(cgrid) ,old_can_co2,old_can_rhos,old_can_temp,old_can_prss) !------------------------------------------------------------------------------! end do patchloop + !---------------------------------------------------------------------------------! end do siteloop + !------------------------------------------------------------------------------------! end do polyloop + !---------------------------------------------------------------------------------------! return end subroutine euler_timestep diff --git a/ED/src/dynamics/events.f90 b/ED/src/dynamics/events.f90 index 91c1d792c..5505ff960 100644 --- a/ED/src/dynamics/events.f90 +++ b/ED/src/dynamics/events.f90 @@ -294,6 +294,7 @@ subroutine event_harvest(agb_frac8,bgb_frac8,fol_frac8,stor_frac8) use allometry, only : bd2dbh, dbh2h, bl2dbh, bl2h, area_indices, ed_biomass use consts_coms, only : pio4 use ed_misc_coms , only : igrass ! ! intent(in) + use budget_utils , only : update_budget implicit none real(kind=8),intent(in) :: agb_frac8 real(kind=8),intent(in) :: bgb_frac8 @@ -457,6 +458,7 @@ subroutine event_planting(pft,density8) filltab_alltypes use pft_coms, only:sla,qsw,q,hgt_min use disturbance_utils,only: plant_patch + use budget_utils , only : update_budget implicit none integer(kind=4),intent(in) :: pft real(kind=8),intent(in) :: density8 @@ -524,6 +526,7 @@ subroutine event_fertilize(rval8) patchtype,allocate_patchtype,copy_patchtype,deallocate_patchtype use pft_coms, only:sla,qsw,q,hgt_min, agf_bs use disturbance_utils,only: plant_patch + use budget_utils , only : update_budget real(kind=8),intent(in),dimension(5) :: rval8 real :: nh4,no3,p,k,ca @@ -579,7 +582,7 @@ subroutine event_fertilize(rval8) end do -end subroutine +end subroutine event_fertilize subroutine event_irrigate(rval8) use grid_coms, only : ngrids,nzg @@ -693,6 +696,7 @@ subroutine event_till(rval8) use decomp_coms, only: f_labile use fuse_fiss_utils, only: terminate_cohorts use ed_therm_lib, only : calc_veg_hcap + use budget_utils , only : update_budget implicit none real(kind=8),intent(in) :: rval8 diff --git a/ED/src/dynamics/fire.f90 b/ED/src/dynamics/fire.f90 index 8506a01df..bf5eb03fc 100644 --- a/ED/src/dynamics/fire.f90 +++ b/ED/src/dynamics/fire.f90 @@ -37,6 +37,7 @@ subroutine fire_frequency(cgrid) integer :: isi integer :: ipa integer :: ico + integer :: imon integer :: k integer :: nsoil real :: ndaysi @@ -49,8 +50,11 @@ subroutine fire_frequency(cgrid) real :: ignition_rate real :: fire_scale real :: mean_fire_intensity + real :: sum_pcpg !---------------------------------------------------------------------------------------! + + !---------------------------------------------------------------------------------------! ! Find the number of days of last month so we can normalise the integrated ground ! ! water. ! @@ -60,14 +64,32 @@ subroutine fire_frequency(cgrid) !---------------------------------------------------------------------------------------! + !----- Current month. ------------------------------------------------------------------! + imon = current_time%month + !---------------------------------------------------------------------------------------! + !----- Loop over polygons and sites. ---------------------------------------------------! polyloop: do ipy = 1,cgrid%npolygons cpoly => cgrid%polygon(ipy) + + !------------------------------------------------------------------------------------! + ! Loop over all sites. ! + !------------------------------------------------------------------------------------! siteloop: do isi = 1,cpoly%nsites csite => cpoly%site(isi) + !---------------------------------------------------------------------------------! + ! Find the total rainfall of the past year and reset the counter for this ! + ! month. ! + !---------------------------------------------------------------------------------! + sum_pcpg = sum(cpoly%avg_monthly_pcpg(:,isi)) + cpoly%avg_monthly_pcpg(imon,isi) = 0. + !---------------------------------------------------------------------------------! + + + !----- Initialize ignition rate and the mean fire intensity (site variables). ----! ignition_rate = 0.0 mean_fire_intensity = 0.0 @@ -158,7 +180,7 @@ subroutine fire_frequency(cgrid) ! The threshold is independent on soil moisture. We use climatological ! ! water deficit instead. ! !---------------------------------------------------------------------------! - if (csite%avg_monthly_waterdef(ipa) > sm_fire) then + if (csite%avg_monthly_waterdef(ipa) >= sm_fire * sum_pcpg) then fire_intensity = fire_parameter mean_fire_intensity = mean_fire_intensity & + fire_intensity * csite%area(ipa) @@ -189,7 +211,7 @@ subroutine fire_frequency(cgrid) !----- Calculate fire disturbance rate [1/month]. --------------------------------! - cpoly%lambda_fire (current_time%month,isi) = ignition_rate + cpoly%lambda_fire (imon,isi) = ignition_rate if (mean_fire_intensity > 0.) then cpoly%ignition_rate (isi) = ignition_rate / mean_fire_intensity else diff --git a/ED/src/dynamics/forestry.f90 b/ED/src/dynamics/forestry.f90 index bd7252a32..38b93c373 100644 --- a/ED/src/dynamics/forestry.f90 +++ b/ED/src/dynamics/forestry.f90 @@ -27,6 +27,7 @@ subroutine apply_forestry(cpoly, isi, year) use grid_coms , only : nzg & ! intent(in) , nzs ! ! intent(in) use ed_misc_coms , only : ibigleaf ! ! intent(in) + use budget_utils , only : update_budget ! ! intent(in) implicit none !----- Arguments -----------------------------------------------------------------------! type(polygontype) , target :: cpoly diff --git a/ED/src/dynamics/growth_balive.f90 b/ED/src/dynamics/growth_balive.f90 index a510236ce..39219bd60 100644 --- a/ED/src/dynamics/growth_balive.f90 +++ b/ED/src/dynamics/growth_balive.f90 @@ -39,7 +39,7 @@ subroutine dbalive_dt(cgrid, tfact) use mortality , only : mortality_rates ! ! subroutine use fuse_fiss_utils , only : sort_cohorts ! ! subroutine use ed_misc_coms , only : igrass ! ! intent(in) - + use budget_utils , only : update_budget ! ! sub-routine implicit none !----- Arguments. -------------------------------------------------------------------! diff --git a/ED/src/dynamics/heun_driver.f90 b/ED/src/dynamics/heun_driver.f90 index 45c1a8081..7b380be07 100644 --- a/ED/src/dynamics/heun_driver.f90 +++ b/ED/src/dynamics/heun_driver.f90 @@ -16,11 +16,14 @@ subroutine heun_timestep(cgrid) use met_driver_coms , only : met_driv_state ! ! structure use grid_coms , only : nzg & ! intent(in) , nzs ! ! intent(in) - use ed_misc_coms , only : dtlsm ! ! intent(in) + use ed_misc_coms , only : current_time & ! intent(in) + , dtlsm ! ! intent(in) use ed_max_dims , only : n_dbh ! ! intent(in) use soil_coms , only : soil_rough & ! intent(in) , snow_rough ! ! intent(in) use therm_lib , only : tq2enthalpy ! ! function + use budget_utils , only : update_budget & ! function + , compute_budget ! ! function implicit none !----- Arguments -----------------------------------------------------------------------! type(edtype) , target :: cgrid @@ -33,6 +36,7 @@ subroutine heun_timestep(cgrid) integer :: isi integer :: ipa integer :: ico + integer :: imon integer :: nsteps real :: thetaatm real :: thetacan @@ -55,8 +59,6 @@ subroutine heun_timestep(cgrid) real :: old_can_temp real :: old_can_prss real :: fm - !----- External functions. -------------------------------------------------------------! - real, external :: compute_netrad !---------------------------------------------------------------------------------------! @@ -67,6 +69,14 @@ subroutine heun_timestep(cgrid) csite => cpoly%site(isi) cmet => cpoly%met(isi) + !---------------------------------------------------------------------------------! + ! Update the monthly rainfall. ! + !---------------------------------------------------------------------------------! + imon = current_time%month + cpoly%avg_monthly_pcpg(imon,isi) = cpoly%avg_monthly_pcpg(imon,isi) & + + cmet%pcpg * dtlsm + !---------------------------------------------------------------------------------! + patchloop: do ipa = 1,csite%npatches cpatch => csite%patch(ipa) @@ -206,8 +216,11 @@ subroutine heun_timestep(cgrid) ,old_can_co2,old_can_rhos,old_can_temp,old_can_prss) !------------------------------------------------------------------------------! end do patchloop + !---------------------------------------------------------------------------------! end do siteloop + !------------------------------------------------------------------------------------! end do polyloop + !---------------------------------------------------------------------------------------! return end subroutine heun_timestep diff --git a/ED/src/dynamics/hybrid_driver.f90 b/ED/src/dynamics/hybrid_driver.f90 index 6d35094e4..af1faf900 100644 --- a/ED/src/dynamics/hybrid_driver.f90 +++ b/ED/src/dynamics/hybrid_driver.f90 @@ -1,34 +1,34 @@ !=============================================================================! !=============================================================================! -! This subroutine is the main driver for the Forward/Backward (FB) -! Euler integration scheme. ! +! This subroutine is the main driver for the Forward/Backward (FB) ! +! Euler integration scheme. ! !-----------------------------------------------------------------------------! subroutine hybrid_timestep(cgrid) use rk4_coms , only : integration_vars & ! structure - , rk4patchtype & ! structure - , zero_rk4_patch & ! subroutine - , zero_rk4_cohort & ! subroutine - , zero_bdf2_patch & - , integration_buff & ! intent(out) - , rk4site & ! intent(out) - , bdf2patchtype & - , tbeg & - , tend & - , dtrk4 & - , dtrk4i - use rk4_driver , only : initp2modelp - + , rk4patchtype & ! structure + , zero_rk4_patch & ! subroutine + , zero_rk4_cohort & ! subroutine + , zero_bdf2_patch & + , integration_buff & ! intent(out) + , rk4site & ! intent(out) + , bdf2patchtype & + , tbeg & + , tend & + , dtrk4 & + , dtrk4i + use rk4_driver , only : initp2modelp use ed_state_vars , only : edtype & ! structure - , polygontype & ! structure - , sitetype & ! structure - , patchtype ! ! structure - + , polygontype & ! structure + , sitetype & ! structure + , patchtype ! ! structure use met_driver_coms , only : met_driv_state ! ! structure use grid_coms , only : nzg & ! intent(in) , nzs ! ! intent(in) - use ed_misc_coms , only : dtlsm ! ! intent(in) + use ed_misc_coms , only : current_time & ! intent(in) + , dtlsm ! ! intent(in) use therm_lib , only : tq2enthalpy ! ! function - + use budget_utils , only : update_budget & ! function + , compute_budget ! ! function implicit none !----- Arguments ----------------------------------------------------------! type(edtype) , target :: cgrid @@ -45,6 +45,7 @@ subroutine hybrid_timestep(cgrid) integer :: isi integer :: ipa integer :: ico + integer :: imon integer :: nsteps real :: thetaatm real :: thetacan @@ -73,7 +74,6 @@ subroutine hybrid_timestep(cgrid) logical , save :: first_time=.true. !----- External functions. -------------------------------------------------------------! - real, external :: compute_netrad real, external :: walltime !---------------------------------------------------------------------------------------! @@ -101,7 +101,15 @@ subroutine hybrid_timestep(cgrid) siteloop: do isi = 1,cpoly%nsites csite => cpoly%site(isi) cmet => cpoly%met(isi) - + + !---------------------------------------------------------------------! + ! Update the monthly rainfall. ! + !---------------------------------------------------------------------! + imon = current_time%month + cpoly%avg_monthly_pcpg(imon,isi) = cpoly%avg_monthly_pcpg(imon,isi) & + + cmet%pcpg * dtlsm + !---------------------------------------------------------------------! + patchloop: do ipa = 1,csite%npatches cpatch => csite%patch(ipa) @@ -263,7 +271,9 @@ subroutine hybrid_timestep(cgrid) ,old_can_co2,old_can_rhos,old_can_temp,old_can_prss) end do patchloop + !-------------------------------------------------------------------! end do siteloop + !----------------------------------------------------------------------! cgrid%walltime_py(ipy) = cgrid%walltime_py(ipy)+walltime(wtime0) diff --git a/ED/src/dynamics/reproduction.f90 b/ED/src/dynamics/reproduction.f90 index b876dd527..cadf06824 100644 --- a/ED/src/dynamics/reproduction.f90 +++ b/ED/src/dynamics/reproduction.f90 @@ -51,6 +51,7 @@ subroutine reproduction(cgrid, month) use grid_coms , only : nzg ! ! intent(in) use ed_misc_coms , only : ibigleaf ! ! intent(in) use phenology_aux , only : pheninit_balive_bstorage ! ! intent(in) + use budget_utils , only : update_budget ! ! sub-routine implicit none !----- Arguments -----------------------------------------------------------------------! type(edtype) , target :: cgrid diff --git a/ED/src/dynamics/rk4_derivs.F90 b/ED/src/dynamics/rk4_derivs.F90 index ff6882bfa..c4cda1707 100644 --- a/ED/src/dynamics/rk4_derivs.F90 +++ b/ED/src/dynamics/rk4_derivs.F90 @@ -848,7 +848,7 @@ subroutine canopy_derivs_two(mzg,initp,dinitp,csite,ipa,hflxgc,wflxgc,qwflxgc,de , fast_diagnostics ! ! intent(in) use canopy_struct_dynamics, only : vertical_vel_flux8 ! ! function use pft_coms , only : water_conductance ! ! intent(in) - + use budget_utils , only : compute_netrad ! ! function implicit none !----- Arguments -----------------------------------------------------------------------! type(sitetype) , target :: csite ! Current site @@ -937,7 +937,6 @@ subroutine canopy_derivs_two(mzg,initp,dinitp,csite,ipa,hflxgc,wflxgc,qwflxgc,de real(kind=8) :: max_dwdt,dwdt ! Used for capping leaf evap !----- Functions -----------------------------------------------------------------------! real(kind=4), external :: sngloff ! Safe dble 2 single precision - real(kind=4), external :: compute_netrad ! Net radiation. !---------------------------------------------------------------------------------------! diff --git a/ED/src/dynamics/rk4_driver.F90 b/ED/src/dynamics/rk4_driver.F90 index 08af78b1a..4ac1a14f3 100644 --- a/ED/src/dynamics/rk4_driver.F90 +++ b/ED/src/dynamics/rk4_driver.F90 @@ -25,8 +25,11 @@ subroutine rk4_timestep(cgrid,ifm) use met_driver_coms , only : met_driv_state ! ! structure use grid_coms , only : nzg & ! intent(in) , nzs ! ! intent(in) - use ed_misc_coms , only : current_time ! ! intent(in) + use ed_misc_coms , only : current_time & ! intent(in) + , dtlsm ! ! intent(in) use therm_lib , only : tq2enthalpy ! ! function + use budget_utils , only : update_budget & ! function + , compute_budget ! ! function implicit none !----------- Use MPI timing calls, need declarations --------------------------------! @@ -44,6 +47,7 @@ subroutine rk4_timestep(cgrid,ifm) integer :: ipa integer :: iun integer :: nsteps + integer :: imon real :: wcurr_loss2atm real :: ecurr_netrad real :: ecurr_loss2atm @@ -71,6 +75,16 @@ subroutine rk4_timestep(cgrid,ifm) csite => cpoly%site(isi) cmet => cpoly%met(isi) + + !------------------------------------------------------------------------------! + ! Update the monthly rainfall. ! + !------------------------------------------------------------------------------! + imon = current_time%month + cpoly%avg_monthly_pcpg(imon,isi) = cpoly%avg_monthly_pcpg(imon,isi) & + + cmet%pcpg * dtlsm + !------------------------------------------------------------------------------! + + patchloop: do ipa = 1,csite%npatches cpatch => csite%patch(ipa) @@ -215,9 +229,11 @@ subroutine rk4_timestep(cgrid,ifm) ,old_can_prss) !---------------------------------------------------------------------------! end do patchloop + !------------------------------------------------------------------------------! end do siteloop - + !---------------------------------------------------------------------------------! end do polygonloop + !------------------------------------------------------------------------------------! return end subroutine rk4_timestep diff --git a/ED/src/init/ed_init_atm.F90 b/ED/src/init/ed_init_atm.F90 index 03915ef74..8c4bac66d 100644 --- a/ED/src/init/ed_init_atm.F90 +++ b/ED/src/init/ed_init_atm.F90 @@ -45,6 +45,7 @@ subroutine ed_init_atm() , cmtl2uext ! ! function use met_driver_coms , only : met_driv_state ! ! structure use canopy_struct_dynamics, only : canopy_turbulence ! ! subroutine + use budget_utils , only : update_budget ! ! subroutine implicit none !----- Local variables. ----------------------------------------------------------------! type(edtype) , pointer :: cgrid diff --git a/ED/src/init/ed_type_init.f90 b/ED/src/init/ed_type_init.f90 index 2291e289a..505409971 100644 --- a/ED/src/init/ed_type_init.f90 +++ b/ED/src/init/ed_type_init.f90 @@ -705,6 +705,16 @@ subroutine init_ed_site_vars(cpoly, lat) !---------------------------------------------------------------------------------------! + !---------------------------------------------------------------------------------------! + ! Initialise monthly rainfall with some arbitrary but high number. This will ! + ! probably prevent fires to happen at the first year, but all data will be replaced by ! + ! actual rainfall after 12 months. In the future we may initialise with climatological ! + ! rainfall. ! + !---------------------------------------------------------------------------------------! + cpoly%avg_monthly_pcpg(:,:) = 500. + !---------------------------------------------------------------------------------------! + + !---------------------------------------------------------------------------------------! ! Initialise several disturbance- and LU-related variables. ! !---------------------------------------------------------------------------------------! diff --git a/ED/src/io/average_utils.f90 b/ED/src/io/average_utils.f90 index 9bd550b4f..878836dd5 100644 --- a/ED/src/io/average_utils.f90 +++ b/ED/src/io/average_utils.f90 @@ -722,9 +722,8 @@ subroutine integrate_ed_daily_output_state(cgrid) siteloop: do isi=1, cpoly%nsites !---------------------------------------------------------------------------------! - ! Determine if there was any beam radiation, and compute the total (I think ! - ! rshort is always the total, but not sure. This is the same test done in the ! - ! radiation driver. ! + ! Determine if there is any beam radiation, and find the total. This is the ! + ! same test done in the radiation driver. ! !---------------------------------------------------------------------------------! if (cpoly%cosaoi(isi) <= cosz_min) then rshort_tot = cpoly%met(isi)%rshort_diffuse @@ -2353,8 +2352,13 @@ subroutine normalize_ed_daily_output_vars(cgrid) !---------------------------------------------------------------------------------! ! Find the average day length. ! !---------------------------------------------------------------------------------! - dtlsm_o_daylight = dtlsm / cpoly%daylight(isi) - frqsum_o_daylight = frqsum / cpoly%daylight(isi) + if (cpoly%daylight(isi) < dtlsm) then + dtlsm_o_daylight = 0. + frqsum_o_daylight = 0. + else + dtlsm_o_daylight = dtlsm / cpoly%daylight(isi) + frqsum_o_daylight = frqsum / cpoly%daylight(isi) + end if !---------------------------------------------------------------------------------! cpoly%dmean_co2_residual(isi) = cpoly%dmean_co2_residual(isi) & diff --git a/ED/src/io/ed_init_full_history.F90 b/ED/src/io/ed_init_full_history.F90 index 1f5ea472b..71849a2e8 100644 --- a/ED/src/io/ed_init_full_history.F90 +++ b/ED/src/io/ed_init_full_history.F90 @@ -2084,7 +2084,10 @@ end subroutine hdf_getslab_i memsize(2) = int(cpoly%nsites,8) memoffs(2) = 0_8 - call hdf_getslab_r(cpoly%lambda_fire,'LAMBDA_FIRE ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpoly%lambda_fire ,'LAMBDA_FIRE ' & + ,dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpoly%avg_monthly_pcpg,'AVG_MONTHLY_PCPG ' & + ,dsetrank,iparallel,.true.,foundvar) dsetrank = 3_8 globdims(1:2) = int(n_dist_types,8) diff --git a/ED/src/io/ed_opspec.F90 b/ED/src/io/ed_opspec.F90 index 5c2416e56..e4a5bc0b7 100644 --- a/ED/src/io/ed_opspec.F90 +++ b/ED/src/io/ed_opspec.F90 @@ -1897,9 +1897,9 @@ subroutine ed_opspec_misc select case (include_fire) case(3) - if (sm_fire < 0.) then + if (sm_fire < 0. .or. sm_fire > 2) then write (reason,fmt='(a,1x,a,1x,i4,a,1x,es12.5,a)') & - 'Invalid SM_FIRE, it must be non-negative' & + 'Invalid SM_FIRE, it must be between 0 and 2' & ,'when INLCUDE_FIRE is ',include_fire,'. Your SM_FIRE is set to' & ,sm_fire,'...' call opspec_fatal(reason,'opspec_misc') diff --git a/ED/src/memory/ed_state_vars.f90 b/ED/src/memory/ed_state_vars.f90 index e29936165..b1d01cd8a 100644 --- a/ED/src/memory/ed_state_vars.f90 +++ b/ED/src/memory/ed_state_vars.f90 @@ -1253,6 +1253,7 @@ module ed_state_vars ! or not recruits come up this month. real,pointer,dimension(:) :: min_monthly_temp + !----------------------------------- ! FORESTRY !----------------------------------- @@ -1296,6 +1297,8 @@ module ed_state_vars real,pointer,dimension(:) :: ignition_rate real,pointer, dimension(:,:) :: lambda_fire ! initialized in create_site !(12,nsites) + ! Monthly rainfall [mm/month] for each month over the past 12 months. + real,pointer,dimension(:,:) :: avg_monthly_pcpg type(prescribed_phen),pointer, dimension(:) :: phen_pars @@ -2991,6 +2994,7 @@ subroutine allocate_polygontype(cpoly,nsites) allocate(cpoly%fire_disturbance_rate(nsites)) allocate(cpoly%ignition_rate(nsites)) allocate(cpoly%lambda_fire(12,nsites)) + allocate(cpoly%avg_monthly_pcpg(12,nsites)) allocate(cpoly%phen_pars(nsites))!THIS PTR IS ALLOCATED IN PHENOLOGY_INIT allocate(cpoly%nat_disturbance_rate(nsites)) allocate(cpoly%nat_dist_type(nsites)) @@ -4274,6 +4278,7 @@ subroutine nullify_polygontype(cpoly) nullify(cpoly%fire_disturbance_rate) nullify(cpoly%ignition_rate) nullify(cpoly%lambda_fire) + nullify(cpoly%avg_monthly_pcpg) nullify(cpoly%phen_pars) nullify(cpoly%nat_disturbance_rate) nullify(cpoly%nat_dist_type) @@ -5537,6 +5542,7 @@ subroutine deallocate_polygontype(cpoly) if(associated(cpoly%fire_disturbance_rate )) deallocate(cpoly%fire_disturbance_rate ) if(associated(cpoly%ignition_rate )) deallocate(cpoly%ignition_rate ) if(associated(cpoly%lambda_fire )) deallocate(cpoly%lambda_fire ) + if(associated(cpoly%avg_monthly_pcpg )) deallocate(cpoly%avg_monthly_pcpg ) if(associated(cpoly%phen_pars )) deallocate(cpoly%phen_pars ) if(associated(cpoly%nat_disturbance_rate )) deallocate(cpoly%nat_disturbance_rate ) if(associated(cpoly%nat_dist_type )) deallocate(cpoly%nat_dist_type ) @@ -12405,8 +12411,15 @@ subroutine filltab_polygontype(igr,ipy,init) if (associated(cpoly%lambda_fire)) then nvar=nvar+1 - call vtable_edio_r(npts,cpoly%lambda_fire,nvar,igr,init,cpoly%siglob_id & - ,var_len,var_len_global,max_ptrs,'LAMBDA_FIRE :29:hist') + call vtable_edio_r(npts,cpoly%lambda_fire,nvar,igr,init,cpoly%siglob_id & + ,var_len,var_len_global,max_ptrs,'LAMBDA_FIRE :29:hist') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if (associated(cpoly%avg_monthly_pcpg)) then + nvar=nvar+1 + call vtable_edio_r(npts,cpoly%avg_monthly_pcpg,nvar,igr,init,cpoly%siglob_id & + ,var_len,var_len_global,max_ptrs,'AVG_MONTHLY_PCPG :29:hist') call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') end if !------------------------------------------------------------------------------------! diff --git a/ED/src/utils/budget_utils.f90 b/ED/src/utils/budget_utils.f90 index e9f9efc5c..37c3dc34b 100644 --- a/ED/src/utils/budget_utils.f90 +++ b/ED/src/utils/budget_utils.f90 @@ -1,471 +1,488 @@ !==========================================================================================! !==========================================================================================! -! This subroutine simply updates the budget variables. ! +! This module contains functions and routines to evaluate the budgets of water, ! +! enthalpy, and carbon dioxide. ! !------------------------------------------------------------------------------------------! -subroutine update_budget(csite,lsl,ipaa,ipaz) - - use ed_state_vars, only : sitetype ! ! structure - implicit none - - !----- Arguments -----------------------------------------------------------------------! - type(sitetype) , target :: csite - integer , intent(in) :: lsl - integer , intent(in) :: ipaa - integer , intent(in) :: ipaz - !----- Local variables. ----------------------------------------------------------------! - integer :: ipa - !----- External functions. -------------------------------------------------------------! - real , external :: compute_water_storage - real , external :: compute_energy_storage - real , external :: compute_co2_storage - !---------------------------------------------------------------------------------------! +module budget_utils + !=======================================================================================! + !=======================================================================================! - do ipa=ipaa,ipaz - !------------------------------------------------------------------------------------! - ! Computing the storage terms for CO2, energy, and water budgets. ! - !------------------------------------------------------------------------------------! - csite%co2budget_initialstorage(ipa) = compute_co2_storage(csite,ipa) - csite%wbudget_initialstorage(ipa) = compute_water_storage(csite,lsl,ipa) - csite%ebudget_initialstorage(ipa) = compute_energy_storage(csite,lsl,ipa) - end do - return -end subroutine update_budget -!==========================================================================================! -!==========================================================================================! + contains + !=======================================================================================! + !=======================================================================================! + ! This subroutine simply updates the budget variables. ! + !---------------------------------------------------------------------------------------! + subroutine update_budget(csite,lsl,ipaa,ipaz) + + use ed_state_vars, only : sitetype ! ! structure + implicit none + !----- Arguments --------------------------------------------------------------------! + type(sitetype) , target :: csite + integer , intent(in) :: lsl + integer , intent(in) :: ipaa + integer , intent(in) :: ipaz + !----- Local variables. -------------------------------------------------------------! + integer :: ipa + !------------------------------------------------------------------------------------! -!==========================================================================================! -!==========================================================================================! -subroutine compute_budget(csite,lsl,pcpg,qpcpg,ipa,wcurr_loss2atm,ecurr_netrad & - ,ecurr_loss2atm,co2curr_loss2atm,wcurr_loss2drainage & - ,ecurr_loss2drainage,wcurr_loss2runoff,ecurr_loss2runoff & - ,site_area,cbudget_nep,old_can_enthalpy,old_can_shv,old_can_co2 & - ,old_can_rhos,old_can_temp,old_can_prss) - use ed_state_vars, only : sitetype ! ! structure - use ed_max_dims , only : str_len ! ! intent(in) - use ed_misc_coms , only : dtlsm & ! intent(in) - , fast_diagnostics & ! intent(in) - , current_time ! ! intent(in) - use ed_max_dims , only : n_dbh ! ! intent(in) - use consts_coms , only : umol_2_kgC & ! intent(in) - , day_sec & ! intent(in) - , rdry & ! intent(in) - , mmdryi & ! intent(in) - , epim1 ! ! intent(in) - use rk4_coms , only : rk4eps & ! intent(in) - , print_budget & ! intent(in) - , budget_pref & ! intent(in) - , checkbudget ! ! intent(in) - use therm_lib , only : tq2enthalpy ! ! function - implicit none - !----- Arguments -----------------------------------------------------------------------! - type(sitetype) , target :: csite - real , intent(inout) :: pcpg - real , intent(inout) :: qpcpg - real , intent(inout) :: co2curr_loss2atm - real , intent(inout) :: ecurr_netrad - real , intent(inout) :: ecurr_loss2atm - real , intent(inout) :: ecurr_loss2drainage - real , intent(inout) :: ecurr_loss2runoff - real , intent(inout) :: wcurr_loss2atm - real , intent(inout) :: wcurr_loss2drainage - real , intent(inout) :: wcurr_loss2runoff - integer , intent(in) :: lsl - integer , intent(in) :: ipa - real , intent(in) :: site_area - real , intent(inout) :: cbudget_nep - real , intent(in) :: old_can_enthalpy - real , intent(in) :: old_can_shv - real , intent(in) :: old_can_co2 - real , intent(in) :: old_can_rhos - real , intent(in) :: old_can_temp - real , intent(in) :: old_can_prss - !----- Local variables -----------------------------------------------------------------! - character(len=str_len) :: budget_fout - real, dimension(n_dbh) :: gpp_dbh - real :: co2budget_finalstorage - real :: co2budget_deltastorage - real :: co2curr_gpp - real :: co2curr_leafresp - real :: co2curr_rootresp - real :: co2curr_growthresp - real :: co2curr_storageresp - real :: co2curr_vleafresp - real :: co2curr_hetresp - real :: co2curr_nep - real :: co2curr_denseffect - real :: co2curr_residual - real :: ebudget_finalstorage - real :: ebudget_deltastorage - real :: ecurr_precipgain - real :: ecurr_denseffect - real :: ecurr_prsseffect - real :: ecurr_residual - real :: wbudget_finalstorage - real :: wbudget_deltastorage - real :: wcurr_precipgain - real :: wcurr_denseffect - real :: wcurr_residual - real :: curr_can_enthalpy - real :: gpp - real :: leaf_resp - real :: root_resp - real :: growth_resp - real :: storage_resp - real :: vleaf_resp - real :: co2_factor - real :: ene_factor - real :: h2o_factor - integer :: jpa - logical :: isthere - logical :: co2_ok - logical :: energy_ok - logical :: water_ok - !----- Local constants. ----------------------------------------------------------------! - character(len=13) , parameter :: fmtf='(a,1x,es14.7)' - character(len=10) , parameter :: bhfmt='(31(a,1x))' - character(len=48) , parameter :: bbfmt='(3(i13,1x),28(es13.6,1x))' - !----- External functions. -------------------------------------------------------------! - real , external :: compute_netrad - real , external :: compute_water_storage - real , external :: compute_energy_storage - real , external :: compute_co2_storage - real , external :: ddens_dt_effect - !----- Locally saved variables. --------------------------------------------------------! - logical , save :: first_time = .true. - !---------------------------------------------------------------------------------------! + do ipa=ipaa,ipaz + !---------------------------------------------------------------------------------! + ! Computing the storage terms for CO2, energy, and water budgets. ! + !---------------------------------------------------------------------------------! + csite%co2budget_initialstorage(ipa) = compute_co2_storage(csite,ipa) + csite%wbudget_initialstorage(ipa) = compute_water_storage(csite,lsl,ipa) + csite%ebudget_initialstorage(ipa) = compute_energy_storage(csite,lsl,ipa) + end do + return + end subroutine update_budget + !=======================================================================================! + !=======================================================================================! + + + + + + + !=======================================================================================! + !=======================================================================================! + subroutine compute_budget(csite,lsl,pcpg,qpcpg,ipa,wcurr_loss2atm,ecurr_netrad & + ,ecurr_loss2atm,co2curr_loss2atm,wcurr_loss2drainage & + ,ecurr_loss2drainage,wcurr_loss2runoff,ecurr_loss2runoff & + ,site_area,cbudget_nep,old_can_enthalpy,old_can_shv & + ,old_can_co2,old_can_rhos,old_can_temp,old_can_prss) + use ed_state_vars, only : sitetype ! ! structure + use ed_max_dims , only : str_len ! ! intent(in) + use ed_misc_coms , only : dtlsm & ! intent(in) + , fast_diagnostics & ! intent(in) + , current_time ! ! intent(in) + use ed_max_dims , only : n_dbh ! ! intent(in) + use consts_coms , only : umol_2_kgC & ! intent(in) + , day_sec & ! intent(in) + , rdry & ! intent(in) + , mmdryi & ! intent(in) + , epim1 ! ! intent(in) + use rk4_coms , only : rk4eps & ! intent(in) + , print_budget & ! intent(in) + , budget_pref & ! intent(in) + , checkbudget ! ! intent(in) + use therm_lib , only : tq2enthalpy ! ! function + implicit none + !----- Arguments --------------------------------------------------------------------! + type(sitetype) , target :: csite + real , intent(inout) :: pcpg + real , intent(inout) :: qpcpg + real , intent(inout) :: co2curr_loss2atm + real , intent(inout) :: ecurr_netrad + real , intent(inout) :: ecurr_loss2atm + real , intent(inout) :: ecurr_loss2drainage + real , intent(inout) :: ecurr_loss2runoff + real , intent(inout) :: wcurr_loss2atm + real , intent(inout) :: wcurr_loss2drainage + real , intent(inout) :: wcurr_loss2runoff + integer , intent(in) :: lsl + integer , intent(in) :: ipa + real , intent(in) :: site_area + real , intent(inout) :: cbudget_nep + real , intent(in) :: old_can_enthalpy + real , intent(in) :: old_can_shv + real , intent(in) :: old_can_co2 + real , intent(in) :: old_can_rhos + real , intent(in) :: old_can_temp + real , intent(in) :: old_can_prss + !----- Local variables --------------------------------------------------------------! + character(len=str_len) :: budget_fout + real, dimension(n_dbh) :: gpp_dbh + real :: co2budget_finalstorage + real :: co2budget_deltastorage + real :: co2curr_gpp + real :: co2curr_leafresp + real :: co2curr_rootresp + real :: co2curr_growthresp + real :: co2curr_storageresp + real :: co2curr_vleafresp + real :: co2curr_hetresp + real :: co2curr_nep + real :: co2curr_denseffect + real :: co2curr_residual + real :: ebudget_finalstorage + real :: ebudget_deltastorage + real :: ecurr_precipgain + real :: ecurr_denseffect + real :: ecurr_prsseffect + real :: ecurr_residual + real :: wbudget_finalstorage + real :: wbudget_deltastorage + real :: wcurr_precipgain + real :: wcurr_denseffect + real :: wcurr_residual + real :: curr_can_enthalpy + real :: gpp + real :: leaf_resp + real :: root_resp + real :: growth_resp + real :: storage_resp + real :: vleaf_resp + real :: co2_factor + real :: ene_factor + real :: h2o_factor + integer :: jpa + logical :: isthere + logical :: co2_ok + logical :: energy_ok + logical :: water_ok + !----- Local constants. -------------------------------------------------------------! + character(len=13) , parameter :: fmtf='(a,1x,es14.7)' + character(len=10) , parameter :: bhfmt='(31(a,1x))' + character(len=48) , parameter :: bbfmt='(3(i13,1x),28(es13.6,1x))' + !----- Locally saved variables. -----------------------------------------------------! + logical , save :: first_time = .true. + !------------------------------------------------------------------------------------! - !---------------------------------------------------------------------------------------! - ! If this is the first time, we initialise all files with their headers. ! - !---------------------------------------------------------------------------------------! - if (first_time) then - do jpa = 1, csite%npatches - write(budget_fout,fmt='(2a,i4.4,a)') trim(budget_pref),'patch_',jpa,'.txt' - inquire(file=trim(budget_fout),exist=isthere) - if (isthere) then - !---- Open the file to delete when closing. -----------------------------------! - open (unit=86,file=trim(budget_fout),status='old',action='write') - close(unit=86,status='delete') - end if - !---------------------------------------------------------------------------------! - if (print_budget) then + !------------------------------------------------------------------------------------! + ! If this is the first time, we initialise all files with their headers. ! + !------------------------------------------------------------------------------------! + if (first_time) then + do jpa = 1, csite%npatches + write(budget_fout,fmt='(2a,i4.4,a)') trim(budget_pref),'patch_',jpa,'.txt' + inquire(file=trim(budget_fout),exist=isthere) + if (isthere) then + !---- Open the file to delete when closing. --------------------------------! + open (unit=86,file=trim(budget_fout),status='old',action='write') + close(unit=86,status='delete') + end if !------------------------------------------------------------------------------! - open (unit=86,file=trim(budget_fout),status='replace',action='write') - write(unit=86,fmt=bhfmt) ' YEAR' , ' MONTH' , ' DAY' & - , ' TIME' , ' LAI' , ' WAI' & - , ' HEIGHT' , ' CO2.STORAGE' , ' CO2.RESIDUAL' & - , ' CO2.DSTORAGE' , ' CO2.NEP' , ' CO2.DENS.EFF' & - , ' CO2.LOSS2ATM' , ' ENE.STORAGE' , ' ENE.RESIDUAL' & - , ' ENE.DSTORAGE' , ' ENE.PRECIP' , ' ENE.NETRAD' & - , ' ENE.DENS.EFF' , ' ENE.PRSS.EFF' , ' ENE.LOSS2ATM' & - , ' ENE.DRAINAGE' , ' ENE.RUNOFF' , ' H2O.STORAGE' & - , ' H2O.RESIDUAL' , ' H2O.DSTORAGE' , ' H2O.PRECIP' & - , ' H2O.DENS.EFF' , ' H2O.LOSS2ATM' , ' H2O.DRAINAGE' & - , ' H2O.RUNOFF' - - close(unit=86,status='keep') - end if - end do - first_time = .false. - end if - !---------------------------------------------------------------------------------------! + if (print_budget) then + !---------------------------------------------------------------------------! + open (unit=86,file=trim(budget_fout),status='replace',action='write') + write(unit=86,fmt=bhfmt) ' YEAR' , ' MONTH' & + , ' DAY' , ' TIME' & + , ' LAI' , ' WAI' & + , ' HEIGHT' , ' CO2.STORAGE' & + , ' CO2.RESIDUAL' , ' CO2.DSTORAGE' & + , ' CO2.NEP' , ' CO2.DENS.EFF' & + , ' CO2.LOSS2ATM' , ' ENE.STORAGE' & + , ' ENE.RESIDUAL' , ' ENE.DSTORAGE' & + , ' ENE.PRECIP' , ' ENE.NETRAD' & + , ' ENE.DENS.EFF' , ' ENE.PRSS.EFF' & + , ' ENE.LOSS2ATM' , ' ENE.DRAINAGE' & + , ' ENE.RUNOFF' , ' H2O.STORAGE' & + , ' H2O.RESIDUAL' , ' H2O.DSTORAGE' & + , ' H2O.PRECIP' , ' H2O.DENS.EFF' & + , ' H2O.LOSS2ATM' , ' H2O.DRAINAGE' & + , ' H2O.RUNOFF' + + close(unit=86,status='keep') + end if + end do + first_time = .false. + end if + !------------------------------------------------------------------------------------! - !---------------------------------------------------------------------------------------! - ! Compute gain in water and energy due to precipitation. ! - !---------------------------------------------------------------------------------------! - wcurr_precipgain = pcpg * dtlsm - ecurr_precipgain = qpcpg * dtlsm - !---------------------------------------------------------------------------------------! + !------------------------------------------------------------------------------------! + ! Compute gain in water and energy due to precipitation. ! + !------------------------------------------------------------------------------------! + wcurr_precipgain = pcpg * dtlsm + ecurr_precipgain = qpcpg * dtlsm + !------------------------------------------------------------------------------------! - !---------------------------------------------------------------------------------------! - ! Compute the density and pressure effects. We seek the conservation of the ! - ! extensive properties [X/m2], but the canopy air space solves the intensive quantities ! - ! instead [X/mol or X/kg]. Because density is not constant within the time step, and ! - ! during the integration we solve the intensive form for the canopy air space, we must ! - ! subtract the density effect from the residual. The derivation is shown below. The ! - ! storage term is what we aim at, but in reality we solve the equations after the >>>. ! - ! ! - ! dM d(rho*z*m) dm d(rho) ! - ! ---- = I - L -> ------------ = I - L >>> rho * z * ---- = I - L - m * z * -------- ! - ! dt dt dt dt ! - ! ! - ! where M is the extensive propery, I is the input flux, L is the loss flux, z is the ! - ! canopy air space depth, and rho is the canopy air space density. ! - ! For the specific case of enthalpy, we also compute the pressure effect between ! - ! time steps. We cannot guarantee conservation of enthalpy when we update pressure, ! - ! because of the first law of thermodynamics (the way to address this would be to use ! - ! equivalent potential temperature, which is enthalpy plus pressure effect). Enthalpy ! - ! is preserved within one time step, once pressure is updated and remains constant. ! - ! ! - ! dH dp dh dp d(rho) ! - ! ---- - V * ---- = Q >>> rho * z * ---- = Q + z * ---- - m * z * -------- ! - ! dt dt dt dt dt ! - ! ! - ! where p is the canopy air space pressure, Q is the net heat exchange, V is the volume ! - ! of the canopy air space. ! - !---------------------------------------------------------------------------------------! - !------ CO2. Density effect only. -----------------------------------------------------! - co2curr_denseffect = ddens_dt_effect(old_can_rhos,csite%can_rhos(ipa) & - ,old_can_co2,csite%can_co2(ipa) & - ,csite%can_depth(ipa),mmdryi) - !------ Water. Density effect only. ----------------------------------------------------! - wcurr_denseffect = ddens_dt_effect(old_can_rhos,csite%can_rhos(ipa) & - ,old_can_shv,csite%can_shv(ipa) & - ,csite%can_depth(ipa),1.) - !------ Enthalpy. Density and pressure effects. ---------------------------------------! - curr_can_enthalpy = tq2enthalpy(csite%can_temp(ipa),csite%can_shv(ipa),.true.) - ecurr_denseffect = ddens_dt_effect(old_can_rhos,csite%can_rhos(ipa) & - ,old_can_enthalpy, curr_can_enthalpy & - ,csite%can_depth(ipa),1.0) - ecurr_prsseffect = csite%can_depth(ipa) * (csite%can_prss(ipa) - old_can_prss) - !---------------------------------------------------------------------------------------! + !------------------------------------------------------------------------------------! + ! Compute the density and pressure effects. We seek the conservation of the ! + ! extensive properties [X/m2], but the canopy air space solves the intensive ! + ! quantities instead [X/mol or X/kg]. Because density is not constant within the ! + ! time step, and during the integration we solve the intensive form for the canopy ! + ! air space, we must subtract the density effect from the residual. The derivation ! + ! is shown below. The storage term is what we aim at, but in reality we solve the ! + ! equations after the >>>. ! + ! ! + ! dM d(rho*z*m) dm d(rho) ! + ! ---- = I - L -> ------------ = I - L >>> rho * z * ---- = I - L - m * z * -------- ! + ! dt dt dt dt ! + ! ! + ! where M is the extensive propery, I is the input flux, L is the loss flux, z is ! + ! the canopy air space depth, and rho is the canopy air space density. ! + ! For the specific case of enthalpy, we also compute the pressure effect between ! + ! time steps. We cannot guarantee conservation of enthalpy when we update pressure, ! + ! because of the first law of thermodynamics (the way to address this would be to ! + ! use equivalent potential temperature, which is enthalpy plus pressure effect). ! + ! Enthalpy is preserved within one time step, once pressure is updated and remains ! + ! constant. ! + ! ! + ! dH dp dh dp d(rho) ! + ! ---- - V * ---- = Q >>> rho * z * ---- = Q + z * ---- - m * z * -------- ! + ! dt dt dt dt dt ! + ! ! + ! where p is the canopy air space pressure, Q is the net heat exchange, V is the ! + ! volume of the canopy air space. ! + !------------------------------------------------------------------------------------! + !------ CO2. Density effect only. --------------------------------------------------! + co2curr_denseffect = ddens_dt_effect(old_can_rhos,csite%can_rhos(ipa) & + ,old_can_co2,csite%can_co2(ipa) & + ,csite%can_depth(ipa),mmdryi) + !------ Water. Density effect only. -------------------------------------------------! + wcurr_denseffect = ddens_dt_effect(old_can_rhos,csite%can_rhos(ipa) & + ,old_can_shv,csite%can_shv(ipa) & + ,csite%can_depth(ipa),1.) + !------ Enthalpy. Density and pressure effects. ------------------------------------! + curr_can_enthalpy = tq2enthalpy(csite%can_temp(ipa),csite%can_shv(ipa),.true.) + ecurr_denseffect = ddens_dt_effect(old_can_rhos,csite%can_rhos(ipa) & + ,old_can_enthalpy, curr_can_enthalpy & + ,csite%can_depth(ipa),1.0) + ecurr_prsseffect = csite%can_depth(ipa) * (csite%can_prss(ipa) - old_can_prss) + !------------------------------------------------------------------------------------! - !---------------------------------------------------------------------------------------! - ! Compute the carbon flux components. ! - !---------------------------------------------------------------------------------------! - call sum_plant_cfluxes(csite,ipa,gpp,gpp_dbh,leaf_resp,root_resp,growth_resp & - ,storage_resp,vleaf_resp) - co2curr_gpp = gpp * dtlsm - co2curr_leafresp = leaf_resp * dtlsm - co2curr_rootresp = root_resp * dtlsm - co2curr_growthresp = growth_resp * dtlsm - co2curr_storageresp = storage_resp * dtlsm - co2curr_vleafresp = vleaf_resp * dtlsm - co2curr_hetresp = csite%rh(ipa) * dtlsm - co2curr_nep = co2curr_gpp - co2curr_leafresp - co2curr_rootresp & - - co2curr_growthresp - co2curr_storageresp - co2curr_vleafresp & - - co2curr_hetresp - cbudget_nep = cbudget_nep + site_area * csite%area(ipa) * co2curr_nep & - * umol_2_kgC - - - !----- Compute current storage terms. --------------------------------------------------! - co2budget_finalstorage = compute_co2_storage(csite,ipa) - wbudget_finalstorage = compute_water_storage(csite,lsl,ipa) - ebudget_finalstorage = compute_energy_storage(csite,lsl,ipa) - - !----- Compute the change in storage. --------------------------------------------------! - co2budget_deltastorage = co2budget_finalstorage - csite%co2budget_initialstorage(ipa) - wbudget_deltastorage = wbudget_finalstorage - csite%wbudget_initialstorage(ipa) - ebudget_deltastorage = ebudget_finalstorage - csite%ebudget_initialstorage(ipa) - !---------------------------------------------------------------------------------------! - ! Compute residuals. ! - !---------------------------------------------------------------------------------------! - !----- 1. Canopy CO2. ------------------------------------------------------------------! - co2curr_residual = co2budget_deltastorage - ( - co2curr_nep - co2curr_loss2atm ) & - - co2curr_denseffect - !----- 2. Energy. ----------------------------------------------------------------------! - ecurr_residual = ebudget_deltastorage - ( ecurr_precipgain - ecurr_loss2atm & - - ecurr_loss2drainage - ecurr_loss2runoff & - + ecurr_netrad + ecurr_prsseffect ) & - - ecurr_denseffect - !----- 3. Water. -----------------------------------------------------------------------! - wcurr_residual = wbudget_deltastorage - ( wcurr_precipgain - wcurr_loss2atm & - - wcurr_loss2drainage - wcurr_loss2runoff ) & - - wcurr_denseffect - !---------------------------------------------------------------------------------------! + !------------------------------------------------------------------------------------! + ! Compute the carbon flux components. ! + !------------------------------------------------------------------------------------! + call sum_plant_cfluxes(csite,ipa,gpp,gpp_dbh,leaf_resp,root_resp,growth_resp & + ,storage_resp,vleaf_resp) + co2curr_gpp = gpp * dtlsm + co2curr_leafresp = leaf_resp * dtlsm + co2curr_rootresp = root_resp * dtlsm + co2curr_growthresp = growth_resp * dtlsm + co2curr_storageresp = storage_resp * dtlsm + co2curr_vleafresp = vleaf_resp * dtlsm + co2curr_hetresp = csite%rh(ipa) * dtlsm + co2curr_nep = co2curr_gpp - co2curr_leafresp - co2curr_rootresp & + - co2curr_growthresp - co2curr_storageresp - co2curr_vleafresp & + - co2curr_hetresp + cbudget_nep = cbudget_nep + site_area * csite%area(ipa) * co2curr_nep & + * umol_2_kgC + + + !----- Compute current storage terms. -----------------------------------------------! + co2budget_finalstorage = compute_co2_storage(csite,ipa) + wbudget_finalstorage = compute_water_storage(csite,lsl,ipa) + ebudget_finalstorage = compute_energy_storage(csite,lsl,ipa) + + !----- Compute the change in storage. -----------------------------------------------! + co2budget_deltastorage = co2budget_finalstorage - csite%co2budget_initialstorage(ipa) + wbudget_deltastorage = wbudget_finalstorage - csite%wbudget_initialstorage(ipa) + ebudget_deltastorage = ebudget_finalstorage - csite%ebudget_initialstorage(ipa) + !------------------------------------------------------------------------------------! + ! Compute residuals. ! + !------------------------------------------------------------------------------------! + !----- 1. Canopy CO2. ---------------------------------------------------------------! + co2curr_residual = co2budget_deltastorage & + - ( - co2curr_nep - co2curr_loss2atm ) & + - co2curr_denseffect + !----- 2. Energy. -------------------------------------------------------------------! + ecurr_residual = ebudget_deltastorage & + - ( ecurr_precipgain - ecurr_loss2atm - ecurr_loss2drainage & + - ecurr_loss2runoff + ecurr_netrad + ecurr_prsseffect ) & + - ecurr_denseffect + !----- 3. Water. --------------------------------------------------------------------! + wcurr_residual = wbudget_deltastorage & + - ( wcurr_precipgain - wcurr_loss2atm & + - wcurr_loss2drainage - wcurr_loss2runoff ) & + - wcurr_denseffect + !------------------------------------------------------------------------------------! - !---------------------------------------------------------------------------------------! - ! Integrate residuals. ! - !---------------------------------------------------------------------------------------! - !----- 1. Canopy CO2. ------------------------------------------------------------------! - csite%co2budget_residual(ipa) = csite%co2budget_residual(ipa) + co2curr_residual - !----- 2. Energy. ----------------------------------------------------------------------! - csite%ebudget_residual(ipa) = csite%ebudget_residual(ipa) + ecurr_residual - !----- 3. Water. -----------------------------------------------------------------------! - csite%wbudget_residual(ipa) = csite%wbudget_residual(ipa) + wcurr_residual - !---------------------------------------------------------------------------------------! - !---------------------------------------------------------------------------------------! - ! Integrate the terms that are part of the budget. ! - !---------------------------------------------------------------------------------------! - !----- 1. Carbon dioxide. --------------------------------------------------------------! - csite%co2budget_gpp(ipa) = csite%co2budget_gpp(ipa) + gpp * dtlsm - csite%co2budget_gpp_dbh(:,ipa) = csite%co2budget_gpp_dbh(:,ipa) + gpp_dbh(:) * dtlsm - csite%co2budget_plresp(ipa) = csite%co2budget_plresp(ipa) & - + ( leaf_resp + root_resp + growth_resp + storage_resp & - + vleaf_resp ) * dtlsm - csite%co2budget_rh(ipa) = csite%co2budget_rh(ipa) & - + csite%rh(ipa) * dtlsm - csite%co2budget_cwd_rh(ipa) = csite%co2budget_cwd_rh(ipa) & - + csite%cwd_rh(ipa) * dtlsm - csite%co2budget_denseffect(ipa) = csite%co2budget_denseffect(ipa) + co2curr_denseffect - csite%co2budget_loss2atm(ipa) = csite%co2budget_loss2atm(ipa) + co2curr_loss2atm - !----- 2. Energy. ----------------------------------------------------------------------! - csite%ebudget_precipgain(ipa) = csite%ebudget_precipgain(ipa) + ecurr_precipgain - csite%ebudget_netrad(ipa) = csite%ebudget_netrad(ipa) + ecurr_netrad - csite%ebudget_prsseffect(ipa) = csite%ebudget_prsseffect(ipa) + ecurr_prsseffect - csite%ebudget_denseffect(ipa) = csite%ebudget_denseffect(ipa) + ecurr_denseffect - csite%ebudget_loss2atm(ipa) = csite%ebudget_loss2atm(ipa) + ecurr_loss2atm - csite%ebudget_loss2drainage(ipa) = csite%ebudget_loss2drainage(ipa) & - + ecurr_loss2drainage - csite%ebudget_loss2runoff(ipa) = csite%ebudget_loss2runoff(ipa) & - + ecurr_loss2runoff - !----- 3. Water. -----------------------------------------------------------------------! - csite%wbudget_precipgain(ipa) = csite%wbudget_precipgain(ipa) + wcurr_precipgain - csite%wbudget_denseffect(ipa) = csite%wbudget_denseffect(ipa) + wcurr_denseffect - csite%wbudget_loss2atm(ipa) = csite%wbudget_loss2atm(ipa) + wcurr_loss2atm - csite%wbudget_loss2drainage(ipa) = csite%wbudget_loss2drainage(ipa) & - + wcurr_loss2drainage - csite%wbudget_loss2runoff(ipa) = csite%wbudget_loss2runoff(ipa) & - + wcurr_loss2runoff - !---------------------------------------------------------------------------------------! + !------------------------------------------------------------------------------------! + ! Integrate residuals. ! + !------------------------------------------------------------------------------------! + !----- 1. Canopy CO2. ---------------------------------------------------------------! + csite%co2budget_residual(ipa) = csite%co2budget_residual(ipa) + co2curr_residual + !----- 2. Energy. -------------------------------------------------------------------! + csite%ebudget_residual(ipa) = csite%ebudget_residual(ipa) + ecurr_residual + !----- 3. Water. --------------------------------------------------------------------! + csite%wbudget_residual(ipa) = csite%wbudget_residual(ipa) + wcurr_residual + !------------------------------------------------------------------------------------! + !------------------------------------------------------------------------------------! + ! Integrate the terms that are part of the budget. ! + !------------------------------------------------------------------------------------! + !----- 1. Carbon dioxide. -----------------------------------------------------------! + csite%co2budget_gpp(ipa) = csite%co2budget_gpp(ipa) + gpp *dtlsm + csite%co2budget_gpp_dbh(:,ipa) = csite%co2budget_gpp_dbh(:,ipa) + gpp_dbh(:)*dtlsm + csite%co2budget_plresp(ipa) = csite%co2budget_plresp(ipa) & + + ( leaf_resp + root_resp + growth_resp & + + storage_resp + vleaf_resp ) * dtlsm + csite%co2budget_rh(ipa) = csite%co2budget_rh(ipa) & + + csite%rh(ipa) * dtlsm + csite%co2budget_cwd_rh(ipa) = csite%co2budget_cwd_rh(ipa) & + + csite%cwd_rh(ipa) * dtlsm + csite%co2budget_denseffect(ipa) = csite%co2budget_denseffect(ipa) & + + co2curr_denseffect + csite%co2budget_loss2atm(ipa) = csite%co2budget_loss2atm(ipa) & + + co2curr_loss2atm + !----- 2. Energy. -------------------------------------------------------------------! + csite%ebudget_precipgain(ipa) = csite%ebudget_precipgain(ipa) + ecurr_precipgain + csite%ebudget_netrad(ipa) = csite%ebudget_netrad(ipa) + ecurr_netrad + csite%ebudget_prsseffect(ipa) = csite%ebudget_prsseffect(ipa) + ecurr_prsseffect + csite%ebudget_denseffect(ipa) = csite%ebudget_denseffect(ipa) + ecurr_denseffect + csite%ebudget_loss2atm(ipa) = csite%ebudget_loss2atm(ipa) + ecurr_loss2atm + csite%ebudget_loss2drainage(ipa) = csite%ebudget_loss2drainage(ipa) & + + ecurr_loss2drainage + csite%ebudget_loss2runoff(ipa) = csite%ebudget_loss2runoff(ipa) & + + ecurr_loss2runoff + !----- 3. Water. --------------------------------------------------------------------! + csite%wbudget_precipgain(ipa) = csite%wbudget_precipgain(ipa) + wcurr_precipgain + csite%wbudget_denseffect(ipa) = csite%wbudget_denseffect(ipa) + wcurr_denseffect + csite%wbudget_loss2atm(ipa) = csite%wbudget_loss2atm(ipa) + wcurr_loss2atm + csite%wbudget_loss2drainage(ipa) = csite%wbudget_loss2drainage(ipa) & + + wcurr_loss2drainage + csite%wbudget_loss2runoff(ipa) = csite%wbudget_loss2runoff(ipa) & + + wcurr_loss2runoff + !------------------------------------------------------------------------------------! - !---------------------------------------------------------------------------------------! - ! Update density and initial storage for next step. ! - !---------------------------------------------------------------------------------------! - csite%wbudget_initialstorage(ipa) = wbudget_finalstorage - csite%ebudget_initialstorage(ipa) = ebudget_finalstorage - csite%co2budget_initialstorage(ipa) = co2budget_finalstorage + !------------------------------------------------------------------------------------! + ! Update density and initial storage for next step. ! + !------------------------------------------------------------------------------------! + csite%wbudget_initialstorage(ipa) = wbudget_finalstorage + csite%ebudget_initialstorage(ipa) = ebudget_finalstorage + csite%co2budget_initialstorage(ipa) = co2budget_finalstorage - !---------------------------------------------------------------------------------------! - ! If the "check budget" option is activated (you can turn on and turn off by setting ! - ! checkbudget in ed_params.f90), then the model will crash whenever there is some ! - ! significant leak of CO2, water, or energy. ! - !---------------------------------------------------------------------------------------! - if (checkbudget) then - co2_ok = abs(co2curr_residual) <= rk4eps * ( abs(co2budget_finalstorage) & - + abs(co2budget_deltastorage) ) - energy_ok = abs(ecurr_residual) <= rk4eps * ( abs(ebudget_finalstorage) & - + abs(ebudget_deltastorage) ) - water_ok = abs(wcurr_residual) <= rk4eps * ( abs(wbudget_finalstorage) & - + abs(wbudget_deltastorage) ) - - - if (.not. co2_ok) then - write (unit=*,fmt='(a)') '|-----------------------------------------------------|' - write (unit=*,fmt='(a)') '| !!! ): CO2 budget failed :( !!! |' - write (unit=*,fmt='(a)') '|-----------------------------------------------------|' - write (unit=*,fmt='(a,i4.4,2(1x,i2.2),1x,f6.0)') ' TIME : ', & - current_time%year,current_time%month,current_time%date ,current_time%time - write (unit=*,fmt=fmtf ) ' LAI : ',csite%lai(ipa) - write (unit=*,fmt=fmtf ) ' VEG_HEIGHT : ',csite%veg_height(ipa) - write (unit=*,fmt=fmtf ) ' CAN_RHOS : ',csite%can_rhos(ipa) - write (unit=*,fmt=fmtf ) ' OLD_CAN_RHOS : ',old_can_rhos - write (unit=*,fmt=fmtf ) ' CAN_DEPTH : ',csite%can_depth(ipa) - write (unit=*,fmt=fmtf ) ' RESIDUAL : ',co2curr_residual - write (unit=*,fmt=fmtf ) ' INITIAL_STORAGE: ',csite%co2budget_initialstorage(ipa) - write (unit=*,fmt=fmtf ) ' FINAL_STORAGE : ',co2budget_finalstorage - write (unit=*,fmt=fmtf ) ' DELTA_STORAGE : ',co2budget_deltastorage - write (unit=*,fmt=fmtf ) ' GPP : ',co2curr_gpp - write (unit=*,fmt=fmtf ) ' LEAF_RESP : ',co2curr_leafresp - write (unit=*,fmt=fmtf ) ' ROOT_RESP : ',co2curr_rootresp - write (unit=*,fmt=fmtf ) ' GROWTH_RESP : ',co2curr_growthresp - write (unit=*,fmt=fmtf ) ' STORAGE_RESP : ',co2curr_storageresp - write (unit=*,fmt=fmtf ) ' VLEAF_RESP : ',co2curr_vleafresp - write (unit=*,fmt=fmtf ) ' HET_RESP : ',co2curr_hetresp - write (unit=*,fmt=fmtf ) ' NEP : ',co2curr_nep - write (unit=*,fmt=fmtf ) ' DENSITY_EFFECT : ',co2curr_denseffect - write (unit=*,fmt=fmtf ) ' LOSS2ATM : ',co2curr_loss2atm - write (unit=*,fmt='(a)') '|-----------------------------------------------------|' - write (unit=*,fmt='(a)') ' ' - end if - if (.not. energy_ok) then - write (unit=*,fmt='(a)') '|-----------------------------------------------------|' - write (unit=*,fmt='(a)') '| !!! ): Enthalpy budget failed :( !!! |' - write (unit=*,fmt='(a)') '|-----------------------------------------------------|' - write (unit=*,fmt='(a,i4.4,2(1x,i2.2),1x,f6.0)') ' TIME : ', & - current_time%year,current_time%month,current_time%date ,current_time%time - write (unit=*,fmt=fmtf ) ' LAI : ',csite%lai(ipa) - write (unit=*,fmt=fmtf ) ' VEG_HEIGHT : ',csite%veg_height(ipa) - write (unit=*,fmt=fmtf ) ' CAN_DEPTH : ',csite%can_depth(ipa) - write (unit=*,fmt=fmtf ) ' RESIDUAL : ',ecurr_residual - write (unit=*,fmt=fmtf ) ' INITIAL_STORAGE: ',csite%ebudget_initialstorage(ipa) - write (unit=*,fmt=fmtf ) ' FINAL_STORAGE : ',ebudget_finalstorage - write (unit=*,fmt=fmtf ) ' DELTA_STORAGE : ',ebudget_deltastorage - write (unit=*,fmt=fmtf ) ' PRECIPGAIN : ',ecurr_precipgain - write (unit=*,fmt=fmtf ) ' NETRAD : ',ecurr_netrad - write (unit=*,fmt=fmtf ) ' DENSITY_EFFECT : ',ecurr_denseffect - write (unit=*,fmt=fmtf ) ' PRESSURE_EFFECT: ',ecurr_prsseffect - write (unit=*,fmt=fmtf ) ' LOSS2ATM : ',ecurr_loss2atm - write (unit=*,fmt=fmtf ) ' LOSS2DRAINAGE : ',ecurr_loss2drainage - write (unit=*,fmt=fmtf ) ' LOSS2RUNOFF : ',ecurr_loss2runoff - write (unit=*,fmt='(a)') '|-----------------------------------------------------|' - write (unit=*,fmt='(a)') ' ' - end if + !------------------------------------------------------------------------------------! + ! If the "check budget" option is activated (you can turn on and turn off by set- ! + ! ting checkbudget in ed_params.f90), then the model will crash whenever there is ! + ! some significant leak of CO2, water, or energy. ! + !------------------------------------------------------------------------------------! + if (checkbudget) then + co2_ok = abs(co2curr_residual) <= rk4eps * ( abs(co2budget_finalstorage) & + + abs(co2budget_deltastorage) ) + energy_ok = abs(ecurr_residual) <= rk4eps * ( abs(ebudget_finalstorage) & + + abs(ebudget_deltastorage) ) + water_ok = abs(wcurr_residual) <= rk4eps * ( abs(wbudget_finalstorage) & + + abs(wbudget_deltastorage) ) + + + if (.not. co2_ok) then + write (unit=*,fmt='(a)') '|--------------------------------------------------|' + write (unit=*,fmt='(a)') '| !!! ): CO2 budget failed :( !!! |' + write (unit=*,fmt='(a)') '|--------------------------------------------------|' + write (unit=*,fmt='(a,i4.4,2(1x,i2.2),1x,f6.0)') ' TIME : ', & + current_time%year,current_time%month,current_time%date ,current_time%time + write (unit=*,fmt=fmtf ) ' LAI : ',csite%lai(ipa) + write (unit=*,fmt=fmtf ) ' VEG_HEIGHT : ',csite%veg_height(ipa) + write (unit=*,fmt=fmtf ) ' CAN_RHOS : ',csite%can_rhos(ipa) + write (unit=*,fmt=fmtf ) ' OLD_CAN_RHOS : ',old_can_rhos + write (unit=*,fmt=fmtf ) ' CAN_DEPTH : ',csite%can_depth(ipa) + write (unit=*,fmt=fmtf ) ' RESIDUAL : ',co2curr_residual + write (unit=*,fmt=fmtf ) ' INITIAL_STORAGE: ' & + ,csite%co2budget_initialstorage(ipa) + write (unit=*,fmt=fmtf ) ' FINAL_STORAGE : ',co2budget_finalstorage + write (unit=*,fmt=fmtf ) ' DELTA_STORAGE : ',co2budget_deltastorage + write (unit=*,fmt=fmtf ) ' GPP : ',co2curr_gpp + write (unit=*,fmt=fmtf ) ' LEAF_RESP : ',co2curr_leafresp + write (unit=*,fmt=fmtf ) ' ROOT_RESP : ',co2curr_rootresp + write (unit=*,fmt=fmtf ) ' GROWTH_RESP : ',co2curr_growthresp + write (unit=*,fmt=fmtf ) ' STORAGE_RESP : ',co2curr_storageresp + write (unit=*,fmt=fmtf ) ' VLEAF_RESP : ',co2curr_vleafresp + write (unit=*,fmt=fmtf ) ' HET_RESP : ',co2curr_hetresp + write (unit=*,fmt=fmtf ) ' NEP : ',co2curr_nep + write (unit=*,fmt=fmtf ) ' DENSITY_EFFECT : ',co2curr_denseffect + write (unit=*,fmt=fmtf ) ' LOSS2ATM : ',co2curr_loss2atm + write (unit=*,fmt='(a)') '|--------------------------------------------------|' + write (unit=*,fmt='(a)') ' ' + end if + if (.not. energy_ok) then + write (unit=*,fmt='(a)') '|--------------------------------------------------|' + write (unit=*,fmt='(a)') '| !!! ): Enthalpy budget failed :( !!! |' + write (unit=*,fmt='(a)') '|--------------------------------------------------|' + write (unit=*,fmt='(a,i4.4,2(1x,i2.2),1x,f6.0)') ' TIME : ', & + current_time%year,current_time%month,current_time%date ,current_time%time + write (unit=*,fmt=fmtf ) ' LAI : ',csite%lai(ipa) + write (unit=*,fmt=fmtf ) ' VEG_HEIGHT : ',csite%veg_height(ipa) + write (unit=*,fmt=fmtf ) ' CAN_DEPTH : ',csite%can_depth(ipa) + write (unit=*,fmt=fmtf ) ' RESIDUAL : ',ecurr_residual + write (unit=*,fmt=fmtf ) ' INITIAL_STORAGE: ',csite%ebudget_initialstorage(ipa) + write (unit=*,fmt=fmtf ) ' FINAL_STORAGE : ',ebudget_finalstorage + write (unit=*,fmt=fmtf ) ' DELTA_STORAGE : ',ebudget_deltastorage + write (unit=*,fmt=fmtf ) ' PRECIPGAIN : ',ecurr_precipgain + write (unit=*,fmt=fmtf ) ' NETRAD : ',ecurr_netrad + write (unit=*,fmt=fmtf ) ' DENSITY_EFFECT : ',ecurr_denseffect + write (unit=*,fmt=fmtf ) ' PRESSURE_EFFECT: ',ecurr_prsseffect + write (unit=*,fmt=fmtf ) ' LOSS2ATM : ',ecurr_loss2atm + write (unit=*,fmt=fmtf ) ' LOSS2DRAINAGE : ',ecurr_loss2drainage + write (unit=*,fmt=fmtf ) ' LOSS2RUNOFF : ',ecurr_loss2runoff + write (unit=*,fmt='(a)') '|--------------------------------------------------|' + write (unit=*,fmt='(a)') ' ' + end if - if (.not. water_ok) then - write (unit=*,fmt='(a)') '|-----------------------------------------------------|' - write (unit=*,fmt='(a)') '| !!! ): Water budget failed :( !!! |' - write (unit=*,fmt='(a)') '|-----------------------------------------------------|' - write (unit=*,fmt='(a,i4.4,2(1x,i2.2),1x,f6.0)') ' TIME : ', & - current_time%year,current_time%month,current_time%date ,current_time%time - write (unit=*,fmt=fmtf ) ' LAI : ',csite%lai(ipa) - write (unit=*,fmt=fmtf ) ' VEG_HEIGHT : ',csite%veg_height(ipa) - write (unit=*,fmt=fmtf ) ' CAN_DEPTH : ',csite%can_depth(ipa) - write (unit=*,fmt=fmtf ) ' RESIDUAL : ',wcurr_residual - write (unit=*,fmt=fmtf ) ' INITIAL_STORAGE: ',csite%wbudget_initialstorage(ipa) - write (unit=*,fmt=fmtf ) ' FINAL_STORAGE : ',wbudget_finalstorage - write (unit=*,fmt=fmtf ) ' DELTA_STORAGE : ',wbudget_deltastorage - write (unit=*,fmt=fmtf ) ' PRECIPGAIN : ',wcurr_precipgain - write (unit=*,fmt=fmtf ) ' DENSITY_EFFECT : ',wcurr_denseffect - write (unit=*,fmt=fmtf ) ' LOSS2ATM : ',wcurr_loss2atm - write (unit=*,fmt=fmtf ) ' LOSS2DRAINAGE : ',wcurr_loss2drainage - write (unit=*,fmt=fmtf ) ' LOSS2RUNOFF : ',wcurr_loss2runoff - write (unit=*,fmt='(a)') '|-----------------------------------------------------|' - write (unit=*,fmt='(a)') ' ' - end if + if (.not. water_ok) then + write (unit=*,fmt='(a)') '|--------------------------------------------------|' + write (unit=*,fmt='(a)') '| !!! ): Water budget failed :( !!! |' + write (unit=*,fmt='(a)') '|--------------------------------------------------|' + write (unit=*,fmt='(a,i4.4,2(1x,i2.2),1x,f6.0)') ' TIME : ', & + current_time%year,current_time%month,current_time%date ,current_time%time + write (unit=*,fmt=fmtf ) ' LAI : ',csite%lai(ipa) + write (unit=*,fmt=fmtf ) ' VEG_HEIGHT : ',csite%veg_height(ipa) + write (unit=*,fmt=fmtf ) ' CAN_DEPTH : ',csite%can_depth(ipa) + write (unit=*,fmt=fmtf ) ' RESIDUAL : ',wcurr_residual + write (unit=*,fmt=fmtf ) ' INITIAL_STORAGE: ',csite%wbudget_initialstorage(ipa) + write (unit=*,fmt=fmtf ) ' FINAL_STORAGE : ',wbudget_finalstorage + write (unit=*,fmt=fmtf ) ' DELTA_STORAGE : ',wbudget_deltastorage + write (unit=*,fmt=fmtf ) ' PRECIPGAIN : ',wcurr_precipgain + write (unit=*,fmt=fmtf ) ' DENSITY_EFFECT : ',wcurr_denseffect + write (unit=*,fmt=fmtf ) ' LOSS2ATM : ',wcurr_loss2atm + write (unit=*,fmt=fmtf ) ' LOSS2DRAINAGE : ',wcurr_loss2drainage + write (unit=*,fmt=fmtf ) ' LOSS2RUNOFF : ',wcurr_loss2runoff + write (unit=*,fmt='(a)') '|--------------------------------------------------|' + write (unit=*,fmt='(a)') ' ' + end if - if (print_budget) then - co2_factor = 1. / dtlsm - ene_factor = 1. / dtlsm - h2o_factor = day_sec / dtlsm - - !----- Fix the units so the terms are expressed as fluxes. -----------------------! - co2curr_residual = co2curr_residual * co2_factor - co2budget_deltastorage = co2budget_deltastorage * co2_factor - co2curr_nep = co2curr_nep * co2_factor - co2curr_denseffect = co2curr_denseffect * co2_factor - co2curr_loss2atm = co2curr_loss2atm * co2_factor - ecurr_residual = ecurr_residual * ene_factor - ebudget_deltastorage = ebudget_deltastorage * ene_factor - ecurr_precipgain = ecurr_precipgain * ene_factor - ecurr_netrad = ecurr_netrad * ene_factor - ecurr_denseffect = ecurr_denseffect * ene_factor - ecurr_prsseffect = ecurr_prsseffect * ene_factor - ecurr_loss2atm = ecurr_loss2atm * ene_factor - ecurr_loss2drainage = ecurr_loss2drainage * ene_factor - ecurr_loss2runoff = ecurr_loss2runoff * ene_factor - wcurr_residual = wcurr_residual * h2o_factor - wbudget_deltastorage = wbudget_deltastorage * h2o_factor - wcurr_precipgain = wcurr_precipgain * h2o_factor - wcurr_denseffect = wcurr_denseffect * h2o_factor - wcurr_loss2atm = wcurr_loss2atm * h2o_factor - wcurr_loss2drainage = wcurr_loss2drainage * h2o_factor - wcurr_loss2runoff = wcurr_loss2runoff * h2o_factor - !---------------------------------------------------------------------------------! + if (print_budget) then + co2_factor = 1. / dtlsm + ene_factor = 1. / dtlsm + h2o_factor = day_sec / dtlsm + + !----- Fix the units so the terms are expressed as fluxes. --------------------! + co2curr_residual = co2curr_residual * co2_factor + co2budget_deltastorage = co2budget_deltastorage * co2_factor + co2curr_nep = co2curr_nep * co2_factor + co2curr_denseffect = co2curr_denseffect * co2_factor + co2curr_loss2atm = co2curr_loss2atm * co2_factor + ecurr_residual = ecurr_residual * ene_factor + ebudget_deltastorage = ebudget_deltastorage * ene_factor + ecurr_precipgain = ecurr_precipgain * ene_factor + ecurr_netrad = ecurr_netrad * ene_factor + ecurr_denseffect = ecurr_denseffect * ene_factor + ecurr_prsseffect = ecurr_prsseffect * ene_factor + ecurr_loss2atm = ecurr_loss2atm * ene_factor + ecurr_loss2drainage = ecurr_loss2drainage * ene_factor + ecurr_loss2runoff = ecurr_loss2runoff * ene_factor + wcurr_residual = wcurr_residual * h2o_factor + wbudget_deltastorage = wbudget_deltastorage * h2o_factor + wcurr_precipgain = wcurr_precipgain * h2o_factor + wcurr_denseffect = wcurr_denseffect * h2o_factor + wcurr_loss2atm = wcurr_loss2atm * h2o_factor + wcurr_loss2drainage = wcurr_loss2drainage * h2o_factor + wcurr_loss2runoff = wcurr_loss2runoff * h2o_factor + !------------------------------------------------------------------------------! - !---------------------------------------------------------------------------------! - ! Write the file. ! - !---------------------------------------------------------------------------------! - write(budget_fout,fmt='(2a,i4.4,a)') trim(budget_pref),'patch_',ipa,'.txt' - open (unit=86,file=trim(budget_fout),status='old',action='write' & - ,position='append') - write(unit=86,fmt=bbfmt) & + + !------------------------------------------------------------------------------! + ! Write the file. ! + !------------------------------------------------------------------------------! + write(budget_fout,fmt='(2a,i4.4,a)') trim(budget_pref),'patch_',ipa,'.txt' + open (unit=86,file=trim(budget_fout),status='old',action='write' & + ,position='append') + write(unit=86,fmt=bbfmt) & current_time%year , current_time%month , current_time%date & , current_time%time , csite%lai(ipa) , csite%wai(ipa) & , csite%veg_height(ipa) , co2budget_finalstorage , co2curr_residual & @@ -477,345 +494,346 @@ subroutine compute_budget(csite,lsl,pcpg,qpcpg,ipa,wcurr_loss2atm,ecurr_netrad , wcurr_residual , wbudget_deltastorage , wcurr_precipgain & , wcurr_denseffect , wcurr_loss2atm , wcurr_loss2drainage & , wcurr_loss2runoff - close(unit=86,status='keep') + close(unit=86,status='keep') + !------------------------------------------------------------------------------! + end if !---------------------------------------------------------------------------------! - end if - !------------------------------------------------------------------------------------! - !------------------------------------------------------------------------------------! - ! Stop the run in case there is any leak of CO2, enthalpy, or water. ! - !------------------------------------------------------------------------------------! - if (.not. (co2_ok .and. energy_ok .and. water_ok)) then - call fatal_error('Budget check has failed, see message above!' & - ,'compute_budget','budget_utils.f90') + !---------------------------------------------------------------------------------! + ! Stop the run in case there is any leak of CO2, enthalpy, or water. ! + !---------------------------------------------------------------------------------! + if (.not. (co2_ok .and. energy_ok .and. water_ok)) then + call fatal_error('Budget check has failed, see message above!' & + ,'compute_budget','budget_utils.f90') + end if end if - end if - return -end subroutine compute_budget -!==========================================================================================! -!==========================================================================================! + return + end subroutine compute_budget + !=======================================================================================! + !=======================================================================================! -!==========================================================================================! -!==========================================================================================! -! This function computes the total water stored in the system, in kg/m2. ! -! (soil + temporary pools + canopy air space + leaf surface). ! -!------------------------------------------------------------------------------------------! -real function compute_water_storage(csite, lsl,ipa) - use ed_state_vars , only : sitetype & ! structure - , patchtype ! ! structure - use grid_coms , only : nzg ! ! intent(in) - use soil_coms , only : dslz ! ! intent(in) - use consts_coms , only : wdns ! ! intent(in) - implicit none - !----- Arguments -----------------------------------------------------------------------! - type(sitetype) , target :: csite - integer , intent(in) :: ipa - integer , intent(in) :: lsl - !----- Local variables -----------------------------------------------------------------! - type(patchtype), pointer :: cpatch - integer :: k - integer :: ico + !=======================================================================================! + !=======================================================================================! + ! This function computes the total water stored in the system, in kg/m2. ! + ! (soil + temporary pools + canopy air space + leaf surface). ! !---------------------------------------------------------------------------------------! + real function compute_water_storage(csite, lsl,ipa) + use ed_state_vars , only : sitetype & ! structure + , patchtype ! ! structure + use grid_coms , only : nzg ! ! intent(in) + use soil_coms , only : dslz ! ! intent(in) + use consts_coms , only : wdns ! ! intent(in) + implicit none + !----- Arguments --------------------------------------------------------------------! + type(sitetype) , target :: csite + integer , intent(in) :: ipa + integer , intent(in) :: lsl + !----- Local variables --------------------------------------------------------------! + type(patchtype), pointer :: cpatch + integer :: k + integer :: ico + !------------------------------------------------------------------------------------! - compute_water_storage = 0.0 - cpatch => csite%patch(ipa) + compute_water_storage = 0.0 + cpatch => csite%patch(ipa) - !----- 1. Add the water stored in the soil. --------------------------------------------! - do k = lsl, nzg + !----- 1. Add the water stored in the soil. -----------------------------------------! + do k = lsl, nzg + compute_water_storage = compute_water_storage & + + csite%soil_water(k,ipa) * dslz(k) * wdns + end do + !----- 2. Add the water stored in the temporary surface water/snow. -----------------! + do k = 1, csite%nlev_sfcwater(ipa) + compute_water_storage = compute_water_storage + csite%sfcwater_mass(k,ipa) + end do + !----- 3. Add the water vapour floating in the canopy air space. --------------------! compute_water_storage = compute_water_storage & - + csite%soil_water(k,ipa) * dslz(k) * wdns - end do - !----- 2. Add the water stored in the temporary surface water/snow. --------------------! - do k = 1, csite%nlev_sfcwater(ipa) - compute_water_storage = compute_water_storage + csite%sfcwater_mass(k,ipa) - end do - !----- 3. Add the water vapour floating in the canopy air space. -----------------------! - compute_water_storage = compute_water_storage & - + csite%can_shv(ipa) * csite%can_depth(ipa) & - * csite%can_rhos(ipa) - !----- 4. Add the water on the leaf and wood surfaces. ---------------------------------! - do ico = 1,cpatch%ncohorts - compute_water_storage = compute_water_storage + cpatch%leaf_water(ico) - compute_water_storage = compute_water_storage + cpatch%wood_water(ico) - end do - - return -end function compute_water_storage -!==========================================================================================! -!==========================================================================================! - - - - - - -!==========================================================================================! -!==========================================================================================! -! This function computs the total net radiation, by adding the radiation that interacts ! -! with the different surfaces. ! -!------------------------------------------------------------------------------------------! -real function compute_netrad(csite,ipa) - use ed_state_vars , only : sitetype & ! structure - , patchtype ! ! structure - implicit none - !----- Arguments -----------------------------------------------------------------------! - type(sitetype) , target :: csite - integer , intent(in) :: ipa - !----- Local variables -----------------------------------------------------------------! - type(patchtype), pointer :: cpatch - integer :: k - integer :: ico - !---------------------------------------------------------------------------------------! - - cpatch => csite%patch(ipa) - - compute_netrad = 0.0 - !----- 1. Add the ground components ----------------------------------------------------! - compute_netrad = csite%rshort_g(ipa) + csite%rlong_g(ipa) + csite%rlong_s(ipa) - !----- 2. Add the shortwave radiation that reaches each snow/water layer ---------------! - do k = 1, csite%nlev_sfcwater(ipa) - compute_netrad = compute_netrad + csite%rshort_s(k,ipa) - end do - !----- 3. Add the radiation components that is absorbed by leaves and branches. --------! - do ico = 1,cpatch%ncohorts - compute_netrad = compute_netrad + cpatch%rshort_l(ico) + cpatch%rlong_l(ico) - compute_netrad = compute_netrad + cpatch%rshort_w(ico) + cpatch%rlong_w(ico) - end do - return -end function compute_netrad -!==========================================================================================! -!==========================================================================================! + + csite%can_shv(ipa) * csite%can_depth(ipa) & + * csite%can_rhos(ipa) + !----- 4. Add the water on the leaf and wood surfaces. ------------------------------! + do ico = 1,cpatch%ncohorts + compute_water_storage = compute_water_storage + cpatch%leaf_water(ico) + compute_water_storage = compute_water_storage + cpatch%wood_water(ico) + end do + return + end function compute_water_storage + !=======================================================================================! + !=======================================================================================! -!==========================================================================================! -!==========================================================================================! -! This function computs the total net radiation, by adding the radiation that interacts ! -! with the different surfaces. The result is given in J/m2. ! -!------------------------------------------------------------------------------------------! -real function compute_energy_storage(csite, lsl, ipa) - use ed_state_vars , only : sitetype & ! structure - , patchtype ! ! structure - use grid_coms , only : nzg ! ! intent(in) - use soil_coms , only : dslz ! ! intent(in) - use rk4_coms , only : toosparse ! ! intent(in) - use therm_lib , only : tq2enthalpy ! ! function - implicit none - !----- Arguments -----------------------------------------------------------------------! - type(sitetype) , target :: csite - integer , intent(in) :: ipa - integer , intent(in) :: lsl - !----- Local variables -----------------------------------------------------------------! - type(patchtype), pointer :: cpatch - integer :: k - integer :: ico - real :: soil_storage - real :: sfcwater_storage - real :: cas_storage - real :: veg_storage - real :: can_enthalpy - !---------------------------------------------------------------------------------------! - - cpatch => csite%patch(ipa) - - !----- 1. Computing internal energy stored at the soil. --------------------------------! - soil_storage = 0.0 - do k = lsl, nzg - soil_storage = soil_storage + csite%soil_energy(k,ipa) * dslz(k) - end do + !=======================================================================================! + !=======================================================================================! + ! This function computs the total net radiation, by adding the radiation that ! + ! interacts with the different surfaces. ! !---------------------------------------------------------------------------------------! + real function compute_netrad(csite,ipa) + use ed_state_vars , only : sitetype & ! structure + , patchtype ! ! structure + implicit none + !----- Arguments --------------------------------------------------------------------! + type(sitetype) , target :: csite + integer , intent(in) :: ipa + !----- Local variables --------------------------------------------------------------! + type(patchtype), pointer :: cpatch + integer :: k + integer :: ico + !------------------------------------------------------------------------------------! + cpatch => csite%patch(ipa) - !---------------------------------------------------------------------------------------! - ! 2. Computing internal energy stored at the temporary snow/water sfc. layer. ! - ! Converting it to J/m2. - !---------------------------------------------------------------------------------------! - sfcwater_storage = 0.0 - do k = 1, csite%nlev_sfcwater(ipa) - sfcwater_storage = sfcwater_storage & - + csite%sfcwater_energy(k,ipa) * csite%sfcwater_mass(k,ipa) - end do - !---------------------------------------------------------------------------------------! + compute_netrad = 0.0 + !----- 1. Add the ground components -------------------------------------------------! + compute_netrad = csite%rshort_g(ipa) + csite%rlong_g(ipa) + csite%rlong_s(ipa) + !----- 2. Add the shortwave radiation that reaches each snow/water layer ------------! + do k = 1, csite%nlev_sfcwater(ipa) + compute_netrad = compute_netrad + csite%rshort_s(k,ipa) + end do + !----- 3. Add the radiation components that is absorbed by leaves and branches. -----! + do ico = 1,cpatch%ncohorts + compute_netrad = compute_netrad + cpatch%rshort_l(ico) + cpatch%rlong_l(ico) + compute_netrad = compute_netrad + cpatch%rshort_w(ico) + cpatch%rlong_w(ico) + end do + return + end function compute_netrad + !=======================================================================================! + !=======================================================================================! + + + + + + + !=======================================================================================! + !=======================================================================================! + ! This function computs the total net radiation, by adding the radiation that ! + ! interacts with the different surfaces. The result is given in J/m2. ! + !---------------------------------------------------------------------------------------! + real function compute_energy_storage(csite, lsl, ipa) + use ed_state_vars , only : sitetype & ! structure + , patchtype ! ! structure + use grid_coms , only : nzg ! ! intent(in) + use soil_coms , only : dslz ! ! intent(in) + use rk4_coms , only : toosparse ! ! intent(in) + use therm_lib , only : tq2enthalpy ! ! function + implicit none + !----- Arguments --------------------------------------------------------------------! + type(sitetype) , target :: csite + integer , intent(in) :: ipa + integer , intent(in) :: lsl + !----- Local variables --------------------------------------------------------------! + type(patchtype), pointer :: cpatch + integer :: k + integer :: ico + real :: soil_storage + real :: sfcwater_storage + real :: cas_storage + real :: veg_storage + real :: can_enthalpy + !------------------------------------------------------------------------------------! - !---------------------------------------------------------------------------------------! - ! 3. Find and value for canopy air total enthalpy . ! - !---------------------------------------------------------------------------------------! - can_enthalpy = tq2enthalpy(csite%can_temp(ipa),csite%can_shv(ipa),.true.) - cas_storage = csite%can_rhos(ipa) * csite%can_depth(ipa) * can_enthalpy - !---------------------------------------------------------------------------------------! + cpatch => csite%patch(ipa) + !----- 1. Computing internal energy stored at the soil. -----------------------------! + soil_storage = 0.0 + do k = lsl, nzg + soil_storage = soil_storage + csite%soil_energy(k,ipa) * dslz(k) + end do + !------------------------------------------------------------------------------------! - !---------------------------------------------------------------------------------------! - ! 4. Compute the internal energy stored in the plants. ! - !---------------------------------------------------------------------------------------! - veg_storage = 0.0 - do ico = 1,cpatch%ncohorts - veg_storage = veg_storage + cpatch%leaf_energy(ico) + cpatch%wood_energy(ico) - end do - !---------------------------------------------------------------------------------------! + !------------------------------------------------------------------------------------! + ! 2. Computing internal energy stored at the temporary snow/water sfc. layer. ! + ! Converting it to J/m2. + !------------------------------------------------------------------------------------! + sfcwater_storage = 0.0 + do k = 1, csite%nlev_sfcwater(ipa) + sfcwater_storage = sfcwater_storage & + + csite%sfcwater_energy(k,ipa) * csite%sfcwater_mass(k,ipa) + end do + !------------------------------------------------------------------------------------! - !----- 5. Integrating the total energy in ED. ------------------------------------------! - compute_energy_storage = soil_storage + sfcwater_storage + cas_storage + veg_storage - !---------------------------------------------------------------------------------------! - return -end function compute_energy_storage -!==========================================================================================! -!==========================================================================================! + !------------------------------------------------------------------------------------! + ! 3. Find and value for canopy air total enthalpy . ! + !------------------------------------------------------------------------------------! + can_enthalpy = tq2enthalpy(csite%can_temp(ipa),csite%can_shv(ipa),.true.) + cas_storage = csite%can_rhos(ipa) * csite%can_depth(ipa) * can_enthalpy + !------------------------------------------------------------------------------------! + !------------------------------------------------------------------------------------! + ! 4. Compute the internal energy stored in the plants. ! + !------------------------------------------------------------------------------------! + veg_storage = 0.0 + do ico = 1,cpatch%ncohorts + veg_storage = veg_storage + cpatch%leaf_energy(ico) + cpatch%wood_energy(ico) + end do + !------------------------------------------------------------------------------------! + !----- 5. Integrating the total energy in ED. ---------------------------------------! + compute_energy_storage = soil_storage + sfcwater_storage + cas_storage + veg_storage + !------------------------------------------------------------------------------------! + return + end function compute_energy_storage + !=======================================================================================! + !=======================================================================================! + + + + + + + !=======================================================================================! + !=======================================================================================! + ! This subroutine computes the carbon flux terms. ! + !---------------------------------------------------------------------------------------! + subroutine sum_plant_cfluxes(csite,ipa, gpp, gpp_dbh,leaf_resp,root_resp,growth_resp & + ,storage_resp,vleaf_resp) + use ed_state_vars , only : sitetype & ! structure + , patchtype ! ! structure + use consts_coms , only : day_sec & ! intent(in) + , umol_2_kgC ! ! intent(in) + use ed_max_dims , only : n_dbh ! ! intent(in) + use ed_misc_coms , only : ddbhi ! ! intent(in) + implicit none + !----- Arguments --------------------------------------------------------------------! + type(sitetype) , target :: csite + integer , intent(in) :: ipa + real , intent(out) :: gpp + real, dimension(n_dbh), intent(out) :: gpp_dbh + real , intent(out) :: leaf_resp + real , intent(out) :: root_resp + real , intent(out) :: growth_resp + real , intent(out) :: storage_resp + real , intent(out) :: vleaf_resp + !----- Local variables --------------------------------------------------------------! + type(patchtype), pointer :: cpatch + integer :: k + integer :: ico + integer :: idbh + real :: lrresp ! Leaf and root respiration + real :: sresp ! Storage, growth, vleaf respiration. + logical :: forest + !------------------------------------------------------------------------------------! -!==========================================================================================! -!==========================================================================================! -! This subroutine computes the carbon flux terms. ! -!------------------------------------------------------------------------------------------! -subroutine sum_plant_cfluxes(csite,ipa, gpp, gpp_dbh,leaf_resp,root_resp,growth_resp & - ,storage_resp,vleaf_resp) - use ed_state_vars , only : sitetype & ! structure - , patchtype ! ! structure - use consts_coms , only : day_sec & ! intent(in) - , umol_2_kgC ! ! intent(in) - use ed_max_dims , only : n_dbh ! ! intent(in) - use ed_misc_coms , only : ddbhi ! ! intent(in) - implicit none - !----- Arguments -----------------------------------------------------------------------! - type(sitetype) , target :: csite - integer , intent(in) :: ipa - real , intent(out) :: gpp - real, dimension(n_dbh), intent(out) :: gpp_dbh - real , intent(out) :: leaf_resp - real , intent(out) :: root_resp - real , intent(out) :: growth_resp - real , intent(out) :: storage_resp - real , intent(out) :: vleaf_resp - !----- Local variables -----------------------------------------------------------------! - type(patchtype), pointer :: cpatch - integer :: k - integer :: ico - integer :: idbh - real :: lrresp !----- Leaf and root respiration - real :: sresp !----- Storage, growth, vleaf respiration. - logical :: forest - !---------------------------------------------------------------------------------------! + + !----- GPP by DBH is computed for forested areas only. ------------------------------! + forest = csite%dist_type(ipa) /= 1 - - !----- GPP by DBH is computed for forested areas only. ---------------------------------! - forest = csite%dist_type(ipa) /= 1 + !----- Initializing some variables. -------------------------------------------------! + gpp = 0.0 + gpp_dbh = 0.0 + leaf_resp = 0.0 + root_resp = 0.0 + growth_resp = 0.0 + storage_resp = 0.0 + vleaf_resp = 0.0 + cpatch => csite%patch(ipa) - !----- Initializing some variables. ----------------------------------------------------! - gpp = 0.0 - gpp_dbh = 0.0 - leaf_resp = 0.0 - root_resp = 0.0 - growth_resp = 0.0 - storage_resp = 0.0 - vleaf_resp = 0.0 - cpatch => csite%patch(ipa) + !------------------------------------------------------------------------------------! + ! Looping over cohorts. ! + !------------------------------------------------------------------------------------! + do ico = 1,cpatch%ncohorts + !----- Add GPP and leaf respiration only for those cohorts with enough leaves. ---! + if (cpatch%leaf_resolvable(ico)) then + gpp = gpp + cpatch%gpp(ico) + !----- Forest cohorts have dbh distribution, add them to gpp_dbh. -------------! + if (forest) then + idbh=max(1,min(n_dbh,ceiling(cpatch%dbh(ico)*ddbhi))) + gpp_dbh(idbh) = gpp_dbh(idbh) + cpatch%gpp(ico) + end if + leaf_resp = leaf_resp + cpatch%leaf_respiration(ico) - !---------------------------------------------------------------------------------------! - ! Looping over cohorts. ! - !---------------------------------------------------------------------------------------! - do ico = 1,cpatch%ncohorts - !----- Adding GPP and leaf respiration only for those cohorts with enough leaves. ---! - if (cpatch%leaf_resolvable(ico)) then - gpp = gpp + cpatch%gpp(ico) - !----- Forest cohorts have dbh distribution, add them to gpp_dbh. ----------------! - if (forest) then - idbh=max(1,min(n_dbh,ceiling(cpatch%dbh(ico)*ddbhi))) - gpp_dbh(idbh) = gpp_dbh(idbh) + cpatch%gpp(ico) end if - leaf_resp = leaf_resp + cpatch%leaf_respiration(ico) + !----- Root respiration happens even when the LAI is tiny ------------------------! + root_resp = root_resp + cpatch%root_respiration(ico) - end if - !----- Root respiration happens even when the LAI is tiny ---------------------------! - root_resp = root_resp + cpatch%root_respiration(ico) - - !------------------------------------------------------------------------------------! - ! Structural terms are "intensive", we must convert them from kgC/plant/day to ! - ! umol/m2/s. ! - !------------------------------------------------------------------------------------! - growth_resp = growth_resp & - + cpatch%growth_respiration(ico) * cpatch%nplant(ico) & - / (day_sec * umol_2_kgC) - storage_resp = storage_resp & - + cpatch%storage_respiration(ico) * cpatch%nplant(ico) & - / (day_sec * umol_2_kgC) - vleaf_resp = vleaf_resp & - + cpatch%vleaf_respiration(ico) * cpatch%nplant(ico) & - / (day_sec * umol_2_kgC) - end do - - return -end subroutine sum_plant_cfluxes -!==========================================================================================! -!==========================================================================================! + !---------------------------------------------------------------------------------! + ! Structural terms are "intensive", we must convert them from kgC/plant/day ! + ! to umol/m2/s. ! + !---------------------------------------------------------------------------------! + growth_resp = growth_resp & + + cpatch%growth_respiration(ico) * cpatch%nplant(ico) & + / (day_sec * umol_2_kgC) + storage_resp = storage_resp & + + cpatch%storage_respiration(ico) * cpatch%nplant(ico) & + / (day_sec * umol_2_kgC) + vleaf_resp = vleaf_resp & + + cpatch%vleaf_respiration(ico) * cpatch%nplant(ico) & + / (day_sec * umol_2_kgC) + end do + return + end subroutine sum_plant_cfluxes + !=======================================================================================! + !=======================================================================================! -!==========================================================================================! -!==========================================================================================! -! This function computes the co2 stored in the canopy air space from ppm to umol/m2. ! -!------------------------------------------------------------------------------------------! -real function compute_co2_storage(csite,ipa) - use ed_state_vars , only : sitetype ! ! structure - use consts_coms , only : mmdryi ! ! intent(in) - implicit none - !----- Arguments -----------------------------------------------------------------------! - type(sitetype) , target :: csite - integer , intent(in) :: ipa + + !=======================================================================================! + !=======================================================================================! + ! This function computes the co2 stored in the canopy air space from ppm to umol/m2. ! !---------------------------------------------------------------------------------------! + real function compute_co2_storage(csite,ipa) + use ed_state_vars , only : sitetype ! ! structure + use consts_coms , only : mmdryi ! ! intent(in) + implicit none + !----- Arguments --------------------------------------------------------------------! + type(sitetype) , target :: csite + integer , intent(in) :: ipa + !------------------------------------------------------------------------------------! - compute_co2_storage = csite%can_co2(ipa) * mmdryi * csite%can_rhos(ipa) & - * csite%can_depth(ipa) + compute_co2_storage = csite%can_co2(ipa) * mmdryi * csite%can_rhos(ipa) & + * csite%can_depth(ipa) - return -end function compute_co2_storage -!==========================================================================================! -!==========================================================================================! + return + end function compute_co2_storage + !=======================================================================================! + !=======================================================================================! -!==========================================================================================! -!==========================================================================================! -! This function computes the change of the integrated value of a given property in the ! -! canopy air space due to change in density. ! -!------------------------------------------------------------------------------------------! -real function ddens_dt_effect(old_rhos,new_rhos,old_prop,new_prop,can_depth,multi) - implicit none - !----- Arguments. ----------------------------------------------------------------------! - real, intent(in) :: old_rhos ! Density before time integration - real, intent(in) :: new_rhos ! Density after time integration - real, intent(in) :: old_prop ! Property before time integration - real, intent(in) :: new_prop ! Property after time integration - real, intent(in) :: can_depth ! Canopy depth - real, intent(in) :: multi ! Some scaling constant that may be needed. + !=======================================================================================! + !=======================================================================================! + ! This function computes the change of the integrated value of a given property in ! + ! the canopy air space due to change in density. ! !---------------------------------------------------------------------------------------! - ddens_dt_effect = multi * can_depth * 0.5 * (old_prop + new_prop) & - * (new_rhos - old_rhos) - return -end function ddens_dt_effect -!==========================================================================================! -!==========================================================================================! + real function ddens_dt_effect(old_rhos,new_rhos,old_prop,new_prop,can_depth,multi) + implicit none + !----- Arguments. -------------------------------------------------------------------! + real, intent(in) :: old_rhos ! Density before time integration + real, intent(in) :: new_rhos ! Density after time integration + real, intent(in) :: old_prop ! Property before time integration + real, intent(in) :: new_prop ! Property after time integration + real, intent(in) :: can_depth ! Canopy depth + real, intent(in) :: multi ! Some scaling constant that may be needed. + !------------------------------------------------------------------------------------! + ddens_dt_effect = multi * can_depth * 0.5 * (old_prop + new_prop) & + * (new_rhos - old_rhos) + return + end function ddens_dt_effect + !=======================================================================================! + !=======================================================================================! +end module budget_utils diff --git a/ED/src/utils/fuse_fiss_utils.f90 b/ED/src/utils/fuse_fiss_utils.f90 index 61fb4d1c7..8add9ce2c 100644 --- a/ED/src/utils/fuse_fiss_utils.f90 +++ b/ED/src/utils/fuse_fiss_utils.f90 @@ -3270,6 +3270,7 @@ subroutine fuse_2_patches(csite,donp,recp,mzg,mzs,prss,lsl,ntext_soil,green_leaf , idoutput & ! intent(in) , imoutput & ! intent(in) , ndcycle ! ! intent(in) + use budget_utils , only : update_budget ! ! intent(in) implicit none !----- Arguments --------------------------------------------------------------------! type(sitetype) , target :: csite ! Current site