From e5a7fa238cd2f1a40cb9cb19a043f5b390ffc6e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20Spo=CC=88rri?= Date: Fri, 28 Oct 2016 14:53:36 +0200 Subject: [PATCH 1/3] Fix linker issue in Cray --- openacc_cuda_sample/cray.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openacc_cuda_sample/cray.cmake b/openacc_cuda_sample/cray.cmake index 3485057..c6a5cef 100644 --- a/openacc_cuda_sample/cray.cmake +++ b/openacc_cuda_sample/cray.cmake @@ -21,4 +21,6 @@ if (TARGET_GPU) set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -g") else() set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -O0 -g -eZ -eD -Rb -Rc -Rd -Rp -Rs") -endif() \ No newline at end of file +endif() + +set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "") From fec519bb0a2df4974fcc315c97a7a429b2eb153f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20Spo=CC=88rri?= Date: Fri, 28 Oct 2016 14:53:52 +0200 Subject: [PATCH 2/3] Replaced implicit array dimension with declared array dimension --- openacc_cuda_sample/src/m_parameterizations.f90 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openacc_cuda_sample/src/m_parameterizations.f90 b/openacc_cuda_sample/src/m_parameterizations.f90 index 03dd80e..594d6a3 100644 --- a/openacc_cuda_sample/src/m_parameterizations.f90 +++ b/openacc_cuda_sample/src/m_parameterizations.f90 @@ -68,10 +68,10 @@ SUBROUTINE microphysics(npx, npy, nlev, t, qc, qv) IMPLICIT NONE ! arguments - INTEGER, INTENT(IN) :: npx, npy, nlev ! dimension of inputs - REAL*8, INTENT(INOUT) :: t(:,:,:) ! temperature - REAL*8, INTENT(IN) :: qc(:,:,:) ! cloud water content - REAL*8, INTENT(INOUT) :: qv(:,:,:) ! water vapour content + INTEGER, INTENT(IN) :: npx, npy, nlev ! dimension of inputs + REAL*8, INTENT(INOUT) :: t(npx,npy,nlev) ! temperature + REAL*8, INTENT(IN) :: qc(npx,npy,nlev) ! cloud water content + REAL*8, INTENT(INOUT) :: qv(npx,npy,nlev) ! water vapour content ! local variables INTEGER :: i, j, k ! loop indices From 9318b1ed852b6647bcedd26f6eafbe51b8da3a08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20Spo=CC=88rri?= Date: Fri, 28 Oct 2016 15:01:48 +0200 Subject: [PATCH 3/3] Add MPI call --- openacc_cuda_sample/src/main.f90 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openacc_cuda_sample/src/main.f90 b/openacc_cuda_sample/src/main.f90 index 08808b8..e077f77 100644 --- a/openacc_cuda_sample/src/main.f90 +++ b/openacc_cuda_sample/src/main.f90 @@ -18,8 +18,10 @@ PROGRAM main ! local variables INTEGER :: ntstep + INTEGER :: mpi_error INTEGER, parameter :: itimloop = 5 - + + CALL MPI_init(mpi_error) CALL initialize() !---------------------------------------------------------------------------- @@ -49,4 +51,6 @@ PROGRAM main CALL cleanup() + CALL MPI_finalize(mpi_error) + END PROGRAM main