I want to slot in new code for Coastal total water level (TWL) functionality as cleanly as possible with the existing code base. In particular, it seems like CoastalFormulation should be a natural analog to the existing CatchmentFormulation. A lot of stuff there in the baseFormulation interface right now is specific to the existing lumped catchment models, or is just defunct. I try to clean out what's gotten in my way so far, to make the subsequent additions easier.
Additions
None
Removals
Nexus Manager class stub that was added years ago and never fleshed out or used
Scalar overload of Formulation::get_var_value_as_double, which was papering over an assumption of single element arrays that we agreed should be made more explicit
Changes
Move various functionality that's largely specific to our implementation of lumped catchments down from the Formulation base class to the CatchmentFormulation intermediate class
Move functionality duplicated across the several Bmi_{C,Cpp,Fortran,Py}_Formulation up to their common base Bmi_Module_Formulation class
Move arrays of variable names describing required parameters to BMI modules to class static members, to avoid duplicate allocation per instance.
Testing
Local testing on macOS
CI
Checklist
[x] PR has an informative and human-readable title
[x] Changes are limited to a single goal (no scope creep)
[x] Code can be automatically merged (no conflicts)
[x] Code follows project standards (link if applicable)
[x] Passes all existing automated tests
[x] Any change in functionality is tested
[x] New functions are documented (with a description, list of inputs, and expected output)
[x] Placeholder code is flagged / future todos are captured in comments
[x] Project documentation has been updated (including the "Unreleased" section of the CHANGELOG)
[x] Reviewers requested with the Reviewers tool :arrow_right:
I think this is mostly in shape to clear the path for Coastal needs. I'm still uncertain about create_formulation, but that could be addressed in a subsequent PR.
I want to slot in new code for Coastal total water level (TWL) functionality as cleanly as possible with the existing code base. In particular, it seems like
CoastalFormulation
should be a natural analog to the existingCatchmentFormulation
. A lot of stuff there in the baseFormulation
interface right now is specific to the existing lumped catchment models, or is just defunct. I try to clean out what's gotten in my way so far, to make the subsequent additions easier.Additions
None
Removals
Formulation::get_var_value_as_double
, which was papering over an assumption of single element arrays that we agreed should be made more explicitChanges
Formulation
base class to theCatchmentFormulation
intermediate classBmi_{C,Cpp,Fortran,Py}_Formulation
up to their common baseBmi_Module_Formulation
classstatic
members, to avoid duplicate allocation per instance.Testing
Checklist