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

Add TUV-x run function #223

Merged
merged 9 commits into from
Oct 2, 2024
Merged

Add TUV-x run function #223

merged 9 commits into from
Oct 2, 2024

Conversation

mattldawson
Copy link
Collaborator

Adds the ability to run the TUV-x calculations through the C and Fortran APIs. This leaves the TUV-x Python wrapper for future work.

Copy link
Collaborator

@boulderdaze boulderdaze left a comment

Choose a reason for hiding this comment

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

Looks good! What are the differences between the fixed and the original configuration?

Comment on lines +79 to +80
void RunTuvx(TUVX *tuvx, const double solar_zenith_angle, const double earth_sun_distance,
double * const photolysis_rate_constants, double * const heating_rates, Error * const error);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess const pointer to Error is fine, but only this Error parameter is marked by const compared to the other functions that take Error

Error * const error

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe we could make a follow-up task to go through all the code and use const consistently and where it makes sense?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, I like the idea

Comment on lines +8 to 14
<DiagnosticConditionalJump>
Memcheck:Cond
fun:__tuvx_diagnostic_util_MOD_diagnostic_1d_dk
fun:__tuvx_photolysis_rates_MOD_get
fun:__tuvx_core_MOD_run
fun:InternalRunTuvx
...
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this necessary?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Valgrind was catching a conditional jump on uninitialized data that I couldn't really make sense of because the source code line that seemed to trigger it was a fortran function header. it seems to only be related to when we try to output diagnostics inside TUV-x, so I figured it wouldn't be a big deal to suppress the error. But, I could also make a separate issue to look into this.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah I see. Yeah I agree. I don't think it wouldn't be a big deal for that case

@mattldawson
Copy link
Collaborator Author

Looks good! What are the differences between the fixed and the original configuration?

The fixed configuration is where everything is specified in the json file, and the other test includes setting some grids and profiles through the API. Is this what you were asking?

@boulderdaze
Copy link
Collaborator

Looks good! What are the differences between the fixed and the original configuration?

The fixed configuration is where everything is specified in the json file, and the other test includes setting some grids and profiles through the API. Is this what you were asking?

oh I was curious what's fixed in the new fixed configuration that are different from the old(?) configuration

@mattldawson
Copy link
Collaborator Author

Looks good! What are the differences between the fixed and the original configuration?

The fixed configuration is where everything is specified in the json file, and the other test includes setting some grids and profiles through the API. Is this what you were asking?

oh I was curious what's fixed in the new fixed configuration that are different from the old(?) configuration

ah, I think it's pretty much the same as the old configuration. I just renamed it fixed because I added this other configuration where some of the data is changed by the user

@mattldawson mattldawson merged commit 8cd7c3f into main Oct 2, 2024
66 checks passed
@mattldawson mattldawson deleted the develop-add-tuvx-run-test branch October 2, 2024 16:30
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.

3 participants