(git:34ef472)
cp_parser_methods Module Reference

Utility routines to read data from files. Kept as close as possible to the old parser because. More...

Functions/Subroutines

character(len=default_path_length+default_string_length) function, public parser_location (parser)
 return a description of the part of the file actually parsed More...
 
subroutine, public parser_read_line (parser, nline, at_end)
 Read the next line from a logical unit "unit" (I/O node only). Skip (nline-1) lines and skip also all comment lines. More...
 
subroutine, public parser_get_next_line (parser, nline, at_end)
 Read the next input line and broadcast the input information. Skip (nline-1) lines and skip also all comment lines. More...
 
subroutine, public parser_skip_space (parser)
 Skips the whitespaces. More...
 
character(len=3) function, public parser_test_next_token (parser, string_length)
 Test next input object. More...
 
subroutine, public parser_search_string (parser, string, ignore_case, found, line, begin_line, search_from_begin_of_file)
 Search a string pattern in a file defined by its logical unit number "unit". A case sensitive search is performed, if ignore_case is .FALSE.. begin_line: give back the parser at the beginning of the line matching the search. More...
 
elemental subroutine, public read_float_object (string, object, error_message)
 Returns a floating point number read from a string including fraction like z1/z2. More...
 
elemental subroutine, public read_integer_object (string, object, error_message)
 Returns an integer number read from a string including products of integer numbers like iz1*iz2*iz3. More...
 

Detailed Description

Utility routines to read data from files. Kept as close as possible to the old parser because.

  1. string handling is a weak point of fortran compilers, and it is easy to write correct things that do not work
  2. conversion of old code
    History
    22.11.1999 first version of the old parser (called qs_parser) Matthias Krack 06.2004 removed module variables, cp_parser_type, new module [fawzi]
    Author
    Fawzi Mohamed, Matthias Krack

Function/Subroutine Documentation

◆ parser_location()

character (len=default_path_length+default_string_length) function, public cp_parser_methods::parser_location ( type(cp_parser_type), intent(in)  parser)

return a description of the part of the file actually parsed

Parameters
parserthe parser
Returns
...
Author
fawzi

Definition at line 69 of file cp_parser_methods.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parser_read_line()

subroutine, public cp_parser_methods::parser_read_line ( type(cp_parser_type), intent(inout)  parser,
integer, intent(in)  nline,
logical, intent(out), optional  at_end 
)

Read the next line from a logical unit "unit" (I/O node only). Skip (nline-1) lines and skip also all comment lines.

Parameters
parser...
nline...
at_end...
Date
22.11.1999
Author
Matthias Krack (MK)
Version
1.0
Note
08.2008 [tlaino] - Teodoro Laino UZH : updated for buffer

Definition at line 146 of file cp_parser_methods.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parser_get_next_line()

subroutine, public cp_parser_methods::parser_get_next_line ( type(cp_parser_type), intent(inout)  parser,
integer, intent(in)  nline,
logical, intent(out), optional  at_end 
)

Read the next input line and broadcast the input information. Skip (nline-1) lines and skip also all comment lines.

Parameters
parser...
nline...
at_end...
Date
22.11.1999
Author
Matthias Krack (MK)
Version
1.0

Definition at line 420 of file cp_parser_methods.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parser_skip_space()

subroutine, public cp_parser_methods::parser_skip_space ( type(cp_parser_type), intent(inout)  parser)

Skips the whitespaces.

Parameters
parser...
Date
02.03.2001
Author
Matthias Krack (MK)
Version
1.0

Definition at line 450 of file cp_parser_methods.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parser_test_next_token()

character(len=3) function, public cp_parser_methods::parser_test_next_token ( type(cp_parser_type), intent(inout)  parser,
integer, intent(in), optional  string_length 
)

Test next input object.

  • test_result : "EOL": End of line
  • test_result : "EOS": End of section
  • test_result : "FLT": Floating point number
  • test_result : "INT": Integer number
  • test_result : "STR": String
    Parameters
    parser...
    string_length...
    Returns
    ...
    Date
    23.11.1999
    Author
    Matthias Krack (MK)
    Note
    - 08.2008 [tlaino] - Teodoro Laino UZH : updated for buffer

Major rewrite to parse also (multiple) products of integer or floating point numbers (23.11.2012,MK)

Definition at line 690 of file cp_parser_methods.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parser_search_string()

subroutine, public cp_parser_methods::parser_search_string ( type(cp_parser_type), intent(inout)  parser,
character(len=*), intent(in)  string,
logical, intent(in)  ignore_case,
logical, intent(out)  found,
character(len=*), intent(out), optional  line,
logical, intent(in), optional  begin_line,
logical, intent(in), optional  search_from_begin_of_file 
)

Search a string pattern in a file defined by its logical unit number "unit". A case sensitive search is performed, if ignore_case is .FALSE.. begin_line: give back the parser at the beginning of the line matching the search.

Parameters
parser...
string...
ignore_case...
found...
line...
begin_line...
search_from_begin_of_file...
Date
05.10.1999
Author
MK
Note
08.2008 [tlaino] - Teodoro Laino UZH : updated for buffer

Definition at line 784 of file cp_parser_methods.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_float_object()

elemental subroutine, public cp_parser_methods::read_float_object ( character(len=*), intent(in)  string,
real(kind=dp), intent(out)  object,
character(len=*), intent(out)  error_message 
)

Returns a floating point number read from a string including fraction like z1/z2.

Parameters
string...
object...
error_message...
Date
11.01.2011 (MK)
History
  • Add simple function parsing (17.05.2023, MK)
Author
Matthias Krack
Version
2.0
Note
- Parse also multiple products and fractions of floating point numbers (23.11.2012,MK)

Definition at line 1257 of file cp_parser_methods.F.

Here is the caller graph for this function:

◆ read_integer_object()

elemental subroutine, public cp_parser_methods::read_integer_object ( character(len=*), intent(in)  string,
integer, intent(out)  object,
character(len=*), intent(out)  error_message 
)

Returns an integer number read from a string including products of integer numbers like iz1*iz2*iz3.

Parameters
string...
object...
error_message...
Date
23.11.2012 (MK)
Author
Matthias Krack
Version
1.0
Note
- Parse also (multiple) products of integer numbers (23.11.2012,MK)

Definition at line 1373 of file cp_parser_methods.F.

Here is the caller graph for this function: