LCOV - code coverage report
Current view: top level - wannier - eulerrot.f (source / functions) Hit Total Coverage
Test: combined.info Lines: 0 19 0.0 %
Date: 2019-09-08 04:53:50 Functions: 0 2 0.0 %

          Line data    Source code
       1             : !--------------------------------------------------------------------------------
       2             : ! Copyright (c) 2016 Peter Grünberg Institut, Forschungszentrum Jülich, Germany
       3             : ! This file is part of FLEUR and available as free software under the conditions
       4             : ! of the MIT license as expressed in the LICENSE file in more detail.
       5             : !--------------------------------------------------------------------------------
       6             : 
       7             :       module m_eulerrot
       8             : c************************************
       9             : c     Perform Euler rotations.
      10             : c     Y. Mokrousov 
      11             : c
      12             : c     tidied up version
      13             : c     Frank Freimuth
      14             : c************************************
      15             :       contains
      16           0 :       subroutine eulerrot(
      17           0 :      >               nwfs,alpha,beta,gamma,
      18           0 :      <               amx)
      19             : c************************************************************************
      20             : c..Perform "nwfs" Euler rotations.
      21             : c..Input: Set of "nwfs" Euler angles: alpha(i),beta(i),gamma(i); i=1,nwfs
      22             : c..Output: "nwfs" rotation matrices: amx(:,:,i); i=1,nwfs
      23             : c************************************************************************
      24             : 
      25             :       implicit none
      26             : 
      27             :       integer, intent (in)  :: nwfs
      28             :       real,    intent (in)  :: alpha(nwfs),beta(nwfs),gamma(nwfs) 
      29             :       real,    intent (out) :: amx(3,3,nwfs)
      30             : 
      31             :       integer :: nwf
      32             : 
      33           0 :       do nwf = 1,nwfs
      34             :          call eulerrot1(
      35             :      >                  alpha(nwf),beta(nwf),gamma(nwf),
      36           0 :      <                  amx(1,1,nwf) )
      37             :       enddo 
      38             : 
      39           0 :       end subroutine eulerrot
      40             : 
      41           0 :       subroutine eulerrot1(
      42             :      >               alpha,beta,gamma,
      43             :      <               amx)
      44             : c***********************************************************************
      45             : c..Perform one Euler rotation.
      46             : c..Input: Euler angles: alpha, beta, gamma
      47             : c..Output: Rotation matrix: amx(:,:)
      48             : c 
      49             : c..Given the Euler angles, the following procedure is 
      50             : c..performed:
      51             : c..1. Rotation around the z-axis by alpha (matrix D)
      52             : c..2. Rotation around the x-axis by beta  (matrix C)
      53             : c..3. Rotation around the z-axis by gamma again. (matrix B)
      54             : c..The overall rotation is given by the matrix A = B*C*D
      55             : c***********************************************************************
      56             : 
      57             :       implicit none
      58             : 
      59             :       real,    intent (in)  :: alpha,beta,gamma 
      60             :       real,    intent (out) :: amx(3,3)
      61             : 
      62             :       real    :: bmx(3,3),cmx(3,3),dmx(3,3),hmx(3,3)
      63             : 
      64           0 :       dmx(1,1) = cos(alpha) ; dmx(1,2) = sin(alpha) ; dmx(1,3) = 0. 
      65           0 :       dmx(2,1) =-sin(alpha) ; dmx(2,2) = cos(alpha) ; dmx(2,3) = 0. 
      66           0 :       dmx(3,1) = 0.         ; dmx(3,2) = 0.         ; dmx(3,3) = 1. 
      67             : 
      68           0 :       cmx(1,1) = 1.  ; cmx(1,2) = 0.         ; cmx(1,3) = 0. 
      69           0 :       cmx(2,1) = 0.  ; cmx(2,2) = cos(beta)  ; cmx(2,3) = sin(beta)
      70           0 :       cmx(3,1) = 0.  ; cmx(3,2) =-sin(beta)  ; cmx(3,3) = cos(beta)
      71             :   
      72           0 :       bmx(1,1) = cos(gamma) ; bmx(1,2) = sin(gamma) ; bmx(1,3) = 0. 
      73           0 :       bmx(2,1) =-sin(gamma) ; bmx(2,2) = cos(gamma) ; bmx(2,3) = 0. 
      74           0 :       bmx(3,1) = 0.         ; bmx(3,2) = 0.         ; bmx(3,3) = 1. 
      75             : 
      76           0 :       hmx = matmul(cmx,dmx)
      77           0 :       amx = matmul(bmx,hmx)
      78             : 
      79           0 :       end subroutine eulerrot1
      80             : 
      81             : 
      82             :       end module m_eulerrot  

Generated by: LCOV version 1.13