Neko 0.9.99
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
csv_file Module Reference

File format for .csv files, used for any read/write operations involving floating point data.

Data Types

type  csv_file_t
 

Functions/Subroutines

subroutine csv_file_write (this, data, t)
 Writes data to an output file.
 
subroutine csv_file_write_vector (f, data, t)
 Writes a vector_t object to an output file, in a row format. If the parameter t is present, it will be appended at the start of the row, followed by the contents of the vector.
 
subroutine csv_file_write_matrix (f, data, t)
 Writes a matrix_t object to an output file. If the parameter t is present, it will be appended at the start of each row.
 
subroutine csv_file_read (this, data)
 Reads data from an input file.
 
subroutine csv_file_read_vector (f, vec)
 Read a vector (i.e. data on a single row) from a csv file.
 
subroutine csv_file_read_matrix (f, mat)
 Read a matrix from a csv file.
 
subroutine csv_file_set_header (this, hd)
 Sets the header for a csv file. For example: hd = "u,v,w,p".
 
integer function csv_file_count_lines (this)
 Count the number of lines in a file by going through it entirely until the end is reached.
 

Function/Subroutine Documentation

◆ csv_file_count_lines()

integer function csv_file::csv_file_count_lines ( class(csv_file_t), intent(in this)

Definition at line 305 of file csv_file.f90.

◆ csv_file_read()

subroutine csv_file::csv_file_read ( class(csv_file_t this,
class(*), intent(inout), target  data 
)
Parameters
thiscsv file in which to read.
datamatrix_t or vector_t, will contain the read data.

Definition at line 181 of file csv_file.f90.

Here is the call graph for this function:

◆ csv_file_read_matrix()

subroutine csv_file::csv_file_read_matrix ( type(csv_file_t), intent(inout f,
type(matrix_t), intent(inout mat 
)
Parameters
dcsv file from which to read.
vecMatrix object in which to store the file contents.
Note
If the number of lines in the file is larger than the number of rows of mat, it will be assumed that a one-line header is present.

Definition at line 265 of file csv_file.f90.

Here is the caller graph for this function:

◆ csv_file_read_vector()

subroutine csv_file::csv_file_read_vector ( type(csv_file_t), intent(inout f,
type(vector_t), intent(inout vec 
)
Parameters
dcsv file from which to read.
vecVector object in which to store the file contents.
Note
- Equivalent to reading a matrix with nrows = 1 and ncols = N. To read a vector in a column format, use a matrix_t with ncols = 1.
- If the number of lines in the file is larger than 1, it will be assumed that a one-line header is present.

Definition at line 236 of file csv_file.f90.

Here is the caller graph for this function:

◆ csv_file_set_header()

subroutine csv_file::csv_file_set_header ( class(csv_file_t), intent(inout this,
character(len=*), intent(in hd 
)
Parameters
hdHeader.
Note
The header will be written "as is", meaning there will be no checks performed on the header separators, number of columns, etc.

Definition at line 295 of file csv_file.f90.

◆ csv_file_write()

subroutine csv_file::csv_file_write ( class (csv_file_t), intent(inout this,
class(*), intent(in), target  data,
real(kind=rp), intent(in), optional  t 
)
Parameters
thiscsv file to write in.
dataData to write, can be vector_t or matrix_t.
tTime.

Definition at line 65 of file csv_file.f90.

Here is the call graph for this function:

◆ csv_file_write_matrix()

subroutine csv_file::csv_file_write_matrix ( class(csv_file_t), intent(inout f,
type(matrix_t), intent(in data,
real(kind=rp), intent(in), optional  t 
)
Parameters
fcsv file in which to write.
dataMatrix to write.
Time.

Definition at line 151 of file csv_file.f90.

Here is the caller graph for this function:

◆ csv_file_write_vector()

subroutine csv_file::csv_file_write_vector ( class(csv_file_t), intent(inout f,
type(vector_t), intent(in data,
real(kind=rp), intent(in), optional  t 
)
Parameters
fcsv file in which to write.
dataVector to write.
Time.
Note
Equivalent to writing a matrix with nrows = 1 and ncols = N. To write a vector in a column format, use a matrix_t with ncols = 1.

Definition at line 120 of file csv_file.f90.

Here is the caller graph for this function: