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
33 call set_slices(is,ie,ts,te,iR,ib,iparm)
44 #if (defined(AIX) && !defined(JUBL))
45 call xdrfopen_(ixdrf,nazwa, "r", iret)
47 call xdrfopen(ixdrf,nazwa, "r", iret)
49 if (iret.eq.0) return1
52 call opentmp(islice1,ientout,bprotfile_temp)
56 #if (defined(AIX) && !defined(JUBL))
57 call xdrffloat_(ixdrf, rtime, iret)
58 c print *,"rtime",rtime," iret",iret
59 call xdrffloat_(ixdrf, rpotE, iret)
60 c write (iout,*) "rpotE",rpotE," iret",iret
62 call xdrffloat_(ixdrf, ruconst, iret)
63 call xdrffloat_(ixdrf, rt_bath, iret)
64 call xdrfint_(ixdrf, nss, iret)
66 call xdrfint_(ixdrf, ihpb(j), iret)
67 call xdrfint_(ixdrf, jhpb(j), iret)
69 call xdrfint_(ixdrf, nprop, iret)
70 if (umbrella(iparm) .or. read_iset(iparm) .or. hamil_rep)
71 & call xdrfint(ixdrf, iset, iret)
73 call xdrffloat_(ixdrf, rprop(i), iret)
76 call xdrffloat(ixdrf, rtime, iret)
77 call xdrffloat(ixdrf, rpotE, iret)
78 c write (iout,*) "rpotE",rpotE," iret",iret
80 call xdrffloat(ixdrf, ruconst, iret)
81 call xdrffloat(ixdrf, rt_bath, iret)
82 call xdrfint(ixdrf, nss, iret)
84 call xdrfint(ixdrf, ihpb(j), iret)
85 call xdrfint(ixdrf, jhpb(j), iret)
87 call xdrfint(ixdrf, nprop, iret)
88 c write (iout,*) "nprop",nprop
89 if (it.gt.0 .and. nprop.ne.nprop_prev) then
90 write (iout,*) "Warning previous nprop",nprop_prev,
97 if (umbrella(iparm) .or. read_iset(iparm) .or. hamil_rep)
98 & call xdrfint(ixdrf, iset, iret)
100 call xdrffloat(ixdrf, rprop(i), iret)
104 itraj=mod(it,totraj(iR,iparm))
106 write (iout,*) "ii",ii," itraj",itraj," it",it
108 if (iset.eq.0) iset = 1
111 if (itraj.gt.ntraj) ntraj=itraj
112 nstep(itraj)=nstep(itraj)+1
113 c rprop(2)=dsqrt(rprop(2))
114 c rprop(3)=dsqrt(rprop(3))
116 write (iout,*) "umbrella ",umbrella
117 write (iout,*) rtime,rpotE,rt_bath,nss,
118 & (ihpb(j),jhpb(j),j=1,nss),(rprop(j),j=1,nprop)
119 write (iout,*) "nprop",nprop," iset",iset," myparm",myparm
125 #if (defined(AIX) && !defined(JUBL))
126 call xdrf3dfcoord_(ixdrf, xoord, itmp, prec, iret)
128 call xdrf3dfcoord(ixdrf, xoord, itmp, prec, iret)
131 write (iout,'(10f8.3)') ((xoord(j,i),j=1,3),i=1,itmp)
134 if (itmp .ne. nres + nct - nnt + 1) then
135 write (iout,*) "Error: inconsistent sizes",itmp,nres+nct-nnt+1
141 c write (iout,*) "calling slice"
143 islice=slice(nstep(itraj),time,is,ie,ts,te)
144 c write (iout,*) "islice",islice
154 c(j,i+nres+nnt-1)=xoord(j,i+nres)
158 if (islice.gt.0 .and. islice.le.nslice .and. (.not.separate_parset
159 & .or. iset.eq.myparm)) then
161 kk(islice)=kk(islice)+1
162 mm(islice)=mm(islice)+1
163 if (mod(nstep(itraj),isampl(iparm)).eq.0 .and.
164 & conf_check(ll(islice)+1,1)) then
165 if (replica(iparm)) then
166 rt_bath=1.0d0/(rt_bath*1.987D-3)
168 if (abs(real(beta_h(i,iparm))-rt_bath).lt.1.0e-4) then
174 if (i.gt.nT_h(iparm)) then
175 write (iout,*) "Error - temperature of conformation",
176 & ii,1.0d0/(rt_bath*1.987D-3),
177 & " does not match any of the list"
179 & 1.0d0/(rt_bath*1.987D-3),
180 & (1.0d0/(beta_h(i,iparm)*1.987D-3),i=1,nT_h(iparm))
183 c call MPI_Abort(MPI_COMM_WORLD,IERROR,ERRCODE)
185 kk(islice)=kk(islice)-1
186 mm(islice)=mm(islice)-1
194 jj(islice)=jj(islice)+1
195 if (umbrella(iparm)) then
196 snk(iset,iib,iparm,islice)=snk(iset,iib,iparm,islice)+1
197 else if (hamil_rep) then
198 snk(1,iib,iparm,islice)=snk(1,iib,iparm,islice)+1
200 snk(iR,iib,iparm,islice)=snk(iR,iib,iparm,islice)+1
202 ll(islice)=ll(islice)+1
204 write (iout,*) "Writing conformation, record",ll(islice)
205 write (iout,*) "ib",ib," iib",iib
206 write (iout,*) "ntraj",ntraj," itraj",itraj,
207 & " nstep",nstep(itraj)
208 write (iout,*) "pote",rpotE," time",rtime
209 c if (replica(iparm)) then
210 c write (iout,*) "TEMP",1.0d0/(rt_bath*1.987D-3)
211 c write (iout,*) "TEMP list"
213 c & (1.0d0/(beta_h(i,iparm)*1.987D-3),i=1,nT_h(iparm))
215 write (iout,*) "iparm",iparm," ib",ib," iR",iR," nQ",nQ
216 c write (iout,*) "nres",nres," nnt",nnt," nct",nct," nss",nss
217 c write (iout,*) "length",nres*4+(nct-nnt+1)*4+4+2*nss*4
220 if (islice.ne.islice1) then
221 c write (iout,*) "islice",islice," islice1",islice1
223 c write (iout,*) "Closing file ",
224 c & bprotfile_temp(:ilen(bprotfile_temp))
225 call opentmp(islice,ientout,bprotfile_temp)
226 c write (iout,*) "Opening file ",
227 c & bprotfile_temp(:ilen(bprotfile_temp))
230 if (umbrella(iparm)) then
231 write(ientout,rec=ll(islice))
232 & ((xoord(l,k),l=1,3),k=1,nres),
233 & ((xoord(l,k),l=1,3),k=nres+1,nres+nct-nnt+1),
234 & nss,(ihpb(k),jhpb(k),k=1,nss),
235 & rpotE+0.0d0,efree,rmsdev,(rprop(i)+0.0d0,i=1,nQ),
237 else if (hamil_rep) then
238 write(ientout,rec=ll(islice))
239 & ((xoord(l,k),l=1,3),k=1,nres),
240 & ((xoord(l,k),l=1,3),k=nres+1,nres+nct-nnt+1),
241 & nss,(ihpb(k),jhpb(k),k=1,nss),
242 & rpotE+0.0d0,efree,rmsdev,(rprop(i)+0.0d0,i=1,nQ),
245 write(ientout,rec=ll(islice))
246 & ((xoord(l,k),l=1,3),k=1,nres),
247 & ((xoord(l,k),l=1,3),k=nres+1,nres+nct-nnt+1),
248 & nss,(ihpb(k),jhpb(k),k=1,nss),
249 & rpotE+0.0d0,efree,rmsdev,(rprop(i)+0.0d0,i=1,nQ),
253 call int_from_cart1(.false.)
254 write (iout,*) "Writing conformation, record",ll(islice)
255 write (iout,*) "Cartesian coordinates"
256 write (iout,'(8f10.5)') ((c(j,i),j=1,3),i=1,nres)
257 write (iout,'(8f10.5)') ((c(j,i+nres),j=1,3),i=nnt,nct)
258 write (iout,*) "Internal coordinates"
259 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
260 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
261 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
262 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
263 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
264 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
265 write (iout,'(16i5)') nss,(ihpb(k),jhpb(k),k=1,nss)
266 c write (iout,'(8f10.5)') (rprop(j),j=1,nQ)
267 write (iout,'(16i5)') iscor
277 #if (defined(AIX) && !defined(JUBL))
278 call xdrfclose_(ixdrf, iret)
280 call xdrfclose(ixdrf, iret)
282 write (iout,'(i10," trajectories found in file.")') ntraj+1
283 write (iout,'(a)') "Numbers of steps in trajectories:"
284 write (iout,'(8i10)') (nstep(i),i=0,ntraj)
285 write (iout,*) ii," conformations read from file",
286 & nazwa(:ilen(nazwa))
288 write (iout,*) mm(islice)," conformations read so far, slice",
290 write (iout,*) ll(islice),
291 & " conformations stored so far, slice",islice