Skip to content

Commit 0730fa2

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 3da1030 commit 0730fa2

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
@@ -2437,6 +2437,18 @@ subroutine atm_advance_acoustic_step_work(nCells, nEdges, nCellsSolve, cellStart
24372437
resm = (1.0 - epssm) / (1.0 + epssm)
24382438
rdts = 1./dts
24392439

2440+
MPAS_ACC_TIMER_START('atm_advance_acoustic_step [ACC_data_xfer]')
2441+
!$acc enter data copyin(exner,cqu,cofwt,coftz,cofrz,cofwr,cofwz, &
2442+
!$acc a_tri,alpha_tri,gamma_tri,rho_zz,theta_m,w, &
2443+
!$acc tend_ru,tend_rho,tend_rt,tend_rw,rw,rw_save)
2444+
!$acc enter data create(rtheta_pp_old)
2445+
if(small_step == 1) then
2446+
!$acc enter data create(ru_p,ruAvg,rho_pp,rtheta_pp,wwAvg,rw_p)
2447+
else
2448+
!$acc enter data copyin(ru_p,ruAvg,rho_pp,rtheta_pp,wwAvg,rw_p)
2449+
end if
2450+
MPAS_ACC_TIMER_STOP('atm_advance_acoustic_step [ACC_data_xfer]')
2451+
24402452
if(small_step /= 1) then ! not needed on first small step
24412453

24422454
! forward-backward acoustic step integration.
@@ -2654,6 +2666,13 @@ subroutine atm_advance_acoustic_step_work(nCells, nEdges, nCellsSolve, cellStart
26542666
end do ! end of loop over cells
26552667
!$acc end parallel
26562668
2669+
MPAS_ACC_TIMER_START('atm_advance_acoustic_step [ACC_data_xfer]')
2670+
!$acc exit data delete(exner,cqu,cofwt,coftz,cofrz,cofwr,cofwz, &
2671+
!$acc a_tri,alpha_tri,gamma_tri,rho_zz,theta_m,w, &
2672+
!$acc tend_ru,tend_rho,tend_rt,tend_rw,rw,rw_save)
2673+
!$acc exit data copyout(rtheta_pp_old,ru_p,ruAvg,rho_pp, &
2674+
!$acc rtheta_pp,wwAvg,rw_p)
2675+
MPAS_ACC_TIMER_STOP('atm_advance_acoustic_step [ACC_data_xfer]')
26572676
26582677
end subroutine atm_advance_acoustic_step_work
26592678

0 commit comments

Comments
 (0)