-
Notifications
You must be signed in to change notification settings - Fork 0
/
dirgapf.f90
65 lines (40 loc) · 965 Bytes
/
dirgapf.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
!programa para achar o gap direto nas bandas do TB
!gfortran dirgapf.f90 -o dirgapf.x
!dirgapf.x nbands nocp nk < input > output
program main
implicit none
integer :: nbands,nocp,nk
integer :: i,j,k
double precision :: flag1,flag2
character(len=1) :: cflag
double precision,allocatable,dimension(:,:,:) :: bands
double precision :: gap,gapflag
!variaveis getarg
character*30 arg
integer ios
CALL getarg(1, arg)
read(arg,*,iostat=ios) nbands
CALL getarg(2, arg)
read(arg,*,iostat=ios) nocp
CALL getarg(3, arg)
read(arg,*,iostat=ios) nk
allocate(bands(nbands,nk,2))
do i=1,nbands
read(*,*) cflag
do j=1,nk
read(*,*) bands(i,j,1),bands(i,j,2),flag1,flag2
end do
read(*,*)
end do
gap = 50.0
do i=1,nk
gapflag=bands(nocp+1,i,2)-bands(nocp,i,2)
if (gapflag .lt. gap) then
gap = gapflag
else
continue
end if
end do
write(*,*) 'dirgap:',gap
deallocate(bands)
end program main