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

Fix the values of the mass, energy, and angular momentum errors #2

Merged
merged 1 commit into from
Jul 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile.Defines
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ GMEM = -fsanitize=undefined -fsanitize=address -fsanitize=leak
GWARNINGS = -Wall -Warray-bounds -Wimplicit-interface -Wextra -Warray-temporaries

#FFLAGS = -init=snan,arrays -traceback -no-wrap-margin -O3 -g -CB -nogen-interfaces -no-pie -fp-speculation=safe $(SIMDVEC) $(PAR) #$(HEAPARR)
#FFLAGS = $(IDEBUG) $(HEAPARR)
FFLAGS = -init=snan,arrays -no-wrap-margin -fp-model strict -fp-model no-except -traceback -g -O3 $(SIMDVEC) $(PAR) $(HEAPARR)
FFLAGS = $(IDEBUG) $(HEAPARR)
#FFLAGS = -init=snan,arrays -no-wrap-margin -fp-model strict -fp-model no-except -traceback -g -O3 $(SIMDVEC) $(PAR) $(HEAPARR)
FORTRAN = ifort
#AR = xiar

Expand Down
14 changes: 7 additions & 7 deletions src/main/swiftest_symba.f90
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,13 @@ program swiftest_symba
end if

! reorder by mass
if (out_stat /= "APPEND") call symba_reorder_pl(npl, symba_plA) ! This is a new run, so we will sort the massive body list by mass
if (out_stat /= "APPEND") then ! This is a new run, so we will sort the massive body list by mass and save the initial conditions of the central body
call symba_reorder_pl(npl, symba_plA)
symba_plA%helio%swiftest%Mcb_initial = symba_plA%helio%swiftest%mass(1)
symba_plA%helio%swiftest%Rcb_initial = symba_plA%helio%swiftest%radius(1)
symba_plA%helio%swiftest%Lcb_initial(:) = symba_plA%helio%swiftest%Ip(3,1) * symba_plA%helio%swiftest%mass(1) * &
symba_plA%helio%swiftest%radius(1)**2 * symba_plA%helio%swiftest%rot(:,1)
end if

call util_valid(npl, ntp, symba_plA%helio%swiftest, symba_tpA%helio%swiftest)
ntp0 = ntp
Expand All @@ -130,12 +136,6 @@ program swiftest_symba
CALL util_dist_index_plpl(npl, nplm, symba_plA)
!CALL util_dist_index_pltp(nplm, ntp, symba_tpA)

! Save initial mass and angular momentum of the central body
symba_plA%helio%swiftest%Mcb_initial = symba_plA%helio%swiftest%mass(1)
symba_plA%helio%swiftest%Rcb_initial = symba_plA%helio%swiftest%radius(1)
symba_plA%helio%swiftest%Lcb_initial(:) = symba_plA%helio%swiftest%Ip(3,1) * symba_plA%helio%swiftest%mass(1) * &
symba_plA%helio%swiftest%radius(1)**2 * symba_plA%helio%swiftest%rot(:,1)

if (param%lenergy) then
call coord_h2b(npl, symba_plA%helio%swiftest, msys)
call io_conservation_report(t, symba_plA, npl, j2rp2, j4rp4, param, lterminal=.false.)
Expand Down