Change the way surface source reading flag is given

This commit is contained in:
YoungHui Park 2020-10-09 00:46:15 -05:00
parent c4b39cdb6c
commit f2bdae918c
2 changed files with 19 additions and 5 deletions

View file

@ -646,6 +646,25 @@ void read_settings_xml()
}
}
// Check if the user has specified to read surface source.
if (check_for_node(root, "surf_src_read")) {
surf_src_read = true;
// Get surface source read node
xml_node node_ss = root.child("surf_src_read");
settings::path_source = "surface_source.h5";
// Check if the user has specified different file for surface source reading
if (check_for_node(node_ss, "file")) {
settings::path_source = get_node_value(node_ss, "file", false, true);
}
// Check if surface source file exists
if (!file_exists(settings::path_source)) {
fatal_error(fmt::format("Source file '{}' does not exist.",
settings::path_source));
}
}
// 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

View file

@ -81,11 +81,6 @@ IndependentSource::IndependentSource(pugi::xml_node node)
settings::path_source));
}
// Check if it is a surface source file.
if (check_for_node(node, "surf_src_read")) {
settings::surf_src_read = get_node_value_bool(node, "surf_src_read");
}
} else if (check_for_node(node, "library")) {
settings::path_source_library = get_node_value(node, "library", false, true);
if (!file_exists(settings::path_source_library)) {