The Elk Code
tm3tsrl.f90
Go to the documentation of this file.
1 
2 ! Copyright (C) 2026 S. Kalhoefer, L. Nordstrom and O. Granas.
3 ! This file is distributed under the terms of the GNU General Public License.
4 ! See the file COPYING for license details.
5 
6 !BOP
7 ! !ROUTINE: tm3tsrl
8 ! !INTERFACE:
9 pure subroutine tm3tsrl(r,ld,wkpr_v,wkpr_t)
10 ! !INPUT/OUTPUT PARAMETERS:
11 ! r : r-index of tensor moment (in,integer)
12 ! ld : leading dimension (in,integer)
13 ! wkpr_v : 3-index complex van der Laan components (in,complex(-ld:ld))
14 ! wkpr_t : real tesseral tensor moment components (out,real(-ld:ld))
15 ! !DESCRIPTION:
16 ! Converts complex tensor moments in the van der Laan convention into real
17 ! tensor moments corresponding to tesseral spherical harmonics. See routines
18 ! {\tt tm3vdl} and {\tt tm3todm}.
19 !
20 ! !REVISION HISTORY:
21 ! Created May 2026 (Sebastian Kalhoefer)
22 !EOP
23 !BOC
24 implicit none
25 ! arguments
26 integer, intent(in) :: r,ld
27 complex(8), intent(in) :: wkpr_v(-ld:ld)
28 real(8), intent(out) :: wkpr_t(-ld:ld)
29 ! local variables
30 integer t
31 real(8), parameter :: s2=sqrt(2.d0)
32 do t=-r,r
33  if (t < 0) then
34  wkpr_t(t)=s2*wkpr_v(t)%im
35  else if (t == 0) then
36  wkpr_t(t)=wkpr_v(t)%re
37  else
38  wkpr_t(t)=s2*wkpr_v(t)%re
39  end if
40 end do
41 end subroutine
42 !EOC
43 
pure subroutine tm3tsrl(r, ld, wkpr_v, wkpr_t)
Definition: tm3tsrl.f90:10