File format for .csv files, used for any read/write operations involving floating point data.
|
subroutine | csv_file_write (this, data, t) |
| Writes data to an output file. More...
|
|
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. More...
|
|
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. More...
|
|
subroutine | csv_file_read (this, data) |
| Reads data from an input file. More...
|
|
subroutine | csv_file_read_vector (f, vec) |
| Read a vector (i.e. data on a single row) from a csv file. More...
|
|
subroutine | csv_file_read_matrix (f, mat) |
| Read a matrix from a csv file. More...
|
|
subroutine | csv_file_set_header (this, hd) |
| Sets the header for a csv file. For example: hd = "u,v,w,p" . More...
|
|
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. More...
|
|
◆ csv_file_count_lines()
integer function csv_file::csv_file_count_lines |
( |
class(csv_file_t), intent(in) |
this | ) |
|
◆ csv_file_read()
subroutine csv_file::csv_file_read |
( |
class(csv_file_t) |
this, |
|
|
class(*), intent(inout), target |
data |
|
) |
| |
- Parameters
-
this | csv file in which to read. |
data | matrix_t or vector_t , will contain the read data. |
Definition at line 181 of file csv_file.f90.
◆ 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
-
d | csv file from which to read. |
vec | Matrix 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.
◆ 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
-
d | csv file from which to read. |
vec | Vector 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.
◆ csv_file_set_header()
subroutine csv_file::csv_file_set_header |
( |
class(csv_file_t), intent(inout) |
this, |
|
|
character(len=*), intent(in) |
hd |
|
) |
| |
- Parameters
-
- 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
-
this | csv file to write in. |
data | Data to write, can be vector_t or matrix_t. |
t | Time. |
Definition at line 65 of file csv_file.f90.
◆ 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
-
f | csv file in which to write. |
data | Matrix to write. |
Time. | |
Definition at line 151 of file csv_file.f90.
◆ 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
-
f | csv file in which to write. |
data | Vector 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.