Hello,
You are correct. This is due to the max size of integer kind 4. Since this is linked with QE, I cannot directly change it. However, you can introduce a temporary kind 8 variable like this:
[code:3ahltjhs] INTEGER(kind=8) :: mult_unit
CALL set_ndnmbr ( 0, iq, 1, nqc, filelab)
tempfile = trim(dvscf_dir) // trim(prefix) // ‘.dvscf_q’ // filelab
unf_recl = DIRECT_IO_FACTOR * lrdrho
mult_unit = unf_recl
mult_unit = recn * mult_unit
open (iudvscf, file = tempfile, form = ‘unformatted’, &
access = ‘direct’, iostat=ios,recl = unf_recl,status=‘old’)
IF (ios /= 0) call errore (‘readdvscf’,'error opening ’ // tempfile, iudvscf)
#if defined(__NAG)
CALL fstat( iudvscf, statb, errno=ios)
IF (mult_unit .gt. statb%st_size) call errore(‘readdvscf’, &
trim(tempfile)//’ too short, check ecut’, iudvscf)
#endif
#if ! defined(__NAG)
ios = fstat ( iudvscf, statb)
!IF (recn * unf_recl .gt. statb(8)) call errore(‘readdvscf’, &
IF (mult_unit .gt. statb(8)) call errore(‘readdvscf’, &
trim(tempfile)//’ too short, check ecut’, iudvscf)
#endif
!
read (iudvscf, rec = recn) dvscf
close (iudvscf, status = ‘keep’)
!
!
end subroutine readdvscf[/code:3ahltjhs]
Let me know if this works for you.
Best,
Samuel