Skip to content

Commit

Permalink
(*)Removed problematic offline tracer lines
Browse files Browse the repository at this point in the history
  Commented out the problematic lines that Andrew Shao flagged in his review of
MOM6 dev/gfdl PR #37.  The model runs perfectly well in short offline-tracer
test runs, and even gives bitwise identical output, perhaps because no layers
were being abruptly flooded to 10^13 times their previous values.  These omitted
lines could change answers in some cases, so the lines in question have been
retained in case the offline tracer code needs to be debugged layer and these
mysterious (and seemingly unhelpful) lines turn out to have been necessary.  All
answers in the non-offline-tracer runs are bitwise identical.
  • Loading branch information
Hallberg-NOAA committed Dec 22, 2021
1 parent 86eb106 commit 5d4e8a1
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions src/tracer/MOM_offline_aux.F90
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,16 @@ subroutine update_h_horizontal_flux(G, GV, uhtr, vhtr, h_pre, h_new)
h_new(i,j,k) = max(0.0, G%areaT(i,j)*h_pre(i,j,k) + &
((uhtr(I-1,j,k) - uhtr(I,j,k)) + (vhtr(i,J-1,k) - vhtr(i,J,k))))

! In the case that the layer is now dramatically thinner than it was previously,
! add a bit of mass to avoid truncation errors. This will lead to
! non-conservation of tracers
h_new(i,j,k) = h_new(i,j,k) + &
max(GV%Angstrom_H, 1.0e-13*h_new(i,j,k) - G%areaT(i,j)*h_pre(i,j,k))
! This line was used previously, but it makes no sense, as it applies to the case of
! wetting, not drying, and it does not seem to serve any useful purpose. Test runs
! without this line seem to work properly, but it is being retained in a comment
! pending verification that it is in fact unnecessary.

! h_new(i,j,k) = h_new(i,j,k) + &
! max(GV%Angstrom_H, 1.0e-13*h_new(i,j,k) - G%areaT(i,j)*h_pre(i,j,k))

! Convert back to thickness
h_new(i,j,k) = h_new(i,j,k) * G%IareaT(i,j)
h_new(i,j,k) = max(GV%Angstrom_H, h_new(i,j,k) * G%IareaT(i,j))

enddo ; enddo
enddo
Expand Down Expand Up @@ -103,18 +105,24 @@ subroutine update_h_vertical_flux(G, GV, ea, eb, h_pre, h_new)
do i=is-1,ie+1
! Top layer
h_new(i,j,1) = max(0.0, h_pre(i,j,1) + ((eb(i,j,1) - ea(i,j,2)) + ea(i,j,1)))
h_new(i,j,1) = h_new(i,j,1) + max(0.0, 1.0e-13*h_new(i,j,1) - h_pre(i,j,1))
! h_new(i,j,1) = h_new(i,j,1) + max(0.0, 1.0e-13*h_new(i,j,1) - h_pre(i,j,1))

! Bottom layer
h_new(i,j,nz) = max(0.0, h_pre(i,j,nz) + ((ea(i,j,nz) - eb(i,j,nz-1)) + eb(i,j,nz)))
h_new(i,j,nz) = h_new(i,j,nz) + max(0.0, 1.0e-13*h_new(i,j,nz) - h_pre(i,j,nz))
! h_new(i,j,nz) = h_new(i,j,nz) + max(0.0, 1.0e-13*h_new(i,j,nz) - h_pre(i,j,nz))
enddo

! Interior layers
do k=2,nz-1 ; do i=is-1,ie+1
h_new(i,j,k) = max(0.0, h_pre(i,j,k) + ((ea(i,j,k) - eb(i,j,k-1)) + &
(eb(i,j,k) - ea(i,j,k+1))))
h_new(i,j,k) = h_new(i,j,k) + max(0.0, 1.0e-13*h_new(i,j,k) - h_pre(i,j,k))

! This line and its two counterparts above were used previously, but it makes no sense as
! written because it acts in the case of wetting, not drying, and it does not seem to serve
! any useful purpose. Test runs without these lines seem to work fine, but they are
! being retained in comments pending verification that they are in fact unnecessary.

! h_new(i,j,k) = h_new(i,j,k) + max(0.0, 1.0e-13*h_new(i,j,k) - h_pre(i,j,k))
enddo ; enddo
enddo

Expand Down

0 comments on commit 5d4e8a1

Please sign in to comment.