Skip to content

Commit

Permalink
Demonstrate piecemeal diagnostic posting in ePBL
Browse files Browse the repository at this point in the history
ePBL calculates the vertical diffusivity column by column. This
provides a convenient sanity check of the new piecemeal posting
of diagnostics. The original diagnostic Kd_ePBL is done by posting
the full 3d prognostic array, whereas a new diagnostic
Kd_ePBL_col_by_col posts the same array from within ePBL but does
so column by column.
  • Loading branch information
ashao committed Jan 19, 2025
1 parent 192dc0c commit 8e8fe04
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/parameterizations/vertical/MOM_energetic_PBL.F90
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module MOM_energetic_PBL
use MOM_coms, only : EFP_type, real_to_EFP, EFP_to_real, operator(+), assignment(=), EFP_sum_across_PEs
use MOM_debugging, only : hchksum
use MOM_diag_mediator, only : post_data, register_diag_field, safe_alloc_alloc
use MOM_diag_mediator, only : post_data_3d_by_column, post_data_3d_final
use MOM_diag_mediator, only : time_type, diag_ctrl
use MOM_domains, only : create_group_pass, do_group_pass, group_pass_type
use MOM_error_handler, only : MOM_error, FATAL, WARNING, MOM_mesg
Expand Down Expand Up @@ -227,6 +228,7 @@ module MOM_energetic_PBL
type(EFP_type), dimension(2) :: sum_its_BBL !< The total number of iterations and columns worked on

!>@{ Diagnostic IDs
integer :: id_Kd_ePBL_col_by_col = -1
integer :: id_ML_depth = -1, id_hML_depth = -1, id_TKE_wind = -1, id_TKE_mixing = -1
integer :: id_TKE_MKE = -1, id_TKE_conv = -1, id_TKE_forcing = -1
integer :: id_TKE_mech_decay = -1, id_TKE_conv_decay = -1
Expand Down Expand Up @@ -649,6 +651,7 @@ subroutine energetic_PBL(h_3d, u_3d, v_3d, tv, fluxes, visc, dt, Kd_int, G, GV,
u_star, u_star_mean, mech_TKE, dt, MLD_io, Kd, mixvel, mixlen, GV, &
US, CS, eCD, Waves, G, i, j)
endif
call post_data_3d_by_column(CS%id_Kd_ePBL_col_by_col, Kd, CS%diag, i, j)

! Add the diffusivity due to bottom boundary layer mixing, if there is energy to drive this mixing.
if (CS%ePBL_BBL_effic > 0.0) then
Expand Down Expand Up @@ -758,6 +761,7 @@ subroutine energetic_PBL(h_3d, u_3d, v_3d, tv, fluxes, visc, dt, Kd_int, G, GV,
do K=1,nz+1 ; do i=is,ie ; Kd_int(i,j,K) = Kd_2d(i,K) ; enddo ; enddo

enddo ! j-loop
call post_data_3d_final(CS%id_Kd_ePBL_col_by_col, CS%diag)

if (CS%debug .and. (CS%ePBL_BBL_effic > 0.0)) then
call hchksum(visc%TKE_BBL, "ePBL visc%TKE_BBL", G%HI, unscale=GV%H_to_MKS*US%Z_to_m**2*US%s_to_T**3)
Expand Down Expand Up @@ -3855,6 +3859,8 @@ subroutine energetic_PBL_init(Time, G, GV, US, param_file, diag, CS)


!/ Checking output flags
CS%id_Kd_ePBL_col_by_col = register_diag_field('ocean_model', 'Kd_ePBL_col_by_col', diag%axesTi, Time, &
'ePBL diapycnal diffusivity at interfaces posted column by column', 'm2 s-1', conversion=GV%HZ_T_to_m2_s)
CS%id_ML_depth = register_diag_field('ocean_model', 'ePBL_h_ML', diag%axesT1, &
Time, 'Surface boundary layer depth', units='m', conversion=US%Z_to_m, &
cmor_long_name='Ocean Mixed Layer Thickness Defined by Mixing Scheme')
Expand Down

0 comments on commit 8e8fe04

Please sign in to comment.