From fa50454b5753f2732640df0f631a00c5138d8f87 Mon Sep 17 00:00:00 2001 From: David A Minton Date: Tue, 5 Oct 2021 23:28:24 -0400 Subject: [PATCH 1/7] Fixed bug in OMP directive --- src/encounter/encounter.f90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/encounter/encounter.f90 b/src/encounter/encounter.f90 index e2830445b..02e78cfcd 100644 --- a/src/encounter/encounter.f90 +++ b/src/encounter/encounter.f90 @@ -14,7 +14,7 @@ module subroutine encounter_check_all_flat_plpl(nplplm, k_plpl, x, v, renc, dt, integer(I4B), dimension(:,:), intent(in) :: k_plpl !! List of all pl-pl encounters real(DP), dimension(:,:), intent(in) :: x !! Position vectors of massive bodies real(DP), dimension(:,:), intent(in) :: v !! Velocity vectors of massive bodies - real(DP), dimension(:), intent(in) :: renc !! Hill's radii of massive bodies + real(DP), dimension(:), intent(in) :: renc !! Hill's radii of massive bodies real(DP), intent(in) :: dt !! Step size logical, dimension(:), intent(out) :: lencounter !! Logical array indicating which pair is in an encounter state logical, dimension(:), intent(out) :: loc_lvdotr !! Logical array indicating the sign of v .dot. x for each encounter @@ -25,7 +25,7 @@ module subroutine encounter_check_all_flat_plpl(nplplm, k_plpl, x, v, renc, dt, !$omp parallel do simd default(private) schedule(static)& !$omp shared(nplplm, k_plpl, x, v, renc, dt, lencounter, loc_lvdotr) & - !$omp lastprivate(xr, yr, zr, vxr, vyr, vzr, renc1, renc2) + !$omp lastprivate(xr, yr, zr, vxr, vyr, vzr, renc12) do k = 1_I8B, nplplm i = k_plpl(1, k) j = k_plpl(2, k) From 491a50917acb0b8465189502e74404b26bb1bb3c Mon Sep 17 00:00:00 2001 From: David A Minton Date: Fri, 8 Oct 2021 15:10:16 -0400 Subject: [PATCH 2/7] Switched to gfortran flags --- Makefile.Defines | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile.Defines b/Makefile.Defines index 3789bb8a8..b0c956c85 100644 --- a/Makefile.Defines +++ b/Makefile.Defines @@ -68,14 +68,15 @@ GPRODUCTION = -O2 -ffree-line-length-none $(GPAR) #FFLAGS = $(IDEBUG) $(SIMDVEC) $(PAR) #FFASTFLAGS = $(IDEBUG) $(SIMDVEC) $(PAR) -FSTRICTFLAGS = $(IPRODUCTION) $(STRICTREAL) $(OPTREPORT) #$(ADVIXE_FLAGS) -FFLAGS = $(IPRODUCTION) -fp-model=fast $(OPTREPORT) #$(ADVIXE_FLAGS) -FORTRAN = ifort +#FSTRICTFLAGS = $(IPRODUCTION) $(STRICTREAL) $(OPTREPORT) #$(ADVIXE_FLAGS) +#FFLAGS = $(IPRODUCTION) -fp-model=fast $(OPTREPORT) #$(ADVIXE_FLAGS) +#FORTRAN = ifort AR = xiar -#FORTRAN = gfortran +FORTRAN = gfortran #FFLAGS = $(GDEBUG) # $(GMEM) $(GPAR) -#FFLAGS = $(GPRODUCTION) -g -fbacktrace #-fcheck=all #-Wall AR = ar # DO NOT include in CFLAGS the "-c" option to compile object only +FFLAGS = $(GPRODUCTION) #-fcheck=all #-Wall AR = ar # DO NOT include in CFLAGS the "-c" option to compile object only +FSTRICTFLAGS = $(FFLAGS) # this is done explicitly as needed in the Makefile CC = icc From 6caaa8d7d5735e8d9898523a459ef84122d1d23d Mon Sep 17 00:00:00 2001 From: David A Minton Date: Sun, 10 Oct 2021 16:24:29 -0400 Subject: [PATCH 3/7] Switched this branch to default to gfortran --- Makefile.Defines | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/Makefile.Defines b/Makefile.Defines index 6050b5790..4cbf3e055 100644 --- a/Makefile.Defines +++ b/Makefile.Defines @@ -66,23 +66,24 @@ GMEM = -fsanitize-address-use-after-scope -fstack-check -fsanitize=bounds-stri GWARNINGS = -Wall -Warray-bounds -Wimplicit-interface -Wextra -Warray-temporaries GPRODUCTION = -O3 -ffree-line-length-none $(GPAR) - -MKL_ROOT = /apps/spack/bell/apps/intel-parallel-studio/cluster.2019.5-intel-19.0.5-4brgqlf/mkl/lib -IMKL = -I$(MKLROOT)/include -LMKL = -L$(MKLROOT)/lib/intel64 -qopt-matmul +#MKL_ROOT = /apps/spack/bell/apps/intel-parallel-studio/cluster.2019.5-intel-19.0.5-4brgqlf/mkl/lib +#IMKL = -I$(MKLROOT)/include +#LMKL = -L$(MKLROOT)/lib/intel64 -qopt-matmul #FFLAGS = $(IDEBUG) $(SIMDVEC) $(PAR) #FFASTFLAGS = $(IDEBUG) $(SIMDVEC) $(PAR) -FSTRICTFLAGS = $(IPRODUCTION) $(STRICTREAL) $(OPTREPORT) #$(ADVIXE_FLAGS) -FFLAGS = $(IPRODUCTION) -fp-model=fast $(OPTREPORT) #$(ADVIXE_FLAGS) -FORTRAN = ifort -AR = xiar +#FSTRICTFLAGS = $(IPRODUCTION) $(STRICTREAL) $(OPTREPORT) #$(ADVIXE_FLAGS) +#FFLAGS = $(IPRODUCTION) -fp-model=fast $(OPTREPORT) #$(ADVIXE_FLAGS) +#FORTRAN = ifort +#AR = xiar -#FORTRAN = gfortran +FORTRAN = gfortran #FFLAGS = $(GDEBUG) $(GMEM) #$(GPAR) -#FFLAGS = $(GPRODUCTION) #-g -fbacktrace -fcheck=all #-Wall -#FSTRICTFLAGS= $(GPRODUCTION) #-g -fbacktrace -fcheck=all #-Wall -#AR = ar # DO NOT include in CFLAGS the "-c" option to compile object only +FFLAGS = $(GPRODUCTION) #-g -fbacktrace -fcheck=all #-Wall +FSTRICTFLAGS= $(GPRODUCTION) #-g -fbacktrace -fcheck=all #-Wall +AR = ar + +# DO NOT include in CFLAGS the "-c" option to compile object only # this is done explicitly as needed in the Makefile #CC = icc From 3b9a75b2c0e92477d69b1237c5869fd36a2bc309 Mon Sep 17 00:00:00 2001 From: Carlisle April Wishard Date: Fri, 15 Oct 2021 14:32:48 -0400 Subject: [PATCH 4/7] Updated collision_id particle info and maxid_collision parameter --- src/io/io.f90 | 3 +++ src/modules/swiftest_classes.f90 | 1 + src/modules/symba_classes.f90 | 1 - src/netcdf/netcdf.f90 | 2 ++ src/setup/setup.f90 | 6 +++--- src/symba/symba_collision.f90 | 10 ++++++---- 6 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/io/io.f90 b/src/io/io.f90 index db08a0331..41b1ff0a9 100644 --- a/src/io/io.f90 +++ b/src/io/io.f90 @@ -710,6 +710,8 @@ module subroutine io_param_reader(self, unit, iotype, v_list, iostat, iomsg) read(param_value, *, err = 667, iomsg = iomsg) param%Euntracked case ("MAXID") read(param_value, *, err = 667, iomsg = iomsg) param%maxid + case ("MAXID_COLLISION") + read(param_value, *, err = 667, iomsg = iomsg) param%maxid_collision case ("PARTICLE_OUT") param%particle_out = param_value case ("NPLMAX", "NTPMAX", "GMTINY", "MIN_GMFRAG", "FRAGMENTATION", "SEED", "YARKOVSKY", "YORP") ! Ignore SyMBA-specific, not-yet-implemented, or obsolete input parameters @@ -1007,6 +1009,7 @@ module subroutine io_param_writer(self, unit, iotype, v_list, iostat, iomsg) end if call io_param_writer_one("FIRSTKICK",param%lfirstkick, unit) call io_param_writer_one("MAXID",param%maxid, unit) + call io_param_writer_one("MAXID_COLLISION",param%maxid_collision, unit) iostat = 0 iomsg = "UDIO not implemented" diff --git a/src/modules/swiftest_classes.f90 b/src/modules/swiftest_classes.f90 index fccc07930..d352b16f3 100644 --- a/src/modules/swiftest_classes.f90 +++ b/src/modules/swiftest_classes.f90 @@ -96,6 +96,7 @@ module swiftest_classes integer(I4B) :: integrator = UNKNOWN_INTEGRATOR !! Symbolic name of the nbody integrator used character(STRMAX) :: param_file_name = "param.in" !! The default name of the parameter input file integer(I4B) :: maxid = -1 !! The current maximum particle id number + integer(I4B) :: maxid_collision = -1 !! The current maximum collision id number real(DP) :: t0 = -1.0_DP !! Integration start time real(DP) :: t = -1.0_DP !! Integration current time real(DP) :: tstop = -1.0_DP !! Integration stop time diff --git a/src/modules/symba_classes.f90 b/src/modules/symba_classes.f90 index 87aa91cae..4a584eda9 100644 --- a/src/modules/symba_classes.f90 +++ b/src/modules/symba_classes.f90 @@ -173,7 +173,6 @@ module symba_classes class(symba_plplenc), allocatable :: plplenc_list !! List of massive body-massive body encounters in a single step class(symba_plplenc), allocatable :: plplcollision_list !! List of massive body-massive body collisions in a single step integer(I4B) :: irec !! System recursion level - integer(I4B) :: collision_counter !! Counter for number of collisions over total simulation contains procedure :: write_discard => symba_io_write_discard !! Write out information about discarded and merged planets and test particles in SyMBA procedure :: initialize => symba_setup_initialize_system !! Performs SyMBA-specific initilization steps diff --git a/src/netcdf/netcdf.f90 b/src/netcdf/netcdf.f90 index 5e05c68e5..26f08f18a 100644 --- a/src/netcdf/netcdf.f90 +++ b/src/netcdf/netcdf.f90 @@ -693,6 +693,7 @@ module subroutine netcdf_read_particle_info_base(self, iu, ind) strlen = len(trim(adjustl(self%info%origin_type))) call check( nf90_get_var(iu%ncid, iu%origin_type_varid, self%info%origin_type, start=[1, idslot], count=[strlen, 1]) ) + call check( nf90_get_var(iu%ncid, iu%collision_id_varid, self%info%collision_id, start=[idslot]) ) call check( nf90_get_var(iu%ncid, iu%origin_time_varid, self%info%origin_time, start=[idslot]) ) call check( nf90_get_var(iu%ncid, iu%origin_xhx_varid, self%info%origin_xh(1), start=[idslot]) ) call check( nf90_get_var(iu%ncid, iu%origin_xhy_varid, self%info%origin_xh(2), start=[idslot]) ) @@ -943,6 +944,7 @@ module subroutine netcdf_write_particle_info_base(self, iu) call check( nf90_put_var(iu%ncid, iu%origin_type_varid, emptystr, start=[1, idslot], count=[NAMELEN, 1]) ) call check( nf90_put_var(iu%ncid, iu%origin_type_varid, charstring, start=[1, idslot], count=[strlen, 1]) ) + call check( nf90_put_var(iu%ncid, iu%collision_id_varid, self%info%collision_id, start=[idslot]) ) call check( nf90_put_var(iu%ncid, iu%origin_time_varid, self%info%origin_time, start=[idslot]) ) call check( nf90_put_var(iu%ncid, iu%origin_xhx_varid, self%info%origin_xh(1), start=[idslot]) ) call check( nf90_put_var(iu%ncid, iu%origin_xhy_varid, self%info%origin_xh(2), start=[idslot]) ) diff --git a/src/setup/setup.f90 b/src/setup/setup.f90 index a2aaa0d23..3f1932d24 100644 --- a/src/setup/setup.f90 +++ b/src/setup/setup.f90 @@ -106,12 +106,12 @@ module subroutine setup_initialize_particle_info_system(self, param) associate(cb => self%cb, pl => self%pl, npl => self%pl%nbody, tp => self%tp, ntp => self%tp%nbody) - call cb%info%set_value(particle_type=CB_TYPE_NAME, status="ACTIVE", origin_type="Initial conditions", origin_time=param%t0, origin_xh=[0.0_DP, 0.0_DP, 0.0_DP], origin_vh=[0.0_DP, 0.0_DP, 0.0_DP], collision_id=0) + call cb%info%set_value(particle_type=CB_TYPE_NAME, status="ACTIVE", origin_type="Initial conditions", origin_time=param%t0, origin_xh=[0.0_DP, 0.0_DP, 0.0_DP], origin_vh=[0.0_DP, 0.0_DP, 0.0_DP]) do i = 1, self%pl%nbody - call pl%info(i)%set_value(particle_type=PL_TYPE_NAME, status="ACTIVE", origin_type="Initial conditions", origin_time=param%t0, origin_xh=self%pl%xh(:,i), origin_vh=self%pl%vh(:,i), collision_id=0) + call pl%info(i)%set_value(particle_type=PL_TYPE_NAME, status="ACTIVE", origin_type="Initial conditions", origin_time=param%t0, origin_xh=self%pl%xh(:,i), origin_vh=self%pl%vh(:,i)) end do do i = 1, self%tp%nbody - call tp%info(i)%set_value(particle_type=TP_TYPE_NAME, status="ACTIVE", origin_type="Initial conditions", origin_time=param%t0, origin_xh=self%tp%xh(:,i), origin_vh=self%tp%vh(:,i), collision_id=0) + call tp%info(i)%set_value(particle_type=TP_TYPE_NAME, status="ACTIVE", origin_type="Initial conditions", origin_time=param%t0, origin_xh=self%tp%xh(:,i), origin_vh=self%tp%vh(:,i)) end do end associate diff --git a/src/symba/symba_collision.f90 b/src/symba/symba_collision.f90 index 74a12413b..e7435a6b5 100644 --- a/src/symba/symba_collision.f90 +++ b/src/symba/symba_collision.f90 @@ -718,7 +718,9 @@ subroutine symba_collision_mergeaddsub(system, param, colliders, frag, status) ncolliders = colliders%ncoll nfrag = frag%nbody - system%collision_counter = system%collision_counter + 1 + param%maxid_collision = max(param%maxid_collision, maxval(system%pl%info(:)%collision_id)) + param%maxid_collision = param%maxid_collision + 1 + ! Setup new bodies allocate(plnew, mold=pl) call plnew%setup(nfrag, param) @@ -746,7 +748,7 @@ subroutine symba_collision_mergeaddsub(system, param, colliders, frag, status) plnew%status(1:nfrag) = NEW_PARTICLE do i = 1, nfrag write(newname, FRAGFMT) frag%id(i) - call plnew%info(i)%set_value(origin_type="Disruption", origin_time=param%t, name=newname, origin_xh=plnew%xh(:,i), origin_vh=plnew%vh(:,i), collision_id=system%collision_counter) + call plnew%info(i)%set_value(origin_type="Disruption", origin_time=param%t, name=newname, origin_xh=plnew%xh(:,i), origin_vh=plnew%vh(:,i), collision_id=param%maxid_collision) end do do i = 1, ncolliders if (colliders%idx(i) == ibiggest) then @@ -760,7 +762,7 @@ subroutine symba_collision_mergeaddsub(system, param, colliders, frag, status) plnew%status(1:nfrag) = NEW_PARTICLE do i = 1, nfrag write(newname, FRAGFMT) frag%id(i) - call plnew%info(i)%set_value(origin_type="Supercatastrophic", origin_time=param%t, name=newname, origin_xh=plnew%xh(:,i), origin_vh=plnew%vh(:,i), collision_id=system%collision_counter) + call plnew%info(i)%set_value(origin_type="Supercatastrophic", origin_time=param%t, name=newname, origin_xh=plnew%xh(:,i), origin_vh=plnew%vh(:,i), collision_id=param%maxid_collision) end do do i = 1, ncolliders if (colliders%idx(i) == ibiggest) then @@ -775,7 +777,7 @@ subroutine symba_collision_mergeaddsub(system, param, colliders, frag, status) plnew%status(1) = OLD_PARTICLE do i = 2, nfrag write(newname, FRAGFMT) frag%id(i) - call plnew%info(i)%set_value(origin_type="Hit and run fragment", origin_time=param%t, name=newname, origin_xh=plnew%xh(:,i), origin_vh=plnew%vh(:,i), collision_id=system%collision_counter) + call plnew%info(i)%set_value(origin_type="Hit and run fragment", origin_time=param%t, name=newname, origin_xh=plnew%xh(:,i), origin_vh=plnew%vh(:,i), collision_id=param%maxid_collision) end do do i = 1, ncolliders if (colliders%idx(i) == ibiggest) cycle From de8a3acdd6baee21ab8b9a476b0b1501dc9c0e41 Mon Sep 17 00:00:00 2001 From: Carlisle April Wishard Date: Fri, 15 Oct 2021 14:44:08 -0400 Subject: [PATCH 5/7] set maxid_collision = 0 at initialization --- src/modules/swiftest_classes.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/swiftest_classes.f90 b/src/modules/swiftest_classes.f90 index 914366708..523adcfb1 100644 --- a/src/modules/swiftest_classes.f90 +++ b/src/modules/swiftest_classes.f90 @@ -96,7 +96,7 @@ module swiftest_classes integer(I4B) :: integrator = UNKNOWN_INTEGRATOR !! Symbolic name of the nbody integrator used character(STRMAX) :: param_file_name = "param.in" !! The default name of the parameter input file integer(I4B) :: maxid = -1 !! The current maximum particle id number - integer(I4B) :: maxid_collision = -1 !! The current maximum collision id number + integer(I4B) :: maxid_collision = 0 !! The current maximum collision id number real(DP) :: t0 = -1.0_DP !! Integration start time real(DP) :: t = -1.0_DP !! Integration current time real(DP) :: tstop = -1.0_DP !! Integration stop time From 282cef3f641466b0ae0fa9a822d049eee5eb308a Mon Sep 17 00:00:00 2001 From: David A Minton Date: Wed, 20 Oct 2021 13:28:25 -0400 Subject: [PATCH 6/7] Cleaned up compiler flags and switched to Intel --- Makefile.Defines | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/Makefile.Defines b/Makefile.Defines index 4cbf3e055..2efa6d70a 100644 --- a/Makefile.Defines +++ b/Makefile.Defines @@ -45,11 +45,6 @@ COLLRESOLVE_HOME = $(ROOT_DIR)/collresolve/ # DO NOT include in FFLAGS the "-c" option to compile object only # this is done explicitly as needed in the Makefile -ADVIXE_DIR = /apps/cent7/intel/advisor_2019 -ADVIXE_FLAGS = -g -O2 -qopt-report=5 -vecabi=cmdtarget -simd -shared-intel -debug inline-debug-info -DTBB_DEBUG -DTBB_USE_THREADING_TOOLS -xhost -traceback - -VTUNE_FLAGS = -g -O2 -qopt-report=5 -simd -shared-intel -qopenmp -debug inline-debug-info -parallel-source-info=2 -parallel -DTBB_DEBUG -DTBB_USE_THREADING_TOOLS -qopenmp -fp-model no-except -mp1 -xhost -traceback -#Be sure to set the environment variable KMP_FORKJOIN_FRAMES=1 for OpenMP debuging in vtune IDEBUG = -O0 -init=snan,arrays -nogen-interfaces -no-pie -no-ftz -fpe-all=0 -g -traceback -mp1 -fp-model strict -fpe0 -debug all -align all -pad -ip -prec-div -prec-sqrt -assume protect-parens -CB -no-wrap-margin STRICTREAL = -fp-model=precise -prec-div -prec-sqrt -assume protect-parens @@ -66,28 +61,26 @@ GMEM = -fsanitize-address-use-after-scope -fstack-check -fsanitize=bounds-stri GWARNINGS = -Wall -Warray-bounds -Wimplicit-interface -Wextra -Warray-temporaries GPRODUCTION = -O3 -ffree-line-length-none $(GPAR) -#MKL_ROOT = /apps/spack/bell/apps/intel-parallel-studio/cluster.2019.5-intel-19.0.5-4brgqlf/mkl/lib -#IMKL = -I$(MKLROOT)/include -#LMKL = -L$(MKLROOT)/lib/intel64 -qopt-matmul +MKL_ROOT = /apps/spack/bell/apps/intel-parallel-studio/cluster.2019.5-intel-19.0.5-4brgqlf/mkl/lib +IMKL = -I$(MKLROOT)/include +LMKL = -L$(MKLROOT)/lib/intel64 -qopt-matmul -#FFLAGS = $(IDEBUG) $(SIMDVEC) $(PAR) -#FFASTFLAGS = $(IDEBUG) $(SIMDVEC) $(PAR) -#FSTRICTFLAGS = $(IPRODUCTION) $(STRICTREAL) $(OPTREPORT) #$(ADVIXE_FLAGS) -#FFLAGS = $(IPRODUCTION) -fp-model=fast $(OPTREPORT) #$(ADVIXE_FLAGS) -#FORTRAN = ifort -#AR = xiar +FSTRICTFLAGS = $(IPRODUCTION) $(STRICTREAL) $(OPTREPORT) +FFLAGS = $(IPRODUCTION) -fp-model=fast $(OPTREPORT) +FORTRAN = ifort +AR = xiar -FORTRAN = gfortran +#FORTRAN = gfortran #FFLAGS = $(GDEBUG) $(GMEM) #$(GPAR) -FFLAGS = $(GPRODUCTION) #-g -fbacktrace -fcheck=all #-Wall -FSTRICTFLAGS= $(GPRODUCTION) #-g -fbacktrace -fcheck=all #-Wall -AR = ar +#FFLAGS = $(GPRODUCTION) #-g -fbacktrace -fcheck=all #-Wall +#FSTRICTFLAGS= $(GPRODUCTION) #-g -fbacktrace -fcheck=all #-Wall +#AR = ar # DO NOT include in CFLAGS the "-c" option to compile object only # this is done explicitly as needed in the Makefile -#CC = icc -CC = cc +CC = icc +#CC = cc CFLAGS = -O3 -w -m64 -std=c99 64_BIT_REALS = -r8 From 4ba22ae672625e447ec472c8547fbb3e51da7c50 Mon Sep 17 00:00:00 2001 From: David Minton Date: Thu, 21 Oct 2021 10:09:20 -0400 Subject: [PATCH 7/7] Updated python write methods to include the new parameter variables. --- python/swiftest/swiftest/io.py | 15 ++++++++++++++- python/swiftest/swiftest/simulation_class.py | 8 +++++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/python/swiftest/swiftest/io.py b/python/swiftest/swiftest/io.py index 3c2151413..ca0f29374 100644 --- a/python/swiftest/swiftest/io.py +++ b/python/swiftest/swiftest/io.py @@ -58,6 +58,11 @@ def read_swiftest_param(param_file_name, param): param['ISTEP_OUT'] = int(param['ISTEP_OUT']) param['ISTEP_DUMP'] = int(param['ISTEP_DUMP']) + param['OUT_TYPE'] = param['OUT_TYPE'].upper() + param['OUT_FORM'] = param['OUT_FORM'].upper() + param['OUT_STAT'] = param['OUT_STAT'].upper() + param['IN_TYPE'] = param['IN_TYPE'].upper() + param['IN_FORM'] = param['IN_FORM'].upper() param['T0'] = real2float(param['T0']) param['TSTOP'] = real2float(param['TSTOP']) param['DT'] = real2float(param['DT']) @@ -74,11 +79,14 @@ def read_swiftest_param(param_file_name, param): param['RHILL_PRESENT'] = param['RHILL_PRESENT'].upper() param['FRAGMENTATION'] = param['FRAGMENTATION'].upper() if param['FRAGMENTATION'] == 'YES' and param['PARTICLE_OUT'] == '': - param['PARTICLE_OUT'] = 'particle.dat' + if param['OUT_TYPE'] == 'REAL8' or param['OUT_TYPE'] == 'REAL4': + param['PARTICLE_OUT'] = 'particle.dat' param['ROTATION'] = param['ROTATION'].upper() param['TIDES'] = param['TIDES'].upper() param['ENERGY'] = param['ENERGY'].upper() param['GR'] = param['GR'].upper() + param['INTERACTION_LOOPS'] = param['INTERACTION_LOOPS'].upper() + param['ENCOUNTER_CHECK'] = param['ENCOUNTER_CHECK'].upper() if 'GMTINY' in param: param['GMTINY'] = real2float(param['GMTINY']) except IOError: @@ -1517,6 +1525,11 @@ def swiftest2swifter_param(swiftest_param, J2=0.0, J4=0.0): swifter_param['OUT_TYPE'] = 'REAL4' if swifter_param['OUT_FORM'] == 'XVEL': swifter_param['OUT_FORM'] = 'XV' + IN_FORM = swifter_param.pop("IN_FORM", None) + INTERACTION_LOOPS = swifter_param.pop("INTERACTION_LOOPS", None) + ENCOUNTER_CHECK = swifter_param.pop("ENCOUNTER_CHECK", None) + ENCOUNTER_CHECK_PLPL = swifter_param.pop("ENCOUNTER_CHECK_PLPL", None) + ENCOUNTER_CHECK_PLTP = swifter_param.pop("ENCOUNTER_CHECK_PLTP", None) swifter_param['! VERSION'] = "Swifter parameter file converted from Swiftest" return swifter_param diff --git a/python/swiftest/swiftest/simulation_class.py b/python/swiftest/swiftest/simulation_class.py index b2736c96d..79c17b086 100644 --- a/python/swiftest/swiftest/simulation_class.py +++ b/python/swiftest/swiftest/simulation_class.py @@ -34,12 +34,12 @@ def __init__(self, codename="Swiftest", param_file=""): 'CHK_QMIN': "-1.0", 'CHK_QMIN_COORD': "HELIO", 'CHK_QMIN_RANGE': "-1.0 -1.0", - 'ENC_OUT': "enc.dat", + 'ENC_OUT': "", 'MU2KG': constants.MSun, 'TU2S': constants.JD2S, 'DU2M': constants.AU2M, 'EXTRA_FORCE': "NO", - 'DISCARD_OUT': "discard.out", + 'DISCARD_OUT': "", 'PARTICLE_OUT' : "", 'BIG_DISCARD': "NO", 'CHK_CLOSE': "YES", @@ -48,7 +48,9 @@ def __init__(self, codename="Swiftest", param_file=""): 'ROTATION': "NO", 'TIDES': "NO", 'ENERGY': "NO", - 'GR': "NO", + 'GR': "YES", + 'INTERACTION_LOOPS': "ADAPTIVE", + 'ENCOUNTER_CHECK': "ADAPTIVE" } self.codename = codename if param_file != "" :