diff --git a/src/core_ocean/Registry.xml b/src/core_ocean/Registry.xml
index be834b1c05..6452774af4 100644
--- a/src/core_ocean/Registry.xml
+++ b/src/core_ocean/Registry.xml
@@ -650,10 +650,6 @@
description="Integer value defining the water type used in Jerlov short wave absorption."
possible_values="Integer values between 1 and 5"
/>
-
abs(config_surface_buoyancy_depth)) exit
- enddo
-
- if(k == maxLevelCell(iCell) .or. k == 1) then
- depLev=2
- else
- depLev=k
- endif
- penetrativeTemperatureFluxOBL(iCell)=penetrativeTemperatureFlux(iCell)*weights(depLev)
+ call ocn_get_jerlov_fraction(boundaryLayerDepth(iCell), weightOSBL)
+ penetrativeTemperatureFluxOBL(iCell)=penetrativeTemperatureFlux(iCell)*weightOSBL
end do
#ifndef CPRPGI
diff --git a/src/core_ocean/shared/mpas_ocn_tracer_short_wave_absorption_variable.F b/src/core_ocean/shared/mpas_ocn_tracer_short_wave_absorption_variable.F
index 096f1b7f8a..3454b04d49 100644
--- a/src/core_ocean/shared/mpas_ocn_tracer_short_wave_absorption_variable.F
+++ b/src/core_ocean/shared/mpas_ocn_tracer_short_wave_absorption_variable.F
@@ -71,8 +71,9 @@ module ocn_tracer_short_wave_absorption_variable
!
!-----------------------------------------------------------------------
- subroutine ocn_tracer_short_wave_absorption_variable_tend(meshPool, swForcingPool, forcingPool, index_temperature, & !{{{
- layerThickness, penetrativeTemperatureFlux, penetrativeTemperatureFluxOBL, tend, err)
+ subroutine ocn_tracer_short_wave_absorption_variable_tend(meshPool, diagnosticsPool, swForcingPool, forcingPool, &!{{{
+ index_temperature, layerThickness, penetrativeTemperatureFlux, penetrativeTemperatureFluxOBL, tend, &
+ err)
!-----------------------------------------------------------------
!
@@ -84,7 +85,8 @@ subroutine ocn_tracer_short_wave_absorption_variable_tend(meshPool, swForcingPoo
type (mpas_pool_type), intent(in) :: &
meshPool, & !< Input: mesh information
swForcingPool, & !< Input: chlorophyll, cloud, zenith data
- forcingPool
+ forcingPool, &
+ diagnosticsPool
real (kind=RKIND), dimension(:), intent(in) :: &
penetrativeTemperatureFlux !< Input: penetrative temperature flux through the surface
@@ -119,14 +121,14 @@ subroutine ocn_tracer_short_wave_absorption_variable_tend(meshPool, swForcingPoo
!
!-----------------------------------------------------------------
- integer :: iCell, k, depLev, nCells
+ integer :: iCell, k, nCells
integer, pointer :: nVertLevels
integer, dimension(:), pointer :: nCellsArray
integer, dimension(:), pointer :: maxLevelCell
- real (kind=RKIND) :: depth
- real (kind=RKIND), dimension(:), pointer :: refBottomDepth
+ real (kind=RKIND) :: weightOSBL, depth
+ real (kind=RKIND), dimension(:), pointer :: boundaryLayerDepth, refBottomDepth
real (kind=RKIND), dimension(:), allocatable :: weights
real (kind=RKIND), dimension(:), pointer :: chlorophyllA, zenithAngle, clearSkyRadiation
real (kind=RKIND), dimension(4) :: Avals, Kvals
@@ -139,6 +141,7 @@ subroutine ocn_tracer_short_wave_absorption_variable_tend(meshPool, swForcingPoo
call mpas_pool_get_array(meshPool, 'maxLevelCell', maxLevelCell)
call mpas_pool_get_array(meshPool, 'refBottomDepth', refBottomDepth)
+ call mpas_pool_get_array(diagnosticsPool, 'boundaryLayerDepth', boundaryLayerDepth)
allocate(weights(nVertLevels+1))
weights = 0.0_RKIND
@@ -154,7 +157,7 @@ subroutine ocn_tracer_short_wave_absorption_variable_tend(meshPool, swForcingPoo
nCells = nCellsArray( 3 )
!$omp parallel
- !$omp do schedule(runtime) private(depth, cloudRatio, k, depLev, Avals, Kvals, weights)
+ !$omp do schedule(runtime) private(depth, cloudRatio, k, weightOSBL, Avals, Kvals, weights)
do iCell = 1, nCells
depth = 0.0_RKIND
cloudRatio = min(1.0_RKIND, 1.0_RKIND - penetrativeTemperatureFlux(iCell)/(hflux_factor*(1.0E-15_RKIND + &
@@ -171,18 +174,8 @@ subroutine ocn_tracer_short_wave_absorption_variable_tend(meshPool, swForcingPoo
* (weights(k) - weights(k+1) )
end do
- depth = 0.0_RKIND
- do k=1,maxLevelCell(iCell)
- depth = depth + layerThickness(k,iCell)
- if(depth > abs(config_surface_buoyancy_depth)) exit
- enddo
-
- if(k == maxLevelCell(iCell) .or. k == 1) then
- depLev=2
- else
- depLev=k
- endif
- penetrativeTemperatureFluxOBL(iCell)=penetrativeTemperatureFlux(iCell)*weights(depLev)
+ call ocn_get_variable_sw_fraction(boundaryLayerDepth(iCell), weightOSBL, Avals, Kvals)
+ penetrativeTemperatureFluxOBL(iCell)=penetrativeTemperatureFlux(iCell)*weightOSBL
end do
!$omp end do
diff --git a/src/core_ocean/shared/mpas_ocn_vmix_cvmix.F b/src/core_ocean/shared/mpas_ocn_vmix_cvmix.F
index 29a0dca807..4495b8f0f5 100644
--- a/src/core_ocean/shared/mpas_ocn_vmix_cvmix.F
+++ b/src/core_ocean/shared/mpas_ocn_vmix_cvmix.F
@@ -674,23 +674,10 @@ subroutine ocn_vmix_coefs_cvmix_build(meshPool, statePool, forcingPool, diagnost
! intent out of BoundaryLayerDepth is boundary layer depth measured in meters and vertical index
indexBoundaryLayerDepth(iCell) = cvmix_variables % kOBL_depth
-
-
- if(config_cvmix_kpp_matching .eq. 'SimpleShapes') then
- do k = 1, int(indexBoundaryLayerDepth(iCell))
- vertViscTopOfCell(k,iCell) = vertViscTopOfCell(k,iCell) + cvmix_variables % Mdiff_iface(k)
- vertDiffTopOfCell(k,iCell) = vertDiffTopOfCell(k,iCell) + cvmix_variables % Tdiff_iface(k)
- end do
- do k = int(indexBoundaryLayerDepth(iCell))+1, maxLevelCell(iCell)+1
- vertViscTopOfCell(k,iCell) = cvmix_variables % Mdiff_iface(k)
- vertDiffTopOfCell(k,iCell) = cvmix_variables % Tdiff_iface(k)
- enddo
- else
- do k = 1, maxLevelCell(iCell) + 1
- vertViscTopOfCell(k, iCell) = cvmix_variables % Mdiff_iface(k)
- vertDiffTopOfCell(k, iCell) = cvmix_variables % Tdiff_iface(k)
- end do
- endif
+ do k = 1, maxLevelCell(iCell) + 1
+ vertViscTopOfCell(k, iCell) = cvmix_variables % Mdiff_iface(k)
+ vertDiffTopOfCell(k, iCell) = cvmix_variables % Tdiff_iface(k)
+ end do
! store non-local flux terms
! these flux terms must be multiplied by the surfaceTracerFlux field