Skip to content

Improve prognostic variable initialization and refactor soil parameterization

Brian Groenke requested to merge bgroenke/cryogridjulia:refactor/var-init into master

Refactors variable initialization to decouple from individual stratigraphy components.

Instead of initialization profiles being provided in each component (e.g. Heat having an initT field), initialcondition! is now invoked directly by the user. The returned u0 can be used to construct the corresponding CryoGridProblem, which is more in-line with the normal ODEProblem API from SciMLBase.

Note that this is a user-facing breaking change. However, it greatly improves the flexibility of initialization; by default, constant and interpolating initializers are provided, but others could be implemented in the future or by the user).

Additionally, soil properties are now abstracted into SoilParameterization with one current implementation, SoilCharacteristicFractions (xice, porosity, saturation, solid organic). The soilparameters function is used as a convenient, unifying constructor and can be overloaded further for others soil parameterizations.

Extra (long overdue) maintenance change: variables and initialcondition! methods for Layer only have been removed. These are outdated/unused, and inconsistent with the overall framework. All variables (diagnostic and prognostic) can now only be declared on a pair of Layer/Process.

Edited by Brian Groenke

Merge request reports