@@ -218,7 +218,7 @@ subroutine mpas_reconstruct_2d(meshPool, u, uReconstructX, uReconstructY, uRecon
218
218
! temporary arrays needed in the compute procedure
219
219
logical :: includeHalosLocal
220
220
integer , pointer :: nCells_ptr, nVertLevels_ptr
221
- integer :: nCells, nVertLevels
221
+ integer :: nCells, nVertLevels
222
222
integer , dimension (:,:), pointer :: edgesOnCell
223
223
integer , dimension (:), pointer :: nEdgesOnCell
224
224
integer :: iCell,iEdge, i, k
@@ -249,7 +249,7 @@ subroutine mpas_reconstruct_2d(meshPool, u, uReconstructX, uReconstructY, uRecon
249
249
call mpas_pool_get_dimension(meshPool, ' nCellsSolve' , nCells_ptr)
250
250
end if
251
251
call mpas_pool_get_dimension(meshPool, ' nVertLevels' , nVertLevels_ptr)
252
- ! Dereference pointers so that OpenACC copies them correctly
252
+ ! Dereference pointers to make sure OpenACC copies the value pointed to implicitly
253
253
nCells = nCells_ptr
254
254
nVertLevels = nVertLevels_ptr
255
255
@@ -275,7 +275,7 @@ subroutine mpas_reconstruct_2d(meshPool, u, uReconstructX, uReconstructY, uRecon
275
275
do iCell = 1 , nCells
276
276
! initialize the reconstructed vectors
277
277
!$acc loop vector
278
- do k= 1 ,nVertLevels
278
+ do k = 1 ,nVertLevels
279
279
uReconstructX(k,iCell) = 0.0
280
280
uReconstructY(k,iCell) = 0.0
281
281
uReconstructZ(k,iCell) = 0.0
@@ -284,10 +284,10 @@ subroutine mpas_reconstruct_2d(meshPool, u, uReconstructX, uReconstructY, uRecon
284
284
! a more efficient reconstruction where rbf_values* matrix_reconstruct
285
285
! has been precomputed in coeffs_reconstruct
286
286
!$acc loop seq
287
- do i= 1 ,nEdgesOnCell(iCell)
287
+ do i = 1 ,nEdgesOnCell(iCell)
288
288
iEdge = edgesOnCell(i,iCell)
289
289
!$acc loop vector
290
- do k= 1 ,nVertLevels
290
+ do k = 1 ,nVertLevels
291
291
uReconstructX(k,iCell) = uReconstructX(k,iCell) &
292
292
+ coeffs_reconstruct(1 ,i,iCell) * u(k,iEdge)
293
293
uReconstructY(k,iCell) = uReconstructY(k,iCell) &
@@ -313,7 +313,7 @@ subroutine mpas_reconstruct_2d(meshPool, u, uReconstructX, uReconstructY, uRecon
313
313
clon = cos (lonCell(iCell))
314
314
slon = sin (lonCell(iCell))
315
315
!$acc loop vector
316
- do k= 1 ,nVertLevels
316
+ do k = 1 ,nVertLevels
317
317
uReconstructZonal(k,iCell) = - uReconstructX(k,iCell)* slon + &
318
318
uReconstructY(k,iCell)* clon
319
319
uReconstructMeridional(k,iCell) = - (uReconstructX(k,iCell)* clon &
@@ -328,7 +328,7 @@ subroutine mpas_reconstruct_2d(meshPool, u, uReconstructX, uReconstructY, uRecon
328
328
!$acc parallel default(present)
329
329
!$acc loop gang vector collapse(2 )
330
330
do iCell = 1 , nCells
331
- do k= 1 ,nVertLevels
331
+ do k = 1 ,nVertLevels
332
332
uReconstructZonal (k,iCell) = uReconstructX(k,iCell)
333
333
uReconstructMeridional(k,iCell) = uReconstructY(k,iCell)
334
334
end do
0 commit comments