mmpol_init_from_xyz Subroutine

public subroutine mmpol_init_from_xyz(sys_obj, xyz_file, prm_file)

Uses

  • proc~~mmpol_init_from_xyz~~UsesGraph proc~mmpol_init_from_xyz mmpol_init_from_xyz module~mod_constants mod_constants proc~mmpol_init_from_xyz->module~mod_constants module~mod_adjacency_mat mod_adjacency_mat proc~mmpol_init_from_xyz->module~mod_adjacency_mat module~mod_io mod_io proc~mmpol_init_from_xyz->module~mod_io module~mod_topology mod_topology proc~mmpol_init_from_xyz->module~mod_topology module~mod_memory mod_memory proc~mmpol_init_from_xyz->module~mod_memory module~mod_electrostatics mod_electrostatics proc~mmpol_init_from_xyz->module~mod_electrostatics module~mod_utils mod_utils proc~mmpol_init_from_xyz->module~mod_utils module~mod_mmpol mod_mmpol proc~mmpol_init_from_xyz->module~mod_mmpol module~mod_prm mod_prm proc~mmpol_init_from_xyz->module~mod_prm iso_c_binding iso_c_binding module~mod_constants->iso_c_binding module~mod_adjacency_mat->module~mod_memory module~mod_io->module~mod_constants module~mod_topology->module~mod_adjacency_mat module~mod_topology->module~mod_memory module~mod_memory->module~mod_constants module~mod_memory->module~mod_io module~mod_memory->iso_c_binding module~mod_electrostatics->module~mod_constants module~mod_electrostatics->module~mod_adjacency_mat module~mod_electrostatics->module~mod_io module~mod_electrostatics->module~mod_topology module~mod_electrostatics->module~mod_memory module~fmmlib_interface fmmlib_interface module~mod_electrostatics->module~fmmlib_interface module~mod_profiling mod_profiling module~mod_electrostatics->module~mod_profiling module~mod_utils->module~mod_constants module~mod_utils->module~mod_memory module~mod_mmpol->module~mod_constants module~mod_mmpol->module~mod_adjacency_mat module~mod_mmpol->module~mod_io module~mod_mmpol->module~mod_topology module~mod_mmpol->module~mod_memory module~mod_mmpol->module~mod_electrostatics module~mod_link_atom mod_link_atom module~mod_mmpol->module~mod_link_atom module~mod_bonded mod_bonded module~mod_mmpol->module~mod_bonded module~mod_nonbonded mod_nonbonded module~mod_mmpol->module~mod_nonbonded module~mod_prm->module~mod_constants module~mod_prm->module~mod_io module~mod_prm->module~mod_topology module~mod_prm->module~mod_memory module~mod_prm->module~mod_electrostatics module~mod_prm->module~mod_utils module~mod_prm->module~mod_bonded module~mod_link_atom->module~mod_constants module~mod_link_atom->module~mod_io module~mod_link_atom->module~mod_topology module~mod_link_atom->module~mod_memory module~mod_link_atom->module~mod_utils module~mod_link_atom->module~mod_bonded module~mod_link_atom->module~mod_nonbonded module~fmmlib_interface->module~mod_constants module~mod_tree mod_tree module~fmmlib_interface->module~mod_tree module~mod_ribtree mod_ribtree module~fmmlib_interface->module~mod_ribtree module~mod_harmonics mod_harmonics module~fmmlib_interface->module~mod_harmonics module~mod_fmm_utils mod_fmm_utils module~fmmlib_interface->module~mod_fmm_utils module~mod_fmm mod_fmm module~fmmlib_interface->module~mod_fmm module~mod_octatree mod_octatree module~fmmlib_interface->module~mod_octatree module~mod_profiling->module~mod_constants module~mod_profiling->module~mod_io module~mod_profiling->module~mod_memory module~mod_bonded->module~mod_io module~mod_bonded->module~mod_topology module~mod_bonded->module~mod_memory module~mod_nonbonded->module~mod_constants module~mod_nonbonded->module~mod_adjacency_mat module~mod_nonbonded->module~mod_topology module~mod_nonbonded->module~mod_memory module~mod_neighbor_list mod_neighbor_list module~mod_nonbonded->module~mod_neighbor_list module~mod_tree->module~mod_constants module~mod_tree->module~mod_adjacency_mat module~mod_tree->module~mod_fmm_utils module~mod_ribtree->module~mod_constants module~mod_ribtree->module~mod_profiling module~mod_ribtree->module~mod_tree module~mod_ribtree->module~mod_fmm_utils module~mod_harmonics->module~mod_constants module~mod_harmonics->module~mod_fmm_utils module~mod_fmm_utils->module~mod_constants module~mod_fmm->module~mod_constants module~mod_fmm->module~mod_tree module~mod_fmm->module~mod_harmonics module~mod_fmm->module~mod_fmm_utils module~mod_octatree->module~mod_constants module~mod_octatree->module~mod_profiling module~mod_octatree->module~mod_tree module~mod_octatree->module~mod_fmm_utils module~mod_neighbor_list->module~mod_adjacency_mat module~mod_neighbor_list->module~mod_io module~mod_neighbor_list->module~mod_memory

