1      subroutine smd_init(operation,rtdb)
2      implicit none
3#include "errquit.fh"
4#include "inp.fh"
5#include "mafdecls.fh"
6#include "rtdb.fh"
7#include "util.fh"
8#include "global.fh"
9c
10      character*(*) operation
11      integer rtdb
12c
13      character*80 pname
14      character*80 tag
15
16      pname = "smd_init"
17      tag = operation
18      if(tag.eq."energy") then
19        call smd_init_sp(rtdb)
20      else if(tag.eq."dynamics") then
21        call smd_init_dynamics(rtdb)
22      else if(tag.eq."fragment") then
23        call smd_init_fragment(rtdb)
24      else
25        call errquit(
26     >       pname//'unknown operation'//tag,0, 0)
27      end if
28
29
30      return
31      end
32
33      subroutine smd_init_sp(rtdb)
34      implicit none
35#include "errquit.fh"
36#include "inp.fh"
37#include "mafdecls.fh"
38#include "rtdb.fh"
39#include "util.fh"
40#include "global.fh"
41c
42      integer rtdb
43c
44      logical ostatus
45      character*72 tag
46      character*32 pname
47      character*255 filename
48      character*72 sp_system
49      character*72 sp_atom
50      character*72 sp_param
51      character*72 sp_bond
52      character*72 sp_shakelist
53      character*72 sp_bondlist
54      character*72 sp_lattice
55      character*72 sp_type
56      character*72 sp_pot
57      character*72 sp_coord
58      character*72 sp_charge
59      character*72 sp_force
60      character*72 sp_energy
61      character*72 sp_exlist
62      character*72 sp_vlist
63      character*72 sp_mass
64      character*72 sp_cutoff
65      character*72 sp_temperature
66      character*72 sp_rtdb
67      character*72 sp_ewald
68c
69      logical olattice
70      logical obond
71      integer master
72      logical odistrib
73c
74      odistrib = .false.
75      master = 0
76      pname = "smd_init_dynamics"
77c
78      sp_atom      = "atom"
79      sp_param     = "parameters"
80      sp_lattice   = "lattice"
81      sp_type      = "type"
82      sp_pot       = "potential"
83      sp_coord     = "coordinates"
84      sp_charge    = "charge"
85      sp_force     = "force"
86      sp_energy    = "energy"
87      sp_exlist    = "excluded_list"
88      sp_vlist     = "verlet_list"
89      sp_shakelist = "shakelist"
90      sp_bondlist  = "bondlist"
91      sp_bond      = "bond"
92      sp_mass  = "mass"
93      sp_cutoff  = "cutoff"
94      sp_temperature = "temperature"
95      sp_rtdb = "rtdb"
96      sp_ewald = "ewald"
97c
98c
99c     CREATE SYSTEM
100c     ------------
101      tag = "atom"
102      call smd_system_set_component(tag,sp_atom)
103
104      tag = "parameters"
105      call smd_system_set_component(tag,sp_param)
106
107      tag = "type"
108      call smd_system_set_component(tag,sp_type)
109
110      tag = "lattice"
111      call smd_system_set_component(tag,sp_lattice)
112
113      tag = "potential"
114      call smd_system_set_component(tag,sp_pot)
115
116      tag = "coordinates"
117      call smd_system_set_component(tag,sp_coord)
118
119      tag = "force"
120      call smd_system_set_component(tag,sp_force)
121
122      tag = "charge"
123      call smd_system_set_component(tag,sp_charge)
124
125      tag = "excl_list"
126      call smd_system_set_component(tag,sp_exlist)
127
128      tag = "verlet_list"
129      call smd_system_set_component(tag,sp_vlist)
130
131      tag = "energy"
132      call smd_system_set_component(tag,sp_energy)
133
134      tag = "bond"
135      call smd_system_set_component(tag,sp_bond)
136
137      tag = "shakelist"
138      call smd_system_set_component(tag,sp_shakelist)
139
140      tag = "bondlist"
141      call smd_system_set_component(tag,sp_bondlist)
142
143      tag = "mass"
144      call smd_system_set_component(tag,sp_mass)
145
146      tag = "cutoff"
147      call smd_system_set_component(tag,sp_cutoff)
148
149      tag = "temperature"
150      call smd_system_set_component(tag,sp_temperature)
151
152      tag = "rtdb"
153      call smd_system_set_component(tag,sp_rtdb)
154
155      tag = "ewald"
156      call smd_system_set_component(tag,sp_ewald)
157c
158c      write(*,*) "in "//pname
159c     DEFINE ALL THE COMPONENTS
160c     --------------------------------
161c
162      if(ga_nodeid().eq.master) then
163      call smd_rtdb_init(.false.,rtdb)
164      call smd_cutoff_init()
165      call smd_temper_init()
166      call smd_atom_init_system()
167      call smd_param_init_system()
168      call smd_lat_init_system()
169      call smd_pot_init_system()
170      call smd_type_init_system()
171      call smd_energy_init_system()
172      call smd_force_init_system()
173      call smd_charge_init_system()
174      call smd_coords_init_system()
175      call smd_exlist_init_system()
176      call smd_vlist_init_system()
177      call smd_bond_init_system()
178      call smd_shakelist_init_system()
179      call smd_bondlist_init_system()
180      call smd_mass_init_system()
181c
182c     finish system setup
183c     -------------------
184      call smd_coords_rebox()
185      call smd_ewald_init()
186      call smd_system_print(6)
187
188      end if
189      call ga_sync()
190      call smd_data_brdcst_create(master)
191      return
192      end
193
194      subroutine smd_init_fragment(rtdb)
195      implicit none
196#include "errquit.fh"
197#include "inp.fh"
198#include "mafdecls.fh"
199#include "rtdb.fh"
200#include "util.fh"
201#include "global.fh"
202c
203      integer rtdb
204c
205      logical ostatus
206      character*72 tag
207      character*32 pname
208      character*255 filename
209      character*72 sp_system
210      character*72 sp_atom
211      character*72 sp_param
212      character*72 sp_bond
213      character*72 sp_shakelist
214      character*72 sp_bondlist
215      character*72 sp_lattice
216      character*72 sp_type
217      character*72 sp_pot
218      character*72 sp_coord
219      character*72 sp_charge
220      character*72 sp_force
221      character*72 sp_energy
222      character*72 sp_exlist
223      character*72 sp_vlist
224      character*72 sp_mass
225      character*72 sp_cutoff
226      character*72 sp_temperature
227      character*72 sp_rtdb
228      character*72 sp_ewald
229      character*72 sp_fragment
230c
231      logical olattice
232      logical obond
233      integer master
234      logical odistrib
235c
236      odistrib = .true.
237c
238      master = 0
239      pname = "smd_init_dynamics"
240c
241      sp_atom      = "atom"
242      sp_param     = "parameters"
243      sp_lattice   = "lattice"
244      sp_type      = "type"
245      sp_pot       = "potential"
246      sp_coord     = "coordinates"
247      sp_charge    = "charge"
248      sp_fragment    = "fragment"
249      sp_force     = "force"
250      sp_energy    = "energy"
251      sp_exlist    = "excluded_list"
252      sp_vlist     = "verlet_list"
253      sp_shakelist = "shakelist"
254      sp_bondlist  = "bondlist"
255      sp_bond      = "bond"
256      sp_mass  = "mass"
257      sp_cutoff  = "cutoff"
258      sp_temperature = "temperature"
259      sp_rtdb = "rtdb"
260      sp_ewald = "ewald"
261c
262c
263c     CREATE SYSTEM
264c     ------------
265      tag = "atom"
266      call smd_system_set_component(tag,sp_atom)
267
268      tag = "parameters"
269      call smd_system_set_component(tag,sp_param)
270
271      tag = "type"
272      call smd_system_set_component(tag,sp_type)
273
274      tag = "lattice"
275      call smd_system_set_component(tag,sp_lattice)
276
277      tag = "potential"
278      call smd_system_set_component(tag,sp_pot)
279
280      tag = "coordinates"
281      call smd_system_set_component(tag,sp_coord)
282
283      tag = "force"
284      call smd_system_set_component(tag,sp_force)
285
286      tag = "charge"
287      call smd_system_set_component(tag,sp_charge)
288
289      tag = "fragment"
290      call smd_system_set_component(tag,sp_fragment)
291
292      tag = "excl_list"
293      call smd_system_set_component(tag,sp_exlist)
294
295      tag = "verlet_list"
296      call smd_system_set_component(tag,sp_vlist)
297
298      tag = "energy"
299      call smd_system_set_component(tag,sp_energy)
300
301      tag = "bond"
302      call smd_system_set_component(tag,sp_bond)
303
304      tag = "shakelist"
305      call smd_system_set_component(tag,sp_shakelist)
306
307      tag = "bondlist"
308      call smd_system_set_component(tag,sp_bondlist)
309
310      tag = "mass"
311      call smd_system_set_component(tag,sp_mass)
312
313      tag = "cutoff"
314      call smd_system_set_component(tag,sp_cutoff)
315
316      tag = "temperature"
317      call smd_system_set_component(tag,sp_temperature)
318
319      tag = "rtdb"
320      call smd_system_set_component(tag,sp_rtdb)
321
322      tag = "ewald"
323      call smd_system_set_component(tag,sp_ewald)
324c
325c      write(*,*) "in "//pname
326c     DEFINE ALL THE COMPONENTS
327c     --------------------------------
328c
329      if(ga_nodeid().eq.master) then
330      call smd_rtdb_init(.false.,rtdb)
331      call smd_cutoff_init()
332      call smd_temper_init()
333      call smd_atom_init_system()
334      call smd_param_init_system()
335      call smd_lat_init_system()
336      call smd_pot_init_system()
337      call smd_type_init_system()
338      call smd_energy_init_system()
339      call smd_force_init_system()
340      call smd_charge_init_system()
341      call smd_coords_init_system()
342      call smd_exlist_init_system()
343      call smd_vlist_init_system()
344      call smd_bond_init_system()
345      call smd_shakelist_init_system()
346      call smd_bondlist_init_system()
347      call smd_mass_init_system()
348c
349c     finish system setup
350c     -------------------
351      call smd_coords_rebox()
352      call smd_ewald_init()
353      call smd_system_print(6)
354
355      end if
356      call ga_sync()
357      call smd_data_brdcst_create(master)
358      call smd_fragment_init_system()
359      return
360      end
361
362      subroutine smd_init_dynamics(rtdb)
363      implicit none
364#include "errquit.fh"
365#include "inp.fh"
366#include "mafdecls.fh"
367#include "rtdb.fh"
368#include "util.fh"
369#include "global.fh"
370c
371      integer rtdb
372c
373      logical ostatus
374      character*72 tag
375      character*32 pname
376      character*255 filename
377      character*72 sp_system
378      character*72 sp_atom
379      character*72 sp_param
380      character*72 sp_bond
381      character*72 sp_shakelist
382      character*72 sp_bondlist
383      character*72 sp_lattice
384      character*72 sp_type
385      character*72 sp_pot
386      character*72 sp_coord
387      character*72 sp_charge
388      character*72 sp_force
389      character*72 sp_energy
390      character*72 sp_exlist
391      character*72 sp_vlist
392      character*72 sp_velocity
393      character*72 sp_mass
394      character*72 sp_cutoff
395      character*72 sp_temperature
396      character*72 sp_rtdb
397      character*72 sp_ewald
398c
399      logical olattice
400      logical obond
401      integer master
402c
403      logical odistrib
404c
405      odistrib = .false.
406      master = 0
407      pname = "smd_init_dynamics"
408c
409      sp_atom      = "atom"
410      sp_param     = "parameters"
411      sp_lattice   = "lattice"
412      sp_type      = "type"
413      sp_pot       = "potential"
414      sp_coord     = "coordinates"
415      sp_charge    = "charge"
416      sp_force     = "force"
417      sp_energy    = "energy"
418      sp_exlist    = "excluded_list"
419      sp_vlist     = "verlet_list"
420      sp_shakelist = "shakelist"
421      sp_bondlist  = "bondlist"
422      sp_bond      = "bond"
423      sp_velocity  = "velocity"
424      sp_mass  = "mass"
425      sp_cutoff  = "cutoff"
426      sp_temperature = "temperature"
427      sp_rtdb = "rtdb"
428      sp_ewald = "ewald"
429c
430c
431c     CREATE SYSTEM
432c     ------------
433      tag = "atom"
434      call smd_system_set_component(tag,sp_atom)
435
436      tag = "parameters"
437      call smd_system_set_component(tag,sp_param)
438
439      tag = "type"
440      call smd_system_set_component(tag,sp_type)
441
442      tag = "lattice"
443      call smd_system_set_component(tag,sp_lattice)
444
445      tag = "potential"
446      call smd_system_set_component(tag,sp_pot)
447
448      tag = "coordinates"
449      call smd_system_set_component(tag,sp_coord)
450
451      tag = "force"
452      call smd_system_set_component(tag,sp_force)
453
454      tag = "charge"
455      call smd_system_set_component(tag,sp_charge)
456
457      tag = "excl_list"
458      call smd_system_set_component(tag,sp_exlist)
459
460      tag = "verlet_list"
461      call smd_system_set_component(tag,sp_vlist)
462
463      tag = "energy"
464      call smd_system_set_component(tag,sp_energy)
465
466      tag = "bond"
467      call smd_system_set_component(tag,sp_bond)
468
469      tag = "shakelist"
470      call smd_system_set_component(tag,sp_shakelist)
471
472      tag = "bondlist"
473      call smd_system_set_component(tag,sp_bondlist)
474
475      tag = "velocity"
476      call smd_system_set_component(tag,sp_velocity)
477
478      tag = "mass"
479      call smd_system_set_component(tag,sp_mass)
480
481      tag = "cutoff"
482      call smd_system_set_component(tag,sp_cutoff)
483
484      tag = "temperature"
485      call smd_system_set_component(tag,sp_temperature)
486
487      tag = "rtdb"
488      call smd_system_set_component(tag,sp_rtdb)
489
490      tag = "ewald"
491      call smd_system_set_component(tag,sp_ewald)
492c
493c      write(*,*) "in "//pname
494c     DEFINE ALL THE COMPONENTS
495c     --------------------------------
496c
497      if(ga_nodeid().eq.master) then
498      call smd_rtdb_init(.false.,rtdb)
499      call smd_cutoff_init()
500      call smd_temper_init()
501      call smd_atom_init_system()
502      call smd_param_init_system()
503      call smd_lat_init_system()
504      call smd_pot_init_system()
505      call smd_type_init_system()
506      call smd_energy_init_system()
507      call smd_force_init_system()
508      call smd_coords_init_system()
509      call smd_charge_init_system()
510      call smd_exlist_init_system()
511      call smd_vlist_init_system()
512      call smd_bond_init_system()
513      call smd_shakelist_init_system()
514      call smd_bondlist_init_system()
515      call smd_vel_init_system()
516      call smd_mass_init_system()
517c
518c     finish system setup
519c     -------------------
520      call smd_coords_rebox()
521      call smd_ewald_init()
522      call smd_system_print(6)
523
524      end if
525      call ga_sync()
526      call smd_data_brdcst_create(master)
527      return
528      end
529
530c $Id$
531