mqc_config_parser Module

Parses section-based input files with %section…end blocks This is the new format generated by mqc_prep.py


Uses

  • module~~mqc_config_parser~~UsesGraph module~mqc_config_parser mqc_config_parser module~mqc_calc_types mqc_calc_types module~mqc_config_parser->module~mqc_calc_types module~mqc_calculation_defaults mqc_calculation_defaults module~mqc_config_parser->module~mqc_calculation_defaults module~mqc_error mqc_error module~mqc_config_parser->module~mqc_error module~mqc_geometry mqc_geometry module~mqc_config_parser->module~mqc_geometry module~mqc_method_types mqc_method_types module~mqc_config_parser->module~mqc_method_types module~mqc_physical_fragment mqc_physical_fragment module~mqc_config_parser->module~mqc_physical_fragment pic_types pic_types module~mqc_config_parser->pic_types module~mqc_calc_types->pic_types module~mqc_calculation_defaults->pic_types module~mqc_geometry->pic_types module~mqc_method_types->pic_types module~mqc_physical_fragment->module~mqc_error module~mqc_physical_fragment->module~mqc_geometry module~mqc_physical_fragment->pic_types module~mqc_cgto mqc_cgto module~mqc_physical_fragment->module~mqc_cgto module~mqc_elements mqc_elements module~mqc_physical_fragment->module~mqc_elements module~mqc_physical_constants mqc_physical_constants module~mqc_physical_fragment->module~mqc_physical_constants module~mqc_xyz_reader mqc_xyz_reader module~mqc_physical_fragment->module~mqc_xyz_reader module~mqc_cgto->pic_types module~mqc_elements->pic_types pic_ascii pic_ascii module~mqc_elements->pic_ascii module~mqc_physical_constants->pic_types module~mqc_xyz_reader->module~mqc_error module~mqc_xyz_reader->module~mqc_geometry module~mqc_xyz_reader->pic_types

