5D update
[unres.git] / source / wham / src-HCD-5D / enecalc1.F
index 69564ad..f037ae8 100644 (file)
@@ -173,7 +173,8 @@ c        temp=1.0d0/(beta_h(ib,ipar)*1.987D-3)
 c        write (iout,*) "temp", temp
 c        call pdbout(i,temp,energia(0),energia(0),0.0d0,0.0d0)
 #endif
-        if (energia(0).ge.1.0d20) then
+        if (isnan(energia(0)) .or. energia(1).ge.1.0d20 
+     &     .or. energia(0).ge.1.0d20) then
           write (iout,*) "NaNs detected in some of the energy",
      &     " components for conformation",ii+1
           write (iout,*) "The Cartesian geometry is:"