diff --git a/src/support/mo_lib_loopindices.F90 b/src/support/mo_lib_loopindices.F90 index 3ac80dd5dfee89db03ae783bbf067fc4ae3419cf..ce67af7b9b7ffd1d2fb4566b0e73077a4926100f 100644 --- a/src/support/mo_lib_loopindices.F90 +++ b/src/support/mo_lib_loopindices.F90 @@ -132,23 +132,23 @@ CONTAINS INTERFACE SUBROUTINE get_indices_c_lib(i_startidx_in, i_endidx_in, nproma, i_blk, i_startblk, i_endblk, & i_startidx_out, i_endidx_out) BIND(C, NAME="get_indices_c_lib") - IMPORT :: C_INT - INTEGER(C_INT), VALUE :: i_startidx_in, i_endidx_in, nproma, i_blk, i_startblk, i_endblk - INTEGER(C_INT) :: i_startidx_out, i_endidx_out + IMPORT :: c_int + INTEGER(c_int), VALUE :: i_startidx_in, i_endidx_in, nproma, i_blk, i_startblk, i_endblk + INTEGER(c_int) :: i_startidx_out, i_endidx_out END SUBROUTINE get_indices_c_lib SUBROUTINE get_indices_e_lib(i_startidx_in, i_endidx_in, nproma, i_blk, i_startblk, i_endblk, & i_startidx_out, i_endidx_out) BIND(C, NAME="get_indices_e_lib") - IMPORT :: C_INT - INTEGER(C_INT), VALUE :: i_startidx_in, i_endidx_in, nproma, i_blk, i_startblk, i_endblk - INTEGER(C_INT) :: i_startidx_out, i_endidx_out + IMPORT :: c_int + INTEGER(c_int), VALUE :: i_startidx_in, i_endidx_in, nproma, i_blk, i_startblk, i_endblk + INTEGER(c_int) :: i_startidx_out, i_endidx_out END SUBROUTINE get_indices_e_lib SUBROUTINE get_indices_v_lib(i_startidx_in, i_endidx_in, nproma, i_blk, i_startblk, i_endblk, & i_startidx_out, i_endidx_out) BIND(C, NAME="get_indices_v_lib") - IMPORT :: C_INT - INTEGER(C_INT), VALUE :: i_startidx_in, i_endidx_in, nproma, i_blk, i_startblk, i_endblk - INTEGER(C_INT) :: i_startidx_out, i_endidx_out + IMPORT :: c_int + INTEGER(c_int), VALUE :: i_startidx_in, i_endidx_in, nproma, i_blk, i_startblk, i_endblk + INTEGER(c_int) :: i_startidx_out, i_endidx_out END SUBROUTINE get_indices_v_lib END INTERFACE diff --git a/src/support/mo_math_utilities.F90 b/src/support/mo_math_utilities.F90 index 6cafa983fe6caa0ce84c616d66449f3b559ed930..459ff764fe038fcae56866f909b400987a5e0dcd 100644 --- a/src/support/mo_math_utilities.F90 +++ b/src/support/mo_math_utilities.F90 @@ -181,7 +181,7 @@ MODULE mo_math_utilities ! Preprocessor directive to conditionally include the tdma_solver_vec implementation #ifndef __USE_CPP_BINDINGS - CONTAINS +CONTAINS SUBROUTINE tdma_solver_vec(a, b, c, d, slev, elev, startidx, endidx, varout, opt_acc_queue) INTEGER, INTENT(IN) :: slev, elev @@ -247,13 +247,13 @@ MODULE mo_math_utilities ! C++ binding for tdma_solver_vec INTERFACE - SUBROUTINE tdma_solver_vec(a, b, c, d, slev, elev, startidx, endidx, nrows, ncols, varout, opt_acc_queue) & - BIND(C, NAME="tdma_solver_vec") - IMPORT :: C_DOUBLE, C_INT - REAL(C_DOUBLE), INTENT(IN) :: a(*), b(*), c(*), d(*) - INTEGER(C_INT), VALUE :: slev, elev, startidx, endidx, nrows, ncols - REAL(C_DOUBLE), INTENT(OUT) :: varout(*) - INTEGER(C_INT), OPTIONAL :: opt_acc_queue + SUBROUTINE tdma_solver_vec(a, b, c, d, slev, elev, startidx, endidx, nrows, ncols, varout, opt_acc_queue) & + BIND(C, NAME="tdma_solver_vec") + IMPORT :: c_double, c_int + REAL(c_double), INTENT(IN) :: a(*), b(*), c(*), d(*) + INTEGER(c_int), VALUE :: slev, elev, startidx, endidx, nrows, ncols + REAL(c_double), INTENT(OUT) :: varout(*) + INTEGER(c_int), OPTIONAL :: opt_acc_queue END SUBROUTINE tdma_solver_vec END INTERFACE diff --git a/test/fortran/test_math_utilities.F90 b/test/fortran/test_math_utilities.F90 index db8b8244a6b2549c39f19ceea2258b55e96ad18e..07dcfb3f300ba9c5f8bf1e4ef4aa2282201e3c72 100644 --- a/test/fortran/test_math_utilities.F90 +++ b/test/fortran/test_math_utilities.F90 @@ -253,10 +253,10 @@ CONTAINS DO i = 1, n DO j = 1, n - a(i, j) = 1.0_wp*(i+j) - b(i, j) = 2.0_wp*(i+j) - c(i, j) = 1.0_wp*(i+j) - d(i, j) = 1.0_wp*(i+j) + a(i, j) = 1.0_wp*(i + j) + b(i, j) = 2.0_wp*(i + j) + c(i, j) = 1.0_wp*(i + j) + d(i, j) = 1.0_wp*(i + j) END DO END DO @@ -274,7 +274,7 @@ CONTAINS elapsed_time = end_time - start_time ! Output timing result - write(*,*) "Elapsed time for tdma_solver_vec: ", elapsed_time, " seconds" + WRITE (*, *) "Elapsed time for tdma_solver_vec: ", elapsed_time, " seconds" sum = 0.0_wp DO i = 1, n @@ -288,13 +288,13 @@ CONTAINS x = 0.0_wp #ifndef __USE_CPP_BINDINGS - CALL tdma_solver_vec(a, b, c, d, 2, n-1, 2, n-1, x) + CALL tdma_solver_vec(a, b, c, d, 2, n - 1, 2, n - 1, x) #else - CALL tdma_solver_vec(a, b, c, d, 1, n-1, 1, n-1, n, n, x, -1) + CALL tdma_solver_vec(a, b, c, d, 1, n - 1, 1, n - 1, n, n, x, -1) #endif sum = 0.0_wp - DO i = 2, n-1 - DO j = 2, n-1 + DO i = 2, n - 1 + DO j = 2, n - 1 sum = sum + x(i, j) END DO END DO