Used by

  • module~~mqc_config_parser~~UsedByGraph module~mqc_config_parser mqc_config_parser module~mqc_calculation_interface mqc_calculation_interface module~mqc_calculation_interface->module~mqc_config_parser module~mqc_config_adapter mqc_config_adapter module~mqc_config_adapter->module~mqc_config_parser module~mqc_config_parser_basic_sections mqc_config_parser_basic_sections module~mqc_config_parser_basic_sections->module~mqc_config_parser module~mqc_config_parser_calc_settings mqc_config_parser_calc_settings module~mqc_config_parser_calc_settings->module~mqc_config_parser module~mqc_config_parser_fragments mqc_config_parser_fragments module~mqc_config_parser_fragments->module~mqc_config_parser module~mqc_config_parser_molecules mqc_config_parser_molecules module~mqc_config_parser_molecules->module~mqc_config_parser module~mqc_config_parser_structure mqc_config_parser_structure module~mqc_config_parser_structure->module~mqc_config_parser module~mqc_driver mqc_driver module~mqc_driver->module~mqc_config_parser module~mqc_driver->module~mqc_config_adapter module~mqc_many_body_expansion mqc_many_body_expansion module~mqc_driver->module~mqc_many_body_expansion module~mqc_mbe_fragment_distribution_scheme mqc_mbe_fragment_distribution_scheme module~mqc_driver->module~mqc_mbe_fragment_distribution_scheme proc~check_fragment_overlap check_fragment_overlap proc~check_fragment_overlap->module~mqc_config_parser proc~compute_gmbe compute_gmbe proc~compute_gmbe->module~mqc_config_parser proc~initialize_fragmented_system initialize_fragmented_system proc~initialize_fragmented_system->module~mqc_config_parser proc~molecule_to_system_geometry molecule_to_system_geometry proc~molecule_to_system_geometry->module~mqc_config_parser proc~process_intersection_derivatives process_intersection_derivatives proc~process_intersection_derivatives->module~mqc_config_parser proc~run_multi_molecule_calculations run_multi_molecule_calculations proc~run_multi_molecule_calculations->module~mqc_config_parser proc~run_multi_molecule_calculations->module~mqc_config_adapter program~main main program~main->module~mqc_config_parser program~main->module~mqc_config_adapter program~main->module~mqc_driver module~mqc_many_body_expansion->module~mqc_config_adapter module~mqc_mbe_fragment_distribution_scheme->module~mqc_config_adapter proc~apply_distance_screening apply_distance_screening proc~apply_distance_screening->module~mqc_config_adapter proc~compute_energy_and_forces compute_energy_and_forces proc~compute_energy_and_forces->module~mqc_config_adapter proc~compute_energy_and_forces->module~mqc_driver proc~fragment_should_be_screened fragment_should_be_screened proc~fragment_should_be_screened->module~mqc_config_adapter module~mpi_fragment_work_smod mpi_fragment_work_smod module~mpi_fragment_work_smod->module~mqc_mbe_fragment_distribution_scheme module~mqc_gmbe_fragment_distribution_scheme mqc_gmbe_fragment_distribution_scheme module~mqc_gmbe_fragment_distribution_scheme->module~mqc_mbe_fragment_distribution_scheme module~mqc_hessian_distribution_scheme mqc_hessian_distribution_scheme module~mqc_hessian_distribution_scheme->module~mqc_mbe_fragment_distribution_scheme module~mqc_serial_fragment_processor mqc_serial_fragment_processor module~mqc_serial_fragment_processor->module~mqc_mbe_fragment_distribution_scheme module~mqc_unfragmented_workflow mqc_unfragmented_workflow module~mqc_unfragmented_workflow->module~mqc_mbe_fragment_distribution_scheme proc~gmbe_run_distributed gmbe_context_t%gmbe_run_distributed proc~gmbe_run_distributed->module~mqc_mbe_fragment_distribution_scheme proc~gmbe_run_distributed->module~mqc_gmbe_fragment_distribution_scheme proc~mbe_run_distributed mbe_context_t%mbe_run_distributed proc~mbe_run_distributed->module~mqc_mbe_fragment_distribution_scheme proc~mbe_run_serial mbe_context_t%mbe_run_serial proc~mbe_run_serial->module~mqc_mbe_fragment_distribution_scheme proc~gmbe_run_serial gmbe_context_t%gmbe_run_serial proc~gmbe_run_serial->module~mqc_gmbe_fragment_distribution_scheme

Variables

Type Visibility Attributes Name Initial
integer, public, parameter :: MAX_LINE_LEN = 1024

Interfaces

interface

  • private module subroutine parse_aimd_section(unit, config, error)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: unit
    type(mqc_config_t), intent(inout) :: config
    type(error_t), intent(out) :: error

interface

  • private module subroutine parse_connectivity_generic(unit, nbonds, nbroken, bonds, error)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: unit
    integer, intent(inout) :: nbonds
    integer, intent(inout) :: nbroken
    type(bond_t), intent(inout), allocatable :: bonds(:)
    type(error_t), intent(out) :: error

interface

  • private module subroutine parse_connectivity_section(unit, config, error)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: unit
    type(mqc_config_t), intent(inout) :: config
    type(error_t), intent(out) :: error

interface

  • private module subroutine parse_driver_section(unit, config, error)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: unit
    type(mqc_config_t), intent(inout) :: config
    type(error_t), intent(out) :: error

interface

  • private module subroutine parse_fragmentation_section(unit, config, error)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: unit
    type(mqc_config_t), intent(inout) :: config
    type(error_t), intent(out) :: error

interface

  • private module subroutine parse_fragments_generic(unit, nfrag, fragments, error)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: unit
    integer, intent(inout) :: nfrag
    type(input_fragment_t), intent(inout), allocatable :: fragments(:)
    type(error_t), intent(out) :: error

interface

  • private module subroutine parse_fragments_section(unit, config, error)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: unit
    type(mqc_config_t), intent(inout) :: config
    type(error_t), intent(out) :: error

interface

  • private module subroutine parse_geometry_generic(unit, geom, error)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: unit
    type(geometry_type), intent(inout) :: geom
    type(error_t), intent(out) :: error

interface

  • private module subroutine parse_geometry_section(unit, config, error)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: unit
    type(mqc_config_t), intent(inout) :: config
    type(error_t), intent(out) :: error

interface

  • private module subroutine parse_hessian_section(unit, config, error)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: unit
    type(mqc_config_t), intent(inout) :: config
    type(error_t), intent(out) :: error

interface

  • private module subroutine parse_model_section(unit, config, error)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: unit
    type(mqc_config_t), intent(inout) :: config
    type(error_t), intent(out) :: error

interface

  • private module subroutine parse_molecules_section(unit, config, error)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: unit
    type(mqc_config_t), intent(inout) :: config
    type(error_t), intent(out) :: error

interface

  • private module subroutine parse_scf_section(unit, config, error)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: unit
    type(mqc_config_t), intent(inout) :: config
    type(error_t), intent(out) :: error

interface

  • private module subroutine parse_schema_section(unit, config, error)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: unit
    type(mqc_config_t), intent(inout) :: config
    type(error_t), intent(out) :: error

interface

  • private module subroutine parse_structure_generic(unit, charge, multiplicity, error)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: unit
    integer, intent(inout) :: charge
    integer, intent(inout) :: multiplicity
    type(error_t), intent(out) :: error

interface

  • private module subroutine parse_structure_section(unit, config, error)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: unit
    type(mqc_config_t), intent(inout) :: config
    type(error_t), intent(out) :: error

interface

  • private module subroutine parse_system_section(unit, config, error)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: unit
    type(mqc_config_t), intent(inout) :: config
    type(error_t), intent(out) :: error

interface

  • private module subroutine parse_xtb_section(unit, config, error)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: unit
    type(mqc_config_t), intent(inout) :: config
    type(error_t), intent(out) :: error

Derived Types

type, public ::  input_fragment_t

Input fragment definition with charge, multiplicity, and atom indices This is the parsed representation from the input file, not the computational fragment

Components

Type Visibility Attributes Name Initial
integer, public :: charge = 0
integer, public, allocatable :: indices(:)

Atom indices in this fragment

integer, public :: multiplicity = 1

Type-Bound Procedures

procedure, public :: destroy => input_fragment_destroy

type, public ::  molecule_t

Single molecule definition with structure, geometry, fragments, and connectivity

Components

Type Visibility Attributes Name Initial
type(bond_t), public, allocatable :: bonds(:)
integer, public :: charge = 0
type(input_fragment_t), public, allocatable :: fragments(:)
type(geometry_type), public :: geometry
integer, public :: multiplicity = 1
character(len=:), public, allocatable :: name

Optional molecule name

integer, public :: nbonds = 0
integer, public :: nbroken = 0
integer, public :: nfrag = 0

Type-Bound Procedures

procedure, public :: destroy => molecule_destroy

type, public ::  mqc_config_t

Complete configuration from .mqc file

Components

Type Visibility Attributes Name Initial
real(kind=dp), public :: aimd_dt = DEFAULT_AIMD_DT

Timestep (femtoseconds)

real(kind=dp), public :: aimd_initial_temperature = DEFAULT_AIMD_TEMPERATURE

Initial temperature for velocity init (K)

integer, public :: aimd_nsteps = DEFAULT_AIMD_NSTEPS

Number of MD steps (0 = no AIMD)

integer, public :: aimd_output_frequency = DEFAULT_AIMD_OUTPUT_FREQ

Write output every N steps

logical, public :: allow_overlapping_fragments = .false.
character(len=:), public, allocatable :: aux_basis
character(len=:), public, allocatable :: basis
type(bond_t), public, allocatable :: bonds(:)
integer(kind=int32), public :: calc_type = CALC_TYPE_ENERGY
integer, public :: charge = 0
integer, public :: cpcm_nang = DEFAULT_CPCM_NANG

Number of angular grid points for CPCM cavity

