+! AL 4/17/17: Exit itime_split loop when energy goes infinite
+ if (energia_short(0).gt.0.99e20 .or. isnan(energia_short(0)) ) then
+ if (PRINT_AMTS_MSG) &
+ write (iout,*) "Infinities/NaNs in energia_short",energia_short(0),"; increasing ntime_split to",ntime_split
+ ntime_split=ntime_split*2
+ if (ntime_split.gt.maxtime_split) then
+#ifdef MPI
+ write (iout,*) &
+ "Cannot rescue the run; aborting job. Retry with a smaller time step"
+ call flush(iout)
+ call MPI_Abort(MPI_COMM_WORLD,IERROR,ERRCODE)
+#else
+ write (iout,*) &
+ "Cannot rescue the run; terminating. Retry with a smaller time step"
+#endif
+ endif
+ exit
+ endif
+! End change