init_erf_ncoord Subroutine

public subroutine init_erf_ncoord(self, mol, norm_exp, rcov)

Set the covalent radii and the distance normalization of an erf-type coordination number and build the pair tables derived from them. The radii and exponent are only accessible through this routine, which keeps them consistent with the tables.

Arguments

Type IntentOptional Attributes Name
class(erf_ncoord_type), intent(inout) :: self

Coordination number container

type(structure_type), intent(in) :: mol

Molecular structure data

real(kind=wp), intent(in) :: norm_exp

Exponent of the distance normalization

real(kind=wp), intent(in), optional :: rcov(:)

Covalent radii, absent selects the default covalent radii


Source Code

   subroutine init_erf_ncoord(self, mol, norm_exp, rcov)

      !> Coordination number container
      class(erf_ncoord_type), intent(inout) :: self

      !> Molecular structure data
      type(structure_type), intent(in) :: mol

      !> Exponent of the distance normalization
      real(wp), intent(in) :: norm_exp

      !> Covalent radii, absent selects the default covalent radii
      real(wp), intent(in), optional :: rcov(:)

      ! Avoid the 0/0 in the derivative expressions for a non-positive radius
      ! sum, the large finite inverse makes the exponentially damped
      ! derivatives evaluate to zero
      real(wp), parameter :: inv_rc_zero = 1.0e30_wp

      integer :: izp, jzp
      real(wp) :: rc

      if (allocated(self%rcov)) deallocate(self%rcov)
      allocate(self%rcov(mol%nid))
      if (present(rcov)) then
         self%rcov(:) = rcov
      else
         self%rcov(:) = get_covalent_rad(mol%num)
      end if

      self%norm_exp = norm_exp

      if (allocated(self%rc_mat)) deallocate(self%rc_mat)
      if (allocated(self%inv_rcn_mat)) deallocate(self%inv_rcn_mat)
      allocate(self%rc_mat(mol%nid, mol%nid), self%inv_rcn_mat(mol%nid, mol%nid))

      do jzp = 1, mol%nid
         do izp = 1, mol%nid
            rc = self%rcov(izp) + self%rcov(jzp)
            self%rc_mat(izp, jzp) = rc
            if (rc > 0.0_wp) then
               self%inv_rcn_mat(izp, jzp) = 1.0_wp / rc**self%norm_exp
            else
               self%inv_rcn_mat(izp, jzp) = inv_rc_zero
            end if
         end do
      end do

   end subroutine init_erf_ncoord