@@ -703,7 +703,7 @@ function ice_time_step_CFL(CS, ISS, G)
703703
704704  min_dt =  5.0e17 * G% US% s_to_T !  The starting maximum is roughly the lifetime of the universe.
705705  min_vel =  (1.0e-12 / (365.0 * 86400.0 )) *  G% US% m_s_to_L_T
706-   do  j= G% jsc,G% jec ; do  i= G% isc,G% iec ; if  (ISS% hmask(i,j) == 1.0 ) then 
706+   do  j= G% jsc,G% jec ; do  i= G% isc,G% iec ; if  (ISS% hmask(i,j) == 1.0   .or.  ISS % hmask(i,j)== 3 ) then 
707707    dt_local =  2.0 * G% areaT(i,j) /  &
708708       ((G% dyCu(I,j)  *  max (abs (CS% u_shelf(I,J)  +  CS% u_shelf(I,j-1 )), min_vel) +  &
709709         G% dyCu(I-1 ,j)*  max (abs (CS% u_shelf(I-1 ,J)+  CS% u_shelf(I-1 ,j-1 )), min_vel)) +  &
@@ -979,7 +979,7 @@ subroutine ice_shelf_solve_outer(CS, ISS, G, US, u_shlf, v_shlf, taudx, taudy, i
979979      nodefloat =  0 
980980
981981      do  l= 0 ,1  ; do  k= 0 ,1 
982-         if  ((ISS% hmask(i,j) == 1 ) .and.  &
982+         if  ((ISS% hmask(i,j) == 1   .or.  ISS % hmask(i,j)== 3 ) .and.  &
983983            (rhoi_rhow *  H_node(i-1 + k,j-1 + l) -  CS% bed_elev(i,j) <=  0 )) then 
984984          nodefloat =  nodefloat +  1 
985985        endif 
@@ -1512,7 +1512,7 @@ subroutine ice_shelf_advect_thickness_x(CS, G, LB, time_step, hmask, h0, h_after
15121512  do  j= jsh,jeh ; do  I= ish-1 ,ieh
15131513    if  (CS% u_face_mask(I,j) == 4 .) then  !  The flux itself is a specified boundary condition.
15141514      uh_ice(I,j) =  time_step *  G% dyCu(I,j) *  CS% u_flux_bdry_val(I,j)
1515-     elseif  ((hmask(i,j) == 1 )  .or.  (hmask(i+1 ,j) == 1 )) then 
1515+     elseif  ((hmask(i,j) == 1   .or.  hmask(i,j) ==  3 )  .or.  (hmask(i+1 ,j) == 1   .or.  hmask(i +1 ,j) ==  3 )) then 
15161516      u_face =  0.5  *  (CS% u_shelf(I,J-1 ) +  CS% u_shelf(I,J))
15171517      h_face =  0.0  !  This will apply when the source cell is iceless or not fully ice covered.
15181518
@@ -1591,8 +1591,7 @@ subroutine ice_shelf_advect_thickness_y(CS, G, LB, time_step, hmask, h0, h_after
15911591  do  J= jsh-1 ,jeh ; do  i= ish,ieh
15921592    if  (CS% v_face_mask(i,J) == 4 .) then  !  The flux itself is a specified boundary condition.
15931593      vh_ice(i,J) =  time_step *  G% dxCv(i,J) *  CS% v_flux_bdry_val(i,J)
1594-     elseif  ((hmask(i,j) == 1 ) .or.  (hmask(i,j+1 ) == 1 )) then 
1595- 
1594+     elseif  ((hmask(i,j) == 1  .or.  hmask(i,j) == 3 ) .or.  (hmask(i,j+1 ) == 1  .or.  hmask(i,j+1 ) == 3 )) then 
15961595      v_face =  0.5  *  (CS% v_shelf(I-1 ,J) +  CS% v_shelf(I,J))
15971596      h_face =  0.0  !  This will apply when the source cell is iceless or not fully ice covered.
15981597
@@ -1760,7 +1759,7 @@ subroutine shelf_advance_front(CS, ISS, G, hmask, uh_ice, vh_ice)
17601759              partial_vol =  ISS% h_shelf(i,j) *  ISS% area_shelf_h(i,j) +  tot_flux
17611760
17621761              if  ((partial_vol /  G% areaT(i,j)) == h_reference) then  !  cell is exactly covered, no overflow
1763-                 ISS% hmask(i,j) =  1 
1762+                 if  (ISS % hmask(i,j) .ne. 3 )  ISS% hmask(i,j) =  1 
17641763                ISS% h_shelf(i,j) =  h_reference
17651764                ISS% area_shelf_h(i,j) =  G% areaT(i,j)
17661765              elseif  ((partial_vol /  G% areaT(i,j)) < h_reference) then 
@@ -1770,7 +1769,7 @@ subroutine shelf_advance_front(CS, ISS, G, hmask, uh_ice, vh_ice)
17701769                ISS% h_shelf(i,j) =  h_reference
17711770              else 
17721771
1773-                 ISS% hmask(i,j) =  1 
1772+                 if  (ISS % hmask(i,j) .ne. 3 )  ISS% hmask(i,j) =  1 
17741773                ISS% area_shelf_h(i,j) =  G% areaT(i,j)
17751774                ! h_temp(i,j) = h_reference
17761775                partial_vol =  partial_vol -  h_reference *  G% areaT(i,j)
@@ -1962,30 +1961,31 @@ subroutine calc_shelf_driving_stress(CS, ISS, G, US, taudx, taudy, OD)
19621961      dyh =  G% dyT(i,j)
19631962      Dx= dxh
19641963      Dy= dyh
1965-       if  (ISS% hmask(i,j) == 1 ) then  !  we are inside the global computational bdry, at an ice-filled cell
1964+       if  (ISS% hmask(i,j) == 1  .or.  ISS% hmask(i,j) == 3 ) then 
1965+         !  we are inside the global computational bdry, at an ice-filled cell
19661966
19671967        !  calculate sx
19681968        if  ((i+ i_off) == gisc) then  !  at west computational bdry
1969-          if  (ISS% hmask(i+1 ,j) == 1 ) then 
1969+          if  (ISS% hmask(i+1 ,j) == 1   .or.  ISS % hmask(i +1 ,j) ==  3 ) then 
19701970            sx =  (S(i+1 ,j)- S(i,j))/ dxh
19711971          else 
19721972            sx =  0 
19731973          endif 
19741974        elseif  ((i+ i_off) == giec) then  !  at east computational bdry
1975-           if  (ISS% hmask(i-1 ,j) == 1 ) then 
1975+           if  (ISS% hmask(i-1 ,j) == 1   .or.  ISS % hmask(i -1 ,j) ==  3 ) then 
19761976            sx =  (S(i,j)- S(i-1 ,j))/ dxh
19771977          else 
19781978            sx =  0 
19791979          endif 
19801980        else  !  interior
1981-           if  (ISS% hmask(i+1 ,j) == 1 ) then 
1981+           if  (ISS% hmask(i+1 ,j) == 1   .or.  ISS % hmask(i +1 ,j) ==  3 ) then 
19821982            cnt =  cnt+1 
19831983            Dx = dxh+  G% dxT(i+1 ,j)
19841984            sx =  S(i+1 ,j)
19851985          else 
19861986            sx =  S(i,j)
19871987          endif 
1988-           if  (ISS% hmask(i-1 ,j) == 1 ) then 
1988+           if  (ISS% hmask(i-1 ,j) == 1   .or.  ISS % hmask(i -1 ,j) ==  3 ) then 
19891989            cnt =  cnt+1 
19901990            Dx = dxh+  G% dxT(i-1 ,j)
19911991            sx =  sx -  S(i-1 ,j)
@@ -2003,26 +2003,26 @@ subroutine calc_shelf_driving_stress(CS, ISS, G, US, taudx, taudy, OD)
20032003
20042004        !  calculate sy, similarly
20052005        if  ((j+ j_off) == gjsc) then  !  at south computational bdry
2006-           if  (ISS% hmask(i,j+1 ) == 1 ) then 
2006+           if  (ISS% hmask(i,j+1 ) == 1   .or.  ISS % hmask(i,j +1 ) ==  3 ) then 
20072007            sy =  (S(i,j+1 )- S(i,j))/ dyh
20082008          else 
20092009            sy =  0 
20102010          endif 
20112011        elseif  ((j+ j_off) == gjec) then  !  at north computational bdry
2012-           if  (ISS% hmask(i,j-1 ) == 1 ) then 
2012+           if  (ISS% hmask(i,j-1 ) == 1   .or.  ISS % hmask(i,j -1 ) ==  3 ) then 
20132013            sy =  (S(i,j)- S(i,j-1 ))/ dyh
20142014          else 
20152015            sy =  0 
20162016          endif 
20172017        else  !  interior
2018-           if  (ISS% hmask(i,j+1 ) == 1 ) then 
2018+           if  (ISS% hmask(i,j+1 ) == 1   .or.  ISS % hmask(i,j +1 ) ==  3 ) then 
20192019            cnt =  cnt+1 
20202020            Dy = dyh+  G% dyT(i,j+1 )
20212021            sy =  S(i,j+1 )
20222022          else 
20232023            sy =  S(i,j)
20242024          endif 
2025-           if  (ISS% hmask(i,j-1 ) == 1 ) then 
2025+           if  (ISS% hmask(i,j-1 ) == 1   .or.  ISS % hmask(i,j -1 ) ==  3 ) then 
20262026            cnt =  cnt+1 
20272027            sy =  sy -  S(i,j-1 )
20282028            Dy = dyh+  G% dyT(i,j-1 )
@@ -2258,7 +2258,7 @@ subroutine CG_action(CS, uret, vret, u_shlf, v_shlf, Phi, Phisub, umask, vmask,
22582258
22592259  Ee= 1.0 
22602260
2261-   do  j= js,je ; do  i= is,ie ; if  (hmask(i,j) == 1 ) then 
2261+   do  j= js,je ; do  i= is,ie ; if  (hmask(i,j) == 1   .or.  hmask(i,j)== 3 ) then 
22622262
22632263      do  iq= 1 ,2  ; do  jq= 1 ,2 
22642264
@@ -2426,7 +2426,7 @@ subroutine matrix_diagonal(CS, G, US, float_cond, H_node, ice_visc, basal_trac,
24262426
24272427  Ee= 1.0 
24282428
2429-   do  j= jsc-1 ,jec+1  ; do  i= isc-1 ,iec+1  ; if  (hmask(i,j) == 1 ) then 
2429+   do  j= jsc-1 ,jec+1  ; do  i= isc-1 ,iec+1  ; if  (hmask(i,j) == 1   .or.  hmask(i,j)== 3 ) then 
24302430
24312431    call  bilinear_shape_fn_grid(G, i, j, Phi)
24322432
@@ -2584,7 +2584,7 @@ subroutine apply_boundary_values(CS, ISS, G, US, time, Phisub, H_node, ice_visc,
25842584
25852585  Ee= 1.0 
25862586
2587-   do  j= jsc-1 ,jec+1  ; do  i= isc-1 ,iec+1  ; if  (ISS% hmask(i,j) == 1 ) then 
2587+   do  j= jsc-1 ,jec+1  ; do  i= isc-1 ,iec+1  ; if  (ISS% hmask(i,j) == 1   .or.  ISS % hmask(i,j) ==  3 ) then 
25882588
25892589    !  process this cell if any corners have umask set to non-dirichlet bdry.
25902590
@@ -3221,7 +3221,7 @@ subroutine update_velocity_masks(CS, G, hmask, umask, vmask, u_face_mask, v_face
32213221  endif 
32223222
32233223  do  j= js,G% jed; do  i= is,G% ied
3224-     if  (hmask(i,j) == 1 ) then 
3224+     if  (hmask(i,j) == 1   .or.  hmask(i,j)== 3 ) then 
32253225      umask(I-1 :I,J-1 :J)= 1 
32263226      vmask(I-1 :I,J-1 :J)= 1 
32273227    endif 
@@ -3362,7 +3362,7 @@ subroutine interpolate_H_to_B(G, h_shelf, hmask, H_node)
33623362      num_h =  0 
33633363      do  k= 0 ,1 
33643364        do  l= 0 ,1 
3365-           if  (hmask(i+ k,j+ l) == 1.0 ) then 
3365+           if  (hmask(i+ k,j+ l) == 1.0   .or.  hmask(i + k,j + l) ==  3.0 ) then 
33663366            summ =  summ +  h_shelf(i+ k,j+ l)
33673367            num_h =  num_h +  1 
33683368          endif 
0 commit comments