From ac2c500933489ed51e7df825ff5478162f29f09d Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 5 Oct 2011 22:48:23 -0400 Subject: [PATCH] Fixed mesh tallies for two dimensions and increased xml-fortran buffer length to 10000. --- src/mesh.f90 | 11 +++++++++-- src/tally.f90 | 9 +++++++-- src/xml-fortran/xmlparse.f90 | 2 +- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/mesh.f90 b/src/mesh.f90 index 92b7cfe3f5..76025c93cc 100644 --- a/src/mesh.f90 +++ b/src/mesh.f90 @@ -17,17 +17,24 @@ contains integer, intent(out) :: bin logical, intent(out) :: in_mesh + integer :: n integer, allocatable :: ijk(:) + ! Get number of dimensions + n = m % n_dimension + ! Create indices array same size as xyz - allocate(ijk(size(xyz))) + allocate(ijk(n)) ! Determine indices - call get_mesh_indices(m, xyz, ijk, in_mesh) + call get_mesh_indices(m, xyz(1:n), ijk, in_mesh) ! Convert indices to bin bin = mesh_indices_to_bin(m, ijk) + ! Release memory for ijk + deallocate(ijk) + end subroutine get_mesh_bin !=============================================================================== diff --git a/src/tally.f90 b/src/tally.f90 index fa8a2bbe3c..697fc31a4a 100644 --- a/src/tally.f90 +++ b/src/tally.f90 @@ -726,8 +726,13 @@ contains m => meshes(t % mesh) allocate(ijk(m % n_dimension)) call bin_to_mesh_indices(m, bin, ijk) - label = "Index (" // trim(int_to_str(ijk(1))) // ", " // & - trim(int_to_str(ijk(2))) // ", " // trim(int_to_str(ijk(3))) // ")" + if (m % n_dimension == 2) then + label = "Index (" // trim(int_to_str(ijk(1))) // ", " // & + trim(int_to_str(ijk(2))) // ")" + elseif (m % n_dimension == 3) then + label = "Index (" // trim(int_to_str(ijk(1))) // ", " // & + trim(int_to_str(ijk(2))) // ", " // trim(int_to_str(ijk(3))) // ")" + end if case (T_ENERGYIN) E0 = t % energy_in(bin) E1 = t % energy_in(bin + 1) diff --git a/src/xml-fortran/xmlparse.f90 b/src/xml-fortran/xmlparse.f90 index b54b2c41ec..1e3b5e5627 100644 --- a/src/xml-fortran/xmlparse.f90 +++ b/src/xml-fortran/xmlparse.f90 @@ -46,7 +46,7 @@ module xmlparse implicit none - integer, parameter :: XML_BUFFER_LENGTH = 1000 + integer, parameter :: XML_BUFFER_LENGTH = 10000 !=============================================================================== ! XML_PARSE defines the data type that holds the parser information