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

E3SM issue4152 bugfix #826

Merged
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
28 changes: 20 additions & 8 deletions src/core_ocean/mode_forward/mpas_ocn_time_integration_split.F
Original file line number Diff line number Diff line change
Expand Up @@ -1387,11 +1387,9 @@ subroutine ocn_time_integrator_split(domain, dt)!{{{
! velocity for normalVelocityCorrectionection is
! normalBarotropicVelocity +
! normalBaroclinicVelocity + uBolus
do k=1,nVertLevels
uTemp(k) = normalBarotropicVelocityNew(iEdge) + &
normalBaroclinicVelocityNew(k,iEdge) + &
normalGMBolusVelocity(k,iEdge)
end do
uTemp(:) = normalBarotropicVelocityNew(iEdge) &
+ normalBaroclinicVelocityNew(:,iEdge) &
+ normalGMBolusVelocity(:,iEdge)

! thicknessSum is initialized outside the loop because
! on land boundaries maxLevelEdgeTop=0, but I want to
Expand Down Expand Up @@ -2019,6 +2017,7 @@ subroutine ocn_time_integration_split_init(domain)!{{{

type (mpas_pool_type), pointer :: &
statePool, &! structure containing model state
meshPool, &! structure containing mesh fields
tracersPool ! structure containing tracer fields

integer :: &
Expand All @@ -2027,6 +2026,9 @@ subroutine ocn_time_integration_split_init(domain)!{{{
ierr, &! local error flag
cell1, cell2 ! neighbor cell indices across edge

integer, dimension(:), pointer :: maxLevelEdgeTop
integer, dimension(:,:), pointer :: cellsOnEdge

real (kind=RKIND) :: &
normalThicknessFluxSum, &! vertical sum of thick flux
layerThicknessSum, &! vertical sum of layer thickness
Expand All @@ -2050,6 +2052,8 @@ subroutine ocn_time_integration_split_init(domain)!{{{
remainder, &! remaining time after interval division
zeroInterval ! zero timestep for comparing remainder

integer, pointer :: nVertLevels, nCells, nEdges

integer (kind=I8KIND) :: nBtrSubcyclesI8

! End preamble
Expand Down Expand Up @@ -2130,8 +2134,12 @@ subroutine ocn_time_integration_split_init(domain)!{{{

block => domain % blocklist
call mpas_pool_get_subpool(block%structs, 'state', statePool)

call mpas_pool_get_subpool(statePool, 'tracers', tracersPool)
call mpas_pool_get_subpool(block%structs, 'mesh', meshPool)

call mpas_pool_get_dimension(block % dimensions, 'nVertLevels', nVertLevels)
call mpas_pool_get_dimension(block % dimensions, 'nCells', nCells)
call mpas_pool_get_dimension(block % dimensions, 'nEdges', nEdges)

call mpas_pool_get_array(statePool, 'layerThickness', &
layerThickness, 1)
Expand All @@ -2142,6 +2150,10 @@ subroutine ocn_time_integration_split_init(domain)!{{{
call mpas_pool_get_array(statePool, 'normalBaroclinicVelocity', &
normalBaroclinicVelocity, 1)

call mpas_pool_get_array(meshPool, 'refBottomDepth', refBottomDepth)
call mpas_pool_get_array(meshPool, 'cellsOnEdge', cellsOnEdge)
call mpas_pool_get_array(meshPool, 'maxLevelEdgeTop', maxLevelEdgeTop)

!*** Compute barotropic velocity at first timestep
!*** This is only done upon start-up.
if (unsplit) then
Expand All @@ -2155,12 +2167,12 @@ subroutine ocn_time_integration_split_init(domain)!{{{
else ! split explicit

if (config_filter_btr_mode) then
do iCell = 1, nCellsAll
do iCell = 1, nCells
layerThickness(1,iCell) = refBottomDepth(1)
enddo
endif

do iEdge = 1, nEdgesAll
do iEdge = 1, nEdges
cell1 = cellsOnEdge(1,iEdge)
cell2 = cellsOnEdge(2,iEdge)
kmax = maxLevelEdgeTop(iEdge)
Expand Down