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

Enhance inactive top cells feature #840

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
942333c
minLevel* changes to ocn_tracer_exponential_decay
cbegeman Mar 18, 2021
531896a
minLevel* changes to ocn_tracer_DMS
cbegeman Mar 18, 2021
2e698a3
minLevel* changes to ocn_tracer_ecosys
cbegeman Mar 18, 2021
11c2121
minLevel* changes to ocn_tracer_MacroMolecules
cbegeman Mar 18, 2021
5177995
minLevel* changes to ocn_tracer_ideal_age
cbegeman Mar 18, 2021
2280a98
minLevel* changes to ocn_tracer_interior_restoring
cbegeman Mar 18, 2021
88ae8cc
minLevel* changes to ocn_filter_btr_mode_tend_vel
cbegeman Mar 18, 2021
2f0c2b1
minLevel* changes to ocn_tend_freq_filtered_thickness
cbegeman Mar 18, 2021
4833ca5
minLevel* changes to ocn_tracer_short_wave_absorption_jerlov
cbegeman Mar 18, 2021
97d835e
minLevel* changes to ocn_tracer_short_wave_absorption_variable
cbegeman Mar 18, 2021
d0618e6
minLevel* changes to ocn_frazil_forcing
cbegeman Mar 18, 2021
57f09f9
minLevel* changes to ocn_tracer_surface_flux_to_tend
cbegeman Mar 18, 2021
82a35c4
minLevel* changes to ocn_tracer_nonlocalflux
cbegeman Mar 18, 2021
44d8292
minLevel* changes to ocn_diags,ocn_compute_kpp_rhs
cbegeman Mar 18, 2021
aa47979
Assign unused values in ocn_vmix
cbegeman Mar 24, 2021
e423bd6
minLevel* changes to ocn_tracer_advection_std
cbegeman Mar 18, 2021
5112d94
minLevel* changes to ocn_wetting_drying
cbegeman Mar 18, 2021
17fbfeb
minLevel* changes to ocn_tidal_forcing
cbegeman Mar 18, 2021
08e2af1
minLevel* changes to ocn_tracer_hmix_del2
cbegeman Mar 18, 2021
b2013a2
minLevel* changes to ocn_tracer_hmix_del4
cbegeman Mar 18, 2021
5c4f316
minLevel* changes to ocn_tracer_hmix_redi
cbegeman Mar 18, 2021
7eda6ec
fix to Redi needed to ensure bfb results in ecosys tracers
cbegeman Mar 26, 2021
842ba35
minLevel* changes to ocn_vel_hmix_del4
cbegeman Mar 18, 2021
ad58e5b
minLevel* changes to ocn_vel_hmix_leith
cbegeman Mar 18, 2021
1ad6881
minLevel* changes to ocn_vel_vmix_tend_rayleigh,...
cbegeman Mar 18, 2021
398d22f
minLevel* changes to ocn_gm
cbegeman Mar 18, 2021
8d7ae8c
Minlevelcell changes to ocn_init_isomip_plus
cbegeman Mar 17, 2021
a7a0337
Fixup minLevel* changes to ocn_tendency
cbegeman Mar 30, 2021
51b0c49
minLevel* changes to ocn_time_integration_si
cbegeman Mar 30, 2021
34b45b9
fixup ocn_tend_freq_filtered_thickness
cbegeman Mar 30, 2021
ca9acf2
Remaining minLevel* changes to cvmix
cbegeman Mar 30, 2021
6d3770f
Fixup minLevelCell changes to vmix:
cbegeman Mar 31, 2021
0ba1a67
Fixup minLevel* changes to vmix, rayleigh
cbegeman Apr 1, 2021
4349195
Resolve merge conflict with freshwater flux terms
cbegeman Apr 6, 2021
21464cc
Fixup freq-filtered diagnostics
cbegeman Apr 7, 2021
4e2dbee
Fixup gm k-limit conditionals
cbegeman Apr 7, 2021
430ab93
Fixup ocn_tidal_forcing
cbegeman Apr 7, 2021
ca5f52d
Fixup ocn_tracer_DMS
cbegeman Apr 7, 2021
318fb1c
Fixup cvmix
cbegeman Apr 7, 2021
bcdcde3
minLevel* changes to RK4 timestepping
cbegeman Mar 30, 2021
74d2acb
Revert minLevel* changes to RK4: initialize *new = *cur
cbegeman Mar 30, 2021
6da36d2
Revert minLevel* changes to RK4: diagnostic update
cbegeman Mar 30, 2021
f0c76b7
Fixup RK4:
cbegeman Apr 7, 2021
0816935
Keep same vertical limits on kpp call
cbegeman Apr 9, 2021
19dc7d9
Fixup redi: change k to minLevelEdgeBot for flux terms
cbegeman Apr 12, 2021
9d189a2
Fixup ocn_tracer_ecosys
cbegeman Apr 14, 2021
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
30 changes: 19 additions & 11 deletions src/core_ocean/mode_forward/mpas_ocn_time_integration_rk4.F
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ subroutine ocn_time_integrator_rk4(domain, dt)!{{{
! Diagnostics Indices

! Mesh array pointers
integer, dimension(:), pointer :: maxLevelCell, maxLevelEdgeTop
integer, dimension(:), pointer :: minLevelCell, maxLevelCell, maxLevelEdgeTop
real (kind=RKIND), dimension(:), pointer :: bottomDepth

! Provis Array Pointers
Expand Down Expand Up @@ -237,6 +237,9 @@ subroutine ocn_time_integrator_rk4(domain, dt)!{{{
call mpas_pool_get_array(meshPool, 'maxLevelCell', maxLevelCell)
call mpas_pool_get_array(meshPool, 'maxLevelEdgeTop', maxLevelEdgeTop)

! Lower k-loop limit of 1 rather than minLevel* needed in *New = *Cur
! assignments below are needed to maintain bit-for-bit results

!$omp parallel
!$omp do schedule(runtime) private(k)
do iEdge = 1, nEdges
Expand Down Expand Up @@ -620,6 +623,8 @@ subroutine ocn_time_integrator_rk4(domain, dt)!{{{
call mpas_pool_get_dimension(meshPool, 'nCells', nCells)
call mpas_pool_get_dimension(meshPool, 'nEdges', nEdges)
call mpas_pool_get_array(meshPool, 'bottomDepth', bottomDepth)
call mpas_pool_get_array(meshPool, 'minLevelCell', minLevelCell)
call mpas_pool_get_array(meshPool, 'maxLevelCell', maxLevelCell)

call mpas_pool_get_array(statePool, 'normalVelocity', normalVelocityCur, 1)
call mpas_pool_get_array(statePool, 'normalVelocity', normalVelocityNew, 2)
Expand Down Expand Up @@ -658,12 +663,12 @@ subroutine ocn_time_integrator_rk4(domain, dt)!{{{
if (tidalInputMask(iCell) == 1.0_RKIND) then
! compute total depth for relative thickness contribution
totalDepth = 0.0_RKIND
do k = 1, maxLevelCell(iCell)
do k = minLevelCell(iCell), maxLevelCell(iCell)
totalDepth = totalDepth + restingThickness(k,iCell)
end do

! only modify layer thicknesses on tidal boundary
do k = 1, maxLevelCell(iCell)
do k = minLevelCell(iCell), maxLevelCell(iCell)
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
Expand Down Expand Up @@ -719,8 +724,8 @@ subroutine ocn_time_integrator_rk4(domain, dt)!{{{
!$omp parallel
!$omp do schedule(runtime)
do iCell = 1, nCells
surfaceVelocity(indexSurfaceVelocityZonal, iCell) = velocityZonal(1, iCell)
surfaceVelocity(indexSurfaceVelocityMeridional, iCell) = velocityMeridional(1, iCell)
surfaceVelocity(indexSurfaceVelocityZonal, iCell) = velocityZonal(minLevelCell(iCell), iCell)
surfaceVelocity(indexSurfaceVelocityMeridional, iCell) = velocityMeridional(minLevelCell(iCell), iCell)

SSHGradient(indexSSHGradientZonal, iCell) = gradSSHZonal(iCell)
SSHGradient(indexSSHGradientMeridional, iCell) = gradSSHMeridional(iCell)
Expand Down Expand Up @@ -1031,7 +1036,7 @@ subroutine ocn_time_integrator_rk4_diagnostic_update(block, dt, rkSubstepWeight,

real (kind=RKIND), dimension(:, :, :), pointer :: tracersGroupCur, tracersGroupProvis, tracersGroupTend

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

logical, pointer :: config_use_tracerGroup
type (mpas_pool_iterator_type) :: groupItr
Expand Down Expand Up @@ -1071,6 +1076,7 @@ subroutine ocn_time_integrator_rk4_diagnostic_update(block, dt, rkSubstepWeight,
call mpas_pool_get_array(tendPool, 'layerThickness', layerThicknessTend)
call mpas_pool_get_array(tendPool, 'lowFreqDivergence', lowFreqDivergenceTend)

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

Expand Down Expand Up @@ -1208,7 +1214,7 @@ subroutine ocn_time_integrator_rk4_accumulate_update(block, rkWeight, err)!{{{

real (kind=RKIND), dimension(:, :, :), pointer :: tracersGroupNew, tracersGroupTend

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

logical, pointer :: config_use_tracerGroup
type (mpas_pool_iterator_type) :: groupItr
Expand Down Expand Up @@ -1243,12 +1249,13 @@ subroutine ocn_time_integrator_rk4_accumulate_update(block, rkWeight, err)!{{{
call mpas_pool_get_array(tendPool, 'highFreqThickness', highFreqThicknessTend)
call mpas_pool_get_array(tendPool, 'lowFreqDivergence', lowFreqDivergenceTend)

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

!$omp parallel
!$omp do schedule(runtime) private(k)
do iCell = 1, nCells
do k = 1, maxLevelCell(iCell)
do k = minLevelCell(iCell), maxLevelCell(iCell)
layerThicknessNew(k, iCell) = layerThicknessNew(k, iCell) + rkWeight * layerThicknessTend(k, iCell)
end do
end do
Expand Down Expand Up @@ -1277,7 +1284,7 @@ subroutine ocn_time_integrator_rk4_accumulate_update(block, rkWeight, err)!{{{
!$omp parallel
!$omp do schedule(runtime) private(k)
do iCell = 1, nCells
do k = 1, maxLevelCell(iCell)
do k = minLevelCell(iCell), maxLevelCell(iCell)
tracersGroupNew(:, k, iCell) = tracersGroupNew(:, k, iCell) + rkWeight &
* tracersGroupTend(:, k, iCell)
end do
Expand Down Expand Up @@ -1326,7 +1333,7 @@ subroutine ocn_time_integrator_rk4_cleanup(block, dt, err)!{{{
real (kind=RKIND), dimension(:, :), pointer :: layerThicknessNew, normalVelocityNew
real (kind=RKIND), dimension(:, :, :), pointer :: tracersGroupNew

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

logical, pointer :: config_use_tracerGroup
type (mpas_pool_iterator_type) :: groupItr
Expand Down Expand Up @@ -1355,6 +1362,7 @@ subroutine ocn_time_integrator_rk4_cleanup(block, dt, err)!{{{
call mpas_pool_get_dimension(tracersPool, 'index_temperature', indexTemperature)
call mpas_pool_get_dimension(tracersPool, 'index_salinity', indexSalinity)

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

call mpas_pool_begin_iteration(tracersPool)
Expand All @@ -1365,7 +1373,7 @@ subroutine ocn_time_integrator_rk4_cleanup(block, dt, err)!{{{
!$omp parallel
!$omp do schedule(runtime) private(k)
do iCell = 1, nCells
do k = 1, maxLevelCell(iCell)
do k = minLevelCell(iCell), maxLevelCell(iCell)
tracersGroupNew(:, k, iCell) = tracersGroupNew(:, k, iCell) / layerThicknessNew(k, iCell)
end do
end do
Expand Down
Loading