vdw_init Subroutine

public subroutine vdw_init(vdw, top, vdw_type, radius_rule, radius_size, radius_type, epsrule, cutoff)

Uses

  • proc~~vdw_init~~UsesGraph proc~vdw_init vdw_init module~mod_io mod_io proc~vdw_init->module~mod_io module~mod_memory mod_memory proc~vdw_init->module~mod_memory module~mod_constants mod_constants proc~vdw_init->module~mod_constants module~mod_neighbor_list mod_neighbor_list proc~vdw_init->module~mod_neighbor_list module~mod_io->module~mod_constants module~mod_memory->module~mod_io module~mod_memory->module~mod_constants iso_c_binding iso_c_binding module~mod_memory->iso_c_binding module~mod_constants->iso_c_binding module~mod_neighbor_list->module~mod_io module~mod_neighbor_list->module~mod_memory module~mod_adjacency_mat mod_adjacency_mat module~mod_neighbor_list->module~mod_adjacency_mat module~mod_adjacency_mat->module~mod_memory

Initialize the non-bonded object allocating the parameters vectors

Arguments

Type IntentOptional Attributes Name
type(ommp_nonbonded_type), intent(inout) :: vdw
type(ommp_topology_type), intent(in), target :: top
character(len=*) :: vdw_type
character(len=*) :: radius_rule
character(len=*) :: radius_size
character(len=*) :: radius_type
character(len=*) :: epsrule
real(kind=rp) :: cutoff

Calls

proc~~vdw_init~~CallsGraph proc~vdw_init vdw_init proc~fatal_error fatal_error proc~vdw_init->proc~fatal_error interface~mallocate mallocate proc~vdw_init->interface~mallocate proc~nl_init nl_init proc~vdw_init->proc~nl_init proc~ommp_message ommp_message proc~fatal_error->proc~ommp_message proc~close_output close_output proc~fatal_error->proc~close_output proc~r_alloc1 r_alloc1 interface~mallocate->proc~r_alloc1 proc~i_alloc1 i_alloc1 interface~mallocate->proc~i_alloc1 proc~i_alloc2 i_alloc2 interface~mallocate->proc~i_alloc2 proc~r_alloc3 r_alloc3 interface~mallocate->proc~r_alloc3 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~nl_init->proc~fatal_error proc~nl_init->interface~mallocate proc~nl_update nl_update proc~nl_init->proc~nl_update proc~nl_update->proc~ommp_message proc~time_push time_push proc~nl_update->proc~time_push proc~reverse_grp_tab reverse_grp_tab proc~nl_update->proc~reverse_grp_tab proc~time_pull time_pull proc~nl_update->proc~time_pull interface~mfree mfree proc~nl_update->interface~mfree proc~memory_init memory_init proc~r_alloc1->proc~memory_init proc~chk_alloc chk_alloc proc~r_alloc1->proc~chk_alloc proc~close_output->proc~ommp_message proc~i_alloc1->proc~memory_init proc~i_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~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~time_push->proc~fatal_error proc~mem_stat mem_stat proc~time_push->proc~mem_stat proc~reverse_grp_tab->interface~mallocate proc~reverse_grp_tab->interface~mfree proc~compress_list compress_list proc~reverse_grp_tab->proc~compress_list proc~time_pull->proc~fatal_error proc~time_pull->proc~ommp_message proc~time_pull->proc~mem_stat proc~r_free1 r_free1 interface~mfree->proc~r_free1 proc~i_free1 i_free1 interface~mfree->proc~i_free1 proc~r_free3 r_free3 interface~mfree->proc~r_free3 proc~i_free2 i_free2 interface~mfree->proc~i_free2 proc~r_free2 r_free2 interface~mfree->proc~r_free2 proc~i_free3 i_free3 interface~mfree->proc~i_free3 proc~l_free1 l_free1 interface~mfree->proc~l_free1 proc~l_free2 l_free2 interface~mfree->proc~l_free2 proc~chk_alloc->proc~fatal_error proc~mem_stat->proc~memory_init proc~chk_free chk_free proc~r_free1->proc~chk_free proc~i_free1->proc~chk_free proc~r_free3->proc~chk_free proc~compress_list->interface~mallocate proc~compress_list->interface~mfree proc~i_free2->proc~chk_free proc~r_free2->proc~chk_free proc~i_free3->proc~chk_free proc~l_free1->proc~chk_free proc~l_free2->proc~chk_free proc~chk_free->proc~fatal_error

Called by

