-
Notifications
You must be signed in to change notification settings - Fork 66
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
+Gracefully handle longer input parameter lines #89
+Gracefully handle longer input parameter lines #89
Conversation
Added the ability to detect and handle multiline parameter specifications that are longer than INPUT_STR_LENGTH after the lines have been concatenated. Many instances where character strings are set to length INPUT_STR_LENGTH are replaced by param_file_type%max_line_len. This commit partially addresses MOM6 issue mom-ocean#75. All answers and output are bitwise identical in cases that worked previously, but there is a new element in the publicly visible param_file_type, and some cases where there had previously been errors due to very long input specification may now work.
Make the lines of the param_file_type individually allocatable to support arbitrarily long input lines. This required the introduction of a new private type to hold the actual allocatable array, so the lines are now an array of this type. All answers are bitwise identical.
Use a character buffer to minimize the memory footprint associated with reading the input parameters on root_PE and broadcasting it to all PEs. All answers are bitwise identical.
Now that INPUT_STR_LENGTH is only used as the size of a single temporary character string, the maximum permitted line length can be increased to a larger value without unduly impacting the memory footprint of the model, so it has been increased to 1024. If this is not large enough, considering that MOM6 also supports line continuation, there is a bigger problem than this limit. Some message strings were also changed to be allocatable, while others have sizes that are set using param_file_type%max_line_len. Also eliminated the hard-coded internal parameter all_PEs_read, which had a note that it should have been eliminated in about 2010 (before MOM6 existed). All answers and output are bitwise identical.
Thanks for working on this. I tried out the PR with my full Northwest Atlantic setup and can confirm it works as expected. |
Codecov Report
@@ Coverage Diff @@
## dev/gfdl #89 +/- ##
============================================
+ Coverage 28.99% 29.02% +0.03%
============================================
Files 245 245
Lines 72177 72223 +46
============================================
+ Hits 20925 20962 +37
- Misses 51252 51261 +9
Continue to review full report at Codecov.
|
Gaea regression: https://gitlab.gfdl.noaa.gov/ogrp/MOM6/-/pipelines/15064 ✔️ |
This PR is a series of commits that will enable to MOM6 to handle much longer
input parameter lines, of up to 1000 characters in a single line, and with no
limit for lines with continuation. This required the addition of a new internal
function and type, but all changes are private to the MOM_file_parser module.
This PR addresses the problems noted in MOM6 issue #75, which can be closed once
this PR is accepted. All answers and output are bitwise identical in any cases
that worked before.
The commits in this PR include: