80 function file_init(fname, header, precision)
result(this)
81 character(len=*) :: fname
82 character(len=*),
optional :: header
83 integer,
optional :: precision
84 type(
file_t),
target :: this
85 character(len=80) :: suffix
90 if (
allocated(this%file_type))
then
91 deallocate(this%file_type)
94 if (suffix .eq.
"rea")
then
96 else if (suffix .eq.
"re2")
then
98 else if (suffix .eq.
"map")
then
100 else if (suffix .eq.
"vtk")
then
102 else if (suffix .eq.
"nmsh")
then
104 else if (suffix .eq.
"fld")
then
106 else if (suffix .eq.
"chkp")
then
108 else if (suffix .eq.
"stl")
then
110 else if (suffix .eq.
"csv")
then
112 this%file_type%serial = .true.
117 call this%file_type%init(fname)
119 if (
present(header))
then
120 call this%set_header(header)
123 if (
present(precision))
then
124 call this%set_precision(precision)
131 type(
file_t),
intent(inout) :: this
133 if (
allocated(this%file_type))
then
134 deallocate(this%file_type)
142 class(
file_t),
intent(inout) :: this
143 class(*),
intent(inout) :: data
144 real(kind=
rp),
intent(in),
optional :: t
147 call this%file_type%write(
data, t)
149 call this%file_type%write(data)
157 class(
file_t),
intent(in) :: this
158 class(*),
intent(inout) :: data
160 call this%file_type%read(data)
166 class(
file_t),
intent(inout) :: this
167 integer,
intent(in) :: n
169 select type(ft => this%file_type)
171 call ft%set_counter(n)
178 class(
file_t),
intent(inout) :: this
179 integer,
intent(in) :: n
181 select type(ft => this%file_type)
183 call ft%set_start_counter(n)
190 class(
file_t),
intent(inout) :: this
191 character(len=*),
intent(in) :: hd
193 character(len=80) :: suffix
195 select type(ft => this%file_type)
197 call ft%set_header(hd)
200 call neko_warning(
"No set_header defined for " // trim(suffix) //
" yet!")
208 class(
file_t),
intent(inout) :: this
209 integer,
intent(in) :: precision
211 character(len=80) :: suffix
213 select type(ft => this%file_type)
215 call ft%set_precision(precision)
218 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 filename_suffix(fname, suffix)
Extract a filename's suffix.
subroutine neko_warning(warning_msg)
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 NEKTON map files.
Interface for Neko nmsh files.
Interface for NEKTON re2 files.
Interface for NEKTON ascii files.
Interface for legacy VTK files.