ommp_system_from_qm_helper Subroutine

public subroutine ommp_system_from_qm_helper(qmh, prm_file, sys)

Uses

  • proc~~ommp_system_from_qm_helper~~UsesGraph proc~ommp_system_from_qm_helper ommp_system_from_qm_helper module~mod_constants mod_constants proc~ommp_system_from_qm_helper->module~mod_constants module~mod_adjacency_mat mod_adjacency_mat proc~ommp_system_from_qm_helper->module~mod_adjacency_mat module~mod_topology mod_topology proc~ommp_system_from_qm_helper->module~mod_topology module~mod_io mod_io proc~ommp_system_from_qm_helper->module~mod_io module~mod_utils mod_utils proc~ommp_system_from_qm_helper->module~mod_utils module~mod_mmpol mod_mmpol proc~ommp_system_from_qm_helper->module~mod_mmpol module~mod_prm mod_prm proc~ommp_system_from_qm_helper->module~mod_prm iso_c_binding iso_c_binding module~mod_constants->iso_c_binding module~mod_memory mod_memory module~mod_adjacency_mat->module~mod_memory module~mod_topology->module~mod_adjacency_mat module~mod_topology->module~mod_memory module~mod_io->module~mod_constants 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_topology module~mod_mmpol->module~mod_io module~mod_link_atom mod_link_atom module~mod_mmpol->module~mod_link_atom module~mod_electrostatics mod_electrostatics module~mod_mmpol->module~mod_electrostatics module~mod_mmpol->module~mod_memory 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_topology module~mod_prm->module~mod_io module~mod_prm->module~mod_utils module~mod_prm->module~mod_electrostatics module~mod_prm->module~mod_memory module~mod_prm->module~mod_bonded module~mod_link_atom->module~mod_constants module~mod_link_atom->module~mod_topology module~mod_link_atom->module~mod_io module~mod_link_atom->module~mod_utils module~mod_link_atom->module~mod_memory module~mod_link_atom->module~mod_bonded module~mod_link_atom->module~mod_nonbonded module~mod_electrostatics->module~mod_constants module~mod_electrostatics->module~mod_adjacency_mat module~mod_electrostatics->module~mod_topology module~mod_electrostatics->module~mod_io module~mod_electrostatics->module~mod_memory module~mod_profiling mod_profiling module~mod_electrostatics->module~mod_profiling module~fmmlib_interface fmmlib_interface module~mod_electrostatics->module~fmmlib_interface module~mod_memory->module~mod_constants module~mod_memory->module~mod_io module~mod_memory->iso_c_binding module~mod_bonded->module~mod_topology module~mod_bonded->module~mod_io 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_profiling->module~mod_constants module~mod_profiling->module~mod_io module~mod_profiling->module~mod_memory 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_neighbor_list->module~mod_adjacency_mat module~mod_neighbor_list->module~mod_io module~mod_neighbor_list->module~mod_memory 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

Takes in input a QM Helper object, with initialized atom types, and using a parameter file, it generates a OMMP System object that corresponds to the QM system. It is used for internal testing pourpose but other creative things are always possible.

Arguments

Type IntentOptional Attributes Name
type(ommp_qm_helper), intent(in) :: qmh
character(len=*), intent(in) :: prm_file
type(ommp_system), intent(inout), pointer :: sys

Calls

