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

Generalization of advection-related subroutines in mpas_atm_time_integration.F #1162

Merged
merged 1 commit into from
May 1, 2024
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
9 changes: 5 additions & 4 deletions src/core_atmosphere/dynamics/mpas_atm_time_integration.F
Original file line number Diff line number Diff line change
Expand Up @@ -1352,7 +1352,7 @@ subroutine advance_scalars(field_name, domain, rk_step, rk_timestep, config_mono
call mpas_pool_get_dimension(mesh, 'nCells', nCells)
call mpas_pool_get_dimension(mesh, 'nEdges', nEdges)
call mpas_pool_get_dimension(mesh, 'nVertLevels', nVertLevels)
call mpas_pool_get_dimension(state, 'num_scalars', num_scalars)
call mpas_pool_get_dimension(state, 'num_'//trim(field_name), num_scalars)

call mpas_pool_get_dimension(block % dimensions, 'nThreads', nThreads)

Expand Down Expand Up @@ -3234,7 +3234,7 @@ subroutine atm_advance_scalars_mono(field_name, block, tend, state, diag, mesh,
call mpas_allocate_scratch_field(scale)
call mpas_pool_get_array(halo_scratch, 'scale', scale_arr)

call atm_advance_scalars_mono_work(block, state, nCells, nEdges, num_scalars, dt, &
call atm_advance_scalars_mono_work(field_name, block, state, nCells, nEdges, num_scalars, dt, &
cellStart, cellEnd, edgeStart, edgeEnd, &
cellSolveStart, cellSolveEnd, &
coef_3rd_order, nCellsSolve, uhAvg, wwAvg, scalar_tend, rho_zz_old, &
Expand Down Expand Up @@ -3282,7 +3282,7 @@ end subroutine atm_advance_scalars_mono
!> as used in the RK3 scheme as described in Wang et al MWR 2009
!
!-----------------------------------------------------------------------
subroutine atm_advance_scalars_mono_work(block, state, nCells, nEdges, num_scalars, dt, &
subroutine atm_advance_scalars_mono_work(field_name, block, state, nCells, nEdges, num_scalars, dt, &
cellStart, cellEnd, edgeStart, edgeEnd, &
cellSolveStart, cellSolveEnd, &
coef_3rd_order, nCellsSolve, uhAvg, wwAvg, scalar_tend, rho_zz_old, &
Expand All @@ -3297,6 +3297,7 @@ subroutine atm_advance_scalars_mono_work(block, state, nCells, nEdges, num_scala

implicit none

character(len=*), intent(in) :: field_name
type (block_type), intent(inout), target :: block
type (mpas_pool_type), intent(inout) :: state
integer, intent(in) :: nCells ! for allocating stack variables
Expand Down Expand Up @@ -3401,7 +3402,7 @@ subroutine atm_advance_scalars_mono_work(block, state, nCells, nEdges, num_scala

!$OMP BARRIER
!$OMP MASTER
call exchange_halo_group(block % domain, 'dynamics:scalars_old')
call exchange_halo_group(block % domain, 'dynamics:'//trim(field_name)//'_old')
!$OMP END MASTER
!$OMP BARRIER

Expand Down