Skip to content

Commit

Permalink
Bugfix: Uninitialized variable in MEKE advection
Browse files Browse the repository at this point in the history
- As reported in #236, advFac was being used unitialized because
  of a badly placed "endif".
- Test answers did not change because uninitialized data luckily had zero.
- Closes #236
  • Loading branch information
adcroft committed Nov 9, 2015
1 parent 74142db commit 1711852
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/parameterizations/lateral/MOM_MEKE.F90
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,6 @@ subroutine step_forward_MEKE(MEKE, h, SN_u, SN_v, visc, dt, G, CS, hu, hv)
MEKE_uflux(I,j) = MEKE_uflux(I,j) + baroHu(I,j)*MEKE%MEKE(i+1,j)*advFac
endif
enddo ; enddo
endif
!$OMP do
do J=js-1,je ; do i=is,ie
if (baroHv(i,J)>0.) then
Expand All @@ -432,6 +431,7 @@ subroutine step_forward_MEKE(MEKE, h, SN_u, SN_v, visc, dt, G, CS, hu, hv)
MEKE_vflux(i,J) = MEKE_vflux(i,J) + baroHv(i,J)*MEKE%MEKE(i,j+1)*advFac
endif
enddo ; enddo
endif
!$OMP do
do j=js,je ; do i=is,ie
MEKE%MEKE(i,j) = MEKE%MEKE(i,j) + (sdt*(G%IareaT(i,j)*I_mass(i,j))) * &
Expand Down

0 comments on commit 1711852

Please sign in to comment.