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

Commit

Permalink
Fixed Swifter->Swiftest parameter conversion for case where NetCDF an…
Browse files Browse the repository at this point in the history
…d XVEL are in specified
  • Loading branch information
daminton committed Sep 23, 2021
1 parent d85bff4 commit 64252b5
Show file tree
Hide file tree
Showing 9 changed files with 98 additions and 81 deletions.
2 changes: 1 addition & 1 deletion examples/helio_swifter_comparison/cb.swiftest.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
0
Sun
39.476926408897626
0.004650467260962157
4.7535806948127355e-12
Expand Down
2 changes: 1 addition & 1 deletion examples/helio_swifter_comparison/param.swifter.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ IN_TYPE ASCII
PL_IN pl.swifter.in
TP_IN tp.swifter.in
BIN_OUT bin.swifter.dat
ENC_OUT enc.swifter.dat
CHK_QMIN 0.004650467260962157
CHK_RMIN 0.004650467260962157
CHK_RMAX 1000.0
CHK_EJECT 1000.0
CHK_QMIN_COORD HELIO
CHK_QMIN_RANGE 0.004650467260962157 1000.0
ENC_OUT enc.swifter.dat
EXTRA_FORCE NO
BIG_DISCARD NO
CHK_CLOSE YES
Expand Down
8 changes: 5 additions & 3 deletions examples/helio_swifter_comparison/param.swiftest.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ TSTOP 1.0
DT 0.0006844626967830253
ISTEP_OUT 1
ISTEP_DUMP 1
OUT_FORM XV
OUT_TYPE REAL8
OUT_FORM XVEL
OUT_TYPE NETCDF_DOUBLE
OUT_STAT UNKNOWN
IN_TYPE ASCII
PL_IN pl.swiftest.in
TP_IN tp.swiftest.in
CB_IN cb.swiftest.in
BIN_OUT bin.swiftest.dat
ENC_OUT enc.swiftest.dat
CHK_QMIN 0.004650467260962157
CHK_RMIN 0.004650467260962157
CHK_RMAX 1000.0
Expand All @@ -22,7 +21,10 @@ CHK_QMIN_RANGE 0.004650467260962157 1000.0
MU2KG 1.988409870698051e+30
TU2S 31557600.0
DU2M 149597870700.0
IN_FORM EL
ENC_OUT enc.swiftest.dat
EXTRA_FORCE NO
DISCARD_OUT discard.out
BIG_DISCARD NO
CHK_CLOSE YES
RHILL_PRESENT YES
Expand Down
50 changes: 25 additions & 25 deletions examples/helio_swifter_comparison/pl.swifter.in
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
9
0 39.476926408897625196
0 39.476926408897626
0.0 0.0 0.0
0.0 0.0 0.0
1 6.5537098095653139645e-06 0.001475124456355905224
1 6.5537098095653139645e-06 0.0014751320469864830743
1.6306381826061645943e-05
-0.30949970210807342674 0.1619004125820537876 0.041620272188990829754
-6.8742992150644793847 -8.672423996611946485 -0.078109307586001638286
2 9.663313399581537916e-05 0.006759069616556246028
0.25597748680933402055 -0.33873157013416782535 -0.051160436706398457196
6.1515614442706225157 6.693373063190126291 -0.017305148628664950593
2 9.663313399581537916e-05 0.0067591015124708249373
4.0453784346544178454e-05
-0.5567137338251560985 -0.46074173273652380134 0.02580196630219121906
4.6580776303108450487 -5.726444072926637749 -0.3473859047161406309
3 0.000120026935827952453094 0.010044908171483009529
0.31726034651636542128 -0.654711054374790713 -0.027292938884777531716
6.598488376677801111 3.1963353072519729466 -0.33689924099817045804
3 0.000120026935827952453094 0.010044886970936247304
4.25875607065040958e-05
0.6978790186886838498 -0.73607603319120218366 3.261671020506711323e-05
4.4579240279134950613 4.300011122687349501 -0.00022055769049333364448
4 1.2739802010675941456e-05 0.0072466797341124641736
1.0035242101099290934 -0.0018228334577166870837 -3.6653532112110000198e-06
-0.09070203147464428398 6.2603556827487729817 -0.00030066016029169661568
4 1.2739802010675941456e-05 0.0072464547040638876134
2.265740805092889601e-05
-1.617661473167097963 0.38314370807747849534 0.04771055403546069218
-0.98751874613118001086 -4.5371239937302254657 -0.07086074102213555221
5 0.037692251088985676735 0.35527079166215922855
-1.6246010829214110327 -0.22657397469775839016 0.035102757644925722258
0.8960028670481912773 -4.6255927366612961593 -0.118919639419818187306
5 0.037692251088985676735 0.355270418186049151
0.00046732617030490929307
4.1527454588897487753 -2.8347492039446908763 -0.081136554176388195336
1.5225069137843642898 2.4087104911325327961 -0.044067446366273183833
6 0.011285899820091272997 0.43765832419088212185
4.3414830724724824407 -2.51086598242009007 -0.086704432177356224876
1.3483266539369778604 2.5183130150315082463 -0.04062579121197158367
6 0.011285899820091272997 0.43766612292716386504
0.00038925687730393611812
6.39471595410062843 -7.621162747287802297 -0.121992225877669294154
1.4493167787574136286 1.3075474785896286071 -0.08039429377859412155
7 0.0017236589478267730203 0.46960112247450473807
6.5829270711489096257 -7.4466885388333317053 -0.1325136240669045895
1.4148318095568700728 1.3475938908840546106 -0.079718098761849415056
7 0.0017236589478267730203 0.46974626380654876733
0.00016953449859497231466
14.793135356927480828 13.074218343364380601 -0.14311846037737518955
-0.9605086875596024784 1.0118431725941020164 0.016148779866732710198
8 0.0020336100526728302319 0.78136567314580814177
14.666242725889420129 13.206619035005820351 -0.14098973299186590147
-0.97063485833896719253 1.0031115306266739172 0.016248131244499269076
8 0.0020336100526728302319 0.7815278251043273693
0.000164587904124493665
29.568629894896030663 -4.5543028991960081697 -0.58771107137394917874
0.16867624969736024011 1.1427992197933557251 -0.027387722828706092838
29.590408344240941574 -4.4040527861079086236 -0.5913025789369640295
0.16275481312443448273 1.1438129826052378228 -0.027269849433711815306
48 changes: 24 additions & 24 deletions examples/helio_swifter_comparison/pl.swiftest.in
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
8
1 6.5537098095653139645e-06 0.001475124456355905224
Mercury 6.5537098095653139645e-06 0.0014751320469864830743
1.6306381826061645943e-05
-0.30949970210807342674 0.1619004125820537876 0.041620272188990829754
-6.8742992150644793847 -8.672423996611946485 -0.078109307586001638286
2 9.663313399581537916e-05 0.006759069616556246028
0.3871001662734879778 0.20562290678137279398 7.0035924891789802516
48.303217155090528934 29.188931936657478872 249.51513505827190897
Venus 9.663313399581537916e-05 0.0067591015124708249373
4.0453784346544178454e-05
-0.5567137338251560985 -0.46074173273652380134 0.02580196630219121906
4.6580776303108450487 -5.726444072926637749 -0.3473859047161406309
3 0.000120026935827952453094 0.010044908171483009529
0.72332777691946326115 0.006778976236186400224 3.3945045285598101081
76.62168299033216101 55.13031240212004036 163.93804780753200134
Earth 0.000120026935827952453094 0.010044886970936247304
4.25875607065040958e-05
0.6978790186886838498 -0.73607603319120218366 3.261671020506711323e-05
4.4579240279134950613 4.300011122687349501 -0.00022055769049333364448
4 1.2739802010675941456e-05 0.0072466797341124641736
1.0000161415769019957 0.016676412290744600103 0.0027631154255367738025
175.55232875760239608 287.42522734499760872 258.78495415394627344
Mars 1.2739802010675941456e-05 0.0072464547040638876134
2.265740805092889601e-05
-1.617661473167097963 0.38314370807747849534 0.04771055403546069218
-0.98751874613118001086 -4.5371239937302254657 -0.07086074102213555221
5 0.037692251088985676735 0.35527079166215922855
1.523676904140427002 0.09336889523077140929 1.8479174535355760156
49.49048416488570723 286.71297337264127236 217.69847566206189526
Jupiter 0.037692251088985676735 0.355270418186049151
0.00046732617030490929307
4.1527454588897487753 -2.8347492039446908763 -0.081136554176388195336
1.5225069137843642898 2.4087104911325327961 -0.044067446366273183833
6 0.011285899820091272997 0.43765832419088212185
5.203511886158586286 0.04851730533676239243 1.3035664078742539296
100.51660414853159864 273.38583632465582696 319.82047460791568483
Saturn 0.011285899820091272997 0.43766612292716386504
0.00038925687730393611812
6.39471595410062843 -7.621162747287802297 -0.121992225877669294154
1.4493167787574136286 1.3075474785896286071 -0.08039429377859412155
7 0.0017236589478267730203 0.46960112247450473807
9.581916834333245703 0.052275407242262622587 2.4862549750808580207
113.59523415390539469 335.6043567212101948 226.4432833007888064
Uranus 0.0017236589478267730203 0.46974626380654876733
0.00016953449859497231466
14.793135356927480828 13.074218343364380601 -0.14311846037737518955
-0.9605086875596024784 1.0118431725941020164 0.016148779866732710198
8 0.0020336100526728302319 0.78136567314580814177
19.23982351960097148 0.044242611285930592835 0.77036564121123352056
74.09449253346330977 95.642912088788392566 236.35401257802050168
Neptune 0.0020336100526728302319 0.7815278251043273693
0.000164587904124493665
29.568629894896030663 -4.5543028991960081697 -0.58771107137394917874
0.16867624969736024011 1.1427992197933557251 -0.027387722828706092838
30.293078755751320585 0.013606718417359980194 1.7689422408080119897
131.74363516600720914 246.0153226740773107 334.47147806471997455
16 changes: 8 additions & 8 deletions examples/helio_swifter_comparison/tp.swifter.in
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
4
101
2.1159283340247889704 1.8593322968487970837 -0.33108647801775120678
-2.557303042640355446 2.5920133227445458545 0.5530693963730075664
1.7496059999633410964 2.170163391141847864 -0.2537726760879844834
-3.0064589998644978604 2.1233488530690124423 0.6210068204130407379
102
3.055528708824450046 -0.9023759798915096386 0.36193041623852567623
0.4122422441588732561 2.6115158464246720372 -1.8437451126910543971
3.0772345391474851262 -0.5509101822792066283 0.11666058691376969547
-0.08868603569822111026 2.7292630488987525612 -1.882742859645719835
103
-0.26900389298636068203 -3.1374127668516589296 0.7234488489303841918
3.0956076496295565968 0.17648254651685860603 -0.16591700615421532186
0.13917497353384339354 -3.081984978409241016 0.69426813140927812196
3.105664664763373206 0.67090307556352112164 -0.2786153399455880027
104
-1.9061083760262669262 -1.0793924233562111059 0.26419511130887440853
2.3545884478521155142 -3.673223720899393644 -0.17666743480430943436
-1.5389664718057010084 -1.5223401530194009545 0.23276670506845731357
3.2083305098906780644 -3.027143636331455024 -0.2998683055841925141
24 changes: 12 additions & 12 deletions examples/helio_swifter_comparison/tp.swiftest.in
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
4
101
2.1159283340247889704 1.8593322968487970837 -0.33108647801775120678
-2.557303042640355446 2.5920133227445458545 0.5530693963730075664
102
3.055528708824450046 -0.9023759798915096386 0.36193041623852567623
0.4122422441588732561 2.6115158464246720372 -1.8437451126910543971
103
-0.26900389298636068203 -3.1374127668516589296 0.7234488489303841918
3.0956076496295565968 0.17648254651685860603 -0.16591700615421532186
104
-1.9061083760262669262 -1.0793924233562111059 0.26419511130887440853
2.3545884478521155142 -3.673223720899393644 -0.17666743480430943436
Ceres
2.765747739047986986 0.07842442286391371198 10.58812680413526941
80.267870472138739046 73.70681387423925912 265.5864733899878729
Pallas
2.7728732614124069755 0.22985557009005991302 34.91360509225025055
172.91485570077549028 310.5371254957265137 247.03377107355748876
Juno
2.6683517962774989662 0.2569403610937920912 12.991505775900760611
169.85134752220179166 247.97718553048909484 234.12051491952391302
Vesta
2.3614342874418641216 0.08829242551000027195 7.1415846765059312062
103.80497351959969876 151.06131421642410828 334.46222015317840714

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions python/swiftest/swiftest/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -1501,6 +1501,12 @@ def swiftest2swifter_param(swiftest_param, J2=0.0, J4=0.0):
swifter_param['J4'] = J4
if swifter_param['OUT_STAT'] == "REPLACE":
swifter_param['OUT_STAT'] = "UNKNOWN"
if swifter_param['OUT_TYPE'] == 'NETCDF_DOUBLE':
swifter_param['OUT_TYPE'] = 'REAL8'
elif swifter_param['OUT_TYPE'] == 'NETCDF_FLOAT':
swifter_param['OUT_TYPE'] = 'REAL4'
if swifter_param['OUT_FORM'] == 'XVEL':
swifter_param['OUT_FORM'] = 'XV'
swifter_param['! VERSION'] = "Swifter parameter file converted from Swiftest"

return swifter_param
Expand Down

0 comments on commit 64252b5

Please sign in to comment.