Skip to content

Commit

Permalink
Merge branch 'user/ksh/open_bc' into user/ksh/bad_segs
Browse files Browse the repository at this point in the history
  • Loading branch information
kshedstrom committed Jan 12, 2017
2 parents 7d28845 + cf87566 commit a083e65
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/core/MOM_open_boundary.F90
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,19 @@ module MOM_open_boundary
real, pointer, dimension(:,:) :: unhbt=>NULL() !<The vertically summed normal layer transports (m3 s-1).
real, pointer, dimension(:,:) :: unbt=>NULL() !<The vertically-averaged normal velocity (m s-1).
real, pointer, dimension(:,:,:) :: tangent_vel=>NULL() !<The layer velocity tangential to the OB segment (m s-1).
real, pointer, dimension(:,:,:) :: tangent_trans=>NULL() !<The layer transport tangential to the OB segment (m3 s-1).
real, pointer, dimension(:,:) :: tangent_vel_bt=>NULL() !<The barotropic velocity tangential to the OB segment (m s-1).
real, pointer, dimension(:,:) :: eta=>NULL() !<The sea-surface elevation (m).
real, pointer, dimension(:,:,:) :: normal_vel=>NULL() !<The layer velocity normal to the OB segment (m s-1).
real, pointer, dimension(:,:,:) :: normal_trans=>NULL() !<The layer transport normal to the OB segment (m3 s-1).
real, pointer, dimension(:,:) :: normal_vel_bt=>NULL() !<The barotropic velocity normal to the OB segment (m s-1).
real, pointer, dimension(:,:) :: eta=>NULL() !<The sea-surface elevation along the segment (m).
type(hor_index_type) :: HI !< Horizontal index ranges
end type OBC_segment_type

!> Open-boundary data
type, public :: ocean_OBC_type
integer :: number_of_segments = 0 !< The number of open-boundary segments.
integer :: number_of_segments = 0 !< The number of open-boundary segments.
integer :: ke = 0 !< The number of model layers
logical :: Flather_u_BCs_exist_globally = .false. !< True if any zonal velocity points
!! in the global domain use Flather BCs.
logical :: Flather_v_BCs_exist_globally = .false. !< True if any meridional velocity points
Expand Down Expand Up @@ -205,6 +210,9 @@ subroutine open_boundary_config(G, param_file, OBC)
call get_param(param_file, mod, "OBC_VALUES_CONFIG", config2, &
"A string that sets how the open boundary values are \n"//&
" configured: \n", default="None", do_not_log=.true.)
call get_param(param_file, mod, "NZ", OBC%ke, &
"The number of model layers", default=0, do_not_log=.true.)

if (config1 .ne. "None" .or. config2 .ne. "None") OBC%user_BCs_set_globally = .true.

if (OBC%number_of_segments > 0) then
Expand Down
3 changes: 3 additions & 0 deletions src/user/supercritical_initialization.F90
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ subroutine supercritical_set_OBC_data(OBC, G, param_file)

allocate(OBC%u(G%IsdB:G%IedB,G%jsd:G%jed,G%ke)) ; OBC%u(:,:,:) = 0.0
allocate(OBC%uh(G%IsdB:G%IedB,G%jsd:G%jed,G%ke)) ; OBC%uh(:,:,:) = 0.0
if (.not.associated(OBC%ubt_outer)) then
allocate(OBC%ubt_outer(G%IsdB:G%IedB,G%jsd:G%jed)) ; OBC%ubt_outer(:,:) = 0.0
endif

do j=G%jsd,G%jed ; do I=G%IsdB,G%IedB
if (OBC%OBC_segment_u(I,j)>0) then
Expand Down

0 comments on commit a083e65

Please sign in to comment.