Move btran2 to just inside of Fire model #1144
Labels
bfb
bit-for-bit
code health
improving internal code structure to make easier to maintain (sustainability)
btran2 is a bit of data in EnergyFluxes type that's just used as an alternative to btran for the Li Fire model. A scientific question would be could the fire model be tuned to use the regular value as well as the new PHS formulation? But, that would be an involved effort.
In the meantime, since this is just for use by the Li Fire model, it would be good to isolate it to just inside the fire model. Right now it's data in EnergyFluxes, it's initialized in CanopyFluxes, and then calculated in SoilMoistStress%calc_root_moist_stress_clm45default. And then it's only use is in CNFireLi2014Mod and CNFireLi2016Mod. clmfates_interfaceMod.F90 also uses it, but actually just sets it to a missing value, so it must not be used within FATES.
The calculation just involves this bit of code which is fairly well contained.
So, s_node, smp_node_lf would be local variables. h2osoi_vol, watsat, soil_water_retention_curve, soilstate_inst, smpsc, rootfr, smpso are then passed into the subroutine for calculating it. So it needs the types: waterstatebulk_inst, soilstate_inst, soil_water_retention_curve, and pftcon sent in. btran0 is a parameter in CanopyFluxes that is used for initialization, but it's just set to 0.0_r8, so I don't know that a big effort needs to be made to use it for btran2.
Note, #889 has some adjustments to the above, but if it's made to be inside LiFire model it'll be more straightforward to handle those changes without adding an extra switch for it outside of the existing fire_method switch.
The text was updated successfully, but these errors were encountered: