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 bug in stealth feature log-law drag #6056

Merged
merged 1 commit into from
Dec 15, 2023
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
16 changes: 8 additions & 8 deletions components/mpas-ocean/src/shared/mpas_ocn_vmix.F
Original file line number Diff line number Diff line change
Expand Up @@ -1069,13 +1069,6 @@ subroutine ocn_vel_vmix_tend_implicit_spatially_variable_loglaw(forcingPool, dt,
von_karman_sq / &
(log(1.0_RKIND + &
(zMidEdge/bottom_roughness)))**2))
! For some reason we can use k-1 even when N=Nsurf
kineticEnergyTopOfEdge = 0.5_RKIND * (kineticEnergyCell(k,cell1) + kineticEnergyCell(k,cell2) + &
kineticEnergyCell(k-1,cell1) + kineticEnergyCell(k-1,cell2))
vertViscTopOfEdge(k,iEdge) = max(vertViscTopOfEdge(k,iEdge), &
sqrt(CdTemp(k) * kineticEnergyTopOfEdge) * &
von_karman * (zMidEdge + bottom_roughness) &
)
enddo

! one active layer
Expand All @@ -1084,7 +1077,14 @@ subroutine ocn_vel_vmix_tend_implicit_spatially_variable_loglaw(forcingPool, dt,
/ (1.0_RKIND + dt*CdTemp(N) &
* sqrt(kineticEnergyCell(N,cell1) + kineticEnergyCell(N,cell2)) / layerThickEdgeDrag(N,iEdge) )
else

do k = Nsurf+1, N
kineticEnergyTopOfEdge = 0.5_RKIND * (kineticEnergyCell(k,cell1) + kineticEnergyCell(k,cell2) + &
kineticEnergyCell(k-1,cell1) + kineticEnergyCell(k-1,cell2))
vertViscTopOfEdge(k,iEdge) = max(vertViscTopOfEdge(k,iEdge), &
sqrt(CdTemp(k) * kineticEnergyTopOfEdge) * &
von_karman * (zMidEdge + bottom_roughness) &
)
enddo
! tridiagonal matrix algorithm
C(Nsurf) = -2.0_RKIND*dt*vertViscTopOfEdge(Nsurf+1,iEdge) &
/ (layerThickEdgeMean(Nsurf,iEdge) + layerThickEdgeMean(Nsurf+1,iEdge)) &
Expand Down