Closed peverwhee closed 3 weeks ago
I still don't have a way to test this in NEPTUNE or the UFS, but my comments were addressed, all CI tests pass, and this capability is really important to have. For NEPTUNE, we are primarily interested in getting namelist information from the
register
phase so that we can setup the output variable registry before going through the ESMF/NUOPC init phase and the subsequent CCPP init phase.I do have a question, though. The CCPP technical documentation (https://github.com/ncar/ccpp-doc) is for ccpp_prebuild only, and none of the new capabilities developed for capgen are captured in any kind of documentation. Would it make sense to start a feature/capgen branch in ccpp-doc (if we want to keep documenting CCPP in this form), or in some other ways while these new features are being added? It seems daunting to write documentation from scratch after capgen was implemented in the UFS and all other models using prebuild at the moment. Maybe we can discuss this at the next CCPP framework meeting @mkavulich ?
@climbfuji yes, I think discussing capgen documentation is a crucial topic to discuss! I've added it to next week's agenda.
Overview
This PR adds a new phase, register, that can be called by a host model and used by schemes to perform any set up that needs to happen BEFORE the grid is established.
NOTE: this PR also removes the old
dynamic_constituent_routine
metadata implementation for runtime constituents.Description
I have implemented it as an "optional" phase, by which I mean that it is not required that a host model call this phase (though I'm happy to be overruled!). As a result, the register phase does not change the CCPP "state" (but will produce an error if it is called after the
init
phase).More:
Dynamic/run-time constituent handling:
ccpp_constituent_properties_t
variable required):dynamic_constituents_for_<scheme>
<suite>_dynamic_constituents
, which are then used to pack and initialize the module level constituents object<host>_constituents_obj
.Generated host cap code examples
Multiple schemes have dynamic constituents:
No schemes have dynamic constituents:
Misc notes
Since this phase is called before the grid is initialized, variables are not allocated at this time (that still happens in
init
) and no variables with horizontal and vertical dimensions can be passed in.UI Changes
User interface changes?: Yes, but they're optional If a host model wishes to utilize schemes' register phases, they must add a call to
<host_model>_ccpp_physics_register(suite_name, errmsg, errflg)
Testing
test removed: removed unit tests for dyn_const_routines (old implementation of runtime constituent handling) - all pass unit tests: Removed old dynamic constituents testing - all pass system tests: Updated capgen and advection tests to include register phases (with and without dynamic constituents)
Fixes: closes #572