Skip to content
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

Fix compilation on Kesch-TDS #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion openacc_cuda_sample/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ add_executable(openacc_cuda_sample
${FORTRAN_SRC}
${CUDA_COMPILED}
)
target_link_libraries(openacc_cuda_sample stdc++ gcc_eh)
target_link_libraries(openacc_cuda_sample stdc++ gcc_eh ${CUDA_LIBRARIES})
7 changes: 3 additions & 4 deletions openacc_cuda_sample/cray.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ endif()

SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${OpenACC_FLAGS}")


# Release
SET(CMAKE_Fortran_FLAGS_RELEASE "")
# Remove "-rdynamic" from the link options
SET(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS)

# Debug Options (replace default)
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()
endif()
10 changes: 5 additions & 5 deletions openacc_cuda_sample/src/m_parameterizations.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
! module containing the physical parameterizations
MODULE m_parameterizations

USE iso_c_binding, ONLY: C_LOC
USE iso_c_binding, ONLY: C_LOC, C_DOUBLE

IMPLICIT NONE

Expand All @@ -25,9 +25,9 @@ SUBROUTINE saturation_adjustment(npx, npy, nlev, t, qc, qv)

! arguments
INTEGER, INTENT(IN) :: npx, npy, nlev ! dimensions of inputs
REAL*8, INTENT(IN) :: t(:,:,:) ! temperature
REAL*8, INTENT(OUT) :: qc(:,:,:) ! cloud water content
REAL*8, INTENT(INOUT) :: qv(:,:,:) ! water vapour content
REAL*8, INTENT(IN), TARGET :: t(:,:,:) ! temperature
REAL*8, INTENT(OUT), TARGET :: qc(:,:,:) ! cloud water content
REAL*8, INTENT(INOUT), TARGET :: qv(:,:,:) ! water vapour content

! Interface to CUDA wrapper function using iso_c_binding
INTERFACE
Expand All @@ -37,7 +37,7 @@ SUBROUTINE saturation_adjustment_cuda( ntot, t, qc, qv, &
BIND(c, name='saturation_adjustment_cuda')
USE, INTRINSIC :: iso_c_binding
INTEGER(C_INT), VALUE :: ntot
TYPE(C_PTR), VALUE :: t, qc, qv
TYPE(C_PTR), VALUE, TARGET :: t, qc, qv
REAL(KIND=C_DOUBLE), VALUE :: cs1, cs2, cs3, cs4, t0
END SUBROUTINE saturation_adjustment_cuda
END INTERFACE
Expand Down