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

Commit

Permalink
Changed it so that if the run is a restart, it doesn't save the initi…
Browse files Browse the repository at this point in the history
…al values of the central body mass and momentum
  • Loading branch information
daminton committed Jul 2, 2021
1 parent bbd5bc1 commit 6338afb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
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

0 comments on commit 6338afb

Please sign in to comment.