quantum-espresso/Gamma/macro.f90

44 lines
1.2 KiB
Fortran

!
! Copyright (C) 2003 PWSCF group
! This file is distributed under the terms of the
! GNU General Public License. See the file `License'
! in the root directory of the present distribution,
! or http://www.gnu.org/copyleft/gpl.txt .
!
!
!----------------------------------------------------------------------
SUBROUTINE macro
!----------------------------------------------------------------------
!
USE pwcom
USE cgcom
!
IMPLICIT NONE
INTEGER:: kpoint, ipol
CHARACTER(len=7) :: filbar
LOGICAL :: here
!
DO kpoint=1,nks
! NB: this version works only for nks = 1 !
DO ipol=1,3
WRITE(filbar,'("filbar",i1)') ipol
iubar=ipol
CALL seqopn (iubar,filbar,'unformatted',here)
!!! if (.not.here) then
! calculate x * psi (if not already done)
dvpsi(:,:) = (0.d0, 0.d0)
!!! else
! otherwise restart from x * psi that is present on from file
!!! read(iubar) dvpsi
!!! end if
CALL dvpsi_e(kpoint,ipol)
! write x * psi
REWIND(iubar)
WRITE(iubar) dvpsi
CLOSE(unit=iubar,status='keep')
ENDDO
ENDDO
!
RETURN
END SUBROUTINE macro