NCAR / ccpp-framework

Common Community Physics Package (CCPP)
http://www.dtcenter.org/community-code/common-community-physics-package-ccpp/
Other
26 stars 64 forks source link

CCPP Framework to provide API calls for suite inspection by host #380

Open grantfirl opened 3 years ago

grantfirl commented 3 years ago

Description

In the UFS (and copied in the SCM) the host needs to know information about the suite being run in order to conditionally allocate variables and set some control parameters. Right now, there is the messy situation that these control variables are set via namelist, regardless of what is actually in the SDF, which necessitated adding a bunch of consistency checks in the host code (see, e.g. https://github.com/NOAA-EMC/fv3atm/pull/302) and/or in the init stage of schemes. The namelist variables (most? all?) can go away if there was a way for the host to ask the framework if scheme X is present in the SDF.

Solution

Add a function in the CCPP API like scheme_in_suite_check('scheme_X') that returns a boolean.

Alternatives (optional)

Status quo: namelist variables that must be made consistent with the SDF (currently manually) and check for errors at run-time in the code.

Related to (optional)

Related to https://github.com/NOAA-EMC/fv3atm/pull/302.

Apologies if this functionality already exists or has been planned.

gold2718 commented 3 years ago

Is this proposed interface for runtime, build time (post framework), or both?

climbfuji commented 3 years ago

Please add to the agenda for 06/22 - we had a similar discussion in the past (remember: process etc.), but it's good to pick it up again.

On Jun 10, 2021, at 6:22 PM, goldy @.***> wrote:

Is this proposed interface for runtime, build time (post framework), or both?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/NCAR/ccpp-framework/issues/380#issuecomment-859172240, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB5C2RPKXOUKIJARQGXJ2EDTSFJLZANCNFSM46PSO7GQ.

grantfirl commented 3 years ago

@gold2718 This is for runtime. @climbfuji reminded me that we definitely have discussed addressing this in the past, but I didn't see any issue that actually requested this. This isn't any more urgent than it was the last time we talked about it, it was just brought to the forefront of my mind with some recent PRs in FV3 and SCM. @climbfuji, I'll see if I can dig up the meeting notes where this was discussed to link to the issue. I very much appreciate your note-taking for those meetings, but do you know if there is an easy way to search through them? Last time when I needed to look something up, I had to rely on my memory of approximate timeline and manually click through the meeting dates until I found what I was looking for.

gold2718 commented 3 years ago

Currently (in capgen), there is a post-framework database access for the processes, e.g.,

<ccpp_framework>/scripts/ccpp_datafile.py --process-list <build_dir>j/ccpp/ccpp_datatable.xml

should output a list of schemes tied to processes, e.g.,

deep_convection=am,microphysics=thompson

To add a runtime API, we need to define the desired interfaces.