Skip to content

OpenACC port of atm_bdy_reset_speczone_values #1270

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

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
14 changes: 14 additions & 0 deletions src/core_atmosphere/dynamics/mpas_atm_time_integration.F
Original file line number Diff line number Diff line change
Expand Up @@ -6962,15 +6962,29 @@ subroutine atm_bdy_reset_speczone_values( state, diag, mesh, nVertLevels, &
call mpas_pool_get_array(state, 'theta_m', theta_m, 2)
call mpas_pool_get_array(diag, 'rtheta_p', rtheta_p)
call mpas_pool_get_array(diag, 'rtheta_base', rtheta_base)

MPAS_ACC_TIMER_START('atm_bdy_reset_speczone_values [ACC_data_xfer]')
!$acc enter data copyin(rt_driving_values, rho_driving_values, rtheta_base, &
!$acc theta_m, rtheta_p)
MPAS_ACC_TIMER_STOP('atm_bdy_reset_speczone_values [ACC_data_xfer]')

!$acc parallel default(present)
!$acc loop gang worker
do iCell = cellSolveStart, cellSolveEnd
if( bdyMaskCell(iCell) > nRelaxZone) then
!$acc loop vector
do k=1, nVertLevels
theta_m(k,iCell) = rt_driving_values(k,iCell)/rho_driving_values(k,iCell)
rtheta_p(k,iCell) = rt_driving_values(k,iCell) - rtheta_base(k,iCell)
end do
end if
end do
!$acc end parallel

MPAS_ACC_TIMER_START('atm_bdy_reset_speczone_values [ACC_data_xfer]')
!$acc exit data copyout(theta_m, rtheta_p) &
!$acc delete(rt_driving_values, rho_driving_values, rtheta_base)
MPAS_ACC_TIMER_STOP('atm_bdy_reset_speczone_values [ACC_data_xfer]')

end subroutine atm_bdy_reset_speczone_values

Expand Down