diff --git a/src/tracer/MOM_lateral_boundary_mixing.F90 b/src/tracer/MOM_lateral_boundary_mixing.F90 index d915b06e30..f7ec2ad09d 100644 --- a/src/tracer/MOM_lateral_boundary_mixing.F90 +++ b/src/tracer/MOM_lateral_boundary_mixing.F90 @@ -133,9 +133,11 @@ subroutine lateral_boundary_mixing(G, GV, US, h, Coef_x, Coef_y, dt, Reg, CS) real, dimension(SZI_(G),SZJ_(G),SZK_(G),2) :: ppoly0_E !< Edge values from reconstructions real, dimension(SZK_(G),CS%deg+1) :: ppoly_S !< Slopes from reconstruction (placeholder) real, dimension(SZIB_(G),SZJ_(G),SZK_(G)) :: uFlx ! Zonal flux of tracer [H conc ~> m conc or conc kg m-2] - real, dimension(SZI_(G),SZJ_(G)) :: uFLx_bulk ! Total calculated bulk-layer u-flux for the tracer + real, dimension(SZIB_(G),SZJ_(G)) :: uFLx_bulk ! Total calculated bulk-layer u-flux for the tracer real, dimension(SZI_(G),SZJB_(G),SZK_(G)) :: vFlx ! Meridional flux of tracer real, dimension(SZI_(G),SZJB_(G)) :: vFlx_bulk ! Total calculated bulk-layer v-flux for the tracer + real, dimension(SZIB_(G),SZJ_(G)) :: uwork_2d ! Layer summed u-flux transport + real, dimension(SZI_(G),SZJB_(G)) :: vwork_2d ! Layer summed v-flux transport type(tracer_type), pointer :: Tracer => NULL() ! Pointer to the current tracer integer :: remap_method !< Reconstruction method integer :: i,j,k,m @@ -215,7 +217,21 @@ subroutine lateral_boundary_mixing(G, GV, US, h, Coef_x, Coef_y, dt, Reg, CS) ! Post the tracer diagnostics 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_dfx_2d>0) then + uwork_2d(:,:) = 0. + do k=1,GV%ke; do j=G%jsc,G%jec; do I=G%isc-1,G%iec + uwork_2d(I,j) = uwork_2d(I,j) + uFlx(I,j,k) + enddo; enddo; enddo + endif + call post_data(tracer%id_lbm_dfx_2d, uwork_2d, CS%diag) + if (tracer%id_lbm_dfy_2d>0) then + vwork_2d(:,:) = 0. + do k=1,GV%ke; do J=G%jsc-1,G%jec; do i=G%isc,G%iec + vwork_2d(i,J) = vwork_2d(i,J) + vFlx(i,J,k) + enddo; enddo; enddo + endif + call post_data(tracer%id_lbm_dfy_2d, vwork_2d, CS%diag) enddo end subroutine lateral_boundary_mixing diff --git a/src/tracer/MOM_tracer_registry.F90 b/src/tracer/MOM_tracer_registry.F90 index fc16c7cc18..9ccd5f887a 100644 --- a/src/tracer/MOM_tracer_registry.F90 +++ b/src/tracer/MOM_tracer_registry.F90 @@ -60,6 +60,10 @@ module MOM_tracer_registry !! [conc H m2 s-1 ~> conc m3 s-1 or conc kg s-1] real, dimension(:,:,:), pointer :: lbm_df_y => NULL() !< diagnostic array for y-diffusive tracer flux !! [conc H m2 s-1 ~> conc m3 s-1 or conc kg s-1] + real, dimension(:,:), pointer :: lbm_df_x_2d => NULL() !< diagnostic array for x-diffusive tracer flux + !! [conc H m2 s-1 ~> conc m3 s-1 or conc kg s-1] + real, dimension(:,:), pointer :: lbm_df_y_2d => NULL() !< diagnostic array for y-diffusive tracer flux + !! [conc H m2 s-1 ~> conc m3 s-1 or conc kg s-1] real, dimension(:,:), pointer :: lbm_bulk_df_x => NULL() !< diagnostic array for x-diffusive tracer flux !! [conc H m2 s-1 ~> conc m3 s-1 or conc kg s-1] real, dimension(:,:), pointer :: lbm_bulk_df_y => NULL() !< diagnostic array for y-diffusive tracer flux @@ -118,6 +122,7 @@ module MOM_tracer_registry integer :: id_tr = -1 integer :: id_adx = -1, id_ady = -1, id_dfx = -1, id_dfy = -1 integer :: id_lbm_bulk_dfx = -1, id_lbm_bulk_dfy = -1, id_lbm_dfx = -1, id_lbm_dfy = -1 + integer :: id_lbm_dfx_2d, id_lbm_dfy_2d integer :: id_adx_2d = -1, id_ady_2d = -1, id_dfx_2d = -1, id_dfy_2d = -1 integer :: id_adv_xy = -1, id_adv_xy_2d = -1 integer :: id_dfxy_cont = -1, id_dfxy_cont_2d = -1, id_dfxy_conc = -1 @@ -415,6 +420,14 @@ subroutine register_tracer_diagnostics(Reg, h, Time, diag, G, GV, use_ALE) Tr%id_lbm_dfy = register_diag_field("ocean_model", trim(shortnm)//"_lbm_dfy", & diag%axesCvL, Time, trim(flux_longname)//" diffusive meridional flux from the near-boundary mixing scheme" , & trim(flux_units), v_extensive = .true., x_cell_method = 'sum') + Tr%id_lbm_dfx_2d = register_diag_field("ocean_model", trim(shortnm)//"_lbm_dfx_2d", & + diag%axesCu1, Time, trim(flux_longname)//& + " diffusive zonal flux from the near-boundary mixing scheme vertically integrated" , & + trim(flux_units), v_extensive = .true., y_cell_method = 'sum') + Tr%id_lbm_dfy_2d = register_diag_field("ocean_model", trim(shortnm)//"_lbm_dfy_2d", & + diag%axesCv1, Time, trim(flux_longname)//& + " diffusive meridional flux from the near-boundary mixing scheme vertically integrated" , & + trim(flux_units), v_extensive = .true., x_cell_method = 'sum') else Tr%id_adx = register_diag_field("ocean_model", trim(shortnm)//"_adx", & diag%axesCuL, Time, "Advective (by residual mean) Zonal Flux of "//trim(flux_longname), & @@ -434,6 +447,12 @@ subroutine register_tracer_diagnostics(Reg, h, Time, diag, G, GV, use_ALE) Tr%id_lbm_dfy = register_diag_field("ocean_model", trim(shortnm)//"_lbm_diffy", & diag%axesCvL, Time, "Boundary Diffusive Meridional Flux of "//trim(flux_longname), & flux_units, v_extensive=.true., conversion=Tr%flux_scale, x_cell_method = 'sum') + Tr%id_lbm_dfx_2d = register_diag_field("ocean_model", trim(shortnm)//"_lbm_diffx_2d", & + diag%axesCu1, Time, "Vertically integrated Boundary Diffusive Zonal Flux of "//trim(flux_longname), & + flux_units, v_extensive=.true., conversion=Tr%flux_scale, y_cell_method = 'sum') + Tr%id_lbm_dfy_2d = register_diag_field("ocean_model", trim(shortnm)//"_lbm_diffy_2d", & + diag%axesCv1, Time, "Vertically integrated Boundary Diffusive Meridional Flux of "//trim(flux_longname), & + flux_units, v_extensive=.true., conversion=Tr%flux_scale, x_cell_method = 'sum') endif if (Tr%id_adx > 0) call safe_alloc_ptr(Tr%ad_x,IsdB,IedB,jsd,jed,nz) if (Tr%id_ady > 0) call safe_alloc_ptr(Tr%ad_y,isd,ied,JsdB,JedB,nz) @@ -441,6 +460,8 @@ subroutine register_tracer_diagnostics(Reg, h, Time, diag, G, GV, use_ALE) if (Tr%id_dfy > 0) call safe_alloc_ptr(Tr%df_y,isd,ied,JsdB,JedB,nz) if (Tr%id_lbm_dfx > 0) call safe_alloc_ptr(Tr%lbm_df_x,IsdB,IedB,jsd,jed,nz) if (Tr%id_lbm_dfy > 0) call safe_alloc_ptr(Tr%lbm_df_y,isd,ied,JsdB,JedB,nz) + if (Tr%id_lbm_dfx_2d > 0) call safe_alloc_ptr(Tr%lbm_df_x_2d,IsdB,IedB,jsd,jed) + if (Tr%id_lbm_dfy_2d > 0) call safe_alloc_ptr(Tr%lbm_df_y_2d,isd,ied,JsdB,JedB) Tr%id_adx_2d = register_diag_field("ocean_model", trim(shortnm)//"_adx_2d", & diag%axesCu1, Time, &