1
subroutine write_md_record( istep )
4
use atomlist, only: iza
5
use md_out, only: md_v_format
6
use parallel, only: IOnode
7
use m_energies, only: Etot, Eharrs1, Ekinion
10
use m_stress, only: tstress
12
use md_out, only: md_netcdf
17
integer, intent(in) :: istep
19
real(dp) :: Etot_output
20
real(dp):: getot ! Total energy including thermostat dynamic variables
22
real(dp) :: Psol ! Total pressure (static + kinetic)
27
! Save atomic positions and velocities accumulatively
28
if (writmd.and.IOnode) then
29
if (.not. harrisfun) then
34
getot = Etot_output + Ekinion + kn + kpr + vn + vpr
35
Psol = - ((tstress(1,1)+tstress(2,2) +tstress(3,3))/3.0_dp)
36
call iomd( na_u, isa, iza,
37
. xa, va, ucell, vcell, varcel, istep, inicoor,
38
. fincoor, tempion, Etot_output, getot,
39
. volume_of_some_cell/Ang**3, Psol/kbar)
40
call md_v_format(na_u,isa,xa,ucell)
42
call md_netcdf( na_u, isa, iza,
43
. xa, va, ucell, vcell, varcel,
44
. tempion, Etot_output, getot,
45
. volume_of_some_cell/Ang**3, Psol/kbar)
50
! Accumulate coor in Xmol file for animation
51
lastst = fincoor .le. istep
52
if (writpx.and.IOnode) then
53
call pixmol(iza, xa, na_u, lastst)