wham with mpich2 (no aliasing) and new dimenstions
[unres.git] / source / cluster / wham / src / main_clust.F
index 4b6478a..810dcae 100644 (file)
@@ -36,6 +36,7 @@ C
       integer i,j,k,l,m,n,len,lev,idum,ii,ind,ioffset,jj,icut,ncon,
      & it,ncon_work,ind1,ilen
       double precision t1,t2,tcpu,difconf
+      real diss_(maxdist)
       
       double precision varia(maxvar)
       double precision hrtime,mintime,sectime
@@ -59,9 +60,9 @@ C
         stop
       endif
 #endif
-
       call initialize
       call openunits
+      call cinfo
       call parmread
       call read_control
       call molread
@@ -146,7 +147,11 @@ C
           if (ind.ge.indstart(me) .and. ind.le.indend(me)) then
 #endif
           ind1=ind1+1
+#ifdef MPI
+          DISS_(IND1)=DIFCONF(I,J)
+#else
           DISS(IND1)=DIFCONF(I,J)
+#endif
 c          write (iout,'(2i4,i10,f10.5)') i,j,ind,DISS(IND)
 #ifdef MPI
           endif
@@ -160,7 +165,7 @@ c          write (iout,'(2i4,i10,f10.5)') i,j,ind,DISS(IND)
       PRINT '(a)','End of distance computation'
 
 #ifdef MPI
-      call MPI_Gatherv(diss(1),scount(me),MPI_REAL,diss(1),
+      call MPI_Gatherv(diss_(1),scount(me),MPI_REAL,diss(1),
      &     scount(0),idispl(0),MPI_REAL,Master,MPI_COMM_WORLD, IERROR)
       if (me.eq.master) then
 #endif
@@ -227,7 +232,11 @@ C
         write (iout,'(2i5,f10.5)') i,list_conf(i),totfree(i)
       enddo
 #endif
+#ifdef AIX
+      call flush_(iout)
+#else
       call flush(iout)
+#endif
       CALL HC(N,M,LEN,IOPT,IA,IB,CRIT,MEMBR,NN,DISNN,FLAG,DISS)
       LEV = N-1
       write (iout,*) "n",n," ncon_work",ncon_work," lev",lev