mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
added hdf5 link and output a sample file
This commit is contained in:
parent
0dd1d054cc
commit
e3fdfa79e3
3 changed files with 34 additions and 2 deletions
|
|
@ -20,6 +20,7 @@ DEBUG = no
|
|||
PROFILE = no
|
||||
OPTIMIZE = no
|
||||
USE_MPI = no
|
||||
USE_HDF5 = yes
|
||||
|
||||
#===============================================================================
|
||||
# Intel Fortran compiler options
|
||||
|
|
@ -79,10 +80,12 @@ endif
|
|||
# use petsc compiler
|
||||
ifeq ($(COMPILER),petsc)
|
||||
F90 = ${FLINKER}
|
||||
F90FLAGS := -cpp -ffree-form -I ${PETSC_DIR}/include
|
||||
F90FLAGS := -cpp -ffree-form -I${PETSC_DIR}/include
|
||||
include ${PETSC_DIR}/conf/variables
|
||||
include ${PETSC_DIR}/conf/rules
|
||||
LDFLAGS = ${PETSC_SYS_LIB}
|
||||
F90FLAGS += -I${HDF5_PREFIX}/include
|
||||
LDFLAGS += -L${HDF5_PREFIX}/lib ${HDF5_PREFIX}/lib/libhdf5hl_fortran.a ${HDF5_PREFIX}/lib/libhdf5_hl.a ${HDF5_PREFIX}/lib/libhdf5_fortran.a ${HDF5_PREFIX}/lib/libhdf5.a -lz -lrt -lm -Wl,-rpath -Wl,${HDF5_PREFIX}/lib
|
||||
endif
|
||||
|
||||
#===============================================================================
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
module cmfd_execute
|
||||
|
||||
use cmfd_utils, only: get_matrix_idx,neutron_balance,set_coremap, &
|
||||
& get_reflector_albedo
|
||||
& get_reflector_albedo,write_hdf5
|
||||
use global
|
||||
use mesh, only: mesh_indices_to_bin
|
||||
use mesh_header, only: StructuredMesh
|
||||
|
|
@ -50,6 +50,9 @@ contains
|
|||
write(107,*) cmfd % dtilde
|
||||
write(108,*) cmfd % dhat
|
||||
|
||||
! write cmfd object to hdf5 file
|
||||
call write_hdf5()
|
||||
|
||||
! solve diffusion equation
|
||||
call cmfd_solver()
|
||||
|
||||
|
|
|
|||
|
|
@ -509,4 +509,30 @@ contains
|
|||
|
||||
end function get_reflector_albedo
|
||||
|
||||
!===============================================================================
|
||||
! WRITE_HDF5 writes an hdf5 output file with the cmfd object for restarts
|
||||
!===============================================================================
|
||||
|
||||
subroutine write_hdf5()
|
||||
|
||||
use hdf5 ! This module contains all necessary modules
|
||||
|
||||
character(LEN=8), parameter :: filename = "filef.h5" ! File name
|
||||
integer(HID_T) :: file_id ! File identifier
|
||||
integer :: error ! Error flag
|
||||
|
||||
! Initialize FORTRAN interface.
|
||||
call h5open_f (error)
|
||||
|
||||
! Create a new file using default properties.
|
||||
call h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error)
|
||||
|
||||
! Terminate access to the file.
|
||||
call h5fclose_f(file_id, error)
|
||||
|
||||
! Close FORTRAN interface.
|
||||
call h5close_f(error)
|
||||
|
||||
end subroutine write_hdf5
|
||||
|
||||
end module cmfd_utils
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue