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

Use JVN_ as max not exact number of J-values #26

Merged

Conversation

lizziel
Copy link
Contributor

@lizziel lizziel commented Sep 4, 2024

Name and Institution (Required)

Name: Lizzie Lundgren
Institution: Harvard University

Describe the update

This PR updates how global variable JVN_ is used. It is described in the code as maximum number of J-values but was used instead as the exact number of J-values by setting the maximum index of FJX_j2j.dat entries read. This set up the possibility of a silent bug if FJX_j2j.dat was expanded but JVN_ remained the same.

This update introduces new behavior where JVN_ is set to a high number beyond the number of entries in FJX_j2j.dat. File read of FJX_j2j.dat stops when 9999 is encountered at the start of a line. Previously FJX_j2j.dat files ended in 9999 so inclusion of that in the file is not new.

Besides preventing the silent bug described above this update is beneficial by enabling removal of model-dependent C-preprocessor blocks where JVN_ values were set. Those values would need to be updated every time new photolysis reactions were added to external models. A drawback of this update, however, is that several arrays are allocated more memory than they need. However, the arrays are 1D and relatively small so this should not make a significant impact.

Expected changes

This is a zero diff update.

Reference(s)

None

Related Github Issues and PRs

None

@lizziel lizziel added the enhancement New feature or request label Sep 4, 2024
@lizziel lizziel changed the base branch from main to dev/8.0.1 September 4, 2024 20:59
@lizziel lizziel added this to the 8.0.1 milestone Sep 4, 2024
@lizziel lizziel self-assigned this Sep 4, 2024
@lizziel lizziel merged commit 6bf4a36 into dev/8.0.1 Sep 4, 2024
8 checks passed
@msulprizio msulprizio deleted the feature/define_max_rather_than_exact_num_jvalues branch October 1, 2024 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant