Merge branch 'lipid' of mmka.chem.univ.gda.pl:unres into lipid
[unres.git] / source / cluster / wham / src-M / probabl.F
index 293fb8f..0c45402 100644 (file)
       character*80 bxname
       character*2 licz1
       character*5 ctemper
-      integer ilen
+      integer ilen,ijk
       external ilen
-      real*4 Fdimless(maxconf)
-      double precision energia(0:max_ene)
+      real*4 Fdimless(maxconf), Fdimless_buf(maxconf)
+      double precision energia(0:max_ene), totfree_buf(0:maxconf),
+     &  entfac_buf(maxconf)
       do i=1,ncon
         list_conf(i)=i
       enddo
@@ -134,6 +135,7 @@ c        call flush(iout)
           call int_from_cart1(.false.)
           call etotal(energia(0),fT)
           totfree(i)=energia(0)         
+          totfree_buf(i)=totfree(i)
 c          write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
 c          write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
 c          call enerprint(energia(0),fT)
@@ -208,27 +210,49 @@ c#endif
         write (iout,*) "ebe" ebe,wang
 #endif        
         Fdimless(i)=beta_h(ib)*etot+entfac(ii)
+        Fdimless_buf(i)=Fdimless(i)
         totfree(i)=etot
+        totfree_buf(i)=totfree(i)
 #ifdef DEBUG
         write (iout,*) "fdim calc", i,ii,ib,
      &   1.0d0/(1.987d-3*beta_h(ib)),totfree(i),
      &   entfac(ii),Fdimless(i)
 #endif
       enddo   ! i
+
+      do ijk=1,maxconf
+      entfac_buf(ijk)=entfac(ijk)
+      Fdimless_buf(ijk)=Fdimless(ijk)
+      enddo
+      do ijk=0,maxconf
+      totfree_buf(ijk)=totfree(ijk)
+      enddo
+
+
+c      scount_buf=scount(me)
+c      scount_buf2=scount(0)
+
+c      entfac_buf(indstart(me)+1)=entfac(indstart(me)+1)
+
 #ifdef MPI
-      call MPI_Gatherv(Fdimless(1),scount(me),
+      WRITE (iout,*) "Wchodze do call MPI_Gatherv1 (Propabl)"
+      call MPI_Gatherv(Fdimless_buf(1),scount(me),
      & MPI_REAL,Fdimless(1),
      & scount(0),idispl(0),MPI_REAL,Master,
      & MPI_COMM_WORLD, IERROR)
-      call MPI_Gatherv(totfree(1),scount(me),
+      WRITE (iout,*) "Wchodze do call MPI_Gatherv2 (Propabl)"
+      call MPI_Gatherv(totfree_buf(1),scount(me),
      & MPI_DOUBLE_PRECISION,totfree(1),
      & scount(0),idispl(0),MPI_DOUBLE_PRECISION,Master,
      & MPI_COMM_WORLD, IERROR)
-      call MPI_Gatherv(entfac(indstart(me)+1),scount(me),
+      WRITE (iout,*) "Wchodze do call MPI_Gatherv3 (Propabl)"
+      call MPI_Gatherv(entfac_buf(indstart(me)+1),scount(me),
      & MPI_DOUBLE_PRECISION,entfac(1),
      & scount(0),idispl(0),MPI_DOUBLE_PRECISION,Master,
      & MPI_COMM_WORLD, IERROR)
+      WRITE (iout,*) "Wychodze z call MPI_Gatherv (Propabl)"
       if (me.eq.Master) then
+      WRITE (iout,*) "me.eq.Master"
 #endif
 #ifdef DEBUG
         write (iout,*) "The FDIMLESS array before sorting"
@@ -236,13 +260,16 @@ c#endif
 c          write (iout,*) i,fdimless(i)
         enddo
 #endif
+      WRITE (iout,*) "Wchodze do call mysort1"
         call mysort1(ncon,Fdimless,list_conf)
-#ifdef DEBUG
+      WRITE (iout,*) "Wychodze z call mysort1"
+C#ifdef DEBUG
         write (iout,*) "The FDIMLESS array after sorting"
         do i=1,ncon
           write (iout,*) i,list_conf(i),fdimless(i)
         enddo
-#endif
+c#endif
+      WRITE (iout,*) "Wchodze do petli i=1,ncon totfree(i)=fdimless(i)"
         do i=1,ncon
           totfree(i)=fdimless(i)
         enddo