Skip to content

Commit

Permalink
Changes by M Longo (rv255) (plus bug fixes)
Browse files Browse the repository at this point in the history
  
  1.  New radiation scheme, based on the multiple layer, multiple-scattering model 
      by Zhao and Qualls (2005;2006).  It has the finite crown area for diffuse radiation,
      and I ran it in the past and it works fine, but I haven't tested extensively, and 
      should not be used in default runs.
  
  2.  Added the cosine interpolation for radiation for when the radiation from the met
      driver is not to be linearly interpolated.  This avoids crashes with this non-standard
      option.
  
  3.  Added some new variables to the namelist, to help tuning:
      a. Leaf transmittance and reflectance, leaf mean orientation and clumping factor 
      b. Kw for grasses and trees
      c. D0 (transpiration factor)
      d. Vm factor was split between C3 and C4
      e. Some of the other parameters became absolute values and were split between
         C3/C4 or tree/grass
      f. Klow for CO2-limited photosynthesis (C4 grass only)
      g. Leaf width (grass/broadleaf/conifer)
  
  4.  Several bug fixes, including a couple on the surface layer model (a bogus von Karman
      constant in the definition of zeta), and a variable that wasn't properly copied
      (soil resistance).  The latter didn't change results for the default method, but it 
      made the ground vapour methods to work.
  
  5.  Added a CLM based surface layer model, although I think there is no real benefit so
      I am going to keep using Beljaars and Holtslag because the functional form is smoother.

  6.  Changed IALLOM, mainly to remove some options we didn't use, and added a new option. 
      These are the new settings.  Except for the rooting depth and maximum crown area, the 
      options affect tropical trees and grasses only:
      0 --   Original ED-2.1;
  
      1 --   a. The coefficients for structural biomass are set so the total AGB
                is similar to Baker et al. (2004), equation 2.  Balive is the default ED-2.1;
             b. Experimental root depth that makes canopy trees to have root depths of 5m 
                and grasses/seedlings at 0.5 to have root depth of 0.5 m.
             c. Crown area defined as in Poorter et al. (2006), imposing maximum crown area.
  
      2 --   Similar to 1, but with a few extra changes:
             a. Height -> DBH allometry as in Poorter et al. (2006), this makes the trees
                to hit 35 m at a somewhat higher DBH, so Bleaf still increases up to ~90 cm.
             b. Balive is retuned, using a few leaf biomass allometric equations for
                a few genuses in Costa Rica.  References:
                Cole and Ewel (2006), and Calvo Alvarado et al. (2008).
  
  7.  I added a correction to the wind in the surface layer for the unstable case, so it 
      accounts for additional turbulence when estimating the winds for each cohort
  
  8.  Added a temporary CLM-4 canopy resistance.  This is ugly, overly simplified, but it
      seems to give the best results for water fluxes...
  
  9. Added soil color as a new variable, which hopefully will let us to tune ground albedo.
      Soil colors 1-20 are based on CLM-4, and 21 is the default from ED.
  
  10. Above ground biomass fraction is a PFT-dependent variable.  There is no practical
      change except that loss_fraction disappeared and was substituted by agf_bs.  The
      values are the currently the same for all PFTs.
  
  11. Changed the light phenology so it has values that are closer to the current tuning. 
      Changed the call for the top cohort, so it uses properties from a cohort with the 
      same properties.  None of these changes helped, results are still bad, though. 
  
  12. Changed (simplified) the branch thermodynamics options:
      a.  I deleted some allometric options that were either non-functional, or not 
          tested.  Now we only have one DBH => WAI allometry. 
      b.  IBRANCH_THERMO has 3 options now:
          0 -- No branches
          1 -- Leaves and branches are solved together in RK4 (veg_energy and veg_water
               are the prognostic variables).  I'm not a huge fan of this, but it works,
               and Paul and Steve supported this option.
          2 -- Leaves and branches are solved as independent entities in RK4
               (leaf_energy, leaf_water, wood_energy, wood_water are the prognostic 
               variables).  I like this better but it is a lot slower than 0 and 1. 
  
  13. Changed the fire model so it uses the monthly mean moisture rather than the 
      instantaneous one, so rainfall on the 31st day of the month will not suppress fires
      if the month was very dry.
  
  14. Added some diagnostic variables, and removed NEE as it was not NEE but carbon dioxide
      flux.  We now track CO2 flux and storage, their monthly means and mean diurnal cycle 
      as variables on their own.  Since these variables are usually compared to tower, they
      were kept in umol/m2/s, not kgC/m2/yr...
      
  15. Changed the critical height for reproduction for grasses, now it uses DBH (temporary
      fix until new grasses are implemented), which avoids the plants to stop growing just
      because of round-off errors.
  
  16. When we sort cohorts, we use height as the primary variable, but in case of ties, we
      make the use DBH to break the tie.  Not sure if this is going to be a problem when 
      dealing with new grasses, but I think we should do that for trees. 
  
  17. Renamed the variable max_dbh to dbh_crit because it did not represent the maximum
      DBH, just a DBH when the cohort hits its maximum possible height.
  
  18. Change to water limitation: New option to H2O_PLANT_LIM where available water is 
      the soil water at field capacity minus wilting point, scaled by the so-called 
      wilting factor:  (psi(k) - (H - z(k)) - psi_wp) / (psi_fc - psi_wp)               
      where psi is the matric potentital at layer k, z is the layer depth, H it the
      crown height and psi_fc and psi_wp are the matric potentials at wilting point
      and field capacity.       
  
  19. Several bug fixes in the coupled model, and a couple of changes in Ramspost.  They 
      are both working at least for my runs...
  • Loading branch information
