Skip to content

Commit

Permalink
Fix maskhalo update bug in dynamics, only appears when running padded…
Browse files Browse the repository at this point in the history
… decompositions. In #491, an unmasked halo update was changed to a masked halo update.  This affects only padded decompositions with maskhalo_dyn=true and was picked up by an exact restart failure (#517)
  • Loading branch information
apcraig authored Sep 25, 2020
1 parent b0a7ee6 commit e662c79
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 39 deletions.
18 changes: 5 additions & 13 deletions cicecore/cicedynB/dynamics/ice_dyn_eap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,11 @@ subroutine eap (dt)
call ice_timer_start(timer_bound)
call ice_HaloUpdate (strength, halo_info, &
field_loc_center, field_type_scalar)
! velocities may have changed in dyn_prep2
call stack_velocity_field(uvel, vvel, fld2)
call ice_HaloUpdate (fld2, halo_info, &
field_loc_NEcorner, field_type_vector)
call unstack_velocity_field(fld2, uvel, vvel)
call ice_timer_stop(timer_bound)

if (maskhalo_dyn) then
Expand All @@ -377,19 +382,6 @@ subroutine eap (dt)
call ice_HaloMask(halo_info_mask, halo_info, halomask)
endif

! velocities may have changed in dyn_prep2
call stack_velocity_field(uvel, vvel, fld2)
call ice_timer_start(timer_bound)
if (maskhalo_dyn) then
call ice_HaloUpdate (fld2, halo_info_mask, &
field_loc_NEcorner, field_type_vector)
else
call ice_HaloUpdate (fld2, halo_info, &
field_loc_NEcorner, field_type_vector)
endif
call ice_timer_stop(timer_bound)
call unstack_velocity_field(fld2, uvel, vvel)

!-----------------------------------------------------------------
! basal stress coefficients (landfast ice)
!-----------------------------------------------------------------
Expand Down
18 changes: 5 additions & 13 deletions cicecore/cicedynB/dynamics/ice_dyn_evp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,11 @@ subroutine evp (dt)
call ice_timer_start(timer_bound)
call ice_HaloUpdate (strength, halo_info, &
field_loc_center, field_type_scalar)
! velocities may have changed in dyn_prep2
call stack_velocity_field(uvel, vvel, fld2)
call ice_HaloUpdate (fld2, halo_info, &
field_loc_NEcorner, field_type_vector)
call unstack_velocity_field(fld2, uvel, vvel)
call ice_timer_stop(timer_bound)

if (maskhalo_dyn) then
Expand All @@ -319,19 +324,6 @@ subroutine evp (dt)
call ice_HaloMask(halo_info_mask, halo_info, halomask)
endif

! velocities may have changed in dyn_prep2
call stack_velocity_field(uvel, vvel, fld2)
call ice_timer_start(timer_bound)
if (maskhalo_dyn) then
call ice_HaloUpdate (fld2, halo_info_mask, &
field_loc_NEcorner, field_type_vector)
else
call ice_HaloUpdate (fld2, halo_info, &
field_loc_NEcorner, field_type_vector)
endif
call ice_timer_stop(timer_bound)
call unstack_velocity_field(fld2, uvel, vvel)

!-----------------------------------------------------------------
! basal stress coefficients (landfast ice)
!-----------------------------------------------------------------
Expand Down
18 changes: 5 additions & 13 deletions cicecore/cicedynB/dynamics/ice_dyn_vp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,11 @@ subroutine implicit_solver (dt)
call ice_timer_start(timer_bound)
call ice_HaloUpdate (strength, halo_info, &
field_loc_center, field_type_scalar)
! velocities may have changed in dyn_prep2
call stack_velocity_field(uvel, vvel, fld2)
call ice_HaloUpdate (fld2, halo_info, &
field_loc_NEcorner, field_type_vector)
call unstack_velocity_field(fld2, uvel, vvel)
call ice_timer_stop(timer_bound)

if (maskhalo_dyn) then
Expand All @@ -430,19 +435,6 @@ subroutine implicit_solver (dt)
call ice_HaloMask(halo_info_mask, halo_info, halomask)
endif

! velocities may have changed in dyn_prep2
call stack_velocity_field(uvel, vvel, fld2)
call ice_timer_start(timer_bound)
if (maskhalo_dyn) then
call ice_HaloUpdate (fld2, halo_info_mask, &
field_loc_NEcorner, field_type_vector)
else
call ice_HaloUpdate (fld2, halo_info, &
field_loc_NEcorner, field_type_vector)
endif
call ice_timer_stop(timer_bound)
call unstack_velocity_field(fld2, uvel, vvel)

!-----------------------------------------------------------------
! basal stress coefficients (landfast ice)
!-----------------------------------------------------------------
Expand Down

0 comments on commit e662c79

Please sign in to comment.