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

Commit

Permalink
Merge branch 'master' into debug
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Feb 25, 2022
2 parents 858003f + 0c86301 commit 7c13d5e
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 42 deletions.
24 changes: 8 additions & 16 deletions Makefile.Defines
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,14 @@ SWIFTEST_HOME = $(ROOT_DIR)
USER_MODULES =
COLLRESOLVE_HOME = $(ROOT_DIR)/collresolve/

#NETCDF_FORTRAN_HOME = /home/daminton/local


# Compiler definitions

# DO NOT include in FFLAGS the "-c" option to compile object only
# this is done explicitly as needed in the Makefile
ADVIXE_INCLUDE = -I$(ADVISOR_2019_DIR)/include/intel64
ADVIXE_LINK = -L$(ADVISOR_2019_DIR)/lib64 -ladvisor
ADVIXE_FLAGS = -g -O2 -qopt-report=5 -vecabi=cmdtarget -simd -shared-intel -debug inline-debug-info -DTBB_DEBUG -DTBB_USE_THREADING_TOOLS -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 -qopt-matmul -fp-model strict -fpe0 -debug all -align all -pad -ip -prec-div -prec-sqrt -assume protect-parens -CB -no-wrap-margin
IDEBUG = -O0 -init=snan,arrays -nogen-interfaces -no-pie -no-ftz -fpe-all=0 -g -traceback -mp1 -qopt-matmul -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
SIMDVEC = -simd -xhost -align all -pad -assume contiguous_assumed_shape -vecabi=cmdtarget -fp-model no-except -fma
PAR = -qopenmp -parallel -parallel-source-info=2
SIMDVEC = -simd -xhost -align all -assume contiguous_assumed_shape -vecabi=cmdtarget -fp-model no-except -fma
PAR = -qopenmp -parallel
HEAPARR = -heap-arrays 4194304
OPTREPORT = -qopt-report=5
IPRODUCTION = -no-wrap-margin -O3 -qopt-prefetch=0 -qopt-matmul -sox $(PAR) $(SIMDVEC) #$(HEAPARR)
Expand All @@ -69,13 +61,13 @@ GWARNINGS = -Wall -Warray-bounds -Wimplicit-interface -Wextra -Warray-temporari
GPRODUCTION = -O3 -ffree-line-length-none $(GPAR)

INCLUDES = -I$(SWIFTEST_HOME)/include -I$(NETCDF_FORTRAN_HOME)/include -I$(MKLROOT)/include
LINKS = -L$(MKLROOT)/lib/intel64 -L$(NETCDF_FORTRAN_HOME)/lib -lswiftest -lnetcdf -lnetcdff -qopt-matmul $(PAR)
LINKS = -L$(MKLROOT)/lib/intel64 -L$(NETCDF_FORTRAN_HOME)/lib -lswiftest -lnetcdf -lnetcdff -qopt-matmul $(PAR)

FSTRICTFLAGS = $(IDEBUG) $(SIMDVEC) $(PAR)
FFLAGS = $(IDEBUG) $(SIMDVEC) $(PAR)
FSTRICTFLAGS = $(IPRODUCTION) $(STRICTREAL)
FFLAGS = $(IPRODUCTION) -fp-model=fast

