MULTCONF for cx files
[unres.git] / source / unres / src_MD / unres.F
index b14c040..f5fd355 100644 (file)
@@ -407,7 +407,16 @@ c---------------------------------------------------------------------------
       endif
 
       close (intin)
-      open(intin,file=intinname,status='old')
+      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
@@ -422,21 +431,15 @@ c---------------------------------------------------------------------------
       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))
@@ -467,14 +470,9 @@ 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)
@@ -539,14 +537,9 @@ c          if (minim) call briefout(it,etot)
 
           imm=imm-1
           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)
@@ -639,11 +632,6 @@ c Broadcast the order to compute internal coordinates to the slaves.
           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.)
           else
             read (intin,'(i5)',end=1100,err=1100) iconf