VMEC 8.52
3D Equilibrium solver with nested flux surfaces.
Loading...
Searching...
No Matches
symrzl.f90
Go to the documentation of this file.
1
3
26SUBROUTINE symrzl(r1s, rus, rvs, z1s, zus, zvs, lus, lvs, rcons, zcons, &
27 r1a, rua, rva, z1a, zua, zva, lua, lva, rcona, zcona )
28
29 USE vmec_main
30
31 IMPLICIT NONE
32
33 REAL(rprec), DIMENSION(ns*nzeta,ntheta3,0:1), INTENT(inout) :: &
34 r1s, rus, rvs, z1s, zus, zvs, lus, lvs, rcons, zcons
35 REAL(rprec), DIMENSION(ns*nzeta,ntheta3,0:1), INTENT(in) :: &
36 r1a, rua, rva, z1a, zua, zva, lua, lva, rcona, zcona
37
38 INTEGER :: mpar, ir, i, jk, jka, n2
39
40 ! FIRST SUM SYMMETRIC, ANTISYMMETRIC PIECES ON EXTENDED INTERVAL, THETA = [PI,2*PI]
41 DO mpar = 0, 1
42 DO i = 1 + ntheta2, ntheta1 ! pi, ..., 2*pi
43 ir = ntheta1 + 2 - i !-theta --> (ntheta1+1) - (i-1)
44 DO jk = 1, ns*nzeta
45 jka = ireflect(jk) !-zeta
46 r1s(jk,i,mpar) = r1s(jka,ir,mpar) - r1a(jka,ir,mpar) ! R has even parity --> r1s is mirrored without sign change, r1a ( odd parity) is mirrored with sign change
47 rus(jk,i,mpar) =-rus(jka,ir,mpar) + rua(jka,ir,mpar) ! Ru has odd parity --> rus is mirrored with sign change, rua (even parity) is mirrored without sign change
48 z1s(jk,i,mpar) =-z1s(jka,ir,mpar) + z1a(jka,ir,mpar) ! Z has odd parity --> z1s is mirrored with sign change, z1a (even parity) is mirrored without sign change
49 zus(jk,i,mpar) = zus(jka,ir,mpar) - zua(jka,ir,mpar) ! ...
50 lus(jk,i,mpar) = lus(jka,ir,mpar) - lua(jka,ir,mpar)
51 rcons(jk,i,mpar)= rcons(jka,ir,mpar)-rcona(jka,ir,mpar)
52 zcons(jk,i,mpar)=-zcons(jka,ir,mpar)+zcona(jka,ir,mpar)
53 END DO
54 IF (lthreed) THEN
55 DO jk = 1, ns*nzeta
56 jka = ireflect(jk)
57 rvs(jk,i,mpar)=(-rvs(jka,ir,mpar))+rva(jka,ir,mpar)
58 zvs(jk,i,mpar) = zvs(jka,ir,mpar) - zva(jka,ir,mpar)
59 lvs(jk,i,mpar) = lvs(jka,ir,mpar) - lva(jka,ir,mpar)
60 END DO
61 ENDIF
62 END DO
63
64 ! NOW SUM SYMMETRIC, ANTISYMMETRIC PIECES FOR THETA = [0,PI]
65 n2 = ntheta2
66 r1s(:,:n2,mpar) = r1s(:,:n2,mpar) + r1a(:,:n2,mpar)
67 rus(:,:n2,mpar) = rus(:,:n2,mpar) + rua(:,:n2,mpar)
68 z1s(:,:n2,mpar) = z1s(:,:n2,mpar) + z1a(:,:n2,mpar)
69 zus(:,:n2,mpar) = zus(:,:n2,mpar) + zua(:,:n2,mpar)
70 lus(:,:n2,mpar) = lus(:,:n2,mpar) + lua(:,:n2,mpar)
71 rcons(:,:n2,mpar) = rcons(:,:n2,mpar) + rcona(:,:n2,mpar)
72 zcons(:,:n2,mpar) = zcons(:,:n2,mpar) + zcona(:,:n2,mpar)
73 IF (lthreed) THEN
74 rvs(:,:n2,mpar) = rvs(:,:n2,mpar) + rva(:,:n2,mpar)
75 zvs(:,:n2,mpar) = zvs(:,:n2,mpar) + zva(:,:n2,mpar)
76 lvs(:,:n2,mpar) = lvs(:,:n2,mpar) + lva(:,:n2,mpar)
77 ENDIF
78 END DO
79
80END SUBROUTINE symrzl
integer, dimension(:), allocatable ireflect
two-dimensional array for computing 2pi-v angle
logical lthreed
subroutine symrzl(r1s, rus, rvs, z1s, zus, zvs, lus, lvs, rcons, zcons, r1a, rua, rva, z1a, zua, zva, lua, lva, rcona, zcona)
Symmetrize , and .
Definition symrzl.f90:28