GEOS-ESM / GEOS-ESM/GOCART

GOCART2G_GridComp too cozy with MOIST parameterizations

Open
#231 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

architecture violation
Dominant language
Fortran
Stars
29
Forks
22
Avg merge
1d 16h
Merged PRs (30d)
4

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in GOCART2G_GridComp at the conditional on cld_micro and the SO4 state lookup, then inspect the callbacks and shared GCM rc-file usage described in the issue. Determine how the protocol can avoid consulting MOIST parameterization names. Done means GOCART2G no longer depends on those cloud-microphysics details while its coupling still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
fortran
Domain
backend-api-design
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.