triple_scale Function

public elemental function triple_scale(ii, jj, kk) result(triple)

Logic exercise to distribute a triple energy to atomwise energies.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: ii

Atom indices

integer, intent(in) :: jj

Atom indices

integer, intent(in) :: kk

Atom indices

Return Value real(kind=wp)

Fraction of energy


Source Code

elemental function triple_scale(ii, jj, kk) result(triple)

   !> Atom indices
   integer, intent(in) :: ii, jj, kk

   !> Fraction of energy
   real(wp) :: triple

   if (ii == jj) then
      if (ii == kk) then
         ! ii'i" -> 1/6
         triple = 1.0_wp/6.0_wp
      else
         ! ii'j -> 1/2
         triple = 0.5_wp
      end if
   else
      if (ii /= kk .and. jj /= kk) then
         ! ijk -> 1 (full)
         triple = 1.0_wp
      else
         ! ijj' and iji' -> 1/2
         triple = 0.5_wp
      end if
   end if

end function triple_scale