Provides functions to parse standard XYZ format files containing atomic coordinates and element symbols for molecular structures. Read XYZ file from disk Parse XYZ data from string Split text into lines (for testing)
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private, | parameter | :: | MAX_ELEMENT_SYMBOL_LEN | = | 4 |
Maximum element symbol length |
Convert integer to string
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | i |
Read molecular geometry from XYZ format file
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | filename |
Path to XYZ file |
||
| type(geometry_type), | intent(out) | :: | geom |
Parsed molecular geometry |
||
| type(error_t), | intent(out) | :: | error |
Error handling |
Parse molecular geometry from XYZ format string
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | xyz_string | |||
| type(geometry_type), | intent(out) | :: | geom | |||
| type(error_t), | intent(out) | :: | error |
Split input text into lines based on CR, LF, or CRLF line endings Trailing newlines do not create empty lines
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | text | |||
| character(len=:), | intent(out), | allocatable | :: | lines(:) | ||
| integer, | intent(out) | :: | nlines |