VMEC 8.52
3D Equilibrium solver with nested flux surfaces.
Loading...
Searching...
No Matches
fsym_fft.f90
Go to the documentation of this file.
1
3
16SUBROUTINE fsym_fft (bs, bu, bv, &
17 bs_s, bu_s, bv_s, &
18 bs_a, bu_a, bv_a)
19
20 USE vmec_main
21
22 IMPLICIT NONE
23
24 REAL(rprec), DIMENSION(nzeta,ntheta3), INTENT(in) :: bs
25 REAL(rprec), DIMENSION(nzeta,ntheta3,0:1), INTENT(in) :: bu, bv
26 REAL(rprec), DIMENSION(nzeta,ntheta2), INTENT(out) :: bs_s, bs_a
27 REAL(rprec), DIMENSION(nzeta,ntheta2,0:1), INTENT(out) :: bu_s, bv_s, bu_a, bv_a
28
29 INTEGER :: ir, i, kz, kzr
30
31 ! CONTRACTS bs,bu,bv FROM FULL nu INTERVAL TO HALF-U INTERVAL
32 ! SO COS,SIN INTEGRALS CAN BE PERFORMED ON HALF-U INTERVAL
33 !
34 ! bs_s(v,u) = .5*( bs(v,u) - bs(-v,-u) ) ! * SIN(mu - nv)
35 ! bs_a(v,u) = .5*( bs(v,u) + bs(-v,-u) ) ! * COS(mu - nv)
36 !
37 ! bu, bv have opposite parity
38
39 DO i = 1, ntheta2
40
41 ! -theta
42 ir = ntheta1+2-i
43 IF (i == 1) ir = 1
44
45 DO kz = 1, nzeta
46
47 ! -zeta
48 ! kzr = ireflect(ns*kz)/ns
49 kzr = nzeta+2-kz ! nzeta+1 - (kz-1)
50 IF (kz .eq. 1) kzr = 1
51
52 bs_a(kz,i) = cp5*(bs(kz,i) + bs(kzr,ir))
53 bs_s(kz,i) = cp5*(bs(kz,i) - bs(kzr,ir))
54
55 bu_a(kz,i,:) = cp5*(bu(kz,i,:) - bu(kzr,ir,:))
56 bu_s(kz,i,:) = cp5*(bu(kz,i,:) + bu(kzr,ir,:))
57
58 bv_a(kz,i,:) = cp5*(bv(kz,i,:) - bv(kzr,ir,:))
59 bv_s(kz,i,:) = cp5*(bv(kz,i,:) + bv(kzr,ir,:))
60 END DO
61 END DO
62
63END SUBROUTINE fsym_fft
subroutine fsym_fft(bs, bu, bv, bs_s, bu_s, bv_s, bs_a, bu_a, bv_a)
Contract bs,bu,bv from full nu interval to half-u interval so cos, sin integrals can be performed on ...
Definition fsym_fft.f90:19