Skip to content

Commit

Permalink
Merge branch 'ESMG-user/ksh/open_bc' into dev/master
Browse files Browse the repository at this point in the history
  • Loading branch information
adcroft committed Jul 1, 2016
2 parents fd8cf8a + be8080a commit c2799bc
Show file tree
Hide file tree
Showing 41 changed files with 1,311 additions and 1,190 deletions.
8 changes: 4 additions & 4 deletions src/core/MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ module MOM

! This file is part of MOM6. See LICENSE.md for the license.

use MOM_variables, only : vertvisc_type, ocean_OBC_type
use MOM_variables, only : vertvisc_type
use MOM_open_boundary, only : ocean_OBC_type

! A Structure with pointers to forcing fields to drive MOM;
! all fluxes are positive downward.
Expand Down Expand Up @@ -98,7 +99,7 @@ module MOM
use MOM_mixed_layer_restrat, only : mixedlayer_restrat_register_restarts
use MOM_neutral_diffusion, only : neutral_diffusion_CS, neutral_diffusion_diag_init
use MOM_obsolete_diagnostics, only : register_obsolete_diagnostics
use MOM_open_boundary, only : Radiation_Open_Bdry_Conds, open_boundary_init
use MOM_open_boundary, only : Radiation_Open_Bdry_Conds
use MOM_PressureForce, only : PressureForce, PressureForce_init, PressureForce_CS
use MOM_set_visc, only : set_viscous_BBL, set_viscous_ML, set_visc_init
use MOM_set_visc, only : set_visc_register_restarts, set_visc_CS
Expand Down Expand Up @@ -1821,7 +1822,7 @@ subroutine initialize_MOM(Time, param_file, dirs, CS, Time_in)
call callTree_waypoint("restart registration complete (initialize_MOM)")

call cpu_clock_begin(id_clock_MOM_init)
call MOM_initialize_fixed(dG, param_file, write_geom_files, dirs%output_directory)
call MOM_initialize_fixed(dG, CS%OBC, param_file, write_geom_files, dirs%output_directory)
call callTree_waypoint("returned from MOM_initialize_fixed() (initialize_MOM)")
call MOM_initialize_coord(GV, param_file, write_geom_files, &
dirs%output_directory, CS%tv, dG%max_depth)
Expand Down Expand Up @@ -1952,7 +1953,6 @@ subroutine initialize_MOM(Time, param_file, dirs, CS, Time_in)
call wave_speed_init(Time, G, param_file, diag, CS%wave_speed_CSp)
call VarMix_init(Time, G, param_file, diag, CS%VarMix, CS%wave_speed_CSp)
call set_visc_init(Time, G, GV, param_file, diag, CS%visc, CS%set_visc_CSp)

if (CS%split) then
allocate(eta(SZI_(G),SZJ_(G))) ; eta(:,:) = 0.0
if (CS%legacy_split) then
Expand Down
180 changes: 96 additions & 84 deletions src/core/MOM_barotropic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,13 @@ module MOM_barotropic
use MOM_grid, only : ocean_grid_type
use MOM_hor_index, only : hor_index_type
use MOM_io, only : vardesc, var_desc
use MOM_open_boundary, only : ocean_OBC_type, OBC_SIMPLE, OBC_NONE, OBC_FLATHER
use MOM_open_boundary, only : OBC_DIRECTION_E, OBC_DIRECTION_W
use MOM_open_boundary, only : OBC_DIRECTION_N, OBC_DIRECTION_S
use MOM_restart, only : register_restart_field, query_initialized, MOM_restart_CS
use MOM_tidal_forcing, only : tidal_forcing_sensitivity, tidal_forcing_CS
use MOM_time_manager, only : time_type, set_time, operator(+), operator(-)
use MOM_variables, only : BT_cont_type, alloc_bt_cont_type
use MOM_variables, only : ocean_OBC_type, OBC_SIMPLE, OBC_NONE
use MOM_variables, only : OBC_FLATHER_E, OBC_FLATHER_W
use MOM_variables, only : OBC_FLATHER_N, OBC_FLATHER_S
use MOM_verticalGrid, only : verticalGrid_type

