correcation in ion param and dyn_ss
[unres4.git] / source / wham / enecalc.F90
index 1568a9a..643e201 100644 (file)
@@ -1231,7 +1231,7 @@ write(iout,*)"end of store_parm"
             eello_turn6,eel_loc,edihcnstr,etors_d,estr,evdw2_14,esccor,tt, &
             ecation_prot, ecationcation,evdwpp,eespp,evdwpsb,eelpsb,evdwsb, &
             eelsb,estr_nucl,ebe_nucl,esbloc,etors_nucl,etors_d_nucl,&
-            ecorr_nucl,ecorr3_nucl,escbase, epepbase,escpho, epeppho
+            ecorr_nucl,ecorr3_nucl,escbase, epepbase,escpho, epeppho,ecation_nucl
 
       integer :: i,ii,ik,iproc,iscor,j,k,l,ib,iparm,iprot,nlist
       real(kind=8) :: qfree,sumprob,eini,efree,rmsdev
@@ -1396,6 +1396,15 @@ write(iout,*)"end of store_parm"
             etors_d_nucl =      enetb(36,i,iparm)
             ecorr_nucl =      enetb(37,i,iparm)
             ecorr3_nucl =      enetb(38,i,iparm)
+            epeppho=   enetb(49,i,iparm)
+            escpho=    enetb(48,i,iparm)
+            epepbase=  enetb(47,i,iparm)
+            escbase=   enetb(46,i,iparm)
+            ecation_nucl=enetb(50,i,iparm)
+!      wscbase=ww(46)
+!      wpepbase=ww(47)
+!      wscpho=ww(48)
+!      wpeppho=ww(49)
 
 !#ifdef SPLITELE
 !            etot=wsc*(evdw+ft(6)*evdw_t)+wscp*evdw2+ft(1)*welec*ees &
@@ -1423,7 +1432,7 @@ write(iout,*)"end of store_parm"
             etot=wsc*evdw+wscp*evdw2+welec*ees &
             +wvdwpp*evdw1 &
             +wang*ebe+wtor*etors+wscloc*escloc &
-            +wstrain*ehpb+nss*ebr+wcorr*ecorr+wcorr5*ecorr5 &
+            +wstrain*ehpb+wcorr*ecorr+wcorr5*ecorr5 &
             +wcorr6*ecorr6+wturn4*eello_turn4 &
             +wturn3*eello_turn3 &
             +wturn6*eello_turn6+wel_loc*eel_loc &
@@ -1434,13 +1443,14 @@ write(iout,*)"end of store_parm"
             +wvdwsb*evdwsb+welsb*eelsb+wsbloc*esbloc+wtor_nucl*etors_nucl&
             +wtor_d_nucl*etors_d_nucl+wcorr_nucl*ecorr_nucl+wcorr3_nucl*ecorr3_nucl&
             +wscbase*escbase&
-            +wpepbase*epepbase+wscpho*escpho+wpeppho*epeppho
+            +wpepbase*epepbase+wscpho*escpho+wpeppho*epeppho&
+            +wcatnucl*ecation_nucl
 
 #else
             etot=wsc*evdw+wscp*evdw2 &
             +welec*(ees+evdw1) &
             +wang*ebe+wtor*etors+wscloc*escloc &
-            +wstrain*ehpb+nss*ebr+wcorr*ecorr+wcorr5*ecorr5 &
+            +wstrain*ehpb+wcorr*ecorr+wcorr5*ecorr5 &
             +wcorr6*ecorr6+wturn4*eello_turn4 &
             +wturn3*eello_turn3 &
             +wturn6*eello_turn6+wel_loc*eel_loc+edihcnstr &
@@ -1451,7 +1461,8 @@ write(iout,*)"end of store_parm"
             +wvdwsb*evdwsb+welsb*eelsb+wsbloc*esbloc+wtor_nucl*etors_nucl&
             +wtor_d_nucl*etors_d_nucl+wcorr_nucl*ecorr_nucl+wcorr3_nucl*ecorr3_nucl&
             +wscbase*escbase&
-            +wpepbase*epepbase+wscpho*escpho+wpeppho*epeppho
+            +wpepbase*epepbase+wscpho*escpho+wpeppho*epeppho&
+            +wcatnucl*ecation_nucl
 
 #endif
 
@@ -1470,13 +1481,22 @@ write(iout,*)"end of store_parm"
 #endif
           enddo   ! i
 #ifdef MPI
+          scount_(:)=0
           do i=1,scount(me1)
             Fdimless_(i)=Fdimless(i)
           enddo
+          write(iout,*) "before gather Fdimless"
+          write(iout,*) scount(me),scount_(0),idispl(0)
+          write (iout,*) "added update of scount_"
+         call MPI_AllGather( scount(me), 1, MPI_INTEGER, scount_(0), 1, &
+        MPI_INTEGER, WHAM_COMM, IERROR)
+
+
           call MPI_Gatherv(Fdimless_(1),scount(me),&
            MPI_REAL,Fdimless(1),&
            scount_(0),idispl(0),MPI_REAL,Master,&
            WHAM_COMM, IERROR)
+          write(iout,*) "after gather Fdimless"
 #ifdef DEBUG
           call MPI_Gatherv(potE(1,iparm),scount_(me),&
            MPI_DOUBLE_PRECISION,potE(1,iparm),&