From be564393d1030efb21c06d0b6791089262737a7e Mon Sep 17 00:00:00 2001 From: David Minton Date: Mon, 24 May 2021 10:21:57 -0400 Subject: [PATCH] Fixed array bounds bugs --- src/io/io_dump_pl.f90 | 4 ++-- src/symba/symba_rearray.f90 | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/io/io_dump_pl.f90 b/src/io/io_dump_pl.f90 index 28c1d0f75..35504aef2 100644 --- a/src/io/io_dump_pl.f90 +++ b/src/io/io_dump_pl.f90 @@ -64,8 +64,8 @@ SUBROUTINE io_dump_pl(npl, swiftest_plA, param) write(LUN) swiftest_plA%xh(:,1:npl) write(LUN) swiftest_plA%vh(:,1:npl) if (param%lrotation) THEN - write(LUN) swiftest_plA%Ip(:,:) - write(LUN) swiftest_plA%rot(:,:) + write(LUN) swiftest_plA%Ip(:,1:npl) + write(LUN) swiftest_plA%rot(:,1:npl) end if close(LUN) idx = idx + 1 diff --git a/src/symba/symba_rearray.f90 b/src/symba/symba_rearray.f90 index 53ea421ab..b550b82f6 100644 --- a/src/symba/symba_rearray.f90 +++ b/src/symba/symba_rearray.f90 @@ -132,19 +132,19 @@ subroutine symba_rearray(t, npl, nplm, ntp, nsppl, nsptp, symba_plA, symba_tpA, ! Create the particle information and set the status flags of all new particles allocate(add_l_pl(npl)) - where ((symba_plA%helio%swiftest%status(:) == DISRUPTION) .or. & - (symba_plA%helio%swiftest%status(:) == SUPERCATASTROPHIC) .or. & - (symba_plA%helio%swiftest%status(:) == HIT_AND_RUN)) - symba_plA%helio%swiftest%info(:)%origin_time = t - symba_plA%helio%swiftest%info(:)%origin_xh(1) = symba_plA%helio%swiftest%xh(1,:) - symba_plA%helio%swiftest%info(:)%origin_xh(2) = symba_plA%helio%swiftest%xh(2,:) - symba_plA%helio%swiftest%info(:)%origin_xh(3) = symba_plA%helio%swiftest%xh(3,:) - symba_plA%helio%swiftest%info(:)%origin_vh(1) = symba_plA%helio%swiftest%vh(1,:) - symba_plA%helio%swiftest%info(:)%origin_vh(2) = symba_plA%helio%swiftest%vh(2,:) - symba_plA%helio%swiftest%info(:)%origin_vh(3) = symba_plA%helio%swiftest%vh(3,:) - add_l_pl(:) = .true. + where ((symba_plA%helio%swiftest%status(1:npl) == DISRUPTION) .or. & + (symba_plA%helio%swiftest%status(1:npl) == SUPERCATASTROPHIC) .or. & + (symba_plA%helio%swiftest%status(1:npl) == HIT_AND_RUN)) + symba_plA%helio%swiftest%info(1:npl)%origin_time = t + symba_plA%helio%swiftest%info(1:npl)%origin_xh(1) = symba_plA%helio%swiftest%xh(1,1:npl) + symba_plA%helio%swiftest%info(1:npl)%origin_xh(2) = symba_plA%helio%swiftest%xh(2,1:npl) + symba_plA%helio%swiftest%info(1:npl)%origin_xh(3) = symba_plA%helio%swiftest%xh(3,1:npl) + symba_plA%helio%swiftest%info(1:npl)%origin_vh(1) = symba_plA%helio%swiftest%vh(1,1:npl) + symba_plA%helio%swiftest%info(1:npl)%origin_vh(2) = symba_plA%helio%swiftest%vh(2,1:npl) + symba_plA%helio%swiftest%info(1:npl)%origin_vh(3) = symba_plA%helio%swiftest%vh(3,1:npl) + add_l_pl(1:npl) = .true. elsewhere - add_l_pl(:) = .false. + add_l_pl(1:npl) = .false. end where ! check for duplicate names and fix if ncessary