83 function file_init(fname, header, precision)
result(this)
84 character(len=*) :: fname
85 character(len=*),
optional :: header
86 integer,
optional :: precision
87 type(
file_t),
target :: this
88 character(len=80) :: suffix
93 if (
allocated(this%file_type))
then
94 deallocate(this%file_type)
97 if (suffix .eq.
"rea")
then
99 else if (suffix .eq.
"re2")
then
101 else if (suffix .eq.
"map")
then
103 else if (suffix .eq.
"vtk")
then
105 else if (suffix .eq.
"nmsh")
then
107 else if (suffix .eq.
"fld")
then
109 else if (suffix .eq.
"chkp")
then
111 else if (suffix .eq.
"stl")
then
113 else if (suffix .eq.
"csv")
then
115 this%file_type%serial = .true.
116 else if ((suffix .eq.
"hdf5") .or. (suffix .eq.
"h5"))
then
122 call this%file_type%init(fname)
124 if (
present(header))
then
125 call this%set_header(header)
128 if (
present(precision))
then
129 call this%set_precision(precision)
83 function file_init(fname, header, precision)
result(this)
…
136 type(
file_t),
intent(inout) :: this
138 if (
allocated(this%file_type))
then
139 deallocate(this%file_type)
147 class(
file_t),
intent(inout) :: this
148 class(*),
intent(inout) :: data
149 real(kind=
rp),
intent(in),
optional :: t
152 call this%file_type%write(
data, t)
154 call this%file_type%write(data)
162 class(
file_t),
intent(in) :: this
163 class(*),
intent(inout) :: data
165 call this%file_type%read(data)
171 class(
file_t),
intent(inout) :: this
175 select type(ft => this%file_type)
184 class(
file_t),
intent(inout) :: this
185 integer,
intent(in) :: n
187 select type(ft => this%file_type)
189 call ft%set_counter(n)
196 class(
file_t),
intent(inout) :: this
197 integer,
intent(in) :: n
199 select type(ft => this%file_type)
201 call ft%set_start_counter(n)
208 class(
file_t),
intent(inout) :: this
209 character(len=*),
intent(in) :: hd
211 character(len=80) :: suffix
213 select type(ft => this%file_type)
215 call ft%set_header(hd)
218 call neko_warning(
"No set_header defined for " // trim(suffix) //
" yet!")
226 class(
file_t),
intent(inout) :: this
227 integer,
intent(in) :: precision
229 character(len=80) :: suffix
231 select type(ft => this%file_type)
233 call ft%set_precision(precision)
236 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.
integer function file_get_counter(this)
Get a file's counter.
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.