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

Stokes MOST modifications to unresolved shear #306

Merged
Merged
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
39 changes: 20 additions & 19 deletions src/parameterizations/vertical/MOM_CVMix_KPP.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1028,6 +1028,7 @@ subroutine KPP_compute_BLD(CS, G, GV, US, h, Temp, Salt, u, v, tv, uStar, buoyFl
real :: hcorr ! A cumulative correction arising from inflation of vanished layers [Z ~> m]

! For Langmuir Calculations
real :: Vt_layer ! non-dimensional extent contribution to unresolved shear
real :: LangEnhVt2 ! Langmuir enhancement for unresolved shear [nondim]
real, dimension(GV%ke) :: U_H, V_H ! Velocities at tracer points [L T-1 ~> m s-1]
real :: MLD_guess ! A guess at the mixed layer depth for calculating the Langmuir number [Z ~> m]
Expand Down Expand Up @@ -1092,13 +1093,9 @@ subroutine KPP_compute_BLD(CS, G, GV, US, h, Temp, Salt, u, v, tv, uStar, buoyFl
do k=1,GV%ke
U_H(k) = 0.5 * (u(I,j,k)+u(I-1,j,k))
V_H(k) = 0.5 * (v(i,J,k)+v(i,J-1,k))
Copy link
Member

Choose a reason for hiding this comment

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

For multiple tests including SMS.TL319_t232.G1850MARBL_JRA and other, I get the following error:

dec1095.hsn.de.hpc.ucar.edu 2093: forrtl: severe (174): SIGSEGV, segmentation fault occurred
dec1095.hsn.de.hpc.ucar.edu 2093: Image              PC                Routine            Line        Source             
dec1095.hsn.de.hpc.ucar.edu 2093: libpthread-2.31.s  0000147407AC08C0  Unknown               Unknown  Unknown
dec1095.hsn.de.hpc.ucar.edu 2093: cesm.exe           0000000001683D0D  mom_cvmix_kpp_mp_        1095  MOM_CVMix_KPP.F90
dec1095.hsn.de.hpc.ucar.edu 2093: cesm.exe           0000000000D8BF79  mom_diabatic_driv        1326  MOM_diabatic_driver.F90
dec1095.hsn.de.hpc.ucar.edu 2093: cesm.exe           0000000000D7F76E  mom_diabatic_driv         395  MOM_diabatic_driver.F90
dec1095.hsn.de.hpc.ucar.edu 2093: cesm.exe           0000000000C66171  mom_mp_step_mom_t        1608  MOM.F90
dec1095.hsn.de.hpc.ucar.edu 2093: cesm.exe           0000000000C5A936  mom_mp_step_mom_          956  MOM.F90
dec1095.hsn.de.hpc.ucar.edu 2093: cesm.exe           0000000000C21689  mom_ocean_model_n         638  mom_ocean_model_nuopc.F90
dec1095.hsn.de.hpc.ucar.edu 2093: cesm.exe           0000000000BDC250  mom_cap_mod_mp_mo        1845  mom_cap.F90

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We need to evaluate this in conjunction with CVMix/CVMix-src#97
I apologize for missing this detail in the original description.

Copy link
Member

Choose a reason for hiding this comment

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

Then we need to update the CVMix submodule with this PR. When you do a git status, I believe you'll have something like:

    modified:   pkg/CVMix-src (new commits)

If so, can you do:

git add pkg/CVMix-src
git commit -m "update CVMix submodule"
git push

Note that this will not only modify CVMix but also change the CVMix remote from mom-ocean organization to CVMix organization, because I think the mom-ocean fork doesn't have those changes yet. Before submitting a MOM6 candidate PR to mom-ocean, we'll need to push these CVMix changes to the CVMix mom-ocean fork, I think. Comments, @mnlevy1981?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I've opened mom-ocean/CVMix-src#1 to get these changes to mom-ocean/CVMix-src; I don't know if we can update dev/ncar before that PR is taken care of, because the git add pkg/CVMix-src will tell git modules to look for commit mom-ocean/CVMix-src@5e3d0ce and I don't know if having the open PR is sufficient for finding that external.

uE_H(k) = 0.5 * (u(I,j,k)+u(I-1,j,k)-Waves%US_x(I,j,k)-Waves%US_x(I-1,j,k))
vE_H(k) = 0.5 * (v(i,J,k)+v(i,J-1,k)-Waves%US_y(i,J,k)-Waves%US_y(i,J-1,k))
enddo
if (CS%StokesMOST) then
do k=1,GV%ke
uE_H(k) = 0.5 * (u(I,j,k)+u(I-1,j,k)-Waves%US_x(I,j,k)-Waves%US_x(I-1,j,k))
vE_H(k) = 0.5 * (v(i,J,k)+v(i,J-1,k)-Waves%US_y(i,J,k)-Waves%US_y(i,J-1,k))
enddo
endif

! things independent of position within the column
Coriolis = 0.25*US%s_to_T*( (G%CoriolisBu(i,j) + G%CoriolisBu(i-1,j-1)) + &
Expand Down Expand Up @@ -1149,7 +1146,7 @@ subroutine KPP_compute_BLD(CS, G, GV, US, h, Temp, Salt, u, v, tv, uStar, buoyFl
surfFricVel,waves%omega_w2x(i,j), uE_H, vE_H, uS_Hi, vS_Hi, uSbar_H, vSbar_H, uS_SLD,&
vS_SLD, uSbar_SLD, vSbar_SLD, StokesXI, CVMix_kpp_params_user=CS%KPP_params )
StokesXI_1d(k) = StokesXI
StokesVt_1d(k) = StokesXI
StokesVt_1d(k) = 0.0 ! StokesXI

! average temperature, salinity, u and v over surface layer starting at ksfc
delH = SLdepth_0d + iFaceHeight(ksfc-1)
Expand All @@ -1175,6 +1172,8 @@ subroutine KPP_compute_BLD(CS, G, GV, US, h, Temp, Salt, u, v, tv, uStar, buoyFl
Vk = vE_H(k) + vS_H(k) - surfV

else !not StokesMOST
uS_H(k) = 0.5*(Waves%US_x(i,j,ktmp)+Waves%US_x(i-1,j,ktmp))
vS_H(k) = 0.5*(Waves%US_y(i,j,ktmp)+Waves%US_y(i,j-1,ktmp))
StokesXI_1d(k) = 0.0

! average temperature, salinity, u and v over surface layer
Expand Down Expand Up @@ -1205,12 +1204,13 @@ subroutine KPP_compute_BLD(CS, G, GV, US, h, Temp, Salt, u, v, tv, uStar, buoyFl
endif

enddo
surfTemp = surfHtemp / hTot
surfSalt = surfHsalt / hTot
surfU = surfHu / hTot
surfV = surfHv / hTot
surfUs = surfHus / hTot
surfVs = surfHvs / hTot
I_hTot = 1./hTot
Copy link
Member

Choose a reason for hiding this comment

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

@gustavo-marques While this is better for performance, it changes answers, soI reverted it in the previous PR. Are we okay with answer changes, or should we revert this again?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, we are okay with answer changes. Thanks!

surfTemp = surfHtemp * I_hTot
surfSalt = surfHsalt * I_hTot
surfU = surfHu * I_hTot
surfV = surfHv * I_hTot
surfUs = surfHus * I_hTot
surfVs = surfHvs * I_hTot

! vertical shear between present layer and surface layer averaged surfU and surfV.
! C-grid average to get Uk and Vk on T-points.
Expand Down Expand Up @@ -1296,12 +1296,13 @@ subroutine KPP_compute_BLD(CS, G, GV, US, h, Temp, Salt, u, v, tv, uStar, buoyFl
z_inter(K) = US%Z_to_m*iFaceHeight(K)
enddo

! turbulent velocity scales w_s and w_m computed at the cell centers.
! Note that if sigma > CS%surf_layer_ext, then CVMix_kpp_compute_turbulent_scales
! computes w_s and w_m velocity scale at sigma=CS%surf_layer_ext. So we only pass
! sigma=CS%surf_layer_ext for this calculation.
! CVMix_kpp_compute_turbulent_scales_1d_OBL computes w_s velocity scale at cell centers for
! CVmix_kpp_compute_bulk_Richardson call to CVmix_kpp_compute_unresolved_shear
! at sigma=Vt_layer (CS%surf_layer_ext or 1.0) for this calculation.
! StokesVt_1d controls Stokes enhancement (= 0 for none)
Vt_layer = 1.0 ! CS%surf_layer_ext
call CVMix_kpp_compute_turbulent_scales( & ! 1d_OBL
CS%surf_layer_ext, & ! (in) Normalized surface layer depth; sigma = CS%surf_layer_ext
Vt_layer, & ! (in) Boundary layer extent contributing to unresolved shear
OBL_depth, & ! (in) OBL depth [m]
surfBuoyFlux2, & ! (in) Buoyancy flux at surface [m2 s-3]
surfFricVel, & ! (in) Turbulent friction velocity at surface [m s-1]
Expand Down Expand Up @@ -1341,7 +1342,7 @@ subroutine KPP_compute_BLD(CS, G, GV, US, h, Temp, Salt, u, v, tv, uStar, buoyFl
N_iface=N_col, & ! Buoyancy frequency [s-1]
EFactor=LangEnhVT2, & ! Langmuir enhancement factor [nondim]
LaSL=CS%La_SL(i,j), & ! surface layer averaged Langmuir number [nondim]
bfsfc=surfBuoyFlux2, & ! surface buoyancy flux [m2 s-3]
bfsfc=surfBuoyFlux2, & ! surface buoyancy flux [m2 s-3]
uStar=surfFricVel, & ! surface friction velocity [m s-1]
CVMix_kpp_params_user=CS%KPP_params ) ! KPP parameters

Expand Down
Loading