The Open FUSION Toolkit 1.0.0-beta6
Modeling tools for plasma and fusion research and engineering
Loading...
Searching...
No Matches
oft_io Module Reference

Detailed Description

HDF5 file manipulation for output and restart data.

Functions to write and read HDF5 data files and XDMF files for visit

  • Parallel restart file creation and read in
  • Data output for plotting
  • XDMF reference files for plot files
Author
Chris Hansen
Date
Summer 2010

Data Types

interface  hdf5_read
 Read data from an HDF5 file. More...
type  hdf5_rst
 HDF5 restart structure. More...
interface  hdf5_write
 Write data to an HDF5 file. More...
type  oft_bin_file
 Binary output file object. More...
type  xdmf_plot_file
 Information for XDMF plotting groups in HDF5 plot file. More...

Functions/Subroutines

subroutine bin_file_add (self, fieldname, type_str, desc, fsize)
 Add field to Open FUSION Toolkit binary I/O file.
subroutine bin_file_add_comm (self, comment)
 Add comment to Open FUSION Toolkit binary I/O file.
subroutine bin_file_close (self)
 Close Open FUSION Toolkit binary I/O file.
subroutine bin_file_flush (self)
 Flush I/O buffer for Open FUSION Toolkit binary I/O file.
subroutine bin_file_header (self)
 Write header for Open FUSION Toolkit binary I/O file.
subroutine bin_file_open (self)
 Open Open FUSION Toolkit binary I/O file.
subroutine bin_file_setup (self, filename, desc)
 Setup Open FUSION Toolkit binary I/O file.
subroutine bin_file_write (self, data_i4, data_i8, data_r4, data_r8)
 Write single set of data to Open FUSION Toolkit binary I/O file.
subroutine hdf5_add_string_attribute (filename, objname, aname, attr_data)
 Add string attribute to existing object (group or dataset).
subroutine hdf5_create_file (filename, persistent_space_tracking)
 Create an empty HDF5 output file.
subroutine hdf5_create_group (filename, group_name)
 Create HDF5 group in existing file.
subroutine hdf5_delete_obj (filename, obj_path)
 Delete HDF5 object in existing file.
logical function hdf5_field_exist (filepath, path)
 Test for exitence of a field in a HDF5 file.
subroutine hdf5_field_get_sizes (filepath, path, ndims, dim_sizes)
 Test for exitence of a field in a HDF5 file.
integer(hssize_t) function, dimension(2) hdf5_file_size (filepath)
 Test for exitence of a field in a HDF5 file.
character(len=oft_mpi_plen) function hdf5_proc_str (proc_ind)
 Get processor rank as string for HDF5 I/O.
subroutine hdf5_read_1d_i4 (array, filename, path, success)
 integer(i8) 1D array implementation of hdf5_write
subroutine hdf5_read_1d_r8 (array, filename, path, success)
 real(r8) 1D array implementation of hdf5_write
subroutine hdf5_read_2d_i4 (array, filename, path, success)
 integer(i4) 2D array implementation of hdf5_write
subroutine hdf5_read_2d_r8 (array, filename, path, success)
 real(r8) 2D array implementation of hdf5_write
subroutine hdf5_read_rst (rst_info, filename, path, success)
 FE vector implementation of hdf5_write.
subroutine hdf5_read_scalar_i4 (val, filename, path, success)
 integer(i4) scalar implementation of hdf5_read
subroutine hdf5_read_scalar_r8 (val, filename, path, success)
 real(r8) scalar implementation of hdf5_read
subroutine hdf5_rst_destroy (self)
 Deallocate internal storage fields created for HDF5 collective I/O.
character(len=oft_mpi_plen) function hdf5_ts_str (ts_in)
 Get timestep index as string for HDF5 I/O.
subroutine hdf5_write_1d_i4 (array, filename, path)
 integer(i4) 1D array implementation of hdf5_write
subroutine hdf5_write_1d_r8 (array, filename, path, single_prec)
 real(r8) 1D array implementation of hdf5_write
