1 c---------------------------------------------------------------------------------------------------------
2 double precision function qwolynes(ilevel,jfrag,ib,iprot)
5 include 'DIMENSIONS.ZSCOPT'
6 include 'DIMENSIONS.COMPAR'
7 include 'COMMON.IOUNITS'
8 include 'COMMON.COMPAR'
10 include 'COMMON.INTERACT'
12 include 'COMMON.PEPTCONT'
13 include 'COMMON.CONTACTS1'
14 include 'COMMON.HEADER'
15 include 'COMMON.CLASSES'
16 integer ilevel,jfrag,ib,iprot
17 integer i,j,jl,k,l,il,kl,nl,np,ip,kp
20 double precision qq,qqij,qqijCM,dij,d0ij,dijCM,d0ijCM
21 logical lprn /.false./
22 double precision sigm,x
24 if (lprn) write (iout,*) "QWolyes: iprot",iprot," ib",ib,
25 & " jfrag",jfrag," ilevel",ilevel
28 if (lprn) write (iout,*) "Q computed for whole molecule"
39 d0ij=dsqrt((cref(1,jl,iprot)-cref(1,il,iprot))**2+
40 & (cref(2,jl,iprot)-cref(2,il,iprot))**2+
41 & (cref(3,jl,iprot)-cref(3,il,iprot))**2)
43 qqij = dexp(-0.5d0*((dij-d0ij)/(sigm(d0ij)))**2)
44 if (itype(il).ne.10 .or. itype(jl).ne.10) then
47 & (cref(1,jl+nres,iprot)-cref(1,il+nres,iprot))**2+
48 & (cref(2,jl+nres,iprot)-cref(2,il+nres,iprot))**2+
49 & (cref(3,jl+nres,iprot)-cref(3,il+nres,iprot))**2)
50 dijCM=dist(il+nres,jl+nres)
51 qqijCM = dexp(-0.5d0*((dijCM-d0ijCM)/(sigm(d0ijCM)))**2)
55 c write (iout,*) "il",il," jl",jl,
56 c & " itype",itype(il),itype(jl)
57 c write (iout,*)"d0ij",d0ij," dij",dij," d0ijCM",d0ijCM,
58 c & " dijCM",dijCM," qqij",qqij," qqijCM",qqijCM
63 if (lprn) write (iout,*) "nl",nl," qq",qq
64 else if (ilevel.eq.1) then
66 write (iout,*) "Level",ilevel," fragment",jfrag
67 write (iout,*) "nlist_frag",nlist_frag(jfrag,ib,iprot),
68 & " list_frag",(list_frag(j,jfrag,ib,iprot),
69 & j=1,nlist_frag(jfrag,ib,iprot))
72 do i=2,nlist_frag(jfrag,ib,iprot)
74 il=list_frag(i,jfrag,ib,iprot)
75 jl=list_frag(j,jfrag,ib,iprot)
76 if (iabs(il-jl).gt.nsep) then
84 d0ij=dsqrt((cref(1,jl,iprot)-cref(1,il,iprot))**2+
85 & (cref(2,jl,iprot)-cref(2,il,iprot))**2+
86 & (cref(3,jl,iprot)-cref(3,il,iprot))**2)
88 qqij = dexp(-0.5d0*((dij-d0ij)/(sigm(d0ij)))**2)
89 if (itype(il).ne.10 .or. itype(jl).ne.10) then
92 & (cref(1,jl+nres,iprot)-cref(1,il+nres,iprot))**2+
93 & (cref(2,jl+nres,iprot)-cref(2,il+nres,iprot))**2+
94 & (cref(3,jl+nres,iprot)-cref(3,il+nres,iprot))**2)
95 dijCM=dist(il+nres,jl+nres)
96 qqijCM = dexp(-0.5d0*((dijCM-d0ijCM)/(sigm(d0ijCM)))**2)
100 c write (iout,*) "i",i," j",j," il",il," jl",jl,
101 c & " itype",itype(il),itype(jl)
102 c write (iout,*)"d0ij",d0ij," dij",dij," d0ijCM",d0ijCM,
103 c & " dijCM",dijCM," qqij",qqij," qqijCM",qqijCM
109 if (lprn) write (iout,*) "nl",nl," qq",qq
110 else if (ilevel.eq.2) then
111 np=npiece(jfrag,ilevel,ib,iprot)
114 write (iout,*) "npiece",npiece(jfrag,ilevel,ib,iprot),
115 & " ipiece",(ipiece(i,jfrag,ilevel,ib,iprot),
116 & i=1,npiece(jfrag,ilevel,ib,iprot))
119 ip=ipiece(i,jfrag,ilevel,ib,iprot)
120 do j=1,nlist_frag(ip,ib,iprot)
121 il=list_frag(j,ip,ib,iprot)
123 kp=ipiece(k,jfrag,ilevel,ib,iprot)
124 do l=1,nlist_frag(kp,ib,iprot)
125 kl=list_frag(l,kp,ib,iprot)
126 if (iabs(kl-il).gt.nsep) then
134 d0ij=dsqrt((cref(1,kl,iprot)-cref(1,il,iprot))**2+
135 & (cref(2,kl,iprot)-cref(2,il,iprot))**2+
136 & (cref(3,kl,iprot)-cref(3,il,iprot))**2)
138 qqij = dexp(-0.5d0*((dij-d0ij)/(sigm(d0ij)))**2)
139 if (itype(il).ne.10 .or. itype(kl).ne.10) then
142 & (cref(1,kl+nres,iprot)-cref(1,il+nres,iprot))**2+
143 & (cref(2,kl+nres,iprot)-cref(2,il+nres,iprot))**2+
144 & (cref(3,kl+nres,iprot)-cref(3,il+nres,iprot))**2)
145 dijCM=dist(il+nres,kl+nres)
146 qqijCM = dexp(-0.5d0*((dijCM-d0ijCM)/
147 & (sigm(d0ijCM)))**2)
151 c write (iout,*) "i",i," j",j," k",k," l",l," il",il,
152 c & " kl",kl," itype",itype(il),itype(kl)
153 c write (iout,*) " d0ij",d0ij," dij",dij," d0ijCM",
154 c & d0ijCM," dijCM",dijCM," qqij",qqij," qqijCM",qqijCM
162 if (lprn) write (iout,*) "nl",nl," qq",qq
164 write (iout,*)"Error: Q can be computed only for level 1 and 2."