Fixed the following components:
[unres.git] / source / wham / src / enecalc1.F
index 5ef4d77..dcf6a97 100644 (file)
@@ -47,6 +47,7 @@
       integer snk_p(MaxR,MaxT_h,Max_parm)
       logical lerr
       character*64 bprotfile_temp
+      integer scount_t(0:maxprocs-1)
       call opentmp(islice,ientout,bprotfile_temp)
       iii=0
       ii=0
@@ -203,20 +204,21 @@ c        call pdbout(ii+1,beta_h(ib,ipar),efree,energia(0),0.0d0,rmsdev)
      &         " the value read in: ",energia(0),eini," point",
      &         iii+1,indstart(me1)+iii," T",
      &         1.0d0/(1.987D-3*beta_h(ib,ipar))
+#ifdef DEBUG
              call enerprint(energia(0),fT)
-            write (iout,'(4f10.5,2i5)') 0.0,energia(0),0.0,
+             write (iout,'(4f10.5,2i5)') 0.0,energia(0),0.0,
      &       1.0d0/(beta_h(ib,ipar)*1.987D-3),
      &       0,0
-            write(iout,'(8f10.5)')
+             write(iout,'(8f10.5)')
      &       ((c(l,k),l=1,3),k=1,nres),
      &       ((c(l,k+nres),l=1,3),k=nnt,nct)
-c             itmp=ipdb
-c             ipdb=iout
-c             call pdbout(iii+1,beta_h(ib,ipar),
-c     &                   eini,energia(0),0.0d0,rmsdev)
+             itmp=ipdb
+             ipdb=iout
+             call pdbout(iii+1,beta_h(ib,ipar),
+     &                   eini,energia(0),0.0d0,rmsdev)
              write (iout,*)
              ipdb=itmp
-
+#endif
               errmsg_count=errmsg_count+1
               if (errmsg_count.gt.maxerrmsg_count) 
      &          write (iout,*) "Too many warning messages"
@@ -291,8 +293,11 @@ c     &   " snk",snk_p(iR,ib,ipar)
       call flush(iout)
 c  Master gathers updated numbers of conformations written by all procs.
       scme = scount(me)
-      call MPI_AllGather( scount(me), 1, MPI_INTEGER, scount(0), 1, 
+      call MPI_AllGather( scount(me), 1, MPI_INTEGER, scount_t(0), 1, 
      &  MPI_INTEGER, WHAM_COMM, IERROR)
+      do k=0,nprocs-1
+        scount(k) = scount_t(k)
+      enddo
       indstart(0)=1
       indend(0)=scount(0)
       do i=1, Nprocs-1