Ctests for individual schemes. #354
Ctests for individual schemes. #354bbakernoaa wants to merge 13 commits intoufs-community:ufs/devfrom
Conversation
…iance - Unified soil and water density constants in dust_data_mod. - Introduced fengsha_params_type to manage scheme constants. - Added OpenMP parallelization to the driver. - Implemented CCPP-style error handling with errmsg and errflg. - Created a standalone test suite with CMake support. - Modernized syntax and improved documentation.
…iance - Unified soil and water density constants in dust_data_mod. - Introduced fengsha_params_type to manage scheme constants. - Added OpenMP parallelization to the driver. - Implemented CCPP-style error handling with errmsg and errflg. - Created a standalone test suite with CTest support. - Modernized syntax and improved documentation.
- Added Doxygen-style documentation for all subroutine arguments. - Unified soil and water density constants in dust_data_mod.F90. - Introduced fengsha_params_type to manage scheme constants. - Added OpenMP parallelization to the driver. - Implemented CCPP-style error handling with errmsg and errflg. - Created a standalone test suite with CTest support. - Modernized syntax and improved documentation.
- Moved all FENGSHA parameters and unified densities into dust_fengsha_mod.F90. - Restored shared dust_data_mod.F90 to original state. - Refactored driver for F2008, OpenMP, and CCPP compliance. - Added Doxygen-style documentation for all arguments. - Updated FENGSHA call in rrfs_smoke_wrapper.F90. - Added standalone test suite with CTest support.
- Moved all FENGSHA parameters and unified densities into dust_fengsha_mod.F90. - Refactored driver for F2008, OpenMP, and best practices. - Added Doxygen-style documentation for all arguments. - Updated FENGSHA call in rrfs_smoke_wrapper.F90. - Added standalone test suite with CTest support. - Removed unnecessary .meta file for internal scheme.
- Refactored dust_fengsha_mod.F90 for Fortran 2008 and CCPP compliance. - Unified soil (2650 kg/m3) and water (1000 kg/m3) densities. - Parameterized hardcoded constants into fengsha_params_type. - Added Doxygen-style documentation for all arguments. - Implemented OpenMP parallelization in the driver. - Updated rrfs_smoke_wrapper.F90 for the new driver interface. - Added a comprehensive unit test suite with CTest support, covering standard land, water, frozen soil, snow cover, high roughness, and wind threshold cases.
- Modernized dust_fengsha_mod.F90 for Fortran 2008 and CCPP compliance. - Unified soil and water densities. - Parameterized hardcoded constants into fengsha_params_type. - Added OpenMP parallelization to the driver. - Implemented CCPP-style error handling. - Added Doxygen documentation for all interfaces. - Created a comprehensive test suite (8 cases) using CTest. - Integrated tests into CI with a new GitHub Actions workflow.
- Modernized dust_fengsha_mod.F90 for Fortran 2008 and CCPP compliance. - Unified soil (2650 kg/m3) and water (1000 kg/m3) densities locally. - Parameterized hardcoded constants into fengsha_params_type. - Added OpenMP parallelization to the driver. - Implemented CCPP-style error handling. - Added Doxygen documentation for all interfaces. - Created a comprehensive test suite (8 cases) using CTest. - Integrated tests into CI with a new GitHub Actions workflow ci_ctests.yml.
…822003951296 Cleanup and modernizing FENGSHA dust emission scheme
- Created test_seas_gocart.F90 to test GOCART sea salt emission scheme. - Created test_wetdep_ls.F90 to test large-scale wet deposition scheme. - Updated physics/smoke_dust/tests/CMakeLists.txt to include new tests and integrate with CTest. - Verified all tests pass using ctest.
|
|
||
| jobs: | ||
| ctests: | ||
| if: github.repository == 'NCAR/ccpp-physics' || github.repository == 'ufs-community/ccpp-physics' || github.repository == 'bbakernoaa/ccpp-physics' |
There was a problem hiding this comment.
I think this should be either "only the authoritative repository" or "any repository".
There was a problem hiding this comment.
I agree. These are small enough it could any repository.
| - name: Install dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y gfortran cmake |
There was a problem hiding this comment.
This may be ok for now, in the long run we need another option so that we have ESMF, w3emc, ip, bacio. We can probably piggyback on the container solution that @dustinswales is working on for running SCM from this repository.
There was a problem hiding this comment.
These unit tests don't need ESMF or any other dependencies, just fortran and cmake.
The CCPP SCM tests do need all of those other things, which is a pain to install/maintain on the GitHub runners, not to mention slow. So we are moving to containerized CI to give us total control, plus access to proprietary compilers.
There was a problem hiding this comment.
We'll need a bit of time to mull this over. It may be better to have one test directory at the top level of NCAR ccpp-physics main that takes care of the different tests, like it is done for most other large code bases. (I am talking about the CMakeLists.txt part only).
There was a problem hiding this comment.
Sure. Just a jumping off point.
There was a problem hiding this comment.
I kinda like the idea of keeping the tests alongside the scheme, which is consistent with how physics submodules are organized (i.e. test/ and src/ dirs).
- Added test_seas_gocart.F90 for sea salt emission verification. - Added test_wetdep_ls.F90 for large-scale wet deposition verification. - Updated CMakeLists.txt to include new test targets and improved build logic. - Renamed GitHub Action step to "Build and run smoke and dust tests" to reflect broader coverage.
…4801856136 Add more tests to the smoke and dust suite
Co-authored-by: Dom Heinzeller <dom.heinzeller@icloud.com>
dustinswales
left a comment
There was a problem hiding this comment.
@bbakernoaa Thanks for these changes.
You are the first developer to add unit tests to a scheme in the CCPP and trigger them via GitHub Actions. Schemes in submodules do this, but no parameterizations residing in the CCPP do.
We need more of this in the CCPP and hopefully this provides the motivation and a roadmap for others.
I suggest using more specific names for the tests, but otherwise I have no concerns.
There was a problem hiding this comment.
I kinda like the idea of keeping the tests alongside the scheme, which is consistent with how physics submodules are organized (i.e. test/ and src/ dirs).
| @@ -0,0 +1,26 @@ | |||
| name: Physics Scheme Unit Tests (CTest) | |||
There was a problem hiding this comment.
Maybe change to something like "Smoke-Dust Unit Tests (CTest)"
| on: [push, pull_request] | ||
|
|
||
| jobs: | ||
| ctests: |
There was a problem hiding this comment.
Ditto more descriptive name here.
If/when more schemes add unit tests, we want to have a name that is extensible
| - name: Install dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y gfortran cmake |
There was a problem hiding this comment.
These unit tests don't need ESMF or any other dependencies, just fortran and cmake.
The CCPP SCM tests do need all of those other things, which is a pain to install/maintain on the GitHub runners, not to mention slow. So we are moving to containerized CI to give us total control, plus access to proprietary compilers.
Description of Changes:
This pull request introduces comprehensive unit testing for the FENGSHA dust emission scheme in the
physics/smoke_dustdirectory. It adds a new CTest-based workflow for automated testing, includes a CMake configuration for building the tests, and implements a thorough Fortran test program that covers multiple edge cases for dust emissions. Additionally, a minor error handling improvement is made in the smoke wrapper routine.Automated Testing Infrastructure:
.github/workflows/ci_ctests.yml) to automatically build and run the FENGSHA unit tests on push and pull request events.CMakeLists.txtfile for the FENGSHA test suite, enabling easy compilation and integration with CTest for automated test execution.FENGSHA Dust Emission Unit Tests:
test_dust_fengsha.F90) that exercises the FENGSHA dust emission driver across a variety of scenarios, including standard emission, water, frozen soil, snow cover, high roughness, invalid soil type, low wind, and very dry soil. The test program reports pass/fail for each case and stops on failure.Code Robustness Improvement:
rrfs_smoke_wrapper_runsubroutine to propagate error messages and flags from the FENGSHA driver and to return early if an error is detected, improving overall error handling.@climbfuji @ligiabernardet @dustinswales