1
subroutine smd_coords_init_system()
10
character*32 sp_coords,sp_atom
11
character*32 tag,pname
14
pname = "smd_coords_init_system"
17
call smd_system_get_component(sp_atom,tag,result)
20
> pname//'no component '//tag,0,0)
23
call smd_system_get_component(sp_coords,tag,result)
26
> pname//'no component '//tag,0,0)
28
call smd_coords_init(sp_coords,sp_atom)
30
call smd_coords_read(sp_coords)
35
subroutine smd_coords_init(sp_coords,sp_atom)
39
#include "mafdecls.fh"
44
character*(*) sp_coords
50
pname = "smd_coords_init"
52
c write(*,*) "in "//pname
54
c get total number of atoms
55
c -------------------------
56
call smd_atom_ntot(sp_atom,na)
59
> pname//'no atoms ',0, RTDB_ERR)
61
c create coords data structures
62
c ---------------------------
63
call smd_namespace_create(sp_coords)
64
call smd_data_create(sp_coords,"coords",3*na,MT_DBL)
69
subroutine smd_coords_read(sp_coords)
73
#include "mafdecls.fh"
78
character*(*) sp_coords
87
pname = "smd_coords_read"
89
write(*,*) "in "//pname
91
c fill in coordinates from pdb file if any
92
c ----------------------------------------
94
call smd_data_get_index(sp_coords,tag,i_c,result)
97
> pname//'error getting index for '//tag,0, RTDB_ERR)
99
call smd_data_get_size(sp_coords,tag,na,result)
102
> pname//'error getting index for '//tag,0, RTDB_ERR)
105
> pname//'no atoms ',0, RTDB_ERR)
109
call smd_coordfile_read_coords(na,
116
subroutine smd_coords_rebox()
118
#include "errquit.fh"
120
#include "mafdecls.fh"
125
character*32 sp_coords
130
integer i_c,i_lrc,i_lc
133
pname = "smd_atom_rebox"
136
c get atomic coordinates
137
c ----------------------
138
call smd_system_get_component(sp_coords,"coordinates",result)
141
> pname//'no coordinates ',0,0)
144
call smd_data_get_index(sp_coords,tag,i_c,result)
147
> pname//'error getting index for '//tag,0, RTDB_ERR)
149
call smd_data_get_size(sp_coords,tag,na,result)
152
> pname//'error getting index for '//tag,0, RTDB_ERR)
156
call smd_lat_rebox(na,
162
subroutine smd_coords_print(un)
164
#include "errquit.fh"
166
#include "mafdecls.fh"
172
character*32 sp_coords
177
integer i_c,i_lrc,i_lc
180
pname = "smd_atom_rebox"
183
c get atomic coordinates
184
c ----------------------
185
call smd_system_get_component(sp_coords,"coordinates",result)
188
> pname//'no coordinates ',0,0)
191
call smd_data_get_index(sp_coords,tag,i_c,result)
194
> pname//'error getting index for '//tag,0, RTDB_ERR)
196
call smd_data_get_size(sp_coords,tag,na,result)
199
> pname//'error getting index for '//tag,0, RTDB_ERR)
204
call smd_util_print_force_array(un,na,
210
subroutine smd_coords_update()
212
#include "errquit.fh"
214
#include "mafdecls.fh"
217
#include "smd_system.fh"
220
character*72 sp_coords
222
character*72 sp_force
223
character*72 sp_shakelist
231
double precision ekin, tstep
233
integer i_is1,i_is2,i_ds,ns
237
integer h_nrij,i_nrij
238
integer h_orij,i_orij
240
pname = "smd_coords_update"
242
c write(*,*) "in "//pname
244
call smd_rtdb_get_handle(rtdb)
249
call smd_system_get_component(sp_vel,tag,result)
252
> pname//'no component '//tag,0,0)
255
call smd_system_get_component(sp_mass,tag,result)
258
> pname//'no component '//tag,0,0)
261
call smd_system_get_component(sp_force,tag,result)
264
> pname//'no component '//tag,0,0)
267
call smd_system_get_component(sp_coords,tag,result)
270
> pname//'no component '//tag,0,0)
276
call smd_data_get_index(sp_vel,tag,i_v,result)
279
> pname//'error getting index for'//tag,0, 0)
280
call smd_data_get_size(sp_vel,tag,na,result)
283
> pname//'error getting index for'//tag,0, 0)
290
call smd_data_get_index(sp_mass,tag,i_m,result)
293
> pname//'error getting index for'//tag,0, 0)
298
call smd_data_get_index(sp_force,tag,i_f,result)
301
> pname//'error getting index for'//tag,0, 0)
307
call smd_data_get_index(sp_coords,tag,i_c,result)
310
> pname//'error getting index for'//tag,0, 0)
316
if (.not.rtdb_get(rtdb,tag,mt_dbl,1,tstep))
317
> call errquit(pname//'failed to store'//tag,0,
321
oshake = smd_system_shake()
326
call smd_system_get_component(sp_shakelist,tag,result)
329
> pname//'no component '//tag,0,0)
332
call smd_data_get_index(sp_shakelist,tag,i_is1,result)
335
> pname//'error getting index for '//tag,0, 0)
338
call smd_data_get_index(sp_shakelist,tag,i_is2,result)
341
> pname//'error getting index for '//tag,0, 0)
343
tag = "shake:distance"
344
call smd_data_get_index(sp_shakelist,tag,i_ds,result)
347
> pname//'error getting index for '//tag,0, 0)
349
call smd_data_get_size(sp_shakelist,tag,ns,result)
352
> pname//'error getting size for '//tag,0, 0)
354
if(.not.ma_push_get(mt_dbl,na*3,'i_ncc',h_ncc,i_ncc))
355
+ call errquit(pname//'Failed to allocate memory',
358
if(.not.ma_push_get(mt_dbl,na*3,'i_nvv',h_nvv,i_nvv))
359
+ call errquit(pname//'Failed to allocate memory',
362
if(.not.ma_push_get(mt_dbl,na*3,'i_dcc',h_dcc,i_dcc))
363
+ call errquit(pname//'Failed to allocate memory',
366
if(.not.ma_push_get(mt_dbl,ns*3,'i_nrij',h_nrij,i_nrij))
367
+ call errquit(pname//'Failed to allocate memory',
370
if(.not.ma_push_get(mt_dbl,ns*3,'i_orij',h_orij,i_orij))
371
+ call errquit(pname//'Failed to allocate memory',
376
call smd_leapf_shake(na,
405
call smd_coords_rebox()
409
if(.not.ma_pop_stack(h_orij))
410
& call errquit(pname//'Failed to deallocate stack h_orij',0,
413
if(.not.ma_pop_stack(h_nrij))
414
& call errquit(pname//'Failed to deallocate stack h_nrij',0,
417
if(.not.ma_pop_stack(h_dcc))
418
& call errquit(pname//'Failed to deallocate stack h_dcc',0,
421
if(.not.ma_pop_stack(h_nvv))
422
& call errquit(pname//'Failed to deallocate stack h_nvv',0,
426
if(.not.ma_pop_stack(h_ncc))
427
& call errquit(pname//'Failed to deallocate stack h_ncc',0,