# FSTRICTFLAGS = $(ADVIXE_FLAGS) $(PAR) $(SIMDVEC) $(STRICTREAL)
# FFLAGS = $(ADVIXE_FLAGS) $(PAR) $(SIMDVEC) -fp-model=fast
FSTRICTFLAGS = $(ADVIXE_FLAGS) $(PAR) $(SIMDVEC) $(STRICTREAL)
FFLAGS = $(ADVIXE_FLAGS) $(PAR) $(SIMDVEC) -fp-model=fast
FORTRAN = ifort
AR = xiar
CC = icc
Expand Down
14 changes: 7 additions & 7 deletions examples/symba_gr_test/pl.swiftest.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,31 @@ Mercury 6.5537098095653139645e-06 0.0014751260185578720416
1.6306381826061645943e-05
0.38709858430953941744 0.20562340108970009189 7.0033025080013837638
48.296118373786072198 29.20442403952453958 338.33948746828792764
Venus 9.663313399581537916e-05 0.006759120024335718617
Venus 9.6633133995815381836e-05 0.0067591200243357198168
4.0453784346544178454e-05
0.72332975797361009906 0.006717605698865438367 3.3944392733422819042
76.60235891771118588 54.960379460829607012 200.47893395506480374
Earth 0.000120026935827952453094 0.0100446292823340959596
Earth 0.000120026935827952456416 0.010044629282334098766
4.25875607065040958e-05
0.99999048745432228547 0.016714003765458580048 0.0036378626088630029375
175.0251726002310022 287.96196288125747742 114.34829340424269617
Mars 1.2739802010675941456e-05 0.0072466212625671651507
Mars 1.2739802010675941808e-05 0.0072466212625671666944
2.265740805092889601e-05
1.5237119255895350545 0.09344151133508207807 1.8474416735579008986
49.47285721247470036 286.7379771285890797 209.33967734771380265
Jupiter 0.037692251088985676735 0.35521688466465032753
Jupiter 0.03769225108898567778 0.35521688466465040944
0.00046732617030490929307
5.202727800851599582 0.048244977116379678117 1.3036311345700750675
100.51925884330809424 273.58984028825142332 129.5536700659941971
Saturn 0.011285899820091272997 0.43538665458575465117
Saturn 0.01128589982009127331 0.43538665458575473606
0.00038925687730393611812
9.532011952667287957 0.054863298704333408884 2.4879063632803011252
113.63057816762059815 339.54673564023909194 290.89958065689040723
Uranus 0.0017236589478267730203 0.46987236554736915505
Uranus 0.001723658947826773068 0.46987236554736924745
0.00016953449859497231466
19.244988382902359803 0.0479617494230129629 0.7730102596086204647
74.012580980165793676 93.595549122802268016 262.86586372775150267
Neptune 0.0020336100526728302319 0.7749718408665498732
Neptune 0.0020336100526728302882 0.7749718408665500834
0.000164587904124493665
30.038959912561129073 0.008955570159296157365 1.7711193542961420899
131.82211597488270627 284.47484279411258967 308.45137222693909962
Expand Down
37 changes: 19 additions & 18 deletions python/swiftest/swiftest/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import xarray as xr
import sys
import tempfile
import re

newfeaturelist = ("FRAGMENTATION", "ROTATION", "TIDES", "ENERGY", "GR", "YARKOVSKY", "YORP", "IN_FORM")

