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

Add support (and tests) for optional arguments in ccpp_prebuild #552

Closed climbfuji closed 6 months ago

climbfuji commented 8 months ago

Add support (and tests) for optional arguments in ccpp_prebuild

See https://github.com/NCAR/ccpp-framework/issues/526 for a detailed description. This PR goes even further and creates an array of pointers for each conditionally allocated variable dimensioned to the number of OpenMP threads. This was required to fix multi-threading issues with GNU compilers (9.2.0 on Hera - might have to do with this being an old version). Since pointers do not cost anything in terms of memory, it's not an issue at all to have an array of number-of-openmp-thread pointers instead of a scalar.

User interface changes?: No

Resolves https://github.com/NCAR/ccpp-framework/issues/526 Resolves https://github.com/NCAR/ccpp-framework/issues/540

Testing: test removed: none unit tests: added test_prebuild/test_opt_arg/* and wrapper script test_prebuild/run_all_tests.sh that runs all tests - ALL PASS system tests: ran end-to-end regression tests for ufs-weather-model on Hera with Intel and GNU, all tests b4b identical with existing baseline manual testing: compile on macOS for all suites (cannot run due to ESMF/UFS-W-M bug on macOS, since about 5 years ago)

climbfuji commented 6 months ago

Everyone, this PR is finally open for review!

FernandoAndrade-NOAA commented 6 months ago

Testing for #2205 has completed successfully, please continue with merging this PR.