Skip to content

Commit

Permalink
The fix from #493 should not be used at grounded margins
Browse files Browse the repository at this point in the history
  • Loading branch information
ckhroulev committed Oct 30, 2021
1 parent 2bf22a8 commit 70ad22e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/stressbalance/ssa/SSA.cc
Expand Up @@ -241,6 +241,7 @@ void SSA::compute_driving_stress(const IceModelVec2S &ice_thickness,
IceModelVec2V &result) const {

using mask::ice_free_ocean;
using mask::floating_ice;

bool cfbc = m_config->get_flag("stress_balance.calving_front_stress_bc");
bool surface_gradient_inward = m_config->get_flag("stress_balance.ssa.compute_surface_gradient_inward");
Expand Down Expand Up @@ -307,7 +308,7 @@ void SSA::compute_driving_stress(const IceModelVec2S &ice_thickness,

if (east + west > 0) {
h_x = 1.0 / ((west + east) * dx) * (west * (h.ij - h.w) + east * (h.e - h.ij));
if (ice_free_ocean(M.e) or ice_free_ocean(M.w)) {
if (floating_ice(M.ij) and (ice_free_ocean(M.e) or ice_free_ocean(M.w))) {
// at the ice front: use constant extrapolation to approximate the value outside
// the ice extent (see the notes in the manual)
h_x /= 2.0;
Expand All @@ -326,7 +327,7 @@ void SSA::compute_driving_stress(const IceModelVec2S &ice_thickness,

if (north + south > 0) {
h_y = 1.0 / ((south + north) * dy) * (south * (h.ij - h.s) + north * (h.n - h.ij));
if (ice_free_ocean(M.s) or ice_free_ocean(M.n)) {
if (floating_ice(M.ij) and (ice_free_ocean(M.s) or ice_free_ocean(M.n))) {
// at the ice front: use constant extrapolation to approximate the value outside
// the ice extent
h_y /= 2.0;
Expand Down

0 comments on commit 70ad22e

Please sign in to comment.