Skip to content

Commit

Permalink
(*)Fix Kd_interface diag in newer diabatic_ALE
Browse files Browse the repository at this point in the history
  Corrected the field being posted for the Kd_interface diagnostic inside of
diabatic_ALE() to be the minimum of Kd_heat and Kd_salt, which includes the
contributions from ePBL, but excluding any extra double-diffusive mixing, making
it analogous to the diagnostic that is currently being posted from
layered_diabatic() or diabatic_ALE_legacy().  Diabatic_ALE() is used when
USE_REGRIDDING=True and USE_LEGACY_DIABATIC_DRIVER=False, in which case a
diagnostic will change, correcting the issue noted at
NOAA-GFDL/issues/398.  All solutions are bitwise identical.
  • Loading branch information
Hallberg-NOAA committed May 16, 2024
1 parent 6272bbc commit ed6d7eb
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/parameterizations/vertical/MOM_diabatic_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1266,9 +1266,6 @@ subroutine diabatic_ALE(u, v, h, tv, Hml, fluxes, visc, ADp, CDp, dt, Time_end,
call hchksum(Kd_heat, "after set_diffusivity Kd_heat", G%HI, haloshift=0, scale=GV%HZ_T_to_m2_s)
endif

! Store the diagnosed typical diffusivity at interfaces.
if (CS%id_Kd_int > 0) call post_data(CS%id_Kd_int, Kd_heat, CS%diag)

! Set diffusivities for heat and salt separately, and possibly change the meaning of Kd_heat.
if (CS%double_diffuse) then
! Add contributions from double diffusion
Expand Down Expand Up @@ -1542,6 +1539,14 @@ subroutine diabatic_ALE(u, v, h, tv, Hml, fluxes, visc, ADp, CDp, dt, Time_end,
if (CS%id_Kd_heat > 0) call post_data(CS%id_Kd_heat, Kd_heat, CS%diag)
if (CS%id_Kd_salt > 0) call post_data(CS%id_Kd_salt, Kd_salt, CS%diag)
if (CS%id_Kd_ePBL > 0) call post_data(CS%id_Kd_ePBL, Kd_ePBL, CS%diag)
if (CS%id_Kd_int > 0) then
if (CS%double_diffuse .or. CS%useKPP) then
do K=1,nz ; do j=js,je ; do i=is,ie
Kd_heat(i,j,k) = min(Kd_heat(i,j,k), Kd_salt(i,j,k))
enddo ; enddo ; enddo
endif
call post_data(CS%id_Kd_int, Kd_heat, CS%diag)
endif

if (CS%id_ea_t > 0) call post_data(CS%id_ea_t, ent_t(:,:,1:nz), CS%diag)
if (CS%id_eb_t > 0) call post_data(CS%id_eb_t, ent_t(:,:,2:nz+1), CS%diag)
Expand Down Expand Up @@ -3297,8 +3302,8 @@ subroutine diabatic_driver_init(Time, G, GV, US, param_file, useALEalgorithm, di
CS%id_Kd_int = register_diag_field('ocean_model', 'Kd_interface', diag%axesTi, Time, &
'Total diapycnal diffusivity at interfaces', 'm2 s-1', conversion=GV%HZ_T_to_m2_s)
if (CS%use_energetic_PBL) then
CS%id_Kd_ePBL = register_diag_field('ocean_model', 'Kd_ePBL', diag%axesTi, Time, &
'ePBL diapycnal diffusivity at interfaces', 'm2 s-1', conversion=GV%HZ_T_to_m2_s)
CS%id_Kd_ePBL = register_diag_field('ocean_model', 'Kd_ePBL', diag%axesTi, Time, &
'ePBL diapycnal diffusivity at interfaces', 'm2 s-1', conversion=GV%HZ_T_to_m2_s)
endif

CS%id_Kd_heat = register_diag_field('ocean_model', 'Kd_heat', diag%axesTi, Time, &
Expand Down

0 comments on commit ed6d7eb

Please sign in to comment.