molecule_to_system_geometry Subroutine

private subroutine molecule_to_system_geometry(mol, sys_geom, use_angstrom, allow_overlapping, error)

Uses

  • proc~~molecule_to_system_geometry~~UsesGraph proc~molecule_to_system_geometry molecule_to_system_geometry module~mqc_config_parser mqc_config_parser proc~molecule_to_system_geometry->module~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

Convert a molecule_t to system_geometry_t Handles both unfragmented (nfrag=0) and fragmented molecules

Arguments

Type IntentOptional 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

Calls

proc~~molecule_to_system_geometry~~CallsGraph proc~molecule_to_system_geometry molecule_to_system_geometry proc~error_set error_t%error_set proc~molecule_to_system_geometry->proc~error_set proc~geometry_to_system_unfragmented geometry_to_system_unfragmented proc~molecule_to_system_geometry->proc~geometry_to_system_unfragmented proc~initialize_fragmented_system initialize_fragmented_system proc~molecule_to_system_geometry->proc~initialize_fragmented_system proc~element_symbol_to_number element_symbol_to_number proc~geometry_to_system_unfragmented->proc~element_symbol_to_number proc~to_bohr to_bohr proc~geometry_to_system_unfragmented->proc~to_bohr proc~check_fragment_overlap check_fragment_overlap proc~initialize_fragmented_system->proc~check_fragment_overlap proc~initialize_fragmented_system->proc~element_symbol_to_number proc~error_add_context error_t%error_add_context proc~initialize_fragmented_system->proc~error_add_context proc~error_has_error error_t%error_has_error proc~initialize_fragmented_system->proc~error_has_error proc~initialize_fragmented_system->proc~to_bohr proc~check_fragment_overlap->proc~error_set to_char to_char proc~check_fragment_overlap->to_char to_lower to_lower proc~element_symbol_to_number->to_lower to_upper to_upper proc~element_symbol_to_number->to_upper

Called by

proc~~molecule_to_system_geometry~~CalledByGraph proc~molecule_to_system_geometry molecule_to_system_geometry proc~config_to_system_geometry config_to_system_geometry proc~config_to_system_geometry->proc~molecule_to_system_geometry proc~run_multi_molecule_calculations run_multi_molecule_calculations proc~run_multi_molecule_calculations->proc~config_to_system_geometry program~main main program~main->proc~config_to_system_geometry program~main->proc~run_multi_molecule_calculations

Source Code

   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