vdw_set_pair Subroutine

public subroutine vdw_set_pair(vdw, mask_a, mask_b, r, e)

Uses

  • proc~~vdw_set_pair~~UsesGraph proc~vdw_set_pair vdw_set_pair module~mod_io mod_io proc~vdw_set_pair->module~mod_io module~mod_constants mod_constants proc~vdw_set_pair->module~mod_constants module~mod_memory mod_memory proc~vdw_set_pair->module~mod_memory module~mod_io->module~mod_constants iso_c_binding iso_c_binding module~mod_constants->iso_c_binding module~mod_memory->module~mod_io module~mod_memory->module~mod_constants module~mod_memory->iso_c_binding

Arguments

Type IntentOptional Attributes Name
type(ommp_nonbonded_type), intent(inout) :: vdw

Nonbonded data structure

logical(kind=lp), intent(in) :: mask_a(vdw%top%mm_atoms)
logical(kind=lp), intent(in) :: mask_b(vdw%top%mm_atoms)
real(kind=rp), intent(in) :: r

Equilibrium distance for the pair

real(kind=rp), intent(in) :: e

Depth of the potential


Calls

proc~~vdw_set_pair~~CallsGraph proc~vdw_set_pair vdw_set_pair interface~mallocate mallocate proc~vdw_set_pair->interface~mallocate interface~mfree mfree proc~vdw_set_pair->interface~mfree proc~r_alloc1 r_alloc1 interface~mallocate->proc~r_alloc1 proc~r_alloc3 r_alloc3 interface~mallocate->proc~r_alloc3 proc~i_alloc2 i_alloc2 interface~mallocate->proc~i_alloc2 proc~i_alloc1 i_alloc1 interface~mallocate->proc~i_alloc1 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~i_free1 i_free1 interface~mfree->proc~i_free1 proc~l_free1 l_free1 interface~mfree->proc~l_free1 proc~r_free3 r_free3 interface~mfree->proc~r_free3 proc~r_free1 r_free1 interface~mfree->proc~r_free1 proc~i_free2 i_free2 interface~mfree->proc~i_free2 proc~r_free2 r_free2 interface~mfree->proc~r_free2 proc~l_free2 l_free2 interface~mfree->proc~l_free2 proc~i_free3 i_free3 interface~mfree->proc~i_free3 proc~chk_free chk_free proc~i_free1->proc~chk_free proc~l_free1->proc~chk_free proc~r_free3->proc~chk_free proc~chk_alloc chk_alloc proc~r_alloc1->proc~chk_alloc proc~memory_init memory_init proc~r_alloc1->proc~memory_init proc~r_alloc3->proc~chk_alloc proc~r_alloc3->proc~memory_init proc~i_alloc2->proc~chk_alloc proc~i_alloc2->proc~memory_init proc~i_alloc1->proc~chk_alloc proc~i_alloc1->proc~memory_init proc~r_alloc2->proc~chk_alloc proc~r_alloc2->proc~memory_init proc~i_alloc3->proc~chk_alloc proc~i_alloc3->proc~memory_init proc~l_alloc1->proc~chk_alloc proc~l_alloc1->proc~memory_init proc~l_alloc2->proc~chk_alloc proc~l_alloc2->proc~memory_init proc~r_free1->proc~chk_free proc~i_free2->proc~chk_free proc~r_free2->proc~chk_free proc~l_free2->proc~chk_free proc~i_free3->proc~chk_free proc~fatal_error fatal_error proc~chk_free->proc~fatal_error proc~chk_alloc->proc~fatal_error proc~ommp_message ommp_message proc~fatal_error->proc~ommp_message proc~close_output close_output proc~fatal_error->proc~close_output proc~close_output->proc~ommp_message

Called by

