Convert a molecule_t to system_geometry_t Handles both unfragmented (nfrag=0) and fragmented molecules
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(molecule_t), | intent(in) | :: | mol | |||
| type(system_geometry_t), | intent(out) | :: | sys_geom | |||
| logical, | intent(in) | :: | use_angstrom | |||
| logical, | intent(in) | :: | allow_overlapping | |||
| type(error_t), | intent(out) | :: | error |
subroutine molecule_to_system_geometry(mol, sys_geom, use_angstrom, allow_overlapping, error) !! Convert a molecule_t to system_geometry_t !! Handles both unfragmented (nfrag=0) and fragmented molecules use mqc_config_parser, only: molecule_t type(molecule_t), intent(in) :: mol type(system_geometry_t), intent(out) :: sys_geom logical, intent(in) :: use_angstrom type(error_t), intent(out) :: error logical, intent(in) :: allow_overlapping ! Check if geometry is loaded if (mol%geometry%natoms == 0) then call error%set(ERROR_VALIDATION, "No geometry loaded in molecule") return end if if (mol%nfrag == 0) then ! Unfragmented molecule call geometry_to_system_unfragmented(mol%geometry, sys_geom, use_angstrom) sys_geom%charge = mol%charge sys_geom%multiplicity = mol%multiplicity else ! Fragmented molecule call initialize_fragmented_system(mol%nfrag, mol%geometry, mol%fragments, & mol%charge, mol%multiplicity, & allow_overlapping, use_angstrom, & sys_geom, error) end if end subroutine molecule_to_system_geometry