mmpol_init Subroutine

public subroutine mmpol_init(sys_obj, l_ff_type, l_mm_atoms, l_pol_atoms)

Uses

  • proc~~mmpol_init~~UsesGraph proc~mmpol_init mmpol_init module~mod_io mod_io proc~mmpol_init->module~mod_io module~mod_profiling mod_profiling proc~mmpol_init->module~mod_profiling module~mod_constants mod_constants proc~mmpol_init->module~mod_constants module~mod_electrostatics mod_electrostatics proc~mmpol_init->module~mod_electrostatics module~mod_io->module~mod_constants module~mod_profiling->module~mod_io module~mod_profiling->module~mod_constants module~mod_memory mod_memory module~mod_profiling->module~mod_memory iso_c_binding iso_c_binding module~mod_constants->iso_c_binding module~mod_electrostatics->module~mod_io module~mod_electrostatics->module~mod_profiling module~mod_electrostatics->module~mod_constants module~mod_electrostatics->module~mod_memory module~mod_adjacency_mat mod_adjacency_mat module~mod_electrostatics->module~mod_adjacency_mat module~mod_topology mod_topology module~mod_electrostatics->module~mod_topology module~mod_memory->module~mod_io module~mod_memory->module~mod_constants module~mod_memory->iso_c_binding module~mod_adjacency_mat->module~mod_memory module~mod_topology->module~mod_memory module~mod_topology->module~mod_adjacency_mat

Performs all the memory allocation and vector initialization needed to run the openMMPol library

Allocation topology... ... and electrostatics

Arguments

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

The object to be initialized

integer(kind=ip), intent(in) :: l_ff_type

Force field type used in initialization

integer(kind=ip), intent(in) :: l_mm_atoms

Number of MM atoms used in initialization

integer(kind=ip), intent(in) :: l_pol_atoms

Number of polarizable atoms used in initialization


Calls

proc~~mmpol_init~~CallsGraph proc~mmpol_init mmpol_init proc~time_push time_push proc~mmpol_init->proc~time_push proc~topology_init topology_init proc~mmpol_init->proc~topology_init proc~fatal_error fatal_error proc~mmpol_init->proc~fatal_error proc~time_pull time_pull proc~mmpol_init->proc~time_pull proc~electrostatics_init electrostatics_init proc~mmpol_init->proc~electrostatics_init proc~time_push->proc~fatal_error proc~mem_stat mem_stat proc~time_push->proc~mem_stat interface~mallocate mallocate proc~topology_init->interface~mallocate proc~ommp_message ommp_message proc~fatal_error->proc~ommp_message proc~close_output close_output proc~fatal_error->proc~close_output proc~time_pull->proc~fatal_error proc~time_pull->proc~mem_stat proc~time_pull->proc~ommp_message proc~electrostatics_init->interface~mallocate proc~memory_init memory_init proc~mem_stat->proc~memory_init proc~r_alloc1 r_alloc1 interface~mallocate->proc~r_alloc1 proc~i_alloc1 i_alloc1 interface~mallocate->proc~i_alloc1 proc~r_alloc3 r_alloc3 interface~mallocate->proc~r_alloc3 proc~i_alloc2 i_alloc2 interface~mallocate->proc~i_alloc2 proc~r_alloc2 r_alloc2 interface~mallocate->proc~r_alloc2 proc~i_alloc3 i_alloc3 interface~mallocate->proc~i_alloc3 proc~l_alloc1 l_alloc1 interface~mallocate->proc~l_alloc1 proc~l_alloc2 l_alloc2 interface~mallocate->proc~l_alloc2 proc~close_output->proc~ommp_message proc~r_alloc1->proc~memory_init proc~chk_alloc chk_alloc proc~r_alloc1->proc~chk_alloc proc~i_alloc1->proc~memory_init proc~i_alloc1->proc~chk_alloc proc~r_alloc3->proc~memory_init proc~r_alloc3->proc~chk_alloc proc~i_alloc2->proc~memory_init proc~i_alloc2->proc~chk_alloc proc~r_alloc2->proc~memory_init proc~r_alloc2->proc~chk_alloc proc~i_alloc3->proc~memory_init proc~i_alloc3->proc~chk_alloc proc~l_alloc1->proc~memory_init proc~l_alloc1->proc~chk_alloc proc~l_alloc2->proc~memory_init proc~l_alloc2->proc~chk_alloc proc~chk_alloc->proc~fatal_error

Called by

proc~~mmpol_init~~CalledByGraph proc~mmpol_init mmpol_init proc~mmpol_init_from_mmp mmpol_init_from_mmp proc~mmpol_init_from_mmp->proc~mmpol_init proc~mmpol_init_from_xyz mmpol_init_from_xyz proc~mmpol_init_from_xyz->proc~mmpol_init proc~ommp_system_from_qm_helper ommp_system_from_qm_helper proc~ommp_system_from_qm_helper->proc~mmpol_init proc~ommp_init_mmp ommp_init_mmp proc~ommp_init_mmp->proc~mmpol_init_from_mmp program~test_si_geomgrad_num test_SI_geomgrad_num program~test_si_geomgrad_num->proc~ommp_system_from_qm_helper program~test_si_geomgrad test_SI_geomgrad program~test_si_geomgrad->proc~ommp_system_from_qm_helper proc~ommp_init_xyz ommp_init_xyz proc~ommp_init_xyz->proc~mmpol_init_from_xyz 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 proc~c_ommp_init_mmp C_ommp_init_mmp proc~c_ommp_init_mmp->proc~ommp_init_mmp 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(sys_obj, l_ff_type, l_mm_atoms, l_pol_atoms)
        !! Performs all the memory allocation and vector initialization
        !! needed to run the openMMPol library
        
        use mod_constants, only: OMMP_FF_AMBER, OMMP_FF_AMOEBA, OMMP_FF_UNKNOWN
        use mod_electrostatics, only: electrostatics_init
        use mod_io, only: print_matrix, fatal_error
        use mod_profiling, only: time_push, time_pull

        implicit none

        type(ommp_system), intent(inout) :: sys_obj
        !! The object to be initialized
        integer(ip), intent(in) :: l_ff_type
        !! Force field type used in initialization
        integer(ip), intent(in) :: l_mm_atoms
        !! Number of MM atoms used in initialization
        integer(ip), intent(in) :: l_pol_atoms
        !! Number of polarizable atoms used in initialization
        
        call time_push()

        !! Allocation topology...
        allocate(sys_obj%top)
        !! ... and electrostatics
        allocate(sys_obj%eel)
        
        ! FF related settings
        if(l_ff_type == OMMP_FF_UNKNOWN) then
            call fatal_error("Cannot initialize an UNKNOWN forcefield!")
        end if
        sys_obj%ff_type = l_ff_type
        
        if(sys_obj%ff_type == OMMP_FF_AMOEBA) then
            sys_obj%amoeba = .true.
        else if(sys_obj%ff_type == OMMP_FF_AMBER) then
            sys_obj%amoeba = .false.
        end if
        
        ! Initialization of sub-modules:
        !   a. topology
        call topology_init(sys_obj%top, l_mm_atoms)
        !   b. electrostatics
        call electrostatics_init(sys_obj%eel, sys_obj%amoeba, l_pol_atoms, &
                                 sys_obj%top)

        ! Everything is done
        sys_obj%mmpol_is_init = .true.
        call time_pull('MMPol object creation (mmpol_init)')
    end subroutine mmpol_init