Skip to content

Commit

Permalink
minLevel* changes to ocn_tracer_short_wave_absorption_variable
Browse files Browse the repository at this point in the history
  • Loading branch information
cbegeman committed Mar 22, 2021
1 parent a806287 commit 9230b88
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ subroutine ocn_tracer_short_wave_absorption_variable_tend(meshPool, swForcingPoo
integer, pointer :: nVertLevels
integer, dimension(:), pointer :: nCellsArray

integer, dimension(:), pointer :: maxLevelCell
integer, dimension(:), pointer :: minLevelCell, maxLevelCell

real (kind=RKIND) :: depth
real (kind=RKIND), dimension(:), pointer :: refBottomDepth
Expand All @@ -141,12 +141,13 @@ subroutine ocn_tracer_short_wave_absorption_variable_tend(meshPool, swForcingPoo
call mpas_pool_get_dimension(meshPool, 'nCellsArray', nCellsArray)
call mpas_pool_get_dimension(meshPool, 'nVertLevels', nVertLevels)

call mpas_pool_get_array(meshPool, 'minLevelCell', minLevelCell)
call mpas_pool_get_array(meshPool, 'maxLevelCell', maxLevelCell)
call mpas_pool_get_array(meshPool, 'refBottomDepth', refBottomDepth)

allocate(weights(nVertLevels+1))
weights = 0.0_RKIND
weights(1) = 1.0_RKIND
weights(minLevelCell(iCell)) = 1.0_RKIND
Avals(:)=0.0_RKIND
Kvals(:)=0.0_RKIND

Expand All @@ -168,7 +169,7 @@ subroutine ocn_tracer_short_wave_absorption_variable_tend(meshPool, swForcingPoo

call ocn_get_os00_coeffs(chlorophyllA(iCell),zenithAngle(iCell),cloudRatio,Avals, Kvals)

do k = 1, maxLevelCell(iCell)
do k = minLevelCell(iCell), maxLevelCell(iCell)
depth = depth + layerThickness(k, iCell)

call ocn_get_variable_sw_fraction(depth, weights(k+1), Avals, Kvals)
Expand All @@ -186,13 +187,13 @@ subroutine ocn_tracer_short_wave_absorption_variable_tend(meshPool, swForcingPoo
end if

depth = 0.0_RKIND
do k=1,maxLevelCell(iCell)
do k=minLevelCell(iCell),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
if(k == maxLevelCell(iCell) .or. k == minLevelCell(iCell)) then
depLev=minLevelCell(iCell)+1
else
depLev=k
endif
Expand Down

0 comments on commit 9230b88

Please sign in to comment.