This function read a Tinker xyz and prm files and initialize all the quantities need to describe the environment within this library.

Arguments

Type IntentOptional Attributes Name
type(ommp_system), intent(inout), target :: sys_obj

The system object to be initialized

character(len=*), intent(in) :: xyz_file

name of the input XYZ file

character(len=*), intent(in) :: prm_file

name of the input PRM file


Calls

proc~~mmpol_init_from_xyz~~CallsGraph proc~mmpol_init_from_xyz mmpol_init_from_xyz proc~mmpol_init mmpol_init proc~mmpol_init_from_xyz->proc~mmpol_init proc~assign_bond assign_bond proc~mmpol_init_from_xyz->proc~assign_bond proc~assign_imptorsion assign_imptorsion proc~mmpol_init_from_xyz->proc~assign_imptorsion proc~assign_opb assign_opb proc~mmpol_init_from_xyz->proc~assign_opb proc~adj_mat_from_conn adj_mat_from_conn proc~mmpol_init_from_xyz->proc~adj_mat_from_conn proc~fatal_error fatal_error proc~mmpol_init_from_xyz->proc~fatal_error proc~check_keyword~2 check_keyword proc~mmpol_init_from_xyz->proc~check_keyword~2 proc~ommp_message ommp_message proc~mmpol_init_from_xyz->proc~ommp_message proc~large_file_read large_file_read proc~mmpol_init_from_xyz->proc~large_file_read proc~str_uncomment str_uncomment proc~mmpol_init_from_xyz->proc~str_uncomment interface~mallocate mallocate proc~mmpol_init_from_xyz->interface~mallocate proc~isreal isreal proc~mmpol_init_from_xyz->proc~isreal proc~assign_torsion assign_torsion proc~mmpol_init_from_xyz->proc~assign_torsion proc~tokenize_pure tokenize_pure proc~mmpol_init_from_xyz->proc~tokenize_pure proc~assign_urey assign_urey proc~mmpol_init_from_xyz->proc~assign_urey proc~assign_vdw assign_vdw proc~mmpol_init_from_xyz->proc~assign_vdw interface~atoi atoi proc~mmpol_init_from_xyz->interface~atoi proc~mmpol_init_bonded mmpol_init_bonded proc~mmpol_init_from_xyz->proc~mmpol_init_bonded proc~assign_pitors assign_pitors proc~mmpol_init_from_xyz->proc~assign_pitors proc~assign_tortors assign_tortors proc~mmpol_init_from_xyz->proc~assign_tortors proc~assign_pol assign_pol proc~mmpol_init_from_xyz->proc~assign_pol proc~build_conn_upto_n build_conn_upto_n proc~mmpol_init_from_xyz->proc~build_conn_upto_n proc~time_push time_push proc~mmpol_init_from_xyz->proc~time_push proc~time_pull time_pull proc~mmpol_init_from_xyz->proc~time_pull proc~str_to_lower str_to_lower proc~mmpol_init_from_xyz->proc~str_to_lower proc~get_prm_ff_type get_prm_ff_type proc~mmpol_init_from_xyz->proc~get_prm_ff_type proc~mmpol_init_nonbonded mmpol_init_nonbonded proc~mmpol_init_from_xyz->proc~mmpol_init_nonbonded proc~check_conn_matrix check_conn_matrix proc~mmpol_init_from_xyz->proc~check_conn_matrix proc~assign_angle assign_angle proc~mmpol_init_from_xyz->proc~assign_angle interface~mfree mfree proc~mmpol_init_from_xyz->interface~mfree proc~assign_mpoles assign_mpoles proc~mmpol_init_from_xyz->proc~assign_mpoles proc~assign_angtor assign_angtor proc~mmpol_init_from_xyz->proc~assign_angtor proc~mmpol_prepare mmpol_prepare proc~mmpol_init_from_xyz->proc~mmpol_prepare proc~assign_strbnd assign_strbnd proc~mmpol_init_from_xyz->proc~assign_strbnd interface~atof atof proc~mmpol_init_from_xyz->interface~atof proc~assign_strtor assign_strtor proc~mmpol_init_from_xyz->proc~assign_strtor proc~mmpol_init->proc~fatal_error proc~mmpol_init->proc~time_push proc~mmpol_init->proc~time_pull proc~electrostatics_init electrostatics_init proc~mmpol_init->proc~electrostatics_init proc~topology_init topology_init proc~mmpol_init->proc~topology_init proc~assign_bond->proc~fatal_error proc~assign_bond->proc~ommp_message proc~assign_bond->interface~mallocate proc~assign_bond->proc~isreal proc~assign_bond->interface~mfree proc~read_atom_cards read_atom_cards proc~assign_bond->proc~read_atom_cards proc~bond_init bond_init proc~assign_bond->proc~bond_init proc~tokenize tokenize proc~assign_bond->proc~tokenize proc~isint isint proc~assign_bond->proc~isint proc~assign_imptorsion->proc~fatal_error proc~assign_imptorsion->interface~mallocate proc~assign_imptorsion->proc~isreal proc~assign_imptorsion->interface~mfree proc~assign_imptorsion->proc~read_atom_cards proc~assign_imptorsion->proc~tokenize proc~assign_imptorsion->proc~isint proc~imptorsion_init imptorsion_init proc~assign_imptorsion->proc~imptorsion_init proc~assign_opb->proc~fatal_error proc~assign_opb->interface~mallocate proc~assign_opb->proc~isreal proc~assign_opb->interface~mfree proc~assign_opb->proc~read_atom_cards proc~opb_init opb_init proc~assign_opb->proc~opb_init proc~assign_opb->proc~tokenize proc~assign_opb->proc~isint proc~adj_mat_from_conn->interface~mallocate proc~adj_mat_from_conn->interface~mfree proc~compress_list compress_list proc~adj_mat_from_conn->proc~compress_list proc~sort_ivec_inplace sort_ivec_inplace proc~adj_mat_from_conn->proc~sort_ivec_inplace proc~fatal_error->proc~ommp_message proc~close_output close_output proc~fatal_error->proc~close_output proc~check_keyword~2->proc~ommp_message proc~check_keyword~2->proc~str_to_lower proc~keyword_is_recognized~2 keyword_is_recognized proc~check_keyword~2->proc~keyword_is_recognized~2 proc~keyword_is_implemented~2 keyword_is_implemented proc~check_keyword~2->proc~keyword_is_implemented~2 proc~starts_with_alpha starts_with_alpha proc~check_keyword~2->proc~starts_with_alpha proc~check_keyword~2->proc~tokenize proc~keyword_is_ignored~2 keyword_is_ignored proc~check_keyword~2->proc~keyword_is_ignored~2 proc~large_file_read->proc~fatal_error proc~i_alloc1 i_alloc1 interface~mallocate->proc~i_alloc1 proc~i_alloc3 i_alloc3 interface~mallocate->proc~i_alloc3 proc~l_alloc2 l_alloc2 interface~mallocate->proc~l_alloc2 proc~r_alloc2 r_alloc2 interface~mallocate->proc~r_alloc2 proc~r_alloc3 r_alloc3 interface~mallocate->proc~r_alloc3 proc~r_alloc1 r_alloc1 interface~mallocate->proc~r_alloc1 proc~l_alloc1 l_alloc1 interface~mallocate->proc~l_alloc1 proc~i_alloc2 i_alloc2 interface~mallocate->proc~i_alloc2 proc~assign_torsion->proc~fatal_error proc~assign_torsion->interface~mallocate proc~assign_torsion->proc~isreal proc~assign_torsion->interface~mfree proc~assign_torsion->proc~read_atom_cards proc~torsion_init torsion_init proc~assign_torsion->proc~torsion_init proc~assign_torsion->proc~tokenize proc~assign_torsion->proc~isint proc~assign_urey->proc~fatal_error proc~assign_urey->interface~mallocate proc~assign_urey->proc~isreal proc~assign_urey->interface~mfree proc~assign_urey->proc~read_atom_cards proc~assign_urey->proc~tokenize proc~assign_urey->proc~isint proc~urey_init urey_init proc~assign_urey->proc~urey_init proc~assign_vdw->proc~fatal_error proc~assign_vdw->interface~mallocate proc~assign_vdw->proc~isreal proc~assign_vdw->interface~mfree proc~assign_vdw->proc~read_atom_cards proc~vdw_init vdw_init proc~assign_vdw->proc~vdw_init proc~assign_vdw->proc~tokenize proc~assign_vdw->proc~isint proc~vdw_set_pair vdw_set_pair proc~assign_vdw->proc~vdw_set_pair proc~assign_pitors->proc~fatal_error proc~assign_pitors->interface~mallocate proc~assign_pitors->proc~isreal proc~assign_pitors->interface~mfree proc~assign_pitors->proc~read_atom_cards proc~pitors_init pitors_init proc~assign_pitors->proc~pitors_init proc~assign_pitors->proc~tokenize proc~assign_pitors->proc~isint proc~assign_tortors->proc~fatal_error proc~assign_tortors->interface~mallocate proc~assign_tortors->proc~isreal proc~assign_tortors->interface~mfree proc~tortor_init tortor_init proc~assign_tortors->proc~tortor_init proc~assign_tortors->proc~read_atom_cards proc~assign_tortors->proc~tokenize proc~assign_tortors->proc~isint proc~tortor_newmap tortor_newmap proc~assign_tortors->proc~tortor_newmap proc~assign_pol->proc~fatal_error proc~assign_pol->interface~mallocate proc~assign_pol->proc~isreal proc~assign_pol->interface~mfree proc~set_screening_parameters set_screening_parameters proc~assign_pol->proc~set_screening_parameters proc~assign_pol->proc~tokenize proc~assign_pol->proc~isint proc~copy_yale_sparse copy_yale_sparse proc~build_conn_upto_n->proc~copy_yale_sparse proc~sparse_identity sparse_identity proc~build_conn_upto_n->proc~sparse_identity proc~mat_mult mat_mult proc~build_conn_upto_n->proc~mat_mult proc~mat_andnot mat_andnot proc~build_conn_upto_n->proc~mat_andnot proc~free_yale_sparse free_yale_sparse proc~build_conn_upto_n->proc~free_yale_sparse proc~time_push->proc~fatal_error proc~mem_stat mem_stat proc~time_push->proc~mem_stat proc~time_pull->proc~fatal_error proc~time_pull->proc~ommp_message proc~time_pull->proc~mem_stat proc~get_prm_ff_type->proc~tokenize proc~check_conn_matrix->proc~fatal_error proc~check_conn_matrix->proc~build_conn_upto_n proc~check_conn_matrix->proc~copy_yale_sparse proc~check_conn_matrix->proc~free_yale_sparse proc~assign_angle->proc~fatal_error proc~assign_angle->proc~ommp_message proc~assign_angle->interface~mallocate proc~assign_angle->proc~isreal proc~assign_angle->interface~mfree proc~assign_angle->proc~read_atom_cards proc~angle_init angle_init proc~assign_angle->proc~angle_init proc~assign_angle->proc~tokenize proc~assign_angle->proc~isint proc~l_free1 l_free1 interface~mfree->proc~l_free1 proc~l_free2 l_free2 interface~mfree->proc~l_free2 proc~i_free2 i_free2 interface~mfree->proc~i_free2 proc~r_free2 r_free2 interface~mfree->proc~r_free2 proc~r_free1 r_free1 interface~mfree->proc~r_free1 proc~i_free3 i_free3 interface~mfree->proc~i_free3 proc~r_free3 r_free3 interface~mfree->proc~r_free3 proc~i_free1 i_free1 interface~mfree->proc~i_free1 proc~assign_mpoles->proc~fatal_error proc~assign_mpoles->proc~ommp_message proc~assign_mpoles->interface~mallocate proc~assign_mpoles->proc~isreal proc~assign_mpoles->interface~mfree proc~assign_mpoles->proc~set_screening_parameters proc~assign_mpoles->proc~tokenize proc~assign_mpoles->proc~isint proc~assign_angtor->proc~fatal_error proc~assign_angtor->interface~mallocate proc~assign_angtor->proc~isreal proc~assign_angtor->interface~mfree proc~assign_angtor->proc~read_atom_cards proc~angtor_init angtor_init proc~assign_angtor->proc~angtor_init proc~assign_angtor->proc~tokenize proc~assign_angtor->proc~isint proc~mmpol_prepare->proc~ommp_message proc~mmpol_prepare->proc~build_conn_upto_n proc~mmpol_prepare->proc~time_push proc~mmpol_prepare->proc~time_pull proc~mmpol_prepare->proc~copy_yale_sparse proc~make_screening_lists make_screening_lists proc~mmpol_prepare->proc~make_screening_lists proc~reverse_grp_tab reverse_grp_tab proc~mmpol_prepare->proc~reverse_grp_tab proc~rotate_multipoles rotate_multipoles proc~mmpol_prepare->proc~rotate_multipoles proc~thole_init thole_init proc~mmpol_prepare->proc~thole_init proc~build_pg_adjacency_matrix build_pg_adjacency_matrix proc~mmpol_prepare->proc~build_pg_adjacency_matrix proc~remove_null_pol remove_null_pol proc~mmpol_prepare->proc~remove_null_pol proc~fmm_coordinates_update fmm_coordinates_update proc~mmpol_prepare->proc~fmm_coordinates_update proc~assign_strbnd->proc~fatal_error proc~assign_strbnd->interface~mallocate proc~assign_strbnd->proc~isreal proc~assign_strbnd->interface~mfree proc~assign_strbnd->proc~read_atom_cards proc~strbnd_init strbnd_init proc~assign_strbnd->proc~strbnd_init proc~assign_strbnd->proc~tokenize proc~assign_strbnd->proc~isint proc~assign_strtor->proc~fatal_error proc~assign_strtor->interface~mallocate proc~assign_strtor->proc~isreal proc~assign_strtor->interface~mfree proc~assign_strtor->proc~read_atom_cards proc~strtor_init strtor_init proc~assign_strtor->proc~strtor_init proc~assign_strtor->proc~tokenize proc~assign_strtor->proc~isint proc~tortor_init->interface~mallocate proc~memory_init memory_init proc~mem_stat->proc~memory_init proc~chk_free chk_free proc~l_free1->proc~chk_free proc~make_screening_lists->interface~mallocate proc~make_screening_lists->interface~mfree proc~make_screening_lists->proc~compress_list proc~make_screening_lists->proc~free_yale_sparse proc~fmm_make_neigh_list fmm_make_neigh_list proc~make_screening_lists->proc~fmm_make_neigh_list proc~fmm_list_are_near fmm_list_are_near proc~make_screening_lists->proc~fmm_list_are_near proc~screening_rules screening_rules proc~make_screening_lists->proc~screening_rules proc~compress_data compress_data proc~make_screening_lists->proc~compress_data proc~reverse_grp_tab->interface~mallocate proc~reverse_grp_tab->interface~mfree proc~reverse_grp_tab->proc~compress_list proc~i_alloc1->proc~memory_init proc~chk_alloc chk_alloc proc~i_alloc1->proc~chk_alloc proc~read_atom_cards->proc~fatal_error proc~read_atom_cards->interface~mallocate proc~read_atom_cards->interface~mfree proc~read_atom_cards->proc~tokenize proc~read_atom_cards->proc~isint proc~count_substr_occurence count_substr_occurence proc~read_atom_cards->proc~count_substr_occurence proc~opb_init->proc~fatal_error proc~opb_init->proc~ommp_message proc~opb_init->interface~mallocate proc~compress_list->interface~mallocate proc~compress_list->interface~mfree proc~close_output->proc~ommp_message proc~i_alloc3->proc~memory_init proc~i_alloc3->proc~chk_alloc proc~l_alloc2->proc~memory_init proc~l_alloc2->proc~chk_alloc proc~torsion_init->interface~mallocate proc~vdw_init->proc~fatal_error proc~vdw_init->interface~mallocate proc~nl_init nl_init proc~vdw_init->proc~nl_init proc~reallocate_mat reallocate_mat proc~mat_mult->proc~reallocate_mat proc~mat_andnot->proc~reallocate_mat proc~angle_init->interface~mallocate proc~l_free2->proc~chk_free proc~i_free2->proc~chk_free proc~r_free2->proc~chk_free proc~rotation_matrix rotation_matrix proc~rotate_multipoles->proc~rotation_matrix proc~r_alloc2->proc~memory_init proc~r_alloc2->proc~chk_alloc proc~r_free1->proc~chk_free proc~thole_init->proc~fatal_error proc~thole_init->proc~ommp_message proc~strtor_init->interface~mallocate proc~i_free3->proc~chk_free proc~build_pg_adjacency_matrix->proc~reallocate_mat proc~strbnd_init->interface~mallocate proc~set_screening_parameters->proc~fatal_error proc~pitors_init->interface~mallocate proc~r_free3->proc~chk_free proc~angtor_init->interface~mallocate proc~r_alloc3->proc~memory_init proc~r_alloc3->proc~chk_alloc proc~r_alloc1->proc~memory_init proc~r_alloc1->proc~chk_alloc proc~electrostatics_init->interface~mallocate proc~bond_init->interface~mallocate proc~topology_init->interface~mallocate proc~imptorsion_init->interface~mallocate proc~sort_ivec_inplace->interface~mfree proc~sort_ivec sort_ivec proc~sort_ivec_inplace->proc~sort_ivec proc~l_alloc1->proc~memory_init proc~l_alloc1->proc~chk_alloc proc~tortor_newmap->interface~mallocate proc~tortor_newmap->interface~mfree proc~cyclic_spline cyclic_spline proc~tortor_newmap->proc~cyclic_spline proc~remove_null_pol->proc~ommp_message proc~remove_null_pol->interface~mallocate proc~remove_null_pol->interface~mfree proc~i_free1->proc~chk_free proc~urey_init->interface~mallocate proc~fmm_coordinates_update->proc~ommp_message proc~fmm_coordinates_update->proc~time_push proc~fmm_coordinates_update->proc~time_pull proc~init_as_octatree init_as_octatree proc~fmm_coordinates_update->proc~init_as_octatree proc~free_fmm free_fmm proc~fmm_coordinates_update->proc~free_fmm proc~free_tree free_tree proc~fmm_coordinates_update->proc~free_tree proc~fmm_coordinates_update->proc~fmm_make_neigh_list proc~fmm_init fmm_init proc~fmm_coordinates_update->proc~fmm_init proc~vdw_set_pair->interface~mallocate proc~vdw_set_pair->interface~mfree proc~i_alloc2->proc~memory_init proc~i_alloc2->proc~chk_alloc proc~fmm_error fmm_error proc~init_as_octatree->proc~fmm_error proc~populate_level_list populate_level_list proc~init_as_octatree->proc~populate_level_list proc~populate_leaf_list populate_leaf_list proc~init_as_octatree->proc~populate_leaf_list proc~tree_populate_farnear_lists tree_populate_farnear_lists proc~init_as_octatree->proc~tree_populate_farnear_lists proc~allocate_tree allocate_tree proc~init_as_octatree->proc~allocate_tree proc~sort_ivec->interface~mallocate proc~sort_ivec->interface~mfree proc~rotation_matrix->proc~fatal_error proc~free_tree->proc~free_yale_sparse proc~chk_free->proc~fatal_error proc~fmm_make_neigh_list->interface~mallocate proc~fmm_make_neigh_list->interface~mfree proc~fmm_make_neigh_list->proc~compress_list proc~screening_rules->proc~fatal_error proc~compress_data->interface~mallocate proc~chk_alloc->proc~fatal_error proc~nl_init->proc~fatal_error proc~nl_init->interface~mallocate proc~nl_update nl_update proc~nl_init->proc~nl_update proc~cyclic_spline->interface~mallocate proc~cyclic_spline->interface~mfree dgemm dgemm proc~cyclic_spline->dgemm dgetrf dgetrf proc~cyclic_spline->dgetrf dgetri dgetri proc~cyclic_spline->dgetri proc~prepare_fmmm_constants prepare_fmmm_constants proc~fmm_init->proc~prepare_fmmm_constants proc~ntot_sph_harm ntot_sph_harm proc~fmm_init->proc~ntot_sph_harm proc~make_vscales make_vscales proc~prepare_fmmm_constants->proc~make_vscales proc~make_vcnk make_vcnk proc~prepare_fmmm_constants->proc~make_vcnk proc~make_m2l_ztranslate_coef make_m2l_ztranslate_coef proc~prepare_fmmm_constants->proc~make_m2l_ztranslate_coef proc~populate_level_list->proc~compress_list proc~tree_populate_farnear_lists->proc~compress_list proc~aggregative_pass aggregative_pass proc~tree_populate_farnear_lists->proc~aggregative_pass proc~allocate_tree->proc~fmm_error proc~allocate_yale_sparse allocate_yale_sparse proc~allocate_tree->proc~allocate_yale_sparse proc~nl_update->proc~ommp_message proc~nl_update->proc~time_push proc~nl_update->proc~time_pull proc~nl_update->interface~mfree proc~nl_update->proc~reverse_grp_tab proc~make_m2l_ztranslate_coef->proc~make_vcnk

