From 623844d47afdb9226c7aee756fc7d3454a348416 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 18 Jul 2012 19:06:38 -0400 Subject: [PATCH] Added checks for no cells or surfaces. --- src/input_xml.F90 | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 7750bcc846..a7334523e4 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -358,8 +358,16 @@ contains ! Parse geometry.xml file call read_xml_file_geometry_t(filename) - ! Allocate cells array + ! Get number of tags n_cells = size(cell_) + + ! Check for no cells + if (n_cells == 0) then + message = "No cells found in geometry.xml!" + call fatal_error() + end if + + ! Allocate cells array allocate(cells(n_cells)) n_universes = 0 @@ -440,8 +448,16 @@ contains ! ========================================================================== ! READ SURFACES FROM GEOMETRY.XML - ! Allocate cells array + ! Get number of tags n_surfaces = size(surface_) + + ! Check for no surfaces + if (n_surfaces == 0) then + message = "No surfaces found in geometry.xml!" + call fatal_error() + end if + + ! Allocate cells array allocate(surfaces(n_surfaces)) do i = 1, n_surfaces