! !-------------------------------------------------------- subroutine readdvscf ( dvscf, recn, iq, nqc ) !-------------------------------------------------------- ! ! open dvscf files as direct access, read, ad close again ! ! Feliciano Giustino, UC Berkeley ! !------------------------------------------------------------- ! #include "f_defs.h" use io_files, only : prefix, tmp_dir, dvscf_dir use units_ph, only : lrdrho use kinds, only : DP USE lsda_mod, ONLY : nspin USE gvect, ONLY : nrxx use pwcom #ifdef __PARA use mp_global,only : nproc, nproc_pool, me_pool, mpime use para, only : nprocp, mypool use mp_global,only : npool #endif ! implicit none integer :: recn, iq, nqc, iudvscf ! perturbation number ! the current q point ! the total number of qpoints in the list ! the temporary unit number complex(kind=DP) :: dvscf ( nrxx , nspin) ! integer :: unf_recl character (len=256) :: tempfile character (len=3) :: filelab ! file label iudvscf = 80 ! ! the call to set_ndnmbr is just a trick to get quickly ! a file label by exploiting an existing subroutine ! (if you look at the sub you will find that the original ! purpose was for pools and nodes) ! call set_ndnmbr ( 0, iq, 1, nqc, filelab) tempfile = trim(dvscf_dir) // trim(prefix) // '.dvscf_q' // filelab ! unf_recl = DIRECT_IO_FACTOR * lrdrho ! ! open the dvscf file, read and close ! open (iudvscf, file = tempfile, form = 'unformatted', & access = 'direct', recl = unf_recl) read (iudvscf, rec = recn) dvscf close (iudvscf, status = 'keep') ! ! return end subroutine readdvscf !-------------------------------------------------------- !