Skip to content

Commit

Permalink
correctly merge height monotonicity log in nh_utils::update_dz_*
Browse files Browse the repository at this point in the history
  • Loading branch information
bensonr committed Mar 17, 2021
1 parent 4901b49 commit 3dcd065
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions model/nh_utils.F90
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,14 @@ subroutine update_dz_c(is, ie, js, je, km, ng, dt, dp0, zs, area, ut, vt, gz, ws
! Enforce monotonicity of height to prevent blowup
!$OMP parallel do default(none) shared(is1,ie1,js1,je1,ws,zs,gz,rdt,km,dz_min)
do j=js1, je1
do k=2, km+1
do i=is1, ie1
gz(i,j,k) = min( gz(i,j,k), gz(i,j,k-1) - dz_min )
enddo
enddo
do i=is1, ie1
ws(i,j) = ( zs(i,j) - gz(i,j,km+1) ) * rdt
enddo
do k=km, 1, -1
do i=is1, ie1
gz(i,j,k) = max( gz(i,j,k), gz(i,j,k+1) + dz_min )
enddo
enddo
enddo

end subroutine update_dz_c
Expand Down Expand Up @@ -310,15 +310,15 @@ subroutine update_dz_d(ndif, damp, hord, is, ie, js, je, km, ng, npx, npy, area,

!$OMP parallel do default(none) shared(is,ie,js,je,km,ws,zs,zh,rdt,dz_min)
do j=js, je
do k=2, km+1
do i=is,ie
ws(i,j) = ( zs(i,j) - zh(i,j,km+1) ) * rdt
enddo
do k=km, 1, -1
do i=is, ie
! Enforce monotonicity of height to prevent blowup
zh(i,j,k) = min( zh(i,j,k), zh(i,j,k-1) - dz_min )
zh(i,j,k) = max( zh(i,j,k), zh(i,j,k+1) + dz_min )
enddo
enddo
do i=is,ie
ws(i,j) = ( zs(i,j) - zh(i,j,km+1) ) * rdt
enddo
enddo

end subroutine update_dz_d
Expand Down

0 comments on commit 3dcd065

Please sign in to comment.