successfully printed out total cross section from tally object

This commit is contained in:
Bryan Herman 2011-10-28 19:47:53 -04:00
parent 1fee45a858
commit 6c85dc3a25
2 changed files with 33 additions and 1 deletions

View file

@ -1,4 +1,5 @@
cmfd_utils.o: global.o
cmfd_utils.o: mesh.o
cross_section.o: constants.o
cross_section.o: cross_section_header.o

View file

@ -1,6 +1,8 @@
module cmfd_utils
use global
use mesh, only: mesh_indices_to_bin
use tally_header, only: TallyObject, TallyScore
implicit none
@ -47,7 +49,36 @@ contains
subroutine print_cmfd()
write(7,*) 'hello world'
integer :: bins(TALLY_TYPES) ! bin for tally_types, for filters
integer :: ijk(3) ! indices for mesh cell where tally is
integer :: score_index ! index in tally score to get value
real(8) :: tally_val ! value of tally being extracted
type(TallyObject), pointer :: t ! pointer for a tally object
type(StructuredMesh), pointer :: m ! pointer for mesh object
! associate pointers with objects
t => tallies(1)
m => meshes(t % mesh)
! set all bins to 1
bins = 1
! get mesh indices, first we will first force to 1,1,1
ijk = (/ 1, 1, 1 /)
! apply filters, here we will just try a mesh filter first
bins(T_MESH) = mesh_indices_to_bin(m,ijk)
! calculate score index from bins
score_index = sum((bins - 1) * t%stride) + 1
! get value from tally object
tally_val = t%scores(score_index,1)%val
! write value to file
write(7,*) "Tally value is:",tally_val
end subroutine print_cmfd