Skip to content

Commit 09e60a5

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 3223f28 commit 09e60a5

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
@@ -2459,6 +2459,18 @@ subroutine atm_advance_acoustic_step_work(nCells, nEdges, nCellsSolve, cellStart
24592459
resm = (1.0 - epssm) / (1.0 + epssm)
24602460
rdts = 1./dts
24612461

2462+
MPAS_ACC_TIMER_START('atm_advance_acoustic_step [ACC_data_xfer]')
2463+
!$acc enter data copyin(exner,cqu,cofwt,coftz,cofrz,cofwr,cofwz, &
2464+
!$acc a_tri,alpha_tri,gamma_tri,rho_zz,theta_m,w, &
2465+
!$acc tend_ru,tend_rho,tend_rt,tend_rw,rw,rw_save)
2466+
!$acc enter data create(rtheta_pp_old)
2467+
if(small_step == 1) then
2468+
!$acc enter data create(ru_p,ruAvg,rho_pp,rtheta_pp,wwAvg,rw_p)
2469+
else
2470+
!$acc enter data copyin(ru_p,ruAvg,rho_pp,rtheta_pp,wwAvg,rw_p)
2471+
end if
2472+
MPAS_ACC_TIMER_STOP('atm_advance_acoustic_step [ACC_data_xfer]')
2473+
24622474
if(small_step /= 1) then ! not needed on first small step
24632475

24642476
! forward-backward acoustic step integration.
@@ -2676,6 +2688,13 @@ subroutine atm_advance_acoustic_step_work(nCells, nEdges, nCellsSolve, cellStart
26762688
end do ! end of loop over cells
26772689
!$acc end parallel
26782690
2691+
MPAS_ACC_TIMER_START('atm_advance_acoustic_step [ACC_data_xfer]')
2692+
!$acc exit data delete(exner,cqu,cofwt,coftz,cofrz,cofwr,cofwz, &
2693+
!$acc a_tri,alpha_tri,gamma_tri,rho_zz,theta_m,w, &
2694+
!$acc tend_ru,tend_rho,tend_rt,tend_rw,rw,rw_save)
2695+
!$acc exit data copyout(rtheta_pp_old,ru_p,ruAvg,rho_pp, &
2696+
!$acc rtheta_pp,wwAvg,rw_p)
2697+
MPAS_ACC_TIMER_STOP('atm_advance_acoustic_step [ACC_data_xfer]')
26792698
26802699
end subroutine atm_advance_acoustic_step_work
26812700

0 commit comments

Comments
 (0)