Skip to content

Commit

Permalink
Small fixes:
Browse files Browse the repository at this point in the history
-  Reproduction, seed_dispersal fix:  nseed_maygo was incorrectly weighted

-  Change phenology so that if phenology_status flag is updated every day.

-  Terminate_patches subroutine called in vegetation_dyanamics

NOTE: THIS REVISION HAS A NON-WORKING VERSION OF BIG-LEAF ED AS AN OPTION
IN ED2IN.  THIS FEATURE IS UNDER-DEVELOPMENT AND WILL BE FULLY FUNCTIONAL
SOON

R Knox Changes:
 ------ Hybrid Solver ----
 This commit encapsulates hybrid time stepping.  This uses an euler
 forward step for everything but leaf and canopy temperature. Leaf 
 and canopy temperature use a bdf2 implicit step.  Boundary
 conditions for the implicit step use the following:
 -forward step leaf water and canopy humidity.
 -current step ground temperature, radiation, leaf liquid state,
          atmospheric temperature, aerodynamic conductances

 Future versions of the hybrid solver could work out using forward step
 radiation (cosz approx), and solving for the soil surface water
balancing
 prior to the implicit step.  This is done after the implicit step,
prohibiting
 a good estimate of forward state surface water and therefore
disallowing
 forward step ground temperature.

 Two new files are added, their names are self explanatory.
 hybrid_driver.f90
 bdf2_solver.f90

 Hybrid time-stepping is now option number 3 in the ED2IN card.

 Next step:  incorporating hybrid stepping in the coupled model.

 Added some text to the ED2IN describing the hybrid option
 Amended bdf2_solver to solve for wood also.  This is untested and
needs discussion.  Use    ibranch_thermo=0 with hybrid stepping until this
is tested.

-also added option to read ED runs done with the late model (from Ke)
 but removing the water sites


MD Longo Changes (mdl rv 289):
1. Bug fix in energy budget: the internal energy that left the soil
layers to be transpired was removed from the soil but not added
anywhere else. Because phase change happens at the leaves, I added
this energy to the leaves so the energy budget is closed

2. Bug fix in the mixed branch thermodynamics (IBRANCH_THERMO=1). In
case one part was resolvable and the other wasnt, the model was
forcing the non-resolvable part to be in thermal equilibrium with the
canopy air space when it left the integrator. This was causing
instabilities, because inside the integrator both pools are bound
together. Now we always impose thermal equilibrium between leaves
and wood, and make them in thermal equilibrium with canopy air space
only when neither the leaves nor the wood are resolvable.

3. Switched the prognostic variable of the canopy air space to
specific enthalpy, which now includes the effect of moisture. There
were a few reasons for this change:
   a. We assume constant pressure within one integration call. From
the first law of thermodynamics change in enthalpy is equal to heat
exchange when pressure remains constant, which makes enthalpy a
natural prognostic variable. The caveat is that enthalpy is not
preserved between time steps, so we still track potential temperature,
which is conserved when no phase change and no energy is exchanged,
but pressure changes, like between two consecutive calls.
   b. The energy associated with water vapor was not part of the budget
so transpiration, and evaporation from ground and vegetation were both
treated as sinks of energy, while condensation was treated as source.
This is not true because the energy remains in the system, at the
canopy air space.
   c. The amount of energy transferred between the surfaces and the CAS
was incorrect. Phase change requires latent heat, but in ED once
water evaporates from the surfaces, not only does it change phase, but
it also moves from one pool to the other, so the total energy
exchanged should include the loss of internal energy, and by using
enthalpy we can track the total energy exchanged with simpler equations.

4. Because of the enthalpy, we redefined the latent heat of
sublimation and evaporation. They used to be constants, which is
thermodynamically inconsistent. Because we assume the specific heat
to be constants, the latent heat must be assumed a linear function of
temperature so latent heat becomes the difference in enthalpy between
the two phases involved. The original terms were renamed as alvl3 and
alvi3, to represent that they are values at the triple point, and alvl
and alvi became functions

5. I moved all conversions between enthalpy/energy and temperature to
therm_lib and therm_lib8, and renamed some of the functions (qtk,
qwtk) to better represent their thermodynamic meaning.

Minor changes;
- nonlocal_dispersal wasnt assigned for PFTs (12-15)
- I just added the 2 variables to control the detailed output, a flag
to tell which types of output the user wants (IDETAILED) and
PATCH_KEEP, a flag to define which patch remains (used only when
IDETAILED is not 0). Most detailed output works only for single
polygon runs.
- Ramspost: now the buffers have enough size to deal with 4-D cumulus
variables, and cumulus variables seem to be working fine.\
- Reduced the photosynthesis tolerance to the same as therm_lib8
- Bug fix in canopy_structure_dynamics so that Massaman+branch thermo works
-  IALLOM parameters for dbh2bl to the way they were originally intended
-  Changed vt_vector from pointer to allocatable array
-  Reduced the number of pointer variables to 1100
-  Removed obsolete variables like wood projected area
  • Loading branch information
