From 728cacf690dcb796154fcaf31c5b43aa2e14ff6e Mon Sep 17 00:00:00 2001 From: David A Minton Date: Fri, 20 Aug 2021 00:22:46 -0400 Subject: [PATCH] Fixed issues reading in orbital element initial conditions --- examples/in_form_el/cb.in | 5 +++ examples/in_form_el/param.in | 35 +++++++++++++++++ examples/in_form_el/pl.in | 33 ++++++++++++++++ examples/in_form_el/tp.in | 76 ++++++++++++++++++++++++++++++++++++ src/io/io.f90 | 5 --- src/setup/setup.f90 | 4 ++ 6 files changed, 153 insertions(+), 5 deletions(-) create mode 100644 examples/in_form_el/cb.in create mode 100644 examples/in_form_el/param.in create mode 100644 examples/in_form_el/pl.in create mode 100644 examples/in_form_el/tp.in diff --git a/examples/in_form_el/cb.in b/examples/in_form_el/cb.in new file mode 100644 index 000000000..673a79459 --- /dev/null +++ b/examples/in_form_el/cb.in @@ -0,0 +1,5 @@ +0 +0.0002959122081920778 +0.004650467260962157 +4.7535806948127355e-12 +-2.2473967953572827e-18 diff --git a/examples/in_form_el/param.in b/examples/in_form_el/param.in new file mode 100644 index 000000000..409cd2d2b --- /dev/null +++ b/examples/in_form_el/param.in @@ -0,0 +1,35 @@ +! VERSION Swiftest parameter input from file param.in +T0 0.0 +TSTOP 365250000000.0 +DT 5.0 +ISTEP_OUT 7305000 +ISTEP_DUMP 7305000 +OUT_FORM EL +OUT_TYPE REAL8 +OUT_STAT REPLACE +IN_TYPE ASCII +PL_IN pl.in +TP_IN tp.in +CB_IN cb.in +BIN_OUT bin.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 +MU2KG 1.988409870698051e+30 +TU2S 86400.0 +DU2M 149597870700.0 +IN_FORM EL +ENC_OUT enc.dat +EXTRA_FORCE NO +DISCARD_OUT discard.out +BIG_DISCARD NO +CHK_CLOSE YES +RHILL_PRESENT YES +FRAGMENTATION NO +ROTATION NO +TIDES NO +ENERGY NO +GR YES diff --git a/examples/in_form_el/pl.in b/examples/in_form_el/pl.in new file mode 100644 index 000000000..55748b408 --- /dev/null +++ b/examples/in_form_el/pl.in @@ -0,0 +1,33 @@ +8 +1 4.9125474498983625e-11 0.0014751256791533402 +1.6306381826061646e-05 +0.38710383731080894 0.24071190040066506 8.640070276952633 +30.683987164281632 57.949871930463694 151.08868778597147 +2 7.243452483873647e-10 0.0067591154147628296 +4.0453784346544176e-05 +0.7233315774753523 0.02498272794314777 2.4772002857938187 +125.76075677093282 6.742571718202682 350.2972657114627 +3 8.997011382166019e-10 0.010044745408888887 +4.25875607065041e-05 +0.9999904186618421 0.05232751342856539 2.0722848768764717 +113.84624589363827 312.12453079628943 148.9860363695549 +4 9.549535102761465e-11 0.007246758104365299 +2.2657408050928896e-05 +1.5236293140305446 0.005382832120155795 4.468216946001687 +325.6098790099478 152.40711385323957 110.04936074450407 +5 2.825345908631355e-07 0.3552714410085414 +0.0004673261703049093 +5.203095539549931 0.03063821583296288 1.3661365597246853 +113.82182400586191 303.52091573107697 96.03226696213453 +6 8.459715183006416e-08 0.43765112940564116 +0.00038925687730393614 +9.579329287028964 0.08182512713593486 2.54624964218005 +100.32672664745415 306.8523855342038 64.14978871000847 +7 1.2920249163736674e-08 0.4695173932519177 +0.00016953449859497232 +19.185526866180975 0.02725895554029442 0.6468816262831063 +75.84341829565291 203.1828812930829 337.91763726094723 +8 1.5243589003230834e-08 0.7812638143548571 +0.00016458790412449367 +30.033406636357004 0.014808837377897958 1.0172902231424474 +112.31047122167676 61.6982073585126 219.66063286932612 diff --git a/examples/in_form_el/tp.in b/examples/in_form_el/tp.in new file mode 100644 index 000000000..48e97fb82 --- /dev/null +++ b/examples/in_form_el/tp.in @@ -0,0 +1,76 @@ +25 +1030101 +1.9298376430729873 0.012639757841142886 24.991702977377773 +341.74785371597466 248.1210122966632 133.62225322652563 +1030102 +1.9576788467130908 0.027970945719088838 25.55968189226752 +168.9126943096874 174.5978360268346 251.14179333855816 +1030103 +1.967626111006107 0.09226955476091864 1.5279774530000956 +343.6507149897438 15.943105536008861 203.03043240705532 +1030104 +1.9481905063928624 0.0011928078627614026 13.712706682327513 +65.70102045298484 272.5349689212673 248.3878548054673 +1030105 +1.9770133412534745 0.07760502570359305 21.113956523745326 +352.7420976555242 265.31463697173825 90.20915048805514 +1030106 +1.9218154288668319 0.024539743705313734 6.3122997131518 +96.26526838131817 245.40058043017729 203.1458881543752 +1030107 +1.8804043534140047 0.051960914508786316 5.641080857843637 +135.37074231372475 310.57579433118855 92.01889766237802 +1030108 +1.905574620628057 0.0094526649542939 27.795518144975087 +257.055868633706 262.18164024081847 174.33454380356292 +1030109 +1.9610371451706512 0.0642394856575368 11.238178270217231 +155.06613544539204 179.7982091248266 227.65351567825778 +1030110 +1.8442099887042422 0.06774466132861966 7.7755827872476635 +53.89722157548661 231.27772356054047 224.74925586092095 +1030111 +1.918614204096997 0.09311188233380624 22.656238093717935 +8.91787503082778 121.09392635435141 61.064615587866086 +1030112 +1.846083421031052 0.058817512099736215 23.17733139808657 +204.2210767808533 325.0096873835248 80.8104389106319 +1030113 +1.877211316979287 0.09545803603787674 22.75125883423326 +338.55088656488704 260.97440743659024 358.27993618149003 +1030114 +1.847699999560908 0.04422349734135026 24.400107433270254 +175.41066398268853 271.9213024922804 40.10860995923193 +1030115 +1.9693855972875431 0.01087613268562867 18.3688586644925 +288.07225817085316 351.2861239674453 138.17614312177193 +1030116 +1.8499142747340205 0.05785154439430367 18.680424125046468 +170.34777680935684 121.2501486818594 116.63207933400314 +1030117 +1.8484833703421926 0.027361686628703055 12.35340287511839 +77.72361263316543 170.96254103643864 153.80655599509745 +1030118 +1.8844066519945433 0.012253504795668403 28.11812027401767 +5.816089316051807 234.40531004184038 284.0432510837761 +1030119 +1.8321110668963587 0.05520820027904241 4.246848772229706 +195.98962278787414 196.26877791689589 296.01468603344676 +1030120 +1.9298252957677076 0.04051603959563857 11.38835718089586 +14.020062127093711 350.7131191785245 61.91415736777295 +1030121 +1.8296584872076656 0.02265081514507832 19.242848763922552 +170.21169721403766 255.88594273947075 131.4644380844818 +1030122 +1.8699958208259342 0.08248881864547655 6.775274873263883 +131.47697608382563 36.70815817760613 166.48187957273242 +1030123 +1.8427387543178881 0.07305783679736073 5.034586865380743 +311.1450141807796 214.40263993828856 332.6408661254218 +1030124 +1.8567511528637752 0.014548178017731906 8.946207161705699 +27.813385444122652 111.5675183218652 201.4816583454089 +1030125 +1.8846946839402372 0.06619567127431686 13.271555732235106 +271.1533808977903 174.59924852630596 257.0822687250529 diff --git a/src/io/io.f90 b/src/io/io.f90 index 5d1aef6df..67d4665ab 100644 --- a/src/io/io.f90 +++ b/src/io/io.f90 @@ -1212,11 +1212,6 @@ module function io_read_frame_system(self, iu, param) result(ierr) goto 667 end if - if (param%in_form == EL) then - call self%pl%el2xv(self%cb) - call self%tp%el2xv(self%cb) - end if - return 667 continue diff --git a/src/setup/setup.f90 b/src/setup/setup.f90 index 0a2664feb..049a0acf3 100644 --- a/src/setup/setup.f90 +++ b/src/setup/setup.f90 @@ -141,6 +141,10 @@ module subroutine setup_initialize_system(self, param) call self%set_msys() call self%pl%set_mu(self%cb) call self%tp%set_mu(self%cb) + if (param%in_form == EL) then + call self%pl%el2xv(self%cb) + call self%tp%el2xv(self%cb) + end if call self%pl%eucl_index() if (.not.param%lrhill_present) call self%pl%set_rhill(self%cb) self%pl%lfirst = param%lfirstkick