Commit dfebb1d7 authored by Victor Yu's avatar Victor Yu

Merge branch 'nag_compilation' into 'master'

Make ELSI interface compile with NAG Fortran 6.2

See merge request elsi-devel/elsi-interface!88
parents a8b4ae57 5e24abc3
......@@ -333,7 +333,7 @@ subroutine elsi_solve_elpa_real(ph,bh,row_map,col_map,ham,ovlp,eval,evec)
! Compute sparsity
if(bh%nnz_g == UNSET) then
if(bh%nnz_l == UNSET) then
call elsi_get_nnz(bh%def0,ham,bh%n_lrow,bh%n_lcol,bh%nnz_l)
call elsi_get_nnz(bh%def0,bh%n_lrow,bh%n_lcol,ham,bh%nnz_l)
end if
call MPI_Allreduce(bh%nnz_l,bh%nnz_g,1,mpi_integer4,mpi_sum,bh%comm,ierr)
......@@ -683,7 +683,7 @@ subroutine elsi_solve_elpa_cmplx(ph,bh,row_map,col_map,ham,ovlp,eval,evec)
! Compute sparsity
if(bh%nnz_g == UNSET) then
if(bh%nnz_l == UNSET) then
call elsi_get_nnz(bh%def0,ham,bh%n_lrow,bh%n_lcol,bh%nnz_l)
call elsi_get_nnz(bh%def0,bh%n_lrow,bh%n_lcol,ham,bh%nnz_l)
end if
call MPI_Allreduce(bh%nnz_l,bh%nnz_g,1,mpi_integer4,mpi_sum,bh%comm,ierr)
......
......@@ -410,13 +410,11 @@ subroutine elsi_dm_real_c_wrapper(h_c,ham_c,ovlp_c,dm_c,energy)&
real(kind=c_double), pointer :: ovlp_f(:,:)
real(kind=c_double), pointer :: dm_f(:,:)
integer(kind=c_int) :: n_basis
integer(kind=c_int) :: lrow
integer(kind=c_int) :: lcol
call c_f_pointer(h_c,h_f)
n_basis = h_f%ph%n_basis
lrow = h_f%bh%n_lrow
lcol = h_f%bh%n_lcol
......@@ -444,13 +442,11 @@ subroutine elsi_dm_complex_c_wrapper(h_c,ham_c,ovlp_c,dm_c,energy)&
complex(kind=c_double_complex), pointer :: ovlp_f(:,:)
complex(kind=c_double_complex), pointer :: dm_f(:,:)
integer(kind=c_int) :: n_basis
integer(kind=c_int) :: lrow
integer(kind=c_int) :: lcol
call c_f_pointer(h_c,h_f)
n_basis = h_f%ph%n_basis
lrow = h_f%bh%n_lrow
lcol = h_f%bh%n_lcol
......
......@@ -348,7 +348,7 @@ subroutine elsi_solve_elpa_real(ph,bh,row_map,col_map,ham,ovlp,eval,evec)
! Compute sparsity
if(bh%nnz_g == UNSET) then
if(bh%nnz_l == UNSET) then
call elsi_get_nnz(bh%def0,ham,bh%n_lrow,bh%n_lcol,bh%nnz_l)
call elsi_get_nnz(bh%def0,bh%n_lrow,bh%n_lcol,ham,bh%nnz_l)
end if
call MPI_Allreduce(bh%nnz_l,bh%nnz_g,1,mpi_integer4,mpi_sum,bh%comm,ierr)
......@@ -700,7 +700,7 @@ subroutine elsi_solve_elpa_cmplx(ph,bh,row_map,col_map,ham,ovlp,eval,evec)
! Compute sparsity
if(bh%nnz_g == UNSET) then
if(bh%nnz_l == UNSET) then
call elsi_get_nnz(bh%def0,ham,bh%n_lrow,bh%n_lcol,bh%nnz_l)
call elsi_get_nnz(bh%def0,bh%n_lrow,bh%n_lcol,ham,bh%nnz_l)
end if
call MPI_Allreduce(bh%nnz_l,bh%nnz_g,1,mpi_integer4,mpi_sum,bh%comm,ierr)
......
......@@ -13,7 +13,6 @@ module ELSI_NTPOLY
NTPOLY_HPCP
use ELSI_DATATYPE, only: elsi_param_t,elsi_basic_t
use ELSI_IO, only: elsi_say,elsi_get_time
use ELSI_MALLOC, only: elsi_allocate,elsi_deallocate
use ELSI_MPI, only: elsi_check_mpi,mpi_logical
use ELSI_PRECISION, only: r8,i4
use NTPOLY, only: PM,TRS2,TRS4,HPCP,EnergyDensityMatrix,LowdinExtrapolate,&
......@@ -227,7 +226,6 @@ subroutine elsi_update_dm_ntpoly(ph,bh,ovlp0,ovlp1,dm0,dm1)
type(Matrix_ps), intent(inout) :: dm0
type(Matrix_ps), intent(inout) :: dm1
integer(kind=i4) :: ne
real(kind=r8) :: t0
real(kind=r8) :: t1
character(len=200) :: msg
......@@ -236,8 +234,6 @@ subroutine elsi_update_dm_ntpoly(ph,bh,ovlp0,ovlp1,dm0,dm1)
call elsi_get_time(t0)
ne = int(ph%n_electrons,kind=i4)
if(ph%solver /= NTPOLY_SOLVER) then
call DestructPermutation(ph%nt_perm)
call ConstructRandomPermutation(ph%nt_perm,ovlp0%logical_matrix_dimension)
......
......@@ -11,7 +11,7 @@ module ELSI_OCC
use ELSI_CONSTANTS, only: GAUSSIAN,FERMI,METHFESSEL_PAXTON,COLD,CUBIC,&
SQRT_PI,INVERT_SQRT_PI
use ELSI_DATATYPE, only: elsi_handle,elsi_param_t,elsi_basic_t
use ELSI_DATATYPE, only: elsi_param_t,elsi_basic_t
use ELSI_IO, only: elsi_say
use ELSI_MALLOC, only: elsi_allocate,elsi_deallocate
use ELSI_MPI, only: elsi_stop,elsi_check_mpi,mpi_sum,mpi_real8
......
......@@ -107,7 +107,7 @@ subroutine elsi_solve_omm_real(ph,bh,ham,ovlp,coeff,dm)
! Compute sparsity
if(bh%nnz_g == UNSET) then
if(bh%nnz_l == UNSET) then
call elsi_get_nnz(bh%def0,ham,bh%n_lrow,bh%n_lcol,bh%nnz_l)
call elsi_get_nnz(bh%def0,bh%n_lrow,bh%n_lcol,ham,bh%nnz_l)
end if
call MPI_Allreduce(bh%nnz_l,bh%nnz_g,1,mpi_integer4,mpi_sum,bh%comm,ierr)
......@@ -259,7 +259,7 @@ subroutine elsi_solve_omm_cmplx(ph,bh,ham,ovlp,coeff,dm)
! Compute sparsity
if(bh%nnz_g == UNSET) then
if(bh%nnz_l == UNSET) then
call elsi_get_nnz(bh%def0,ham,bh%n_lrow,bh%n_lcol,bh%nnz_l)
call elsi_get_nnz(bh%def0,bh%n_lrow,bh%n_lcol,ham,bh%nnz_l)
end if
call MPI_Allreduce(bh%nnz_l,bh%nnz_g,1,mpi_integer4,mpi_sum,bh%comm,ierr)
......
......@@ -13,7 +13,7 @@ module ELSI_REDIST
use ELSI_IO, only: elsi_say,elsi_get_time
use ELSI_MALLOC, only: elsi_allocate,elsi_deallocate
use ELSI_MPI, only: elsi_check_mpi,mpi_sum,mpi_real8,mpi_complex16,&
mpi_integer4,mpi_comm_self
mpi_integer4
use ELSI_NTPOLY, only: Triplet_r,Triplet_c,TripletList_r,TripletList_c,&
Matrix_ps,ConstructEmptyMatrix,FillMatrixFromTripletList,&
GetMatrixTripletList,ConstructTripletList,AppendToTripletList,&
......@@ -438,11 +438,11 @@ subroutine elsi_blacs_to_pexsi_hs_real(ph,bh,ham_den,ovlp_den,ham_sp,ovlp_sp,&
if(ph%first_blacs_to_pexsi) then
if(.not. ph%unit_ovlp) then
call elsi_get_nnz(bh%def0,ovlp_den,bh%n_lrow,bh%n_lcol,bh%nnz_l)
call elsi_get_nnz(bh%def0,bh%n_lrow,bh%n_lcol,ovlp_den,bh%nnz_l)
call elsi_allocate(bh,s_val_send,bh%nnz_l,"s_val_send",caller)
else
call elsi_get_nnz(bh%def0,ham_den,bh%n_lrow,bh%n_lcol,bh%nnz_l)
call elsi_get_nnz(bh%def0,bh%n_lrow,bh%n_lcol,ham_den,bh%nnz_l)
end if
end if
......@@ -767,11 +767,11 @@ subroutine elsi_blacs_to_pexsi_hs_cmplx(ph,bh,ham_den,ovlp_den,ham_sp,ovlp_sp,&
if(ph%first_blacs_to_pexsi) then
if(.not. ph%unit_ovlp) then
call elsi_get_nnz(bh%def0,ovlp_den,bh%n_lrow,bh%n_lcol,bh%nnz_l)
call elsi_get_nnz(bh%def0,bh%n_lrow,bh%n_lcol,ovlp_den,bh%nnz_l)
call elsi_allocate(bh,s_val_send,bh%nnz_l,"s_val_send",caller)
else
call elsi_get_nnz(bh%def0,ham_den,bh%n_lrow,bh%n_lcol,bh%nnz_l)
call elsi_get_nnz(bh%def0,bh%n_lrow,bh%n_lcol,ham_den,bh%nnz_l)
end if
end if
......@@ -1579,11 +1579,11 @@ subroutine elsi_blacs_to_sips_hs_real(ph,bh,ham_den,ovlp_den,ham_sp,ovlp_sp,&
if(ph%first_blacs_to_sips) then
if(.not. ph%unit_ovlp) then
call elsi_get_nnz(bh%def0,ovlp_den,bh%n_lrow,bh%n_lcol,bh%nnz_l)
call elsi_get_nnz(bh%def0,bh%n_lrow,bh%n_lcol,ovlp_den,bh%nnz_l)
call elsi_allocate(bh,s_val_send,bh%nnz_l,"s_val_send",caller)
else
call elsi_get_nnz(bh%def0,ham_den,bh%n_lrow,bh%n_lcol,bh%nnz_l)
call elsi_get_nnz(bh%def0,bh%n_lrow,bh%n_lcol,ham_den,bh%nnz_l)
end if
end if
......@@ -1801,11 +1801,11 @@ subroutine elsi_blacs_to_sips_hs_cmplx(ph,bh,ham_den,ovlp_den,ham_sp,ovlp_sp,&
if(ph%first_blacs_to_sips) then
if(.not. ph%unit_ovlp) then
call elsi_get_nnz(bh%def0,ovlp_den,bh%n_lrow,bh%n_lcol,bh%nnz_l)
call elsi_get_nnz(bh%def0,bh%n_lrow,bh%n_lcol,ovlp_den,bh%nnz_l)
call elsi_allocate(bh,s_val_send,bh%nnz_l,"s_val_send",caller)
else
call elsi_get_nnz(bh%def0,ham_den,bh%n_lrow,bh%n_lcol,bh%nnz_l)
call elsi_get_nnz(bh%def0,bh%n_lrow,bh%n_lcol,ham_den,bh%nnz_l)
end if
end if
......@@ -2615,7 +2615,7 @@ subroutine elsi_blacs_to_sips_dm_real(ph,bh,dm_den,dm_sp,row_ind,col_ptr)
call elsi_get_time(t0)
call elsi_get_nnz(bh%def0,dm_den,bh%n_lrow,bh%n_lcol,bh%nnz_l)
call elsi_get_nnz(bh%def0,bh%n_lrow,bh%n_lcol,dm_den,bh%nnz_l)
call elsi_allocate(bh,val_send,bh%nnz_l,"val_send",caller)
call elsi_allocate(bh,row_send,bh%nnz_l,"row_send",caller)
......@@ -2771,7 +2771,7 @@ subroutine elsi_blacs_to_sips_dm_cmplx(ph,bh,dm_den,dm_sp,row_ind,col_ptr)
call elsi_get_time(t0)
call elsi_get_nnz(bh%def0,dm_den,bh%n_lrow,bh%n_lcol,bh%nnz_l)
call elsi_get_nnz(bh%def0,bh%n_lrow,bh%n_lcol,dm_den,bh%nnz_l)
call elsi_allocate(bh,val_send,bh%nnz_l,"val_send",caller)
call elsi_allocate(bh,row_send,bh%nnz_l,"row_send",caller)
......@@ -3351,7 +3351,7 @@ subroutine elsi_blacs_to_siesta_dm_real(bh,dm_den,dm_sp,row_ind,col_ptr)
call elsi_get_time(t0)
call elsi_get_nnz(bh%def0,dm_den,bh%n_lrow,bh%n_lcol,bh%nnz_l)
call elsi_get_nnz(bh%def0,bh%n_lrow,bh%n_lcol,dm_den,bh%nnz_l)
call elsi_allocate(bh,dest,bh%nnz_l,"dest",caller)
call elsi_allocate(bh,perm,bh%nnz_l,"perm",caller)
......@@ -3517,7 +3517,7 @@ subroutine elsi_blacs_to_siesta_dm_cmplx(bh,dm_den,dm_sp,row_ind,col_ptr)
call elsi_get_time(t0)
call elsi_get_nnz(bh%def0,dm_den,bh%n_lrow,bh%n_lcol,bh%nnz_l)
call elsi_get_nnz(bh%def0,bh%n_lrow,bh%n_lcol,dm_den,bh%nnz_l)
call elsi_allocate(bh,dest,bh%nnz_l,"dest",caller)
call elsi_allocate(bh,perm,bh%nnz_l,"perm",caller)
......
......@@ -17,7 +17,7 @@ module ELSI_RW
use ELSI_MALLOC, only: elsi_allocate,elsi_deallocate
use ELSI_MPI, only: mpi_sum,mpi_real8,mpi_complex16,mpi_integer4,&
mpi_mode_rdonly,mpi_mode_wronly,mpi_mode_create,mpi_info_null,&
mpi_status_ignore,mpi_success,elsi_stop,elsi_check_mpi
mpi_status_ignore,elsi_stop,elsi_check_mpi
use ELSI_PRECISION, only: r8,i4,i8
use ELSI_REDIST, only: elsi_sips_to_blacs_dm,elsi_blacs_to_sips_hs,&
elsi_blacs_to_sips_hs_dim
......@@ -1647,7 +1647,7 @@ subroutine elsi_write_mat_real_sp(rwh,f_name,mat)
character(len=*), parameter :: caller = "elsi_write_mat_real_sp"
! Compute nnz
call elsi_get_nnz(rwh%bh%def0,mat,rwh%bh%n_lrow,rwh%bh%n_lcol,nnz_g)
call elsi_get_nnz(rwh%bh%def0,rwh%bh%n_lrow,rwh%bh%n_lcol,mat,nnz_g)
! Convert to CSC
call elsi_allocate(rwh%bh,col_ptr,rwh%n_basis+1,"col_ptr",caller)
......@@ -1738,7 +1738,7 @@ subroutine elsi_write_mat_complex_sp(rwh,f_name,mat)
character(len=*), parameter :: caller = "elsi_write_mat_complex_sp"
! Compute nnz
call elsi_get_nnz(rwh%bh%def0,mat,rwh%bh%n_lrow,rwh%bh%n_lcol,nnz_g)
call elsi_get_nnz(rwh%bh%def0,rwh%bh%n_lrow,rwh%bh%n_lcol,mat,nnz_g)
! Convert to CSC
call elsi_allocate(rwh%bh,col_ptr,rwh%n_basis+1,"col_ptr",caller)
......
......@@ -11,10 +11,10 @@ module ELSI_SETUP
use ELSI_CONSTANTS, only: ELPA_SOLVER,PEXSI_SOLVER,SINGLE_PROC,MULTI_PROC,&
PEXSI_CSC,SIESTA_CSC,UNSET
use ELSI_DATATYPE, only: elsi_handle,elsi_param_t,elsi_basic_t
use ELSI_DATATYPE, only: elsi_handle
use ELSI_ELPA, only: elsi_cleanup_elpa
use ELSI_IO, only: elsi_say,elsi_final_print,fjson_close_file,&
fjson_finish_array,fjson_reset_fj_handle
use ELSI_IO, only: elsi_final_print,fjson_close_file,fjson_finish_array,&
fjson_reset_fj_handle
use ELSI_MALLOC, only: elsi_allocate,elsi_deallocate
use ELSI_NTPOLY, only: elsi_cleanup_ntpoly
use ELSI_OMM, only: elsi_cleanup_omm
......
......@@ -13,8 +13,7 @@ module ELSI_TOOLS
use ELSI_CONSTANTS, only: ELPA_SOLVER
use ELSI_DATATYPE, only: elsi_handle
use ELSI_ELPA, only: elsi_update_dm_elpa
use ELSI_MALLOC, only: elsi_allocate
use ELSI_NTPOLY, only: elsi_init_ntpoly,elsi_update_dm_ntpoly,CopyMatrix
use ELSI_NTPOLY, only: elsi_update_dm_ntpoly,CopyMatrix
use ELSI_OCC, only: elsi_mu_and_occ,elsi_entropy
use ELSI_PRECISION, only: i4,r8
use ELSI_REDIST, only: elsi_blacs_to_ntpoly_hs,elsi_ntpoly_to_blacs_dm
......
......@@ -459,14 +459,14 @@ end subroutine
!>
!! This routine counts the number of non_zero elements in a matrix.
!!
subroutine elsi_get_nnz_real(def0,mat,n_row,n_col,nnz)
subroutine elsi_get_nnz_real(def0,n_row,n_col,mat,nnz)
implicit none
real(kind=r8), intent(in) :: def0
real(kind=r8), intent(in) :: mat(n_row,n_col)
integer(kind=i4), intent(in) :: n_row
integer(kind=i4), intent(in) :: n_col
real(kind=r8), intent(in) :: mat(n_row,n_col)
integer(kind=i4), intent(out) :: nnz
integer(kind=i4) :: i_row
......@@ -489,14 +489,14 @@ end subroutine
!>
!! This routine counts the number of non_zero elements in a matrix.
!!
subroutine elsi_get_nnz_cmplx(def0,mat,n_row,n_col,nnz)
subroutine elsi_get_nnz_cmplx(def0,n_row,n_col,mat,nnz)
implicit none
real(kind=r8), intent(in) :: def0
complex(kind=r8), intent(in) :: mat(n_row,n_col)
integer(kind=i4), intent(in) :: n_row
integer(kind=i4), intent(in) :: n_col
complex(kind=r8), intent(in) :: mat(n_row,n_col)
integer(kind=i4), intent(out) :: nnz
integer(kind=i4) :: i_row
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment