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 'DIMENSIONS.FREE'
7 include 'COMMON.IOUNITS'
8 include 'COMMON.COMPAR'
10 include 'COMMON.INTERACT'
12 include 'COMMON.CONTROL'
13 double precision przes(3),obrot(3,3)
14 double precision creff(3,maxres2),cc(3,maxres2)
15 logical iadded(maxres)
16 integer inumber(2,maxres)
17 common /ccc/ creff,cc,iadded,inumber
22 write (iout,*) "i",i," j",j," jcont",jcon," ishif",ishif
23 write (iout,*) "npiece",npiece(j,i)
26 c write (iout,*) "symetr",symetr
32 c write (iout,*) "nperm",nperm
39 c write (iout,*) "kkk",kkk
44 write (iout,*) "Level 1: j=",j,"k=",k," adding fragment",
45 & ifrag(1,k,j),ifrag(2,k,j)
48 call cprep(ifrag(1,k,j),ifrag(2,k,j),ishif,idup,kkk)
49 c write (iout,*) "Exit cprep"
51 c write (iout,*) "ii=",ii
54 c write (iout,*) "kk",kk," npiece",npiece(kk,1)
57 write (iout,*) "Level",i,": j=",j,"k=",k," kk=",kk,
58 & " l=",l," adding fragment",
59 & ifrag(1,l,kk),ifrag(2,l,kk)
62 call cprep(ifrag(1,l,kk),ifrag(2,l,kk),ishif,idup,kkk)
63 c write (iout,*) "After cprep"
70 write (iout,*) "tuszukaj"
73 write(iout,'(5i4,2(3f10.5,5x))') i,j,k,inumber(1,k),
74 & inumber(2,k),(creff(l,k),l=1,3),(cc(l,k),l=1,3)
81 call fitsq(rms,cc(1,1),creff(1,1),idup,przes,obrot,non_conv)
83 print *,'Error: FITSQ non-convergent, jcon',jcon,i
85 else if (rms.lt.-1.0d-6) then
86 print *,'Error: rms^2 = ',rms,jcon,i
88 else if (rms.ge.1.0d-6 .and. rms.lt.0) then
91 c write (iout,*) "rmsmin", rminrms, "rms", rms
92 if (rms.le.rminrms) rminrms=rms
94 rmscalc = dsqrt(rminrms)
95 c write (iout, *) "analysys", rmscalc,anatemp
98 c-------------------------------------------------------------------------
99 subroutine cprep(if1,if2,ishif,idup,kwa)
100 implicit real*8 (a-h,o-z)
102 include 'DIMENSIONS.ZSCOPT'
103 include 'DIMENSIONS.COMPAR'
104 include 'DIMENSIONS.FREE'
105 include 'COMMON.CONTROL'
106 include 'COMMON.IOUNITS'
107 include 'COMMON.COMPAR'
108 include 'COMMON.CHAIN'
109 include 'COMMON.INTERACT'
111 double precision przes(3),obrot(3,3)
112 double precision creff(3,maxres2),cc(3,maxres2)
113 logical iadded(maxres)
114 integer inumber(2,maxres),iistrart,kwa,blar
115 common /ccc/ creff,cc,iadded,inumber
116 c write (iout,*) "Calling cprep symetr",symetr," kwa",kwa
121 c write (iout,*) "nperm",nperm
125 c write (iout,*) "l",l," iadded",iadded(l)
127 if (l+ishif.gt.1 .and. l+ishif.le.nres .and. .not.iadded(l))
132 inumber(2,idup)=l+ishif
134 creff(m,idup)=cref(m,l,kkk)
135 cc(m,idup)=c(m,l+ishif)
141 c-------------------------------------------------------------------------
142 double precision function rmsnat(jcon)
143 implicit real*8 (a-h,o-z)
145 include 'DIMENSIONS.ZSCOPT'
146 include 'DIMENSIONS.COMPAR'
147 include 'DIMENSIONS.FREE'
148 include 'COMMON.IOUNITS'
149 include 'COMMON.COMPAR'
150 include 'COMMON.CHAIN'
151 include 'COMMON.INTERACT'
153 include 'COMMON.CONTROL'
154 double precision przes(3),obrot(3,3),cc(3,2*maxres),
157 integer ishif,i,j,resprzesun
161 C write (iout,*) "tu2", nres,nsup
163 if (nres.gt.nsup) noverlap=nsup
164 write (iout,*) "tu3,",noverlap
171 if (itype(i).ne.ntyp1) then
175 ccref(j,nnsup)=cref(j,i,kkk)
179 call fitsq(rms,cc(1,1),ccref(1,1),nnsup,przes,obrot,non_conv)
181 print *,'Error: FITSQ non-convergent, jcon',jcon,i
183 else if (rms.lt.-1.0d-6) then
184 print *,'Error: rms^2 = ',rms,jcon,i
186 else if (rms.ge.1.0d-6 .and. rms.lt.0) then
189 if (rms.le.rminrms) rminrms=rms
190 c write (iout,*) "kkk",kkk," rmsnat",rms , rminrms
192 rmsnat = dsqrt(rminrms)
193 C write (iout,*) "analysys",rmsnat, anatemp
194 C liczenie rmsdla pojedynczego lancucha
197 c-----------------------------------------------------------------------------
198 double precision function gyrate(jcon)
199 implicit real*8 (a-h,o-z)
201 include 'COMMON.INTERACT'
202 include 'COMMON.CHAIN'
203 double precision cen(3),rg
215 cen(j)=cen(j)/dble(nct-nnt+1)
220 rg = rg + (c(j,i)-cen(j))**2
223 gyrate = dsqrt(rg/dble(nct-nnt+1))