Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

* Fix for spatially varying Bodner fields. #711

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -1064,8 +1064,8 @@ 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_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
psi_mag = ( ( ( (0.5*(CS%Cr_space(i,j) + CS%Cr_space(i+1,j))) * grid_dsd ) & ! L2 H T-1 ~> m3 s-1 or kg s-1
* ( absf * h_sml ) ) * ( ( 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
endif
Expand Down Expand Up @@ -1105,8 +1105,8 @@ 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_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
psi_mag = ( ( ( (0.5*(CS%Cr_space(i,j) + CS%Cr_space(i,j+1))) * grid_dsd ) & ! L2 H T-1 ~> m3 s-1 or kg s-1
* ( absf * h_sml ) ) * ( ( 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
endif
Expand Down Expand Up @@ -1670,6 +1670,7 @@ logical function mixedlayer_restrat_init(Time, G, GV, US, param_file, diag, CS,
filename = trim(inputdir) // "/" // trim(filename)
allocate(CS%MLD_Tfilt_space(G%isd:G%ied,G%jsd:G%jed), source=0.0)
call MOM_read_data(filename, varname, CS%MLD_Tfilt_space, G%domain, scale=US%s_to_T)
call pass_var(CS%MLD_Tfilt_space, G%domain)
endif
allocate(CS%Cr_space(G%isd:G%ied,G%jsd:G%jed), source=CS%Cr)
if (CS%Cr_grid) then
Expand All @@ -1681,6 +1682,7 @@ logical function mixedlayer_restrat_init(Time, G, GV, US, param_file, diag, CS,
default="Cr")
filename = trim(inputdir) // "/" // trim(filename)
call MOM_read_data(filename, varname, CS%Cr_space, G%domain)
call pass_var(CS%Cr_space, G%domain)
endif
call closeParameterBlock(param_file) ! The remaining parameters do not have MLE% prepended
call get_param(param_file, mdl, "MLE_USE_PBL_MLD", CS%MLE_use_PBL_MLD, &
Expand Down
Loading