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

Create generalized mixing ratio conversion schemes #68

Open
nusbaume opened this issue Sep 20, 2023 · 1 comment
Open

Create generalized mixing ratio conversion schemes #68

nusbaume opened this issue Sep 20, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@nusbaume
Copy link
Collaborator

Now that the CCPP-framework's constituent object is up and running, it would be great to figure out a way to replace the species-specific wet-to-dry and dry-to-wet physics schemes with more generic routines that can convert all wet constituent variables to dry and visa versa.

@gold2718
Copy link
Contributor

One thing I struggled with is keeping track of the state of each species.
Currently in CAM, the wet-to-dry or dry-to-wet is often done "in place" (via set_dry_to_wet and set_wet_to_dry) so the value of a state%q species could be wet or dry with no indication.

In the CCPP world, these two states are associated with different standard names so a generic routine needs to be able to see and possibly manipulate the standard names of the constituent object species.

If the choice is to modify in-place, use of the object needs to be careful to not use old constituent array indices since they may now point to the wrong mixing ratio. The framework needs to be able to always pull out or create the correct mixing ratio for any species declared individually by a scheme and schemes need to have some way to indicate which state they want everything in to provide some protection against the troubles we have run into in the past.

If the choice is to modify via a copy, this would take a bunch of new memory but then, the objects should have different standard names. Also, in this world, it could be problematic to have a "mixed" object, that is one where some species are dry and some are wet (which might be a good thing since that would be a confusing state of affairs).

Of course, a third option could be to go with some sort of internal solution whereby the object could hand over any requested mixing ratio by doing an on-the-fly conversion and then keep everything consistent using some sort of cache-consistency algorithm.

I may be overthinking this but this is how I see it anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants