Skip to content

Read .CHRG / .UHF from dirname of coordinate file #81

@awvwgk

Description

@awvwgk

Like in xtb the .CHRG and .UHF files can be used to specify the total charge and number of unpaired electrons, respectively. However, this behavior seems somewhat uninituitive in case a path to a coordinate file is given while .CHRG / .UHF can only be in the working directory.

tblite/app/driver_run.f90

Lines 93 to 105 in 5db81cc

inquire(file='.CHRG', exist=exist)
if (exist) then
open(file='.CHRG', newunit=unit)
read(unit, *, iostat=stat) charge
if (stat == 0) then
mol%charge = charge
if (config%verbosity > 0) call info(ctx, "Molecular charge read from .CHRG")
else
if (config%verbosity > 0) call warn(ctx, &
"Could not read molecular charge read from .CHRG")
end if
close(unit)
end if

An alternative implementation using the dirname of the coordinate file can be found in mctc-convert.

cc @marvinfriede

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions