Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update and bugfix to movement of the ice-shelf front #475

Merged
merged 1 commit into from
Oct 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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