From c83629a372b4b673af7ee5b4222267481478befb Mon Sep 17 00:00:00 2001 From: Will Boyd Date: Fri, 29 May 2015 14:39:07 -0700 Subject: [PATCH 1/3] Fixed nuclide XML input parsing for tallies to use to_lower --- src/input_xml.F90 | 56 ++++++++++++++++++++--------------------------- 1 file changed, 24 insertions(+), 32 deletions(-) diff --git a/src/input_xml.F90 b/src/input_xml.F90 index f9f4ad58e..08718519c 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -2542,49 +2542,41 @@ contains n_words = get_arraysize_string(node_tal, "nuclides") allocate(t % nuclide_bins(n_words)) do j = 1, n_words + ! Check if total material was specified if (trim(sarray(j)) == 'total') then t % nuclide_bins(j) = -1 cycle end if - ! Check if xs specifier was given - if (ends_with(sarray(j), 'c')) then - word = sarray(j) - else - if (default_xs == '') then - ! No default cross section specified, search through nuclides - pair_list => nuclide_dict % keys() - do while (associated(pair_list)) - if (starts_with(pair_list % key, & - sarray(j))) then - word = pair_list % key(1:150) - exit - end if + ! If a specific nuclide was specified + word = to_lower(sarray(j)) - ! Advance to next - pair_list => pair_list % next - end do + ! Append default_xs specifier to nuclide if needed + if ((default_xs /= '') .and. (.not. ends_with(sarray(j), 'c'))) then + word = word // "." // default_xs + end if - ! Check if no nuclide was found - if (.not. associated(pair_list)) then - call fatal_error("Could not find the nuclide " & - &// trim(sarray(j)) // " specified in tally " & - &// trim(to_str(t % id)) // " in any material.") - end if - deallocate(pair_list) - else - ! Set nuclide to default xs - word = trim(sarray(j)) // "." // default_xs + ! Search through nuclides + pair_list => nuclide_dict % keys() + do while (associated(pair_list)) + call write_message(pair_list % key) + if (starts_with(pair_list % key, word)) then + word = pair_list % key(1:150) + exit end if - end if - ! Check to make sure nuclide specified is in problem - if (.not. nuclide_dict % has_key(to_lower(word))) then - call fatal_error("The nuclide " // trim(word) // " from tally " & - &// trim(to_str(t % id)) & - &// " is not present in any material.") + ! Advance to next + pair_list => pair_list % next + end do + + ! Check if no nuclide was found + if (.not. associated(pair_list)) then + call fatal_error("Could not find the nuclide " & + &// trim(word) // " specified in tally " & + &// trim(to_str(t % id)) // " in any material.") end if + deallocate(pair_list) ! Set bin to index in nuclides array t % nuclide_bins(j) = nuclide_dict % get_key(to_lower(word)) From 48afd86f8dabd7599b679c7896f09a551801c13c Mon Sep 17 00:00:00 2001 From: Will Boyd Date: Fri, 29 May 2015 14:46:00 -0700 Subject: [PATCH 2/3] Removed unnecessary to_lower call in tally nuclides parsing --- src/input_xml.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 08718519c..c1e89ce6e 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -2579,7 +2579,7 @@ contains deallocate(pair_list) ! Set bin to index in nuclides array - t % nuclide_bins(j) = nuclide_dict % get_key(to_lower(word)) + t % nuclide_bins(j) = nuclide_dict % get_key(word) end do ! Set number of nuclide bins From 91dc249a993501b03fe33c60848f36437caffa32 Mon Sep 17 00:00:00 2001 From: Will Boyd Date: Sat, 30 May 2015 08:26:12 -0700 Subject: [PATCH 3/3] Removed debugging message in input_xml.F90 for tally nuclides refactor --- src/input_xml.F90 | 1 - 1 file changed, 1 deletion(-) diff --git a/src/input_xml.F90 b/src/input_xml.F90 index c1e89ce6e..b80c82157 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -2560,7 +2560,6 @@ contains ! Search through nuclides pair_list => nuclide_dict % keys() do while (associated(pair_list)) - call write_message(pair_list % key) if (starts_with(pair_list % key, word)) then word = pair_list % key(1:150) exit