LevineLab committed Jan 27, 2012
2 parents 12cc064 + 247232b commit 55be45b
Show file tree
Hide file tree
Showing 204 changed files with 21,882 additions and 10,674 deletions.
2,636 changes: 2,636 additions & 0 deletions .bzrignore

Large diffs are not rendered by default.

425 changes: 265 additions & 160 deletions BRAMS/Template/RAMSIN

Large diffs are not rendered by default.

52 changes: 17 additions & 35 deletions BRAMS/Template/callopenmpi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,40 +18,24 @@ mpirun='mpirun'
#------------------------------------------------------------------------------------------#


#----- Find the number of cores. ----------------------------------------------------------#
nmach=`wc -l < ${LSB_DJOB_HOSTFILE}`

#----- Checking available spots -----------------------------------------------------------#
host=/odyssey/home/mlongo/.lsbatch/hosts.${LSB_JOBID}


/bin/cp ${LSB_DJOB_HOSTFILE} ${host}
let NPROC=0
let NNODE=0
let NCORE=0
for machine in `cat ${LSB_DJOB_HOSTFILE}`
do
let NPROC=${NPROC}+1
let NCORE=${NCORE}+1
if [ ${NCORE} -eq 8 ]
then
let NCORE=0
let NNODE=${NNODE}+1
fi
done

#----- Changing the output filename to change for different processors --------------------#
if [ ${NPROC} -lt 10 ]
#----- Change the output filename to change for different processors ----------------------#
if [ ${nmach} -lt 10 ]
then
logfile=`dirname ${logfile}`'/00'${NPROC}'_'`basename ${logfile}`
errfile=`dirname ${errfile}`'/00'${NPROC}'_'`basename ${errfile}`
elif [ ${NPROC} -lt 100 ]
logfile=`dirname ${logfile}`'/00'${nmach}'_'`basename ${logfile}`
errfile=`dirname ${errfile}`'/00'${nmach}'_'`basename ${errfile}`
elif [ ${nmach} -lt 100 ]
then
logfile=`dirname ${logfile}`'/0'${NPROC}'_'`basename ${logfile}`
errfile=`dirname ${errfile}`'/0'${NPROC}'_'`basename ${errfile}`
logfile=`dirname ${logfile}`'/0'${nmach}'_'`basename ${logfile}`
errfile=`dirname ${errfile}`'/0'${nmach}'_'`basename ${errfile}`
else
logfile=`dirname ${logfile}`'/'${NPROC}'_'`basename ${logfile}`
errfile=`dirname ${errfile}`'/'${NPROC}'_'`basename ${errfile}`
logfile=`dirname ${logfile}`'/'${nmach}'_'`basename ${logfile}`
errfile=`dirname ${errfile}`'/'${nmach}'_'`basename ${errfile}`
fi
#----- Erasing old logfiles and joblogs ---------------------------------------------------#

#----- Erase old logfiles and joblogs -----------------------------------------------------#
if [ -s ${logfile} ]
then
rm -fv ${logfile}
Expand All @@ -61,10 +45,8 @@ then
rm -fv ${errfile}
fi

#----- Submitting the jobs to the nodes ---------------------------------------------------#
#${mpirun} -np ${NPROC} --nooversubscribe -machinefile ${host} -mca btl_openib_ib_timeout 20 -mca btl openib,sm ${brams} 1> ${logfile} 2> ${errfile}
${mpirun} -np ${NPROC} --nooversubscribe -machinefile ${host} ${brams} 1> ${logfile} 2> ${errfile}
#${mpirun} -np ${NPROC} --nooversubscribe -machinefile ${host} -mca btl_openib_ib_timeout 20 -mca btl self,tcp ${brams} 1> ${logfile} 2> ${errfile}

