A module for parsing Fortran namelists.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public, | parameter | :: | wp | = | real64 |
default real kind |
Returns lowercase version of the string.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | str |
input string |
lowercase version of the string
Parse a Fortran namelist into a json_value
structure.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | filename |
the namelist file to parse |
||
type(json_value), | pointer | :: | p_namelist |
the resulting JSON structure |
||
logical, | intent(out) | :: | status_ok |
true if there were no errors |
Read a single line from a file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | iunit |
the file unit (assumed to be opened) |
||
character(len=:), | intent(out), | allocatable | :: | line |
the line read |
|
logical, | intent(out) | :: | eof |
if end of file reached |
Infers the variable type and adds it to the namelist JSON structure.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(json_core), | intent(inout) | :: | json | |||
type(json_value), | pointer | :: | p_namelist | |||
character(len=*), | intent(in) | :: | path | |||
character(len=*), | intent(in) | :: | str |
Convert a string to a real(wp)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | str | |||
real(kind=wp), | intent(out) | :: | val | |||
logical, | intent(out) | :: | status_ok |
Convert a string to an integer
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | str | |||
integer, | intent(out) | :: | val | |||
logical, | intent(out) | :: | status_ok |
Convert a string to a logical
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | str | |||
logical, | intent(out) | :: | val | |||
logical, | intent(out) | :: | status_ok |