93 subroutine file_init(this, fname, header, precision, layout, overwrite)
94 class(
file_t),
intent(inout) :: this
95 character(len=*),
intent(in) :: fname
96 character(len=*),
intent(in),
optional :: header
97 integer,
intent(in),
optional :: precision
98 integer,
intent(in),
optional :: layout
99 logical,
intent(in),
optional :: overwrite
100 character(len=80) :: suffix
106 select case (trim(suffix))
127 this%file_type%serial = .true.
133 call neko_error(
'Unknown file format: "' // trim(suffix) //
'"')
136 call this%file_type%init(fname)
138 if (
present(header))
then
139 call this%set_header(header)
142 if (
present(precision))
then
143 call this%set_precision(precision)
146 if (
present(layout) .and. (suffix .eq.
"bp"))
then
147 call this%set_layout(layout)
150 if (
present(overwrite))
then
151 call this%set_overwrite(overwrite)
158 class(
file_t),
intent(inout) :: this
160 if (
allocated(this%file_type))
then
162 select type (ft => this%file_type)
166 deallocate(this%file_type)
174 class(
file_t),
intent(inout) :: this
175 class(*),
intent(inout) :: data
176 real(kind=
dp),
intent(in),
optional :: t
178 call this%file_type%write(
data, t = t)
185 class(
file_t),
intent(in) :: this
186 class(*),
intent(inout) :: data
188 call this%file_type%read(data)
194 class(
file_t),
intent(in) :: this
195 character(len=1024) :: fname
199 select type (ft => this%file_type)
201 fname = ft%get_fname()
208 class(
file_t),
intent(in) :: this
209 character(len=1024) :: fname
213 select type (ft => this%file_type)
215 fname = ft%get_base_fname()
222 class(
file_t),
intent(inout) :: this
226 select type (ft => this%file_type)
235 class(
file_t),
intent(inout) :: this
236 integer,
intent(in) :: n
238 select type (ft => this%file_type)
240 call ft%set_counter(n)
247 class(
file_t),
intent(inout) :: this
248 integer,
intent(in) :: n
250 select type (ft => this%file_type)
252 call ft%set_start_counter(n)
259 class(
file_t),
intent(inout) :: this
260 character(len=*),
intent(in) :: hd
261 character(len=80) :: suffix
263 select type (ft => this%file_type)
265 call ft%set_header(hd)
268 call neko_warning(
"No set_header defined for " // trim(suffix) //
" yet")
276 class(
file_t),
intent(inout) :: this
277 integer,
intent(in) :: precision
278 character(len=80) :: suffix
280 select type (ft => this%file_type)
282 call ft%set_precision(precision)
284 call ft%set_precision(precision)
286 call ft%set_precision(precision)
289 call neko_warning(
"No precision strategy defined for " // trim(suffix) &
298 class(
file_t),
intent(inout) :: this
299 integer,
intent(in) :: layout
300 character(len=80) :: suffix
302 select type (ft => this%file_type)
304 call ft%set_layout(layout)
307 call neko_warning(
"No set_layout defined for " // trim(suffix) //
" yet")
314 class(
file_t),
intent(inout) :: this
315 logical,
intent(in) :: overwrite
316 character(len=80) :: suffix
318 select type (ft => this%file_type)
320 call ft%set_overwrite(overwrite)
328 class(
file_t),
intent(inout) :: this
329 logical,
intent(in) :: subdivide
330 character(len=80) :: suffix
332 select type (ft => this%file_type)
334 call ft%set_subdivide(subdivide)
338 call neko_warning(
"Subdivide output not supported for " // &
339 trim(suffix) //
" files")
Neko legacy 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_overwrite(this, overwrite)
Sets the file's overwrite flag.
subroutine file_set_start_counter(this, n)
Set a file's start counter.
subroutine file_set_counter(this, n)
Set a file's counter.
character(len=1024) function file_get_fname(this)
Get a file's name.
subroutine file_set_layout(this, layout)
Set a file's output layout.
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_set_subdivide(this, subdivide)
Enable or disable subdivision of spectral elements into linear sub-cells. Only has effect for VTKHDF ...
subroutine file_free(this)
File operation destructor.
subroutine file_init(this, fname, header, precision, layout, overwrite)
Constructor.
character(len=1024) function file_get_base_fname(this)
Get a file's base name.
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 dp
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 ADIOS2 bp files.
Interface for Neko legacy 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.
Interface for HDF5 files.