Expand Down Expand Up @@ -1157,11 +1158,11 @@ def swift2swifter(swift_param, plname="", tpname="", conversion_questions={}):
try:
with open(swift_param['PL_IN'], 'r') as plold:
line = plold.readline()
i_list = [i for i in line.split(" ") if i.strip()]
i_list = [i for i in re.split(' +|\t',line) if i.strip()]
npl = int(i_list[0])
print(npl, file=plnew)
line = plold.readline()
i_list = [i for i in line.split(" ") if i.strip()]
i_list = [i for i in re.split(' +|\t',line) if i.strip()]
GMcb = real2float(i_list[0])
if swift_param['L1'] == "T":
swifter_param['J2'] = real2float(i_list[1])
Expand All @@ -1176,7 +1177,7 @@ def swift2swifter(swift_param, plname="", tpname="", conversion_questions={}):
line = plold.readline()
for n in range(1, npl): # Loop over planets
line = plold.readline()
i_list = [i for i in line.split(" ") if i.strip()]
i_list = [i for i in re.split(' +|\t',line) if i.strip()]
GMpl = real2float(i_list[0])
if isSyMBA:
rhill = real2float(i_list[1])
Expand All @@ -1192,13 +1193,13 @@ def swift2swifter(swift_param, plname="", tpname="", conversion_questions={}):
if swifter_param['CHK_CLOSE'] == 'YES':
print(plrad, file=plnew)
line = plold.readline()
i_list = [i for i in line.split(" ") if i.strip()]
i_list = [i for i in re.split(' +|\t',line) if i.strip()]
xh = real2float(i_list[0])
yh = real2float(i_list[1])
zh = real2float(i_list[2])
print(xh, yh, zh, file=plnew)
line = plold.readline()
i_list = [i for i in line.split(" ") if i.strip()]
i_list = [i for i in re.split(' +|\t',line) if i.strip()]
vhx = real2float(i_list[0])
vhy = real2float(i_list[1])
vhz = real2float(i_list[2])
Expand All @@ -1225,19 +1226,19 @@ def swift2swifter(swift_param, plname="", tpname="", conversion_questions={}):
print(f'Writing out new TP file: {swifter_param["TP_IN"]}')
with open(swift_param['TP_IN'], 'r') as tpold:
line = tpold.readline()
i_list = [i for i in line.split(" ") if i.strip()]
i_list = [i for i in re.split(' +|\t',line) if i.strip()]
ntp = int(i_list[0])
print(ntp, file=tpnew)
for n in range(0, ntp): # Loop over test particles
print(npl + n + 1, file=tpnew)
line = tpold.readline()
i_list = [i for i in line.split(" ") if i.strip()]
i_list = [i for i in re.split(' +|\t',line) if i.strip()]
xh = real2float(i_list[0])
yh = real2float(i_list[1])
zh = real2float(i_list[2])
print(xh, yh, zh, file=tpnew)
line = tpold.readline()
i_list = [i for i in line.split(" ") if i.strip()]
i_list = [i for i in re.split(' +|\t',line) if i.strip()]
vhx = real2float(i_list[0])
vhy = real2float(i_list[1])
vhz = real2float(i_list[2])
Expand Down Expand Up @@ -1275,17 +1276,17 @@ def swifter2swiftest(swifter_param, plname="", tpname="", cbname="", conversion_
with open(swifter_param['PL_IN'], 'r') as plold:
line = plold.readline()
line = line.split("!")[0] # Ignore comments
i_list = [i for i in line.split(" ") if i.strip()]
i_list = [i for i in re.split(' +|\t',line) if i.strip()]
npl = int(i_list[0])
print(npl - 1, file=plnew)
line = plold.readline()
i_list = [i for i in line.split(" ") if i.strip()]
i_list = [i for i in re.split(' +|\t',line) if i.strip()]
GMcb = real2float(i_list[1]) # Store central body GM for later
line = plold.readline() # Ignore the two zero vector lines
line = plold.readline()
for n in range(1, npl): # Loop over planets
line = plold.readline()
i_list = [i for i in line.split(" ") if i.strip()]
i_list = [i for i in re.split(' +|\t',line) if i.strip()]
idnum = int(i_list[0])
GMpl = real2float(i_list[1])
if swifter_param['RHILL_PRESENT'] == 'YES':
Expand All @@ -1295,17 +1296,17 @@ def swifter2swiftest(swifter_param, plname="", tpname="", cbname="", conversion_
print(idnum, GMpl, file=plnew)
if swifter_param['CHK_CLOSE'] == 'YES':
line = plold.readline()
i_list = [i for i in line.split(" ") if i.strip()]
i_list = [i for i in re.split(' +|\t',line) if i.strip()]
plrad = real2float(i_list[0])
print(plrad, file=plnew)
line = plold.readline()
i_list = [i for i in line.split(" ") if i.strip()]
i_list = [i for i in re.split(' +|\t',line) if i.strip()]
xh = real2float(i_list[0])
yh = real2float(i_list[1])
zh = real2float(i_list[2])
print(xh, yh, zh, file=plnew)
line = plold.readline()
i_list = [i for i in line.split(" ") if i.strip()]
i_list = [i for i in re.split(' +|\t',line) if i.strip()]
vhx = real2float(i_list[0])
vhy = real2float(i_list[1])
vhz = real2float(i_list[2])
Expand Down Expand Up @@ -1334,22 +1335,22 @@ def swifter2swiftest(swifter_param, plname="", tpname="", cbname="", conversion_
with open(swifter_param['TP_IN'], 'r') as tpold:
line = tpold.readline()
line = line.split("!")[0] # Ignore comments
i_list = [i for i in line.split(" ") if i.strip()]
i_list = [i for i in re.split(' +|\t',line) if i.strip()]
ntp = int(i_list[0])
print(ntp, file=tpnew)
for n in range(0, ntp): # Loop over test particles
line = tpold.readline()
i_list = [i for i in line.split(" ") if i.strip()]
i_list = [i for i in re.split(' +|\t',line) if i.strip()]
name = int(i_list[0])
print(name, file=tpnew)
line = tpold.readline()
i_list = [i for i in line.split(" ") if i.strip()]
i_list = [i for i in re.split(' +|\t',line) if i.strip()]
xh = real2float(i_list[0])
yh = real2float(i_list[1])
zh = real2float(i_list[2])
print(xh, yh, zh, file=tpnew)
line = tpold.readline()
i_list = [i for i in line.split(" ") if i.strip()]
i_list = [i for i in re.split(' +|\t',line) if i.strip()]
vhx = real2float(i_list[0])
vhy = real2float(i_list[1])
vhz = real2float(i_list[2])
Expand Down
2 changes: 1 addition & 1 deletion python/swiftest/swiftest/simulation_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class Simulation:
"""
This is a class that define the basic Swift/Swifter/Swiftest simulation object
This is a class that defines the basic Swift/Swifter/Swiftest simulation object
"""
def __init__(self, codename="Swiftest", param_file="", readbin=True):
self.ds = xr.Dataset()
Expand Down

0 comments on commit 7c13d5e

Please sign in to comment.