-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.f90
78 lines (61 loc) · 2.67 KB
/
main.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
65
66
67
68
69
70
71
72
73
74
75
76
77
Program MainPhononCollection
!!!
!!!
!!!
!!! this is the main code of the Phonon collection
!!!
!!!
!use PhononInterface, only :PhononInterfaceMain
use ReadInputFile, only :ReadInput,SimParams
use ReadingInput, only :INPUT,OpenPOSCARFile,atom_type,&
AtomTypeInit,ReadCoordinates
use PhononInterface
Implicit None
Type( SimParams ) ::MDParameters
Type( INPUT ) ::StrucReader
Type( atom_type ),allocatable,dimension( : ) ::Atoms
Character( len = : ),allocatable ::InputFile
Logical ::ReadOK
!!!
!local variables only needed in main routine
Integer ::Nstruc !! actual structure to be analyzed
!!! file containing input flags
InputFile = 'Phonon.in'
StrucReader%FileNr = 666
!! open input parameter file and read data from it
!!
Call ReadInput( MDParameters , InputFile )
!!
!! here we read the data of the XDATCAR file
!! but could also be a POSCAR
!! since you are doing phonon comuptations
!! I hope you did them in the microcannoical
!! ensemble otherise it does not make sense
!! because you compute dynamic properties from
!! autocorrelation functions
!! variable cell shapes are not supported
StrucReader%fname = './XDATCAR'
Call OpenPOSCARFile( StrucReader )
!!! initializing atom array
Call AtomTypeInit( StrucReader , Atoms )
!!! read first structure
Call ReadCoordinates( StrucReader , Atoms )
!!! do initialization
Call PhononInterfaceInit( MDParameters , Atoms , &
StrucReader%Lattice )
Do Nstruc = 1 , MDParameters%Nend
If ( Nstruc .ge. MDParameters%Nstart .and. &
Modulo( Nstruc , MDParameters%BlockSample ) .eq. 0 ) then
!! Call relevant phonon routines
Call PhononInterfaceMain( MDParameters , Atoms , &
StrucReader%Lattice )
If ( Modulo( Nstruc , 10 ) .eq. 0 ) then
Write( * , * ) "Analysed " , Nstruc , &
"structures"
End If
End If
Call ReadCoordinates( StrucReader , Atoms , ReadOK )
If ( .not. ReadOK ) Exit
End Do
Call PhononInterfaceFinal
End Program MainPhononCollection