Skip to content

Commit

Permalink
Adjust OBC mask to be consistent with land mask.
Browse files Browse the repository at this point in the history
  • Loading branch information
kshedstrom committed Jun 18, 2016
1 parent c421b4b commit 983ce84
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/core/MOM_open_boundary.F90
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ module MOM_open_boundary
public open_boundary_query
public open_boundary_end
public open_boundary_impose_normal_slope
public open_boundary_impose_land_mask
public Radiation_Open_Bdry_Conds
public set_Flather_positions
public set_Flather_data
Expand Down Expand Up @@ -235,6 +236,35 @@ subroutine open_boundary_impose_normal_slope(OBC, G, depth)

end subroutine open_boundary_impose_normal_slope

!> Sets the slope of bathymetry normal to an open bounndary to zero.
subroutine open_boundary_impose_land_mask(OBC, G)
type(ocean_OBC_type), pointer :: OBC !< Open boundary control structure
type(ocean_grid_type), intent(in) :: G !< Ocean grid structure
! Local variables
integer :: i, j

if (.not.associated(OBC)) return

if (associated(OBC%OBC_kind_u)) then
do j=G%jsd,G%jed ; do I=G%isd,G%ied-1
if (G%mask2dCu(I,j) == 0) then
OBC%OBC_kind_u(I,j) = OBC_NONE
OBC%OBC_mask_u(I,j) = .false.
endif
enddo ; enddo
endif

if (associated(OBC%OBC_kind_v)) then
do J=G%jsd,G%jed-1 ; do i=G%isd,G%ied
if (G%mask2dCv(i,J) == 0) then
OBC%OBC_kind_v(i,J) = OBC_NONE
OBC%OBC_mask_v(i,J) = .false.
endif
enddo ; enddo
endif

end subroutine open_boundary_impose_land_mask

!> Diagnose radiation conditions at open boundaries
subroutine Radiation_Open_Bdry_Conds(OBC, u_new, u_old, v_new, v_old, &
h_new, h_old, G)
Expand Down
4 changes: 4 additions & 0 deletions src/initialization/MOM_fixed_initialization.F90
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ module MOM_fixed_initialization
use MOM_open_boundary, only : ocean_OBC_type
use MOM_open_boundary, only : open_boundary_config, open_boundary_query
use MOM_open_boundary, only : set_Flather_positions, open_boundary_impose_normal_slope
use MOM_open_boundary, only : open_boundary_impose_land_mask
use MOM_string_functions, only : uppercase
use user_initialization, only : user_initialize_topography, USER_set_OBC_positions
use DOME_initialization, only : DOME_initialize_topography, DOME_set_OBC_positions
Expand Down Expand Up @@ -112,6 +113,9 @@ subroutine MOM_initialize_fixed(G, OBC, PF, write_geom, output_dir)

! This call sets masks that prohibit flow over any point interpreted as land
call initialize_masks(G, PF)

! Make OBC mask consistent with land mask
call open_boundary_impose_land_mask(OBC, G)
if (debug) then
call hchksum(G%bathyT, 'MOM_initialize_fixed: depth ', G%HI, haloshift=1)
call hchksum(G%mask2dT, 'MOM_initialize_fixed: mask2dT ', G%HI)
Expand Down

0 comments on commit 983ce84

Please sign in to comment.