Feature/advanced clock#8
Open
bbakernoaa wants to merge 32 commits into
Open
Conversation
- Add native C++ implementations of FENGSHA, Ginoux (GOCART2G), and K14 dust emission schemes with Kokkos GPU-portable parallelization - Add Fortran bridge implementations for FENGSHA, Ginoux, and K14 schemes to call existing Fortran kernels - Add header files defining FengshaScheme, FengshaFortranScheme, GinouxScheme, GinouxFortranScheme, and K14Scheme classes - Add Fortran kernel modules (fengsha_kernel.F90, ginoux_kernel.F90, k14_kernel.F90) implementing core dust emission algorithms - Add C++ wrapper implementations (cece_fengsha.cpp, cece_ginoux.cpp, cece_k14.cpp) and Fortran bridge implementations - Add property-based unit tests for FENGSHA, Ginoux, and K14 schemes (test_fengsha_properties.cpp, test_ginoux_properties.cpp, test_k14_properties.cpp) - Update CMakeLists.txt to include new source files, Fortran kernels, and test executables with proper linking and test discovery - Enables multi-scheme dust emission modeling with both native C++ and Fortran-based implementations
- Add DMS sea-air exchange flux documentation with Schmidt number parameterization - Add Ginoux legacy dust emission scheme documentation with threshold velocity algorithm - Add FENGSHA dust scheme documentation with saltation model and size-resolved bins - Add Ginoux multi-bin dust scheme documentation with vertical flux distribution - Add K14 dust scheme documentation with brittle fragmentation model - Add lightning NOx production documentation with flash rate parameterization - Add MEGAN biogenic VOC emission documentation with activity factor approach - Add sea salt emission documentation with size-resolved bin distribution - Add soil NOx emission documentation with temperature and moisture dependencies - Add volcanic SO2 emission documentation with injection height specifications - Update FENGSHA C++ headers and implementation with refined algorithm details - Update K14 C++ headers and implementation with improved fragmentation calculations - Update Fortran bridge implementations for FENGSHA and K14 with enhanced parameter handling - Update Fortran kernel modules with optimized computational kernels
- Increase clang-format ColumnLimit from 100 to 150 characters for improved code readability - Add comprehensive Physics Schemes section to users guide with table of all available schemes - Add Python Interface section with example usage and build instructions - Reformat header files to comply with new column limit across compute, config, data ingestor, diagnostics, and physics modules - Update all source files in core, I/O, and physics implementations to match new formatting standards - Reformat test files to align with updated clang-format configuration - Improve code consistency and maintainability across the entire codebase
…cy files - Upgrade pip and add numpy to CI dependencies for improved package management - Fix whitespace formatting in GitHub Actions workflows for consistency - Refactor MEGAN scheme parameters to support configurable species and emission factors - Add new gamma_age and gamma_sm parameters to MeganScheme class for enhanced flexibility - Rename aef_isop_ to aef_ and introduce species_name_ and export_field_name_ fields - Add clang-format directives to logger for precise formatting control - Fix struct initialization syntax in CeceLogger for C++ standards compliance - Remove legacy MACCity_4x5.nc data file from scripts directory - Remove deprecated cece_core_initialize_p2_wrapper.cpp implementation file - Expand Python bindings to support updated MEGAN scheme configuration
- Consolidate multi-line string concatenations in tide_yaml_c.cpp error messages - Reformat function signatures in cece_megan.cpp to fit within column limit - Adjust line breaks in conditional expressions and assignments across modified files - Align with increased clang-format column limit configuration from recent style updates
- Change struct stat initialization from `st{}` to `st {}` for consistency
- Consolidate ISO8601 test date vector onto single line to improve readability
- Maintain compliance with established code formatting standards
- Add clang-format off/on directives around multi-line error message - Preserve error message formatting across line breaks - Maintain consistency with code style guidelines
…ists - Remove src/cece_core_initialize_p2_wrapper.cpp from CECE_SRCS - Eliminate redundant wrapper file that duplicates initialization logic - Streamline build configuration by removing unused source file reference
…ffix - Rename cece_core_initialize_p2_impl to cece_core_initialize_p2 - Simplify public API by removing internal implementation naming convention - Maintains all existing functionality and parameters
- Add MEGAN3 canopy model with emission activity calculations - Add BDSNP soil NOx emission module with Fortran kernel - Implement speciation engine supporting CB6, CRACMM2, RACM2, and SAPRC07 mechanisms - Add speciation mapping configuration files for all supported mechanisms - Add Fortran bridge implementations for MEGAN3 and BDSNP kernels - Update CMakeLists.txt with new source files and test targets - Add comprehensive test suites for speciation, MEGAN3, and BDSNP modules - Update soil NOx module with improved Fortran bridge integration - Add example configuration file for MEGAN3 setup - Remove obsolete test checkpoint script
- Reorganize include statements to follow standard ordering (system headers first, then project headers) - Reformat function signatures to comply with column limit constraints - Break long parameter lists across multiple lines with proper indentation - Adjust spacing and line breaks in function bodies for consistency - Update inline function formatting in header files - Ensure consistent formatting across BDSNP, MEGAN3, canopy model, and speciation modules - Update corresponding test files to match reformatted implementations
- Move gamma helper functions (get_gamma_lai, get_gamma_age, get_gamma_sm, get_gamma_t_li, get_gamma_t_ld, get_gamma_par_pceea, get_gamma_co2) from cece_megan.cpp to cece_megan.hpp as KOKKOS_INLINE_FUNCTION - Add necessary includes (Kokkos_Core.hpp, algorithm, cmath, numbers) to header - Update cece_emission_activity.cpp to include cece_megan.hpp instead of forward declaring get_gamma_co2 - Enable gamma functions to be inlined across multiple translation units (cece_megan.cpp, cece_megan3.cpp, cece_emission_activity.cpp) - Consolidate function documentation in header for better maintainability
- Move cece_megan.hpp include before namespace declaration in cece_emission_activity.cpp to ensure proper header availability - Remove redundant include comment block from cece_megan3.cpp and relocate cece_megan.hpp include to top of includes section - Consolidate include organization for consistency across emission-related modules - Improves header dependency clarity and follows include ordering conventions
…ding - Add CECE_SOURCE_DIR compile definition to test_speciation target in CMakeLists.txt - Update LoadCB6SpeciationConfig test to resolve speciation config file paths relative to source directory - Use CECE_SOURCE_DIR macro to construct absolute paths for spc_cb6.yaml and map_cb6.yaml - Ensures test can locate configuration files regardless of working directory when executed
…lines - Remove blank line after Kokkos_Core.hpp include - Reformat get_gamma_t_ld function signature to single line - Reformat get_gamma_par_pceea function signature across multiple lines - Break long get_gamma_par_pceea call in MeganScheme::Run to improve readability - Ensure consistent code formatting across physics module
…n files - Update physics schemes table to distinguish between single-species `megan` and multi-species `megan3` - Add `megan3` scheme with mechanism and speciation file parameters - Rename `soil_nox` to `bdsnp` with updated parameter names - Add comprehensive SPC/MAP speciation file documentation with format specifications and examples - Document shipped mechanism files (CB6, RACM2, SAPRC07, CRACMM2) - Provide guidance for adding custom chemical mechanisms - Expand MEGAN documentation to cover both single-species and MEGAN3 schemes - Update code examples and parameter descriptions across physics, MEGAN, and soil NOx modules
…ith clang-format - Consolidate split string literals in EmissionActivityCalculator warning message - Consolidate split string literals in Megan3Scheme warning message - Consolidate split string literals in Megan3FortranScheme warning message - Improves code consistency with clang-format guidelines across emission modules
…acking engine - Add CeceClock class with time tracking and refresh interval validation - Implement refresh_interval_seconds configuration for physics schemes and data streams - Add stacking_refresh_interval_seconds to driver configuration section - Create cece_clock.hpp header and cece_clock.cpp implementation - Add comprehensive unit tests for clock properties and run loop behavior - Update CMakeLists.txt to build clock module and register new test executables - Extend configuration documentation with clock refresh interval usage and validation rules - Update driver configuration guide with stacking_refresh_interval_seconds parameter - Modify cece_config.hpp and parser to support per-component refresh intervals - Ensure backward compatibility: components without refresh_interval_seconds default to base timestep - Validate all intervals are positive multiples of timestep_seconds at initialization
- Condense enum definition to single line - Align struct member comments for improved readability - Reformat constructor parameter lists to fit line length limits - Standardize spacing around assignment operators in member variables - Consolidate multi-line string concatenations in error messages - Align private member variable declarations with consistent spacing - Improve overall code formatting consistency across clock implementation
…figurations (#9) - Remove outdated ACES diagnostician agent documentation - Add GitHub Actions workflow for weekly modulefile synchronization from ufs-weather-model - Add 28 new modulefile configurations for CECE across multiple HPC systems (Acorn, Derecho, GAEAC, Hera, Hercules, Orion, Ursa, WCOSS2, NoaaCloud, Linux, macOS, and container environments) - Create cece_common.lua with shared library dependencies and version management - Rename and adapt modulefiles from ufs_* naming convention to cece_* for Community Emissions Computing Engine - Remove deprecated dependencies (MAPL, Scotch, GFTL-shared, W3EMC, IP, SP, G2TMPL, G2, CRTM, BACIO) from common configuration - Update internal references from UFS Model to CECE throughout modulefile documentation - Enables automated weekly updates and maintenance of build environments across supported platforms
zmoon
reviewed
Apr 21, 2026
- Add .pre-commit-config.yaml with hooks for trailing whitespace, file endings, YAML validation, clang-format for C++, ruff for Python, and cmake-format - Integrate pre-commit into sync_modulefiles.yml workflow to automatically format modulefiles - Reformat CMakeLists.txt to comply with cmake-format guidelines - Reformat .vscode/settings.json and .gitignore for consistency - Update all example configuration files and driver files with standardized formatting - Reformat C++ headers and source files including cece_config.hpp, cece_internal.hpp, and cece_c_api.cpp - Reformat Python modules in src/python/ and test files for consistency - Update TIDE submodule CMake files and Fortran source files with standardized formatting - Reformat documentation files including stacking_engine.md and vertical_distribution.md - Update modulefiles with consistent formatting and add Python environment setup in workflow - Ensures consistent code style across C++, Python, CMake, and Fortran throughout the project
- Replace custom clang-format and clang-tidy setup with pre-commit action - Remove JCSDA Docker container dependency for simplified CI environment - Update checkout action from v2 to v4 for improved performance - Add Python 3.12 setup for pre-commit framework compatibility - Simplify workflow by delegating linting to pre-commit configuration - Remove commented clang-tidy section and manual compilation database filtering
- Move cece_cap.F90 from src/ to src/interfaces/esmf/ to group ESMF interface code - Relocate standalone_nuopc directory from root to src/standalone_nuopc for consistent source organization - Update CMakeLists.txt to reference new file and directory paths - Update documentation to reflect new standalone_nuopc location - Fix test race conditions by generating unique config filenames per test using test info metadata - Improves project structure clarity by organizing interface implementations and standalone components under src/
- Remove clang-format and clang-tidy installation step that handled LLVM repository setup and version fallback logic - Remove commented-out clang-format check step that validated C++ source files - Simplify CI workflow by delegating code formatting checks to pre-commit framework as established in previous commits - Reduce CI job complexity and build time by eliminating redundant linting toolchain setup
Collaborator
|
Warning from the build: Details |
* Switch to gersemi for CMake formatting This one is an active project, unlike cmake-format-precommit * Update other hooks * Remove `.github/` from TIDE since it is vendored not submodule * Update Actions * Add Dependabot for GHA * Bit of workflow cleanup * Format YAML with Prettier * Export compile commands for clang-tidy * Make clang-tidy available at configure time; Python consistency * Run clang-tidy after build using the custom target * We know we have spack activate script; set shell in defaults * Don't run CI/lint on every push to any branch only protected/long-lived branches and when PR is open * We have spack and don't want CDEPS to be silently skipped * Remove `.DS_Store` again it keeps coming back, might as well keep trying... * welp no spack * notes * Exclude `_deps` from clang-tidy Co-authored-by: Copilot <copilot@github.com> * Exclude `src/python/` from clang-tidy if not building the interface; help it find `omp.h` * Fix some small bugs in TIDE cmake * Source-root-anchored header filter the other one seemed to work but possibly was not before that it was matching fetched dependencies this makes it more explicit what we want to include the match is done against absolute paths, not relative to .clang-tidy's location or something --------- Co-authored-by: Copilot <copilot@github.com>
This commit resolves conflicts between the local branch and the ufs-community/cece main branch. Key changes: - Moved cece_cap.F90 to src/ and standalone_nuopc/ to the root to match upstream layout. - Integrated CeceClock and advanced physics schemes (MEGAN3, BDSNP) into the merged codebase. - Fixed GitHub Action versions (checkout@v4, setup-python@v5) and removed misplaced TIDE CI workflow. - Updated CMake and TIDE build scripts for better compatibility. - Ensured host synchronization for all state fields in the run phase. Co-authored-by: bbakernoaa <22104759+bbakernoaa@users.noreply.github.com>
* fix: resolve MPI binding conflicts and enhance test configurations for tide module * fmt * Use compiler to figure out HAVE_EXECUTE * Decide CPRGNU using CMake's knowledge of the compiler this variable indicates whether the compiler if gfortran or not * NetCDF Fortran, not just NetCDF * Define CPRINTEL if the compiler is Intel(LLVM) * Use Fortran linker for app target --------- Co-authored-by: zmoon <zmoon92@gmail.com>
Resolved conflicts: - .github/workflows/ci.yml: Use main's venv-based pytest approach - .github/workflows/sync_modulefiles.yml: Update to latest action versions (v6/v8) - CMakeLists.txt: Keep feature branch's new sources (clock, speciation, megan3, bdsnp) and test targets; adopt main's Python venv test infrastructure - docs/ginoux.md, docs/k14.md: Use main's cleaner descriptions - docs/megan.md, docs/soil_nox.md: Keep feature branch's comprehensive MEGAN3/BDSNP docs - include/cece/cece_config.hpp: Keep refresh_interval_seconds fields - include/cece/cece_internal.hpp: Keep CeceClock member - src/cece_core_run.cpp: Keep feature branch's clock-gated execution - src/io/cece_standalone_writer.cpp: Use main's overflow-safe size_t casts - src/io/tide/CMakeLists.txt: Use main's generic comment - src/io/tide/cmake/FindPIO.cmake: Keep HINTS (correct CMake keyword) - src/io/tide/cmake/LibCheck.cmake: Keep HEAD (main had typo with extra paren) - src/physics/cece_megan.cpp: Keep feature branch's refactored gamma functions - Removed src/io/tide/.github/workflows/ci.yml (deleted in feature branch) - Removed test_checkpoint.py (deleted in feature branch)
GCC warns that the ISO 8601 format string '%04d-%02d-%02dT%02d:%02d:%02d' could theoretically produce up to 72 bytes if tm_struct fields span the full int range. The actual output for valid dates is always 19 chars + null (20 bytes), but GCC's static analysis cannot prove this at compile time. Increase char buffers from [20] to [32] to give sufficient headroom and silence the -Wformat-truncation= warnings reported in CI.
- spack/packages/cece/reop.yaml: Remove extra trailing newline (end-of-file-fixer) - spack/packages/cece/package.py: Apply ruff-format line length fixes - CMakeLists.txt: Apply gersemi formatting to install() call - ruff.toml: Add per-file-ignores for spack/ directory (F403/F405 are expected in spack packages which use 'from spack.package import *')
The merge with main overwrote cece_config.hpp, dropping the refresh_interval_seconds field from CeceDataStreamConfig and stacking_refresh_interval_seconds from DriverConfig. The config parser (from main) references these fields, causing build failures. Restore both fields with their default value of 0 (backward compatible).
zmoon
reviewed
May 13, 2026
Comment on lines
82
to
+218
| @@ -191,7 +210,12 @@ The driver validates configuration parameters and exits with error if: | |||
| 2. **Start time >= end time:** Start time must be strictly before end time | |||
| 3. **Non-positive timestep:** Timestep must be > 0 seconds | |||
| 4. **Invalid grid dimensions:** nx and ny must be > 0 | |||
| <<<<<<< feature/advanced_clock | |||
| 5. **Missing mesh file:** If mesh_file is specified, the file must exist and be valid | |||
| 6. **Invalid refresh interval:** Any `refresh_interval_seconds` or `stacking_refresh_interval_seconds` must be a positive integer multiple of `timestep_seconds`. Error messages name the offending component. | |||
| ======= | |||
| 5. **Missing gridspec file:** If gridspec_file is specified, the file must exist and be a valid ESMF GRIDSPEC NetCDF file | |||
| >>>>>>> main | |||
Collaborator
There was a problem hiding this comment.
Some incomplete merge stuff here. Might be elsewhere as well?
Collaborator
Author
There was a problem hiding this comment.
was still working on it :)
bbakernoaa
added a commit
that referenced
this pull request
May 13, 2026
…onfig parser Main's config parser references refresh_interval_seconds on CeceDataStreamConfig, PhysicsSchemeConfig, and stacking_refresh_interval_seconds on DriverConfig. These fields were introduced by the advanced_clock feature (PR #8) and merged to main. Add all three fields with default value 0 (no-op, backward compatible) so the config parser compiles correctly on this branch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces support for per-component refresh intervals in the CECE simulation framework, allowing each physics scheme, data stream, and the stacking engine to run at independent, configurable intervals that are integer multiples of the simulation base timestep. The changes include the addition of a new
CeceClockclass for scheduling, updates to configuration structures and documentation, and new tests to ensure correct scheduling behavior. Backward compatibility is maintained, so existing configurations continue to work as before.Key changes:
Core scheduling and configuration
CeceClockclass (cece_clock.hpp) to manage simulation time and schedule component execution based on independent refresh intervals, with validation to ensure all intervals are positive integer multiples of the base timestep.DriverConfig,PhysicsSchemeConfig,CeceDataStreamConfig) to include new fields:stacking_refresh_interval_secondsandrefresh_interval_secondsfor per-component scheduling. [1] [2] [3]CeceInternalData) for use during the run loop.Documentation and example updates
configuration.mdanddriver_configuration_guide.mdto describe the new refresh interval options, validation logic, and backward compatibility. Provided configuration examples for various use cases. [1] [2] [3] [4] [5] [6]Testing and validation
CeceClock(test targets:test_cece_clock_properties,test_cece_clock_run_loop) to verify correct scheduling, validation, and time decomposition. [1] [2] [3]Backward compatibility and Fortran integration
These changes enable more efficient simulation workflows by reducing unnecessary computation for slowly changing components, while maintaining compatibility with existing workflows.