forked from lgcrego/Dynemol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.f
126 lines (90 loc) · 3.27 KB
/
main.f
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
Program qdynamo
use MPI
use type_m
use constants_m
use setup_checklist
use card_reading , only : ReadInputCard
use MPI_definitions_m , only : launch_MPI , setup_MPI_labor_force , master , myid
use parameters_m , only : Define_Environment , driver , nuclear_matter , restart
use MM_input , only : Define_MM_Environment , driver_MM
use Semi_Empirical_Parms , only : read_EHT_parameters
use Structure_Builder , only : Read_Structure
use qdynamics_m , only : qdynamics
use Sampling_m , only : Avrg_Confgs
use GA_driver_m , only : GA_driver
use diagnostic_m , only : diagnostic
use Chebyshev_driver_m , only : Chebyshev_driver
use QMDynamicSlice_driver_m , only : QMDynamicSlice_driver
use MMechanics_m , only : MMechanics
use MD_read_m , only : Build_MM_Environment
use good_vibrations_m , only : Optimize_Structure , normal_modes , Optimize_Parameters_Driver
! local variables ...
integer :: err
logical :: go_without_card
! Initialize MPI if necessary ...
call launch_MPI
! Initialize GPU if necessary ...
CALL GPU_Init(myid,1)
!========================================================
! THE TRUTH IS OUT THERE
!========================================================
CALL get_environment_vars
If( master ) then
If( .not. restart ) CALL system( dynemoldir//"env.sh" )
end If
inquire( file=dynemolworkdir//"makefile" , EXIST = go_without_card )
if( go_without_card ) then
CAll Define_Environment
CALL Define_MM_Environment
else
call ReadInputCard
If( master ) then
! cloning the psf files into trunk directories ...
call system("cp card.inpt log.trunk/.")
CALL system("echo dyn.trunk/ dos.trunk/ opt.trunk/ ancillary.trunk/ | xargs -n 1 cp log.trunk/card.inpt ")
end if
end if
CALL setup_MPI_labor_force
If( master ) CALL checklist
CALL read_EHT_parameters
CALL Read_Structure
If( driver == "MM_Dynamics" .OR. nuclear_matter == "MDynamics" ) CALL Build_MM_Environment
If( master ) then
CALL dump_driver_parameters_and_tuning
CALL system("echo dyn.trunk/ dos.trunk/ opt.trunk/ ancillary.trunk/ | xargs -n 1 cp log.trunk/driver_parms_and_tuning.log ")
end if
select case ( driver )
case ( "q_dynamics" )
CALL qdynamics
case ( "slice_AO" , "slice_FSSH" , "slice_Cheb" , "slice_CSDM" )
CALL QMDynamicSlice_driver
case ( "avrg_confgs" )
CALL Avrg_Confgs
case ( "Genetic_Alg" )
CALL GA_driver
case ( "diagnostic" )
CALL diagnostic
case ( "MM_Dynamics" )
select case ( driver_MM )
case ( "MM_Dynamics" )
CALL MMechanics
case ( "MM_Optimize" )
CALL Optimize_Structure
case ( "NormalModes" )
CALL normal_modes
case ( "Parametrize" )
CALL Optimize_Parameters_Driver
case default
Print*, " >>> Check your driver options <<< :" , driver
stop
end select
case default
Print*, " >>> Check your driver options <<< :" , driver
stop
end select
include 'formats.h'
! Finalize MPI
call MPI_FINALIZE(err)
! Finalize GPU
call GPU_Finalize
END