From 825f037dbad82f04fb17c01d066a91828f43efb9 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 9 Jun 2015 15:51:18 +0700 Subject: [PATCH] Call LocalCoord % reset() in gfortran-4.6 compatible manner --- src/geometry.F90 | 9 +++------ src/particle_header.F90 | 5 ++++- src/plot.F90 | 1 - 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/geometry.F90 b/src/geometry.F90 index dc8c4adc3f..6f6b5f20b1 100644 --- a/src/geometry.F90 +++ b/src/geometry.F90 @@ -134,8 +134,10 @@ contains class(Lattice), pointer :: lat ! pointer to lattice type(Universe), pointer :: univ ! universe to search in + do j = p % n_coord + 1, MAX_COORD + call p % coord(j) % reset() + end do j = p % n_coord - call p % coord(j+1:) % reset() ! set size of list to search if (present(search_cells)) then @@ -486,7 +488,6 @@ contains ! the lower universes. p % n_coord = 1 - call p % coord(2:) % reset() call find_cell(p, found) if (.not. found) then call handle_lost_particle(p, "Couldn't find particle after reflecting& @@ -530,7 +531,6 @@ contains ! Remove lower coordinate levels and assignment of surface p % surface = NONE p % n_coord = 1 - call p % coord(2:) % reset() call find_cell(p, found) if (run_mode /= MODE_PLOTTING .and. (.not. found)) then @@ -540,7 +540,6 @@ contains ! forward a tiny bit it should fix the problem. p % n_coord = 1 - call p % coord(2:) % reset() p % coord(1) % xyz = p % coord(1) % xyz + TINY_BIT * p % coord(1) % uvw call find_cell(p, found) @@ -594,7 +593,6 @@ contains OUTSIDE_LAT: if (.not. lat % are_valid_indices(i_xyz)) then ! The particle is outside the lattice. Search for it from base coord p % n_coord = 1 - call p % coord(2:) % reset() call find_cell(p, found) if (.not. found) then call handle_lost_particle(p, "Could not locate particle " & @@ -615,7 +613,6 @@ contains ! Remove lower coordinates p % n_coord = 1 - call p % coord(2:) % reset() ! Search for particle call find_cell(p, found) diff --git a/src/particle_header.F90 b/src/particle_header.F90 index 30737ef525..1aabc25703 100644 --- a/src/particle_header.F90 +++ b/src/particle_header.F90 @@ -128,9 +128,12 @@ contains subroutine clear_particle(this) class(Particle) :: this + integer :: i ! remove any coordinate levels - call this % coord(:) % reset() + do i = 1, MAX_COORD + call this % coord(i) % reset() + end do end subroutine clear_particle diff --git a/src/plot.F90 b/src/plot.F90 index 1a27fff671..f761b40400 100644 --- a/src/plot.F90 +++ b/src/plot.F90 @@ -62,7 +62,6 @@ contains type(Cell), pointer :: c p % n_coord = 1 - call p % coord(2:) % reset() call find_cell(p, found_cell) j = p % n_coord