subroutine hdf5_write_2d_i4 (array, filename, path)
 integer(i4) 2D array implementation of hdf5_write
subroutine hdf5_write_2d_r8 (array, filename, path, single_prec)
 real(r8) 2D array implementation of hdf5_write
subroutine hdf5_write_rst (rst_info, filename, path)
 FE vector implementation of hdf5_write.
subroutine hdf5_write_scalar_i4 (val, filename, path)
 integer(i4) scalar implementation of hdf5_write
subroutine hdf5_write_scalar_r8 (val, filename, path, single_prec)
 real(r8) scalar implementation of hdf5_write
logical function oft_file_exist (filepath)
 Test for exitence of a file.
subroutine xdmf_add_mesh (self, mesh_type, pt_list, cell_list, grid_name)
 Needs docs.
subroutine xdmf_add_timestep (self, t)
 Adds a timestep to the dump metadata file.
subroutine xdmf_clear_timesteps (self, clear_static)
 Clear existing timesteps and reset to static fields.
subroutine xdmf_write_scalar (self, data, grid_name, path, centering, single_prec)
 Write scalar field to plot file.
subroutine xdmf_write_vector (self, data, grid_name, path, centering, single_prec)
 Write vector field to plot file.
subroutine xmdf_setup (self, group_name, basepath, persistent_space_tracking)
 Needs docs.

Variables

