1 double precision function rmscalc(ishif,i,j,jcon,lprn)
2 implicit real*8 (a-h,o-z)
4 include 'DIMENSIONS.ZSCOPT'
5 include 'DIMENSIONS.COMPAR'
6 include 'COMMON.IOUNITS'
7 include 'COMMON.COMPAR'
9 include 'COMMON.INTERACT'
11 include 'COMMON.CONTROL'
12 double precision przes(3),obrot(3,3)
13 double precision creff(3,maxres2),cc(3,maxres2)
14 logical iadded(maxres)
15 integer inumber(2,maxres)
16 common /ccc/ creff,cc,iadded,inumber
21 write (iout,*) "i",i," j",j," jcont",jcon," ishif",ishif
22 write (iout,*) "npiece",npiece(j,i)
25 c write (iout,*) "symetr",symetr
31 c write (iout,*) "nperm",nperm
38 c write (iout,*) "kkk",kkk
43 write (iout,*) "Level 1: j=",j,"k=",k," adding fragment",
44 & ifrag(1,k,j),ifrag(2,k,j)
47 call cprep(ifrag(1,k,j),ifrag(2,k,j),ishif,idup,kkk)
48 c write (iout,*) "Exit cprep"
50 c write (iout,*) "ii=",ii
53 c write (iout,*) "kk",kk," npiece",npiece(kk,1)
56 write (iout,*) "Level",i,": j=",j,"k=",k," kk=",kk,
57 & " l=",l," adding fragment",
58 & ifrag(1,l,kk),ifrag(2,l,kk)
61 call cprep(ifrag(1,l,kk),ifrag(2,l,kk),ishif,idup,kkk)
62 c write (iout,*) "After cprep"
69 write (iout,*) "tuszukaj"
72 write(iout,'(5i4,2(3f10.5,5x))') i,j,k,inumber(1,k),
73 & inumber(2,k),(creff(l,k),l=1,3),(cc(l,k),l=1,3)
80 call fitsq(rms,cc(1,1),creff(1,1),idup,przes,obrot,non_conv)
82 print *,'Error: FITSQ non-convergent, jcon',jcon,i
84 else if (rms.lt.-1.0d-6) then
85 print *,'Error: rms^2 = ',rms,jcon,i
87 else if (rms.ge.1.0d-6 .and. rms.lt.0) then
90 c write (iout,*) "rmsmin", rminrms, "rms", rms
91 if (rms.le.rminrms) rminrms=rms
93 rmscalc = dsqrt(rminrms)
94 c write (iout, *) "analysys", rmscalc,anatemp
97 c-------------------------------------------------------------------------
98 subroutine cprep(if1,if2,ishif,idup,kwa)
99 implicit real*8 (a-h,o-z)
101 include 'DIMENSIONS.ZSCOPT'
102 include 'DIMENSIONS.COMPAR'
103 include 'COMMON.CONTROL'
104 include 'COMMON.IOUNITS'
105 include 'COMMON.COMPAR'
106 include 'COMMON.CHAIN'
107 include 'COMMON.INTERACT'
109 double precision przes(3),obrot(3,3)
110 double precision creff(3,maxres2),cc(3,maxres2)
111 logical iadded(maxres)
112 integer inumber(2,maxres),iistrart,kwa,blar
113 common /ccc/ creff,cc,iadded,inumber
114 c write (iout,*) "Calling cprep symetr",symetr," kwa",kwa
119 c write (iout,*) "nperm",nperm
123 c write (iout,*) "l",l," iadded",iadded(l)
125 if (l+ishif.gt.1 .and. l+ishif.le.nres .and. .not.iadded(l))
130 inumber(2,idup)=l+ishif
132 creff(m,idup)=cref(m,l,kkk)
133 cc(m,idup)=c(m,l+ishif)
139 c-------------------------------------------------------------------------
140 double precision function rmsnat(jcon)
141 implicit real*8 (a-h,o-z)
143 include 'DIMENSIONS.ZSCOPT'
144 include 'DIMENSIONS.COMPAR'
145 include 'COMMON.IOUNITS'
146 include 'COMMON.COMPAR'
147 include 'COMMON.CHAIN'
148 include 'COMMON.INTERACT'
150 include 'COMMON.CONTROL'
151 double precision przes(3),obrot(3,3),cc(3,2*maxres),
154 integer ishif,i,j,resprzesun
158 C write (iout,*) "tu2", nres,nsup
160 if (nres.gt.nsup) noverlap=nsup
161 write (iout,*) "tu3,",noverlap
168 if (itype(i).ne.ntyp1) then
172 ccref(j,nnsup)=cref(j,i,kkk)
176 call fitsq(rms,cc(1,1),ccref(1,1),nnsup,przes,obrot,non_conv)
178 print *,'Error: FITSQ non-convergent, jcon',jcon,i
180 else if (rms.lt.-1.0d-6) then
181 print *,'Error: rms^2 = ',rms,jcon,i
183 else if (rms.ge.1.0d-6 .and. rms.lt.0) then
186 if (rms.le.rminrms) rminrms=rms
187 c write (iout,*) "kkk",kkk," rmsnat",rms , rminrms
189 rmsnat = dsqrt(rminrms)
190 C write (iout,*) "analysys",rmsnat, anatemp
191 C liczenie rmsdla pojedynczego lancucha
194 c-----------------------------------------------------------------------------
195 double precision function gyrate(jcon)
196 implicit real*8 (a-h,o-z)
198 include 'COMMON.INTERACT'
199 include 'COMMON.CHAIN'
200 double precision cen(3),rg
212 cen(j)=cen(j)/dble(nct-nnt+1)
217 rg = rg + (c(j,i)-cen(j))**2
220 gyrate = dsqrt(rg/dble(nct-nnt+1))