#----- Submit--- the jobs to the nodes ----------------------------------------------------#
#${mpirun} -np ${nmach} --nooversubscribe -machinefile ${LSB_DJOB_HOSTFILE} -mca btl_openib_ib_timeout 20 -mca btl openib,sm ${brams} 1> ${logfile} 2> ${errfile}
${mpirun} -np ${nmach} --nooversubscribe -machinefile ${LSB_DJOB_HOSTFILE} ${brams} 1> ${logfile} 2> ${errfile}
#${mpirun} -np ${nmach} --nooversubscribe -machinefile ${LSB_DJOB_HOSTFILE} -mca btl_openib_ib_timeout 20 -mca btl self,tcp ${brams} 1> ${logfile} 2> ${errfile}

rm -f ${host}
76 changes: 67 additions & 9 deletions BRAMS/Template/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
#------------------------------------------------------------------------------------------#
# ADJUST SOME VARIABLES HERE! #
#------------------------------------------------------------------------------------------#
locdisk='/n/Moorcroft_Lab/Users' # Local disk
remdisk='/n/moorcroftfs1' # Output directory
queue='moorcroft2c' # Queue to be used
whena='01-01-1999 00:00' # Initial time for simulation
whenz='03-01-1999 00:00' # Final time for simulation
isfcl=1 # 1 = LEAF-3 run, 5 = ED-2.2 run
here=`pwd` # Local disk
moi=`whoami` # User name
diskthere='/n/scratch2/moorcroft_lab' # Output directory
queue='camd' # Queue to be used
whena='08-01-2008 00:00' # Initial time for simulation
whenz='09-01-2008 00:00' # Final time for simulation
isfcl=5 # 1 = LEAF-3 run, 5 = ED-2.2 run

#------------------------------------------------------------------------------------------#
#------------------------------------------------------------------------------------------#
Expand All @@ -19,10 +20,58 @@ isfcl=1 # 1 = LEAF-3 run, 5 = ED-2.2 run
# NO NEED TO CHANGE ANYTHING BEYOND THIS POINT UNLESS YOU'RE DEVELOPING THE SCRIPT! #
#------------------------------------------------------------------------------------------#

#----- Define some paths and the name of this simulation. ---------------------------------#
here=`pwd`
there=`echo ${here} | sed s@${locdisk}@${remdisk}@g`
#----- Define the name of this simulation. ------------------------------------------------#
thissim=`basename ${here}`
#------------------------------------------------------------------------------------------#



#------------------------------------------------------------------------------------------#
# Check the directories. #
#------------------------------------------------------------------------------------------#
basehere=`basename ${here}`
dirhere=`dirname ${here}`
while [ ${basehere} != ${moi} ]
do
basehere=`basename ${dirhere}`
dirhere=`dirname ${dirhere}`
done
diskhere=${dirhere}
echo '-------------------------------------------------------------------------------'
echo ' - Simulation control on disk: '${diskhere}
echo ' - Output on disk: '${diskthere}
echo '-------------------------------------------------------------------------------'
there=`echo ${here} | sed s@${diskhere}@${diskthere}@g`
#------------------------------------------------------------------------------------------#



#------------------------------------------------------------------------------------------#
# Make sure that the directory there exists, if not, create all parent directories #
# needed. #
#------------------------------------------------------------------------------------------#
while [ ! -s ${there} ]
do
namecheck=`basename ${there}`
dircheck=`dirname ${there}`
while [ ! -s ${dircheck} ] && [ ${namecheck} != '/' ]
do
namecheck=`basename ${dircheck}`
dircheck=`dirname ${dircheck}`
done

if [ ${namecheck} == '/' ]
then
echo 'Invalid disk for variable there:'
echo ' DISK ='${diskhere}
exit 58
else
echo 'Making directory: '${dircheck}/${namecheck}
mkdir ${dircheck}/${namecheck}
fi
done
#------------------------------------------------------------------------------------------#



#----- Extract the time from the whena and whenz variables. -------------------------------#
Expand All @@ -38,6 +87,10 @@ yearz=`echo ${whenz} | awk '{print substr($1,7,4)}'`
hourz=`echo ${whenz} | awk '{print substr($2,1,2)}'`
minuz=`echo ${whenz} | awk '{print substr($2,4,2)}'`
timez=${hourz}${minuz}
#------------------------------------------------------------------------------------------#




#------ Decide which soil moisture data set to use. ---------------------------------------#
if [ ${yeara} -le 2004 ]
Expand All @@ -49,6 +102,7 @@ fi
#------------------------------------------------------------------------------------------#



#----- Decide the number of patches based on isfcl. ---------------------------------------#
if [ ${isfcl} -eq 1 ]
then
Expand All @@ -62,6 +116,8 @@ else
echo ' Invalid ISFCL -> '${isfcl}'...'
exit 1
fi
#------------------------------------------------------------------------------------------#


echo 'I am going to set up the '${thissim}' simulation...'
echo ' - Current directory: '${here}
Expand Down Expand Up @@ -177,4 +233,6 @@ else

mv tothere ${there}
fi
#------------------------------------------------------------------------------------------#


Loading

0 comments on commit 55be45b

Please sign in to comment.