Skip to content

Commit

Permalink
Merge pull request #569 from paulromano/summary-offset-fix
Browse files Browse the repository at this point in the history
Check if offsets are allocated before writing to summary.h5
  • Loading branch information
smharper committed Jan 21, 2016
2 parents 82ac44b + c9d790e commit 5b11e6a
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/summary.F90
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ subroutine write_summary()
call write_attribute_string(file_id, "n_batches", &
"description", "Total number of batches")

! Write eigenvalue information
! Write eigenvalue information
if (run_mode == MODE_EIGENVALUE) then
! write number of inactive/active batches and generations/batch
call write_dataset(file_id, "n_inactive", n_inactive)
Expand Down Expand Up @@ -174,8 +174,10 @@ subroutine write_geometry(file_id)
case (CELL_FILL)
call write_dataset(cell_group, "fill_type", "universe")
call write_dataset(cell_group, "fill", universes(c%fill)%id)
if (size(c%offset) > 0) then
call write_dataset(cell_group, "offset", c%offset)
if (allocated(c%offset)) then
if (size(c%offset) > 0) then
call write_dataset(cell_group, "offset", c%offset)
end if
end if

if (allocated(c%translation)) then
Expand Down Expand Up @@ -362,8 +364,10 @@ subroutine write_geometry(file_id)
call write_dataset(lattice_group, "outer", lat%outer)

! Write distribcell offsets if present
if (size(lat%offset) > 0) then
call write_dataset(lattice_group, "offsets", lat%offset)
if (allocated(lat%offset)) then
if (size(lat%offset) > 0) then
call write_dataset(lattice_group, "offsets", lat%offset)
end if
end if

select type (lat)
Expand Down

0 comments on commit 5b11e6a

Please sign in to comment.