diff --git a/include/openmc/nuclide.h b/include/openmc/nuclide.h index be81dd917b..ae6817eeb3 100644 --- a/include/openmc/nuclide.h +++ b/include/openmc/nuclide.h @@ -198,7 +198,7 @@ namespace simulation { // Cross section caches extern NuclideMicroXS* micro_xs; -extern "C" MaterialMacroXS material_xs; +extern MaterialMacroXS material_xs; #pragma omp threadprivate(micro_xs, material_xs) } // namespace simulation diff --git a/include/openmc/settings.h b/include/openmc/settings.h index 1e2b85c15b..e8ff62972e 100644 --- a/include/openmc/settings.h +++ b/include/openmc/settings.h @@ -23,32 +23,32 @@ namespace openmc { namespace settings { // Boolean flags -extern "C" bool assume_separate; //!< assume tallies are spatially separate? -extern "C" bool check_overlaps; //!< check overlaps in geometry? -extern "C" bool confidence_intervals; //!< use confidence intervals for results? -extern "C" bool create_fission_neutrons; //!< create fission neutrons (fixed source)? -extern "C" bool dagmc; //!< indicator of DAGMC geometry -extern "C" bool entropy_on; //!< calculate Shannon entropy? -extern "C" bool legendre_to_tabular; //!< convert Legendre distributions to tabular? -extern bool output_summary; //!< write summary.h5? -extern "C" bool output_tallies; //!< write tallies.out? -extern "C" bool particle_restart_run; //!< particle restart run? -extern "C" bool photon_transport; //!< photon transport turned on? -extern "C" bool reduce_tallies; //!< reduce tallies at end of batch? -extern bool res_scat_on; //!< use resonance upscattering method? -extern "C" bool restart_run; //!< restart run? -extern "C" bool run_CE; //!< run with continuous-energy data? -extern "C" bool source_latest; //!< write latest source at each batch? -extern "C" bool source_separate; //!< write source to separate file? -extern "C" bool source_write; //!< write source in HDF5 files? -extern "C" bool survival_biasing; //!< use survival biasing? -extern "C" bool temperature_multipole; //!< use multipole data? -extern "C" bool trigger_on; //!< tally triggers enabled? -extern "C" bool trigger_predict; //!< predict batches for triggers? -extern bool ufs_on; //!< uniform fission site method on? -extern bool urr_ptables_on; //!< use unresolved resonance prob. tables? -extern "C" bool write_all_tracks; //!< write track files for every particle? -extern "C" bool write_initial_source; //!< write out initial source file? +extern "C" bool assume_separate; //!< assume tallies are spatially separate? +extern bool check_overlaps; //!< check overlaps in geometry? +extern bool confidence_intervals; //!< use confidence intervals for results? +extern bool create_fission_neutrons; //!< create fission neutrons (fixed source)? +extern "C" bool dagmc; //!< indicator of DAGMC geometry +extern bool entropy_on; //!< calculate Shannon entropy? +extern bool legendre_to_tabular; //!< convert Legendre distributions to tabular? +extern bool output_summary; //!< write summary.h5? +extern bool output_tallies; //!< write tallies.out? +extern bool particle_restart_run; //!< particle restart run? +extern "C" bool photon_transport; //!< photon transport turned on? +extern "C" bool reduce_tallies; //!< reduce tallies at end of batch? +extern bool res_scat_on; //!< use resonance upscattering method? +extern bool restart_run; //!< restart run? +extern bool run_CE; //!< run with continuous-energy data? +extern bool source_latest; //!< write latest source at each batch? +extern bool source_separate; //!< write source to separate file? +extern bool source_write; //!< write source in HDF5 files? +extern bool survival_biasing; //!< use survival biasing? +extern bool temperature_multipole; //!< use multipole data? +extern "C" bool trigger_on; //!< tally triggers enabled? +extern bool trigger_predict; //!< predict batches for triggers? +extern bool ufs_on; //!< uniform fission site method on? +extern bool urr_ptables_on; //!< use unresolved resonance prob. tables? +extern bool write_all_tracks; //!< write track files for every particle? +extern bool write_initial_source; //!< write out initial source file? // Paths to various files extern std::string path_cross_sections; //!< path to cross_sections.xml @@ -62,33 +62,33 @@ extern std::string path_statepoint; //!< path to a statepoint file extern int32_t index_entropy_mesh; //!< Index of entropy mesh in global mesh array extern int32_t index_ufs_mesh; //!< Index of UFS mesh in global mesh array -extern "C" int32_t n_batches; //!< number of (inactive+active) batches -extern "C" int32_t n_inactive; //!< number of inactive batches -extern "C" int32_t gen_per_batch; //!< number of generations per batch -extern "C" int64_t n_particles; //!< number of particles per generation +extern int32_t n_batches; //!< number of (inactive+active) batches +extern "C" int32_t n_inactive; //!< number of inactive batches +extern int32_t gen_per_batch; //!< number of generations per batch +extern "C" int64_t n_particles; //!< number of particles per generation -extern int electron_treatment; //!< how to treat secondary electrons -extern "C" std::array energy_cutoff; //!< Energy cutoff in [eV] for each particle type -extern "C" int legendre_to_tabular_points; //!< number of points to convert Legendres -extern "C" int max_order; //!< Maximum Legendre order for multigroup data -extern "C" int n_log_bins; //!< number of bins for logarithmic energy grid -extern "C" int n_max_batches; //!< Maximum number of batches -extern ResScatMethod res_scat_method; //!< resonance upscattering method +extern int electron_treatment; //!< how to treat secondary electrons +extern std::array energy_cutoff; //!< Energy cutoff in [eV] for each particle type +extern int legendre_to_tabular_points; //!< number of points to convert Legendres +extern int max_order; //!< Maximum Legendre order for multigroup data +extern int n_log_bins; //!< number of bins for logarithmic energy grid +extern int n_max_batches; //!< Maximum number of batches +extern ResScatMethod res_scat_method; //!< resonance upscattering method extern double res_scat_energy_min; //!< Min energy in [eV] for res. upscattering extern double res_scat_energy_max; //!< Max energy in [eV] for res. upscattering extern std::vector res_scat_nuclides; //!< Nuclides using res. upscattering treatment extern "C" int run_mode; //!< Run mode (eigenvalue, fixed src, etc.) extern std::unordered_set sourcepoint_batch; //!< Batches when source should be written extern std::unordered_set statepoint_batch; //!< Batches when state should be written -extern "C" int temperature_method; //!< method for choosing temperatures -extern "C" double temperature_tolerance; //!< Tolerance in [K] on choosing temperatures -extern "C" double temperature_default; //!< Default T in [K] -extern "C" std::array temperature_range; //!< Min/max T in [K] over which to load xs -extern "C" int trace_batch; //!< Batch to trace particle on -extern "C" int trace_gen; //!< Generation to trace particle on -extern "C" int64_t trace_particle; //!< Particle ID to enable trace on +extern int temperature_method; //!< method for choosing temperatures +extern double temperature_tolerance; //!< Tolerance in [K] on choosing temperatures +extern double temperature_default; //!< Default T in [K] +extern std::array temperature_range; //!< Min/max T in [K] over which to load xs +extern int trace_batch; //!< Batch to trace particle on +extern int trace_gen; //!< Generation to trace particle on +extern int64_t trace_particle; //!< Particle ID to enable trace on extern std::vector> track_identifiers; //!< Particle numbers for writing tracks -extern "C" int trigger_batch_interval; //!< Batch interval for triggers +extern int trigger_batch_interval; //!< Batch interval for triggers extern "C" int verbosity; //!< How verbose to make output extern double weight_cutoff; //!< Weight cutoff for Russian roulette extern double weight_survive; //!< Survival weight after Russian roulette diff --git a/src/bank_header.F90 b/src/bank_header.F90 index 992d357fb6..995cc6a3ad 100644 --- a/src/bank_header.F90 +++ b/src/bank_header.F90 @@ -19,9 +19,6 @@ module bank_header integer(C_INT) :: particle ! particle type (neutron, photon, etc.) end type Bank - integer(C_INT64_T), bind(C) :: n_bank ! # of sites in fission bank -!$omp threadprivate(n_bank) - interface function openmc_fission_bank(ptr, n) result(err) bind(C) import C_PTR, C_INT64_T, C_INT diff --git a/src/initialize.F90 b/src/initialize.F90 index b51d81b5be..4cef58a814 100644 --- a/src/initialize.F90 +++ b/src/initialize.F90 @@ -12,14 +12,6 @@ module initialize import C_PTR type(C_PTR) :: ptr end function - function path_output_c() result(ptr) bind(C) - import C_PTR - type(C_PTR) :: ptr - end function - function path_particle_restart_c() result(ptr) bind(C) - import C_PTR - type(C_PTR) :: ptr - end function end interface contains @@ -47,10 +39,6 @@ contains else path_input = '' end if - if (.not. is_null(path_particle_restart_c())) then - call c_f_pointer(path_particle_restart_c(), string, [255]) - path_particle_restart = to_f_string(string) - end if end subroutine read_command_line end module initialize diff --git a/src/nuclide_header.F90 b/src/nuclide_header.F90 index 57a283c650..f7fdff531f 100644 --- a/src/nuclide_header.F90 +++ b/src/nuclide_header.F90 @@ -70,8 +70,7 @@ module nuclide_header ! Cross section caches type(NuclideMicroXS), allocatable, target :: micro_xs(:) ! Cache for each nuclide - type(MaterialMacroXS), bind(C) :: material_xs ! Cache for current material -!$omp threadprivate(micro_xs, material_xs) +!$omp threadprivate(micro_xs) interface function nuclides_size() bind(C) result(n) diff --git a/src/settings.F90 b/src/settings.F90 index a9bbb5d31a..b897c8ff92 100644 --- a/src/settings.F90 +++ b/src/settings.F90 @@ -6,88 +6,34 @@ module settings implicit none - ! ============================================================================ - ! ENERGY TREATMENT RELATED VARIABLES - logical(C_BOOL), bind(C, name='run_CE') :: run_CE ! Run in CE mode? - ! ============================================================================ ! CONTINUOUS-ENERGY CROSS SECTION RELATED VARIABLES - ! Default temperature and method for choosing temperatures - integer(C_INT), bind(C) :: temperature_method - logical(C_BOOL), bind(C) :: temperature_multipole - real(C_DOUBLE), bind(C) :: temperature_tolerance - real(C_DOUBLE), bind(C) :: temperature_default - real(C_DOUBLE), bind(C) :: temperature_range(2) - - integer(C_INT), bind(C) :: n_log_bins ! number of bins for logarithmic grid - logical(C_BOOL), bind(C) :: photon_transport - ! ============================================================================ - ! MULTI-GROUP CROSS SECTION RELATED VARIABLES - - ! Maximum Data Order - integer(C_INT), bind(C) :: max_order - - ! Whether or not to convert Legendres to tabulars - logical(C_BOOL), bind(C) :: legendre_to_tabular - - ! Number of points to use in the Legendre to tabular conversion - integer(C_INT), bind(C) :: legendre_to_tabular_points - ! ============================================================================ ! SIMULATION VARIABLES ! Assume all tallies are spatially distinct logical(C_BOOL), bind(C) :: assume_separate - ! Use confidence intervals for results instead of standard deviations - logical(C_BOOL), bind(C) :: confidence_intervals - integer(C_INT64_T), bind(C) :: n_particles ! # of particles per generation - integer(C_INT32_T), bind(C) :: n_batches ! # of batches integer(C_INT32_T), bind(C) :: n_inactive ! # of inactive batches - integer(C_INT32_T), bind(C) :: gen_per_batch ! # of generations per batch - integer(C_INT), bind(C) :: n_max_batches ! max # of batches logical(C_BOOL), bind(C) :: trigger_on ! flag for turning triggers on/off - logical(C_BOOL), bind(C) :: entropy_on - - ! Write source at end of simulation - - ! Variance reduction settins - logical(C_BOOL), bind(C) :: survival_biasing - real(C_DOUBLE), bind(C) :: energy_cutoff(4) - ! Mode to run in (fixed source, eigenvalue, plotting, etc) integer(C_INT), bind(C) :: run_mode ! flag for use of DAGMC geometry logical(C_BOOL), bind(C) :: dagmc - ! Restart run - logical(C_BOOL), bind(C) :: restart_run - ! The verbosity controls how much information will be printed to the screen ! and in logs integer(C_INT), bind(C) :: verbosity - logical(C_BOOL), bind(C) :: check_overlaps - - ! Trace for single particle - integer(C_INT), bind(C) :: trace_batch - integer(C_INT), bind(C) :: trace_gen - integer(C_INT64_T), bind(C) :: trace_particle - - ! Particle tracks - logical(C_BOOL), bind(C) :: write_all_tracks - character(MAX_FILE_LEN) :: path_input ! Path to input file character(MAX_FILE_LEN) :: path_cross_sections = '' ! Path to cross_sections.xml - character(MAX_FILE_LEN) :: path_particle_restart ! Path to particle restart - character(MAX_FILE_LEN) :: path_output = '' ! Path to output directory ! No reduction at end of batch logical(C_BOOL), bind(C) :: reduce_tallies diff --git a/src/settings.cpp b/src/settings.cpp index 20a5306a1c..ec62c4aa62 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -793,15 +793,6 @@ extern "C" { const char* path_input_c() { return settings::path_input.c_str(); } - const char* path_statepoint_c() { - return settings::path_statepoint.c_str(); - } - const char* path_sourcepoint_c() { - return settings::path_sourcepoint.c_str(); - } - const char* path_particle_restart_c() { - return settings::path_particle_restart.c_str(); - } void free_memory_settings() { settings::statepoint_batch.clear(); diff --git a/src/simulation_header.F90 b/src/simulation_header.F90 index 218473a06b..8976c7047e 100644 --- a/src/simulation_header.F90 +++ b/src/simulation_header.F90 @@ -4,7 +4,6 @@ module simulation_header use bank_header use constants - use settings, only: gen_per_batch use stl_vector, only: VectorReal implicit none @@ -40,7 +39,6 @@ module simulation_header #ifdef _OPENMP integer(C_INT), bind(C) :: n_threads ! number of OpenMP threads - integer(C_INT), bind(C) :: thread_id ! ID of a given thread #endif ! ============================================================================ @@ -48,10 +46,6 @@ module simulation_header integer(C_INT), bind(C) :: restart_batch - logical(C_BOOL), bind(C) :: trace - -!$omp threadprivate(trace, thread_id) - interface subroutine entropy_clear() bind(C) end subroutine