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

Use layerNormalVelocity to calculate layerThicknessEdge #133

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -1458,7 +1458,7 @@ subroutine calculate_layerThicknessEdge(meshPool, geometryPool, velocityPool, er
! local variables
!-----------------------------------------------------------------
real (kind=RKIND), dimension(:), pointer :: thickness
real (kind=RKIND), dimension(:,:), pointer :: layerThickness, layerThicknessEdge, normalVelocity
real (kind=RKIND), dimension(:,:), pointer :: layerThickness, layerThicknessEdge, layerNormalVelocity
integer, dimension(:,:), pointer :: cellsOnEdge
integer, pointer :: nEdges, nVertLevels
integer :: iEdge, cell1, cell2, k
Expand All @@ -1472,7 +1472,7 @@ subroutine calculate_layerThicknessEdge(meshPool, geometryPool, velocityPool, er
call mpas_pool_get_array(geometryPool, 'thickness', thickness, timeLevel = 1)
call mpas_pool_get_array(geometryPool, 'layerThickness', layerThickness, timeLevel = 1)
call mpas_pool_get_array(geometryPool, 'layerThicknessEdge', layerThicknessEdge)
call mpas_pool_get_array(velocityPool, 'normalVelocity', normalVelocity)
call mpas_pool_get_array(velocityPool, 'layerNormalVelocity', layerNormalVelocity)

! Note: SIA velocity solver uses its own local calculation of h_edge that is always 2nd order.
! Note: ocn_diagnostic_solve in mpas_ocn_tendency.F has 2, 3, & 4th order calculations for h_edge that can be used.
Expand All @@ -1486,7 +1486,7 @@ subroutine calculate_layerThicknessEdge(meshPool, geometryPool, velocityPool, er
cell2 = cellsOnEdge(2,iEdge)
do k=1, nVertLevels
! Calculate h on edges using first order
VelSign = sign(1.0_RKIND, normalVelocity(k, iEdge))
VelSign = sign(1.0_RKIND, layerNormalVelocity(k, iEdge))
layerThicknessEdge(k,iEdge) = max(VelSign * layerThickness(k, cell1), &
VelSign * (-1.0_RKIND) * layerThickness(k, cell2))
! + velocity goes from index 1 to 2 in the cellsOnEdge array.
Expand Down