1
subroutine smd_bondlist_init_system()
10
character*32 sp_bond,sp_type,sp_bondlist
11
character*32 tag,pname
14
pname = "smd_bondlist_init_system"
17
call smd_system_get_component(sp_bond,tag,result)
18
if(.not.result) goto 200
21
call smd_system_get_component(sp_type,tag,result)
24
> pname//'no component '//tag,0,0)
27
call smd_system_get_component(sp_bondlist,tag,result)
30
> pname//'no component '//tag,0,0)
32
call smd_bondlist_init(sp_bondlist,result)
37
call smd_system_unset_component(tag)
43
subroutine smd_bondlist_init(sp_bondlist,result)
47
#include "mafdecls.fh"
52
character*(*) sp_bondlist
57
character*255 filename
61
integer i_ib1,i_ib2,i_db,i_itb
75
pname = "smd_bondlist_init"
77
c write(*,*) "in "//pname
82
call smd_get_ind_dim(tag,i_it,na,result)
85
> pname//'error getting index for'//tag,0, RTDB_ERR)
90
call smd_get_ind(tag,i_ib1,result)
93
> pname//'error getting index for '//tag,0, 0)
96
call smd_get_ind(tag,i_ib2,result)
99
> pname//'error getting index for '//tag,0, 0)
101
tag = "bond:distance"
102
call smd_get_ind(tag,i_db,result)
105
> pname//'error getting index for '//tag,0, 0)
107
tag = "bond:strength"
108
call smd_get_ind(tag,i_kb,result)
111
> pname//'error getting index for '//tag,0, 0)
115
call smd_get_ind_dim(tag,i_itb,nb,result)
118
> pname//'error getting index for '//tag,0, 0)
121
c allocate initial storage for bond list
122
c ---------------------------------------
124
if(.not.ma_push_get(mt_int,ns,'tmp i1',h_il1t,i_il1t))
125
+ call errquit(pname//'Failed to allocate memory',
128
if(.not.ma_push_get(mt_int,ns,'tmp i2',h_il2t,i_il2t))
129
+ call errquit(pname//'Failed to allocate memory',
132
if(.not.ma_push_get(mt_dbl,ns,'tmp d',h_dlt,i_dlt))
133
+ call errquit(pname//'Failed to allocate memory',
136
if(.not.ma_push_get(mt_dbl,ns,'tmp k',h_klt,i_klt))
137
+ call errquit(pname//'Failed to allocate memory',
140
if(.not.ma_push_get(mt_int,ns,'tmp t',h_tlt,i_tlt))
141
+ call errquit(pname//'Failed to allocate memory',
145
call smd_bondlist_set(ns,nb,na,
158
c create bond list structure
159
c ---------------------------
164
call smd_namespace_create(sp_bondlist)
166
call smd_data_create_get(sp_bondlist,tag,ns,MT_INT,i_il1)
168
call smd_data_create_get(sp_bondlist,tag,ns,MT_INT,i_il2)
169
tag = "bond:distance"
170
call smd_data_create_get(sp_bondlist,tag,ns,MT_DBL,i_dl)
171
tag = "bond:strength"
172
call smd_data_create_get(sp_bondlist,tag,ns,MT_DBL,i_kl)
174
call smd_data_create_get(sp_bondlist,tag,ns,MT_INT,i_tl)
178
int_mb(i_il1+i-1) = int_mb(i_il1t+i-1)
179
int_mb(i_il2+i-1) = int_mb(i_il2t+i-1)
180
int_mb(i_tl+i-1) = int_mb(i_tlt+i-1)
181
dbl_mb(i_dl+i-1) = dbl_mb(i_dlt+i-1)
182
dbl_mb(i_kl+i-1) = dbl_mb(i_klt+i-1)
187
if(.not.ma_pop_stack(h_tlt))
188
& call errquit(pname//'Failed to deallocate stack',0,
191
if(.not.ma_pop_stack(h_klt))
192
& call errquit(pname//'Failed to deallocate stack',0,
195
if(.not.ma_pop_stack(h_dlt))
196
& call errquit(pname//'Failed to deallocate stack',0,
199
if(.not.ma_pop_stack(h_il2t))
200
& call errquit(pname//'Failed to deallocate stack',0,
203
if(.not.ma_pop_stack(h_il1t))
204
& call errquit(pname//'Failed to deallocate stack',0,
210
subroutine smd_bondlist_set(ns,nb,na,
224
#include "errquit.fh"
226
#include "mafdecls.fh"
235
double precision dl(ns)
236
double precision kl(ns)
240
double precision db(ns)
241
double precision kb(ns)
244
integer i,i1,i2,j,nlist
251
if(it(j).eq.ib1(i)) i1=j
252
if(it(j).eq.ib2(i)) i2=j
255
il1(nlist) = min(i1,i2)
256
il2(nlist) = max(i1,i2)