correction for large entropy differences
authorAdam Sieradzan <adasko@piasek4.chem.univ.gda.pl>
Thu, 6 Apr 2017 17:00:06 +0000 (19:00 +0200)
committerAdam Sieradzan <adasko@piasek4.chem.univ.gda.pl>
Thu, 6 Apr 2017 17:00:06 +0000 (19:00 +0200)
source/wham/src-M/wham_calc1.F

index 5f31879..6372100 100644 (file)
@@ -851,8 +851,13 @@ c        ent=-dlog(entfac(t))
      &  WHAM_COMM,IERROR)
       call MPI_Allreduce(entmax_p,entmax,1,MPI_DOUBLE_PRECISION,MPI_MAX,
      &  WHAM_COMM,IERROR)
-      ientmax=entmax-entmin 
-      if (ientmax.gt.2000) ientmax=2000
+C      ientmax=entmax-entmin 
+C      if (ientmax.gt.2000) ientmax=2000
+      if ((-dlog(entmax)-entmin).lt.2000.0d0) then
+      ientmax=-dlog(entmax)-entmin
+      else
+       ientmax=2000
+      endif
       write (iout,*) "entmin",entmin," entmax",entmax," ientmax",ientmax
       call flush(iout)
       do t=1,scount(me1)
@@ -876,8 +881,11 @@ c        ient=-dlog(entfac(t))-entmin
         if (ent.lt.entmin) entmin=ent
         if (ent.gt.entmax) entmax=ent
       enddo
+      if ((-dlog(entmax)-entmin).lt.2000.0d0) then
       ientmax=-dlog(entmax)-entmin
-      if (ientmax.gt.2000) ientmax=2000
+      else
+       ientmax=2000
+      endif
       do t=1,ntot(islice)
         ient=entfac(t)-entmin
         if (ient.le.2000) histent(ient)=histent(ient)+1