85
85
! If performing MD with `virtual` step: initialize
86
86
if ( want_virtual_step_md ) then ! do perform two-step MD
88
do while ((istep.le.fincoor) .and. (.not. relaxd))
89
do substep = BASE_STEP, VIRTUAL_STEP
90
if ( td_elec_dyn ) then
91
call siesta_tddft( istep )
93
call siesta_forces( istep )
96
! Call to init "Virtual" step data here -
97
! after call to `siesta_forces` on the first step
98
if (istep==inicoor) call init_virtual_step_md()
100
if (substep .eq. BASE_STEP) then
101
call base_md_step_logic()
102
call store_state_before_move()
103
! ** Call siesta_move here to record proper step values
104
if (SIESTA_worker) call siesta_move( istep, relaxd )
106
call broadcast(relaxd,comm=true_MPI_Comm_World)
108
call store_state_after_move()
109
call make_virtual_md_move()
111
if (.not. relaxd) then
115
if (ionode) call memory_snapshot("after geometry step")
118
call virtual_md_step_logic()
119
call re_store_state_after_move()
89
$ call die("No TDDFT with thermal transport...")
91
call init_virtual_step_md() ! allocate xa,va,fa aux arrays
93
DO WHILE ((istep.le.fincoor) .and. (.not. relaxd))
97
call siesta_forces( istep )
99
call base_md_step_logic() ! Perform whatever needs to be done now
100
call store_state_before_move() ! Save xa, fa, va
102
! ** Call siesta_move here to record proper step values
103
if (SIESTA_worker) call siesta_move( istep, relaxd )
105
call store_state_after_move() ! Store future base coords
106
call make_virtual_md_move() ! Generate xa for virtual step
109
substep = VIRTUAL_STEP
110
call siesta_forces( istep )
112
call virtual_md_step_logic()
113
call re_store_state_after_move() ! Restore xa to xa_future, fa to fa_saved
115
if (.not. relaxd) then
120
call broadcast(relaxd,comm=true_MPI_Comm_World)
124
126
else ! Skip `Virtual` step - generic SIESTA cycle
126
DO WHILE ((istep.le.fincoor) .AND. (.not. relaxd))
128
if ( td_elec_dyn ) then
129
call siesta_tddft( istep )
131
call siesta_forces( istep )
134
if (SIESTA_worker) call siesta_move( istep, relaxd )
136
call broadcast(relaxd,comm=true_MPI_Comm_World)
138
if (.not. relaxd) then
142
if (ionode) call memory_snapshot("after geometry step")
128
DO WHILE ((istep.le.fincoor) .AND. (.not. relaxd))
130
if ( td_elec_dyn ) then
131
call siesta_tddft( istep )
133
call siesta_forces( istep )
136
if (SIESTA_worker) call siesta_move( istep, relaxd )
138
call broadcast(relaxd,comm=true_MPI_Comm_World)
140
if (.not. relaxd) then
144
if (ionode) call memory_snapshot("after geometry step")
146
149
endif ! One/two-step MD
148
151
C End of coordinate-relaxation loop