do iparm=1,nParmSet
#ifdef DEBUG
write (iout,'(2i5,21f8.2)') i,iparm,
- & (enetb(k,i,iparm),k=1,22)
+ & (enetb(k,i,iparm),k=1,max_ene)
#endif
call restore_parm(iparm)
#ifdef DEBUG
& 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)
c ient=-dlog(entfac(t))-entmin
ient=entfac(t)-entmin
- if (ient.le.2000) histent_p(ient)=histent_p(ient)+1
+ write (iout,*) "ient",ient,entfac(t),entmin
+C if (ient.le.2000) histent_p(ient)=histent_p(ient)+1
enddo
- call MPI_Allreduce(histent_p(0),histent(0),ientmax+1,MPI_INTEGER,
- & MPI_SUM,WHAM_COMM,IERROR)
- if (me1.eq.Master) then
- write (iout,*) "Entropy histogram"
- do i=0,ientmax
- write(iout,'(f15.4,i10)') entmin+i,histent(i)
- enddo
- endif
+C call MPI_Allreduce(histent_p(0),histent(0),ientmax+1,MPI_INTEGER,
+C & MPI_SUM,WHAM_COMM,IERROR)
+C if (me1.eq.Master) then
+C write (iout,*) "Entropy histogram"
+C do i=0,ientmax
+C write(iout,'(f15.4,i10)') entmin+i,histent(i)
+C enddo
+C endif
#else
entmin=1.0d10
entmax=-1.0d10
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
- do t=1,ntot(islice)
- ient=entfac(t)-entmin
- if (ient.le.2000) histent(ient)=histent(ient)+1
- enddo
- write (iout,*) "Entropy histogram"
- do i=0,ientmax
- write(iout,'(2f15.4)') entmin+i,histent(i)
- enddo
+ else
+ ientmax=2000
+ endif
+C do t=1,ntot(islice)
+C ient=entfac(t)-entmin
+C if (ient.le.2000) histent(ient)=histent(ient)+1
+C enddo
+C write (iout,*) "Entropy histogram"
+C do i=0,ientmax
+C write(iout,'(2f15.4)') entmin+i,histent(i)
+C enddo
#endif
#ifdef MPI
esccor=enetb(19,t,iparm)
edihcnstr=enetb(20,t,iparm)
C edihcnstr=0.0d0
- eliptran=enetb(22,i,iparm)
- etube=enetb(25,i,iparm)
+ eliptran=enetb(22,t,iparm)
+ etube=enetb(25,t,iparm)
do k=0,nGridT
betaT=startGridT+k*delta_T
endif
#endif
+#ifdef MPI
+ do ib=1,nT_h(iparm)
+ potEmin=potEmin_all(ib,iparm)
+ expfac=dexp(-beta_h(ib,iparm)*(etot-potEmin)+entfac(t))
+ hfin_p(ind,ib)=hfin_p(ind,ib)+
+ & dexp(-beta_h(ib,iparm)*(etot-potEmin)+entfac(t))
+ if (rmsrgymap) then
+ indrgy=dint((q(nQ+2,t)-rgymin)/deltrgy)
+ indrms=dint((q(nQ+1,t)-rmsmin)/deltrms)
+ hrmsrgy_p(indrgy,indrms,ib)=
+ & hrmsrgy_p(indrgy,indrms,ib)+expfac
+ endif
+ enddo
+#else
+ do ib=1,nT_h(iparm)
+ potEmin=potEmin_all(ib,iparm)
+ expfac=dexp(-beta_h(ib,iparm)*(etot-potEmin)+entfac(t))
+ hfin(ind,ib)=hfin(ind,ib)+
+ & dexp(-beta_h(ib,iparm)*(etot-potEmin)+entfac(t))
+ if (rmsrgymap) then
+ indrgy=dint((q(nQ+2,t)-rgymin)/deltrgy)
+ indrms=dint((q(nQ+1,t)-rmsmin)/deltrms)
+ hrmsrgy(indrgy,indrms,ib)=
+ & hrmsrgy(indrgy,indrms,ib)+expfac
+ endif
+ enddo
+#endif
+
weight=dexp(-betaT*(etot-potEmin)+entfac(t))
#ifdef DEBUG
write (iout,*) "iparm",iparm," t",t," betaT",betaT,
if (indE.gt.upindE_p) upindE_p=indE
histE_p(indE)=histE_p(indE)+dexp(-entfac(t))
endif
-#ifdef MPI
- do ib=1,nT_h(iparm)
- potEmin=potEmin_all(ib,iparm)
- expfac=dexp(-beta_h(ib,iparm)*(etot-potEmin)+entfac(t))
- hfin_p(ind,ib)=hfin_p(ind,ib)+
- & dexp(-beta_h(ib,iparm)*(etot-potEmin)+entfac(t))
- if (rmsrgymap) then
- indrgy=dint((q(nQ+2,t)-rgymin)/deltrgy)
- indrms=dint((q(nQ+1,t)-rmsmin)/deltrms)
- hrmsrgy_p(indrgy,indrms,ib)=
- & hrmsrgy_p(indrgy,indrms,ib)+expfac
- endif
- enddo
-#else
- do ib=1,nT_h(iparm)
- potEmin=potEmin_all(ib,iparm)
- expfac=dexp(-beta_h(ib,iparm)*(etot-potEmin)+entfac(t))
- hfin(ind,ib)=hfin(ind,ib)+
- & dexp(-beta_h(ib,iparm)*(etot-potEmin)+entfac(t))
- if (rmsrgymap) then
- indrgy=dint((q(nQ+2,t)-rgymin)/deltrgy)
- indrms=dint((q(nQ+1,t)-rmsmin)/deltrms)
- hrmsrgy(indrgy,indrms,ib)=
- & hrmsrgy(indrgy,indrms,ib)+expfac
- endif
- enddo
-#endif
+!#ifdef MPI
+! do ib=1,nT_h(iparm)
+! potEmin=potEmin_all(ib,iparm)
+! expfac=dexp(-beta_h(ib,iparm)*(etot-potEmin)+entfac(t))
+! hfin_p(ind,ib)=hfin_p(ind,ib)+
+! & dexp(-beta_h(ib,iparm)*(etot-potEmin)+entfac(t))
+! if (rmsrgymap) then
+! indrgy=dint((q(nQ+2,t)-rgymin)/deltrgy)
+! indrms=dint((q(nQ+1,t)-rmsmin)/deltrms)
+! hrmsrgy_p(indrgy,indrms,ib)=
+! & hrmsrgy_p(indrgy,indrms,ib)+expfac
+! endif
+! enddo
+!#else
+! do ib=1,nT_h(iparm)
+! potEmin=potEmin_all(ib,iparm)
+! expfac=dexp(-beta_h(ib,iparm)*(etot-potEmin)+entfac(t))
+! hfin(ind,ib)=hfin(ind,ib)+
+! & dexp(-beta_h(ib,iparm)*(etot-potEmin)+entfac(t))
+! if (rmsrgymap) then
+! indrgy=dint((q(nQ+2,t)-rgymin)/deltrgy)
+! indrms=dint((q(nQ+1,t)-rmsmin)/deltrms)
+! hrmsrgy(indrgy,indrms,ib)=
+! & hrmsrgy(indrgy,indrms,ib)+expfac
+! endif
+! enddo
+!#endif
enddo ! t
do ib=1,nT_h(iparm)
if (histout) call MPI_Reduce(hfin_p(0,ib),hfin(0,ib),nbin,