From be6b7ea90db74750558d66afbe6e23aebd4130d5 Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Mon, 6 Jan 2014 09:41:48 -0500 Subject: [PATCH] added check if source is written to statepoint file that the statepoint will exist --- src/input_xml.F90 | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/src/input_xml.F90 b/src/input_xml.F90 index e8d602c356..cc12d0c41d 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -57,6 +57,7 @@ contains integer, allocatable :: temp_int_array(:) integer(8) :: temp_long logical :: file_exists + logical :: check character(MAX_FILE_LEN) :: env_variable character(MAX_WORD_LEN) :: type character(MAX_LINE_LEN) :: filename @@ -612,13 +613,13 @@ contains call statepoint_batch % add(n_batches) end if - ! Check if the user has specified to write state points + ! Check if the user has specified to write source points if (check_for_node(doc, "source_point")) then ! Get pointer to source_point node call get_node_ptr(doc, "source_point", node_sp) - ! Determine number of batches at which to store state points + ! Determine number of batches at which to store source points if (check_for_node(node_sp, "batches")) then n_source_points = get_arraysize_integer(node_sp, "batches") else @@ -626,7 +627,7 @@ contains end if if (n_source_points > 0) then - ! User gave specific batches to write state points + ! User gave specific batches to write source points allocate(temp_int_array(n_source_points)) call get_node_array(node_sp, "batches", temp_int_array) do i = 1, n_source_points @@ -634,14 +635,14 @@ contains end do deallocate(temp_int_array) elseif (check_for_node(node_sp, "interval")) then - ! User gave an interval for writing state points + ! User gave an interval for writing source points call get_node_value(node_sp, "interval", temp_int) n_source_points = n_batches / temp_int do i = 1, n_source_points call sourcepoint_batch % add(temp_int * i) end do else - ! If neither were specified, write state point at last batch + ! If neither were specified, write source points with state points n_source_points = n_state_points do i = 1, n_state_points call sourcepoint_batch % add(statepoint_batch % get_item(i)) @@ -658,8 +659,8 @@ contains if (check_for_node(node_sp, "source_write")) then call get_node_value(node_sp, "source_write", temp_str) call lower_case(temp_str) - if (trim(temp_str) == 'true' .or. & - trim(temp_str) == '1') source_separate = .true. + if (trim(temp_str) == 'false' .or. & + trim(temp_str) == '0') source_write = .false. end if if (check_for_node(node_sp, "overwrite_latest")) then call get_node_value(node_sp, "overwrite_latest", temp_str) @@ -677,6 +678,21 @@ contains end do end if + ! If source is not seperate and is to be written out in the statepoint file, + ! make sure that the sourcepoint batch numbers are contained in the + ! statepoint list + if (.not. source_separate) then + check = .true. + do i = 1, n_source_points + check = statepoint_batch % contains(sourcepoint_batch % get_item(i)) + if (.not. check) then + message = 'Sourcepoint batches are not a subset& + & of statepoint batches.' + call fatal_error() + end if + end do + end if + ! Check if the user has specified to not reduce tallies at the end of every ! batch if (check_for_node(doc, "no_reduce")) then