From b2401e0104ad92cf0827a3207df20e54648a52e8 Mon Sep 17 00:00:00 2001 From: David A Minton Date: Thu, 16 Sep 2021 13:45:03 -0400 Subject: [PATCH] Added user parameter option to turn on or off the flattened interaction loops --- src/io/io.f90 | 9 +++++++-- src/modules/swiftest_classes.f90 | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/io/io.f90 b/src/io/io.f90 index f04c07e4f..51d10561d 100644 --- a/src/io/io.f90 +++ b/src/io/io.f90 @@ -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. @@ -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 @@ -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)) diff --git a/src/modules/swiftest_classes.f90 b/src/modules/swiftest_classes.f90 index 61f0de8ef..287654614 100644 --- a/src/modules/swiftest_classes.f90 +++ b/src/modules/swiftest_classes.f90 @@ -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