proc~~vdw_set_pair~~CalledByGraph proc~vdw_set_pair vdw_set_pair proc~assign_vdw assign_vdw proc~assign_vdw->proc~vdw_set_pair proc~mmpol_init_from_xyz mmpol_init_from_xyz proc~mmpol_init_from_xyz->proc~assign_vdw proc~qm_helper_init_vdw_prm qm_helper_init_vdw_prm proc~qm_helper_init_vdw_prm->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_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_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~ommp_create_link_atom ommp_create_link_atom proc~ommp_create_link_atom->proc~qm_helper_init_vdw_prm proc~c_ommp_init_xyz C_ommp_init_xyz proc~c_ommp_init_xyz->proc~ommp_init_xyz proc~c_ommp_create_link_atom C_ommp_create_link_atom proc~c_ommp_create_link_atom->proc~ommp_create_link_atom

Contents

Source Code


Source Code

    subroutine vdw_set_pair(vdw, mask_a, mask_b, r, e)
        use mod_io, only: ommp_message, fatal_error
        use mod_constants, only: OMMP_VERBOSE_LOW
        use mod_memory, only: mallocate, mfree

        implicit none

        type(ommp_nonbonded_type), intent(inout) :: vdw
        !! Nonbonded data structure
        logical(lp), intent(in) :: mask_a(vdw%top%mm_atoms)
        logical(lp), intent(in) :: mask_b(vdw%top%mm_atoms)
        real(rp), intent(in) :: r
        !! Equilibrium distance for the pair
        real(rp), intent(in) :: e 
        !! Depth of the potential 

        integer(ip) :: oldsize, newsize
        logical(lp), allocatable :: ltmp(:,:)
        real(rp), allocatable :: rtmp(:)
        character(len=OMMP_STR_CHAR_MAX) :: msg

        oldsize = size(vdw%vdw_pair_r)
        if(vdw%npair >= oldsize) then
            newsize = oldsize + pair_allocation_chunk
            call mallocate('vdw_set_pair [rtmp]', oldsize, rtmp)
            call mallocate('vdw_set_pair [ltmp]',vdw%top%mm_atoms, oldsize, ltmp)
            
            rtmp = vdw%vdw_pair_r
            call mfree('vdw_set_pair [vdw%vdw_pair_r]', vdw%vdw_pair_r)
            call mallocate('vdw_set_pair [vdw%vdw_pair_r]', newsize, vdw%vdw_pair_r)
            vdw%vdw_pair_r(1:oldsize) = rtmp
            
            rtmp = vdw%vdw_pair_e
            call mfree('vdw_set_pair [vdw%vdw_pair_e]', vdw%vdw_pair_e)
            call mallocate('vdw_set_pair [vdw%vdw_pair_e]', newsize, vdw%vdw_pair_e)
            vdw%vdw_pair_e(1:oldsize) = rtmp

            ltmp = vdw%vdw_pair_mask_a
            call mfree('vdw_set_pair [vdw_pair_mask_a]', vdw%vdw_pair_mask_a)
            call mallocate('vdw_set_pair [vdw_pair_mask_a]', &
                           vdw%top%mm_atoms, newsize, vdw%vdw_pair_mask_a)
            vdw%vdw_pair_mask_a(:,1:oldsize) = ltmp
            
            ltmp = vdw%vdw_pair_mask_b
            call mfree('vdw_set_pair [vdw_pair_mask_b]', vdw%vdw_pair_mask_b)
            call mallocate('vdw_set_pair [vdw_pair_mask_b]', &
                           vdw%top%mm_atoms, newsize, vdw%vdw_pair_mask_b)
            vdw%vdw_pair_mask_b(:,1:oldsize) = ltmp

            call mfree('vdw_set_pair [rtmp]', rtmp)
            call mfree('vdw_set_pair [ltmp]', ltmp)
        end if
        vdw%npair = vdw%npair + 1
        vdw%vdw_pair_mask_a(:,vdw%npair) = mask_a
        vdw%vdw_pair_mask_b(:,vdw%npair) = mask_b
        vdw%vdw_pair_r(vdw%npair) = r
        vdw%vdw_pair_e(vdw%npair) = e

    end subroutine vdw_set_pair