-
Notifications
You must be signed in to change notification settings - Fork 244
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
Fix epipycnal pairing array size declarations #1186
Fix epipycnal pairing array size declarations #1186
Conversation
Corrected the size of 4 arrays used to describe layer pairings in tracer_epipycnal_ML_diff, to avoid the possibility of segmentation faults when there are very few interior layers compared with the number of mixed and buffer layers. Also corrected a number of spelling errors in comments. In runs that previously worked, all answers should be bitwise identical, and they are identical in all MOM6-examples test cases.
This appears to resolve #966. Regression testing on Gaea: https://gitlab.gfdl.noaa.gov/ogrp/MOM6/-/pipelines/11074 ✔️ No regressions. |
My last comment was not quite correct. This resolves the error with |
If I am reading this right, then it seems that In the case of tc1, 2*(nkml + nkbl) is 8, and I hit the out-of-bound index at 7, which is larger than NK but still within bounds. These declarations also appear to work correctly:
Would it be better to use this rather than Also, the |
I am pretty sure the upper limit on num_srt is PEmax_krho, which in turn can be as large as GV%ke. With this, I think that the most restrictive limit on the number pairings in this code is |
Sorry, I misread the second loop, yes you are right. Disregard my comment. |
Corrected the size of 4 arrays used to describe layer pairings in
tracer_epipycnal_ML_diff, to avoid the possibility of segmentation faults
when there are very few interior layers compared with the number of mixed and
buffer layers. Also corrected a number of spelling errors in comments. In
runs that previously worked, all answers should be bitwise identical, and they
are identical in all MOM6-examples test cases.