Skip to content

Commit

Permalink
Bodner diag: Fix ustar and dims
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
marshallward committed Feb 9, 2024
1 parent ebeb562 commit 63136f1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/parameterizations/lateral/MOM_mixed_layer_restrat.F90
Original file line number Diff line number Diff line change
Expand Up @@ -979,16 +979,18 @@ 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)) &
+ (G%CoriolisBu(I-1,J) + G%CoriolisBu(I,J-1))))**2, &
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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 63136f1

Please sign in to comment.