@@ -5052,7 +5052,9 @@ subroutine mask_outside_OBCs(G, US, param_file, OBC)
5052
5052
integer :: i, j
5053
5053
integer :: l_seg
5054
5054
logical :: fatal_error = .False.
5055
- real :: min_depth ! The minimum depth for ocean points [Z ~> m]
5055
+ real :: min_depth ! The minimum depth for ocean points [Z ~> m]
5056
+ real :: mask_depth ! The masking depth for ocean points [Z ~> m]
5057
+ real :: Dmask ! The depth for masking in the same units as G%bathyT [Z ~> m].
5056
5058
integer , parameter :: cin = 3 , cout = 4 , cland = - 1 , cedge = - 2
5057
5059
character (len= 256 ) :: mesg ! Message for error messages.
5058
5060
real , allocatable , dimension (:,:) :: color, color2 ! For sorting inside from outside,
@@ -5062,6 +5064,12 @@ subroutine mask_outside_OBCs(G, US, param_file, OBC)
5062
5064
5063
5065
call get_param(param_file, mdl, " MINIMUM_DEPTH" , min_depth, &
5064
5066
units= " m" , default= 0.0 , scale= US% m_to_Z, do_not_log= .true. )
5067
+ call get_param(param_file, mdl, " MASKING_DEPTH" , mask_depth, &
5068
+ units= " m" , default=- 9999.0 , scale= US% m_to_Z, do_not_log= .true. )
5069
+
5070
+ Dmask = mask_depth
5071
+ if (mask_depth == - 9999.0 * US% m_to_Z) Dmask = min_depth
5072
+
5065
5073
! The reference depth on a dyn_horgrid is 0, otherwise would need: min_depth = min_depth - G%Z_ref
5066
5074
5067
5075
allocate (color(G% isd:G% ied, G% jsd:G% jed), source= 0.0 )
@@ -5152,7 +5160,7 @@ subroutine mask_outside_OBCs(G, US, param_file, OBC)
5152
5160
&"the masking of the outside grid points.")' ) i, j
5153
5161
call MOM_error(WARNING," MOM mask_outside_OBCs: " // mesg, all_print= .true. )
5154
5162
endif
5155
- if (color(i,j) == cout) G% bathyT(i,j) = min_depth
5163
+ if (color(i,j) == cout) G% bathyT(i,j) = Dmask
5156
5164
enddo ; enddo
5157
5165
if (fatal_error) call MOM_error(FATAL, &
5158
5166
" MOM_open_boundary: inconsistent OBC segments." )
0 commit comments