mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Added command-line option for number of particles per generation.
This commit is contained in:
parent
0a18e051c8
commit
d3d47eb331
3 changed files with 20 additions and 5 deletions
|
|
@ -130,7 +130,7 @@ module global
|
|||
! ============================================================================
|
||||
! CRITICALITY SIMULATION VARIABLES
|
||||
|
||||
integer(8) :: n_particles ! # of particles per generation
|
||||
integer(8) :: n_particles = 0 ! # of particles per generation
|
||||
integer :: n_batches ! # of batches
|
||||
integer :: n_inactive ! # of inactive batches
|
||||
integer :: n_active ! # of active batches
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ module initialize
|
|||
use ace, only: read_xs
|
||||
use bank_header, only: Bank
|
||||
use constants
|
||||
use datatypes, only: dict_create, dict_get_key, dict_has_key, &
|
||||
use datatypes, only: dict_create, dict_get_key, dict_has_key, &
|
||||
dict_keys
|
||||
use datatypes_header, only: ListKeyValueII, DictionaryII
|
||||
use energy_grid, only: unionized_grid
|
||||
|
|
@ -18,7 +18,8 @@ module initialize
|
|||
create_xs_summary_file, print_version
|
||||
use random_lcg, only: initialize_prng
|
||||
use source, only: initialize_source
|
||||
use string, only: to_str, starts_with, ends_with, lower_case
|
||||
use string, only: to_str, str_to_int, starts_with, ends_with, &
|
||||
lower_case
|
||||
use tally, only: create_tally_map
|
||||
use tally_header, only: TallyObject
|
||||
use timing, only: timer_start, timer_stop
|
||||
|
|
@ -28,7 +29,7 @@ module initialize
|
|||
#endif
|
||||
|
||||
#ifdef HDF5
|
||||
use hdf5_interface, only: hdf5_create_output, hdf5_write_header, &
|
||||
use hdf5_interface, only: hdf5_create_output, hdf5_write_header, &
|
||||
hdf5_write_summary
|
||||
#endif
|
||||
|
||||
|
|
@ -244,6 +245,17 @@ contains
|
|||
select case (argv(i))
|
||||
case ('-p', '-plot', '--plot')
|
||||
run_mode = MODE_PLOTTING
|
||||
case ('-n', '-n_particles', '--n_particles')
|
||||
i = i + 1
|
||||
! Read number of particles per cycle
|
||||
n_particles = str_to_int(argv(i))
|
||||
|
||||
! Check that number specified was valid
|
||||
if (n_particles == ERROR_INT) then
|
||||
message = "Must specify integer after " // trim(argv(i-1)) // &
|
||||
" command-line flag."
|
||||
call fatal_error()
|
||||
end if
|
||||
case ('-?', '-help', '--help')
|
||||
call print_usage()
|
||||
stop
|
||||
|
|
|
|||
|
|
@ -102,7 +102,10 @@ contains
|
|||
message = "Need to specify number of particles per cycles."
|
||||
call fatal_error()
|
||||
end if
|
||||
n_particles = str_to_int(criticality % particles)
|
||||
|
||||
! If the number of particles was specified as a command-line argument, we
|
||||
! don't set it here
|
||||
if (n_particles == 0) n_particles = str_to_int(criticality % particles)
|
||||
|
||||
! Copy cycle information
|
||||
n_batches = criticality % batches
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue