diff --git a/src/cmfd_input.F90 b/src/cmfd_input.F90 index 17e7d9ad36..94a6b21e55 100644 --- a/src/cmfd_input.F90 +++ b/src/cmfd_input.F90 @@ -11,7 +11,8 @@ contains !=============================================================================== subroutine read_cmfd_xml() - + + use error use global use output use string @@ -28,13 +29,14 @@ contains filename = trim(path_input) // "cmfd.xml" inquire(FILE=filename, EXIST=file_exists) if (.not. file_exists) then - ! Since a tallies.xml file is optional, no error is issued here + ! CMFD is optional unless it is in on from settings + if (cmfd_on) then + message = "No CMFD XML file, '" // trim(filename) // "' does not exist!" + call fatal_error() + end if return else - ! turn cmfd flag on -! cmfd_on = .TRUE. - ! tell user message = "Reading CMFD XML file..." call write_message(5) diff --git a/src/input_xml.F90 b/src/input_xml.F90 index cebc58e910..3b8e6bda3f 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -815,7 +815,11 @@ contains n_meshes = 0 else n_user_meshes = size(mesh_) - n_meshes = n_user_meshes + n_cmfd_meshes + if (cmfd_on) then + n_meshes = n_user_meshes + n_cmfd_meshes + else + n_meshes = n_user_meshes + end if allocate(meshes(n_meshes)) end if @@ -826,7 +830,11 @@ contains call warning() else n_user_tallies = size(tally_) - if (cmfd_on) n_tallies = n_user_tallies + n_cmfd_tallies + if (cmfd_on) then + n_tallies = n_user_tallies + n_cmfd_tallies + else + n_tallies = n_user_tallies + end if allocate(tallies(n_tallies)) end if @@ -1198,9 +1206,15 @@ contains end do ! Determine number of types of tallies - n_analog_tallies = n_user_analog_tallies + n_cmfd_analog_tallies - n_tracklength_tallies = n_user_tracklength_tallies + n_cmfd_tracklength_tallies - n_current_tallies = n_user_current_tallies + n_cmfd_current_tallies + if (cmfd_on) then + n_analog_tallies = n_user_analog_tallies + n_cmfd_analog_tallies + n_tracklength_tallies = n_user_tracklength_tallies + n_cmfd_tracklength_tallies + n_current_tallies = n_user_current_tallies + n_cmfd_current_tallies + else + n_analog_tallies = n_user_analog_tallies + n_tracklength_tallies = n_user_tracklength_tallies + n_current_tallies = n_user_current_tallies + end if ! Allocate list of pointers for tallies by type allocate(analog_tallies(n_analog_tallies))