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

Commit

Permalink
Added user parameter option to turn on or off the flattened interacti…
Browse files Browse the repository at this point in the history
…on loops
  • Loading branch information
daminton committed Sep 16, 2021
1 parent 5a5a221 commit b2401e0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/io/io.f90
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,9 @@ module subroutine io_param_reader(self, unit, iotype, v_list, iostat, iomsg)
case ("TIDES")
call io_toupper(param_value)
if (param_value == "YES" .or. param_value == 'T') param%ltides = .true.
case ("FLATTEN_INTERACTIONS")
call io_toupper(param_value)
if (param_value == "NO" .or. param_value == 'F') param%lflatten_interactions = .false.
case ("FIRSTKICK")
call io_toupper(param_value)
if (param_value == "NO" .or. param_value == 'F') param%lfirstkick = .false.
Expand Down Expand Up @@ -755,9 +758,10 @@ module subroutine io_param_reader(self, unit, iotype, v_list, iostat, iomsg)
if ((param%qmin_alo > 0.0_DP) .or. (param%qmin_ahi > 0.0_DP)) write(*,*) "CHK_QMIN_RANGE = ",param%qmin_alo, param%qmin_ahi
write(*,*) "EXTRA_FORCE = ",param%lextra_force
write(*,*) "RHILL_PRESENT = ",param%lrhill_present
write(*,*) "ROTATION = ", param%lrotation
write(*,*) "TIDES = ", param%ltides
write(*,*) "ROTATION = ", param%lrotation
write(*,*) "TIDES = ", param%ltides
write(*,*) "ENERGY = ",param%lenergy
write(*,*) "FLATTEN_INTERACTIONS = ",param%lflatten_interactions
if (param%lenergy) write(*,*) "ENERGY_OUT = ",trim(adjustl(param%energy_out))
write(*,*) "MU2KG = ",param%MU2KG
write(*,*) "TU2S = ",param%TU2S
Expand Down Expand Up @@ -899,6 +903,7 @@ module subroutine io_param_writer(self, unit, iotype, v_list, iostat, iomsg)
write(param_name, *) "GR"; write(param_value, Lfmt) param%lgr; write(unit, *, err = 667, iomsg = iomsg) adjustl(param_name) // trim(adjustl(param_value))
write(param_name, *) "ROTATION"; write(param_value, Lfmt) param%lrotation; write(unit, *, err = 667, iomsg = iomsg) adjustl(param_name) // trim(adjustl(param_value))
write(param_name, *) "TIDES"; write(param_value, Lfmt) param%ltides; write(unit, *, err = 667, iomsg = iomsg) adjustl(param_name) // trim(adjustl(param_value))
write(param_name, *) "FLATTEN_INTERACTIONS"; write(param_value, Lfmt) param%lflatten_interactions; write(unit, *, err = 667, iomsg = iomsg) adjustl(param_name) // trim(adjustl(param_value))

if (param%lenergy) then
write(param_name, *) "FIRSTENERGY"; write(param_value, Lfmt) param%lfirstenergy; write(unit, *, err = 667, iomsg = iomsg) adjustl(param_name) // trim(adjustl(param_value))
Expand Down
1 change: 1 addition & 0 deletions src/modules/swiftest_classes.f90
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ module swiftest_classes
logical :: loblatecb = .false. !! Calculate acceleration from oblate central body (automatically turns true if nonzero J2 is input)
logical :: lrotation = .false. !! Include rotation states of big bodies
logical :: ltides = .false. !! Include tidal dissipation
logical :: lflatten_interactions = .true. !! Use the flattened upper triangular matrix for pl-pl interactions (turning this on improves the speed but uses more memory)

! Initial values to pass to the energy report subroutine (usually only used in the case of a restart, otherwise these will be updated with initial conditions values)
real(DP) :: Eorbit_orig = 0.0_DP !! Initial orbital energy
Expand Down

0 comments on commit b2401e0

Please sign in to comment.