From 6338afb128150fd933e42aa3e10465b2402329a2 Mon Sep 17 00:00:00 2001 From: David A Minton Date: Fri, 2 Jul 2021 15:38:09 -0400 Subject: [PATCH] Changed it so that if the run is a restart, it doesn't save the initial values of the central body mass and momentum --- Makefile.Defines | 4 ++-- src/main/swiftest_symba.f90 | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Makefile.Defines b/Makefile.Defines index 6a52a013f..c4ec91506 100644 --- a/Makefile.Defines +++ b/Makefile.Defines @@ -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 diff --git a/src/main/swiftest_symba.f90 b/src/main/swiftest_symba.f90 index a5ac6bede..35432975e 100644 --- a/src/main/swiftest_symba.f90 +++ b/src/main/swiftest_symba.f90 @@ -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 @@ -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.)