EDmodel/ED2 — pull request #16 by crollinson (2014-12-30 22:13:07+00:00)
Title: SFCWater Fixes

A number of small fixes regarding snow and temporary water in ED. Tweaks center around 2 themes:
1. Rules regarding snow layers. This includes rules for creating new layers and how top/bottom snow layers interact with the ground & air
2. The snowfac usage in canopy_struct_dynamics. The most recent changes to snowfac would cause problems with CO2 going out of bounds in certain cases. This should probably be looked into in greater depth in the future.

Specific Edits & Rationale:

Canopy_struct_dynamics:
Re-implemented old version of snowfac (percentage of vertical canopy
covered by snow). Old version was causing CO2 to go out of bounds in
young patches due to weird canopy roughness

rk4_derivs:
line 487: this should not be scaled by snowfac. We need to relative
fluxes and this is not affected by how much of the area is covered in
snow.
line 514: the top layer of snow needs to interact with the air to
prevent massive amounts of energy transfer back & forth between snow
layers (which causes the spiral out of control)
1009-1014: we may not need this

rk4_misc:
changed the rules for creating a new snow layer so that minimum mass,
depth & energy conditions must be met. This prevents the formation of
layers with 1/2 of the total mass, but only a small fraction of the
energy (which makes a very cold layer & contributed to the spiral out
of control)

ed_init:
corrected thickness allocation, so that it evaluates FALSE for even
numbers (old version could never be false)

ed_therm_lib
fix bug that caused a crash when sfcwater_depth = plant height