The Elk Code
 
Loading...
Searching...
No Matches
moddelf.f90
Go to the documentation of this file.
1
2! Copyright (C) 2020 J. K. Dewhurst and S. Sharma.
3! This file is distributed under the terms of the GNU General Public License.
4! See the file COPYING for license details.
5
6module moddelf
7
8use modphonon
10use modmpi
11
12contains
13
14subroutine delfile(fname)
15implicit none
16! arguments
17character(*), intent(in) :: fname
18! local variables
19integer ios
20open(40,file=fname,iostat=ios)
21close(40,status='DELETE',iostat=ios)
22end subroutine
23
24subroutine delfiles(evec,devec,eval,occ,pmat,epsi)
25implicit none
26! arguments
27logical, optional, intent(in) :: evec,devec,eval,occ,pmat,epsi
28! local variables
29character(256) fext,fname
30if (present(evec)) then
31! delete the first-variational eigenvector file
32 fname=trim(scrpath)//'EVECFV'//trim(filext)
33 if (mp_mpi) call delfile(fname)
34 if (ramdisk) call delfrd(fname)
35! delete the second-variational eigenvector file
36 fname=trim(scrpath)//'EVECSV'//trim(filext)
37 if (mp_mpi) call delfile(fname)
38 if (ramdisk) call delfrd(fname)
39end if
40if (present(devec)) then
41! construct the dynamical matrix file extension
42 call dynfext(iqph,isph,iaph,ipph,fext)
43! delete the eigenvector derivative files
44 fname=trim(scrpath)//'DEVECFV'//trim(fext)
45 if (mp_mpi) call delfile(fname)
46 if (ramdisk) call delfrd(fname)
47 fname=trim(scrpath)//'DEVECSV'//trim(fext)
48 if (mp_mpi) call delfile(fname)
49 if (ramdisk) call delfrd(fname)
50end if
51if (present(eval)) then
52! delete the first-variational eigenvalue file
53 fname='EVALFV'//trim(filext)
54 if (mp_mpi) call delfile(fname)
55 if (ramdisk) call delfrd(fname)
56! delete the second-variational eigenvalue file
57 if (mp_mpi) call delfile('EVALSV'//trim(filext))
58end if
59if (present(occ)) then
60! delete the occupation number file
61 if (mp_mpi) call delfile('OCCSV'//trim(filext))
62end if
63if (present(pmat)) then
64! delete the momentum matrix elements file
65 if (mp_mpi) call delfile('PMAT.OUT')
66 if (ramdisk) call delfrd('PMAT.OUT')
67end if
68if (present(epsi)) then
69! delete the inverse dielectric function file
70 if (mp_mpi) call delfile('EPSINV.OUT')
71end if
72end subroutine
73
74end module
75
subroutine dynfext(iq, is, ia, ip, fext)
Definition dynfext.f90:7
subroutine delfiles(evec, devec, eval, occ, pmat, epsi)
Definition moddelf.f90:25
subroutine delfile(fname)
Definition moddelf.f90:15
logical mp_mpi
Definition modmpi.f90:17
integer iaph
Definition modphonon.f90:15
integer ipph
Definition modphonon.f90:15
integer iqph
Definition modphonon.f90:15
integer isph
Definition modphonon.f90:15
type(file_t), dimension(:), allocatable, private file
subroutine delfrd(fname)
logical ramdisk
Definition modramdisk.f90:9