PartMC
2.6.1
|
Reading formatted text input. More...
Data Types | |
type | spec_file_t |
An input file with extra data for printing messages. More... | |
Functions/Subroutines | |
subroutine | spec_file_die_msg (code, file, msg) |
Exit with an error message containing filename and line number. More... | |
subroutine | spec_file_assert_msg (code, file, condition_ok, msg) |
Exit with an error message containing filename and line number if condition_ok is .false. More... | |
subroutine | spec_file_open (filename, file) |
Open a spec file for reading. More... | |
subroutine | spec_file_close (file) |
Close a spec file. More... | |
subroutine | spec_file_read_line_raw (file, line, eof) |
Read a single line from a spec file, signaling if we have hit EOF. More... | |
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). More... | |
subroutine | spec_file_read_line (file, line, eof) |
Read a spec_line from the spec_file. More... | |
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. More... | |
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. More... | |
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. More... | |
subroutine | spec_file_check_line_name (file, line, name) |
Check that the name of the line data is as given. More... | |
subroutine | spec_file_check_name (file, name, read_name) |
Checks that the read_name is the same as name. More... | |
subroutine | spec_file_check_line_length (file, line, length) |
Check that the length of the line data is as given. More... | |
subroutine | spec_file_check_read_iostat (file, ios, type) |
Check the IOSTAT and error if it is bad. More... | |
integer function | spec_file_string_to_integer (file, string) |
Convert a string to an integer. More... | |
real(kind=dp) function | spec_file_string_to_real (file, string) |
Convert a string to an real. More... | |
logical function | spec_file_string_to_logical (file, string) |
Convert a string to an logical. More... | |
subroutine | spec_file_read_integer (file, name, var) |
Read an integer from a spec file that must have the given name. More... | |
subroutine | spec_file_read_real (file, name, var) |
Read a real number from a spec file that must have the given name. More... | |
subroutine | spec_file_read_logical (file, name, var) |
Read a logical from a spec file that must have a given name. More... | |
subroutine | spec_file_read_string (file, name, var) |
Read a string from a spec file that must have a given name. More... | |
subroutine | spec_file_read_complex (file, name, var) |
Read a complex number from a spec file that must have the given name. More... | |
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. More... | |
subroutine | spec_file_read_timed_real_array (file, name, times, vals) |
Read an a time-indexed array of real data. More... | |
Variables | |
integer, parameter | spec_file_max_list_lines = 1000 |
Maximum number of lines in an array. More... | |
Reading formatted text input.
subroutine pmc_spec_file::spec_file_assert_msg | ( | integer, intent(in) | code, |
type(spec_file_t), intent(in) | file, | ||
logical, intent(in) | condition_ok, | ||
character(len=*), intent(in) | msg | ||
) |
Exit with an error message containing filename and line number if condition_ok
is .false.
[in] | code | Failure status code. |
[in] | file | Spec file. |
[in] | condition_ok | Whether the assertion is ok. |
[in] | msg | Error message. |
Definition at line 90 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 431 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 389 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 409 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 450 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 111 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 626 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 540 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 214 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(:), allocatable | 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 362 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(:), allocatable | 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 317 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 297 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 147 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 583 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 183 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 562 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(:), allocatable | names, | ||
real(kind=dp), dimension(:,:), allocatable | 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 649 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(:), allocatable | times, | ||
real(kind=dp), dimension(:), allocatable | 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 687 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 469 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 507 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 488 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.