Skip to content

Commit

Permalink
Update halos for hbl in LBM
Browse files Browse the repository at this point in the history
The get_MLD and get_BLD routines only return boundary layer depths
on the T-grid's computational domain leading to striping when
calculating the LBM fluxes. Adding a halo update for this variable
fixes the problem
  • Loading branch information
Andrew Shao committed Sep 14, 2019
1 parent 915bcb1 commit f6800c2
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/tracer/MOM_lateral_boundary_mixing.F90
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module MOM_lateral_boundary_mixing

use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end
use MOM_cpu_clock, only : CLOCK_MODULE, CLOCK_ROUTINE
use MOM_domains, only : pass_var
use MOM_diag_mediator, only : diag_ctrl, time_type
use MOM_diag_mediator, only : post_data, register_diag_field
use MOM_error_handler, only : MOM_error, FATAL, WARNING, MOM_mesg, is_root_pe
Expand Down Expand Up @@ -142,6 +143,8 @@ subroutine lateral_boundary_mixing(G, GV, US, h, Coef_x, Coef_y, dt, Reg, CS)
if (ASSOCIATED(CS%KPP_CSp)) call KPP_get_BLD(CS%KPP_CSp, hbl, G)
if (ASSOCIATED(CS%energetic_PBL_CSp)) call energetic_PBL_get_MLD(CS%energetic_PBL_CSp, hbl, G, US)

call pass_var(hbl,G%Domain)

do m = 1,Reg%ntr
tracer => Reg%tr(m)
do j = G%jsc-1, G%jec+1
Expand All @@ -154,6 +157,8 @@ subroutine lateral_boundary_mixing(G, GV, US, h, Coef_x, Coef_y, dt, Reg, CS)
! Diffusive fluxes in the i-direction
uFlx(:,:,:) = 0.
vFlx(:,:,:) = 0.
uFlx_bulk(:,:) = 0.
vFlx_bulk(:,:) = 0.
if ( CS%method == 1 ) then
do j=G%jsc,G%jec
do i=G%isc-1,G%iec
Expand Down Expand Up @@ -183,10 +188,10 @@ subroutine lateral_boundary_mixing(G, GV, US, h, Coef_x, Coef_y, dt, Reg, CS)
enddo ; enddo ; enddo

! Post the tracer diagnostics
if (tracer%id_lbm_bulk_dfx>0) call post_data(tracer%id_lbm_bulk_dfx, uFlx_bulk, CS%diag)
if (tracer%id_lbm_bulk_dfy>0) call post_data(tracer%id_lbm_bulk_dfy, vFlx_bulk, CS%diag)
if (tracer%id_lbm_dfx>0) call post_data(tracer%id_lbm_dfx, uFlx, CS%diag)
if (tracer%id_lbm_dfy>0) call post_data(tracer%id_lbm_dfy, vFlx, CS%diag)
if (tracer%id_lbm_bulk_dfx>0) call post_data(tracer%id_lbm_bulk_dfx, uFlx_bulk, CS%diag)
if (tracer%id_lbm_bulk_dfy>0) call post_data(tracer%id_lbm_bulk_dfy, vFlx_bulk, CS%diag)
if (tracer%id_lbm_dfx>0) call post_data(tracer%id_lbm_dfx, uFlx, CS%diag)
if (tracer%id_lbm_dfy>0) call post_data(tracer%id_lbm_dfy, vFlx, CS%diag)

enddo

Expand Down

0 comments on commit f6800c2

Please sign in to comment.