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

ccpp_prebuild: ccpp stub and various bugfixes #436

Merged
merged 16 commits into from
Jun 9, 2022

Conversation

climbfuji
Copy link
Collaborator

@climbfuji climbfuji commented Feb 3, 2022

A stub ccpp-physics package is added in directory stub that currently works with ccpp_prebuild.py. See #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 #435
Fixes #394

Testing:

  • Instructions for how to build the stub added (stub/README.md), this also serves as a kind of test. No other tests added or removed.
  • To do after the correspondig UFS branches are updated: ufs-weather-model code compiles and runs on macosx with GNU for all physics suites in fv3atm.
  • To do after the correspondig UFS branches are updated: full regression tests with the ufs-weather-model still need to be run.
  • Done 04/16/2022: All capgen tests pass (cd test && ./run_test.sh and cd test && ./run_doctest.sh).
  • Done 04/16/2022: All ccpp_prebuild tests pass (cd tests && PYTHONPATH=/Users/dom.heinzeller/scratch/ufs-weather-model/ufs-weather-model-ufuk-exchange-grid-20220416/FV3/ccpp/framework/scripts:/Users/dom.heinzeller/scratch/ufs-weather-model/ufs-weather-model-ufuk-exchange-grid-20220416/FV3/ccpp/framework/scripts/parse_tools:$PYTHONPATH python test_metadata_parser.py and cd tests && PYTHONPATH=/Users/dom.heinzeller/scratch/ufs-weather-model/ufs-weather-model-ufuk-exchange-grid-20220416/FV3/ccpp/framework/scripts:/Users/dom.heinzeller/scratch/ufs-weather-model/ufs-weather-model-ufuk-exchange-grid-20220416/FV3/ccpp/framework/scripts/parse_tools:$PYTHONPATH python test_mkstatic.py).
  • Done 04/16/2022: Stub builds following the instructions in stub/README.md.

Copy link
Collaborator

@gold2718 gold2718 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One suggested and a couple of changes (unless I am misremembering that ccpp_error_flag got changed to ccpp_error_code).

@climbfuji climbfuji marked this pull request as draft February 7, 2022 04:07
@climbfuji climbfuji requested a review from gold2718 April 16, 2022 16:53
@climbfuji climbfuji marked this pull request as ready for review April 16, 2022 16:53
@climbfuji
Copy link
Collaborator Author

@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.

Copy link
Collaborator

@gold2718 gold2718 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now.

Copy link
Collaborator

@mkavulich mkavulich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still learning how the whole system works, but I don't see any problems, just a couple minor comments.

@uturuncoglu
Copy link
Contributor

@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
Copy link
Collaborator Author

@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
Copy link
Contributor

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

@climbfuji
Copy link
Collaborator Author

@uturuncoglu Done - new hash is 5fe0dc7.

@uturuncoglu
Copy link
Contributor

@climbfuji thanks, that is great.

@uturuncoglu
Copy link
Contributor

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

@uturuncoglu
Copy link
Contributor

@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
Copy link
Collaborator Author

@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 climbfuji merged commit 167313e into NCAR:main Jun 9, 2022
@climbfuji climbfuji deleted the ccpp_framework_stub_merged_20220202 branch June 9, 2022 13:38
@climbfuji
Copy link
Collaborator Author

@uturuncoglu PR merged. New ccpp-framework hash for NCAR main is 167313e, please update your submodule pointer in fv3atm.

@uturuncoglu
Copy link
Contributor

uturuncoglu commented Jun 9, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants