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
104 if (
allocated(this%file_type))
then
105 deallocate(this%file_type)
108 select case (trim(suffix))
129 this%file_type%serial = .true.
135 call neko_error(
'Unknown file format: "' // trim(suffix) //
'"')
138 call this%file_type%init(fname)
140 if (
present(header))
then
141 call this%set_header(header)
144 if (
present(precision))
then
145 call this%set_precision(precision)
148 if (
present(layout) .and. (suffix .eq.
"bp"))
then
149 call this%set_layout(layout)
152 if (
present(overwrite))
then
153 call this%set_overwrite(overwrite)
160 class(
file_t),
intent(inout) :: this
162 if (
allocated(this%file_type))
then
163 deallocate(this%file_type)
171 class(
file_t),
intent(inout) :: this
172 class(*),
intent(inout) :: data
173 real(kind=
rp),
intent(in),
optional :: t
175 call this%file_type%write(
data, t = t)
182 class(
file_t),
intent(in) :: this
183 class(*),
intent(inout) :: data
185 call this%file_type%read(data)
191 class(
file_t),
intent(in) :: this
192 character(len=1024) :: fname
196 select type (ft => this%file_type)
198 fname = ft%get_fname()
205 class(
file_t),
intent(in) :: this
206 character(len=1024) :: fname
210 select type (ft => this%file_type)
212 fname = ft%get_base_fname()
219 class(
file_t),
intent(inout) :: this
223 select type (ft => this%file_type)
232 class(
file_t),
intent(inout) :: this
233 integer,
intent(in) :: n
235 select type (ft => this%file_type)
237 call ft%set_counter(n)
244 class(
file_t),
intent(inout) :: this
245 integer,
intent(in) :: n
247 select type (ft => this%file_type)
249 call ft%set_start_counter(n)
256 class(
file_t),
intent(inout) :: this
257 character(len=*),
intent(in) :: hd
258 character(len=80) :: suffix
260 select type (ft => this%file_type)
262 call ft%set_header(hd)
265 call neko_warning(
"No set_header defined for " // trim(suffix) //
" yet")
273 class(
file_t),
intent(inout) :: this
274 integer,
intent(in) :: precision
275 character(len=80) :: suffix
277 select type (ft => this%file_type)
279 call ft%set_precision(precision)
281 call ft%set_precision(precision)
283 call ft%set_precision(precision)
286 call neko_warning(
"No precision strategy defined for " // trim(suffix) &
295 class(
file_t),
intent(inout) :: this
296 integer,
intent(in) :: layout
297 character(len=80) :: suffix
299 select type (ft => this%file_type)
301 call ft%set_layout(layout)
304 call neko_warning(
"No set_layout defined for " // trim(suffix) //
" yet")
311 class(
file_t),
intent(inout) :: this
312 logical,
intent(in) :: overwrite
313 character(len=80) :: suffix
315 select type (ft => this%file_type)
317 call ft%set_overwrite(overwrite)
325 class(
file_t),
intent(inout) :: this
326 logical,
intent(in) :: subdivide
327 character(len=80) :: suffix
329 select type (ft => this%file_type)
331 call ft%set_subdivide(subdivide)
335 call neko_warning(
"Subdivide output not supported for " // &
336 trim(suffix) //
" files")
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_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 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 ADIOS2 bp files.
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.
Interface for HDF5 files.