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

GOCART2G_GridComp too cozy with MOIST parameterizations #231

Open
amdasilva opened this issue May 12, 2023 · 2 comments
Open

GOCART2G_GridComp too cozy with MOIST parameterizations #231

amdasilva opened this issue May 12, 2023 · 2 comments
Labels
architecture violation Mostly for issues, identifies code defects associated with architecture violations.

Comments

@amdasilva
Copy link
Collaborator

There is an architecture violation in GOCART2G_GridComp where its actions depends on the cloud microphysics it is coupling to:

if((adjustl(cld_micro)/="2MOMENT") .and. (index(aeroList(i), 'SU') > 0)) then ! maintained for compatibility with the single moment
call ESMF_StateGet(state, trim(aeroList(i)), child_state, RC)
call MAPL_GetPointer(child_state, ptr_3d, 'SO4', RC)
end if

This an ARCHITECTURE VIOLATION: a component should not know about its coupling environment. A symptom manifested itself recently when a change of the names of parameterizations inside MOIST required concurrent adjustment in GOCART2G. This is very undesirable as it requires very close matching of GOCART and MOIST releases.

The general principle is that callbacks should establish a protocol for interacting with cloud microphysics but in no way it should consult the MOIST resource file to find out details that are beyond the scope of GOCART2G. This could be avoided by having separate rc files for each component, rather than single GCM rc file that is used for all components.

@amdasilva amdasilva added the architecture violation Mostly for issues, identifies code defects associated with architecture violations. label May 12, 2023
@wmputman
Copy link
Contributor

All of this was removed in the HWT code, that should be merged in Krok

@mathomp4
Copy link
Member

@amdasilva This code is removed in #232. If you look here:

https://github.com/GEOS-ESM/GOCART/pull/232/files

You'll see that that "old" code has it, but the new side (green) has it removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
architecture violation Mostly for issues, identifies code defects associated with architecture violations.
Projects
None yet
Development

No branches or pull requests

3 participants