proc~~vdw_init~~CalledByGraph proc~vdw_init vdw_init proc~qm_helper_init_vdw qm_helper_init_vdw proc~qm_helper_init_vdw->proc~vdw_init proc~assign_vdw assign_vdw proc~assign_vdw->proc~vdw_init proc~c_ommp_qm_helper_init_vdw C_ommp_qm_helper_init_vdw proc~c_ommp_qm_helper_init_vdw->proc~qm_helper_init_vdw proc~qm_helper_init_vdw_prm qm_helper_init_vdw_prm proc~qm_helper_init_vdw_prm->proc~assign_vdw proc~mmpol_init_from_xyz mmpol_init_from_xyz proc~mmpol_init_from_xyz->proc~assign_vdw proc~ommp_system_from_qm_helper ommp_system_from_qm_helper proc~ommp_system_from_qm_helper->proc~assign_vdw proc~ommp_create_link_atom ommp_create_link_atom proc~ommp_create_link_atom->proc~qm_helper_init_vdw_prm proc~ommp_init_xyz ommp_init_xyz proc~ommp_init_xyz->proc~mmpol_init_from_xyz program~test_si_geomgrad test_SI_geomgrad program~test_si_geomgrad->proc~ommp_system_from_qm_helper proc~c_ommp_qm_helper_init_vdw_prm C_ommp_qm_helper_init_vdw_prm proc~c_ommp_qm_helper_init_vdw_prm->proc~qm_helper_init_vdw_prm 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 program~test_si_geomgrad_num test_SI_geomgrad_num program~test_si_geomgrad_num->proc~ommp_system_from_qm_helper proc~c_ommp_create_link_atom C_ommp_create_link_atom proc~c_ommp_create_link_atom->proc~ommp_create_link_atom proc~c_ommp_init_xyz C_ommp_init_xyz proc~c_ommp_init_xyz->proc~ommp_init_xyz

Contents

Source Code


Source Code

    subroutine vdw_init(vdw, top, vdw_type, radius_rule, radius_size, &
                        radius_type, epsrule, cutoff)
        !! Initialize the non-bonded object allocating the parameters vectors
        
        use mod_memory, only: mallocate
        use mod_io, only: fatal_error
        use mod_neighbor_list, only: nl_init
        use mod_constants, only: OMMP_DEFAULT_NL_SUB

        implicit none

        type(ommp_nonbonded_type), intent(inout) :: vdw
        type(ommp_topology_type), intent(in), target :: top
        character(len=*) :: vdw_type, radius_rule, radius_size, radius_type, &
                            epsrule
        real(rp) :: cutoff

        select case(trim(vdw_type))
            case("lennard-jones")
                vdw%vdwtype = OMMP_VDWTYPE_LJ
                continue
            case("buckingham")
                call fatal_error("VdW type buckingham is not implemented")
            case("buffered-14-7")
                vdw%vdwtype = OMMP_VDWTYPE_BUF714
                continue
            case("mm3-hbond")
                call fatal_error("VdW type mm3-hbond is not implemented")
            case("gaussian")
                call fatal_error("VdW type gaussian is not implemented")
            case default
                call fatal_error("VdW type specified is not understood")
        end select
        
        select case(trim(radius_rule))
            case("arithmetic")
                vdw%radrule = OMMP_RADRULE_ARITHMETIC
                continue
            case("geometric")
                call fatal_error("radiusrule geometric is not implemented")
            case("cubic-mean")
                vdw%radrule = OMMP_RADRULE_CUBIC
                continue
            case default
                call fatal_error("radiusrule specified is not understood")
        end select
        
        select case(trim(radius_size))
            case("radius")
                vdw%radf = 2.0
                continue
            case("diameter")
                vdw%radf = 1.0
                continue
            case default
                call fatal_error("radiussize specified is not understood")
        end select
        
        select case(trim(radius_type))
            case("sigma")
                call fatal_error("radiustype sigma is not implemented")
            case("r-min")
                vdw%radtype = OMMP_RADTYPE_RMIN
                continue
            case default
                call fatal_error("radiustype specified is not understood")
        end select
        
        select case(trim(epsrule))
            case("geometric")
                vdw%epsrule = OMMP_EPSRULE_GEOMETRIC
                continue
            case("arithmetic")
                call fatal_error("epsilonrule arithmetic is not implemented")
            case("harmonic")
                call fatal_error("epsilonrule harmonic is not implemented")
            case("w-h")
                call fatal_error("epsilonrule w-h is not implemented")
            case("hhg")
                vdw%epsrule = OMMP_EPSRULE_HHG
                continue
            case default
                call fatal_error("epsilonrule specified is not understood")
        end select

        vdw%top => top
        call mallocate('vdw_init [vdw_r]', top%mm_atoms, vdw%vdw_r)
        call mallocate('vdw_init [vdw_e]', top%mm_atoms, vdw%vdw_e)
        call mallocate('vdw_init [vdw_f]', top%mm_atoms, vdw%vdw_f)
        
        call mallocate('vdw_init [vdw_pair_mask_a]', &
                       top%mm_atoms, pair_allocation_chunk,vdw%vdw_pair_mask_a)
        call mallocate('vdw_init [vdw_pair_mask_b]', & 
                       top%mm_atoms, pair_allocation_chunk,vdw%vdw_pair_mask_b)
        call mallocate('vdw_init [vdw_pair_r]', pair_allocation_chunk, &
                       vdw%vdw_pair_r)
        call mallocate('vdw_init [vdw_pair_e]', pair_allocation_chunk, &
                       vdw%vdw_pair_e)

        vdw%vdw_f = 1.0_rp

        if(cutoff > 0.0) then
            vdw%use_nl = .true.
            if(vdw%use_nl) call nl_init(vdw%nl, top%cmm, cutoff, OMMP_DEFAULT_NL_SUB)
        else
            vdw%use_nl = .false.
        end if
    end subroutine vdw_init