Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding some basic data types to simplify photolysis rate calculations #261

Merged
merged 2 commits into from
Nov 16, 2023

Conversation

jeff-cohere
Copy link
Collaborator

@jeff-cohere jeff-cohere commented Nov 16, 2023

This PR adds a column-independent struct called PhotoTableData that stores all the data used to interpolate photolysis rates, and a column-specific struct called PhotoTableWorkArrays that contains views that function as work arrays. These two types encapsulate array data that once lived in Fortran module variables. I find it too hard to work with functions with 87 arguments, so this is how I've been dealing with them. :-)

No logic is changed, apart from the order of allocation of views. I hope this will allow me to simplify the photolysis code in our EAMxx aerosol microphysics process.

Copy link

codecov bot commented Nov 16, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (795d981) 96.06% compared to head (d64a830) 96.07%.

Files Patch % Lines
src/mam4xx/mo_photo.hpp 97.82% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #261   +/-   ##
=======================================
  Coverage   96.06%   96.07%           
=======================================
  Files          33       33           
  Lines        6537     6574   +37     
=======================================
+ Hits         6280     6316   +36     
- Misses        257      258    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@odiazib odiazib left a comment

Choose a reason for hiding this comment

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

It looks great! Thanks for cleaning this code.

@jeff-cohere jeff-cohere merged commit 10103c8 into main Nov 16, 2023
8 checks passed
@jeff-cohere jeff-cohere deleted the jeff-cohere/chemistry_reorg branch November 16, 2023 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants