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

Loop index caused solsym array to be indexed past end-of-array. #386

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

overfelt
Copy link
Contributor

No description provided.

@overfelt overfelt requested a review from jaelynlitz December 17, 2024 13:06
@@ -297,7 +297,7 @@ void chm_diags(
// accumulators
// if (history_aerosol.and..not .history_verbose) then

for (int nn = lchnk; nn < pcnst; nn++) {
for (int nn = lchnk; nn < gas_pcnst; nn++) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe the real discrepancy is that in this file we set pcnst to 80, but in the validation test, we use pcsnt = 41? I agree that solsym is length gas_pcnst but fldcw can technically be length pcnst ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, there is something wrong with the length of fldcw. There was a note that setting the length to 80 was somewhat of a guess as it was not obvious in the Fortran code what length to use. Maybe we should ask Balwinder when he gets back?

Copy link
Collaborator

Choose a reason for hiding this comment

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

That sounds like a good plan

* Add limiting to avoid indexing past end of array.

* Add limiting to avoid indexing past end of array.

* Add limiting to avoid indexing past end of array.
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.

2 participants