Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Removed extra terminal output of conservation report for non pl-pl co…
Browse files Browse the repository at this point in the history
…llisions/escapes and made the halting condition on lack of mass conservation more robust.
  • Loading branch information
daminton committed Sep 4, 2021
1 parent 87fc551 commit b33dd1e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/discard/discard.f90
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module subroutine discard_system(self, param)
end if

if (lpl_discards .or. ltp_discards) call system%write_discard(param)
if (lpl_discards .and. param%lenergy) call self%conservation_report(param, lterminal=.true.)
if (lpl_discards .and. param%lenergy) call self%conservation_report(param, lterminal=.false.)
if (lpl_check) call pl_discards%setup(0,param)
if (ltp_check) call tp_discards%setup(0,param)

Expand Down
8 changes: 4 additions & 4 deletions src/io/io.f90
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ module subroutine io_conservation_report(self, param, lterminal)
close(EGYIU, err = 667, iomsg = errmsg)
end if

if (.not.param%lfirstenergy .and. lterminal) then
if (.not.param%lfirstenergy) then
Lerror = norm2(Ltot_now(:) - param%Ltot_orig(:)) / norm2(param%Ltot_orig(:))
Eorbit_error = (Eorbit_now - param%Eorbit_orig) / abs(param%Eorbit_orig)
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
write(*, EGYTERMFMT) Lerror, Ecoll_error, Etotal_error, Merror
if (Merror < -10 * epsilon(Merror)) then
write(*,*) 'Mass loss! Halting!'
if (lterminal) write(*, EGYTERMFMT) Lerror, Ecoll_error, Etotal_error, Merror
if (abs(Merror) > 100 * epsilon(Merror)) then
write(*,*) "Severe error! Mass not conserved! Halting!"
call pl%xv2el(cb)
call param%nciu%open(param)
call self%write_hdr(param%nciu, param)
Expand Down

0 comments on commit b33dd1e

Please sign in to comment.