Skip to content

Commit

Permalink
Restore calving front within RK loop
Browse files Browse the repository at this point in the history
Restore calving front within RK loop to prevent velocity solutions
on extended ice geometry.
  • Loading branch information
trhille committed Oct 30, 2023
1 parent 8d5f28e commit bd3d61e
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ subroutine li_time_integrator_forwardeuler_rungekutta(domain, err)
integer :: err_tmp
type (mpas_pool_type), pointer :: geometryPool, thermalPool, meshPool, velocityPool

logical, pointer :: config_restore_calving_front
logical, pointer :: config_restore_calving_front, &
config_restore_calving_front_prevent_retreat
logical, pointer :: config_calculate_damage
logical, pointer :: config_finalize_damage_after_advection
character (len=StrKIND), pointer :: config_thickness_advection
Expand Down Expand Up @@ -160,6 +161,7 @@ subroutine li_time_integrator_forwardeuler_rungekutta(domain, err)
err_tmp = 0

call mpas_pool_get_config(liConfigs, 'config_restore_calving_front', config_restore_calving_front)
call mpas_pool_get_config(liConfigs, 'config_restore_calving_front_prevent_retreat', config_restore_calving_front_prevent_retreat)
call mpas_pool_get_config(liConfigs, 'config_calculate_damage',config_calculate_damage)
call mpas_pool_get_config(liConfigs, 'config_finalize_damage_after_advection', config_finalize_damage_after_advection)
call mpas_pool_get_config(liConfigs, 'config_thickness_advection', config_thickness_advection)
Expand Down Expand Up @@ -475,6 +477,11 @@ subroutine li_time_integrator_forwardeuler_rungekutta(domain, err)
call mpas_timer_stop("halo updates")
if (config_restore_calving_front) then
! restore the calving front to its initial position before velocity solve.
call li_restore_calving_front(domain, err_tmp)
err = ior(err, err_tmp)
endif
! Update velocity for each RK step
! === Solve Velocity =====================
Expand Down Expand Up @@ -531,8 +538,8 @@ subroutine li_time_integrator_forwardeuler_rungekutta(domain, err)
call li_calve_ice(domain, err_tmp)
err = ior(err, err_tmp)
if (config_restore_calving_front) then
! restore the calving front to its initial position; calving options are ignored
if (config_restore_calving_front .and. config_restore_calving_front_prevent_retreat) then
! restore the calving front to its initial position before velocity solve.
call li_restore_calving_front(domain, err_tmp)
err = ior(err, err_tmp)
endif
Expand Down

0 comments on commit bd3d61e

Please sign in to comment.