Fix initialize

This commit is contained in:
amandalund 2017-03-27 17:33:28 -05:00
parent 60dcf722bd
commit 8b1953b7e1
4 changed files with 16 additions and 18 deletions

View file

@ -445,6 +445,7 @@ contains
OUT_BACK, IN_BACK, IN_FRONT, OUT_FRONT, &
OUT_BOTTOM, IN_BOTTOM, IN_TOP, OUT_TOP /)
end if
filt % current = .true.
! Add filter to dictionary
call filter_dict % add_key(filt % id, i_filt)
end select

View file

@ -432,7 +432,6 @@ contains
integer :: id ! user-specified id
type(Cell), pointer :: c => null()
class(Lattice), pointer :: lat => null()
type(TallyObject), pointer :: t => null()
do i = 1, n_cells
! =======================================================================
@ -567,26 +566,20 @@ contains
end do
TALLY_LOOP: do i = 1, n_tallies
t => tallies(i)
! =======================================================================
! ADJUST INDICES FOR EACH TALLY FILTER
! =======================================================================
! ADJUST INDICES FOR EACH TALLY FILTER
FILTER_LOOP: do i = 1, n_filters
FILTER_LOOP: do j = 1, size(t % filter)
select type(filt => filters(i) % obj)
type is (SurfaceFilter)
! Check if this is a surface filter only for surface currents
if (.not. filt % current) call filt % initialize()
class default
call filt % initialize()
end select
select type(filt => filters(t % filter(j)) % obj)
type is (SurfaceFilter)
! Check if this is a surface filter only for surface currents
if (.not. any(t % score_bins == SCORE_CURRENT)) &
call filt % initialize()
class default
call filt % initialize()
end select
end do FILTER_LOOP
end do TALLY_LOOP
end do FILTER_LOOP
end subroutine adjust_indices

View file

@ -3842,6 +3842,7 @@ contains
OUT_BOTTOM, OUT_TOP, IN_LEFT, IN_RIGHT, IN_BACK, &
IN_FRONT, IN_BOTTOM, IN_TOP /)
end if
filt % current = .true.
end select
t % find_filter(FILTER_SURFACE) = n_filter

View file

@ -103,6 +103,9 @@ module tally_filter
!===============================================================================
type, extends(TallyFilter) :: SurfaceFilter
integer, allocatable :: surfaces(:)
! True if this filter is used for surface currents
logical :: current = .false.
contains
procedure :: get_next_bin => get_next_bin_surface
procedure :: to_statepoint => to_statepoint_surface