proc~~ommp_system_from_qm_helper~~CallsGraph proc~ommp_system_from_qm_helper ommp_system_from_qm_helper proc~assign_pitors assign_pitors proc~ommp_system_from_qm_helper->proc~assign_pitors proc~assign_imptorsion assign_imptorsion proc~ommp_system_from_qm_helper->proc~assign_imptorsion proc~assign_opb assign_opb proc~ommp_system_from_qm_helper->proc~assign_opb proc~assign_strbnd assign_strbnd proc~ommp_system_from_qm_helper->proc~assign_strbnd proc~assign_mpoles assign_mpoles proc~ommp_system_from_qm_helper->proc~assign_mpoles proc~fatal_error fatal_error proc~ommp_system_from_qm_helper->proc~fatal_error proc~large_file_read large_file_read proc~ommp_system_from_qm_helper->proc~large_file_read proc~str_uncomment str_uncomment proc~ommp_system_from_qm_helper->proc~str_uncomment proc~check_keyword~2 check_keyword proc~ommp_system_from_qm_helper->proc~check_keyword~2 proc~ommp_message ommp_message proc~ommp_system_from_qm_helper->proc~ommp_message proc~assign_urey assign_urey proc~ommp_system_from_qm_helper->proc~assign_urey proc~assign_torsion assign_torsion proc~ommp_system_from_qm_helper->proc~assign_torsion proc~assign_bond assign_bond proc~ommp_system_from_qm_helper->proc~assign_bond proc~assign_vdw assign_vdw proc~ommp_system_from_qm_helper->proc~assign_vdw proc~check_conn_matrix check_conn_matrix proc~ommp_system_from_qm_helper->proc~check_conn_matrix proc~build_conn_upto_n build_conn_upto_n proc~ommp_system_from_qm_helper->proc~build_conn_upto_n proc~mmpol_init mmpol_init proc~ommp_system_from_qm_helper->proc~mmpol_init proc~assign_tortors assign_tortors proc~ommp_system_from_qm_helper->proc~assign_tortors proc~get_prm_ff_type get_prm_ff_type proc~ommp_system_from_qm_helper->proc~get_prm_ff_type proc~str_to_lower str_to_lower proc~ommp_system_from_qm_helper->proc~str_to_lower proc~assign_pol assign_pol proc~ommp_system_from_qm_helper->proc~assign_pol proc~mmpol_init_nonbonded mmpol_init_nonbonded proc~ommp_system_from_qm_helper->proc~mmpol_init_nonbonded proc~mmpol_init_bonded mmpol_init_bonded proc~ommp_system_from_qm_helper->proc~mmpol_init_bonded proc~assign_angle assign_angle proc~ommp_system_from_qm_helper->proc~assign_angle proc~assign_angtor assign_angtor proc~ommp_system_from_qm_helper->proc~assign_angtor proc~mmpol_prepare mmpol_prepare proc~ommp_system_from_qm_helper->proc~mmpol_prepare proc~assign_strtor assign_strtor proc~ommp_system_from_qm_helper->proc~assign_strtor proc~assign_pitors->proc~fatal_error proc~read_atom_cards read_atom_cards proc~assign_pitors->proc~read_atom_cards interface~mallocate mallocate proc~assign_pitors->interface~mallocate proc~isreal isreal proc~assign_pitors->proc~isreal proc~pitors_init pitors_init proc~assign_pitors->proc~pitors_init interface~mfree mfree proc~assign_pitors->interface~mfree proc~tokenize tokenize proc~assign_pitors->proc~tokenize proc~isint isint proc~assign_pitors->proc~isint proc~assign_imptorsion->proc~fatal_error proc~assign_imptorsion->proc~read_atom_cards proc~assign_imptorsion->interface~mallocate proc~assign_imptorsion->proc~isreal proc~assign_imptorsion->interface~mfree 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->proc~read_atom_cards proc~assign_opb->interface~mallocate proc~assign_opb->proc~isreal proc~assign_opb->interface~mfree proc~opb_init opb_init proc~assign_opb->proc~opb_init proc~assign_opb->proc~tokenize proc~assign_opb->proc~isint proc~assign_strbnd->proc~fatal_error proc~assign_strbnd->proc~read_atom_cards proc~assign_strbnd->interface~mallocate proc~assign_strbnd->proc~isreal proc~assign_strbnd->interface~mfree proc~assign_strbnd->proc~tokenize proc~assign_strbnd->proc~isint proc~strbnd_init strbnd_init proc~assign_strbnd->proc~strbnd_init 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~set_screening_parameters set_screening_parameters proc~assign_mpoles->proc~set_screening_parameters proc~assign_mpoles->proc~tokenize proc~assign_mpoles->proc~isint proc~fatal_error->proc~ommp_message proc~close_output close_output proc~fatal_error->proc~close_output proc~large_file_read->proc~fatal_error 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~check_keyword~2->proc~tokenize proc~keyword_is_ignored~2 keyword_is_ignored proc~check_keyword~2->proc~keyword_is_ignored~2 proc~starts_with_alpha starts_with_alpha proc~check_keyword~2->proc~starts_with_alpha proc~assign_urey->proc~fatal_error proc~urey_init urey_init proc~assign_urey->proc~urey_init proc~assign_urey->proc~read_atom_cards proc~assign_urey->interface~mallocate proc~assign_urey->proc~isreal proc~assign_urey->interface~mfree proc~assign_urey->proc~tokenize proc~assign_urey->proc~isint proc~assign_torsion->proc~fatal_error proc~torsion_init torsion_init proc~assign_torsion->proc~torsion_init proc~assign_torsion->proc~read_atom_cards proc~assign_torsion->interface~mallocate proc~assign_torsion->proc~isreal proc~assign_torsion->interface~mfree proc~assign_torsion->proc~tokenize proc~assign_torsion->proc~isint proc~assign_bond->proc~fatal_error proc~assign_bond->proc~ommp_message proc~assign_bond->proc~read_atom_cards proc~assign_bond->interface~mallocate proc~assign_bond->proc~isreal proc~assign_bond->interface~mfree proc~bond_init bond_init proc~assign_bond->proc~bond_init proc~assign_bond->proc~tokenize proc~assign_bond->proc~isint proc~assign_vdw->proc~fatal_error proc~assign_vdw->proc~read_atom_cards proc~assign_vdw->interface~mallocate proc~assign_vdw->proc~isreal proc~assign_vdw->interface~mfree 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~check_conn_matrix->proc~fatal_error proc~check_conn_matrix->proc~build_conn_upto_n proc~copy_yale_sparse copy_yale_sparse proc~check_conn_matrix->proc~copy_yale_sparse proc~free_yale_sparse free_yale_sparse proc~check_conn_matrix->proc~free_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~build_conn_upto_n->proc~copy_yale_sparse proc~build_conn_upto_n->proc~free_yale_sparse proc~mmpol_init->proc~fatal_error proc~electrostatics_init electrostatics_init proc~mmpol_init->proc~electrostatics_init proc~time_pull time_pull proc~mmpol_init->proc~time_pull proc~topology_init topology_init proc~mmpol_init->proc~topology_init proc~time_push time_push proc~mmpol_init->proc~time_push proc~assign_tortors->proc~fatal_error proc~tortor_init tortor_init proc~assign_tortors->proc~tortor_init proc~assign_tortors->proc~read_atom_cards proc~assign_tortors->interface~mallocate proc~assign_tortors->proc~isreal proc~assign_tortors->interface~mfree proc~assign_tortors->proc~tokenize proc~assign_tortors->proc~isint proc~tortor_newmap tortor_newmap proc~assign_tortors->proc~tortor_newmap proc~get_prm_ff_type->proc~tokenize proc~assign_pol->proc~fatal_error proc~assign_pol->interface~mallocate proc~assign_pol->proc~isreal proc~assign_pol->interface~mfree proc~assign_pol->proc~set_screening_parameters proc~assign_pol->proc~tokenize proc~assign_pol->proc~isint proc~assign_angle->proc~fatal_error proc~assign_angle->proc~ommp_message proc~assign_angle->proc~read_atom_cards proc~assign_angle->interface~mallocate proc~assign_angle->proc~isreal proc~assign_angle->interface~mfree proc~angle_init angle_init proc~assign_angle->proc~angle_init proc~assign_angle->proc~tokenize proc~assign_angle->proc~isint proc~assign_angtor->proc~fatal_error proc~assign_angtor->proc~read_atom_cards proc~assign_angtor->interface~mallocate proc~assign_angtor->proc~isreal proc~assign_angtor->interface~mfree 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_pull 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~mmpol_prepare->proc~copy_yale_sparse 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~mmpol_prepare->proc~time_push proc~assign_strtor->proc~fatal_error proc~assign_strtor->proc~read_atom_cards proc~assign_strtor->interface~mallocate proc~assign_strtor->proc~isreal proc~assign_strtor->interface~mfree 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~electrostatics_init->interface~mallocate proc~time_pull->proc~fatal_error proc~time_pull->proc~ommp_message proc~mem_stat mem_stat proc~time_pull->proc~mem_stat proc~make_screening_lists->interface~mallocate proc~make_screening_lists->interface~mfree 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~compress_list compress_list proc~make_screening_lists->proc~compress_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~urey_init->interface~mallocate proc~torsion_init->interface~mallocate 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~i_alloc1 i_alloc1 interface~mallocate->proc~i_alloc1 proc~l_alloc2 l_alloc2 interface~mallocate->proc~l_alloc2 proc~i_alloc3 i_alloc3 interface~mallocate->proc~i_alloc3 proc~r_alloc2 r_alloc2 interface~mallocate->proc~r_alloc2 proc~r_alloc1 r_alloc1 interface~mallocate->proc~r_alloc1 proc~i_alloc2 i_alloc2 interface~mallocate->proc~i_alloc2 proc~r_alloc3 r_alloc3 interface~mallocate->proc~r_alloc3 proc~l_alloc1 l_alloc1 interface~mallocate->proc~l_alloc1 proc~pitors_init->interface~mallocate proc~i_free2 i_free2 interface~mfree->proc~i_free2 proc~r_free3 r_free3 interface~mfree->proc~r_free3 proc~r_free2 r_free2 interface~mfree->proc~r_free2 proc~l_free1 l_free1 interface~mfree->proc~l_free1 proc~l_free2 l_free2 interface~mfree->proc~l_free2 proc~i_free3 i_free3 interface~mfree->proc~i_free3 proc~i_free1 i_free1 interface~mfree->proc~i_free1 proc~r_free1 r_free1 interface~mfree->proc~r_free1 proc~opb_init->proc~fatal_error proc~opb_init->proc~ommp_message proc~opb_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~close_output->proc~ommp_message proc~mat_andnot->proc~reallocate_mat proc~angle_init->interface~mallocate proc~topology_init->interface~mallocate proc~rotation_matrix rotation_matrix proc~rotate_multipoles->proc~rotation_matrix proc~thole_init->proc~fatal_error proc~thole_init->proc~ommp_message proc~strtor_init->interface~mallocate proc~build_pg_adjacency_matrix->proc~reallocate_mat proc~angtor_init->interface~mallocate proc~bond_init->interface~mallocate proc~set_screening_parameters->proc~fatal_error proc~imptorsion_init->interface~mallocate proc~strbnd_init->interface~mallocate 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~fmm_coordinates_update->proc~ommp_message proc~fmm_coordinates_update->proc~time_pull proc~fmm_coordinates_update->proc~time_push proc~init_as_octatree init_as_octatree proc~fmm_coordinates_update->proc~init_as_octatree 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~free_fmm free_fmm proc~fmm_coordinates_update->proc~free_fmm proc~vdw_set_pair->interface~mallocate proc~vdw_set_pair->interface~mfree proc~time_push->proc~fatal_error proc~time_push->proc~mem_stat 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~free_tree->proc~free_yale_sparse proc~memory_init memory_init proc~i_alloc1->proc~memory_init proc~chk_alloc chk_alloc proc~i_alloc1->proc~chk_alloc proc~l_alloc2->proc~memory_init proc~l_alloc2->proc~chk_alloc proc~i_alloc3->proc~memory_init proc~i_alloc3->proc~chk_alloc proc~chk_free chk_free proc~i_free2->proc~chk_free proc~r_free3->proc~chk_free proc~fmm_make_neigh_list->interface~mallocate proc~fmm_make_neigh_list->interface~mfree proc~fmm_make_neigh_list->proc~compress_list proc~compress_list->interface~mallocate proc~compress_list->interface~mfree proc~r_free2->proc~chk_free proc~l_free1->proc~chk_free proc~l_free2->proc~chk_free proc~cyclic_spline->interface~mallocate proc~cyclic_spline->interface~mfree dgetri dgetri proc~cyclic_spline->dgetri dgemm dgemm proc~cyclic_spline->dgemm dgetrf dgetrf proc~cyclic_spline->dgetrf 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~i_free3->proc~chk_free proc~rotation_matrix->proc~fatal_error proc~i_free1->proc~chk_free proc~r_free1->proc~chk_free proc~r_alloc2->proc~memory_init proc~r_alloc2->proc~chk_alloc proc~mem_stat->proc~memory_init proc~screening_rules->proc~fatal_error proc~compress_data->interface~mallocate proc~r_alloc1->proc~memory_init proc~r_alloc1->proc~chk_alloc proc~i_alloc2->proc~memory_init proc~i_alloc2->proc~chk_alloc proc~r_alloc3->proc~memory_init proc~r_alloc3->proc~chk_alloc proc~l_alloc1->proc~memory_init proc~l_alloc1->proc~chk_alloc proc~nl_init->proc~fatal_error proc~nl_init->interface~mallocate proc~nl_update nl_update proc~nl_init->proc~nl_update 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~nl_update->proc~ommp_message proc~nl_update->proc~time_pull proc~nl_update->proc~reverse_grp_tab proc~nl_update->interface~mfree proc~nl_update->proc~time_push 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~chk_alloc->proc~fatal_error proc~chk_free->proc~fatal_error proc~make_m2l_ztranslate_coef->proc~make_vcnk

