X-Git-Url: http://mmka.chem.univ.gda.pl/gitweb/?a=blobdiff_plain;f=source%2Funres%2Fsrc_MD%2Funres.F;h=7595fe76b589d46555b6925fb447229f9bcc8cfd;hb=fd4cb639b929622c8c53a9e613825ad8b4e18b2b;hp=053eec6ee1dacbd2eeffa4142d752ce3fb9a5c6f;hpb=e11674c0a2345839beaea75df0a4c17f517e16c7;p=unres.git diff --git a/source/unres/src_MD/unres.F b/source/unres/src_MD/unres.F index 053eec6..7595fe7 100644 --- a/source/unres/src_MD/unres.F +++ b/source/unres/src_MD/unres.F @@ -397,7 +397,7 @@ c--------------------------------------------------------------------------- include 'COMMON.SBRIDGE' double precision varia(maxvar) dimension ind(6) - double precision energy(0:max_ene) + double precision energy(0:n_ene) logical eof eof=.false. #ifdef MPI @@ -407,48 +407,51 @@ c--------------------------------------------------------------------------- endif close (intin) - open(intin,file=intinname,status='old') - write (istat,'(a5,20a12)')"# ", + if (read_cart) then + iconf=0 +#ifdef AIX + call xdrfopen_(ixdrf,intinname, "r", iret) +#else + call xdrfopen(ixdrf,intinname, "r", iret) +#endif + else + open(intin,file=intinname,status='old') + endif + write (istat,'(a5,30a12)')"# ", & (wname(print_order(i)),i=1,nprint_ene) if (refstr) then - write (istat,'(a5,20a12)')"# ", + write (istat,'(a5,30a12)')"# ", & (ename(print_order(i)),i=1,nprint_ene), - & "ETOT total","RMSD","nat.contact","nnt.contact" + & "ETOT total","RMSD","nat.contact","nnt.contact","cont.order" else - write (istat,'(a5,20a12)')"# ", + write (istat,'(a5,30a12)')"# ", & (ename(print_order(i)),i=1,nprint_ene),"ETOT total" endif if (.not.minim) then do while (.not. eof) if (read_cart) then - read (intin,'(e15.10,e15.5)',end=1100,err=1100) time,ene - call read_x(intin,*11) -#ifdef MPI -c Broadcast the order to compute internal coordinates to the slaves. - if (nfgtasks.gt.1) - & call MPI_Bcast(6,1,MPI_INTEGER,king,FG_COMM,IERROR) -#endif - call int_from_cart1(.false.) + call read_cx(ixdrf,*1100) + iconf=iconf+1 else read (intin,'(i5)',end=1100,err=1100) iconf call read_angles(intin,*11) call geom_to_var(nvar,varia) call chainbuild endif - write (iout,'(a,i7)') 'Conformation #',iconf + write (iout,'(/a,i7)') 'Conformation #',iconf call etotal(energy(0)) call briefout(iconf,energy(0)) call enerprint(energy(0)) etot=energy(0) if (refstr) then call rms_nac_nnc(rms,frac,frac_nn,co,.true.) - write (istat,'(i5,20(f12.3))') iconf, + write (istat,'(i5,30(f12.3))') iconf, & (energy(print_order(i)),i=1,nprint_ene),etot, & rms,frac,frac_nn,co cjlee end else - write (istat,'(i5,16(f12.3))') iconf, + write (istat,'(i5,30(f12.3))') iconf, & (energy(print_order(i)),i=1,nprint_ene),etot endif enddo @@ -467,22 +470,18 @@ c do n=1,nzsc mm=mm+1 if (mm.lt.nodes) then if (read_cart) then - read (intin,'(e15.10,e15.5)',end=11,err=11) time,ene - call read_x(intin,*11) -#ifdef MPI -c Broadcast the order to compute internal coordinates to the slaves. - if (nfgtasks.gt.1) - & call MPI_Bcast(6,1,MPI_INTEGER,king,FG_COMM,IERROR) -#endif - call int_from_cart1(.false.) + call read_cx(ixdrf,*11) + iconf=iconf+1 + call geom_to_var(nvar,varia) else read (intin,'(i5)',end=11,err=11) iconf call read_angles(intin,*11) call geom_to_var(nvar,varia) call chainbuild endif - write (iout,'(a,i7)') 'Conformation #',iconf + n=n+1 + write (iout,*) 'Conformation #',iconf,' read' imm=imm+1 ind(1)=1 ind(2)=n @@ -519,7 +518,8 @@ c print *,'result received from worker ',man,' sending now' iconf=ind(2) write (iout,*) write (iout,*) - write (iout,'(a,2i7)') 'Conformation #',iconf,ind(5) + write (iout,*) 'Conformation #',iconf," sumsl return code ", + & ind(5) etot=energy(0) call enerprint(energy(0)) @@ -527,31 +527,27 @@ c print *,'result received from worker ',man,' sending now' c if (minim) call briefout(it,etot) if (refstr) then call rms_nac_nnc(rms,frac,frac_nn,co,.true.) - write (istat,'(i5,19(f12.3))') iconf, + write (istat,'(i5,30(f12.3))') iconf, & (energy(print_order(i)),i=1,nprint_ene),etot, & rms,frac,frac_nn,co else - write (istat,'(i5,15(f12.3))') iconf, + write (istat,'(i5,30(f12.3))') iconf, & (energy(print_order(i)),i=1,nprint_ene),etot endif imm=imm-1 if (read_cart) then - read (intin,'(e15.10,e15.5)',end=1101,err=1101) time,ene - call read_x(intin,*11) -#ifdef MPI -c Broadcast the order to compute internal coordinates to the slaves. - if (nfgtasks.gt.1) - & call MPI_Bcast(6,1,MPI_INTEGER,king,FG_COMM,IERROR) -#endif - call int_from_cart1(.false.) + call read_cx(ixdrf,*11) + iconf=iconf+1 + call geom_to_var(nvar,varia) else - read (intin,'(i5)',end=1101,err=1101) iconf + read (intin,'(i5)',end=11,err=11) iconf call read_angles(intin,*11) call geom_to_var(nvar,varia) call chainbuild endif n=n+1 + write (iout,*) 'Conformation #',iconf,' read' imm=imm+1 ind(1)=1 ind(2)=n @@ -589,18 +585,19 @@ c Broadcast the order to compute internal coordinates to the slaves. iconf=ind(2) write (iout,*) write (iout,*) - write (iout,'(a,2i7)') 'Conformation #',iconf,ind(5) + write (iout,*) 'Conformation #',iconf," sumsl return code ", + & ind(5) etot=energy(0) call enerprint(energy(0)) call briefout(it,etot) if (refstr) then call rms_nac_nnc(rms,frac,frac_nn,co,.true.) - write (istat,'(i5,19(f12.3))') iconf, + write (istat,'(i5,30(f12.3))') iconf, & (energy(print_order(i)),i=1,nprint_ene),etot, & rms,frac,frac_nn,co else - write (istat,'(i5,15(f12.3))') iconf, + write (istat,'(i5,30(f12.3))') iconf, & (energy(print_order(i)),i=1,nprint_ene),etot endif nmin=nmin+1 @@ -616,38 +613,44 @@ c Broadcast the order to compute internal coordinates to the slaves. call mpi_send(ind,6,mpi_integer,i,idint,CG_COMM, * ierr) enddo +c ----------------------------------------------------------- +c serial version #else close (intin) - open(intin,file=intinname,status='old') - write (istat,'(a5,20a12)')"# ", + if (read_cart) then + iconf=0 +#ifdef AIX + call xdrfopen_(ixdrf,intinname, "r", iret) +#else + call xdrfopen(ixdrf,intinname, "r", iret) +#endif + else + open(intin,file=intinname,status='old') + endif + write (istat,'(a5,30a12)')"# ", & (wname(print_order(i)),i=1,nprint_ene) write (istat,'("# ",20(1pe12.4))') & (weights(print_order(i)),i=1,nprint_ene) if (refstr) then - write (istat,'(a5,20a12)')"# ", + write (istat,'(a5,30a12)')"# ", & (ename(print_order(i)),i=1,nprint_ene), & "ETOT total","RMSD","nat.contact","nnt.contact" else - write (istat,'(a5,14a12)')"# ", + write (istat,'(a5,30a12)')"# ", & (ename(print_order(i)),i=1,nprint_ene),"ETOT total" endif do while (.not. eof) if (read_cart) then - read (intin,'(e15.10,e15.5)',end=1100,err=1100) time,ene - call read_x(intin,*11) -#ifdef MPI -c Broadcast the order to compute internal coordinates to the slaves. - if (nfgtasks.gt.1) - & call MPI_Bcast(6,1,MPI_INTEGER,king,FG_COMM,IERROR) -#endif - call int_from_cart1(.false.) + call read_cx(ixdrf,*1100) + iconf=iconf+1 + call geom_to_var(nvar,varia) else read (intin,'(i5)',end=1100,err=1100) iconf call read_angles(intin,*11) call geom_to_var(nvar,varia) call chainbuild endif - write (iout,'(a,i7)') 'Conformation #',iconf + write (iout,'(/a,i7)') 'Conformation #',iconf if (minim) call minimize(etot,varia,iretcode,nfun) call etotal(energy(0)) @@ -656,12 +659,12 @@ c Broadcast the order to compute internal coordinates to the slaves. if (minim) call briefout(it,etot) if (refstr) then call rms_nac_nnc(rms,frac,frac_nn,co,.true.) - write (istat,'(i5,18(f12.3))') iconf, + write (istat,'(i5,30(f12.3))') iconf, & (energy(print_order(i)),i=1,nprint_ene), & etot,rms,frac,frac_nn,co cjlee end else - write (istat,'(i5,14(f12.3))') iconf, + write (istat,'(i5,30(f12.3))') iconf, & (energy(print_order(i)),i=1,nprint_ene),etot endif enddo