From 2b1e58b3ab539ee90de4187a0e996d3fc48ae8be Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 29 Sep 2011 22:22:49 -0400 Subject: [PATCH] Completed bin_to_mesh_indices subroutine. Added dependency of mesh on mesh_header. --- src/DEPENDENCIES | 2 ++ src/mesh.f90 | 18 ++++++++++++++++++ src/output.f90 | 5 ++++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/DEPENDENCIES b/src/DEPENDENCIES index b110dfb1a5..2cee0f12c9 100644 --- a/src/DEPENDENCIES +++ b/src/DEPENDENCIES @@ -109,6 +109,8 @@ main.o: string.o main.o: tally.o main.o: timing.o +mesh.o: mesh_header.o + mpi_routines.o: constants.o mpi_routines.o: error.o mpi_routines.o: global.o diff --git a/src/mesh.f90 b/src/mesh.f90 index 0e90f1f9c0..5dd137ccfd 100644 --- a/src/mesh.f90 +++ b/src/mesh.f90 @@ -91,6 +91,24 @@ contains integer, intent(in) :: bin integer, intent(out) :: ijk(:) + integer :: n_y + integer :: n_z + integer :: temp_bin + + if (m % n_dimension == 2) then + n_y = m % dimension(2) + + ijk(1) = (bin - 1)/n_y + 1 + ijk(2) = mod(bin - 1, n_y) + 1 + else if (m % n_dimension == 3) then + n_y = m % dimension(2) + n_z = m % dimension(3) + + ijk(1) = (bin - 1)/(n_y*n_z) + 1 + ijk(2) = mod(bin - 1, n_y*n_z)/n_z + 1 + ijk(3) = mod(bin - 1, n_z) + 1 + end if + end subroutine bin_to_mesh_indices end module mesh diff --git a/src/output.f90 b/src/output.f90 index b9fbc63ec1..7b23d636ee 100644 --- a/src/output.f90 +++ b/src/output.f90 @@ -562,7 +562,10 @@ contains string = "" uid = t % mesh sm => meshes(uid) - string = trim(string) // ' ' // trim(int_to_str(sm % uid)) + string = trim(string) // ' ' // trim(int_to_str(sm % dimension(1))) + do i = 2, sm % n_dimension + string = trim(string) // ' x ' // trim(int_to_str(sm % dimension(i))) + end do write(ou, *) ' Mesh Bins:' // trim(string) end if