Skip to content

424 add carma interface for simple scheme#427

Merged
K20shores merged 35 commits intomainfrom
424-add-carma-interface-for-simple-scheme
Jul 24, 2025
Merged

424 add carma interface for simple scheme#427
K20shores merged 35 commits intomainfrom
424-add-carma-interface-for-simple-scheme

Conversation

@K20shores
Copy link
Copy Markdown
Collaborator

@K20shores K20shores commented Jul 16, 2025

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.

@K20shores K20shores linked an issue Jul 16, 2025 that may be closed by this pull request
@github-actions
Copy link
Copy Markdown
Contributor

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jul 16, 2025

Codecov Report

Attention: Patch coverage is 92.02703% with 59 lines in your changes missing coverage. Please review.

Project coverage is 84.85%. Comparing base (b1b5f2c) to head (b446a4f).
Report is 19 commits behind head on main.

Files with missing lines Patch % Lines
src/carma/carma_c_interface.cpp 83.85% 26 Missing ⚠️
src/carma/interface.F90 95.25% 18 Missing ⚠️
src/carma/carma.cpp 92.17% 14 Missing ⚠️
src/carma/carma_parameters.F90 0.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@K20shores K20shores requested a review from Copilot July 21, 2025 20:50

This comment was marked as outdated.

@K20shores K20shores marked this pull request as ready for review July 24, 2025 15:29
@K20shores K20shores requested a review from Copilot July 24, 2025 15:30

This comment was marked as outdated.

@K20shores K20shores requested a review from Copilot July 24, 2025 15:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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?

@K20shores K20shores merged commit 5a523f8 into main Jul 24, 2025
66 of 69 checks passed
@K20shores K20shores deleted the 424-add-carma-interface-for-simple-scheme branch July 24, 2025 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add CARMA interface for simple scheme

3 participants