Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

+Adding a halo update for tracer reservoirs. #1159

Merged
merged 1 commit into from
Jul 22, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/core/MOM_open_boundary.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1590,7 +1590,7 @@ subroutine open_boundary_init(G, GV, US, param_file, OBC, restart_CSp)
! Local variables
real :: vel2_rescale ! A rescaling factor for squared velocities from the representation in
! a restart file to the internal representation in this run.
integer :: i, j, k, isd, ied, jsd, jed, nz
integer :: i, j, k, isd, ied, jsd, jed, nz, m
integer :: IsdB, IedB, JsdB, JedB
isd = G%isd ; ied = G%ied ; jsd = G%jsd ; jed = G%jed ; nz = GV%ke
IsdB = G%IsdB ; IedB = G%IedB ; JsdB = G%JsdB ; JedB = G%JedB
Expand All @@ -1603,6 +1603,11 @@ subroutine open_boundary_init(G, GV, US, param_file, OBC, restart_CSp)
if (OBC%oblique_BCs_exist_globally) call pass_vector(OBC%rx_oblique, OBC%ry_oblique, G%Domain, &
To_All+Scalar_Pair)
if (associated(OBC%cff_normal)) call pass_var(OBC%cff_normal, G%Domain, position=CORNER)
if (associated(OBC%tres_x) .or. associated(OBC%tres_y)) then
do m=1,OBC%ntr
call pass_vector(OBC%tres_x(:,:,:,m), OBC%tres_y(:,:,:,m), G%Domain, To_All+Scalar_Pair)
enddo
endif

! The rx_normal and ry_normal arrays used with radiation OBCs are currently in units of grid
! points per timestep, but if this were to be corrected to [L T-1 ~> m s-1] or [T-1 ~> s-1] to
Expand Down Expand Up @@ -4711,7 +4716,8 @@ subroutine open_boundary_register_restarts(HI, GV, OBC, Reg, param_file, restart
endif

! Still painfully inefficient, now in four dimensions.
if (any(OBC%tracer_x_reservoirs_used)) then
! Allocating both for now so that the pass_vector works.
if (any(OBC%tracer_x_reservoirs_used) .or. any(OBC%tracer_y_reservoirs_used)) then
allocate(OBC%tres_x(HI%isdB:HI%iedB,HI%jsd:HI%jed,GV%ke,OBC%ntr))
OBC%tres_x(:,:,:,:) = 0.0
do m=1,OBC%ntr
Expand All @@ -4727,8 +4733,8 @@ subroutine open_boundary_register_restarts(HI, GV, OBC, Reg, param_file, restart
endif
endif
enddo
endif
if (any(OBC%tracer_y_reservoirs_used)) then
! endif
! if (any(OBC%tracer_y_reservoirs_used)) then
allocate(OBC%tres_y(HI%isd:HI%ied,HI%jsdB:HI%jedB,GV%ke,OBC%ntr))
OBC%tres_y(:,:,:,:) = 0.0
do m=1,OBC%ntr
Expand Down