From dafb978b66f0cc7e8e0776b2d1310f71be4b7e9f Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 25 Apr 2013 18:49:34 -0400 Subject: [PATCH] Added option in settings.xml. --- docs/source/usersguide/input.rst | 9 +++++++++ src/input_xml.F90 | 9 +++++++++ src/templates/settings.rnc | 2 ++ src/templates/settings_t.xml | 1 + 4 files changed, 21 insertions(+) diff --git a/docs/source/usersguide/input.rst b/docs/source/usersguide/input.rst index 3571f500f1..fbb97b44c8 100644 --- a/docs/source/usersguide/input.rst +++ b/docs/source/usersguide/input.rst @@ -212,6 +212,15 @@ sections summary file to be written, this element should be given as: *Default*: "tallies" +```` Element +------------------------- + +The ```` element specifies an absolute or relative path where all +output files should be written to. The specified path must exist or else OpenMC +will abort. + + *Default*: Current working directory + ```` Element --------------------- diff --git a/src/input_xml.F90 b/src/input_xml.F90 index c07fe6a5c3..13ff553a92 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -71,6 +71,7 @@ contains ! Initialize XML scalar variables cross_sections_ = '' + output_path_ = '' verbosity_ = 0 energy_grid_ = 'union' seed_ = 0_8 @@ -101,6 +102,14 @@ contains path_cross_sections = trim(cross_sections_) end if + ! Set output directory if a path has been specified on the + ! element + if (len_trim(output_path_) > 0) then + path_output = output_path_ + if (.not. ends_with(path_output, "/")) & + path_output = trim(path_output) // "/" + end if + ! Make sure that either criticality or fixed source was specified if (eigenvalue_ % batches == 0 .and. fixed_source_ % batches == 0 & .and. criticality_ % batches == 0) then diff --git a/src/templates/settings.rnc b/src/templates/settings.rnc index a83bb6b778..47dd690bcc 100644 --- a/src/templates/settings.rnc +++ b/src/templates/settings.rnc @@ -43,6 +43,8 @@ element settings { element output { list { ( "summary" | "cross_sections" | "tallies" )+ } }? & + element output_path { xsd:string { maxLength = "255" } }? & + element ptables { xsd:boolean }? & element run_cmfd { xsd:boolean }? & diff --git a/src/templates/settings_t.xml b/src/templates/settings_t.xml index 48dc494aff..3afa61745e 100644 --- a/src/templates/settings_t.xml +++ b/src/templates/settings_t.xml @@ -51,6 +51,7 @@ +