LevineLab committed Mar 22, 2012
2 parents 55be45b + eb4c96e commit 5a74305
Show file tree
Hide file tree
Showing 286 changed files with 50,804 additions and 20,604 deletions.
2,985 changes: 2,985 additions & 0 deletions .bzrignore

Large diffs are not rendered by default.

161 changes: 100 additions & 61 deletions BRAMS/Template/RAMSIN

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions BRAMS/Template/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
#------------------------------------------------------------------------------------------#
here=`pwd` # Local disk
moi=`whoami` # User name
diskthere='/n/scratch2/moorcroft_lab' # Output directory
diskthere='/n/moorcroftfs2' # 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
whena='01-01-2008 00:00' # Initial time for simulation
whenz='01-01-2009 00:00' # Final time for simulation
isfcl=5 # 1 = LEAF-3 run, 5 = ED-2.2 run

#------------------------------------------------------------------------------------------#
Expand Down Expand Up @@ -192,7 +192,8 @@ then
elif [ ! -s ${there} ]
then
mv tothere ${there}
else
elif [ ${here} != ${there} ]
then
echo ' There is already a directory called '${there}'...'
echo ' Do you want to delete it? [y/N]'
read proceed
Expand Down Expand Up @@ -232,6 +233,8 @@ else
rm -frv ${there}

