Move definitions for several variables from Fortran to C++

This commit is contained in:
Paul Romano 2018-08-24 09:51:34 -05:00
parent 4ad0725843
commit 268b865cd3
3 changed files with 26 additions and 17 deletions

View file

@ -17,16 +17,16 @@ namespace openmc {
namespace settings {
// Defined on Fortran side
extern "C" bool check_overlaps;
extern "C" bool particle_restart_run;
extern "C" bool photon_transport;
extern "C" bool restart_run;
extern "C" bool run_CE;
extern "C" bool write_all_tracks;
extern "C" bool write_initial_source;
// Boolean flags
extern "C" bool check_overlaps; //!< check overlaps in geometry?
extern "C" bool particle_restart_run; //!< particle restart run?
extern "C" bool photon_transport; //!< photon transport turned on?
extern "C" bool restart_run; //!< restart run?
extern "C" bool run_CE; //!< run with continuous-energy data?
extern "C" bool write_all_tracks; //!< write track files for every particle?
extern "C" bool write_initial_source; //!< write out initial source file?
// Defined in .cpp
// Paths to various files
// TODO: Make strings instead of char* once Fortran is gone
extern "C" char* path_input;
extern "C" char* path_statepoint;
@ -37,6 +37,7 @@ extern std::string path_multipole;
extern std::string path_output;
extern std::string path_source;
// Temperature settings
extern int temperature_method;
extern bool temperature_multipole;
extern double temperature_tolerance;

View file

@ -9,13 +9,13 @@ module settings
! ============================================================================
! ENERGY TREATMENT RELATED VARIABLES
logical(C_BOOL), bind(C, name='run_CE') :: run_CE = .true. ! Run in CE mode?
logical(C_BOOL), bind(C, name='run_CE') :: run_CE ! Run in CE mode?
! ============================================================================
! CONTINUOUS-ENERGY CROSS SECTION RELATED VARIABLES
! Unreoslved resonance probablity tables
logical :: urr_ptables_on = .true.
logical(C_BOOL) :: urr_ptables_on = .true.
! Default temperature and method for choosing temperatures
integer(C_INT) :: temperature_method = TEMPERATURE_NEAREST
@ -26,7 +26,7 @@ module settings
integer :: n_log_bins ! number of bins for logarithmic grid
logical(C_BOOL), bind(C) :: photon_transport = .false.
logical(C_BOOL), bind(C) :: photon_transport
integer :: electron_treatment = ELECTRON_TTB
! ============================================================================
@ -81,13 +81,13 @@ module settings
integer(C_INT), bind(C, name='openmc_run_mode') :: run_mode = NONE
! Restart run
logical(C_BOOL), bind(C) :: restart_run = .false.
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, name='openmc_verbosity') :: verbosity = 7
logical(C_BOOL), bind(C) :: check_overlaps = .false.
logical(C_BOOL), bind(C) :: check_overlaps
! Trace for single particle
integer :: trace_batch
@ -95,14 +95,14 @@ module settings
integer(8) :: trace_particle
! Particle tracks
logical(C_BOOL), bind(C) :: write_all_tracks = .false.
logical(C_BOOL), bind(C) :: write_all_tracks
integer, allocatable :: track_identifiers(:,:)
! Particle restart run
logical(C_BOOL), bind(C) :: particle_restart_run = .false.
logical(C_BOOL), bind(C) :: particle_restart_run
! Write out initial source
logical(C_BOOL), bind(C) :: write_initial_source = .false.
logical(C_BOOL), bind(C) :: write_initial_source
! Whether create fission neutrons or not. Only applied for MODE_FIXEDSOURCE
logical :: create_fission_neutrons = .true.

View file

@ -18,6 +18,14 @@ namespace openmc {
namespace settings {
bool check_overlaps {false};
bool particle_restart_run {false};
bool photon_transport {false};
bool restart_run {false};
bool run_CE {true};
bool write_all_tracks {false};
bool write_initial_source {false};
char* path_input;
char* path_statepoint;
char* path_sourcepoint;