File: mdinit.F

package info (click to toggle)
ga 5.9.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 18,472 kB
  • sloc: ansic: 192,963; fortran: 53,761; f90: 11,218; cpp: 5,784; makefile: 2,248; sh: 1,945; python: 1,734; perl: 534; csh: 134; asm: 106
file content (115 lines) | stat: -rw-r--r-- 2,433 bytes parent folder | download | duplicates (7)
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
#if HAVE_CONFIG_H
#   include "config.fh"
#endif
      subroutine mdinit
#include "common.fh"
c
      double precision six,twelve,ac
      integer i,j
c
c  turn of all cluster related functions
c
      nocluster = .false.
c
c    This subroutine sets up the potentials, assigns atomic masses
c    and finishes initializing the calculation
c
      six = 6.0d00
      twelve = 12.0d00
c
c      initialize timing and energy statistics arrays
c
      do i = 1, MAXNRG
        nrg(i) = 0.0d00
        anrg(i) = 0.0d00
        anrg2(i) = 0.0d00
      end do
      nrgcnt = 0
      nrg2ct = 0
      do i = 1, MAXTIM
        tmstat(i) = 0.0d00
      end do
      failcount = 0
c
c     assign atom masses
c
      do i = 1, antot
        mass(i) = amass(at(i))
      end do
c
c   Initialize cutoffs for  potential arrays.
c
      rcmax = 0.0d00
      do i = 1, atnum
        do j = 1, atnum
          ac = acut(i,j)
          if (ac.gt.rcmax) rcmax = ac
          rcorr(i,j) = e12(i,j) / ac**12
          dcorr(i,j) = -e6(i,j) / ac**6
          if (icut.eq.1) then
            frcorr(i,j) = - twelve * e12(i,j) / ac**13
            fdcorr(i,j) = six * e6(i,j) / ac**7
          else
            frcorr(i,j) = 0.0d00
            fdcorr(i,j) = 0.0d00
          endif
        end do
      end do
      rcmax = rcmax + 1.0d00
c
c   calculate total number of degrees of freedom
c
      nrg(1) = dble(3*atot-3)
      nrg(2) = nrg(1) / 2.0
c
c   Convert algorithm parameters into system units
c
      istep = 0
      tavg = 0.0d00
      itavg = 0
      tmstrt = 0
      t_done = 0.0d00
      t_rmndr = tau
c
c   Initialize parameters for mass and temperature degrees of freedom
c
      vol1 = xbox * ybox * zbox
      alen1(1) = xbox
      alen1(2) = ybox
      alen1(3) = zbox
      vol2 = 0.0d00
      vol3 = 0.0d00
      do j = 1, 3
        alen2(j) = 0.0d00
        alen3(j) = 0.0d00
      end do
      scal1 = 1.0d00
      scal2 = 0.0d00
      scal3 = 0.0d00
c
c   Initialize bins accumulating r_cluster values
c
      do j = 1, 10
        do i = 1, mcbins
          r_distr(i,j) = 0
        end do
      end do
c
c   Initialize absolute coordinates
c
      call cluster_center
      call update
      call force
      mbflg = .true.
      call cluster_com
c
      tavg = 0.0d00
      do j = 1, 3
        do i = 1, antot
          ra(i,j,7) = ra(i,j,8)
          ra(i,j,3) = ra(i,j,4)/mass(i)
        end do
      end do
c
      return
      end