Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   !!* Fills the given array with the rotation matrix for p-Orbital tesserals.
  2.   !!* @param rot Rotation matrix
  3.   !!* @param dirCos Directional cosine vector for rotation
  4.   subroutine getRotMatP(rot, dirCos)
  5.     real(dp), intent(out) :: rot(:,:)
  6.     real(dp), target, intent(in) :: dirCos(3)
  7.  
  8.     real(dp), pointer :: uu, vv, ww
  9.     real(dp) :: tmpNum
  10.  
  11.     ASSERT(all(shape(rot) == (/ 3, 3 /)))
  12.     ASSERT(size(dirCos) == 3)
  13.  
  14.     !! Directional cosine elements
  15.     uu => dirCos(1)
  16.     vv => dirCos(2)
  17.     ww => dirCos(3)
  18.  
  19.     tmpNum = sqrt(1 - ww**2)
  20.  
  21.     rot(1,1) = uu / tmpNum
  22.     rot(2,1) = vv
  23.     rot(3,1) = ww * vv / tmpNum
  24.     rot(1,2) = 0.0_dp
  25.     rot(2,2) = ww
  26.     rot(3,2) = - tmpNum
  27.     rot(1,3) = - vv  / tmpNum
  28.     rot(2,3) = uu
  29.     rot(3,3) = ww * uu / tmpNum
  30.  
  31.   end subroutine getRotMatP
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement