PartMC
2.1.5
|
Reading formatted text input. More...
Data Types | |
type | spec_file_t |
An input file with extra data for printing messages. More... | |
Public Member Functions | |
subroutine | spec_file_die_msg (code, file, msg) |
Exit with an error message containing filename and line number. | |
subroutine | spec_file_open (filename, file) |
Open a spec file for reading. | |
subroutine | spec_file_close (file) |
Close a spec file. | |
subroutine | spec_file_read_line_raw (file, line, eof) |
Read a single line from a spec file, signaling if we have hit EOF. | |
subroutine | spec_file_read_next_data_line (file, line, eof) |
Read the next line from the spec file that contains useful data (stripping comments and blank lines). | |
subroutine | spec_file_read_line (file, line, eof) |
Read a spec_line from the spec_file. | |
subroutine | spec_file_read_line_no_eof (file, line) |
Read a spec_line from the spec_file. This will always succeed or error out, so should only be called if we know there should be a valid line coming. | |
subroutine | spec_file_read_line_list (file, max_lines, line_list) |
Read a list of spec_lines from a file, stopping at max_lines or EOF, whichever comes first. | |
subroutine | spec_file_read_line_array (file, max_lines, line_array) |
Read an array of spec_lines from a file, stopping at max_lines or EOF. All lines must have the same number of elements. | |
subroutine | spec_file_check_line_name (file, line, name) |
Check that the name of the line data is as given. | |
subroutine | spec_file_check_name (file, name, read_name) |
Checks that the read_name is the same as name. | |
subroutine | spec_file_check_line_length (file, line, length) |
Check that the length of the line data is as given. | |
subroutine | spec_file_check_read_iostat (file, ios, type) |
Check the IOSTAT and error if it is bad. | |
integer function | spec_file_string_to_integer (file, string) |
Convert a string to an integer. | |
real(kind=dp) function | spec_file_string_to_real (file, string) |
Convert a string to an real. | |
logical function | spec_file_string_to_logical (file, string) |
Convert a string to an logical. | |
subroutine | spec_file_read_integer (file, name, var) |
Read an integer from a spec file that must have the given name. | |
subroutine | spec_file_read_real (file, name, var) |
Read a real number from a spec file that must have the given name. | |
subroutine | spec_file_read_logical (file, name, var) |
Read a logical from a spec file that must have a given name. | |
subroutine | spec_file_read_string (file, name, var) |
Read a string from a spec file that must have a given name. | |
subroutine | spec_file_read_complex (file, name, var) |
Read a complex number from a spec file that must have the given name. | |
subroutine | spec_file_read_real_named_array (file, max_lines, names, vals) |
Read an array of named lines with real data. All lines must have the same number of data elements. | |
subroutine | spec_file_read_timed_real_array (file, name, times, vals) |
Read an a time-indexed array of real data. | |
Public Attributes | |
integer, parameter | SPEC_FILE_MAX_LIST_LINES = 1000 |
Maximum number of lines in an array. |
Reading formatted text input.
Definition at line 43 of file spec_file.F90.
subroutine pmc_spec_file::spec_file_check_line_length | ( | type(spec_file_t), intent(in) | file, |
type(spec_line_t), intent(in) | line, | ||
integer, intent(in) | length | ||
) |
Check that the length of the line data is as given.
[in] | file | Spec file. |
[in] | line | Spec line. |
[in] | length | Expected data length. |
Definition at line 425 of file spec_file.F90.
subroutine pmc_spec_file::spec_file_check_line_name | ( | type(spec_file_t), intent(in) | file, |
type(spec_line_t), intent(in) | line, | ||
character(len=*), intent(in) | name | ||
) |
Check that the name of the line data is as given.
[in] | file | Spec file. |
[in] | line | Spec line. |
[in] | name | Expected line name. |
Definition at line 383 of file spec_file.F90.
subroutine pmc_spec_file::spec_file_check_name | ( | type(spec_file_t), intent(inout) | file, |
character(len=*), intent(in) | name, | ||
character(len=*), intent(in) | read_name | ||
) |
Checks that the read_name is the same as name.
[in,out] | file | Spec file. |
[in] | name | Name that we should have. |
[in] | read_name | Name that we do have. |
Definition at line 403 of file spec_file.F90.
subroutine pmc_spec_file::spec_file_check_read_iostat | ( | type(spec_file_t), intent(in) | file, |
integer, intent(in) | ios, | ||
character(len=*), intent(in) | type | ||
) |
Check the IOSTAT and error if it is bad.
[in] | file | Spec file. |
[in] | ios | Iostat result. |
[in] | type | Type being read during error. |
Definition at line 444 of file spec_file.F90.
subroutine pmc_spec_file::spec_file_close | ( | type(spec_file_t), intent(in) | file | ) |
subroutine pmc_spec_file::spec_file_die_msg | ( | integer, intent(in) | code, |
type(spec_file_t), intent(in) | file, | ||
character(len=*), intent(in) | msg | ||
) |
Exit with an error message containing filename and line number.
[in] | code | Failure status code. |
[in] | file | Spec file. |
[in] | msg | Error message. |
Definition at line 73 of file spec_file.F90.
subroutine pmc_spec_file::spec_file_open | ( | character(len=*), intent(in) | filename, |
type(spec_file_t), intent(out) | file | ||
) |
Open a spec file for reading.
[in] | filename | Name of file to open. |
[out] | file | Spec file. |
Definition at line 90 of file spec_file.F90.
subroutine pmc_spec_file::spec_file_read_complex | ( | type(spec_file_t), intent(inout) | file, |
character(len=*), intent(in) | name, | ||
complex(kind=dc), intent(out) | var | ||
) |
Read a complex number from a spec file that must have the given name.
[in,out] | file | Spec file. |
[in] | name | Name. |
[out] | var | Variable to store data. |
Definition at line 628 of file spec_file.F90.
subroutine pmc_spec_file::spec_file_read_integer | ( | type(spec_file_t), intent(inout) | file, |
character(len=*), intent(in) | name, | ||
integer, intent(out) | var | ||
) |
Read an integer from a spec file that must have the given name.
[in,out] | file | Spec file. |
[in] | name | Name. |
[out] | var | Variable to store data. |
Definition at line 534 of file spec_file.F90.
subroutine pmc_spec_file::spec_file_read_line | ( | type(spec_file_t), intent(inout) | file, |
type(spec_line_t), intent(inout) | line, | ||
logical, intent(out) | eof | ||
) |
Read a spec_line from the spec_file.
[in,out] | file | Spec file. |
[in,out] | line | Spec line. |
[out] | eof | True if EOF encountered. |
Definition at line 193 of file spec_file.F90.
subroutine pmc_spec_file::spec_file_read_line_array | ( | type(spec_file_t), intent(inout) | file, |
integer, intent(in) | max_lines, | ||
type(spec_line_t), dimension(:), pointer | line_array | ||
) |
Read an array of spec_lines from a file, stopping at max_lines or EOF. All lines must have the same number of elements.
[in,out] | file | Spec file. |
[in] | max_lines | Max lines to read (0 = no max). |
line_array | Array of spec_lines,. |
Definition at line 356 of file spec_file.F90.
subroutine pmc_spec_file::spec_file_read_line_list | ( | type(spec_file_t), intent(inout) | file, |
integer, intent(in) | max_lines, | ||
type(spec_line_t), dimension(:), pointer | line_list | ||
) |
Read a list of spec_lines from a file, stopping at max_lines or EOF, whichever comes first.
[in,out] | file | Spec file. |
[in] | max_lines | Max lines to read (0 = no max). |
line_list | List of spec_lines. |
Definition at line 297 of file spec_file.F90.
subroutine pmc_spec_file::spec_file_read_line_no_eof | ( | type(spec_file_t), intent(inout) | file, |
type(spec_line_t), intent(inout) | line | ||
) |
Read a spec_line from the spec_file. This will always succeed or error out, so should only be called if we know there should be a valid line coming.
[in,out] | file | Spec file. |
[in,out] | line | Spec line. |
Definition at line 277 of file spec_file.F90.
subroutine pmc_spec_file::spec_file_read_line_raw | ( | type(spec_file_t), intent(inout) | file, |
character(len=*), intent(out) | line, | ||
logical, intent(out) | eof | ||
) |
Read a single line from a spec file, signaling if we have hit EOF.
[in,out] | file | Spec file. |
[out] | line | Complete line read. |
[out] | eof | True if at EOF. |
Definition at line 126 of file spec_file.F90.
subroutine pmc_spec_file::spec_file_read_logical | ( | type(spec_file_t), intent(inout) | file, |
character(len=*), intent(in) | name, | ||
logical, intent(out) | var | ||
) |
Read a logical from a spec file that must have a given name.
[in,out] | file | Spec file. |
[in] | name | Name. |
[out] | var | Variable to store data. |
Definition at line 581 of file spec_file.F90.
subroutine pmc_spec_file::spec_file_read_next_data_line | ( | type(spec_file_t), intent(inout) | file, |
character(len=*), intent(out) | line, | ||
logical, intent(out) | eof | ||
) |
Read the next line from the spec file that contains useful data (stripping comments and blank lines).
[in,out] | file | Spec file. |
[out] | line | Complete line read. |
[out] | eof | True if EOF encountered. |
Definition at line 162 of file spec_file.F90.
subroutine pmc_spec_file::spec_file_read_real | ( | type(spec_file_t), intent(inout) | file, |
character(len=*), intent(in) | name, | ||
real(kind=dp), intent(out) | var | ||
) |
Read a real number from a spec file that must have the given name.
[in,out] | file | Spec file. |
[in] | name | Name. |
[out] | var | Variable to store data. |
Definition at line 558 of file spec_file.F90.
subroutine pmc_spec_file::spec_file_read_real_named_array | ( | type(spec_file_t), intent(inout) | file, |
integer, intent(in) | max_lines, | ||
character(len=SPEC_LINE_MAX_VAR_LEN), dimension(:), pointer | names, | ||
real(kind=dp), dimension(:,:), pointer | vals | ||
) |
Read an array of named lines with real data. All lines must have the same number of data elements.
[in,out] | file | Spec file. |
[in] | max_lines | Max lines to read (0 = no max). |
names | Names of lines. | |
vals | Data values. |
Definition at line 653 of file spec_file.F90.
subroutine pmc_spec_file::spec_file_read_string | ( | type(spec_file_t), intent(inout) | file, |
character(len=*), intent(in) | name, | ||
character(len=*), intent(out) | var | ||
) |
Read a string from a spec file that must have a given name.
[in,out] | file | Spec file. |
[in] | name | Name. |
[out] | var | Variable to store data. |
Definition at line 604 of file spec_file.F90.
subroutine pmc_spec_file::spec_file_read_timed_real_array | ( | type(spec_file_t), intent(inout) | file, |
character(len=*), intent(in) | name, | ||
real(kind=dp), dimension(:), pointer | times, | ||
real(kind=dp), dimension(:), pointer | vals | ||
) |
Read an a time-indexed array of real data.
[in,out] | file | Spec file. |
[in] | name | Variable name. |
times | Names of lines. | |
vals | Data values. |
Definition at line 696 of file spec_file.F90.
integer function pmc_spec_file::spec_file_string_to_integer | ( | type(spec_file_t), intent(in) | file, |
character(len=*), intent(in) | string | ||
) |
Convert a string to an integer.
[in] | file | Spec file. |
[in] | string | String to convert. |
Definition at line 463 of file spec_file.F90.
logical function pmc_spec_file::spec_file_string_to_logical | ( | type(spec_file_t), intent(in) | file, |
character(len=*), intent(in) | string | ||
) |
Convert a string to an logical.
[in] | file | Spec file. |
[in] | string | String to convert. |
Definition at line 501 of file spec_file.F90.
real(kind=dp) function pmc_spec_file::spec_file_string_to_real | ( | type(spec_file_t), intent(in) | file, |
character(len=*), intent(in) | string | ||
) |
Convert a string to an real.
[in] | file | Spec file. |
[in] | string | String to convert. |
Definition at line 482 of file spec_file.F90.
integer, parameter pmc_spec_file::SPEC_FILE_MAX_LIST_LINES = 1000 |
Maximum number of lines in an array.
Definition at line 49 of file spec_file.F90.