1 implicit real*8 (a-h,o-z)
5 include 'COMMON.IOUNITS'
9 include 'COMMON.SBRIDGE'
10 include 'COMMON.INTERACT'
12 & (maxprocs/4,maxprocs/20,maxprocs/200,maxprocs/200)
13 character*128 restin,restout
20 print'(2a)',"Usage: restbin 0/1 NTRAJ NRES INRESTFILE",
21 & " OUTRESTFILE [REMD_M] [USAMPL]"
22 print'(a)',"0 - conversion from bin to ascii / from ascii to bin"
23 print'(a)',"NTRAJ: number of trajectories"
24 print'(a)',"NRES: number of residues"
25 print'(a)',"INRESTFILE: input UNRES/MREMD restart file"
26 print'(a)',"OUTRESTFILE: output UNRES/MREMD restart file"
27 print'(a)',"USAMPL [T/F] flag for umbrella-sampling"
32 if (idir. ne. 0 .and. idir.ne.1) stop "idir must be 0 or 1"
37 call getarg (4,restin)
38 call getarg (5,restout)
39 print *,"idir",idir," nodes",nodes," nres",nres
40 print *,"restin ",restin
41 print *,"restout ",restout
44 read(liczba,*) remd_m(1)
55 read(liczba,'(L1)') usampl
57 print *,"usampl",usampl
58 print *,"remd_m",(remd_m(i),i=1,nodes)
61 call read1restart(i_index)
62 mremd_rst_name=restout
63 call write1rst_asc(i_index)
66 call read1restart_asc(i_index)
67 mremd_rst_name=restout
68 call write1rst(i_index)
71 c------------------------------------------------------------------------------
72 subroutine read1restart(i_index)
73 implicit real*8 (a-h,o-z)
77 include 'COMMON.IOUNITS'
79 include 'COMMON.SETUP'
80 include 'COMMON.CHAIN'
81 include 'COMMON.SBRIDGE'
82 include 'COMMON.INTERACT'
83 real d_restart1(3,2*maxres*maxprocs),r_d(3,2*maxres),
84 & d_restart2(3,2*maxres*maxprocs),t5_restart1(5)
86 & (maxprocs/4,maxprocs/20,maxprocs/200,maxprocs/200)
87 common /przechowalnia/ d_restart1,d_restart2
88 write (*,*) "Processor",me," called read1restart"
91 call xdrfopen_(ixdrf,mremd_rst_name, "r", iret)
92 print *,"restart file ",mremd_rst_name
96 call xdrfint_(ixdrf, i2rep(i), iret)
100 call xdrfint_(ixdrf, ifirst(i), iret)
103 call xdrfint_(ixdrf, nupa(0,il), iret)
104 print *,"nupa(0,",il,")=",nupa(0,il)
106 call xdrfint_(ixdrf, nupa(i,il), iret)
108 print *,"nupa",(nupa(i,il),i=1,nupa(0,il))
110 call xdrfint_(ixdrf, ndowna(0,il), iret)
111 print *,"ndowna(0",il,")=",ndowna(0,il)
113 call xdrfint_(ixdrf, ndowna(i,il), iret)
115 print *,"ndowna",(ndowna(i,il),i=1,ndowna(0,il))
119 call xdrffloat_(ixdrf, t_restart1(j,il), iret)
121 print *,"il",il,"t_restart",(t_restart1(j,il),j=1,4)
124 call xdrfopen(ixdrf,mremd_rst_name, "r", iret)
127 call xdrfint(ixdrf, i2rep(i), iret)
130 call xdrfint(ixdrf, ifirst(i), iret)
133 call xdrfint(ixdrf, nupa(0,il), iret)
135 call xdrfint(ixdrf, nupa(i,il), iret)
138 call xdrfint(ixdrf, ndowna(0,il), iret)
140 call xdrfint(ixdrf, ndowna(i,il), iret)
145 call xdrffloat(ixdrf, t_restart1(j,il), iret)
152 t_bath=t5_restart1(4)
158 call xdrffloat_(ixdrf, d_restart1(j,i+2*nres*il), iret)
160 call xdrffloat(ixdrf, d_restart1(j,i+2*nres*il), iret)
170 call xdrffloat_(ixdrf, d_restart2(j,i+2*nres*il), iret)
172 call xdrffloat(ixdrf, d_restart2(j,i+2*nres*il), iret)
180 call xdrfint_(ixdrf, nset, iret)
182 call xdrfint_(ixdrf,mset(i), iret)
185 call xdrfint_(ixdrf,i2set(i), iret)
191 call xdrfint_(ixdrf,itmp, iret)
192 i_index(i,j,il,il1)=itmp
198 call xdrfint(ixdrf, nset, iret)
200 call xdrfint(ixdrf,mset(i), iret)
203 call xdrfint(ixdrf,i2set(i), iret)
209 call xdrfint(ixdrf,itmp, iret)
210 i_index(i,j,il,il1)=itmp
216 c call mpi_scatter(i2set,1,mpi_integer,
217 c & iset,1,mpi_integer,king,
222 call xdrfclose_(ixdrf, iret)
224 call xdrfclose(ixdrf, iret)
228 c------------------------------------------------------------------------------------
229 subroutine write1rst(i_index)
230 implicit real*8 (a-h,o-z)
234 include 'COMMON.IOUNITS'
235 include 'COMMON.REMD'
236 include 'COMMON.SETUP'
237 include 'COMMON.CHAIN'
238 include 'COMMON.SBRIDGE'
239 include 'COMMON.INTERACT'
241 real d_restart1(3,2*maxres*maxprocs),r_d(3,2*maxres),
242 & d_restart2(3,2*maxres*maxprocs)
246 & (maxprocs/4,maxprocs/20,maxprocs/200,maxprocs/200)
247 common /przechowalnia/ d_restart1,d_restart2
250 call xdrfopen_(ixdrf,mremd_rst_name, "w", iret)
252 call xdrfint_(ixdrf, i2rep(i), iret)
255 call xdrfint_(ixdrf, ifirst(i), iret)
259 call xdrfint_(ixdrf, nupa(i,il), iret)
263 call xdrfint_(ixdrf, ndowna(i,il), iret)
269 call xdrffloat_(ixdrf, t_restart1(j,il), iret)
276 call xdrffloat_(ixdrf, d_restart1(j,i+2*nres*il), iret)
283 call xdrffloat_(ixdrf, d_restart2(j,i+2*nres*il), iret)
289 call xdrfint_(ixdrf, nset, iret)
291 call xdrfint_(ixdrf,mset(i), iret)
294 call xdrfint_(ixdrf,i2set(i), iret)
300 itmp=i_index(i,j,il,il1)
301 call xdrfint_(ixdrf,itmp, iret)
308 call xdrfclose_(ixdrf, iret)
310 call xdrfopen(ixdrf,mremd_rst_name, "w", iret)
312 call xdrfint(ixdrf, i2rep(i), iret)
315 call xdrfint(ixdrf, ifirst(i), iret)
319 call xdrfint(ixdrf, nupa(i,il), iret)
323 call xdrfint(ixdrf, ndowna(i,il), iret)
329 call xdrffloat(ixdrf, t_restart1(j,il), iret)
336 call xdrffloat(ixdrf, d_restart1(j,i+2*nres*il), iret)
343 call xdrffloat(ixdrf, d_restart2(j,i+2*nres*il), iret)
350 call xdrfint(ixdrf, nset, iret)
352 call xdrfint(ixdrf,mset(i), iret)
355 call xdrfint(ixdrf,i2set(i), iret)
361 itmp=i_index(i,j,il,il1)
362 call xdrfint(ixdrf,itmp, iret)
369 call xdrfclose(ixdrf, iret)
373 c----------------------------------------------------------------------------
374 subroutine read1restart_asc(i_index)
375 implicit real*8 (a-h,o-z)
378 include 'COMMON.IOUNITS'
379 include 'COMMON.REMD'
380 include 'COMMON.SETUP'
381 include 'COMMON.CHAIN'
382 include 'COMMON.SBRIDGE'
383 include 'COMMON.INTERACT'
385 real d_restart1(3,2*maxres*maxprocs),r_d(3,2*maxres),
386 & d_restart2(3,2*maxres*maxprocs)
390 & (maxprocs/4,maxprocs/20,maxprocs/200,maxprocs/200)
391 common /przechowalnia/ d_restart1,d_restart2
393 open(irest2,file=mremd_rst_name,status="old")
394 read (irest2,*) (i2rep(i),i=0,nodes-1)
395 read (irest2,*) (ifirst(i),i=1,remd_m(1))
397 read (irest2,*) nupa(0,il),(nupa(i,il),i=1,nupa(0,il))
398 read (irest2,*) ndowna(0,il),(ndowna(i,il),i=1,ndowna(0,il))
401 read (irest2,*) (t_restart1(j,il),j=1,4)
405 read (irest2,*) (d_restart1(j,i+2*nres*il),j=1,3)
410 read (irest2,*) (d_restart2(j,i+2*nres*il),j=1,3)
416 read (irest2,*) (mset(i),i=1,nset)
417 read (irest2,*) (i2set(i),i=1,nodes-1)
421 read (irest2,*) (i_index(i,j,il,il1),j=1,remd_m(i))
428 c---------------------------------------------------------------------------
429 subroutine write1rst_asc(i_index)
430 implicit real*8 (a-h,o-z)
433 include 'COMMON.IOUNITS'
434 include 'COMMON.REMD'
435 include 'COMMON.SETUP'
436 include 'COMMON.CHAIN'
437 include 'COMMON.SBRIDGE'
438 include 'COMMON.INTERACT'
440 real d_restart1(3,2*maxres*maxprocs),r_d(3,2*maxres),
441 & d_restart2(3,2*maxres*maxprocs)
445 & (maxprocs/4,maxprocs/20,maxprocs/200,maxprocs/200)
446 common /przechowalnia/ d_restart1,d_restart2
448 open(irest2,file=mremd_rst_name,status="unknown")
449 write (irest2,*) (i2rep(i),i=0,nodes-1)
450 write (irest2,*) (ifirst(i),i=1,remd_m(1))
452 write (irest2,*) nupa(0,il),(nupa(i,il),i=1,nupa(0,il))
453 write (irest2,*) ndowna(0,il),(ndowna(i,il),i=1,ndowna(0,il))
456 write (irest2,*) (t_restart1(j,il),j=1,4)
460 write (irest2,*) (d_restart1(j,i+2*nres*il),j=1,3)
465 write (irest2,*) (d_restart2(j,i+2*nres*il),j=1,3)
470 write (irest2,*) nset
471 write (irest2,*) (mset(i),i=1,nset)
472 write (irest2,*) (i2set(i),i=1,nodes-1)
476 write (irest2,*) (i_index(i,j,il,il1),j=1,remd_m(i))