Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate WaterStateType into multiple types #358

Closed
billsacks opened this issue Apr 30, 2018 · 3 comments
Closed

Separate WaterStateType into multiple types #358

billsacks opened this issue Apr 30, 2018 · 3 comments
Assignees
Labels
enhancement new capability or improved behavior of existing capability

Comments

@billsacks
Copy link
Member

To support the addition of isotopes, we'd like to split WaterStateType (and possibly WaterFluxType and others) into multiple types. The motivation is that we'd like to have multiple instances of some types: one for bulk water and one for each isotope or other tracer. But currently there are a lot of variables in WaterStateType, and possibly WaterFluxType and elsewhere, that should not be replicated across the various tracers. So we should split this into 2 or more types: one containing the "true" state variables that are replicated across tracers, and one or more auxiliary types containing variables that are only needed for the bulk variables.

This effort can be guided by the list of variables that were replicated for water isotopes in the old water isotope branch managed by Ben Andre.

@billsacks
Copy link
Member Author

Here is the first iteration of the attempt to divide WaterStateType

DividingWaterStateType.F90.txt

@billsacks
Copy link
Member Author

In order to iterate on this prototype, I have set up a github repo: https://github.com/billsacks/prototypes-ctsm-water_state_breakout . The initial commit is the same as what I uploaded in my last comment (which is, in turn, the same as what I emailed out two days ago).

@billsacks
Copy link
Member Author

Sorry, one more iteration on where to record my thoughts: I realized that, for the sake of recording these thoughts for posterity, it would be better if they were recorded in a PR in this repo. So see #395 .

mathewvrothstein added a commit to mathewvrothstein/ctsm that referenced this issue Jul 2, 2018
types for state, diagnostic, and water balance

see issue ESCOMP#358
ESCOMP#358
billsacks pushed a commit to billsacks/ctsm that referenced this issue Feb 22, 2019
types for state, diagnostic, and water balance

see issue ESCOMP#358
ESCOMP#358
billsacks added a commit to billsacks/ctsm that referenced this issue Feb 22, 2019
Rework water data types to accommodate isotopes and other tracers

This tag reworks the various water data types to allow having multiple
instances of variables that are needed for isotopes and other water
tracers.

Specific changes include:

(1) Separated "water state" variables into state, diagnostic and balance
    check-related variables. This separation was not essential for the
    work here, but was desired by Martyn Clark and others.

(2) For each of water state, diagnostic and flux variables, separated
    variables into those needed for both bulk and tracers vs. those only
    needed for bulk. This way, we can have multiple instances of the
    variables needed by tracers, but only a single instance of variables
    that only apply to bulk water. This follows the design laid out in
    ESCOMP#395. The separation was based
    largely on what was done in the old water isotope branch; we didn't
    put a lot of thought into this, because the new design allows us to
    easily migrate variables between bulk-only and bulk-and-tracer as
    needed.

(3) Moved water fluxes that were defined in science modules back into
    waterflux_type or waterfluxbulk_type. This was needed for (2); there
    is more discussion on this in
    ESCOMP#395 and the log message for
    commit 711e5cd.

(4) Introduced a top-level water_type that holds instances of all of the
    other water-related objects. This follows the design laid out in
    ESCOMP#395. This is particularly
    valuable for the tracer instances: the logic related to number of
    tracers can be encapsulated in water_type, rather than infiltrating
    clm_instMod.

(5) Added placeholders for water tracer instances

(6) Added infrastructure to generate history / restart field names for
    the tracer instances. Eventually, the isotope class can also hold
    information specific to each isotope.

This work was a joint effort between Mathew Rothstein and myself; Mat
gets much of the credit for the actual refactoring done here.

Issues fixed (include CTSM Issue #):
- Fixes ESCOMP#358 (Separate WaterStateType into multiple types)
- Fixes ESCOMP#434 (Separate WaterFluxType into a base class and a class that just applies to bulk)
- Fixes ESCOMP#359 (Set up infrastructure for multiple instances of WaterState and WaterFlux types)
- Fixes ESCOMP#458 (Implement handling of history and restart variables for water tracers)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement new capability or improved behavior of existing capability
Projects
None yet
Development

No branches or pull requests

2 participants