ctest grep -v "NaN NaN NaN"
[unres.git] / source / wham / src / energy_p_new.F
index 0fd4d07..0e50c7f 100644 (file)
@@ -116,13 +116,29 @@ c      write(iout,*) "TEST_ENE1 constr_homology=",constr_homology
 c      write(iout,*) "TEST_ENE1 ehomology_constr=",ehomology_constr
 
 C     BARTEK for dfa test!
-      if (wdfa_dist.gt.0) call edfad(edfadis)
+      if (wdfa_dist.gt.0) then
+        call edfad(edfadis)
+      else
+        edfadis=0.0d0
+      endif
 c      write(iout,*)'edfad is finished!', wdfa_dist,edfadis
-      if (wdfa_tor.gt.0) call edfat(edfator)
+      if (wdfa_tor.gt.0) then
+        call edfat(edfator)
+      else
+        edfator=0.0d0
+      endif
 c      write(iout,*)'edfat is finished!', wdfa_tor,edfator
-      if (wdfa_nei.gt.0) call edfan(edfanei)
+      if (wdfa_nei.gt.0) then
+        call edfan(edfanei)
+      else
+        edfanei=0.0d0
+      endif
 c      write(iout,*)'edfan is finished!', wdfa_nei,edfanei
-      if (wdfa_beta.gt.0) call edfab(edfabet)
+      if (wdfa_beta.gt.0) then
+        call edfab(edfabet)
+      else
+        edfabet=0.0d0
+      endif
 c      write(iout,*)'edfab is finished!', wdfa_beta,edfabet
 
 c      write (iout,*) "ft(6)",fact(6)," evdw",evdw," evdw_t",evdw_t
@@ -2948,7 +2964,7 @@ C Evaluate bridge-strain energy and its gradient in virtual-bond and SC vectors.
 C
       implicit real*8 (a-h,o-z)
       include 'DIMENSIONS'
-      include 'DIMENSIONS.ZSCOPT'
+      include 'DIMENSIONS.FREE'
       include 'COMMON.SBRIDGE'
       include 'COMMON.CHAIN'
       include 'COMMON.DERIV'
@@ -3006,9 +3022,9 @@ C target distance.
      &           *rlornmr1(dd,dhpb(i),dhpb1(i),forcon(i))
             fac=fordepth(i)!**4.0d0
      &           *rlornmr1prim(dd,dhpb(i),dhpb1(i),forcon(i))/dd
-            if (energy_dec) write (iout,'(a6,2i5,6f10.3,i5)')
-     &        "edisL",ii,jj,dd,dhpb(i),dhpb1(i),forcon(i),fordepth(i),
-     &        ehpb,irestr_type(i)
+c            if (energy_dec) write (iout,'(a6,2i5,6f10.3,i5)')
+c     &        "edisL",ii,jj,dd,dhpb(i),dhpb1(i),forcon(i),fordepth(i),
+c     &        ehpb,irestr_type(i)
           else if (irestr_type(i).eq.10) then
 c AL 6//19/2018 cross-link restraints
             xdis = 0.5d0*(dd/forcon(i))**2
@@ -3021,15 +3037,15 @@ c     &          " wboltzd",wboltzd
 c            fac=-wboltzd*(dhpb1(i)*(1.0d0-xdis)-dhpb(i))
             fac=-wboltzd*xlscore(i)*(dhpb1(i)*(2.0d0-xdis)*xdis-dhpb(i))
      &           *expdis/(aux*forcon(i)**2)
-            if (energy_dec) write(iout,'(a6,2i5,6f10.3,i5)') 
-     &        "edisX",ii,jj,dd,dhpb(i),dhpb1(i),forcon(i),fordepth(i),
-     &        -wboltzd*xlscore(i)*dlog(aux),irestr_type(i)
+c            if (energy_dec) write(iout,'(a6,2i5,6f10.3,i5)') 
+c     &        "edisX",ii,jj,dd,dhpb(i),dhpb1(i),forcon(i),fordepth(i),
+c     &        -wboltzd*xlscore(i)*dlog(aux),irestr_type(i)
           else if (irestr_type(i).eq.2) then
 c Quartic restraints
             ehpb=ehpb+forcon(i)*gnmr1(dd,dhpb(i),dhpb1(i))
-            if (energy_dec) write(iout,'(a6,2i5,5f10.3,i5)') 
-     &      "edisQ",ii,jj,dd,dhpb(i),dhpb1(i),forcon(i),
-     &      forcon(i)*gnmr1(dd,dhpb(i),dhpb1(i)),irestr_type(i)
+c            if (energy_dec) write(iout,'(a6,2i5,5f10.3,i5)') 
+c     &      "edisQ",ii,jj,dd,dhpb(i),dhpb1(i),forcon(i),
+c     &      forcon(i)*gnmr1(dd,dhpb(i),dhpb1(i)),irestr_type(i)
             fac=forcon(i)*gnmr1prim(dd,dhpb(i),dhpb1(i))/dd
           else
 c Quadratic restraints
@@ -3038,9 +3054,9 @@ C Get the force constant corresponding to this distance.
             waga=forcon(i)
 C Calculate the contribution to energy.
             ehpb=ehpb+0.5d0*waga*rdis*rdis
-            if (energy_dec) write(iout,'(a6,2i5,5f10.3,i5)') 
-     &      "edisS",ii,jj,dd,dhpb(i),dhpb1(i),forcon(i),
-     &       0.5d0*waga*rdis*rdis,irestr_type(i)
+c            if (energy_dec) write(iout,'(a6,2i5,5f10.3,i5)') 
+c     &      "edisS",ii,jj,dd,dhpb(i),dhpb1(i),forcon(i),
+c     &       0.5d0*waga*rdis*rdis,irestr_type(i)
 C
 C Evaluate gradient.
 C