mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Added path_output variable.
This commit is contained in:
parent
2b7739a845
commit
c8f61c958f
6 changed files with 27 additions and 17 deletions
|
|
@ -1,6 +1,6 @@
|
|||
module cmfd_output
|
||||
|
||||
# ifdef PETSC
|
||||
#ifdef PETSC
|
||||
|
||||
! This modules cleans up cmfd objects and echos the results
|
||||
|
||||
|
|
@ -38,10 +38,14 @@ contains
|
|||
subroutine write_neutron_balance()
|
||||
|
||||
use cmfd_data, only: neutron_balance
|
||||
use constants, only: CMFD_BALANCE
|
||||
use constants, only: CMFD_BALANCE, MAX_FILE_LEN
|
||||
|
||||
character(MAX_FILE_LEN) :: filename
|
||||
|
||||
filename = trim(path_output) // 'neutron_balance.out'
|
||||
|
||||
! open file for output
|
||||
open(unit=CMFD_BALANCE,file="neutron_balance.out")
|
||||
open(UNIT=CMFD_BALANCE, FILE=filename, ACTION='write')
|
||||
|
||||
! write out the tally
|
||||
call neutron_balance(CMFD_BALANCE)
|
||||
|
|
@ -51,6 +55,6 @@ contains
|
|||
|
||||
end subroutine write_neutron_balance
|
||||
|
||||
# endif
|
||||
#endif
|
||||
|
||||
end module cmfd_output
|
||||
|
|
|
|||
|
|
@ -259,6 +259,7 @@ module global
|
|||
character(MAX_FILE_LEN) :: path_source = '' ! Path to binary source
|
||||
character(MAX_FILE_LEN) :: path_state_point ! Path to binary state point
|
||||
character(MAX_FILE_LEN) :: path_particle_restart ! Path to particle restart
|
||||
character(MAX_FILE_LEN) :: path_output = '' ! Path to output directory
|
||||
|
||||
! Message used in message/warning/fatal_error
|
||||
character(MAX_LINE_LEN) :: message
|
||||
|
|
|
|||
|
|
@ -831,20 +831,22 @@ contains
|
|||
integer(HID_T) :: dspace ! identifier for dataspace
|
||||
integer(HID_T) :: dset ! identifier for dataset
|
||||
integer, allocatable :: temp_array(:) ! nuclide bin array
|
||||
character(MAX_FILE_LEN) :: filename ! Path to state point
|
||||
type(c_ptr) :: f_ptr ! Pointer for h5dwrite
|
||||
type(TallyObject), pointer :: t => null()
|
||||
|
||||
path_state_point = 'statepoint.' // trim(to_str(current_batch)) // '.h5'
|
||||
filename = trim(path_output) // 'statepoint.' // &
|
||||
trim(to_str(current_batch)) // '.h5'
|
||||
|
||||
! Write message
|
||||
message = "Creating HDF5 state point " // trim(path_state_point) // "..."
|
||||
message = "Creating HDF5 state point " // trim(filename) // "..."
|
||||
call write_message(1)
|
||||
|
||||
! Only master process should continue from here
|
||||
if (.not. master) return
|
||||
|
||||
! Create a new state point file using default properties.
|
||||
call h5fcreate_f(path_state_point, H5F_ACC_TRUNC_F, hdf5_state_point, &
|
||||
call h5fcreate_f(filename, H5F_ACC_TRUNC_F, hdf5_state_point, &
|
||||
hdf5_err)
|
||||
|
||||
! Write revision number for state point file
|
||||
|
|
|
|||
|
|
@ -1077,7 +1077,7 @@ contains
|
|||
type(TallyObject), pointer :: t => null()
|
||||
|
||||
! Create filename for log file
|
||||
path = "summary.out"
|
||||
path = trim(path_output) // "summary.out"
|
||||
|
||||
! Open log file for writing
|
||||
open(UNIT=UNIT_SUMMARY, FILE=path, STATUS='replace', ACTION='write')
|
||||
|
|
@ -1177,7 +1177,7 @@ contains
|
|||
type(SAlphaBeta), pointer :: sab => null()
|
||||
|
||||
! Create filename for log file
|
||||
path = "cross_sections.out"
|
||||
path = trim(path_output) // "cross_sections.out"
|
||||
|
||||
! Open log file for writing
|
||||
open(UNIT=UNIT_XS, FILE=path, STATUS='replace', ACTION='write')
|
||||
|
|
@ -1517,9 +1517,10 @@ contains
|
|||
|
||||
! Create filename for tally output
|
||||
if (run_mode == MODE_TALLIES) then
|
||||
filename = "tallies." // trim(to_str(restart_batch)) // ".out"
|
||||
filename = trim(path_output) // "tallies." // &
|
||||
trim(to_str(restart_batch)) // ".out"
|
||||
else
|
||||
filename = "tallies.out"
|
||||
filename = trim(path_output) // "tallies.out"
|
||||
end if
|
||||
|
||||
! Open tally file for writing
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ contains
|
|||
type(Bank), pointer :: src => null()
|
||||
|
||||
! set up file name
|
||||
filename = 'particle_'//trim(to_str(rank))//'.h5'
|
||||
filename = trim(path_output) // 'particle_'//trim(to_str(rank))//'.h5'
|
||||
|
||||
! create hdf5 file
|
||||
call h5fcreate_f(filename, H5F_ACC_TRUNC_F, hdf5_particle_file, hdf5_err)
|
||||
|
|
@ -90,7 +90,7 @@ contains
|
|||
type(Bank), pointer :: src => null()
|
||||
|
||||
! set up file name
|
||||
filename = 'particle_'//trim(to_str(rank))//'.binary'
|
||||
filename = path_output // 'particle_'//trim(to_str(rank))//'.binary'
|
||||
|
||||
! create hdf5 file
|
||||
open(UNIT=UNIT_PARTICLE, FILE=filename, STATUS='replace', &
|
||||
|
|
|
|||
|
|
@ -51,13 +51,15 @@ contains
|
|||
#else
|
||||
integer :: j, k ! loop indices
|
||||
#endif
|
||||
character(MAX_FILE_LEN) :: filename
|
||||
type(TallyObject), pointer :: t => null()
|
||||
|
||||
! Set filename for binary state point
|
||||
path_state_point = 'statepoint.' // trim(to_str(current_batch)) // '.binary'
|
||||
filename = trim(path_output) // 'statepoint.' // &
|
||||
trim(to_str(current_batch)) // '.binary'
|
||||
|
||||
! Write message
|
||||
message = "Creating state point " // trim(path_state_point) // "..."
|
||||
message = "Creating state point " // trim(filename) // "..."
|
||||
call write_message(1)
|
||||
|
||||
#ifdef MPI
|
||||
|
|
@ -65,7 +67,7 @@ contains
|
|||
! PARALLEL I/O USING MPI-2 ROUTINES
|
||||
|
||||
! Open binary source file for reading
|
||||
call MPI_FILE_OPEN(MPI_COMM_WORLD, path_state_point, MPI_MODE_CREATE + &
|
||||
call MPI_FILE_OPEN(MPI_COMM_WORLD, filename, MPI_MODE_CREATE + &
|
||||
MPI_MODE_WRONLY, MPI_INFO_NULL, fh, mpi_err)
|
||||
|
||||
! ==========================================================================
|
||||
|
|
@ -158,7 +160,7 @@ contains
|
|||
|
||||
#else
|
||||
! Open binary state point file for writing
|
||||
open(UNIT=UNIT_STATE, FILE=path_state_point, STATUS='replace', &
|
||||
open(UNIT=UNIT_STATE, FILE=filename, STATUS='replace', &
|
||||
ACCESS='stream')
|
||||
|
||||
! Write revision number for state point file
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue