Skip to content

Commit

Permalink
ice shelf front advection: When determining a reference thickness for…
Browse files Browse the repository at this point in the history
… a partially-filled cell, add the reference thickness contribution from a neighboring filled cell proportionate to its flux into the partially-filled cell. This is more accurate than simply taking the average thickness of all neighboring filled cells. Also fixed incorrect bounds. (mom-ocean#475)
  • Loading branch information
alex-huth committed Oct 27, 2023
1 parent f514529 commit 503a9f4
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/ice_shelf/MOM_ice_shelf_dynamics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1723,22 +1723,23 @@ subroutine shelf_advance_front(CS, ISS, G, hmask, uh_ice, vh_ice)

do j=jsc-1,jec+1

if (((j+j_off) <= G%domain%njglobal+G%domain%njhalo) .AND. &
((j+j_off) >= G%domain%njhalo+1)) then
if (((j+j_off) <= G%domain%njglobal) .AND. &
((j+j_off) >= 1)) then

do i=isc-1,iec+1

if (((i+i_off) <= G%domain%niglobal+G%domain%nihalo) .AND. &
((i+i_off) >= G%domain%nihalo+1)) then
! first get reference thickness by averaging over cells that are fluxing into this cell
if (((i+i_off) <= G%domain%niglobal) .AND. &
((i+i_off) >= 1)) then
! first get reference thickness by averaging over cells that are fluxing into this cell
n_flux = 0
h_reference = 0.0
tot_flux = 0.0

do k=1,2
if (flux_enter(i,j,k) > 0) then
n_flux = n_flux + 1
h_reference = h_reference + ISS%h_shelf(i+2*k-3,j)
h_reference = h_reference + flux_enter(i,j,k) * ISS%h_shelf(i+2*k-3,j)
!h_reference = h_reference + ISS%h_shelf(i+2*k-3,j)
tot_flux = tot_flux + flux_enter(i,j,k)
flux_enter(i,j,k) = 0.0
endif
Expand All @@ -1747,15 +1748,17 @@ subroutine shelf_advance_front(CS, ISS, G, hmask, uh_ice, vh_ice)
do k=1,2
if (flux_enter(i,j,k+2) > 0) then
n_flux = n_flux + 1
h_reference = h_reference + ISS%h_shelf(i,j+2*k-3)
h_reference = h_reference + flux_enter(i,j,k+2) * ISS%h_shelf(i,j+2*k-3)
!h_reference = h_reference + ISS%h_shelf(i,j+2*k-3)
tot_flux = tot_flux + flux_enter(i,j,k+2)
flux_enter(i,j,k+2) = 0.0
endif
enddo

if (n_flux > 0) then
dxdyh = G%areaT(i,j)
h_reference = h_reference / real(n_flux)
h_reference = h_reference / tot_flux
!h_reference = h_reference / real(n_flux)
partial_vol = ISS%h_shelf(i,j) * ISS%area_shelf_h(i,j) + tot_flux

if ((partial_vol / G%areaT(i,j)) == h_reference) then ! cell is exactly covered, no overflow
Expand Down

0 comments on commit 503a9f4

Please sign in to comment.