81 function file_init(fname, header, precision)
result(this)
82 character(len=*) :: fname
83 character(len=*),
optional :: header
84 integer,
optional :: precision
85 type(
file_t),
target :: this
86 character(len=80) :: suffix
91 if (
allocated(this%file_type))
then
92 deallocate(this%file_type)
95 if (suffix .eq.
"rea")
then
97 else if (suffix .eq.
"re2")
then
99 else if (suffix .eq.
"map")
then
101 else if (suffix .eq.
"vtk")
then
103 else if (suffix .eq.
"nmsh")
then
105 else if (suffix .eq.
"fld")
then
107 else if (suffix .eq.
"chkp")
then
109 else if (suffix .eq.
"stl")
then
111 else if (suffix .eq.
"csv")
then
113 this%file_type%serial = .true.
114 else if ((suffix .eq.
"hdf5") .or. (suffix .eq.
"h5"))
then
120 call this%file_type%init(fname)
122 if (
present(header))
then
123 call this%set_header(header)
126 if (
present(precision))
then
127 call this%set_precision(precision)
134 type(
file_t),
intent(inout) :: this
136 if (
allocated(this%file_type))
then
137 deallocate(this%file_type)
145 class(
file_t),
intent(inout) :: this
146 class(*),
intent(inout) :: data
147 real(kind=
rp),
intent(in),
optional :: t
150 call this%file_type%write(
data, t)
152 call this%file_type%write(data)
160 class(
file_t),
intent(in) :: this
161 class(*),
intent(inout) :: data
163 call this%file_type%read(data)
169 class(
file_t),
intent(inout) :: this
170 integer,
intent(in) :: n
172 select type(ft => this%file_type)
174 call ft%set_counter(n)
181 class(
file_t),
intent(inout) :: this
182 integer,
intent(in) :: n
184 select type(ft => this%file_type)
186 call ft%set_start_counter(n)
193 class(
file_t),
intent(inout) :: this
194 character(len=*),
intent(in) :: hd
196 character(len=80) :: suffix
198 select type(ft => this%file_type)
200 call ft%set_header(hd)
203 call neko_warning(
"No set_header defined for " // trim(suffix) //
" yet!")
211 class(
file_t),
intent(inout) :: this
212 integer,
intent(in) :: precision
214 character(len=80) :: suffix
216 select type(ft => this%file_type)
218 call ft%set_precision(precision)
221 call neko_warning(
"No precision strategy defined for " // trim(suffix) //&
Neko checkpoint file format.
File format for .csv files, used for any read/write operations involving floating point data.
Module for file I/O operations.
subroutine file_set_header(this, hd)
Set a file's header.
subroutine file_set_start_counter(this, n)
Set a file's start counter.
subroutine file_set_counter(this, n)
Set a file's counter.
type(file_t) function, target file_init(fname, header, precision)
File reader/writer constructor.
subroutine file_read(this, data)
Read data from a file.
subroutine file_set_precision(this, precision)
Set a file's output precision.
subroutine file_free(this)
File operation destructor.
subroutine file_write(this, data, t)
Writes data to a file.
Simple module to handle fld file series. Provides an interface to the different fields sotred in a fl...
integer, parameter, public rp
Global precision used in computations.
NEKTON mesh data in re2 format.
NEKTON session data reader.
Stereolithography (STL) file.
subroutine, public neko_warning(warning_msg)
Reports a warning to standard output.
subroutine, public filename_suffix(fname, suffix)
Extract a filename's suffix.
Interface for Neko checkpoint files.
A wrapper around a polymorphic generic_file_t that handles its init. This is essentially a factory fo...
Interface for NEKTON fld files.
Interface for HDF5 files.
Interface for NEKTON map files.
Interface for Neko nmsh files.
Interface for NEKTON re2 files.
Interface for NEKTON ascii files.
Interface for legacy VTK files.