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'
12 >>>>>>> e183793... Added src_MD-M-newcorr (Adasko's source) and src-NEWSC of WHAM (with Momo's SCSC potentials)
14 parameter (MaxTraj=2050)
15 include 'COMMON.CHAIN'
16 include 'COMMON.INTERACT'
17 include 'COMMON.NAMES'
18 include 'COMMON.IOUNITS'
19 include 'COMMON.HEADER'
20 include 'COMMON.SBRIDGE'
21 include 'COMMON.PROTFILES'
22 include 'COMMON.OBCINKA'
27 character*64 nazwa,bprotfile_temp
28 real*4 rtime,rpotE,ruconst,rt_bath,rprop(maxQ)
30 integer iret,itmp,itraj,ntraj
31 real xoord(3,maxres2+2),prec
32 integer nstep(0:MaxTraj-1)
35 integer ii,jj(maxslice),kk(maxslice),ll(maxslice),mm(maxslice)
36 integer is(MaxSlice),ie(MaxSlice),nrec_slice
37 double precision ts(MaxSlice),te(MaxSlice),time_slice
43 character*256 pdbfilename
45 >>>>>>> e183793... Added src_MD-M-newcorr (Adasko's source) and src-NEWSC of WHAM (with Momo's SCSC potentials)
46 call set_slices(is,ie,ts,te,iR,ib,iparm)
57 #if (defined(AIX) && !defined(JUBL))
58 call xdrfopen_(ixdrf,nazwa, "r", iret)
60 call xdrfopen(ixdrf,nazwa, "r", iret)
62 if (iret.eq.0) return1
65 call opentmp(islice1,ientout,bprotfile_temp)
69 #if (defined(AIX) && !defined(JUBL))
71 write (iout,*) "ii",ii," itraj",itraj," it",it
73 call xdrffloat_(ixdrf, rtime, iret)
74 call xdrffloat_(ixdrf, rpotE, iret)
76 write (iout,*) "rtime",rtime," rpotE",rpotE," iret",iret
79 call xdrffloat_(ixdrf, ruconst, iret)
80 call xdrffloat_(ixdrf, rt_bath, iret)
81 call xdrfint_(ixdrf, nss, iret)
83 write (iout,*) "ruconst",ruconst," rt_bath",rt_bath," nss",nss
86 call xdrfint_(ixdrf, ihpb(j), iret)
87 call xdrfint_(ixdrf, jhpb(j), iret)
89 call xdrfint_(ixdrf, nprop, iret)
90 if (umbrella(iparm) .or. read_iset(iparm) .or. hamil_rep)
91 & call xdrfint(ixdrf, iset, iret)
93 call xdrffloat_(ixdrf, rprop(i), iret)
97 write (iout,*) "ii",ii," itraj",itraj," it",it
99 call xdrffloat(ixdrf, rtime, iret)
100 call xdrffloat(ixdrf, rpotE, iret)
102 write (iout,*) "rtime",rtime," rpotE",rpotE," iret",iret
105 call xdrffloat(ixdrf, ruconst, iret)
106 call xdrffloat(ixdrf, rt_bath, iret)
107 call xdrfint(ixdrf, nss, iret)
109 write (iout,*) "ruconst",ruconst," rt_bath",rt_bath," nss",nss
112 call xdrfint(ixdrf, ihpb(j), iret)
113 call xdrfint(ixdrf, jhpb(j), iret)
115 call xdrfint(ixdrf, nprop, iret)
116 c write (iout,*) "nprop",nprop
117 if (it.gt.0 .and. nprop.ne.nprop_prev) then
118 write (iout,*) "Warning previous nprop",nprop_prev,
125 if (umbrella(iparm) .or. read_iset(iparm) .or. hamil_rep)
126 & call xdrfint(ixdrf, iset, iret)
128 call xdrffloat(ixdrf, rprop(i), iret)
132 itraj=mod(it,totraj(iR,iparm))
133 if (iset.eq.0) iset = 1
136 if (itraj.gt.ntraj) ntraj=itraj
137 nstep(itraj)=nstep(itraj)+1
138 c rprop(2)=dsqrt(rprop(2))
139 c rprop(3)=dsqrt(rprop(3))
141 write (iout,*) "umbrella ",umbrella
142 write (iout,*) rtime,rpotE,rt_bath,nss,
143 & (ihpb(j),jhpb(j),j=1,nss),(rprop(j),j=1,nprop)
144 write (iout,*) "nprop",nprop," iset",iset," myparm",myparm
150 #if (defined(AIX) && !defined(JUBL))
151 call xdrf3dfcoord_(ixdrf, xoord, itmp, prec, iret)
153 call xdrf3dfcoord(ixdrf, xoord, itmp, prec, iret)
156 write (iout,'(10f8.3)') ((xoord(j,i),j=1,3),i=1,itmp)
159 if (itmp .ne. nres + nct - nnt + 1) then
160 write (iout,*) "Error: inconsistent sizes",itmp,nres+nct-nnt+1
166 c write (iout,*) "calling slice"
168 islice=slice(nstep(itraj),time,is,ie,ts,te)
169 c write (iout,*) "islice",islice
179 c(j,i+nres+nnt-1)=xoord(j,i+nres)
183 if (islice.gt.0 .and. islice.le.nslice .and. (.not.separate_parset
184 & .or. iset.eq.myparm)) then
186 kk(islice)=kk(islice)+1
187 mm(islice)=mm(islice)+1
188 if (mod(nstep(itraj),isampl(iparm)).eq.0 .and.
189 & conf_check(ll(islice)+1,1)) then
190 if (replica(iparm)) then
191 rt_bath=1.0d0/(rt_bath*1.987D-3)
193 if (abs(real(beta_h(i,iparm))-rt_bath).lt.1.0e-4) then
199 if (i.gt.nT_h(iparm)) then
200 write (iout,*) "Error - temperature of conformation",
201 & ii,1.0d0/(rt_bath*1.987D-3),
202 & " does not match any of the list"
204 & 1.0d0/(rt_bath*1.987D-3),
205 & (1.0d0/(beta_h(i,iparm)*1.987D-3),i=1,nT_h(iparm))
208 c call MPI_Abort(MPI_COMM_WORLD,IERROR,ERRCODE)
210 kk(islice)=kk(islice)-1
211 mm(islice)=mm(islice)-1
219 jj(islice)=jj(islice)+1
220 if (umbrella(iparm)) then
221 snk(iset,iib,iparm,islice)=snk(iset,iib,iparm,islice)+1
222 else if (hamil_rep) then
223 snk(1,iib,iparm,islice)=snk(1,iib,iparm,islice)+1
225 snk(iR,iib,iparm,islice)=snk(iR,iib,iparm,islice)+1
227 ll(islice)=ll(islice)+1
229 write (iout,*) "Writing conformation, record",ll(islice)
230 write (iout,*) "ib",ib," iib",iib
231 write (iout,*) "ntraj",ntraj," itraj",itraj,
232 & " nstep",nstep(itraj)
233 write (iout,*) "pote",rpotE," time",rtime
234 c if (replica(iparm)) then
235 c write (iout,*) "TEMP",1.0d0/(rt_bath*1.987D-3)
236 c write (iout,*) "TEMP list"
238 c & (1.0d0/(beta_h(i,iparm)*1.987D-3),i=1,nT_h(iparm))
240 write (iout,*) "iparm",iparm," ib",ib," iR",iR," nQ",nQ
241 c write (iout,*) "nres",nres," nnt",nnt," nct",nct," nss",nss
242 c write (iout,*) "length",nres*4+(nct-nnt+1)*4+4+2*nss*4
245 if (islice.ne.islice1) then
246 c write (iout,*) "islice",islice," islice1",islice1
248 c write (iout,*) "Closing file ",
249 c & bprotfile_temp(:ilen(bprotfile_temp))
250 call opentmp(islice,ientout,bprotfile_temp)
251 c write (iout,*) "Opening file ",
252 c & bprotfile_temp(:ilen(bprotfile_temp))
255 if (umbrella(iparm)) then
256 write(ientout,rec=ll(islice))
257 & ((xoord(l,k),l=1,3),k=1,nres),
258 & ((xoord(l,k),l=1,3),k=nres+1,nres+nct-nnt+1),
259 & nss,(ihpb(k),jhpb(k),k=1,nss),
260 & rpotE+0.0d0,efree,rmsdev,(rprop(i)+0.0d0,i=1,nQ),
262 else if (hamil_rep) then
263 write(ientout,rec=ll(islice))
264 & ((xoord(l,k),l=1,3),k=1,nres),
265 & ((xoord(l,k),l=1,3),k=nres+1,nres+nct-nnt+1),
266 & nss,(ihpb(k),jhpb(k),k=1,nss),
267 & rpotE+0.0d0,efree,rmsdev,(rprop(i)+0.0d0,i=1,nQ),
270 write(ientout,rec=ll(islice))
271 & ((xoord(l,k),l=1,3),k=1,nres),
272 & ((xoord(l,k),l=1,3),k=nres+1,nres+nct-nnt+1),
273 & nss,(ihpb(k),jhpb(k),k=1,nss),
274 & rpotE+0.0d0,efree,rmsdev,(rprop(i)+0.0d0,i=1,nQ),
281 if (me.eq.Master) then
283 write (iout,*) "PDBOUT"
284 write (iout,*) "temperature",1.0d0/(rt_bath*1.987D-3)
286 write (lt_bath,'(f4.0)') 1.0d0/(rt_bath*1.987D-3)
287 write (iout,*) "lt_bath ",lt_bath
288 pdbfilename=prefix(:ilen(prefix))//"_"//lt_bath//"pdb"
289 write (iout,*) "pdb ",pdbfilename
291 open(ipdb,file=pdbfilename,position="append")
292 c write (tytul,'("Conformation",i10," T=",f5.1)')
293 c & kk(islice),rt_bath
294 call pdbout(kk(islice),1.0d0/(rt_bath*1.987D-3),
295 & efree+0.0d0,rpotE+0.0d0,efree+0.0d0,rmsdev+0.0d0)
301 >>>>>>> e183793... Added src_MD-M-newcorr (Adasko's source) and src-NEWSC of WHAM (with Momo's SCSC potentials)
303 call int_from_cart1(.false.)
304 write (iout,*) "Writing conformation, record",ll(islice)
305 write (iout,*) "Cartesian coordinates"
306 write (iout,'(8f10.5)') ((c(j,i),j=1,3),i=1,nres)
307 write (iout,'(8f10.5)') ((c(j,i+nres),j=1,3),i=nnt,nct)
308 write (iout,*) "Internal coordinates"
309 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
310 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
311 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
312 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
313 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
314 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
315 write (iout,'(16i5)') nss,(ihpb(k),jhpb(k),k=1,nss)
316 c write (iout,'(8f10.5)') (rprop(j),j=1,nQ)
317 write (iout,'(16i5)') iscor
327 #if (defined(AIX) && !defined(JUBL))
328 call xdrfclose_(ixdrf, iret)
330 call xdrfclose(ixdrf, iret)
332 write (iout,'(i10," trajectories found in file.")') ntraj+1
333 write (iout,'(a)') "Numbers of steps in trajectories:"
334 write (iout,'(8i10)') (nstep(i),i=0,ntraj)
335 write (iout,*) ii," conformations read from file",
336 & nazwa(:ilen(nazwa))
338 write (iout,*) mm(islice)," conformations read so far, slice",
340 write (iout,*) ll(islice),
341 & " conformations stored so far, slice",islice