Merge branch 'fix-gnu-warning' into 'develop'

Tackle GNU warnings.

See merge request QEF/q-e!1439
This commit is contained in:
giannozz 2021-06-15 16:31:18 +00:00
commit 5673f1a842
7 changed files with 35 additions and 13 deletions

View File

@ -648,8 +648,7 @@ MODULE io_base
TYPE ( qeh5_file) :: h5file
TYPE ( qeh5_dataset) :: h5dset_mill, h5dset_rho_g
CHARACTER(LEN=10) :: tempchar, datasets(4)
#endif !
#endif
!
ngm = SIZE (rho, 1)
IF (ngm /= SIZE (ig_l2g, 1) ) &

View File

@ -105,17 +105,21 @@ subroutine g_1psi (lda, n, psi, e)
!
USE kinds
USE noncollin_module, ONLY : npol
USE iso_c_binding
implicit none
integer :: lda, & ! input: the leading dimension of psi
n ! input: the real dimension of psi
complex(DP) :: psi (lda, npol) ! inp/out: the psi vector
real(DP) :: e ! input: the eigenvectors
real(DP), target :: e ! input: the eigenvectors
real(DP), dimension(:), pointer :: e_vec
!
call start_clock ('g_1psi')
CALL g_psi (lda, n, 1, npol, psi, e)
! cast scalar to size 1 vector to exactly match g_psi argument type
call C_F_POINTER(C_LOC(e), e_vec, [1])
CALL g_psi (lda, n, 1, npol, psi, e_vec)
call stop_clock ('g_1psi')

View File

@ -88,20 +88,31 @@ subroutine g_1psi_gpu (lda, n, psi_d, e_d)
!
USE kinds
USE noncollin_module, ONLY : npol
USE iso_c_binding
#if defined(__CUDA)
USE cudafor
#endif
implicit none
integer :: lda, & ! input: the leading dimension of psi
n ! input: the real dimension of psi
complex(DP) :: psi_d (lda, npol) ! inp/out: the psi vector
real(DP) :: e_d ! input: the eigenvectors
real(DP), target :: e_d ! input: the eigenvectors
real(DP), dimension(:), pointer :: e_d_vec
#if defined(__CUDA)
attributes(device) :: psi_d, e_d
attributes(device) :: psi_d, e_d, e_d_vec
#endif
!
call start_clock ('g_1psi')
CALL g_psi_gpu (lda, n, 1, npol, psi_d, e_d)
! cast scalar to size 1 vector to exactly match g_psi_gpu argument type
#if defined(__CUDA)
call C_F_POINTER(C_DEVLOC(e_d), e_d_vec, [1])
#else
call C_F_POINTER(C_LOC(e_d), e_d_vec, [1])
#endif
CALL g_psi_gpu (lda, n, 1, npol, psi_d, e_d_vec)
call stop_clock ('g_1psi')

View File

@ -138,7 +138,7 @@
! CELL_PARAMETERS
!
if ( line(1:15) .eq. 'CELL_PARAMETERS' ) then
line = line(16:len)
line(1:15) = ' '
len = string_length(line)
cell_f = 1d0 ! default unit for CELL_PARAMETERS is asumed in units of celldm(1)
!
@ -166,7 +166,7 @@
!
elseif ( line(1:16) .eq. 'ATOMIC_POSITIONS' ) then
! find out the length-unit
line = line(17:len)
line(1:16) = ' '
len = string_length(line)
atomic_posunit = ALAT_UNIT
if (len.gt.0 ) then
@ -227,7 +227,7 @@
!
if ( line(1:16) .eq. 'ATOMIC_POSITIONS' ) then
! find out the length-unit
line = line(17:len)
line(1:16) = ' '
len = string_length(line)
! default is leave unchanged
if (len.gt.0 ) then

View File

@ -1360,6 +1360,7 @@ CONTAINS
#else
CALL xclib_infomsg( 'get_libxc_ext_param', 'WARNING: an external parameter&
&was sought in Libxc, but Libxc is not active' )
get_libxc_ext_param = 0.d0
#endif
RETURN
END FUNCTION

View File

@ -809,6 +809,7 @@ SUBROUTINE gcc_spin( length, rho_in, zeta_io, grho_in, sc_out, v1c_out, v2c_out
!! Implemented: Perdew86, GGA (PW91), PBE
!
USE corr_gga
USE beef_interface, ONLY: beeflocalcorrspin
!
IMPLICIT NONE
!

View File

@ -44,6 +44,7 @@ char *readFile( FILE *file )
char *out;
unsigned long fileLen;
size_t successfully_read_count;
if (!file)
{
@ -63,11 +64,16 @@ char *readFile( FILE *file )
exit(1);
}
fread(out, fileLen, 1, file);
successfully_read_count = fread(out, fileLen, 1, file);
if (successfully_read_count != 1)
{
fprintf(stderr, "Read error!");
fclose(file);
exit(1);
}
return out;
}
}
void get_md5(const char *file, char *md5, int err)