1c
2c $Id$
3c
4
5      SUBROUTINE md_init(iseed,ntype,ncons,ntcons,consatm,nbond,ntbond,
6     $    bondatm,nshel,ntshel,shelatm,lveloc,ewald1)
7
8      implicit none
9
10      include 'p_array.inc'
11      include 'p_const.inc'
12      include 'p_input.inc'
13      include 'cm_atom.inc'
14      include 'cm_latt.inc'
15      include 'cm_temp.inc'
16
17      integer iseed,ntype
18      integer ncons,ntcons,consatm
19      integer nbond,ntbond,bondatm
20      integer nshel,ntshel,shelatm
21
22      real*8 x,det,ewald1
23
24      logical lveloc
25
26      dimension consatm(mxcons,2),bondatm(mxbond,2),shelatm(mxshel,2)
27
28!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
29
30      call tool_randm(iseed,x)
31      call tool_invrt(latt,rlatt,det)
32      call tool_volme(latt,vol)
33      call tool_rebox(natms,mxatms,latt,rlatt,ccc)
34
35!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
36
37      call ewald_setp()
38c Self-interaction energy
39      call ewald_self(ewald1)
40
41!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
42
43! Create exclude list
44      call list_excld(ntype)
45
46!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
47
48! Create constraints list
49      call list_const(ncons,ntcons,consatm)
50
51!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
52
53! Create bonds list
54      call list_bonds(nbond,ntbond,bondatm)
55
56!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
57
58! Create shells list
59      call list_shell(nshel,ntshel,shelatm)
60
61!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
62
63! Temperature parameters
64      degfree=dble(3*(natms-ntshel)-3-ntcons)
65      targetke=degfree*temp*boltzmann*0.5
66
67!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
68
69! Initial random velocities
70      if(.not.lveloc)call init_velo(iseed)
71
72!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
73
74      return
75
76      END
77