7
c This software is being made available for internal testing and
8
c evaluation purposes only. This software is a pre-release test version
9
c which has not yet been authenticated and cleared for publication. Adherence
10
c to this notice may be necessary for the author, Battelle Memorial
11
c Institute, to successfully assert copyright in and commercialize this
12
c software. This software is not intended for duplication or distribution
13
c to third parties without the permission of the Manager of Software
14
c Products at Pacific Northwest Laboratory, Richland, Washington, 99352.
18
double precision x,ran1
22
c This subroutine reads in the molecular simulation parameters
25
if (me.eq.0) open (unit=5,file='md_lj.in',status='old')
29
c nstep: total number of steps in simulation
31
c tau: time step increment
33
c nsc: number of special control steps
35
c iseed: random number seed (this should be a NEGATIVE
43
read(5,*) nstep,tau,nsc,iseed
45
call ga_igop(2,nstep,1,'+')
46
call ga_dgop(3,tau,1,'+')
47
call ga_igop(4,nsc,1,'+')
48
call ga_igop(5,iseed,1,'+')
52
c rcut: cutoff for use in neighbor list calculation
54
c ilist: number of steps taken before updating
57
c icut: cutoff parameter for potential
59
c (0) only potential set to zero at cutoff
61
c (1) potential and forces set to zero at cutoff
67
read(5,*) rcut,ilist,icut
69
call ga_dgop(6,rcut,1,'+')
70
call ga_igop(7,ilist,1,'+')
71
call ga_igop(8,icut,1,'+')
75
c dflalg: default algorithm
77
c 1: constant energy 3 point Gear algorithm
78
c 2: constant pressure algorithm
79
c 3: constant temperature algorithm (velocity scaling)
80
c 4: constant temperature algorithm (Nose' dynmamics)
81
c 5: constant pressure and temperature algorithm
82
c 6: Boltzmann velocity step
83
c 7: adjust volume to specified target volume
84
c (available only as a special step)
85
c 8: adjust kinetic energy based on average temperature
86
c since last call to this step so that temperature
87
c matches target temperature.
88
c (available only as a special step)
89
c 9: constant pressure and temperature algorithm with
90
c independent box adjustments
91
c 10: constant pressure and temperature algorithm with
92
c independent box adjustments in only the x and y
95
c dftmp: default temperature
97
c dfprs: default pressure
99
c dftm: default mass for temperature
101
c dfpm: default mass for pressure
109
read(5,*) dflalg,dftmp,dfprs,dftm,dfpm
111
call ga_igop(9,dflalg,1,'+')
112
call ga_dgop(1,dftmp,1,'+')
113
call ga_dgop(2,dfprs,1,'+')
114
call ga_dgop(3,dftm,1,'+')
115
call ga_dgop(4,dfpm,1,'+')
119
c special step control instructions
121
c isc(i,1): begining step for special instruction
123
c isc(i,2): final step for special instruction
125
c isc(i,3): increment for special instruction
127
c isc(i,4): stepping algorithm for special instruction
128
c (see documentation on dflalg)
130
c rsc(i,1): temperature (in K) if temperature scaling or
131
c Boltzmann algorithm is specified
133
c rsc(i,2): pressure if constant pressure
134
c algorithms are specified. If volume adjustment
135
c algorithm is specified then this is the target
138
c rsc(i,3): mass (in g A**2 /mole) for Nose temperature
141
c rsc(i,4): mass (in g/(mole A**4)) for constant pressure
150
read(5,*) (isc(i,j),j=1,4),(rsc(i,j),j=1,4)
153
call ga_igop(4,isc(i,j),1,'+')
154
call ga_dgop(5,rsc(i,j),1,'+')
160
c istart: startup format
161
c 1: start from single configuration
162
c 2: start from configuration plus velocity
164
c istop: write-out format
165
c 1: single configuration
166
c 2: configuration plus velocity
171
read(5,*) istart,istop
173
call ga_igop(6,istart,1,'+')
174
call ga_igop(7,istop,1,'+')
178
c istat: frequency to print out simulation information
184
call ga_igop(8,istat,1,'+')
188
c equil_1: number of steps in first equilibration regime
190
c equil_2: number of steps in second equilibration regime
192
c equil_3: number of steps in third equilibration regime
198
read(5,*) equil_1, equil_2, equil_3
200
call ga_igop(9,equil_1,1,'+')
201
call ga_igop(1,equil_2,1,'+')
202
call ga_igop(2,equil_3,1,'+')
203
window_1 = int(0.2d00*dble(equil_3-equil_2))
204
window_1 = equil_2 + window_1
205
window_2 = int(0.4d00*dble(equil_3-equil_2))
206
window_2 = window_1 + window_2
210
c cl_prssr: pressure that is applied to cluster
212
c mc_tmprtr: temperature used in Monte Carlo steps
217
read(5,*) cl_prssr, mc_tmprtr
219
call ga_dgop(3,cl_prssr,1,'+')
220
call ga_dgop(4,mc_tmprtr,1,'+')
224
c mcfreq: frequency to apply Monte Carlo step on radius
226
c mcbins: number of bins to accumulate radius in
231
read(5,*) mcfreq, mcbins
233
call ga_igop(7,mcfreq,1,'+')
234
call ga_igop(8,mcbins,1,'+')
236
if (me.eq.0) close(5)
238
c Write out simulation information to output file
240
if (me.eq.0.and.l_stdio) then
242
write(6,1400) 1000.0 * tau
261
if (isc(i-1,4).eq.7) write(6,2200)
263
if (isc(i,4).ne.7) then
264
write(6,2300) (isc(i,j),j=1,4),(rsc(i,j),j=1,4)
267
write(6,2500) (isc(i,j),j=1,4)
268
write(6,2600) rsc(i,1)
269
write(6,2700) rsc(i,2)
274
write(6,3500) equil_1
275
write(6,3600) equil_2
276
write(6,3700) equil_3
277
if (istart.eq.1) then
288
write(6,4500) ga_pgroup_nodeid(ga_pgroup_get_world())
290
iseed = iseed - 10*me
296
1300 format('Total number of steps in simulation :',i9)
297
1400 format('Time step interval :'
299
1500 format('Default algorithm :',i9)
300
1600 format(' Default algorithm parameters ')
301
1700 format(' Default temperature :'
303
1800 format(' Default pressure :'
305
1900 format(' Default temperature mass :'
307
2000 format(' Default pressure mass :'
309
2100 format('Special step instructions:')
310
2200 format(' begin end incrmt algrthm T P ',
312
2300 format(4i8,2f8.3,1pe9.2,1pe9.2)
313
2400 format(' begin end incrmt algrthm')
315
2600 format(' Temperature for volume adjustment :'
317
2700 format(' Target volume for volume adjustment :'
319
2800 format('Initial configuration is coordinates only')
320
2900 format('Initial configuration is coordinates and velocities')
321
3000 format('Final configuration is coordinates only')
322
3100 format('Final configuration is coordinates and velocities')
323
3200 format('Random number seed :',i9)
324
3400 format('Frequency to print out simulation information :',i9)
325
3500 format('Number of steps in first equilibration regime :',i9)
326
3600 format('Number of steps in second equilibration regime :',i9)
327
3700 format('Number of steps in third equilibration regime :',i9)
328
3800 format('Frequency to take Monte Carlo step :',i9)
329
4325 format('Cutoff distance :',
331
4350 format('Neighbor list update frequency :',i9)
332
4400 format('Potential set to zero at cutoff distance')
333
4420 format('Potential and forces set to zero at cutoff distance')
334
4500 format('Writing from node :',i9)
340
double precision scl,gasdev
341
integer inode,icnt,i,j,k,pnum,ilast,ifirst,me
342
character*32 filename
344
c This subroutine reads in the initial coordinates of all atoms in
345
c the system. First determine which coordinates each processor
351
c clean up everything
383
if (task_id.lt.10) then
384
write(filename,100) task_id
385
else if (task_id.ge.10.and.task_id.lt.100) then
386
write(filename,101) task_id
387
else if (task_id.ge.100.and.task_id.lt.1000) then
388
write(filename,102) task_id
389
else if (task_id.ge.1000.and.task_id.lt.10000) then
390
write(filename,103) task_id
392
100 format('md.cfg',i1)
393
101 format('md.cfg',i2)
394
102 format('md.cfg',i3)
395
103 format('md.cfg',i4)
398
open (unit=2,file=filename,status='old')
402
call ga_igop(5,atot,1,'+')
403
ilast = nint(dble((me+1)*atot)/dble(pnum))
404
ifirst = nint(dble(me*atot)/dble(pnum))
407
c read in portions of MD configuration on each node
409
do inode = 0, pnum - 1
411
if (me.eq.inode) then
412
open (unit=2,file=filename,status='old')
415
read(2,*) xbox,ybox,zbox
421
if (xbox.lt.ybox.and.xbox.lt.zbox) then
423
else if (ybox.lt.xbox.and.ybox.lt.zbox) then
428
mc_step = (cl_upper-cl_lower)/dble(mcbins)
431
if (istart.eq.1.or.(.not.l_oldcfg)) then
433
if (i.lt.ifirst) then
437
read(2,*) at(icnt),(ra(icnt,j,1),j=1,3)
438
if (at(icnt).eq.2) ctot = ctot + 1
440
c generate atomic velocities from a Maxwell-Boltzmann distribution
443
scl = sqrt(dftmp / amass(at(icnt)))
444
ra(icnt,j,2) = scl * gasdev(0)
451
if (i.lt.ifirst) then
455
read(2,*) at(icnt),(ra(icnt,j,1),j=1,3),
456
+ (ra(icnt,j,2),j=1,3)
457
if (at(icnt).eq.2) ctot = ctot + 1
466
call ga_igop(9,ctot,1,'+')
468
if (me.eq.0.and.l_stdio) then
470
write(6,1000) xbox,ybox,zbox
473
c initialize absolute coordinates
477
ra(i,j,6) = ra(i,j,1)
484
1000 format('The initial box size parameters are '/
485
+ ' x dimension = ',f9.4,' A'/
486
+ ' y dimension = ',f9.4,' A'/
487
+ ' z dimension = ',f9.4,' A')
488
1100 format('The total number of atoms in simulation :',i9)
494
double precision epsln,sigma
495
integer i,j,ipairs,ip,ktrnc
499
c This subroutine reads in atomic parameters from a parameter
500
c file. These parameters will be used to construct the
501
c system potential function.
511
open(unit=2,file='atom.inp',status='old')
527
call ga_dgop(1,amass(1),4,'+')
528
call ga_igop(2,atnum,1,'+')
530
c read in atomic parameters
537
call ga_igop(3,ipairs,1,'+')
539
do 100 ip = 1, ipairs
546
read (2,*) i,j,ktrnc,epsln,sigma
548
call ga_igop(1,i,1,'+')
549
call ga_igop(2,j,1,'+')
550
call ga_igop(3,ktrnc,1,'+')
551
call ga_dgop(4,epsln,1,'+')
552
call ga_dgop(5,sigma,1,'+')
554
if (i.ne.j) ichk(j,i) = .true.
555
e12(i,j) = 4.0d00*epsln*sigma**12
556
e6(i,j) = 4.0d00*epsln*sigma**6
557
if (i.ne.j) e12(j,i) = e12(i,j)
558
if (i.ne.j) e6(j,i) = e6(i,j)
560
acut(i,j) = exp(log(2.0d00)/6.0d00)*sigma
561
acut(j,i) = exp(log(2.0d00)/6.0d00)*sigma
563
acut(i,j) = rcut * sigma
564
acut(j,i) = rcut * sigma
566
acut2(i,j) = acut(i,j)**2
567
acut2(j,i) = acut(j,i)**2
570
if (me.eq.0) close(2)