Started to remove depecrated Fortran variable declerations

The Fortran variable declerations "variable type*[4,8,16]" is non
Fortran standard. It might cause problem in the future.
Furthermore, the usage of Fortran and C togehther is more clean
if variables are defined according to C variable types.

This is done, now for all the test programs
parent 2954dc5f
......@@ -9,7 +9,8 @@ AM_LDFLAGS = $(SCALAPACK_LDFLAGS)
lib_LTLIBRARIES = libelpa@SUFFIX@.la
libelpa@SUFFIX@_la_LINK = $(FCLINK) $(AM_LDFLAGS) -version-info $(ELPA_SO_VERSION) -lstdc++
libelpa@SUFFIX@_la_SOURCES = src/elpa_utilities.F90 \
libelpa@SUFFIX@_la_SOURCES = src/mod_precision.f90 \
src/elpa_utilities.F90 \
src/elpa1_compute.F90 \
src/elpa1.F90 \
src/elpa2_utilities.F90 \
......
module precision
use iso_c_binding, only : C_FLOAT, C_DOUBLE, C_INT32_T
implicit none
integer, parameter :: rk = C_DOUBLE
integer, parameter :: ck = C_DOUBLE
integer, parameter :: ik = C_INT32_T
end module precision
......@@ -61,6 +61,7 @@ program read_real
! together with standard scalapack routines
!-------------------------------------------------------------------------------
use precision
use ELPA1
use elpa_utilities, only : error_unit
#ifdef WITH_OPENMP
......@@ -80,26 +81,26 @@ program read_real
! nblk: Blocking factor in block cyclic distribution
!-------------------------------------------------------------------------------
integer, parameter :: nblk = 16
integer(kind=ik), parameter :: nblk = 16
!-------------------------------------------------------------------------------
! Local Variables
integer na, nev
integer(kind=ik) :: na, nev
integer np_rows, np_cols, na_rows, na_cols
integer(kind=ik) :: np_rows, np_cols, na_rows, na_cols
integer myid, nprocs, my_prow, my_pcol, mpi_comm_rows, mpi_comm_cols
integer i, mpierr, my_blacs_ctxt, sc_desc(9), info, nprow, npcol, lenarg
integer(kind=ik) :: myid, nprocs, my_prow, my_pcol, mpi_comm_rows, mpi_comm_cols
integer(kind=ik) :: i, mpierr, my_blacs_ctxt, sc_desc(9), info, nprow, npcol, lenarg
integer, external :: numroc
integer, external :: numroc
real*8 err, errmax
real*8, allocatable :: a(:,:), z(:,:), tmp1(:,:), tmp2(:,:), as(:,:), ev(:)
real(kind=rk) :: err, errmax
real(kind=rk), allocatable :: a(:,:), z(:,:), tmp1(:,:), tmp2(:,:), as(:,:), ev(:)
character*256 filename
character*256 :: filename
#ifdef WITH_OPENMP
integer :: omp_get_max_threads, required_mpi_thread_level, provided_mpi_thread_level
integer(kind=iK) :: omp_get_max_threads, required_mpi_thread_level, provided_mpi_thread_level
#endif
!-------------------------------------------------------------------------------
! MPI Initialization
......
......@@ -72,7 +72,7 @@ program test_complex
! with their original authors, but shall adhere to the licensing terms
! distributed along with the original code in the file "COPYING".
!-------------------------------------------------------------------------------
use precision
use ELPA1
use elpa_utilities, only : error_unit
#ifdef WITH_OPENMP
......@@ -101,30 +101,27 @@ program test_complex
! nblk: Blocking factor in block cyclic distribution
!-------------------------------------------------------------------------------
integer :: nblk
integer na, nev
!-------------------------------------------------------------------------------
! Local Variables
integer(kind=ik) :: nblk
integer(kind=ik) :: na, nev
integer :: np_rows, np_cols, na_rows, na_cols
integer(kind=ik) :: np_rows, np_cols, na_rows, na_cols
integer :: myid, nprocs, my_prow, my_pcol, mpi_comm_rows, mpi_comm_cols
integer :: i, mpierr, my_blacs_ctxt, sc_desc(9), info, nprow, npcol
integer(kind=ik) :: myid, nprocs, my_prow, my_pcol, mpi_comm_rows, mpi_comm_cols
integer(kind=ik) :: i, mpierr, my_blacs_ctxt, sc_desc(9), info, nprow, npcol
real*8, allocatable :: ev(:), xr(:,:)
real(kind=rk), allocatable :: ev(:), xr(:,:)
complex*16, allocatable :: a(:,:), z(:,:), tmp1(:,:), tmp2(:,:), as(:,:)
complex(kind=ck), allocatable :: a(:,:), z(:,:), tmp1(:,:), tmp2(:,:), as(:,:)
complex*16, parameter :: CZERO = (0.d0,0.d0), CONE = (1.d0,0.d0)
complex(kind=ck), parameter :: CZERO = (0.d0,0.d0), CONE = (1.d0,0.d0)
integer :: iseed(4096) ! Random seed, size should be sufficient for every generator
integer :: STATUS
integer(kind=ik) :: iseed(4096) ! Random seed, size should be sufficient for every generator
integer(kind=ik) :: STATUS
#ifdef WITH_OPENMP
integer :: omp_get_max_threads, required_mpi_thread_level, provided_mpi_thread_level
integer(kind=ik) :: omp_get_max_threads, required_mpi_thread_level, provided_mpi_thread_level
#endif
logical :: write_to_file
logical :: success
logical :: write_to_file
logical :: success
success = .true.
! read input parameters if they are provided
......
......@@ -77,7 +77,7 @@ program test_complex2
! with their original authors, but shall adhere to the licensing terms
! distributed along with the original code in the file "COPYING".
!-------------------------------------------------------------------------------
use precision
use ELPA1
use ELPA2
use elpa_utilities, only : error_unit
......@@ -108,33 +108,30 @@ program test_complex2
! nblk: Blocking factor in block cyclic distribution
!-------------------------------------------------------------------------------
integer :: nblk
integer na, nev
!-------------------------------------------------------------------------------
! Local Variables
integer(kind=ik) :: nblk
integer(kind=ik) :: na, nev
integer np_rows, np_cols, na_rows, na_cols
integer(kind=ik) :: np_rows, np_cols, na_rows, na_cols
integer myid, nprocs, my_prow, my_pcol, mpi_comm_rows, mpi_comm_cols
integer i, mpierr, my_blacs_ctxt, sc_desc(9), info, nprow, npcol
integer(kind=ik) :: myid, nprocs, my_prow, my_pcol, mpi_comm_rows, mpi_comm_cols
integer(kind=ik) :: i, mpierr, my_blacs_ctxt, sc_desc(9), info, nprow, npcol
integer, external :: numroc
integer, external :: numroc
complex*16, parameter :: CZERO = (0.d0,0.d0), CONE = (1.d0,0.d0)
real*8, allocatable :: ev(:), xr(:,:)
complex(kind=ck), parameter :: CZERO = (0.d0,0.d0), CONE = (1.d0,0.d0)
real(kind=rk), allocatable :: ev(:), xr(:,:)
complex*16, allocatable :: a(:,:), z(:,:), tmp1(:,:), tmp2(:,:), as(:,:)
complex(kind=ck), allocatable :: a(:,:), z(:,:), tmp1(:,:), tmp2(:,:), as(:,:)
integer :: iseed(4096) ! Random seed, size should be sufficient for every generator
integer(kind=ik) :: iseed(4096) ! Random seed, size should be sufficient for every generator
integer :: STATUS
integer(kind=ik) :: STATUS
#ifdef WITH_OPENMP
integer :: omp_get_max_threads, required_mpi_thread_level, provided_mpi_thread_level
integer(kind=ik) :: omp_get_max_threads, required_mpi_thread_level, provided_mpi_thread_level
#endif
logical :: write_to_file
logical :: success
logical :: write_to_file
logical :: success
success = .true.
......
......@@ -78,6 +78,7 @@ program test_complex2
! distributed along with the original code in the file "COPYING".
!-------------------------------------------------------------------------------
use precision
use ELPA1
use ELPA2
use elpa_utilities, only : error_unit
......@@ -112,33 +113,29 @@ program test_complex2
! nblk: Blocking factor in block cyclic distribution
!-------------------------------------------------------------------------------
integer :: nblk
integer na, nev
integer(kind=ik) :: nblk
integer(kind=ik) :: na, nev
integer(kind=ik) :: np_rows, np_cols, na_rows, na_cols
!-------------------------------------------------------------------------------
! Local Variables
integer np_rows, np_cols, na_rows, na_cols
integer myid, nprocs, my_prow, my_pcol, mpi_comm_rows, mpi_comm_cols
integer i, mpierr, my_blacs_ctxt, sc_desc(9), info, nprow, npcol
integer(kind=ik) :: myid, nprocs, my_prow, my_pcol, mpi_comm_rows, mpi_comm_cols
integer(kind=ik) :: i, mpierr, my_blacs_ctxt, sc_desc(9), info, nprow, npcol
integer, external :: numroc
integer, external :: numroc
real*8, allocatable :: ev(:), xr(:,:)
real(kind=rk), allocatable :: ev(:), xr(:,:)
complex*16, allocatable :: a(:,:), z(:,:), tmp1(:,:), tmp2(:,:), as(:,:)
complex(kind=ck), allocatable :: a(:,:), z(:,:), tmp1(:,:), tmp2(:,:), as(:,:)
complex*16, parameter :: CZERO = (0.d0,0.d0), CONE = (1.d0,0.d0)
complex(kind=ck), parameter :: CZERO = (0.d0,0.d0), CONE = (1.d0,0.d0)
integer :: iseed(4096) ! Random seed, size should be sufficient for every generator
integer(kind=ik) :: iseed(4096) ! Random seed, size should be sufficient for every generator
integer :: STATUS
integer(kind=ik) :: STATUS
#ifdef WITH_OPENMP
integer :: omp_get_max_threads, required_mpi_thread_level, provided_mpi_thread_level
integer(kind=ik) :: omp_get_max_threads, required_mpi_thread_level, provided_mpi_thread_level
#endif
logical :: write_to_file
logical :: success
logical :: write_to_file
logical :: success
success = .true.
......
......@@ -77,7 +77,7 @@ program test_complex2
! with their original authors, but shall adhere to the licensing terms
! distributed along with the original code in the file "COPYING".
!-------------------------------------------------------------------------------
use precision
use ELPA1
use ELPA2
......@@ -110,33 +110,30 @@ program test_complex2
! nblk: Blocking factor in block cyclic distribution
!-------------------------------------------------------------------------------
integer :: nblk
integer na, nev
!-------------------------------------------------------------------------------
! Local Variables
integer(kind=ik) :: nblk
integer(kind=ik) :: na, nev
integer np_rows, np_cols, na_rows, na_cols
integer(kind=ik) :: np_rows, np_cols, na_rows, na_cols
integer myid, nprocs, my_prow, my_pcol, mpi_comm_rows, mpi_comm_cols
integer i, mpierr, my_blacs_ctxt, sc_desc(9), info, nprow, npcol
integer(kind=ik) :: myid, nprocs, my_prow, my_pcol, mpi_comm_rows, mpi_comm_cols
integer(kind=ik) :: i, mpierr, my_blacs_ctxt, sc_desc(9), info, nprow, npcol
integer, external :: numroc
integer, external :: numroc
real*8, allocatable :: ev(:), xr(:,:)
real(kind=rk), allocatable :: ev(:), xr(:,:)
complex*16, allocatable :: a(:,:), z(:,:), tmp1(:,:), tmp2(:,:), as(:,:)
complex(kind=ck), allocatable :: a(:,:), z(:,:), tmp1(:,:), tmp2(:,:), as(:,:)
complex*16, parameter :: CZERO = (0.d0,0.d0), CONE = (1.d0,0.d0)
complex(kind=ck), parameter :: CZERO = (0.d0,0.d0), CONE = (1.d0,0.d0)
integer :: iseed(4096) ! Random seed, size should be sufficient for every generator
integer(kind=ik) :: iseed(4096) ! Random seed, size should be sufficient for every generator
integer :: STATUS
integer(kind=ik) :: STATUS
#ifdef WITH_OPENMP
integer :: omp_get_max_threads, required_mpi_thread_level, provided_mpi_thread_level
integer(kind=ik) :: omp_get_max_threads, required_mpi_thread_level, provided_mpi_thread_level
#endif
logical :: write_to_file
logical :: success
logical :: write_to_file
logical :: success
success = .true.
......
......@@ -73,7 +73,7 @@ program test_real
! distributed along with the original code in the file "COPYING".
!
!-------------------------------------------------------------------------------
use precision
use ELPA1
use elpa_utilities, only : error_unit
#ifdef WITH_OPENMP
......@@ -102,32 +102,27 @@ program test_real
! nev: Number of eigenvectors to be calculated
! nblk: Blocking factor in block cyclic distribution
!-------------------------------------------------------------------------------
integer :: nblk
integer na, nev
!-------------------------------------------------------------------------------
! Local Variables
integer :: np_rows, np_cols, na_rows, na_cols
integer(kind=ik) :: nblk
integer(kind=ik) :: na, nev
integer :: myid, nprocs, my_prow, my_pcol, mpi_comm_rows, mpi_comm_cols
integer :: i, mpierr, my_blacs_ctxt, sc_desc(9), info, nprow, npcol
integer(kind=ik) :: np_rows, np_cols, na_rows, na_cols
integer, external :: numroc
integer(kind=ik) :: myid, nprocs, my_prow, my_pcol, mpi_comm_rows, mpi_comm_cols
integer(kind=ik) :: i, mpierr, my_blacs_ctxt, sc_desc(9), info, nprow, npcol
real*8, allocatable :: a(:,:), z(:,:), tmp1(:,:), tmp2(:,:), as(:,:), ev(:)
integer, external :: numroc
integer :: iseed(4096) ! Random seed, size should be sufficient for every generator
real(kind=rk), allocatable :: a(:,:), z(:,:), tmp1(:,:), tmp2(:,:), as(:,:), ev(:)
integer(kind=ik) :: iseed(4096) ! Random seed, size should be sufficient for every generator
integer :: STATUS
integer(kind=ik) :: STATUS
#ifdef WITH_OPENMP
integer :: omp_get_max_threads, required_mpi_thread_level, &
provided_mpi_thread_level
integer(kind=ik) :: omp_get_max_threads, required_mpi_thread_level, &
provided_mpi_thread_level
#endif
logical :: write_to_file
logical :: success
logical :: write_to_file
logical :: success
!-------------------------------------------------------------------------------
success = .true.
......
......@@ -78,7 +78,7 @@ program test_real2
! distributed along with the original code in the file "COPYING".
!
!-------------------------------------------------------------------------------
use precision
use ELPA1
use ELPA2
use elpa_utilities, only : error_unit
......@@ -108,28 +108,25 @@ program test_real2
! nblk: Blocking factor in block cyclic distribution
!-------------------------------------------------------------------------------
integer :: nblk
integer na, nev
!-------------------------------------------------------------------------------
! Local Variables
integer(kind=ik) :: nblk
integer(kind=ik) :: na, nev
integer np_rows, np_cols, na_rows, na_cols
integer(kind=ik) :: np_rows, np_cols, na_rows, na_cols
integer myid, nprocs, my_prow, my_pcol, mpi_comm_rows, mpi_comm_cols
integer i, mpierr, my_blacs_ctxt, sc_desc(9), info, nprow, npcol
integer(kind=ik) :: myid, nprocs, my_prow, my_pcol, mpi_comm_rows, mpi_comm_cols
integer(kind=ik) :: i, mpierr, my_blacs_ctxt, sc_desc(9), info, nprow, npcol
integer, external :: numroc
integer, external :: numroc
real*8, allocatable :: a(:,:), z(:,:), tmp1(:,:), tmp2(:,:), as(:,:), ev(:)
real(kind=rk), allocatable :: a(:,:), z(:,:), tmp1(:,:), tmp2(:,:), as(:,:), ev(:)
integer :: iseed(4096) ! Random seed, size should be sufficient for every generator
integer :: STATUS
integer(kind=ik) :: iseed(4096) ! Random seed, size should be sufficient for every generator
integer(kind=ik) :: STATUS
#ifdef WITH_OPENMP
integer :: omp_get_max_threads, required_mpi_thread_level, provided_mpi_thread_level
integer(kind=ik) :: omp_get_max_threads, required_mpi_thread_level, provided_mpi_thread_level
#endif
logical :: write_to_file
logical :: success
logical :: write_to_file
logical :: success
success = .true.
......
......@@ -78,7 +78,7 @@ program test_real2
! distributed along with the original code in the file "COPYING".
!
!-------------------------------------------------------------------------------
use precision
use ELPA1
use ELPA2
......@@ -113,28 +113,25 @@ program test_real2
! nblk: Blocking factor in block cyclic distribution
!-------------------------------------------------------------------------------
integer :: nblk
integer na, nev
!-------------------------------------------------------------------------------
! Local Variables
integer(kind=ik) :: nblk
integer(kind=ik) :: na, nev
integer np_rows, np_cols, na_rows, na_cols
integer(kind=ik) :: np_rows, np_cols, na_rows, na_cols
integer myid, nprocs, my_prow, my_pcol, mpi_comm_rows, mpi_comm_cols
integer i, mpierr, my_blacs_ctxt, sc_desc(9), info, nprow, npcol
integer(kind=ik) :: myid, nprocs, my_prow, my_pcol, mpi_comm_rows, mpi_comm_cols
integer(kind=ik) :: i, mpierr, my_blacs_ctxt, sc_desc(9), info, nprow, npcol
integer, external :: numroc
integer, external :: numroc
real*8, allocatable :: a(:,:), z(:,:), tmp1(:,:), tmp2(:,:), as(:,:), ev(:)
real(kind=rk), allocatable :: a(:,:), z(:,:), tmp1(:,:), tmp2(:,:), as(:,:), ev(:)
integer :: iseed(4096) ! Random seed, size should be sufficient for every generator
integer :: STATUS
integer(kind=ik) :: iseed(4096) ! Random seed, size should be sufficient for every generator
integer(kind=ik) :: STATUS
#ifdef WITH_OPENMP
integer :: omp_get_max_threads, required_mpi_thread_level, provided_mpi_thread_level
integer(kind=ik) :: omp_get_max_threads, required_mpi_thread_level, provided_mpi_thread_level
#endif
logical :: write_to_file
logical :: success
logical :: write_to_file
logical :: success
success = .true.
......
......@@ -78,7 +78,7 @@ program test_real2
! distributed along with the original code in the file "COPYING".
!
!-------------------------------------------------------------------------------
use precision
use ELPA1
use ELPA2
use elpa_utilities, only : error_unit
......@@ -111,28 +111,25 @@ program test_real2
! nblk: Blocking factor in block cyclic distribution
!-------------------------------------------------------------------------------
integer :: nblk
integer na, nev
!-------------------------------------------------------------------------------
! Local Variables
integer(kind=ik) :: nblk
integer(kind=ik) :: na, nev
integer np_rows, np_cols, na_rows, na_cols
integer(kind=ik) :: np_rows, np_cols, na_rows, na_cols
integer myid, nprocs, my_prow, my_pcol, mpi_comm_rows, mpi_comm_cols
integer i, mpierr, my_blacs_ctxt, sc_desc(9), info, nprow, npcol
integer(kind=ik) :: myid, nprocs, my_prow, my_pcol, mpi_comm_rows, mpi_comm_cols
integer(kind=ik) :: i, mpierr, my_blacs_ctxt, sc_desc(9), info, nprow, npcol
integer, external :: numroc
integer, external :: numroc
real*8, allocatable :: a(:,:), z(:,:), tmp1(:,:), tmp2(:,:), as(:,:), ev(:)
real(kind=rk), allocatable :: a(:,:), z(:,:), tmp1(:,:), tmp2(:,:), as(:,:), ev(:)
integer :: iseed(4096) ! Random seed, size should be sufficient for every generator
integer :: STATUS
integer(kind=ik) :: iseed(4096) ! Random seed, size should be sufficient for every generator
integer(kind=ik) :: STATUS
#ifdef WITH_OPENMP
integer :: omp_get_max_threads, required_mpi_thread_level, provided_mpi_thread_level
integer(kind=ik) :: omp_get_max_threads, required_mpi_thread_level, provided_mpi_thread_level
#endif
logical :: write_to_file
logical :: success
logical :: write_to_file
logical :: success
success = .true.
......
......@@ -79,7 +79,7 @@ program test_real2
! distributed along with the original code in the file "COPYING".
!
!-------------------------------------------------------------------------------
use precision
use ELPA1
use ELPA2
use elpa_utilities, only : error_unit
......@@ -112,28 +112,25 @@ program test_real2
! nblk: Blocking factor in block cyclic distribution
!-------------------------------------------------------------------------------
integer :: nblk
integer na, nev
!-------------------------------------------------------------------------------
! Local Variables
integer(kind=ik) :: nblk
integer(kind=ik) :: na, nev
integer np_rows, np_cols, na_rows, na_cols
integer(kind=ik) :: np_rows, np_cols, na_rows, na_cols
integer myid, nprocs, my_prow, my_pcol, mpi_comm_rows, mpi_comm_cols
integer i, mpierr, my_blacs_ctxt, sc_desc(9), info, nprow, npcol
integer(kind=ik) :: myid, nprocs, my_prow, my_pcol, mpi_comm_rows, mpi_comm_cols
integer(kind=ik) :: i, mpierr, my_blacs_ctxt, sc_desc(9), info, nprow, npcol
integer, external :: numroc
integer, external :: numroc
real*8, allocatable :: a(:,:), z(:,:), tmp1(:,:), tmp2(:,:), as(:,:), ev(:)
real(kind=rk), allocatable :: a(:,:), z(:,:), tmp1(:,:), tmp2(:,:), as(:,:), ev(:)
integer :: iseed(4096) ! Random seed, size should be sufficient for every generator
integer :: STATUS
integer(kind=ik) :: iseed(4096) ! Random seed, size should be sufficient for every generator
integer(kind=ik) :: STATUS
#ifdef WITH_OPENMP
integer :: omp_get_max_threads, required_mpi_thread_level, provided_mpi_thread_level
integer(kind=ik) :: omp_get_max_threads, required_mpi_thread_level, provided_mpi_thread_level
#endif
logical :: write_to_file
logical :: success
logical :: write_to_file
logical :: success
success = .true.
write_to_file = .false.
......
......@@ -73,7 +73,7 @@ program test_real
! distributed along with the original code in the file "COPYING".
!
!-------------------------------------------------------------------------------
use precision
use ELPA1
use elpa_utilities, only : error_unit
use from_c
......@@ -103,38 +103,33 @@ program test_real
! nev: Number of eigenvectors to be calculated
! nblk: Blocking factor in block cyclic distribution
!-------------------------------------------------------------------------------
integer :: nblk
integer na, nev
!-------------------------------------------------------------------------------
! Local Variables
integer :: np_rows, np_cols, na_rows, na_cols
integer(kind=ik) :: nblk
integer(kind=ik) :: na, nev
integer :: myid, nprocs, my_prow, my_pcol, mpi_comm_rows, mpi_comm_cols
integer :: mpi_comm_rows_fromC, mpi_comm_cols_fromC
integer :: i, mpierr, my_blacs_ctxt, sc_desc(9), info, nprow, npcol,j
integer(kind=ik) :: np_rows, np_cols, na_rows, na_cols
integer :: my_prowFromC, my_pcolFromC
integer, external :: numroc
integer(kind=ik) :: myid, nprocs, my_prow, my_pcol, mpi_comm_rows, mpi_comm_cols