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)
168 deallocate(this%file_type)
176 class(
file_t),
intent(inout) :: this
177 class(*),
intent(inout) :: data
178 real(kind=
dp),
intent(in),
optional :: t
180 call this%file_type%write(
data, t = t)
187 class(
file_t),
intent(in) :: this
188 class(*),
intent(inout) :: data
190 call this%file_type%read(data)
196 class(
file_t),
intent(in) :: this
197 character(len=1024) :: fname
201 select type (ft => this%file_type)
203 fname = ft%get_fname()
210 class(
file_t),
intent(in) :: this
211 character(len=1024) :: fname
215 select type (ft => this%file_type)
217 fname = ft%get_base_fname()
224 class(
file_t),
intent(inout) :: this
228 select type (ft => this%file_type)
237 class(
file_t),
intent(inout) :: this
238 integer,
intent(in) :: n
240 select type (ft => this%file_type)
242 call ft%set_counter(n)
249 class(
file_t),
intent(inout) :: this
250 integer,
intent(in) :: n
252 select type (ft => this%file_type)
254 call ft%set_start_counter(n)
261 class(
file_t),
intent(inout) :: this
262 character(len=*),
intent(in) :: hd
263 character(len=80) :: suffix
265 select type (ft => this%file_type)
267 call ft%set_header(hd)
270 call neko_warning(
"No set_header defined for " // trim(suffix) //
" yet")
278 class(
file_t),
intent(inout) :: this
279 integer,
intent(in) :: precision
280 character(len=80) :: suffix
282 select type (ft => this%file_type)
284 call ft%set_precision(precision)
286 call ft%set_precision(precision)
288 call ft%set_precision(precision)
291 call neko_warning(
"No precision strategy defined for " // trim(suffix) &
300 class(
file_t),
intent(inout) :: this
301 integer,
intent(in) :: layout
302 character(len=80) :: suffix
304 select type (ft => this%file_type)
306 call ft%set_layout(layout)
309 call neko_warning(
"No set_layout defined for " // trim(suffix) //
" yet")
316 class(
file_t),
intent(inout) :: this
317 logical,
intent(in) :: overwrite
318 character(len=80) :: suffix
320 select type (ft => this%file_type)
322 call ft%set_overwrite(overwrite)
330 class(
file_t),
intent(inout) :: this
331 logical,
intent(in) :: subdivide
332 character(len=80) :: suffix
334 select type (ft => this%file_type)
336 call ft%set_subdivide(subdivide)
340 call neko_warning(
"Subdivide output not supported for " // &
341 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.