-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanalysum2.f90
92 lines (71 loc) · 2.53 KB
/
analysum2.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
!> \file
!> \brief Compute the (m>0 and n>0) part of the DFT of the analytical Fourier transforms of the equivalently-singular integrals.
!> \brief Compute the (m>0 and n>0) part of the DFT of the analytical Fourier transforms of the equivalently-singular integrals.
!>
!> @param grpmn
!> @param bvec
!> @param m
!> @param n
!> @param l
!> @param ivacskip
!> @param lasym
!> @param m_map
!> @param n_map
!> @param grpmn_m_map
!> @param grpmn_n_map
SUBROUTINE analysum2(grpmn, bvec, m, n, l, ivacskip, lasym, m_map, n_map, &
grpmn_m_map, grpmn_n_map)
USE vacmod, vm_grpmn => grpmn
IMPLICIT NONE
INTEGER, INTENT(in) :: m, n, l, ivacskip
REAL(rprec), INTENT(inout) :: grpmn(0:mf,-nf:nf,nuv2,ndim)
REAL(rprec), INTENT(inout) :: bvec(0:mf,-nf:nf,ndim)
real(rprec), intent(inout) :: m_map(0:mf,-nf:nf)
real(rprec), intent(inout) :: n_map(0:mf,-nf:nf)
real(rprec), intent(inout) :: grpmn_m_map(0:mf,-nf:nf,nuv2)
real(rprec), intent(inout) :: grpmn_n_map(0:mf,-nf:nf,nuv2)
logical, intent(in) :: lasym
INTEGER :: i
REAL(rprec) :: sinp, sinm, cosp, cosm, temp
IF (n .LT. 0) STOP 'error calling analysum2!'
m_map(m, n) = m
m_map(m, -n) = m
n_map(m, n) = n
n_map(m, -n) = -n
! if (cmns(l,m,n) .eq. zero) then
! ! no need to compute zeros...
! return
! end if
DO i = 1,nuv2
grpmn_m_map(m, n, i) = m
grpmn_m_map(m,-n, i) = m
grpmn_n_map(m, n, i) = n
grpmn_n_map(m,-n, i) = -n
sinp = sinu1(i,m)*cosv1(i,n) * cmns(l,m,n)
temp = -cosu1(i,m)*sinv1(i,n) * cmns(l,m,n)
! SIN(mu + |n|v) * cmns (l,m,|n|)
sinm = sinp - temp
! SIN(mu - |n|v) * cmns (l,m,|n|)
sinp = sinp + temp
bvec (m, n, 1) = bvec (m, n, 1) + tlp(i)*bexni(i)*sinp
bvec (m,-n, 1) = bvec (m,-n, 1) + tlm(i)*bexni(i)*sinm
IF (ivacskip .EQ. 0) THEN
grpmn(m, n,i,1) = grpmn(m, n,i,1) + slp(i) *sinp
grpmn(m,-n,i,1) = grpmn(m,-n,i,1) + slm(i) *sinm
END IF
IF (lasym) THEN
cosp = cosu1(i,m)*cosv1(i,n) * cmns(l,m,n)
temp = sinu1(i,m)*sinv1(i,n) * cmns(l,m,n)
! COS(mu + |n|v) * cmns (l,m,|n|)
cosm = cosp - temp
! COS(mu - |n|v) * cmns (l,m,|n|)
cosp = cosp + temp
bvec(m, n,2) = bvec(m, n,2) + tlp(i)*bexni(i)*cosp
bvec(m,-n,2) = bvec(m,-n,2) + tlm(i)*bexni(i)*cosm
IF (ivacskip .EQ. 0) THEN
grpmn(m, n,i,2) = grpmn(m, n,i,2) + slp(i)*cosp
grpmn(m,-n,i,2) = grpmn(m,-n,i,2) + slm(i)*cosm
END IF
END IF
END DO
END SUBROUTINE analysum2