Skip to content

Commit

Permalink
Fix dimensional scaling and use Adcroft reciprocal
Browse files Browse the repository at this point in the history
* mle_fl_2d is [L ~> m]; added scale=US%m_to_L in the
time_interp_external call;

* Use Adcroft reciprocal to compute I_LFront.
  • Loading branch information
gustavo-marques committed Jan 15, 2025
1 parent 755bd87 commit fc0d031
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions src/parameterizations/lateral/MOM_mixed_layer_restrat.F90
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ subroutine mixedlayer_restrat_OM4(h, uhtr, vhtr, tv, forces, dt, h_MLD, VarMix,
Rml_av_fast, & ! Negative g_Rho0 times the average mixed layer density or G_Earth
! times the average specific volume [L2 H-1 T-2 ~> m s-2 or m4 kg-1 s-2]
MLD_slow, & ! Mixed layer depth actually used in MLE restratification parameterization [H ~> m or kg m-2]
mle_fl_2d, & ! MLE frontal length-scale [H ~> m or kg m-2]
mle_fl_2d, & ! MLE frontal length-scale [L ~> m]
htot_slow, & ! The sum of the thicknesses of layers in the mixed layer [H ~> m or kg m-2]
Rml_av_slow ! Negative g_Rho0 times the average mixed layer density or G_Earth
! times the average specific volume [L2 H-1 T-2 ~> m s-2 or m4 kg-1 s-2]
Expand Down Expand Up @@ -359,7 +359,7 @@ subroutine mixedlayer_restrat_OM4(h, uhtr, vhtr, tv, forces, dt, h_MLD, VarMix,
enddo ; enddo
elseif (CS%front_length == 0. .and. CS%fl_from_file) then
res_upscale = .true.
call time_interp_external(CS%sbc_fl, CS%Time, mle_fl_2d, turns=G%HI%turns)
call time_interp_external(CS%sbc_fl, CS%Time, mle_fl_2d, turns=G%HI%turns, scale=US%m_to_L)
call pass_var(mle_fl_2d, G%domain, halo=1)
do j=js,je ; do i=is,ie
if ((G%mask2dT(i,j) > 0.0) .and. (mle_fl_2d(i,j) < 0.0)) then
Expand Down Expand Up @@ -490,11 +490,8 @@ subroutine mixedlayer_restrat_OM4(h, uhtr, vhtr, tv, forces, dt, h_MLD, VarMix,
absf = 0.5*(abs(G%CoriolisBu(I,J-1)) + abs(G%CoriolisBu(I,J)))
! Compute I_LFront = 1 / (frontal length scale) [m-1]
lfront = 0.5 * (mle_fl_2d(i,j) + mle_fl_2d(i+1,j))
if (lfront > 0.) then
I_LFront = 1./lfront
else
I_LFront = 0.0
endif
! Adcroft reciprocal
I_LFront = 0.0 ; if (lfront /= 0.0) I_LFront = 1.0/lfront
! If needed, res_scaling_fac = min( ds, L_d ) / l_f
if (res_upscale) res_scaling_fac = &
( sqrt( 0.5 * ( (G%dxCu(I,j)**2) + (G%dyCu(I,j)**2) ) ) * I_LFront ) &
Expand Down Expand Up @@ -582,11 +579,8 @@ subroutine mixedlayer_restrat_OM4(h, uhtr, vhtr, tv, forces, dt, h_MLD, VarMix,
u_star = max(CS%ustar_min, 0.5*(U_star_2d(i,j) + U_star_2d(i,j+1)))
! Compute I_LFront = 1 / (frontal length scale) [m-1]
lfront = 0.5 * (mle_fl_2d(i,j) + mle_fl_2d(i,j+1))
if (lfront > 0.) then
I_LFront = 1./lfront
else
I_LFront = 0.0
endif
! Adcroft reciprocal
I_LFront = 0.0 ; if (lfront /= 0.0) I_LFront = 1.0/lfront
absf = 0.5*(abs(G%CoriolisBu(I-1,J)) + abs(G%CoriolisBu(I,J)))
! If needed, res_scaling_fac = min( ds, L_d ) / l_f
if (res_upscale) res_scaling_fac = &
Expand Down Expand Up @@ -1646,7 +1640,7 @@ logical function mixedlayer_restrat_init(Time, G, GV, US, param_file, diag, CS,

# include "version_variable.h"
integer :: i, j
character(len=200) :: filename, inputdir, varname
character(len=200) :: filename, varname

! Read all relevant parameters and write them to the model log.
call get_param(param_file, mdl, "MIXEDLAYER_RESTRAT", mixedlayer_restrat_init, &
Expand Down

0 comments on commit fc0d031

Please sign in to comment.