Skip to content

Commit

Permalink
Corrected a max to a min in i2s
Browse files Browse the repository at this point in the history
  A recent update intended to add a min of n and 3 to avoid segmentation faults,
but a max was added instead, triggering segmentation faults.  All answers are
still bitwise identical in the test cases, but this now passes a more sensitive
compiler's checks.
  • Loading branch information
Hallberg-NOAA committed May 8, 2018
1 parent 6e018cf commit 7c2e5be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/framework/MOM_diag_mediator.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2562,7 +2562,7 @@ function i2s(a,n_in)
if (present(n_in)) n = n_in

i2s = ''
do i=1,max(n,3)
do i=1,min(n,3)
write (i2s_temp, '(I4.4)') a(i)
i2s = trim(i2s) //'_'// trim(i2s_temp)
enddo
Expand Down

0 comments on commit 7c2e5be

Please sign in to comment.