Fix test_read_input_nml2 failure and test_diag_update_buffer.F90 seg fault : Cray #1302
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Cray uses an IOSTAT of -4001 for end of file while other compilers typically use -1. Because of this, the do loop (shown below) will not exit on the condition
if (stat.eq.-1)
at Line 71FMS/test_fms/mpp/test_read_input_nml.F90
Lines 68 to 79 in 2be8aa4
To fix: I took the approach seen in fortran standards (section 12.11.5 in the J3/23-007draft spec) and replaced
if (stat.eq.-1)
withif (stat < 0)
to check for end of file and exit loop.I also noticed that the tests were not matching the description here:
FMS/test_fms/mpp/test_read_input_nml.F90
Lines 51 to 56 in 2be8aa4
Previously, test 1 was reading a blank input.nml and test 2 was reading a blank input_alternate.nml. I have modified this so that there is data inside of input.nml and input_alternate.nml. Test 4 still tests a blank nml with the name input_blank.nml
Cray was failing to compile test_diag_update_buffer.F90 because of the
1
at the beginning of line 289FMS/test_fms/diag_manager/test_diag_update_buffer.F90
Lines 288 to 290 in 2be8aa4
I have removed the
1
and refactored the code a little bit - I am open to feedback on the changes I made and will undo if they are not helpful.Fixes #1300
How Has This Been Tested?
make and make check on
C5
cce/15.0.1
cray-hdf5/1.12.2.3
cray-netcdf/4.9.0.3
Checklist:
make distcheck
passes