Skip to content

Commit 58ba84a

Browse files
committed
Add acc data movement to atm_advance_acoustic_step_work
Ensure that the other, non-invariant fields are available for this routine. Variables that are overwritten during this routine are only created while others are copied in. Any variables overwritten by this routine are copied out at the end. Timing for these transfers are reported in the output log file in the new timer: 'atm_advance_acoustic_step [ACC_data_xfer]'.
1 parent 1ea1466 commit 58ba84a

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/core_atmosphere/dynamics/mpas_atm_time_integration.F

+19
Original file line numberDiff line numberDiff line change
@@ -2394,6 +2394,18 @@ subroutine atm_advance_acoustic_step_work(nCells, nEdges, nCellsSolve, cellStart
23942394
resm = (1.0 - epssm) / (1.0 + epssm)
23952395
rdts = 1./dts
23962396

2397+
MPAS_ACC_TIMER_START('atm_advance_acoustic_step [ACC_data_xfer]')
2398+
!$acc enter data copyin(exner,cqu,cofwt,coftz,cofrz,cofwr,cofwz, &
2399+
!$acc a_tri,alpha_tri,gamma_tri,rho_zz,theta_m,w, &
2400+
!$acc tend_ru,tend_rho,tend_rt,tend_rw,rw,rw_save)
2401+
!$acc enter data create(rtheta_pp_old)
2402+
if(small_step == 1) then
2403+
!$acc enter data create(ru_p,ruAvg,rho_pp,rtheta_pp,wwAvg,rw_p)
2404+
else
2405+
!$acc enter data copyin(ru_p,ruAvg,rho_pp,rtheta_pp,wwAvg,rw_p)
2406+
end if
2407+
MPAS_ACC_TIMER_STOP('atm_advance_acoustic_step [ACC_data_xfer]')
2408+
23972409
if(small_step /= 1) then ! not needed on first small step
23982410

23992411
! forward-backward acoustic step integration.
@@ -2611,6 +2623,13 @@ subroutine atm_advance_acoustic_step_work(nCells, nEdges, nCellsSolve, cellStart
26112623
end do ! end of loop over cells
26122624
!$acc end parallel
26132625
2626+
MPAS_ACC_TIMER_START('atm_advance_acoustic_step [ACC_data_xfer]')
2627+
!$acc exit data delete(exner,cqu,cofwt,coftz,cofrz,cofwr,cofwz, &
2628+
!$acc a_tri,alpha_tri,gamma_tri,rho_zz,theta_m,w, &
2629+
!$acc tend_ru,tend_rho,tend_rt,tend_rw,rw,rw_save)
2630+
!$acc exit data copyout(rtheta_pp_old,ru_p,ruAvg,rho_pp, &
2631+
!$acc rtheta_pp,wwAvg,rw_p)
2632+
MPAS_ACC_TIMER_STOP('atm_advance_acoustic_step [ACC_data_xfer]')
26142633
26152634
end subroutine atm_advance_acoustic_step_work
26162635

0 commit comments

Comments
 (0)