diff --git a/src/swiftest/swiftest_util.f90 b/src/swiftest/swiftest_util.f90 index 05f9383ee..74a795856 100644 --- a/src/swiftest/swiftest_util.f90 +++ b/src/swiftest/swiftest_util.f90 @@ -31,6 +31,8 @@ module subroutine swiftest_util_append_arr_char_string(arr, source, nold, nsrc, if (.not. allocated(source)) return nnew = count(lsource_mask(1:nsrc)) + if (nnew == 0) return + if (.not.allocated(arr)) then allocate(arr(nold+nnew)) else @@ -59,6 +61,8 @@ module subroutine swiftest_util_append_arr_DP(arr, source, nold, nsrc, lsource_m if (.not. allocated(source)) return nnew = count(lsource_mask(1:nsrc)) + if (nnew == 0) return + if (.not.allocated(arr)) then allocate(arr(nold+nnew)) else @@ -87,6 +91,8 @@ module subroutine swiftest_util_append_arr_DPvec(arr, source, nold, nsrc, lsourc if (.not. allocated(source)) return nnew = count(lsource_mask(1:nsrc)) + if (nnew == 0) return + if (.not.allocated(arr)) then allocate(arr(NDIM,nold+nnew)) else @@ -117,6 +123,8 @@ module subroutine swiftest_util_append_arr_I4B(arr, source, nold, nsrc, lsource_ if (.not. allocated(source)) return nnew = count(lsource_mask(1:nsrc)) + if (nnew == 0) return + if (.not.allocated(arr)) then allocate(arr(nold+nnew)) else @@ -146,6 +154,8 @@ module subroutine swiftest_util_append_arr_info(arr, source, nold, nsrc, lsource if (.not. allocated(source)) return nnew = count(lsource_mask(1:nsrc)) + if (nnew == 0) return + if (.not.allocated(arr)) then allocate(arr(nold+nnew)) else @@ -178,6 +188,8 @@ module subroutine swiftest_util_append_arr_kin(arr, source, nold, nsrc, lsource_ if (.not. allocated(source)) return nnew = count(lsource_mask(1:nsrc)) + if (nnew == 0) return + if (.not.allocated(arr)) then allocate(arr(nold+nnew)) else @@ -206,6 +218,8 @@ module subroutine swiftest_util_append_arr_logical(arr, source, nold, nsrc, lsou if (.not. allocated(source)) return nnew = count(lsource_mask(1:nsrc)) + if (nnew == 0) return + if (.not.allocated(arr)) then allocate(arr(nold+nnew)) else