1 subroutine cxread(nazwa,ii,jj,kk,ll,mm,iR,ib,iparm,*)
2 implicit real*8 (a-h,o-z)
4 include 'DIMENSIONS.ZSCOPT'
5 include 'DIMENSIONS.FREE'
7 parameter (MaxTraj=2050)
9 include 'COMMON.INTERACT'
10 include 'COMMON.NAMES'
11 include 'COMMON.IOUNITS'
12 include 'COMMON.HEADER'
13 include 'COMMON.SBRIDGE'
14 include 'COMMON.PROTFILES'
15 include 'COMMON.OBCINKA'
20 character*64 nazwa,bprotfile_temp
21 real*4 rtime,rpotE,ruconst,rt_bath,rprop(maxQ)
23 integer iret,itmp,itraj,ntraj
24 real xoord(3,maxres2+2),prec
25 integer nstep(0:MaxTraj-1)
28 integer ii,jj(maxslice),kk(maxslice),ll(maxslice),mm(maxslice)
29 integer is(MaxSlice),ie(MaxSlice),nrec_slice
30 double precision ts(MaxSlice),te(MaxSlice),time_slice
32 call set_slices(is,ie,ts,te,iR,ib,iparm)
43 #if (defined(AIX) && !defined(JUBL))
44 call xdrfopen_(ixdrf,nazwa, "r", iret)
46 call xdrfopen(ixdrf,nazwa, "r", iret)
48 if (iret.eq.0) return1
51 call opentmp(islice1,ientout,bprotfile_temp)
55 #if (defined(AIX) && !defined(JUBL))
56 call xdrffloat_(ixdrf, rtime, iret)
57 c print *,"rtime",rtime," iret",iret
58 call xdrffloat_(ixdrf, rpotE, iret)
59 c write (iout,*) "rpotE",rpotE," iret",iret
61 call xdrffloat_(ixdrf, ruconst, iret)
62 call xdrffloat_(ixdrf, rt_bath, iret)
63 call xdrfint_(ixdrf, nss, iret)
65 call xdrfint_(ixdrf, ihpb(j), iret)
66 call xdrfint_(ixdrf, jhpb(j), iret)
68 call xdrfint_(ixdrf, nprop, iret)
70 call xdrffloat_(ixdrf, rprop(i), iret)
73 call xdrffloat(ixdrf, rtime, iret)
74 call xdrffloat(ixdrf, rpotE, iret)
75 c write (iout,*) "rpotE",rpotE," iret",iret
77 call xdrffloat(ixdrf, ruconst, iret)
78 call xdrffloat(ixdrf, rt_bath, iret)
79 call xdrfint(ixdrf, nss, iret)
81 call xdrfint(ixdrf, ihpb(j), iret)
82 call xdrfint(ixdrf, jhpb(j), iret)
84 call xdrfint(ixdrf, nprop, iret)
85 c write (iout,*) "nprop",nprop
88 call xdrffloat(ixdrf, rprop(i), iret)
92 itraj=mod(it,totraj(iR,iparm))
94 write (iout,*) "ii",ii," itraj",itraj
98 if (itraj.gt.ntraj) ntraj=itraj
99 nstep(itraj)=nstep(itraj)+1
101 write (iout,*) rtime,rpotE,rt_bath,nss,
102 & (ihpb(j),jhpb(j),j=1,nss),(rprop(j),j=1,nprop)
108 #if (defined(AIX) && !defined(JUBL))
109 call xdrf3dfcoord_(ixdrf, xoord, itmp, prec, iret)
111 call xdrf3dfcoord(ixdrf, xoord, itmp, prec, iret)
114 write (iout,'(10f8.3)') ((xoord(j,i),j=1,3),i=1,itmp)
117 if (itmp .ne. nres + nct - nnt + 1) then
118 write (iout,*) "Error: inconsistent sizes",itmp,nres+nct-nnt+1
124 c write (iout,*) "calling slice"
126 islice=slice(nstep(itraj),time,is,ie,ts,te)
127 c write (iout,*) "islice",islice
130 if (islice.gt.0 .and. islice.le.nslice) then
132 kk(islice)=kk(islice)+1
133 mm(islice)=mm(islice)+1
134 if (mod(nstep(itraj),isampl(iparm)).eq.0) then
135 if (replica(iparm)) then
136 rt_bath=1.0d0/(rt_bath*1.987D-3)
138 if (abs(real(beta_h(i,iparm))-rt_bath).lt.1.0e-4) then
144 if (i.gt.nT_h(iparm)) then
145 write (iout,*) "Error - temperature of conformation",
146 & ii,1.0d0/(rt_bath*1.987D-3),
147 & " does not match any of the list"
149 & 1.0d0/(rt_bath*1.987D-3),
150 & (1.0d0/(beta_h(i,iparm)*1.987D-3),i=1,nT_h(iparm))
153 call MPI_Abort(MPI_COMM_WORLD,IERROR,ERRCODE)
160 jj(islice)=jj(islice)+1
161 snk(iR,iib,iparm,islice)=snk(iR,iib,iparm,islice)+1
162 ll(islice)=ll(islice)+1
164 write (iout,*) "Writing conformation, record",ll(islice)
165 write (iout,*) "ib",ib," iib",iib
166 write (iout,*) "ntraj",ntraj," itraj",itraj,
167 & " nstep",nstep(itraj)
168 write (iout,*) "pote",rpotE," time",rtime
169 c if (replica(iparm)) then
170 c write (iout,*) "TEMP",1.0d0/(rt_bath*1.987D-3)
171 c write (iout,*) "TEMP list"
173 c & (1.0d0/(beta_h(i,iparm)*1.987D-3),i=1,nT_h(iparm))
175 write (iout,*) "iparm",iparm," ib",ib," iR",iR," nQ",nQ
176 c write (iout,*) "nres",nres," nnt",nnt," nct",nct," nss",nss
177 c write (iout,*) "length",nres*4+(nct-nnt+1)*4+4+2*nss*4
180 if (islice.ne.islice1) then
181 c write (iout,*) "islice",islice," islice1",islice1
183 c write (iout,*) "Closing file ",
184 c & bprotfile_temp(:ilen(bprotfile_temp))
185 call opentmp(islice,ientout,bprotfile_temp)
186 c write (iout,*) "Opening file ",
187 c & bprotfile_temp(:ilen(bprotfile_temp))
190 write(ientout,rec=ll(islice))
191 & ((xoord(l,k),l=1,3),k=1,nres),
192 & ((xoord(l,k),l=1,3),k=nres+1,nres+nct-nnt+1),
193 & nss,(ihpb(k),jhpb(k),k=1,nss),
194 & rpotE+0.0d0,efree,rmsdev,(rprop(i)+0.0d0,i=1,nQ),
204 c(j,i+nres+nnt-1)=xoord(j,i+nres)
207 call int_from_cart1(.false.)
208 write (iout,*) "Writing conformation, record",ll(islice)
209 write (iout,*) "Cartesian coordinates"
210 write (iout,'(8f10.5)') ((c(j,i),j=1,3),i=1,nres)
211 write (iout,'(8f10.5)') ((c(j,i+nres),j=1,3),i=nnt,nct)
212 write (iout,*) "Internal coordinates"
213 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
214 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
215 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
216 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
217 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
218 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
219 write (iout,'(16i5)') nss,(ihpb(k),jhpb(k),k=1,nss)
220 c write (iout,'(8f10.5)') (rprop(j),j=1,nQ)
221 write (iout,'(16i5)') iscor
230 #if (defined(AIX) && !defined(JUBL))
231 call xdrfclose_(ixdrf, iret)
233 call xdrfclose(ixdrf, iret)
235 write (iout,'(i10," trajectories found in file.")') ntraj+1
236 write (iout,'(a)') "Numbers of steps in trajectories:"
237 write (iout,'(8i10)') (nstep(i),i=0,ntraj)
238 write (iout,*) ii," conformations read from file",
239 & nazwa(:ilen(nazwa))
241 write (iout,*) mm(islice)," conformations read so far, slice",
243 write (iout,*) ll(islice),
244 & " conformations stored so far, slice",islice