Skip to content

Commit

Permalink
Merge branch 'mle_spatial_cr' into esmg_work
Browse files Browse the repository at this point in the history
  • Loading branch information
kshedstrom committed May 24, 2024
2 parents ef86e89 + c368ad2 commit 3dc4a90
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions src/parameterizations/lateral/MOM_mixed_layer_restrat.F90
Original file line number Diff line number Diff line change
Expand Up @@ -935,11 +935,19 @@ subroutine mixedlayer_restrat_Bodner(CS, G, GV, US, h, uhtr, vhtr, tv, forces, d
endif

! Calculate "big H", representative of the mixed layer depth, used in B22 formula (eq 27).
do j=js-1,je+1 ; do i=is-1,ie+1
big_H(i,j) = rmean2ts(little_h(i,j), CS%MLD_filtered_slow(i,j), &
CS%MLD_growing_Tfilt, CS%MLD_decaying_Tfilt, dt)
CS%MLD_filtered_slow(i,j) = big_H(i,j)
enddo ; enddo
if (CS%MLD_grid) then
do j=js-1,je+1 ; do i=is-1,ie+1
big_H(i,j) = rmean2ts(little_h(i,j), CS%MLD_filtered_slow(i,j), &
CS%MLD_growing_Tfilt, CS%MLD_filtered_space(i,j), dt)
CS%MLD_filtered_slow(i,j) = big_H(i,j)
enddo ; enddo
else
do j=js-1,je+1 ; do i=is-1,ie+1
big_H(i,j) = rmean2ts(little_h(i,j), CS%MLD_filtered_slow(i,j), &
CS%MLD_growing_Tfilt, CS%MLD_decaying_Tfilt, dt)
CS%MLD_filtered_slow(i,j) = big_H(i,j)
enddo ; enddo
endif

! Estimate w'u' at h-points, with a floor to avoid division by zero later.
if (allocated(tv%SpV_avg) .and. .not.(GV%Boussinesq .or. GV%semi_Boussinesq)) then
Expand Down Expand Up @@ -1098,7 +1106,7 @@ subroutine mixedlayer_restrat_Bodner(CS, G, GV, US, h, uhtr, vhtr, tv, forces, d
h_big = 0.5*( big_H(i,j) + big_H(i+1,j) ) ! H ~> m or kg m-3
grd_b = ( buoy_av(i+1,j) - buoy_av(i,j) ) * G%IdxCu(I,j) ! L H-1 T-2 ~> s-2 or m3 kg-1 s-2
r_wpup = 2. / ( wpup(i,j) + wpup(i+1,j) ) ! T2 L-1 H-1 ~> s2 m-2 or m s2 kg-1
psi_mag = ( ( ( CS%Cr * grid_dsd ) * ( absf * h_sml ) ) & ! L2 H T-1 ~> m3 s-1 or kg s-1
psi_mag = ( ( ( CS%Cr_space(i,j) * grid_dsd ) * ( absf * h_sml ) ) & ! L2 H T-1 ~> m3 s-1 or kg s-1
* ( ( h_big**2 ) * grd_b ) ) * r_wpup
else ! There is no flux on land and no gradient at open boundary points.
psi_mag = 0.0
Expand Down Expand Up @@ -1139,7 +1147,7 @@ subroutine mixedlayer_restrat_Bodner(CS, G, GV, US, h, uhtr, vhtr, tv, forces, d
h_big = 0.5*( big_H(i,j) + big_H(i,j+1) ) ! H ~> m or kg m-3
grd_b = ( buoy_av(i,j+1) - buoy_av(i,j) ) * G%IdyCv(I,j) ! L H-1 T-2 ~> s-2 or m3 kg-1 s-2
r_wpup = 2. / ( wpup(i,j) + wpup(i,j+1) ) ! T2 L-1 H-1 ~> s2 m-2 or m s2 kg-1
psi_mag = ( ( ( CS%Cr * grid_dsd ) * ( absf * h_sml ) ) & ! L2 H T-1 ~> m3 s-1 or kg s-1
psi_mag = ( ( ( CS%Cr_space(i,j) * grid_dsd ) * ( absf * h_sml ) ) & ! L2 H T-1 ~> m3 s-1 or kg s-1
* ( ( h_big**2 ) * grd_b ) ) * r_wpup
else ! There is no flux on land and no gradient at open boundary points.
psi_mag = 0.0
Expand Down Expand Up @@ -1636,7 +1644,7 @@ logical function mixedlayer_restrat_init(Time, G, GV, US, param_file, diag, CS,
default=.false.)
endif
if (CS%use_Bodner) then
call get_param(param_file, mdl, "CR", CS%CR, &
call get_param(param_file, mdl, "CR", CS%Cr, &
"The efficiency coefficient in eq 27 of Bodner et al., 2023.", &
units="nondim", default=0.0)
call get_param(param_file, mdl, "BODNER_NSTAR", CS%Nstar, &
Expand Down Expand Up @@ -1705,6 +1713,7 @@ logical function mixedlayer_restrat_init(Time, G, GV, US, param_file, diag, CS,
allocate(CS%MLD_filtered_space(G%isd:G%ied,G%jsd:G%jed), source=0.0)
call MOM_read_data(filename, varname, CS%MLD_filtered_space, G%domain, scale=US%s_to_T)
endif
allocate(CS%Cr_space(G%isd:G%ied,G%jsd:G%jed), source=CS%Cr)
if (CS%Cr_grid) then
call get_param(param_file, mdl, "CR_FILE", filename, &
"The path to the file containing the Cr fields.", &
Expand All @@ -1713,7 +1722,6 @@ logical function mixedlayer_restrat_init(Time, G, GV, US, param_file, diag, CS,
"The variable name for Cr field.", &
default="Cr")
filename = trim(inputdir) // "/" // trim(filename)
allocate(CS%Cr_space(G%isd:G%ied,G%jsd:G%jed), source=0.0)
call MOM_read_data(filename, varname, CS%Cr_space, G%domain, scale=US%s_to_T)
endif
call closeParameterBlock(param_file) ! The remaining parameters do not have MLE% prepended
Expand Down

0 comments on commit 3dc4a90

Please sign in to comment.