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

limit Visbeck eddy length to dcEdge (AMOC PR 4/6) #4868

Merged
merged 2 commits into from
Apr 14, 2022
Merged
Show file tree
Hide file tree
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
6 changes: 0 additions & 6 deletions components/mpas-ocean/src/Registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2696,12 +2696,6 @@
<var name="betaEdge" type="real" dimensions="nEdges Time" units="m^{-1} s^{-1}"
description="meridional gradient of the coriolis parameter"
/>
<var name="eddyLength" type="real" dimensions="nEdges Time" units="m"
description="eddy length scale in Visbeck 1997 closure"
/>
<var name="eddyTime" type="real" dimensions="nEdges Time" units="s^{-1}"
description="inverse eddy time scale in Visbeck 1997 closure"
/>
<var name="gmKappaScaling" type="real" dimensions="nVertLevelsP1 nEdges Time" units="NA" default_value="1.0"
description="spatially and depth varying GM kappa. The scaling is based on the Brunt Vaisala Frequency relative to a maximum value below the mixed layer, follows from Danabasoglu and Marshall 2007. If config_GM_closure is not set to N2_dependent the scaling value is set to 1 everywhere."
packages="gm"
Expand Down
10 changes: 0 additions & 10 deletions components/mpas-ocean/src/shared/mpas_ocn_diagnostics_variables.F
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,6 @@ module ocn_diagnostics_variables

real (kind=RKIND), pointer :: globalVerticalStretchMax, globalVerticalStretchMin
real (kind=RKIND), dimension(:), pointer :: betaEdge
real (kind=RKIND), dimension(:), pointer :: eddyLength
real (kind=RKIND), dimension(:), pointer :: eddyTime
real (kind=RKIND), dimension(:), pointer :: gmResolutionTaper

! Semi-implicit Array Pointers
Expand Down Expand Up @@ -572,8 +570,6 @@ subroutine ocn_diagnostics_variables_init(domain, jenkinsOn, hollandJenkinsOn, e
call mpas_pool_get_array(diagnosticsPool, 'barotropicCoriolisTerm', &
barotropicCoriolisTerm)
call mpas_pool_get_array(diagnosticsPool, 'betaEdge', betaEdge)
call mpas_pool_get_array(diagnosticsPool, 'eddyLength', eddyLength)
call mpas_pool_get_array(diagnosticsPool, 'eddyTime', eddyTime)
call mpas_pool_get_array(diagnosticsPool, &
'bottomLayerShortwaveTemperatureFlux', &
bottomLayerShortwaveTemperatureFlux)
Expand Down Expand Up @@ -807,9 +803,7 @@ subroutine ocn_diagnostics_variables_init(domain, jenkinsOn, hollandJenkinsOn, e
!$acc indMLD, &
!$acc density, &
!$acc betaEdge, &
!$acc eddyTime, &
!$acc pressure, &
!$acc eddyLength, &
!$acc thermExpCoeff, &
!$acc sfcFlxAttCoeff, &
!$acc surfacePressure, &
Expand Down Expand Up @@ -1045,9 +1039,7 @@ subroutine ocn_diagnostics_variables_destroy(err) !{{{
!$acc indMLD, &
!$acc density, &
!$acc betaEdge, &
!$acc eddyTime, &
!$acc pressure, &
!$acc eddyLength, &
!$acc thermExpCoeff, &
!$acc sfcFlxAttCoeff, &
!$acc surfacePressure, &
Expand Down Expand Up @@ -1232,9 +1224,7 @@ subroutine ocn_diagnostics_variables_destroy(err) !{{{
indMLD, &
density, &
betaEdge, &
eddyTime, &
pressure, &
eddyLength, &
thermExpCoeff, &
sfcFlxAttCoeff, &
surfacePressure, &
Expand Down
12 changes: 7 additions & 5 deletions components/mpas-ocean/src/shared/mpas_ocn_gm.F
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ subroutine ocn_GM_compute_Bolus_velocity(statePool, &
real(kind=RKIND) :: slopeTaperUp, slopeTaperDown, sfcTaperUp, sfcTaperDown, invAreaCell
real(kind=RKIND) :: lt1, lt2
real(kind=RKIND) :: sigma, Lr, Length, L_rhines, shearEdgeInv
real (kind=RKIND) :: eddyLength, eddyTime
real(kind=RKIND), dimension(:), allocatable :: dzTop, dTdzTop, dSdzTop, k33Norm
real(kind=RKIND) :: c_Visbeck ! baroclinic wave speed from Visbeck parameterization
! Dimensions
Expand Down Expand Up @@ -581,7 +582,8 @@ subroutine ocn_GM_compute_Bolus_velocity(statePool, &
call mpas_pool_get_array(meshPool, 'fEdge', fEdge)
!$omp parallel
!$omp do schedule(runtime) private(k, cell1, cell2, sumN2, ltSum, sumRi, countN2, &
!$omp zEdge, RiTopOfEdge, BruntVaisalaFreqTopEdge, lt1, lt2, c_Visbeck)
!$omp zEdge, RiTopOfEdge, BruntVaisalaFreqTopEdge, lt1, lt2, c_Visbeck, &
!$omp eddyLength, eddyTime)
do iEdge = 1, nEdges
k=minLevelEdgeBot(iEdge)
sumN2 = 0.0_RKIND
Expand Down Expand Up @@ -611,11 +613,11 @@ subroutine ocn_GM_compute_Bolus_velocity(statePool, &
c_Visbeck = sqrt(sumN2*ltsum)
sumRi = sumRi / (ltsum + 1.0E-11_RKIND)

eddyLength(iEdge) = min(c_Visbeck/(1.0E-15_RKIND + abs(fEdge(iEdge))), &
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vanroekel this array was created in the original Visbeck addition. Both eddyLength and eddyTime are used only in these three lines within the iEdge loop, so these arrays could both easily be replaced by scalars. The only reason to keep them is for writing them out. Do you have a preference if these are arrays or scalars?

Copy link
Contributor

Choose a reason for hiding this comment

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

@mark-petersen no real preference on scalar v array. I had them as arrays for diagnostics but I don't think we need them for the duration.

sqrt(c_Visbeck/ (2.0_RKIND*betaEdge(iEdge))))
eddyTime(iEdge) = 1.0_RKIND / (max(abs(fEdge(iEdge)), sqrt(2.0_RKIND*c_Visbeck*betaEdge(iEdge))) / &
eddyLength = max(dcEdge(iEdge), min(c_Visbeck/(1.0E-15_RKIND + abs(fEdge(iEdge))), &
sqrt(c_Visbeck/ (2.0_RKIND*betaEdge(iEdge)))))
eddyTime = 1.0_RKIND / (max(abs(fEdge(iEdge)), sqrt(2.0_RKIND*c_Visbeck*betaEdge(iEdge))) / &
(1.0E-11_RKIND + sqrt(sumRi)))
gmBolusKappa(iEdge) = config_GM_Visbeck_alpha * eddyLength(iEdge)**2.0_RKIND / (1.0E-15 + eddyTime(iEdge))
gmBolusKappa(iEdge) = config_GM_Visbeck_alpha * eddyLength**2.0_RKIND / (1.0E-15 + eddyTime)
gmBolusKappa(iEdge) = max(config_GM_spatially_variable_min_kappa, min(gmBolusKappa(iEdge), &
config_GM_spatially_variable_max_kappa))
else !for really shallow columns use min bolus kappa
Expand Down