From 63136f1d9cfb4d3af14ec39bdca72768768b3b31 Mon Sep 17 00:00:00 2001 From: Marshall Ward Date: Fri, 9 Feb 2024 12:20:56 -0500 Subject: [PATCH] Bodner diag: Fix ustar and dims Fix two issues which emerged from the Bodner length scale diagnostic after the cuberoot ANSWER_DATE was introduced. The split of the loop due to the cuberoot caused ustar to be assigned in a separate loop, leaving it uninitialized for the length scale diagnostics loop. It also had its dimensions removed. However, the whole point of the new cuberoot() function was to preserve its dimensions, so there was no need for the intermediate dimensional manipulation, and all dimensionality should be shifted to the registration. This patch removes the intermediate dimensions and also explicitly defines it as L2/Z rather than L. Having said all that... I am uncertain about the dimensions here. Ustar is tagged as H/T in some places and Z/T in others. I think this needs to be reviewed. --- .../lateral/MOM_mixed_layer_restrat.F90 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/parameterizations/lateral/MOM_mixed_layer_restrat.F90 b/src/parameterizations/lateral/MOM_mixed_layer_restrat.F90 index e83262a63e..e4c889d41c 100644 --- a/src/parameterizations/lateral/MOM_mixed_layer_restrat.F90 +++ b/src/parameterizations/lateral/MOM_mixed_layer_restrat.F90 @@ -979,6 +979,9 @@ subroutine mixedlayer_restrat_Bodner(CS, G, GV, US, h, uhtr, vhtr, tv, forces, d if (CS%id_lfbod > 0) then ! Calculate front length used in B22 formula (eq 24). + w_star3 = max(0., -bflux(i,j)) * BLD(i,j) + u_star3 = U_star_2d(i,j)**3 + ! Include an absurdly_small_freq2 to prevent division by zero. f2_h = max( & (0.25*((G%CoriolisBu(I,J) + G%CoriolisBu(I-1,J-1)) & @@ -986,9 +989,8 @@ subroutine mixedlayer_restrat_Bodner(CS, G, GV, US, h, uhtr, vhtr, tv, forces, d absurdly_small_freq2) lf_bodner_diag(i,j) = & - 0.25 * (cuberoot(CS%mstar * u_star3 + CS%nstar * w_star3)**2 & - * (US%m_to_L * GV%m_to_H * US%T_to_s**2) & - ) / (f2_h * max(little_h(i,j), GV%Angstrom_H)) + 0.25 * cuberoot(CS%mstar * u_star3 + CS%nstar * w_star3)**2 & + / (f2_h * max(little_h(i,j), GV%Angstrom_H)) endif enddo ; enddo @@ -1809,7 +1811,7 @@ logical function mixedlayer_restrat_init(Time, G, GV, US, param_file, diag, CS, 'm2 s-3', conversion=(US%Z_to_m**2*US%s_to_T**3)) CS%id_lfbod = register_diag_field('ocean_model', 'lf_bodner', diag%axesT1, Time, & 'Front length in Bodner mixed layer restratificiation parameterization', & - 'm', conversion=(US%L_to_m)) + 'm', conversion=(US%L_to_m**2)*US%m_to_Z) endif ! If MLD_filtered is being used, we need to update halo regions after a restart