mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Have openmc_next_batch return a status
This commit is contained in:
parent
9f66edb7fb
commit
ac565724dc
1 changed files with 21 additions and 6 deletions
|
|
@ -58,10 +58,9 @@ contains
|
|||
|
||||
call openmc_simulation_init()
|
||||
|
||||
BATCH_LOOP: do current_batch = 1, n_max_batches
|
||||
call openmc_next_batch()
|
||||
if (satisfy_triggers) exit BATCH_LOOP
|
||||
end do BATCH_LOOP
|
||||
do
|
||||
if (openmc_next_batch() < 0) exit
|
||||
end do
|
||||
|
||||
call time_active % stop()
|
||||
|
||||
|
|
@ -73,7 +72,8 @@ contains
|
|||
! OPENMC_NEXT_BATCH
|
||||
!===============================================================================
|
||||
|
||||
subroutine openmc_next_batch() bind(C)
|
||||
function openmc_next_batch() result(retval) bind(C)
|
||||
integer(C_INT) :: retval
|
||||
|
||||
type(Particle) :: p
|
||||
integer(8) :: i_work
|
||||
|
|
@ -119,7 +119,16 @@ contains
|
|||
|
||||
call finalize_batch()
|
||||
|
||||
end subroutine openmc_next_batch
|
||||
! Check simulation ending criteria
|
||||
if (current_batch == n_max_batches) then
|
||||
retval = -1
|
||||
elseif (satisfy_triggers) then
|
||||
retval = -2
|
||||
else
|
||||
retval = 0
|
||||
end if
|
||||
|
||||
end function openmc_next_batch
|
||||
|
||||
!===============================================================================
|
||||
! INITIALIZE_HISTORY
|
||||
|
|
@ -174,6 +183,9 @@ contains
|
|||
|
||||
integer :: i
|
||||
|
||||
! Increment current batch
|
||||
current_batch = current_batch + 1
|
||||
|
||||
if (run_mode == MODE_FIXEDSOURCE) then
|
||||
call write_message("Simulating batch " // trim(to_str(current_batch)) &
|
||||
// "...", 6)
|
||||
|
|
@ -427,6 +439,9 @@ contains
|
|||
end if
|
||||
end if
|
||||
|
||||
! Reset current batch
|
||||
current_batch = 0
|
||||
|
||||
end subroutine openmc_simulation_init
|
||||
|
||||
!===============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue