diff --git a/CPV/Doc/INPUT_CP.def b/CPV/Doc/INPUT_CP.def index 331c06383..01ff949b6 100644 --- a/CPV/Doc/INPUT_CP.def +++ b/CPV/Doc/INPUT_CP.def @@ -1067,8 +1067,9 @@ input_description -distribution {Quantum Espresso} -package CP -program cp.x { as in tolp = 'old_time_step_value' in au 'random' : start the simulation with random atomic velocities 'from_input' : restart the simulation with atomic velocities read - from standard input - ( see the card 'ATOMIC_VELOCITIES' ) + from standard input - see card 'ATOMIC_VELOCITIES' + BEWARE: works only if restart_mode='from_scratch', + tested only with electrons_dynamics='cg' 'zero' : restart the simulation with atomic velocities set to zero } diff --git a/CPV/src/fromscra.f90 b/CPV/src/fromscra.f90 index fdf1facff..5b9e9fb06 100644 --- a/CPV/src/fromscra.f90 +++ b/CPV/src/fromscra.f90 @@ -9,13 +9,13 @@ SUBROUTINE from_scratch( ) ! USE kinds, ONLY : DP - USE control_flags, ONLY : tranp, trane, iverbosity, tpre, tcarpar, & + USE control_flags, ONLY : tranp, trane, iverbosity, tpre, tv0rd, & tzeroc, tzerop, tzeroe, tfor, thdyn, & lwf, tprnfor, tortho, amprp, ampre, & tsde, ortho_eps, ortho_max, & force_pairing - USE ions_positions, ONLY : taus, tau0, tausm, vels, fion, fionm - USE ions_base, ONLY : na, nsp, randpos, zv, ions_vel + USE ions_positions, ONLY : taus, tau0, tausm, vels, velsm, fion, fionm + USE ions_base, ONLY : na, nsp, randpos, zv, ions_vel, vel_srt USE ions_base, ONLY : cdmi, nat, iforce USE ions_nose, ONLY : xnhp0, xnhpm, vnhp USE cell_base, ONLY : ainv, h, s_to_r, ibrav, omega, press, & @@ -140,11 +140,25 @@ SUBROUTINE from_scratch( ) ! CALL occn_info( f ) ! - vels = 0.D0 hold = h velh = 0.0d0 fion = 0.0d0 - tausm = taus + ! + IF ( tv0rd .AND. tfor ) THEN + ! + ! ... vel_srt=starting velocities, read from input, are brough to + ! ... scaled axis and copied into array vels. Since velocites are + ! ... not actually used by the Verlet algorithm, we set tau(t-dt) + ! ... to tausm=tau(t)-v*delta t so that the Verlet algorithm will + ! ... start with the correct velocity + ! + CALL r_to_s( vel_srt, vels, na, nsp, ainv ) + tausm(:,:) = taus(:,:) - vels(:,:)*delt + velsm(:,:) = vels(:,:) + ELSE + vels = 0.D0 + tausm = taus + END IF ! ! ... compute local form factors !