From a2b8b4a1cbb62f9b7fc4e3b8e97982e2a76bc704 Mon Sep 17 00:00:00 2001 From: David A Minton Date: Mon, 30 Aug 2021 09:21:20 -0400 Subject: [PATCH] Added mass loss exception commit --- src/io/io.f90 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/io/io.f90 b/src/io/io.f90 index 65a61da6a..a7cea0d7f 100644 --- a/src/io/io.f90 +++ b/src/io/io.f90 @@ -67,6 +67,10 @@ module subroutine io_conservation_report(self, param, lterminal) Ecoll_error = param%Ecollisions / abs(param%Eorbit_orig) Etotal_error = (Eorbit_now - param%Ecollisions - param%Eorbit_orig - param%Euntracked) / abs(param%Eorbit_orig) Merror = (GMtot_now - param%GMtot_orig) / param%GMtot_orig + if (Merror < -10 * epsilon(Merror)) then + write(*,*) 'Mass loss! Halting!' + call util_exit(FAILURE) + end if write(*, EGYTERMFMT) Lerror, Ecoll_error, Etotal_error, Merror end if end associate