Skip to content

Commit

Permalink
Apply tidal BC to sshSubcycle
Browse files Browse the repository at this point in the history
  • Loading branch information
cbegeman committed Nov 2, 2023
1 parent 4466e95 commit a2ece2a
Showing 1 changed file with 57 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,29 @@ subroutine ocn_time_integrator_split(domain, dt)!{{{

end if ! tidal potential forcing

! direct application of tidal boundary condition
if (config_use_tidal_forcing .and. trim(config_tidal_forcing_type) == 'direct') then
call mpas_pool_get_array(forcingPool, &
'sshSubcycleCurWithTides', &
sshSubcycleCurWithTides)
call mpas_pool_get_array(forcingPool, 'tidalInputMask', tidalInputMask)
call mpas_pool_get_array(forcingPool, 'tidalBCValue', tidalBCValue)
!$omp parallel
!$omp do schedule(runtime)
do iCell=1, nCellsAll
! boolean mask for now, could generalize to tappered sponge layer
! only modify layer thicknesses on tidal boundary
do k = minLevelCell(iCell), maxLevelCell(iCell)
sshSubcycleCurWithTides(iCell) = sshSubcycleCur(iCell) + &
(tidalInputMask(iCell)*(tidalBCValue(iCell) - sshSubcycleCur(iCell)))
end do
end do
!$omp end do
!$omp end parallel
call mpas_pool_get_array(forcingPool, &
'sshSubcycleCurWithTides', &
sshSubcycleCur)
end if
if (edgeHaloComputeCounter <= 1) then
nEdges = nEdgesOwned
else
Expand Down Expand Up @@ -1258,6 +1281,37 @@ subroutine ocn_time_integrator_split(domain, dt)!{{{
'sshSubcycleNewWithTides', &
sshSubcycleNew)
end if ! tidal potential forcing
! direct application of tidal boundary condition
if (config_use_tidal_forcing .and. trim(config_tidal_forcing_type) == 'direct') then
call mpas_pool_get_array(forcingPool, &
'sshSubcycleCurWithTides', &
sshSubcycleCurWithTides)
call mpas_pool_get_array(forcingPool, &
'sshSubcycleNewWithTides', &
sshSubcycleNewWithTides)
call mpas_pool_get_array(forcingPool, 'tidalInputMask', tidalInputMask)
call mpas_pool_get_array(forcingPool, 'tidalBCValue', tidalBCValue)
!$omp parallel
!$omp do schedule(runtime)
do iCell=1, nCellsAll
! boolean mask for now, could generalize to tappered sponge layer
! only modify layer thicknesses on tidal boundary
do k = minLevelCell(iCell), maxLevelCell(iCell)
sshSubcycleCurWithTides(iCell) = sshSubcycleCur(iCell) + &
(tidalInputMask(iCell)*(tidalBCValue(iCell) - sshSubcycleCur(iCell)))
sshSubcycleNewWithTides(iCell) = sshSubcycleNew(iCell) + &
(tidalInputMask(iCell)*(tidalBCValue(iCell) - sshSubcycleNew(iCell)))
end do
end do
!$omp end do
!$omp end parallel
call mpas_pool_get_array(forcingPool, &
'sshSubcycleCurWithTides', &
sshSubcycleCur)
call mpas_pool_get_array(forcingPool, &
'sshSubcycleNewWithTides', &
sshSubcycleNew)
end if

! Need to initialize btr_vel_temp over one more halo
! than we are computing over
Expand Down Expand Up @@ -2602,7 +2656,9 @@ subroutine ocn_time_integrator_split(domain, dt)!{{{

! only modify layer thicknesses on tidal boundary
do k = minLevelCell(iCell), maxLevelCell(iCell)
layerThicknessNew(k, iCell) = tidalInputMask(iCell)*(tidalBCValue(iCell) + bottomDepth(iCell))*(restingThickness(k,iCell)/totalDepth)
layerThicknessNew(k, iCell) = tidalInputMask(iCell)* &
(tidalBCValue(iCell) + bottomDepth(iCell))* &
(restingThickness(k,iCell)/totalDepth)
!(1.0_RKIND - tidalInputMask(iCell))*layerThicknessNew(k, iCell) ! generalized tappered assumption code
end do
end if
Expand Down

0 comments on commit a2ece2a

Please sign in to comment.