424 add carma interface for simple scheme#427
Conversation
|
📄 Documentation for this branch is available at: https://ncar.github.io/musica/branch/424-add-carma-interface-for-simple-scheme/ |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #427 +/- ##
==========================================
+ Coverage 83.63% 84.85% +1.22%
==========================================
Files 48 49 +1
Lines 4093 4815 +722
==========================================
+ Hits 3423 4086 +663
- Misses 670 729 +59 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
…ithub.com/NCAR/musica into 424-add-carma-interface-for-simple-scheme
…ithub.com/NCAR/musica into 424-add-carma-interface-for-simple-scheme
There was a problem hiding this comment.
Pull Request Overview
This PR adds a comprehensive CARMA interface for simple scheme configurations, enabling Python and C++ users to run CARMA aerosol simulations with configurable parameters. The implementation bridges Fortran's CARMA core with modern C++ and Python interfaces.
- Adds complete CARMA driver functionality with C++/Python bindings for parameter configuration and simulation execution
- Implements comprehensive output data transfer system from Fortran to C++ with proper memory management
- Creates aluminum test case configuration with pre-configured groups and elements for validation
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| valgrind.supp | Adds memory check suppression for CARMA conditional jumps |
| src/test/unit/carma/carma_c_api.cpp | Adds unit tests for CARMA C API with default and aluminum test parameters |
| src/carma/interface.F90 | Implements core CARMA simulation runner and output data transfer to C++ |
| src/carma/carma_parameters.F90 | Defines Fortran parameter structures matching C++ interface |
| src/carma/carma_c_interface.cpp | Implements C++ data transfer and memory management for CARMA output |
| src/carma/carma.cpp | Adds CARMA class implementation with parameter conversion and simulation execution |
| src/CMakeLists.txt | Adds new carma_parameters.F90 source file to build |
| pyproject.toml | Adds xarray dependency for netCDF-compatible output |
| musica/test/test_carma.py | Adds Python tests for CARMA instance creation and aluminum test simulation |
| musica/carma.py | Implements comprehensive Python interface with parameter classes and xarray output |
| musica/carma.cpp | Adds Python bindings for CARMA instance management and parameter conversion |
| musica/init.py | Updates module exports to include new CARMA classes |
| include/musica/carma/carma_c_interface.hpp | Defines C interface structures for parameters and output data |
| include/musica/carma/carma.hpp | Defines C++ classes for CARMA parameters, configuration, and output |
Comments suppressed due to low confidence (3)
src/carma/carma.cpp:263
- [nitpick] The TODO comment indicates uncertainty about the parameter name 'idx_wave'. Consider renaming to something more descriptive like 'wavelength_index' or 'optical_wavelength_idx'.
params.idx_wave = 0; // TODO: is there a better name?
musica/carma.py:102
- C++ style comment '//' used in Python code. Should use Python comment style '#'.
self.is_ice = is_ice
include/musica/carma/carma.hpp:102
- [nitpick] The TODO comment indicates uncertainty about the parameter name 'idx_wave'. Consider renaming to something more descriptive like 'wavelength_index' or 'optical_wavelength_idx'.
int idx_wave = 0; // TODO: is there a better name?
Adds a small driver function for CARMA with supporting structs in Python and C++ to fully configure a run of CARMA. There are still some hard-coded parameters that will be removed in future PRs. Also, much of the post processing that happens in Fortran will be lifted out of Fortran and done entirely in Python so that there is no loss of data.