Skip to content

Commit

Permalink
Added a loop to ensure MEKE is never less than 0. Added new variable …
Browse files Browse the repository at this point in the history
…called

FrictWorkMax that calculates the maximum frictional work that is allowed by theory.
  • Loading branch information
sdbachman committed Apr 12, 2019
1 parent 807072b commit 59aad4f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/parameterizations/lateral/MOM_MEKE.F90
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,12 @@ subroutine step_forward_MEKE(MEKE, h, SN_u, SN_v, visc, dt, G, GV, CS, hu, hv)
endif
endif ! MEKE_KH>=0
!$OMP end parallel

! Ensure that MEKE is non-negative
do j=js,je ; do i=is,ie
MEKE%MEKE(i,j) = MAX(0.0, MEKE%MEKE(i,j)
enddo ; enddo


call cpu_clock_begin(CS%id_clock_pass)
call do_group_pass(CS%pass_MEKE, G%Domain)
Expand Down
7 changes: 7 additions & 0 deletions src/parameterizations/lateral/MOM_hor_visc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1039,6 +1039,13 @@ subroutine horizontal_viscosity(u, v, h, diffu, diffv, MEKE, VarMix, Barotropic,
+str_xy(I,J-1)*( &
(u(I,j,k)-u(I,j-1,k))*G%IdyBu(I,J-1) &
+(v(i+1,J-1,k)-v(i,J-1,k))*G%IdxBu(I,J-1) )) ) )

if (associated(MEKE)) then ; if (associated(MEKE%mom_src)) then
FrictWorkMax(i,j,k) = MEKE%MEKE * sqrt(dudx(i,j)**2 + dvdy(i,j)**2 + &
(0.25*(dvdx(I,J)+dvdx(I-1,J)+dvdx(I,J-1)+dvdx(I-1,J-1)) )**2 + &
(0.25*(dudy(I,J)+dudy(I-1,J)+dudy(I,J-1)+dudy(I-1,J-1)) )**2)
endif ; endif

enddo ; enddo ; endif


Expand Down

0 comments on commit 59aad4f

Please sign in to comment.