Called by

proc~~ommp_system_from_qm_helper~~CalledByGraph proc~ommp_system_from_qm_helper ommp_system_from_qm_helper proc~c_ommp_system_from_qm_helper C_ommp_system_from_qm_helper proc~c_ommp_system_from_qm_helper->proc~ommp_system_from_qm_helper

Contents


Source Code

    subroutine ommp_system_from_qm_helper(qmh, prm_file, sys)
        !! Takes in input a QM Helper object, with initialized
        !! atom types, and using a parameter file, it generates a 
        !! OMMP System object that corresponds to the QM system.
        !! It is used for internal testing pourpose but other 
        !! creative things are always possible.
        
        use mod_mmpol, only: mmpol_prepare, mmpol_init, mmpol_init_nonbonded, &
                             mmpol_init_bonded
        use mod_topology, only: check_conn_matrix
        use mod_adjacency_mat, only: 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_constants, only: OMMP_STR_CHAR_MAX
        use mod_io, only: fatal_error, large_file_read
        use mod_utils, only: str_to_lower, str_uncomment
        
        implicit none

        type(ommp_system), intent(inout), pointer :: sys
        type(ommp_qm_helper), intent(in) :: qmh
        character(len=*), intent(in) :: prm_file

        integer(ommp_integer) :: i, ist
        character(len=OMMP_STR_CHAR_MAX), allocatable :: prm_buf(:)

        if(.not. (qmh%qm_top%attype_initialized .and. &
                  qmh%qm_top%atz_initialized)) &
              call ommp_fatal("In order to convert QM Helper to &
                              &OMMP System atom types and atomic &
                              &number should be set.")

        allocate(sys)
        ! Load prm file in RAM
        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

        call mmpol_init(sys, get_prm_ff_type(prm_buf), &
                        qmh%qm_top%mm_atoms, qmh%qm_top%mm_atoms)
        
        do i=1, sys%top%mm_atoms
           sys%eel%polar_mm(i) = i 
        end do

        ! Copy the topology from QM system!
        sys%top%cmm = qmh%qm_top%cmm
        
        sys%top%use_frozen = qmh%qm_top%use_frozen
        sys%top%frozen = qmh%qm_top%frozen
        
        sys%top%atz_initialized = qmh%qm_top%atz_initialized
        sys%top%atz = qmh%qm_top%atz
        
        sys%top%attype_initialized = qmh%qm_top%attype_initialized
        sys%top%attype = qmh%qm_top%attype
        ! Create connectivities from adjacency matrix
        call build_conn_upto_n(qmh%qm_top%conn(1), 4, sys%top%conn, .false.)
        ! Now assign parameters
        
        if( .not. check_keyword(prm_buf)) then
            call ommp_fatal("PRM file cannot be completely understood")
        end if
    
        call ommp_message("QMH->SYS Assigning electrostatic parameters", OMMP_VERBOSE_DEBUG)
        call assign_pol(sys%eel, prm_buf)
        call assign_mpoles(sys%eel, prm_buf)
        
        call ommp_message("QMH->SYS Assigning non-bonded parameters", OMMP_VERBOSE_DEBUG)
        call mmpol_init_nonbonded(sys)
        call assign_vdw(sys%vdw, sys%top, prm_buf)
        
        call ommp_message("QMH->SYS Assigning bonded parameters", OMMP_VERBOSE_DEBUG)
        call mmpol_init_bonded(sys)
        call check_conn_matrix(sys%top, 4)
        call assign_bond(sys%bds, prm_buf)
        call assign_angle(sys%bds, prm_buf)
        call assign_urey(sys%bds, prm_buf)
        call assign_strbnd(sys%bds, prm_buf)
        call assign_opb(sys%bds, prm_buf)
        call assign_pitors(sys%bds, prm_buf)
        call assign_torsion(sys%bds, prm_buf)
        call assign_imptorsion(sys%bds, prm_buf)
        call assign_tortors(sys%bds, prm_buf)
        call assign_angtor(sys%bds, prm_buf)
        call assign_strtor(sys%bds, prm_buf)
        
        deallocate(prm_buf)

        call mmpol_prepare(sys)
        call ommp_message('QMH->SYS Completed', OMMP_VERBOSE_DEBUG)
    end subroutine ommp_system_from_qm_helper