Skip to content

Commit

Permalink
Fixed filtered_grid_motion() to not assume dz_g(CS%nk+1)=0
Browse files Browse the repository at this point in the history
- filtered_grid_motion() assumed the interface motion of the bottom
  was zero which precludes allow the number of levels to changes.
  It turns out allowing dz_g(CS%nk+1) to be filtered gives exactly zero
  when the number levels are the same so we've (@angus-g and I) updated
  filtered_grid_motion() to also filter the bottom interface.
  • Loading branch information
adcroft committed Mar 5, 2018
1 parent d8fb34c commit a46f701
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ALE/MOM_regridding.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@ subroutine filtered_grid_motion( CS, nk, z_old, z_new, dz_g )

dz_g(1) = 0.0
z_old_k = z_old(1)
do k = 2,CS%nk
do k = 2,CS%nk+1
if (k<=nk+1) z_old_k = z_old(k) ! This allows for virtual z_old interface at bottom of the model
! zr1 is positive and increases with depth, and dz_tgt is positive downward.
dz_tgt = sgn*(z_new(k) - z_old_k)
Expand Down Expand Up @@ -1086,7 +1086,7 @@ subroutine filtered_grid_motion( CS, nk, z_old, z_new, dz_g )

endif
enddo
dz_g(CS%nk+1) = 0.0
!dz_g(CS%nk+1) = 0.0

if (debug) then
z_old_k = z_old(1)
Expand Down

0 comments on commit a46f701

Please sign in to comment.