real(kind=dp), public :: cpcm_rscale = DEFAULT_CPCM_RSCALE

Radii scaling factor for CPCM cavity

character(len=:), public, allocatable :: cutoff_method
real(kind=dp), public :: dielectric = -1.0_dp

Direct dielectric constant (-1 = use solvent lookup)

character(len=:), public, allocatable :: distance_metric
character(len=:), public, allocatable :: embedding
integer, public :: frag_level = DEFAULT_FRAG_LEVEL
character(len=:), public, allocatable :: frag_method

MBE, etc.

real(kind=dp), public, allocatable :: fragment_cutoffs(:)

Distance cutoffs indexed by n-mer level (2=dimer, 3=trimer, etc.)

type(input_fragment_t), public, allocatable :: fragments(:)
type(geometry_type), public :: geometry
real(kind=dp), public :: hessian_displacement = DEFAULT_DISPLACEMENT

Finite difference displacement (Bohr)

real(kind=dp), public :: hessian_pressure = DEFAULT_PRESSURE

Pressure for thermochemistry (atm)

real(kind=dp), public :: hessian_temperature = DEFAULT_TEMPERATURE

Temperature for thermochemistry (K)

integer, public :: index_base = 0

0-based or 1-based indexing

character(len=:), public, allocatable :: log_level
integer, public :: max_intersection_level = DEFAULT_MAX_INTERSECTION

Maximum k-way intersection depth for GMBE

integer(kind=int32), public :: method = METHOD_TYPE_GFN2
type(molecule_t), public, allocatable :: molecules(:)

Array of molecules (if nmol > 0)

integer, public :: multiplicity = 1
integer, public :: nbonds = 0
integer, public :: nbroken = 0
integer, public :: nfrag = 0
integer, public :: nmol = 0

Number of molecules (0 = single molecule mode for backward compatibility)

integer, public :: scf_maxiter = 300

Using 300 (parser-specific, different from DEFAULT_SCF_MAXITER)

real(kind=dp), public :: scf_tolerance = DEFAULT_SCF_CONV
character(len=:), public, allocatable :: schema_name
character(len=:), public, allocatable :: schema_version
logical, public :: skip_json_output = .false.

Skip JSON output for large calculations

character(len=:), public, allocatable :: solvation_model

Solvation model: “alpb” (default), “gbsa”, or “cpcm”

character(len=:), public, allocatable :: solvent

Solvent name (e.g., “water”, “ethanol”) or empty for gas phase

character(len=:), public, allocatable :: units

angstrom or bohr

logical, public :: use_cds = .true.

Include non-polar CDS terms in solvation (not for CPCM)

logical, public :: use_shift = .true.

Include solution state shift in solvation (not for CPCM)

Type-Bound Procedures

procedure, public :: destroy => config_destroy

Functions

public function parse_method_string(method_str) result(method_type)

Parse method string from input file (e.g., “XTB-GFN1” -> gfn1)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: method_str

Return Value integer(kind=int32)

public pure function strip_comment(line) result(stripped)

Remove comments (! or #) from a line and trim result

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: line

Return Value character(len=:), allocatable


Subroutines

public subroutine read_mqc_file(filename, config, error)

Read and parse a .mqc format input file

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: filename
type(mqc_config_t), intent(out) :: config
type(error_t), intent(out) :: error

public subroutine skip_to_end(unit, error)

Skip lines until ‘end’ marker is found

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: unit
type(error_t), intent(out) :: error

private subroutine config_destroy(this)

Clean up allocated memory in mqc_config_t

Arguments

Type IntentOptional Attributes Name
class(mqc_config_t), intent(inout) :: this

private subroutine input_fragment_destroy(this)

Clean up allocated memory in input_fragment_t

Arguments

Type IntentOptional Attributes Name
class(input_fragment_t), intent(inout) :: this

private subroutine molecule_destroy(this)

Clean up allocated memory in molecule_t

Arguments

Type IntentOptional Attributes Name
class(molecule_t), intent(inout) :: this