Skip to content

Commit

Permalink
(*)Corrected array syntax in explicit loops
Browse files Browse the repository at this point in the history
  Corrected two assignment that dangerously use array syntax inside of explicit
do-loops, which would lead to an order NI^2*NJ^2 operation that should have been
an NI*NJ operation unless the compiler detects and avoids it.  Answers are
unchanged in the MOM6_examples test cases, but might be corrected in other
cases.
  • Loading branch information
Hallberg-NOAA committed Apr 26, 2018
1 parent 9781d53 commit ea1e4fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/user/MOM_wave_interface.F90
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ subroutine Update_Stokes_Drift(G,GV,CS,h,ustar)
Bottom = Bottom - GV%H_to_m * (h(ii,jj,kk)+h(ii,jjm1,kk))/2.
call DHH85_mid(CS,GV,ustar(ii,jj),Midpoint,US)
! Putting into x-direction for now
CS%US_x(:,:,kk) = US
CS%US_x(ii,jj,kk) = US
enddo
enddo
enddo
Expand All @@ -626,7 +626,7 @@ subroutine Update_Stokes_Drift(G,GV,CS,h,ustar)
Bottom = Bottom - GV%H_to_m * (h(ii,jj,kk)+h(ii,jjm1,kk))/2.
call DHH85_mid(CS,GV,ustar(ii,jj),Midpoint,US)
! Putting into x-direction for now
CS%US_y(:,:,kk) = 0.0
CS%US_y(ii,jj,kk) = 0.0 !### Note that =0 should be =US - RWH
enddo
enddo
enddo
Expand Down

0 comments on commit ea1e4fe

Please sign in to comment.