VMEC 8.52
3D Equilibrium solver with nested flux surfaces.
Loading...
Searching...
No Matches
analysum.f90
Go to the documentation of this file.
1
3
19SUBROUTINE analysum(grpmn, bvec, sl, tl, m, n, l, ivacskip, lasym, m_map, n_map, &
20 grpmn_m_map, grpmn_n_map)
21 USE vacmod, vm_grpmn => grpmn
22 IMPLICIT NONE
23
24 INTEGER, INTENT(in) :: m, n, l, ivacskip
25 REAL(rprec), INTENT(inout) :: grpmn(0:mf,-nf:nf,nuv2,ndim)
26 REAL(rprec), INTENT(inout) :: bvec(0:mf,-nf:nf,ndim)
27 real(rprec), intent(inout) :: m_map(0:mf,-nf:nf)
28 real(rprec), intent(inout) :: n_map(0:mf,-nf:nf)
29 real(rprec), intent(inout) :: grpmn_m_map(0:mf,-nf:nf,nuv2)
30 real(rprec), intent(inout) :: grpmn_n_map(0:mf,-nf:nf,nuv2)
31 REAL(rprec), DIMENSION(nuv2), INTENT(in) :: sl, tl
32 logical, intent(in) :: lasym
33
34 INTEGER :: i
35 REAL(rprec) :: sinp, cosp
36
37 IF (n .LT. 0) stop 'error calling analysum!'
38
39 m_map(m, n) = m
40 m_map(m,-n) = m
41
42 n_map(m, n) = n
43 n_map(m,-n) = -n
44
45! if (cmns(l,m,n) .eq. zero) then
46! ! no need to compute zeros....
47! return
48! end if
49
50 DO i = 1, nuv2
51
52 grpmn_m_map(m, n, i) = m
53 grpmn_m_map(m,-n, i) = m
54
55 grpmn_n_map(m, n, i) = n
56 grpmn_n_map(m,-n, i) = -n
57
58 ! SIN(mu - |n|v)*cmns
59 sinp = sinu1(i,m)*cosv1(i,n) - cosu1(i,m)*sinv1(i,n)
60
61 ! Fourier-transform S_l or T_l*bexni and then
62 ! add up Fourier coefficients, weighted by cmns
63 bvec(m,n,1) = bvec(m,n,1) + cmns(l,m,n) * bexni(i)*tl(i)*sinp
64 IF (ivacskip .EQ. 0) then
65 grpmn(m,n,i,1) = grpmn(m,n,i,1) + cmns(l,m,n) * sl(i)*sinp
66 end if
67
68 IF (lasym) THEN
69 ! COS(mu - |n|v)*cmns
70 cosp = cosu1(i,m)*cosv1(i,n) + sinv1(i,n)*sinu1(i,m)
71
72 bvec(m,n,2) = bvec(m,n,2) + tl(i)*cmns(l,m,n)*bexni(i)*cosp
73 IF (ivacskip .EQ. 0) then
74 grpmn(m,n,i,2) = grpmn(m,n,i,2) + sl(i)*cmns(l,m,n)*cosp
75 end if
76 END IF
77 END DO
78
79END SUBROUTINE analysum
subroutine analysum(grpmn, bvec, sl, tl, m, n, l, ivacskip, lasym, m_map, n_map, grpmn_m_map, grpmn_n_map)
Compute the (m=0 or n=0) part of the DFT of the analytical Fourier transforms of the equivalently-sin...
Definition analysum.f90:21
real(rprec), dimension(:), allocatable bexni
Definition vacmod.f90:37
real(rprec), dimension(:), allocatable grpmn
Definition vacmod.f90:102