The Elk Code
readbec.f90
Go to the documentation of this file.
1 
2 ! Copyright (C) 2024 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 
6 subroutine readbec
7 use modmain
8 use modphonon
9 implicit none
10 ! local variables
11 logical exist
12 integer is,ia,ias,ip,jp
13 character(256) fext
14 do is=1,nspecies
15  do ia=1,natoms(is)
16  ias=idxas(ia,is)
17  do ip=1,3
18  call becfext(is,ia,ip,fext)
19  inquire(file='BEC'//trim(fext),exist=exist)
20  if (.not.exist) then
21  write(*,*)
22  write(*,'("Error(readbec): file not found :")')
23  write(*,'(A)') ' BEC'//trim(fext)
24  write(*,*)
25  stop
26  end if
27  open(50,file='BEC'//trim(fext),status='OLD',form='FORMATTED')
28  do jp=1,3
29  read(50,*) bec(ip,jp,ias)
30  end do
31  close(50)
32  end do
33  end do
34 end do
35 end subroutine
36 
integer, dimension(maxatoms, maxspecies) idxas
Definition: modmain.f90:42
real(8), dimension(:,:,:), allocatable bec
Definition: modphonon.f90:36
integer, dimension(maxspecies) natoms
Definition: modmain.f90:36
integer nspecies
Definition: modmain.f90:34
subroutine becfext(is, ia, ip, fext)
Definition: becfext.f90:7
subroutine readbec
Definition: readbec.f90:7