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_prebuild: ccpp stub and various bugfixes #436

Closed climbfuji closed 2 years ago

climbfuji commented 2 years ago

A stub ccpp-physics package is added in directory stub that currently works with ccpp_prebuild.py. See https://github.com/NCAR/ccpp-framework/issues/435 for some background information.

The stub is so basic and generic that it can be adapted for capgen if required, or deleted. The recipe for capgen.py's hello world example will make this an easy task.

If desired, the necessary build files for capgen can be added in the future, although there will have to be some logic in the stub/CMakeLists.txt file that switches between prebuild and capgen. This might actually be useful as a cookbook recipe for transitioning from prebuild to capgen.

There are no updates in this PR that require changes in capgen.py.

The stub also helped to identify a few bugs and areas that needed cleanup in ccpp_prebuild.py, mostly because the stub didn't require some of the variables that ccpp_prebuild.py's mkstatic.py expects to be there.

Note. Some of these bug fixes are required for ongoing work of adding the ccpp-framework and ccpp-physics to the CMEPS mediator (exchange grid). In particular the addition of a --namespace option to allow for multiple ccpp_static_api_NAMESPACE.F90 in coupled model runs, where multiple components call into CCPP.

User interface changes?: Yes - one item in the ccpp_prebuild_config.py file is renamed from static_api_srcfile to static_api_sourcefile.

Fixes https://github.com/NCAR/ccpp-framework/issues/435 Fixes https://github.com/NCAR/ccpp-framework/issues/394

Testing:

climbfuji commented 2 years ago

@grantfirl @gold2718 @mkavulich This is now ready for review. It's up to date with the latest changes in NCAR main, and all tests for this repository pass.

The RT testing with the ufs-weather-model can only happen after @uturuncoglu updates his corresponding ufs-weather-model, CMEPS, fv3atm, ccpp-physics branches and points to the head of this branch. But these tests passed previously and no changes were made since then that would suggest problems.

@mkavulich When this gets merged, the CCPP technical documentation needs to be updated to reflect the namespace option, the changes in ccpp_prebuild_config.py, and the stub capability. @grantfirl: Also need to update your ccpp_prebuild.py flowchart.

@ligiabernardet I suggest these changes to go in after the CCPP v6 release.

uturuncoglu commented 2 years ago

@climbfuji i am plaining to update my fork in a couple of days and make all the draft PRs active to start formal process of review of other linked PRs. I have already run all the regression tests with the current version and all of them was passing at that point but I'll test again after updating the UFS fork and also run ORT test with the newly added RT for exchange grid. More update will come soon.

climbfuji commented 2 years ago

@uturuncoglu Thanks for letting me know. I will update my branch with the latest changes in the authoritative repo/branch and send you the new hash.

uturuncoglu commented 2 years ago

@climbfuji i wonder if you find a change to update the branch?

climbfuji commented 2 years ago

@uturuncoglu Done - new hash is 5fe0dc7ff9d6e6fa5f51d75c5e5a3f09c5bdb697.

uturuncoglu commented 2 years ago

@climbfuji thanks, that is great.

uturuncoglu commented 2 years ago

@climbfuji the model is updated and I activate all the PRs for official review. All the RT tests are passing on Cheyenne.

uturuncoglu commented 2 years ago

@climbfuji @grantfirl this PR is ready to merge. The top level UFS PR regression tests in different platforms passed without any issue. Both CCPP physics and framework PRs need to be merged before FV3 one. BTW, CMEPS PR is already merged.

climbfuji commented 2 years ago

@climbfuji @grantfirl this PR is ready to merge. The top level UFS PR regression tests in different platforms passed without any issue. Both CCPP physics and framework PRs need to be merged before FV3 one. BTW, CMEPS PR is already merged.

I am more than glad to see this getting merged, thanks for your hard work @uturuncoglu !

climbfuji commented 2 years ago

@uturuncoglu PR merged. New ccpp-framework hash for NCAR main is https://github.com/NCAR/ccpp-framework/commit/167313e029f62833a7390fac06cfe3869b00b2da, please update your submodule pointer in fv3atm.

uturuncoglu commented 2 years ago

@climbfuji thanks. I'll update the UFS model soon. Thanks for your great help. It was impossible without you.