implicit none ; private
Expand Down Expand Up @@ -362,6 +362,8 @@ module MOM_barotropic
OBC_mask_u => NULL(), &
OBC_mask_v => NULL()
integer, dimension(:,:), pointer :: &
OBC_direction_u => NULL(), &
OBC_direction_v => NULL(), &
OBC_kind_u => NULL(), &
OBC_kind_v => NULL()
real, dimension(:,:), pointer :: &
Expand Down Expand Up @@ -2378,44 +2380,46 @@ subroutine apply_velocity_OBCs(OBC, ubt, vbt, uhbt, vhbt, ubt_trans, vbt_trans,
uhbt(I,j) = BT_OBC%uhbt(I,j)
ubt(I,j) = BT_OBC%ubt_outer(I,j)
vel_trans = ubt(I,j)
elseif (BT_OBC%OBC_kind_u(I,j) == OBC_FLATHER_E) then
cfl = dtbt * BT_OBC%Cg_u(I,j) * G%IdxCu(I,j) ! CFL
u_inlet = cfl*ubt_old(I-1,j) + (1.0-cfl)*ubt_old(I,j) ! Valid for cfl<1
! h_in = 2.0*cfl*eta(i,j) + (1.0-2.0*cfl)*eta(i+1,j) ! external
h_in = eta(i,j) + (0.5-cfl)*(eta(i,j)-eta(i-1,j)) ! internal

H_u = BT_OBC%H_u(I,j)
vel_prev = ubt(I,j)
ubt(I,j) = 0.5*((u_inlet + BT_OBC%ubt_outer(I,j)) + &
(BT_OBC%Cg_u(I,j)/H_u) * (h_in-BT_OBC%eta_outer_u(I,j)))

vel_trans = (1.0-bebt)*vel_prev + bebt*ubt(I,j)
elseif (BT_OBC%OBC_kind_u(I,j) == OBC_FLATHER_W) then
cfl = dtbt * BT_OBC%Cg_u(I,j) * G%IdxCu(I,j) ! CFL
u_inlet = cfl*ubt_old(I+1,j) + (1.0-cfl)*ubt_old(I,j) ! Valid for cfl<1
! h_in = 2.0*cfl*eta(i+1,j) + (1.0-2.0*cfl)*eta(i,j) ! external
h_in = eta(i+1,j) + (0.5-cfl)*(eta(i+1,j)-eta(i+2,j)) ! internal

H_u = BT_OBC%H_u(I,j)
vel_prev = ubt(I,j)
ubt(I,j) = 0.5*((u_inlet+BT_OBC%ubt_outer(I,j)) + &
(BT_OBC%Cg_u(I,j)/H_u) * (BT_OBC%eta_outer_u(I,j)-h_in))

vel_trans = (1.0-bebt)*vel_prev + bebt*ubt(I,j)
elseif (BT_OBC%OBC_kind_u(I,j) == OBC_FLATHER_N) then
if ((vbt(i,J-1)+vbt(i+1,J-1)) > 0.0) then
ubt(I,j) = 2.0*ubt(I,j-1)-ubt(I,j-2)
else
ubt(I,j) = BT_OBC%ubt_outer(I,j)
endif
vel_trans = ubt(I,j)
elseif (BT_OBC%OBC_kind_u(I,j) == OBC_FLATHER_S) then
if ((vbt(i,J)+vbt(i+1,J)) > 0.0) then
ubt(I,j) = 2.0*ubt(I,j+1)-ubt(I,j+2)
else
ubt(I,j) = BT_OBC%ubt_outer(I,j)
elseif (BT_OBC%OBC_kind_u(I,j) == OBC_FLATHER) then
if (BT_OBC%OBC_direction_u(I,j) == OBC_DIRECTION_E) then
cfl = dtbt * BT_OBC%Cg_u(I,j) * G%IdxCu(I,j) ! CFL
u_inlet = cfl*ubt_old(I-1,j) + (1.0-cfl)*ubt_old(I,j) ! Valid for cfl<1
! h_in = 2.0*cfl*eta(i,j) + (1.0-2.0*cfl)*eta(i+1,j) ! external
h_in = eta(i,j) + (0.5-cfl)*(eta(i,j)-eta(i-1,j)) ! internal

H_u = BT_OBC%H_u(I,j)
vel_prev = ubt(I,j)
ubt(I,j) = 0.5*((u_inlet + BT_OBC%ubt_outer(I,j)) + &
(BT_OBC%Cg_u(I,j)/H_u) * (h_in-BT_OBC%eta_outer_u(I,j)))

vel_trans = (1.0-bebt)*vel_prev + bebt*ubt(I,j)
elseif (BT_OBC%OBC_direction_u(I,j) == OBC_DIRECTION_W) then
cfl = dtbt * BT_OBC%Cg_u(I,j) * G%IdxCu(I,j) ! CFL
u_inlet = cfl*ubt_old(I+1,j) + (1.0-cfl)*ubt_old(I,j) ! Valid for cfl<1
! h_in = 2.0*cfl*eta(i+1,j) + (1.0-2.0*cfl)*eta(i,j) ! external
h_in = eta(i+1,j) + (0.5-cfl)*(eta(i+1,j)-eta(i+2,j)) ! internal

H_u = BT_OBC%H_u(I,j)
vel_prev = ubt(I,j)
ubt(I,j) = 0.5*((u_inlet+BT_OBC%ubt_outer(I,j)) + &
(BT_OBC%Cg_u(I,j)/H_u) * (BT_OBC%eta_outer_u(I,j)-h_in))

vel_trans = (1.0-bebt)*vel_prev + bebt*ubt(I,j)
elseif (BT_OBC%OBC_direction_u(I,j) == OBC_DIRECTION_N) then
if ((vbt(i,J-1)+vbt(i+1,J-1)) > 0.0) then
ubt(I,j) = 2.0*ubt(I,j-1)-ubt(I,j-2)
else
ubt(I,j) = BT_OBC%ubt_outer(I,j)
endif
vel_trans = ubt(I,j)
elseif (BT_OBC%OBC_direction_u(I,j) == OBC_DIRECTION_S) then
if ((vbt(i,J)+vbt(i+1,J)) > 0.0) then
ubt(I,j) = 2.0*ubt(I,j+1)-ubt(I,j+2)
else
ubt(I,j) = BT_OBC%ubt_outer(I,j)
endif
vel_trans = ubt(I,j)
endif
vel_trans = ubt(I,j)
endif

if (BT_OBC%OBC_kind_u(I,j) /= OBC_SIMPLE) then
Expand All @@ -2436,52 +2440,54 @@ subroutine apply_velocity_OBCs(OBC, ubt, vbt, uhbt, vhbt, ubt_trans, vbt_trans,
vhbt(i,J) = BT_OBC%vhbt(i,J)
vbt(i,J) = BT_OBC%vbt_outer(i,J)
vel_trans = vbt(i,J)
elseif (BT_OBC%OBC_kind_v(i,J) == OBC_FLATHER_N) then
cfl = dtbt * BT_OBC%Cg_v(i,J) * G%IdyCv(I,j) ! CFL
v_inlet = cfl*vbt_old(i,J-1) + (1.0-cfl)*vbt_old(i,J) ! Valid for cfl<1
! h_in = 2.0*cfl*eta(i,j) + (1.0-2.0*cfl)*eta(i,j+1) ! external
h_in = eta(i,j) + (0.5-cfl)*(eta(i,j)-eta(i,j-1)) ! internal

H_v = BT_OBC%H_v(i,J)
vel_prev = vbt(i,J)
vbt(i,J) = 0.5*((v_inlet+BT_OBC%vbt_outer(i,J)) + &
(BT_OBC%Cg_v(i,J)/H_v) * (h_in-BT_OBC%eta_outer_v(i,J)))

vel_trans = (1.0-bebt)*vel_prev + bebt*vbt(i,J)
elseif (BT_OBC%OBC_kind_v(i,J) == OBC_FLATHER_S) then
cfl = dtbt * BT_OBC%Cg_v(i,J) * G%IdyCv(I,j) ! CFL
v_inlet = cfl*vbt_old(i,J+1) + (1.0-cfl)*vbt_old(i,J) ! Valid for cfl <1
! h_in = 2.0*cfl*eta(i,j+1) + (1.0-2.0*cfl)*eta(i,j) ! external
h_in = eta(i,j+1) + (0.5-cfl)*(eta(i,j+1)-eta(i,j+2)) ! internal

H_v = BT_OBC%H_v(i,J)
vel_prev = vbt(i,J)
vbt(i,J) = 0.5*((v_inlet+BT_OBC%vbt_outer(i,J)) + &
(BT_OBC%Cg_v(i,J)/H_v) * (BT_OBC%eta_outer_v(i,J)-h_in))

vel_trans = (1.0-bebt)*vel_prev + bebt*vbt(i,J)
elseif (BT_OBC%OBC_kind_v(i,J) == OBC_FLATHER_E) then
if ((ubt(I-1,j)+ubt(I-1,j+1)) > 0.0) then
vbt(i,J) = 2.0*vbt(i-1,J)-vbt(i-2,J)
else
vbt(i,J) = BT_OBC%vbt_outer(i,J)
endif
vel_trans = vbt(i,J)
elseif (BT_OBC%OBC_kind_v(i,J) == OBC_FLATHER) then
if (BT_OBC%OBC_direction_v(i,J) == OBC_DIRECTION_N) then
cfl = dtbt * BT_OBC%Cg_v(i,J) * G%IdyCv(I,j) ! CFL
v_inlet = cfl*vbt_old(i,J-1) + (1.0-cfl)*vbt_old(i,J) ! Valid for cfl<1
! h_in = 2.0*cfl*eta(i,j) + (1.0-2.0*cfl)*eta(i,j+1) ! external
h_in = eta(i,j) + (0.5-cfl)*(eta(i,j)-eta(i,j-1)) ! internal

H_v = BT_OBC%H_v(i,J)
vel_prev = vbt(i,J)
vbt(i,J) = 0.5*((v_inlet+BT_OBC%vbt_outer(i,J)) + &
(BT_OBC%Cg_v(i,J)/H_v) * (h_in-BT_OBC%eta_outer_v(i,J)))

vel_trans = (1.0-bebt)*vel_prev + bebt*vbt(i,J)
elseif (BT_OBC%OBC_direction_v(i,J) == OBC_DIRECTION_S) then
cfl = dtbt * BT_OBC%Cg_v(i,J) * G%IdyCv(I,j) ! CFL
v_inlet = cfl*vbt_old(i,J+1) + (1.0-cfl)*vbt_old(i,J) ! Valid for cfl <1
! h_in = 2.0*cfl*eta(i,j+1) + (1.0-2.0*cfl)*eta(i,j) ! external
h_in = eta(i,j+1) + (0.5-cfl)*(eta(i,j+1)-eta(i,j+2)) ! internal

H_v = BT_OBC%H_v(i,J)
vel_prev = vbt(i,J)
vbt(i,J) = 0.5*((v_inlet+BT_OBC%vbt_outer(i,J)) + &
(BT_OBC%Cg_v(i,J)/H_v) * (BT_OBC%eta_outer_v(i,J)-h_in))

vel_trans = (1.0-bebt)*vel_prev + bebt*vbt(i,J)
elseif (BT_OBC%OBC_direction_v(i,J) == OBC_DIRECTION_E) then
if ((ubt(I-1,j)+ubt(I-1,j+1)) > 0.0) then
vbt(i,J) = 2.0*vbt(i-1,J)-vbt(i-2,J)
else
vbt(i,J) = BT_OBC%vbt_outer(i,J)
endif
vel_trans = vbt(i,J)
!!!!!!!!!!!!!!!!!!! CLAMPED !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! cfl = dtbt * BT_OBC%Cg_v(i,J) * G%IdyCv(i,J) !
! vbt(i,J) = (vbt(i-1,J) + CFL*vbt(i,J)) / (1.0 + CFL) !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
elseif (BT_OBC%OBC_kind_v(i,J) == OBC_FLATHER_W) then
if ((ubt(I,j)+ubt(I,j+1)) < 0.0) then
vbt(i,J) = 2.0*vbt(i+1,J)-vbt(i+2,J)
else
vbt(i,J) = BT_OBC%vbt_outer(i,J)
endif
vel_trans = vbt(i,J)
elseif (BT_OBC%OBC_direction_v(i,J) == OBC_DIRECTION_W) then
if ((ubt(I,j)+ubt(I,j+1)) < 0.0) then
vbt(i,J) = 2.0*vbt(i+1,J)-vbt(i+2,J)
else
vbt(i,J) = BT_OBC%vbt_outer(i,J)
endif
vel_trans = vbt(i,J)
!!!!!!!!!!!!!!!!!! CLAMPED !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! cfl = dtbt * BT_OBC%Cg_v(i,J) * G%IdyCv(i,J) !
! vbt(i,J) = (vbt(i-1,J) + CFL*vbt(i,J)) / (1.0 + CFL) !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
endif
endif

if (BT_OBC%OBC_kind_v(i,J) /= OBC_SIMPLE) then
Expand Down Expand Up @@ -2532,8 +2538,8 @@ subroutine apply_eta_OBCs(OBC, eta, ubt, vbt, BT_OBC, G, MS, halo, dtbt)

if ((OBC%apply_OBC_u_flather_east .or. OBC%apply_OBC_u_flather_west) .and. &
associated(BT_OBC%OBC_mask_u)) then
do j=js,je ; do I=is-1,ie ; if (BT_OBC%OBC_mask_u(I,j)) then
if (BT_OBC%OBC_kind_u(I,j) == OBC_FLATHER_E) then
do j=js,je ; do I=is-1,ie ; if (BT_OBC%OBC_kind_u(I,j) == OBC_FLATHER) then
if (BT_OBC%OBC_direction_u(I,j) == OBC_DIRECTION_E) then
cfl = dtbt * BT_OBC%Cg_u(I,j) * G%IdxCu(I,j) ! CFL
u_inlet = cfl*ubt(I-1,j) + (1.0-cfl)*ubt(I,j) ! Valid for cfl <1
! h_in = 2.0*cfl*eta(i,j) + (1.0-2.0*cfl)*eta(i+1,j) ! external
Expand All @@ -2542,7 +2548,7 @@ subroutine apply_eta_OBCs(OBC, eta, ubt, vbt, BT_OBC, G, MS, halo, dtbt)
H_u = BT_OBC%H_u(I,j)
eta(i+1,j) = 2.0 * 0.5*((BT_OBC%eta_outer_u(I,j)+h_in) + &
(H_u/BT_OBC%Cg_u(I,j))*(u_inlet-BT_OBC%ubt_outer(I,j))) - eta(i,j)
elseif (BT_OBC%OBC_kind_u(I,j) == OBC_FLATHER_W) then
elseif (BT_OBC%OBC_direction_u(I,j) == OBC_DIRECTION_W) then
cfl = dtbt*BT_OBC%Cg_u(I,j)*G%IdxCu(I,j) ! CFL
u_inlet = cfl*ubt(I+1,j) + (1.0-cfl)*ubt(I,j) ! Valid for cfl <1
! h_in = 2.0*cfl*eta(i+1,j) + (1.0-2.0*cfl)*eta(i,j) ! external
Expand All @@ -2557,8 +2563,8 @@ subroutine apply_eta_OBCs(OBC, eta, ubt, vbt, BT_OBC, G, MS, halo, dtbt)

if ((OBC%apply_OBC_v_flather_north .or. OBC%apply_OBC_v_flather_south) .and. &
associated(BT_OBC%OBC_mask_v)) then
do J=js-1,je ; do i=is,ie ; if (BT_OBC%OBC_mask_v(i,J)) then
if (BT_OBC%OBC_kind_v(i,J) == OBC_FLATHER_N) then
do J=js-1,je ; do i=is,ie ; if (BT_OBC%OBC_kind_v(i,J) == OBC_FLATHER) then
if (BT_OBC%OBC_direction_v(i,J) == OBC_DIRECTION_N) then
cfl = dtbt*BT_OBC%Cg_v(i,J)*G%IdyCv(i,J) ! CFL
v_inlet = cfl*vbt(i,J-1) + (1.0-cfl)*vbt(i,J) ! Valid for cfl <1
! h_in = 2.0*cfl*eta(i,j) + (1.0-2.0*cfl)*eta(i,j+1) ! external
Expand All @@ -2567,7 +2573,7 @@ subroutine apply_eta_OBCs(OBC, eta, ubt, vbt, BT_OBC, G, MS, halo, dtbt)
H_v = BT_OBC%H_v(i,J)
eta(i,j+1) = 2.0 * 0.5*((BT_OBC%eta_outer_v(i,J)+h_in) + &
(H_v/BT_OBC%Cg_v(i,J))*(v_inlet-BT_OBC%vbt_outer(i,J))) - eta(i,j)
elseif (BT_OBC%OBC_kind_v(i,J) == OBC_FLATHER_S) then
elseif (BT_OBC%OBC_direction_v(i,J) == OBC_DIRECTION_S) then
cfl = dtbt*BT_OBC%Cg_v(i,J)*G%IdyCv(i,J) ! CFL
v_inlet = cfl*vbt(i,J+1) + (1.0-cfl)*vbt(i,J) ! Valid for cfl <1
! h_in = 2.0*cfl*eta(i,j+1) + (1.0-2.0*cfl)*eta(i,j) ! external
Expand Down Expand Up @@ -2635,6 +2641,7 @@ subroutine set_up_BT_OBC(OBC, eta, BT_OBC, G, GV, MS, halo, use_BT_cont, Datu, D
allocate(BT_OBC%eta_outer_u(isdw-1:iedw,jsdw:jedw)) ; BT_OBC%eta_outer_u(:,:) = 0.0
allocate(BT_OBC%OBC_mask_u(isdw-1:iedw,jsdw:jedw)) ; BT_OBC%OBC_mask_u(:,:)=.false.
allocate(BT_OBC%OBC_kind_u(isdw-1:iedw,jsdw:jedw)) ; BT_OBC%OBC_kind_u(:,:)=OBC_NONE
allocate(BT_OBC%OBC_direction_u(isdw-1:iedw,jsdw:jedw)); BT_OBC%OBC_direction_u(:,:)=OBC_NONE

allocate(BT_OBC%Cg_v(isdw:iedw,jsdw-1:jedw)) ; BT_OBC%Cg_v(:,:) = 0.0
allocate(BT_OBC%H_v(isdw:iedw,jsdw-1:jedw)) ; BT_OBC%H_v(:,:) = 0.0
Expand All @@ -2643,11 +2650,13 @@ subroutine set_up_BT_OBC(OBC, eta, BT_OBC, G, GV, MS, halo, use_BT_cont, Datu, D
allocate(BT_OBC%eta_outer_v(isdw:iedw,jsdw-1:jedw)) ; BT_OBC%eta_outer_v(:,:)=0.0
allocate(BT_OBC%OBC_mask_v(isdw:iedw,jsdw-1:jedw)) ; BT_OBC%OBC_mask_v(:,:)=.false.
allocate(BT_OBC%OBC_kind_v(isdw-1:iedw,jsdw:jedw)) ; BT_OBC%OBC_kind_v(:,:)=OBC_NONE
allocate(BT_OBC%OBC_direction_v(isdw-1:iedw,jsdw:jedw)); BT_OBC%OBC_direction_v(:,:)=OBC_NONE

if (associated(OBC%OBC_mask_u)) then
do j=js-1,je+1 ; do I=is-1,ie
BT_OBC%OBC_mask_u(I,j) = OBC%OBC_mask_u(I,j)
BT_OBC%OBC_kind_u(I,j) = OBC%OBC_kind_u(I,j)
BT_OBC%OBC_direction_u(I,j) = OBC%OBC_direction_u(I,j)
enddo ; enddo
if (OBC%apply_OBC_u) then
do k=1,nz ; do j=js,je ; do I=is-1,ie
Expand Down Expand Up @@ -2683,6 +2692,7 @@ subroutine set_up_BT_OBC(OBC, eta, BT_OBC, G, GV, MS, halo, use_BT_cont, Datu, D
do J=js-1,je ; do i=is-1,ie+1
BT_OBC%OBC_mask_v(i,J) = OBC%OBC_mask_v(i,J)
BT_OBC%OBC_kind_v(i,J) = OBC%OBC_kind_v(i,J)
BT_OBC%OBC_direction_v(i,J) = OBC%OBC_direction_v(i,J)
enddo ; enddo
if (OBC%apply_OBC_v) then
do k=1,nz ; do J=js-1,je ; do i=is,ie
Expand Down Expand Up @@ -2732,6 +2742,7 @@ subroutine destroy_BT_OBC(BT_OBC)

if (associated(BT_OBC%OBC_mask_u)) deallocate(BT_OBC%OBC_mask_u)
if (associated(BT_OBC%OBC_kind_u)) deallocate(BT_OBC%OBC_kind_u)
if (associated(BT_OBC%OBC_direction_u)) deallocate(BT_OBC%OBC_direction_u)
deallocate(BT_OBC%Cg_u)
deallocate(BT_OBC%H_u)
deallocate(BT_OBC%uhbt)
Expand All @@ -2740,6 +2751,7 @@ subroutine destroy_BT_OBC(BT_OBC)

if (associated(BT_OBC%OBC_mask_v)) deallocate(BT_OBC%OBC_mask_v)
if (associated(BT_OBC%OBC_kind_v)) deallocate(BT_OBC%OBC_kind_v)
if (associated(BT_OBC%OBC_direction_v)) deallocate(BT_OBC%OBC_direction_v)
deallocate(BT_OBC%Cg_v)
deallocate(BT_OBC%H_v)
deallocate(BT_OBC%vhbt)
Expand Down
7 changes: 4 additions & 3 deletions src/core/MOM_continuity.F90
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ module MOM_continuity
use MOM_file_parser, only : get_param, log_version, param_file_type
use MOM_string_functions, only : uppercase
use MOM_grid, only : ocean_grid_type
use MOM_variables, only : ocean_OBC_type, BT_cont_type
use MOM_open_boundary, only : ocean_OBC_type
use MOM_variables, only : BT_cont_type
use MOM_verticalGrid, only : verticalGrid_type

implicit none ; private
Expand Down Expand Up @@ -78,8 +79,8 @@ subroutine continuity(u, v, hin, h, uh, vh, dt, G, GV, CS, uhbt, vhbt, OBC, &
uhbt_aux, vhbt_aux, u_cor_aux, v_cor_aux, BT_cont)
type(ocean_grid_type), intent(inout) :: G
type(verticalGrid_type), intent(in) :: GV
real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), intent(in) :: u
real, dimension(SZI_(G),SZJB_(G),SZK_(G)), intent(in) :: v
real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), intent(inout) :: u
real, dimension(SZI_(G),SZJB_(G),SZK_(G)), intent(inout) :: v
real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(in) :: hin
real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(inout) :: h
real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), intent(out) :: uh
Expand Down
Loading

0 comments on commit c2799bc

Please sign in to comment.