mv tothere ${there}
else
mv tothere/* .
fi
#------------------------------------------------------------------------------------------#

Expand Down
12 changes: 6 additions & 6 deletions BRAMS/Template/tothere/rpost/1eachtime-sigma.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@
#------------------------------------------------------------------------------------------#
# CHANGE LOG #
#------------------------------------------------------------------------------------------#
ramspost='myoutpath/rpost/ramspost_6.2' # Name of executable file
tmpfolder='myoutpath/rpost/.temp' # Name of a timestrrary folder
ramspost='/n/moorcroftfs2/mlongo/EDBRAMS/coupled/monotonic-test/rpost/ramspost_6.2' # Name of executable file
tmpfolder='/n/moorcroftfs2/mlongo/EDBRAMS/coupled/monotonic-test/rpost/.temp' # Name of a timestrrary folder
nice='' # Command to "nice" the job. Put nothing if you don't want
# to be nice
runoutput='myoutpath/rpost/ramspost.out' # Name of a renewable output file
runoutput='/n/moorcroftfs2/mlongo/EDBRAMS/coupled/monotonic-test/rpost/ramspost.out' # Name of a renewable output file
compression='none' # Kind of compression:(Z, bz2, zip, gz, or none)
title='EDBRAMS-1.4' # Title to appear in the header
# (no practical relevance)
deleteintctl='y' # Delete intermediate ctl [y/N]
# (a template will be provided)
outshell='y'
shellout='myoutpath/rpost/serial_out.out' # File for 1eachtime-sigma.sh output
shellout='/n/moorcroftfs2/mlongo/EDBRAMS/coupled/monotonic-test/rpost/serial_out.out' # File for 1eachtime-sigma.sh output

#------------------------------------------------------------------------------------------#
#------------------------------------------------------------------------------------------#
Expand Down Expand Up @@ -91,7 +91,7 @@ fi


#----- Determine the analysis prefix from the list. ---------------------------------------#
fprefix=`grep -i FPREFIX ramspost.inp`
fprefix=`grep -i FPREFIX ramspost.inp | grep -vi "\-\-"`
fprefix=`echo ${fprefix} | sed s/" "/""/g |sed s/"'"/""/g`
ext=`echo ${fprefix} |wc -c`
p=0
Expand All @@ -114,7 +114,7 @@ fprefix=`echo ${fprefix} | awk '{print substr($1,9,'${ext}')}'`
#------------------------------------------------------------------------------------------#
# Determine the output file prefix from the namelist. #
#------------------------------------------------------------------------------------------#
gprefix=`grep -i GPREFIX ramspost.inp`
gprefix=`grep -i GPREFIX ramspost.inp | grep -vi "\-\-"`
gprefix=`echo ${gprefix} | sed s/" "/""/g |sed s/"'"/""/g`
ext=`echo ${gprefix} |wc -c`
p=0
Expand Down
176 changes: 83 additions & 93 deletions BRAMS/Template/tothere/rpost/ramspost.inp
Original file line number Diff line number Diff line change
@@ -1,99 +1,89 @@
$RP_INPUT

$RP_INPUT
!--------------------------------------------------------------------------------------!
! FPREFIX -- Prefix of the input files. !
!--------------------------------------------------------------------------------------!
FPREFIX = 'myoutpath/analy/mysimul-A-',
!--------------------------------------------------------------------------------------!

!--------------------------------------------------------------------------------------!
! NVP -- List of variables to be printed. !
! VP -- Variable names (only the first NVP variables will be used) !
!--------------------------------------------------------------------------------------!
NVP = 86,
VP = 'longitude', 'latitude', 'press', 'tempc', 'theta',
'theiv', 'co2', 'rv', 'liquid', 'ice',
'cuprliq', 'cuprice', 'areadn', 'areaup', 'wdndraft',
'wupdraft', 'thsrc', 'rtsrc', 'co2src', 'ue_avg',
've_avg', 'w_avg', 'tke', 'sigw', 'conprr',
'dnmf', 'upmf', 'edt', 'ierr', 'aadn',
'aaup', 'pcprate', 'acccon', 'totpcp', 'pblhgt',
'zen', 'rshort', 'rshorttoa', 'rshortd', 'albedt',
'rlong', 'rlongup', 'h', 'evap', 'transp',
'hflxca', 'qwflxca', 'cflxca', 'land', 'sst',
'topo', 'lai_ps', 'agb_ps', 'tcan_ps', 'thcan_ps',
'rvcan_ps', 'pcan_ps', 'co2can_ps', 'tveg_ps', 'ustar_ps',
'tstar_ps', 'rstar_ps', 'cstar_ps', 'tempc2m', 'tdewc2m',
'u10m', 'smoist_ps', 'smfrac_ps', 'tsoil_ps', 'sltex_bp',
'vtype_bp', 'sfcw_mass', 'sfcw_depth', 'sfcw_temp', 'vegz0_ps',
'z0_ps', 'rib_ps', 'zeta_ps', 'gpp', 'plresp',
'resphet', 'mynum', 'relvortx', 'relvorty', 'solenoidx',
'solenoidy',
!--------------------------------------------------------------------------------------!

NVP = 75,
VP ='longitude',
'latitude',
'press',
'tempc',
'theta',
'theiv',
'co2',
'rv',
'liquid',
'ice',
'ue_avg',
've_avg',
'w_avg',
'relvortx',
'relvorty',
'solenoidx',
'solenoidy',
'tke',
'sigw',
'conprr',
'dnmf',
'upmf',
'aadn',
'aaup',
'pcprate',
'acccon',
'totpcp',
'pblhgt',
'zen',
'rshort',
'rshorttoa',
'rshortd',
'albedt',
'rlong',
'rlongup',
'h',
'evap',
'transp',
'hflxca',
'qwflxca',
'cflxca',
'land',
'sst',
'topo',
'lai_ps',
'agb_ps',
'tcan_ps',
'thcan_ps',
'rvcan_ps',
'pcan_ps',
'co2can_ps',
'tveg_ps',
'ustar_ps',
'tstar_ps',
'rstar_ps',
'cstar_ps',
'tempc2m',
'tdewc2m',
'u10m',
'smoist_ps',
'smfrac_ps',
'tsoil_ps',
'sltex_bp',
'vtype_bp',
'sfcw_mass',
'sfcw_depth',
'sfcw_temp',
'vegz0_ps',
'z0_ps',
'rib_ps',
'zeta_ps',
'gpp',
'plresp',
'resphet',
'mynum',

!--------------------------------------------------------------------------------------!
! GPREFIX -- Prefix of the output files. !
!--------------------------------------------------------------------------------------!
GPREFIX = 'binary/mysimul',
!--------------------------------------------------------------------------------------!



!--------------------------------------------------------------------------------------!
! NSTEP -- number of steps to use. If 1, every step is used; if 2, every other step !
! is used; if 3, one step is used and two are skipped; and so on... !
!--------------------------------------------------------------------------------------!
NSTEP = 1,
!--------------------------------------------------------------------------------------!



!--------------------------------------------------------------------------------------!
! PROJ -- Should the files be projected to true lon/lat grid points (yes or no, case !
! insensitive). !
!--------------------------------------------------------------------------------------!
PROJ = 'no',
!--------------------------------------------------------------------------------------!


!--------------------------------------------------------------------------------------!
! LATI -- Southernmost latitude to consider (one value per grid). !
! LATF -- Northernmost latitude to consider (one value per grid). !
! LONI -- Westernmost longitude to consider (one value per grid). !
! LONI -- Easternmost longitude to consider (one value per grid). !
!--------------------------------------------------------------------------------------!
LATI = -90., -90., -90.,
LATF = +90., +90., +90.,
LONI = -180.,-180., -180.,
LONF = 180., 180., 180.,
!--------------------------------------------------------------------------------------!

ANL2GRA='ALL',
PROJ='NO',
LATI = -90.,-90., -90.,
LATF = +90.,+90., +90.,
LONI = -180.,-180., -180.,
LONF = 180.,180., 180.,


ZLEVMAX = 51,51,51,

IPRESSLEV = 0,
INPLEVS = 12,
IPLEVS = 2, 4, 6,7,8, 10, 12,14, 16,19,21, 23,
1000,975,950,925,900,850,800,750,700,500,300,200,

$end
!--------------------------------------------------------------------------------------!
! ZLEVMAX -- Maximum number of levels to output !
! IPRESSLEV -- Type of vertical coordinate: !
! 0. Native (sigma-z or shaved-eta) !
! 1. Pressure levels !
! 2. Height levels !
! INPLEVS -- In case ipresslev is 1 or 2, the number of prescribed levels !
! IPLEVS -- The height levels (N.B. they must be integers) !
! If IPRESSLEV = 1, IPLEVS are pressure levels in hPa !
! IPRESSLEV = 2, IPLEVS are the height levels in m above sea level. !
!--------------------------------------------------------------------------------------!
ZLEVMAX = 51, 51, 51,
IPRESSLEV = 0,
INPLEVS = 19,
IPLEVS = 1000, 975, 950, 925, 900, 850, 800, 750, 700, 600,
500, 400, 300, 250, 200, 150, 100, 85, 70,
!--------------------------------------------------------------------------------------!
$END
7 changes: 7 additions & 0 deletions BRAMS/build/bin/2ndcomp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ rm -fv mem_mass.o mem_mass.mod
rm -fv mem_mclat.o mem_mclat.mod
rm -fv mem_micro.o mem_micro.mod
rm -fv mem_mksfc.o mem_mksfc.mod
rm -fv mem_mnt_advec.o mem_mnt_advec.mod
rm -fv mem_nestb.o mem_nestb.mod
rm -fv mem_oda.o mem_oda.mod
rm -fv mem_opt_scratch.o mem_opt_scratch.mod
Expand Down Expand Up @@ -143,12 +144,15 @@ rm -fv mksfc_ndvi.o mksfc_ndvi.mod
rm -fv mksfc_sfc.o mksfc_sfc.mod
rm -fv mksfc_sst.o mksfc_sst.mod
rm -fv mksfc_top.o mksfc_top.mod
rm -fv mnt_advec_aux.o mnt_advec_aux.mod
rm -fv mnt_advec_main.o mnt_advec_main.mod
rm -fv mod_advect_kit.o mod_advect_kit.mod
rm -fv mod_GhostBlock.o mod_GhostBlock.mod
rm -fv mod_GhostBlockPartition.o mod_GhostBlockPartition.mod
rm -fv mod_ozone.o mod_ozone.mod
rm -fv model.o model.mod
rm -fv modsched.o modsched.mod
rm -fv mpass_advec.o mpass_advec.mod
rm -fv mpass_cyclic.o mpass_cyclic.mod
rm -fv mpass_dtl.o mpass_dtl.mod
rm -fv mpass_feed.o mpass_feed.mod
Expand Down Expand Up @@ -275,6 +279,7 @@ rm -fv lake_coms.o lake_coms.mod
rm -fv mem_edcp.o mem_edcp.mod
rm -fv allometry.o allometry.mod
rm -fv average_utils.o average_utils.mod
rm -fv bdf2_solver.o bdf2_solver.mod
rm -fv budget_utils.o budget_utils.mod
rm -fv c34constants.o c34constants.mod
rm -fv canopy_air_coms.o canopy_air_coms.mod
Expand All @@ -283,6 +288,7 @@ rm -fv canopy_radiation_coms.o canopy_radiation_coms.mod
rm -fv canopy_struct_dynamics.o canopy_struct_dynamics.mod
rm -fv consts_coms.o consts_coms.mod
rm -fv decomp_coms.o decomp_coms.mod
rm -fv detailed_coms.o detailed_coms.mod
rm -fv disturb_coms.o disturb_coms.mod
rm -fv disturbance.o disturbance.mod
rm -fv ed_bare_restart.o ed_bare_restart.mod
Expand Down Expand Up @@ -320,6 +326,7 @@ rm -fv grid_coms.o grid_coms.mod
rm -fv growth_balive.o growth_balive.mod
rm -fv h5_output.o h5_output.mod
rm -fv heun_driver.o heun_driver.mod
rm -fv hybrid_driver.o hybrid_driver.mod
rm -fv hydrology_coms.o hydrology_coms.mod
rm -fv hydrology_constants.o hydrology_constants.mod
rm -fv init_hydro_sites.o init_hydro_sites.mod
Expand Down
Loading

0 comments on commit 5a74305

Please sign in to comment.