Skip to content

Commit a4ec069

Browse files
committed
Fix for MASK_OUTSIDE_OBCS with MASKING_DEPTH
1 parent e189e05 commit a4ec069

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/core/MOM_open_boundary.F90

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5052,7 +5052,9 @@ subroutine mask_outside_OBCs(G, US, param_file, OBC)
50525052
integer :: i, j
50535053
integer :: l_seg
50545054
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].
50565058
integer, parameter :: cin = 3, cout = 4, cland = -1, cedge = -2
50575059
character(len=256) :: mesg ! Message for error messages.
50585060
real, allocatable, dimension(:,:) :: color, color2 ! For sorting inside from outside,
@@ -5062,6 +5064,12 @@ subroutine mask_outside_OBCs(G, US, param_file, OBC)
50625064

50635065
call get_param(param_file, mdl, "MINIMUM_DEPTH", min_depth, &
50645066
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+
50655073
! The reference depth on a dyn_horgrid is 0, otherwise would need: min_depth = min_depth - G%Z_ref
50665074

50675075
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)
51525160
&"the masking of the outside grid points.")') i, j
51535161
call MOM_error(WARNING,"MOM mask_outside_OBCs: "//mesg, all_print=.true.)
51545162
endif
5155-
if (color(i,j) == cout) G%bathyT(i,j) = min_depth
5163+
if (color(i,j) == cout) G%bathyT(i,j) = Dmask
51565164
enddo ; enddo
51575165
if (fatal_error) call MOM_error(FATAL, &
51585166
"MOM_open_boundary: inconsistent OBC segments.")

0 commit comments

Comments
 (0)