extend Subroutine

private subroutine extend(self, len)

拓展内存空间,

Type Bound

nnps_pairs_type

Arguments

Type IntentOptional Attributes Name
class(nnps_pairs_type), intent(inout) :: self
integer, intent(in) :: len

粒子对容量


Contents

Source Code


Source Code

    subroutine extend(self, len)
        class(nnps_pairs_type), intent(inout) :: self
        integer, intent(in) :: len  !! 粒子对容量

        self%len = len
        if (self%cap < len) then
            self%cap = len*2
            deallocate (self%wdwdx, self%contact_type)
            allocate (self%wdwdx(1 + dim, self%cap), self%contact_type(self%cap))
        end if

    end subroutine extend