Called by

proc~~mmpol_init_from_xyz~~CalledByGraph proc~mmpol_init_from_xyz mmpol_init_from_xyz proc~ommp_init_xyz ommp_init_xyz proc~ommp_init_xyz->proc~mmpol_init_from_xyz proc~c_ommp_init_xyz C_ommp_init_xyz proc~c_ommp_init_xyz->proc~ommp_init_xyz

Contents

Source Code


Source Code

    subroutine mmpol_init_from_xyz(sys_obj, xyz_file, prm_file)
        !! This function read a Tinker xyz and prm files
        !! and initialize all the quantities need to describe the environment
        !! within this library.
        use mod_mmpol, only: mmpol_prepare, mmpol_init, mmpol_init_nonbonded, &
                             mmpol_init_bonded
        use mod_topology, only: ommp_topology_type, check_conn_matrix
        use mod_electrostatics, only: ommp_electrostatics_type
        
        use mod_memory, only: ip, mfree, mallocate, memory_init
        use mod_constants, only: angstrom2au, OMMP_VERBOSE_DEBUG
        use mod_adjacency_mat, only: adj_mat_from_conn, yale_sparse, &
                                     build_conn_upto_n
        use mod_prm, only: check_keyword, assign_pol, assign_mpoles, &
                           assign_vdw, assign_bond, assign_angle, assign_urey, &
                           assign_strbnd, assign_opb, assign_pitors, &
                           assign_torsion, assign_tortors, assign_angtor, &
                           assign_strtor, assign_imptorsion, get_prm_ff_type
        use mod_utils, only: starts_with_alpha, isreal, isint, &
                             str_to_lower, str_uncomment, &
                             tokenize_pure, atoi, atof
        use mod_io, only: large_file_read

        implicit none

        type(ommp_system), intent(inout), target :: sys_obj
        !! The system object to be initialized
        character(len=*), intent(in) :: xyz_file
        !! name of the input XYZ file
        character(len=*), intent(in) :: prm_file
        !! name of the input PRM file

        integer(ip), parameter :: iof_xyzinp = 200, &
                                  maxn12 = 8
        integer(ip) :: my_mm_atoms, ist, i, j, atom_id, lc, tokx(2)
        integer(ip), allocatable :: i12(:,:), attype(:)
        character(len=OMMP_STR_CHAR_MAX) :: msg
        character(len=OMMP_STR_CHAR_MAX), allocatable :: lines(:), prm_buf(:)
        logical :: fex
        type(yale_sparse) :: adj
        type(ommp_topology_type), pointer :: top
        type(ommp_electrostatics_type), pointer :: eel

        call time_push()
        call time_push()
        ! Check that files are present
        inquire(file=prm_file(1:len(trim(prm_file))), exist=fex)
        if(.not. fex) then
            call fatal_error("Input file '"//&
                &prm_file(1:len(trim(prm_file)))//"' does not exist.")
        end if

        inquire(file=xyz_file(1:len(trim(xyz_file))), exist=fex)
        if(.not. fex) then
            call fatal_error("Input file '"//&
                &xyz_file(1:len(trim(xyz_file)))//"' does not exist.")
        end if

        write(msg, "(A)") "Reading XYZ file: "//xyz_file(1:len(trim(xyz_file)))
        call ommp_message(msg, OMMP_VERBOSE_DEBUG)
        
        ! read tinker xyz file
        call time_push()
        call large_file_read(xyz_file, lines)
        call time_pull('XYZ File reading')
        call large_file_read(prm_file, prm_buf)
        ! Remove comments from prm file
        !$omp parallel do
        do i=1, size(prm_buf)
            prm_buf(i) = str_to_lower(prm_buf(i))
            prm_buf(i) = str_uncomment(prm_buf(i), '!')
        end do
        
        ! First line contains as first word the number of atoms and
        ! then a comment that could be ignored.
        read(lines(1), *) my_mm_atoms
        
        ! Initialize the mmpol module
        ! TODO I'm assuming that it is AMOEBA and fully polarizable
        
        call mmpol_init(sys_obj, get_prm_ff_type(prm_buf), &
                        my_mm_atoms, my_mm_atoms)
        ! Those are just shortcut
        top => sys_obj%top
        eel => sys_obj%eel

        ! Temporary quantities that are only used during the initialization
        call mallocate('mmpol_init_from_xyz [attype]', my_mm_atoms, attype)
        call mallocate('mmpol_init_from_xyz [i12]', maxn12, my_mm_atoms, i12)
       
        call time_push()
        !$omp parallel do default(shared) private(i, lc, tokx) &
        !$omp private(atom_id, j)
        do i=1, my_mm_atoms
            lc = i+1
            
            ! Initializations
            attype(i) = 0_ip
            i12(:,i) = 0_ip
            eel%polar_mm(i) = i
            eel%pol(i) = 0.0

            ! First token contains an atom ID. Only sequential numbering is
            ! currently supported.
            !dir$ forceinline
            tokx = tokenize_pure(lines(lc))
            !dir$ forceinline
            tokx = tokenize_pure(lines(lc), tokx(2))

            atom_id = atoi(lines(lc)(tokx(1):tokx(2)))
            if(atom_id /= i) then
                call fatal_error('Non-sequential atom ids in xyz cannot be handled')
            end if
            
            ! This token should contain an atom name, so it should start
            ! with a letter. If this is not true, an unexpected error should
            ! be raised.
            !dir$ forceinline
            tokx = tokenize_pure(lines(lc), tokx(2)+1)
            if(isreal(lines(lc)(tokx(1):tokx(2)))) then
                call fatal_error('Atom symbol missing (or completely numerical) or PBC string present in XYZ')
            end if

            ! The remaining part contains cartesian coordinates, atom type
            ! and connectivity for the current atom.
            do j=1, 3
                ! Read coordinates and convert to angstrom
                !dir$ forceinline
                tokx = tokenize_pure(lines(lc), tokx(2)+1)
                top%cmm(j,i) = atof(lines(lc)(tokx(1):tokx(2))) * angstrom2au
            end do
            
            !dir$ forceinline
            tokx = tokenize_pure(lines(lc), tokx(2)+1)
            attype(i) = atoi(lines(lc)(tokx(1):tokx(2)))

            do j=1, maxn12
                !dir$ forceinline
                tokx = tokenize_pure(lines(lc), tokx(2)+1)
                if(tokx(2) < 0) exit
                i12(j,i) = atoi(lines(lc)(tokx(1):tokx(2)))
            end do
        end do
        deallocate(lines)
        call time_pull('Interpreting XYZ')

        ! Writes the adjacency matrix in Yale sparse format in adj and then
        ! build the connectivity up to 4th order. This is needed here to be
        ! able to assign the parameters
        
        call adj_mat_from_conn(i12, adj)
        call build_conn_upto_n(adj, 4, top%conn, .false.)

        call mfree('mmpol_init_from_xyz [i12]', i12)
        
        if( .not. check_keyword(prm_buf)) then
            call fatal_error("PRM file cannot be completely understood")
        end if
        call time_pull("XYZ reading and topology generation")

        top%attype = attype
        top%attype_initialized = .true.
        call mfree('mmpol_init_from_xyz [attype]', attype)
       
        call time_push()
        call ommp_message("Assigning electrostatic parameters", OMMP_VERBOSE_DEBUG)
        call assign_pol(eel, prm_buf)
        call assign_mpoles(eel, prm_buf)
        
        call ommp_message("Assigning non-bonded parameters", OMMP_VERBOSE_DEBUG)
        call mmpol_init_nonbonded(sys_obj)
        call assign_vdw(sys_obj%vdw, top, prm_buf)
        
        call ommp_message("Assigning bonded parameters", OMMP_VERBOSE_DEBUG)
        call mmpol_init_bonded(sys_obj)
        call check_conn_matrix(sys_obj%top, 4)
        call assign_bond(sys_obj%bds, prm_buf)
        call assign_angle(sys_obj%bds, prm_buf)
        call assign_urey(sys_obj%bds, prm_buf)
        call assign_strbnd(sys_obj%bds, prm_buf)
        call assign_opb(sys_obj%bds, prm_buf)
        call assign_pitors(sys_obj%bds, prm_buf)
        call assign_torsion(sys_obj%bds, prm_buf)
        call assign_imptorsion(sys_obj%bds, prm_buf)
        call assign_tortors(sys_obj%bds, prm_buf)
        call assign_angtor(sys_obj%bds, prm_buf)
        call assign_strtor(sys_obj%bds, prm_buf)
        call time_pull('Total prm assignament')

        deallocate(prm_buf)

        call mmpol_prepare(sys_obj)
        call time_pull('MMPol initialization from .xyz file')

    end subroutine mmpol_init_from_xyz