Skip to content

Commit

Permalink
+Add optional arg to ice_shelf_min_thickness_calve
Browse files Browse the repository at this point in the history
  Added a new optional argument, halo, to ice_shelf_min_thickness_calve to
specify the range of indices over which to work.  All answers are bitwise
identical, but there is a new argument in a public interface.
  • Loading branch information
Hallberg-NOAA committed Apr 1, 2020
1 parent e87c664 commit fcb1e92
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions src/ice_shelf/MOM_ice_shelf_dynamics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1650,28 +1650,33 @@ subroutine shelf_advance_front(CS, ISS, G, hmask, uh_ice, vh_ice)
end subroutine shelf_advance_front

!> Apply a very simple calving law using a minimum thickness rule
subroutine ice_shelf_min_thickness_calve(G, h_shelf, area_shelf_h, hmask, thickness_calve)
subroutine ice_shelf_min_thickness_calve(G, h_shelf, area_shelf_h, hmask, thickness_calve, halo)
type(ocean_grid_type), intent(in) :: G !< The grid structure used by the ice shelf.
real, dimension(SZDI_(G),SZDJ_(G)), intent(inout) :: h_shelf !< The ice shelf thickness [Z ~> m].
real, dimension(SZDI_(G),SZDJ_(G)), intent(inout) :: area_shelf_h !< The area per cell covered by
!! the ice shelf [L2 ~> m2].
real, dimension(SZDI_(G),SZDJ_(G)), intent(inout) :: hmask !< A mask indicating which tracer points are
!! partly or fully covered by an ice-shelf
real, intent(in) :: thickness_calve !< The thickness at which to trigger calving [Z ~> m].
integer, optional, intent(in) :: halo !< The number of halo points to use. If not present,
!! work on the entire data domain.
integer :: i, j, is, ie, js, je

integer :: i,j
if (present(halo)) then
is = G%isc - halo ; ie = G%iec + halo ; js = G%jsc - halo ; je = G%jec + halo
else
is = G%isd ; ie = G%ied ; js = G%jsd ; je = G%jed
endif

do j=G%jsd,G%jed
do i=G%isd,G%ied
! if ((h_shelf(i,j) < CS%thickness_calve) .and. (hmask(i,j) == 1) .and. &
! (CS%ground_frac(i,j) == 0.0)) then
if ((h_shelf(i,j) < thickness_calve) .and. (area_shelf_h(i,j) > 0.)) then
h_shelf(i,j) = 0.0
area_shelf_h(i,j) = 0.0
hmask(i,j) = 0.0
endif
enddo
enddo
do j=js,je ; do i=is,ie
! if ((h_shelf(i,j) < CS%thickness_calve) .and. (hmask(i,j) == 1) .and. &
! (CS%ground_frac(i,j) == 0.0)) then
if ((h_shelf(i,j) < thickness_calve) .and. (area_shelf_h(i,j) > 0.)) then
h_shelf(i,j) = 0.0
area_shelf_h(i,j) = 0.0
hmask(i,j) = 0.0
endif
enddo ; enddo

end subroutine ice_shelf_min_thickness_calve

Expand Down

0 comments on commit fcb1e92

Please sign in to comment.