mctc_io Module

Input and output module for molecular structure data.

This module provides the main interface for reading and writing molecular structures in various geometry file formats. It exports:

The file format is automatically detected from file extensions, or can be explicitly specified using the filetype enumerator. Use get_filetype to translate file names to format identifiers.

Supported formats include xyz, mol/sdf, pdb, Turbomole coord, VASP POSCAR, DFTB+ gen, Gaussian external, QCSchema JSON, Chemical JSON, Pymatgen JSON, FHI-aims geometry.in, and Q-Chem molecule blocks.

Example usage:

 use mctc_io
 use mctc_env
 type(structure_type) :: mol
 type(error_type), allocatable :: error

 call read_structure(mol, "input.xyz", error)
 if (allocated(error)) stop error%message

 call write_structure(mol, "output.mol", error)