Closed tbohn closed 5 years ago
@tbohn can you post a few figures from when you tested this branch so that we can confirm that results are identical with these changes?
@tbohn thanks. Once you've posted some plots then this will be good to go.
Differences in results between this branch and the current develop branch are 0.
This is the output of gridcell [1,1] in the Stehekin dataset. "Develop" = current develop branch, and "SoilParamUnits" is this PR.
@tbohn thanks, looks good to me.
Currently, the
soil_con
termsmax_moist
,Wcr
, andWpwp
, have units of [mm] butresid_moist
has units of [mm/mm]. Every timeresid_moist
is used in the model physics, it is first multiplied bydepth * MM_PER_M
for consistency with soil moisture units. Not only is this needless extra computation, but it also makes debugging and modification of the code needlessly difficult. Furthermore, it requires addingdepth
as an argument to various functions for the sole purpose of appearing in the unit conversion. There are also a few instances in which other soil moisture thresholds have their units converted needlessly (either other variables with the desired units already exist, or the units actually get converted BACK again before use!).This PR does the following:
resid_moist
to be mm. The conversion from fraction to mm occurs inread_soilparam()
andvic_init()
.max_moist
is divided bydepth * MM_PER_M
withporosity
.soil_con.max_moist_node
tosoil_con.porosity_node
.read_soilparam()
with a one-line call to existing functionsoil_moisture_from_water_table()
.