From 9413e6127d8add650e773b0b3fea76e9fb9b538b Mon Sep 17 00:00:00 2001 From: David A Minton Date: Thu, 5 Aug 2021 16:39:40 -0400 Subject: [PATCH] Fixed inconsistent io between Python and Fortran codes --- python/swiftest/swiftest/io.py | 4 ++-- src/io/io.f90 | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/python/swiftest/swiftest/io.py b/python/swiftest/swiftest/io.py index ce8b800ce..491376739 100644 --- a/python/swiftest/swiftest/io.py +++ b/python/swiftest/swiftest/io.py @@ -470,8 +470,7 @@ def swiftest_stream(f, param): npl = f.read_ints() ntp = f.read_ints() iout_form = f.read_reals('c') - #cbid = f.read_ints() - cbid = np.array([0]) + cbid = f.read_ints() Mcb = f.read_reals(np.float64) Rcb = f.read_reals(np.float64) J2cb = f.read_reals(np.float64) @@ -495,6 +494,7 @@ def swiftest_stream(f, param): p5 = f.read_reals(np.float64) p6 = f.read_reals(np.float64) Mpl = f.read_reals(np.float64) + Rhill = f.read_reals(np.float64) Rpl = f.read_reals(np.float64) if param['RHILL_PRESENT'] == 'YES': Rhill = f.read_reals(np.float64) diff --git a/src/io/io.f90 b/src/io/io.f90 index 097c6eb5a..a0dd69995 100644 --- a/src/io/io.f90 +++ b/src/io/io.f90 @@ -1350,12 +1350,12 @@ module subroutine io_write_frame_body(self, iu, param) write(iu) pl%rhill(1:n) write(iu) pl%radius(1:n) if (param%lrotation) then - write(iu) pl%rot(1, 1:n) - write(iu) pl%rot(2, 1:n) - write(iu) pl%rot(3, 1:n) write(iu) pl%Ip(1, 1:n) write(iu) pl%Ip(2, 1:n) write(iu) pl%Ip(3, 1:n) + write(iu) pl%rot(1, 1:n) + write(iu) pl%rot(2, 1:n) + write(iu) pl%rot(3, 1:n) end if if (param%ltides) then write(iu) pl%k2(1:n) @@ -1389,12 +1389,12 @@ module subroutine io_write_frame_cb(self, iu, param) write(iu) cb%j2rp2 write(iu) cb%j4rp4 if (param%lrotation) then - write(iu) cb%rot(1) - write(iu) cb%rot(2) - write(iu) cb%rot(3) write(iu) cb%Ip(1) write(iu) cb%Ip(2) write(iu) cb%Ip(3) + write(iu) cb%rot(1) + write(iu) cb%rot(2) + write(iu) cb%rot(3) end if if (param%ltides) then write(iu) cb%k2