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

Two small fixes for FPMix #321

Merged
merged 2 commits into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion pkg/CVMix-src
9 changes: 8 additions & 1 deletion src/parameterizations/vertical/MOM_CVMix_KPP.F90
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ module MOM_CVMix_KPP
logical :: LT_K_Enhancement !< Flags if enhancing mixing coefficients due to LT
integer :: LT_K_Shape !< Integer for constant or shape function enhancement
integer :: LT_K_Method !< Integer for mixing coefficients LT method
real :: KPP_CVt2 !< Parameter for Stokes MOST convection entrainment
real :: KPP_K_ENH_FAC !< Factor to multiply by K if Method is CONSTANT [nondim]
logical :: LT_Vt2_Enhancement !< Flags if enhancing Vt2 due to LT
integer :: LT_VT2_METHOD !< Integer for Vt2 LT method
Expand Down Expand Up @@ -436,6 +437,9 @@ logical function KPP_init(paramFile, G, GV, US, diag, Time, CS, passive)
case default ; call MOM_error(FATAL,"KPP_init: "//&
"Unrecognized KPP_LT_K_SHAPE option: "//trim(string))
end select
call get_param(paramFile, mdl, "KPP_CVt2", CS%KPP_CVt2, &
'Parameter for Stokes MOST convection entrainment', &
units="nondim", default=1.6)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is in an if (CS%LT_K_Enhancement) then and it shouldn't be; I'm a little surprised this is passing the test suite because I don't think CS%KPP_CVt2 is initialized before being passed to cvmix_init_kpp(). I didn't run a gnu debug test, which might catch it?

I'm testing a fix (moving these lines out of the if block), then I'll mark this ready to review again.

call get_param(paramFile, mdl, "KPP_LT_K_METHOD", string , &
'Method to enhance mixing coefficient in KPP. '// &
'Valid options are: \n'// &
Expand Down Expand Up @@ -529,6 +533,7 @@ logical function KPP_init(paramFile, G, GV, US, diag, Time, CS, passive)
minVtsqr=US%L_T_to_m_s**2*CS%minVtsqr, &
vonKarman=CS%vonKarman, &
surf_layer_ext=CS%surf_layer_ext, &
CVt2=CS%KPP_CVt2, &
interp_type=CS%interpType, &
interp_type2=CS%interpType2, &
lEkman=CS%computeEkman, &
Expand Down Expand Up @@ -1162,8 +1167,10 @@ subroutine KPP_compute_BLD(CS, G, GV, US, h, Temp, Salt, u, v, tv, uStar, buoyFl
enddo

if (CS%StokesMOST) then
! if k=1, want buoyFlux(i,j,1) - buoyFlux(i,j,2), otherwise
! subtract average of buoyFlux(i,j,k) and buoyFlux(i,j,k+1)
surfBuoyFlux = buoy_scale * &
(buoyFlux(i,j,1) - 0.5*(buoyFlux(i,j,k)+buoyFlux(i,j,k+1)) )
(buoyFlux(i,j,1) - 0.5*(buoyFlux(i,j,max(2,k))+buoyFlux(i,j,k+1)) )
surfBuoyFlux2(k) = surfBuoyFlux
call Compute_StokesDrift(i,j, iFaceHeight(k),iFaceHeight(k+1), &
uS_Hi(k+1), vS_Hi(k+1), uS_H(k), vS_H(k), uSbar_H(k), vSbar_H(k), Waves)
Expand Down
Loading