integer(i4hdf5_fcount =0
 Number of HDF5 fields.
integer(i4), parameter hdf5_flen =40
 Maximum size of HDF5 filenames.
integer(i4), parameter hdf5_nl =800
 Maximum number of HDF5 fields.
integer(i4hdf5_ts =0
 Number of HDF5 time steps.

Function/Subroutine Documentation

◆ bin_file_add()

subroutine bin_file_add ( class(oft_bin_file), intent(inout) self,
character(len=*), intent(in) fieldname,
character(len=2), intent(in) type_str,
character(len=*), intent(in), optional desc,
integer(i4), intent(in), optional fsize )

Add field to Open FUSION Toolkit binary I/O file.

Parameters
[in,out]selfFile object
[in]fieldnameField name to add
[in]type_strType of field
[in]descDescription of field
[in]fsizeSize of field

◆ bin_file_add_comm()

subroutine bin_file_add_comm ( class(oft_bin_file), intent(inout) self,
character(len=*), intent(in) comment )

Add comment to Open FUSION Toolkit binary I/O file.

Parameters
[in,out]selfFile object
[in]commentComment to add

◆ bin_file_close()

subroutine bin_file_close ( class(oft_bin_file), intent(inout) self)

Close Open FUSION Toolkit binary I/O file.

◆ bin_file_flush()

subroutine bin_file_flush ( class(oft_bin_file), intent(inout) self)

Flush I/O buffer for Open FUSION Toolkit binary I/O file.

◆ bin_file_header()

subroutine bin_file_header ( class(oft_bin_file), intent(inout) self)

Write header for Open FUSION Toolkit binary I/O file.

◆ bin_file_open()

subroutine bin_file_open ( class(oft_bin_file), intent(inout) self)

Open Open FUSION Toolkit binary I/O file.

◆ bin_file_setup()

subroutine bin_file_setup ( class(oft_bin_file), intent(inout) self,
character(len=*), intent(in) filename,
character(len=*), intent(in), optional desc )

Setup Open FUSION Toolkit binary I/O file.

◆ bin_file_write()

subroutine bin_file_write ( class(oft_bin_file), intent(inout) self,
integer(i4), dimension(:), intent(in), optional data_i4,
integer(i8), dimension(:), intent(in), optional data_i8,
real(r4), dimension(:), intent(in), optional data_r4,
real(r8), dimension(:), intent(in), optional data_r8 )

Write single set of data to Open FUSION Toolkit binary I/O file.

Parameters
[in,out]selfFile object
[in]data_i4integer(i4) data
[in]data_i8integer(i8) data
[in]data_r4real(r4) data
[in]data_r8real(r8) data

◆ hdf5_add_string_attribute()

subroutine hdf5_add_string_attribute ( character(len=*), intent(in) filename,
character(len=*), intent(in) objname,
character(len=*), intent(in) aname,
character(len=80), dimension(:), intent(in) attr_data )

Add string attribute to existing object (group or dataset).

Parameters
[in]filenameName of HDF5 file
[in]objnameName of object (dataset or group)
[in]anameAttribute name
[in]attr_dataAttribute data (80-character lines)

◆ hdf5_create_file()

subroutine hdf5_create_file ( character(len=*), intent(in) filename,
logical, intent(in), optional persistent_space_tracking )

Create an empty HDF5 output file.

Parameters
[in]filenameName of file to be created

◆ hdf5_create_group()

subroutine hdf5_create_group ( character(len=*), intent(in) filename,
character(len=*), intent(in) group_name )

Create HDF5 group in existing file.

Parameters
[in]filenameName of HDF5 file
[in]group_nameGroup path

◆ hdf5_delete_obj()

subroutine hdf5_delete_obj ( character(len=*), intent(in) filename,
character(len=*), intent(in) obj_path )

Delete HDF5 object in existing file.

Parameters
[in]filenameName of HDF5 file
[in]obj_pathObject path

◆ hdf5_field_exist()

logical function hdf5_field_exist ( character(len=*), intent(in) filepath,
character(len=*), intent(in) path )

Test for exitence of a field in a HDF5 file.

Returns
Logical flag indicating existence of field and file
Parameters
[in]filepathPath to file
[in]pathPath of field in file

◆ hdf5_field_get_sizes()

subroutine hdf5_field_get_sizes ( character(len=*), intent(in) filepath,
character(len=*), intent(in) path,
integer(4), intent(out) ndims,
integer(4), dimension(:), intent(out), allocatable dim_sizes )

Test for exitence of a field in a HDF5 file.

Returns
Logical flag indicating existence of field and file
Parameters
[in]filepathPath to file
[in]pathPath of field in file
[out]ndimsNumber of dimensions in field
[out]dim_sizesSize of each dimension

◆ hdf5_file_size()

integer(hssize_t) function, dimension(2) hdf5_file_size ( character(len=*), intent(in) filepath)

Test for exitence of a field in a HDF5 file.

Returns
Logical flag indicating existence of field and file
Parameters
[in]filepathPath to file

◆ hdf5_proc_str()

character(len=oft_mpi_plen) function hdf5_proc_str ( integer(i4), intent(in), optional proc_ind)

Get processor rank as string for HDF5 I/O.

◆ hdf5_read_1d_i4()

subroutine hdf5_read_1d_i4 ( integer(i4), dimension(:), intent(inout) array,
character(len=*), intent(in) filename,
character(len=*), intent(in) path,
logical, intent(out), optional success )

integer(i8) 1D array implementation of hdf5_write

Parameters
[in,out]arrayValues to read from file
[in]filenamePath to file
[in]pathVariable path in file
[out]successSuccessful read?

◆ hdf5_read_1d_r8()

subroutine hdf5_read_1d_r8 ( real(r8), dimension(:), intent(inout) array,
character(len=*), intent(in) filename,
character(len=*), intent(in) path,
logical, intent(out), optional success )

real(r8) 1D array implementation of hdf5_write

Parameters
[in,out]arrayValues to read from file
[in]filenamePath to file
[in]pathVariable path in file
[out]successSuccessful read?

◆ hdf5_read_2d_i4()

subroutine hdf5_read_2d_i4 ( integer(i4), dimension(:,:), intent(inout) array,
character(len=*), intent(in) filename,
character(len=*), intent(in) path,
logical, intent(out), optional success )

integer(i4) 2D array implementation of hdf5_write

Parameters
[in,out]arrayValues to read from file
[in]filenamePath to file
[in]pathVariable path in file
[out]successSuccessful read?

◆ hdf5_read_2d_r8()

subroutine hdf5_read_2d_r8 ( real(r8), dimension(:,:), intent(inout) array,
character(len=*), intent(in) filename,
character(len=*), intent(in) path,
logical, intent(out), optional success )

real(r8) 2D array implementation of hdf5_write

Parameters
[in,out]arrayValues to read from file
[in]filenamePath to file
[in]pathVariable path in file
[out]successSuccessful read?

◆ hdf5_read_rst()

subroutine hdf5_read_rst ( type(hdf5_rst), intent(inout) rst_info,
character(*), intent(in) filename,
character(*), intent(in) path,
logical, intent(out), optional success )

FE vector implementation of hdf5_write.

Parameters
[in,out]rst_infoRestart data (structure containing mapping and data holder)
[in]filenamePath to file
[in]pathVariable path in file
[out]successSuccessful read?

◆ hdf5_read_scalar_i4()

subroutine hdf5_read_scalar_i4 ( integer(i4), intent(out) val,
character(len=*), intent(in) filename,
character(len=*), intent(in) path,
logical, intent(out), optional success )

integer(i4) scalar implementation of hdf5_read

Parameters
[out]valValue to read from file
[in]filenamePath to file
[in]pathVariable path in file
[out]successSuccessful read?

◆ hdf5_read_scalar_r8()

subroutine hdf5_read_scalar_r8 ( real(r8), intent(out) val,
character(len=*), intent(in) filename,
character(len=*), intent(in) path,
logical, intent(out), optional success )

real(r8) scalar implementation of hdf5_read

Parameters
[out]valValue to read from file
[in]filenamePath to file
[in]pathVariable path in file
[out]successSuccessful read?

◆ hdf5_rst_destroy()

subroutine hdf5_rst_destroy ( type(hdf5_rst), intent(inout) self)

Deallocate internal storage fields created for HDF5 collective I/O.

◆ hdf5_ts_str()

character(len=oft_mpi_plen) function hdf5_ts_str ( integer(i4), intent(in), optional ts_in)

Get timestep index as string for HDF5 I/O.

◆ hdf5_write_1d_i4()

subroutine hdf5_write_1d_i4 ( integer(i4), dimension(:), intent(in) array,
character(len=*), intent(in) filename,
character(len=*), intent(in) path )

integer(i4) 1D array implementation of hdf5_write

Parameters
[in]arrayValues to write to file
[in]filenamePath to file
[in]pathVariable path in file

◆ hdf5_write_1d_r8()

subroutine hdf5_write_1d_r8 ( real(r8), dimension(:), intent(in) array,
character(len=*), intent(in) filename,
character(len=*), intent(in) path,
logical, intent(in), optional single_prec )

real(r8) 1D array implementation of hdf5_write

Parameters
[in]arrayValues to write to file
[in]filenamePath to file
[in]pathVariable path in file
[in]single_precSave as single precision?

◆ hdf5_write_2d_i4()

subroutine hdf5_write_2d_i4 ( integer(i4), dimension(:,:), intent(in) array,
character(len=*), intent(in) filename,
character(len=*), intent(in) path )

integer(i4) 2D array implementation of hdf5_write

Parameters
[in]arrayValues to write to file
[in]filenamePath to file
[in]pathVariable path in file

◆ hdf5_write_2d_r8()

subroutine hdf5_write_2d_r8 ( real(r8), dimension(:,:), intent(in) array,
character(len=*), intent(in) filename,
character(len=*), intent(in) path,
logical, intent(in), optional single_prec )

real(r8) 2D array implementation of hdf5_write

Parameters
[in]arrayValues to write to file
[in]filenamePath to file
[in]pathVariable path in file
[in]single_precSave as single precision?

◆ hdf5_write_rst()

subroutine hdf5_write_rst ( type(hdf5_rst), intent(in) rst_info,
character(len=*), intent(in) filename,
character(len=*), intent(in) path )

FE vector implementation of hdf5_write.

Parameters
[in]rst_infoRestart data (structure containing data and mapping)
[in]filenamePath to file
[in]pathVariable path in file

◆ hdf5_write_scalar_i4()

subroutine hdf5_write_scalar_i4 ( integer(i4), intent(in) val,
character(len=*), intent(in) filename,
character(len=*), intent(in) path )

integer(i4) scalar implementation of hdf5_write

Parameters
[in]valValue to write to file
[in]filenamePath to file
[in]pathVariable path in file

◆ hdf5_write_scalar_r8()

subroutine hdf5_write_scalar_r8 ( real(r8), intent(in) val,
character(len=*), intent(in) filename,
character(len=*), intent(in) path,
logical, intent(in), optional single_prec )

real(r8) scalar implementation of hdf5_write

Parameters
[in]valValue to write to file
[in]filenamePath to file
[in]pathVariable path in file
[in]single_precSave as single precision?

◆ oft_file_exist()

logical function oft_file_exist ( character(len=*), intent(in) filepath)

Test for exitence of a file.

Returns
Logical flag indicating existence
Parameters
[in]filepathPath to file

◆ xdmf_add_mesh()

subroutine xdmf_add_mesh ( class(xdmf_plot_file), intent(inout) self,
integer(i4), intent(in) mesh_type,
real(r8), dimension(:,:), intent(in) pt_list,
integer(i4), dimension(:,:), intent(in) cell_list,
character(len=*), intent(in) grid_name )

Needs docs.

Parameters
[in]mesh_typeMesh type flag (Tet/Tri or Hex/Quad)
[in]pt_listPoint list [3,np]
[in]cell_listCell list [:,nc]
[in]grid_namePath to mesh in HDF5 file

◆ xdmf_add_timestep()

subroutine xdmf_add_timestep ( class(xdmf_plot_file), intent(inout) self,
real(r8), intent(in) t )

Adds a timestep to the dump metadata file.

Subsequent output will be added to this timestep until another call to this subroutine

Parameters
[in]tTime value

◆ xdmf_clear_timesteps()

subroutine xdmf_clear_timesteps ( class(xdmf_plot_file), intent(inout) self,
logical, intent(in), optional clear_static )

Clear existing timesteps and reset to static fields.

Parameters
[in]clear_staticClear static fields as well?

◆ xdmf_write_scalar()

subroutine xdmf_write_scalar ( class(xdmf_plot_file), intent(in) self,
real(r8), dimension(:), intent(in) data,
character(len=*), intent(in) grid_name,
character(len=*), intent(in) path,
integer(i4), intent(in) centering,
logical, intent(in), optional single_prec )

Write scalar field to plot file.

Parameters
[in]dataScalar data
[in]grid_nameGrid name
[in]pathName of the output field
[in]centeringCentering of data (1-> vertex; 2-> cell)
[in]single_precSave as single precision?

◆ xdmf_write_vector()

subroutine xdmf_write_vector ( class(xdmf_plot_file), intent(in) self,
real(r8), dimension(:,:), intent(in) data,
character(len=*), intent(in) grid_name,
character(len=*), intent(in) path,
integer(i4), intent(in) centering,
logical, intent(in), optional single_prec )

Write vector field to plot file.

Parameters
[in]dataVector data
[in]grid_nameGrid name
[in]pathName of the output field
[in]centeringCentering of data (1-> vertex; 2-> cell)
[in]single_precSave as single precision?

◆ xmdf_setup()

subroutine xmdf_setup ( class(xdmf_plot_file), intent(inout) self,
character(len=*), intent(in) group_name,
character(len=*), intent(in), optional basepath,
logical, intent(in), optional persistent_space_tracking )

Needs docs.

Parameters
[in]group_namePath to mesh in HDF5 file

Variable Documentation

◆ hdf5_fcount

integer(i4) hdf5_fcount =0

Number of HDF5 fields.

◆ hdf5_flen

integer(i4), parameter hdf5_flen =40

Maximum size of HDF5 filenames.

◆ hdf5_nl

integer(i4), parameter hdf5_nl =800

Maximum number of HDF5 fields.

◆ hdf5_ts

integer(i4) hdf5_ts =0

Number of HDF5 time steps.