VMEC 8.52
3D Equilibrium solver with nested flux surfaces.
Loading...
Searching...
No Matches
symoutput.f90
Go to the documentation of this file.
1
3
20SUBROUTINE symoutput (bsq , gsqrt , bsubu , bsubv ,bsupu, bsupv , bsubs , &
21 bsqa, gsqrta, bsubua, bsubva,bsupua, bsupva, bsubsa )
22
23 USE vmec_main, p5 => cp5
24
25 IMPLICIT NONE
26
27 REAL(rprec), DIMENSION(ns*nzeta,ntheta3), INTENT(inout) :: &
28 bsq, gsqrt, bsubu, bsubv, bsupu, bsupv, bsubs
29 REAL(rprec), DIMENSION(ns*nzeta,ntheta3), INTENT(out) :: &
30 bsqa,gsqrta,bsubua,bsubva,bsupua,bsupva,bsubsa
31
32 INTEGER :: ir, i, jk, jka
33 REAL(rprec), DIMENSION(ns*nzeta) :: bsq_0, gsqrt_0, bsubu_0, &
34 bsubv_0, bsupu_0, bsupv_0, bsubs_0
35
36 ! SYMMETRIZE FORCES ON RESTRICTED THETA INTERVAL (0 <= u <= pi)
37 ! SO COS,SIN INTEGRALS CAN BE PERFORMED. FOR EXAMPLE,
38 !
39 ! BSQ-S(v,u) = .5*( BSQ(v,u) + BSQ(-v,-u) ) ! * COS(mu - nv)
40 ! BSQ-A(v,u) = .5*( BSQ(v,u) - BSQ(-v,-u) ) ! * SIN(mu - nv)
41 !
42 ! FOR BSUBS, THIS IS REVERSED, S-PIECE ~ SIN, A-PIECE ~ COS
43 DO i = 1, ntheta2
44 ir = ntheta1 + 2 - i !-theta
45 IF (i == 1) ir = 1
46 DO jk = 1, ns*nzeta ! implicit loop over all surfaces
47 jka = ireflect(jk) !-zeta
48
49 bsqa(jk,i) = p5*(bsq(jk,i) - bsq(jka,ir))
50 bsq_0(jk) = p5*(bsq(jk,i) + bsq(jka,ir))
51
52 gsqrta(jk,i) = p5*(gsqrt(jk,i) - gsqrt(jka,ir))
53 gsqrt_0(jk) = p5*(gsqrt(jk,i) + gsqrt(jka,ir))
54
55 bsubua(jk,i) = p5*(bsubu(jk,i) - bsubu(jka,ir))
56 bsubu_0(jk) = p5*(bsubu(jk,i) + bsubu(jka,ir))
57
58 bsubva(jk,i) = p5*(bsubv(jk,i) - bsubv(jka,ir))
59 bsubv_0(jk) = p5*(bsubv(jk,i) + bsubv(jka,ir))
60
61 ! Dominant symmetry reversed
62 bsubsa(jk,i) = p5*(bsubs(jk,i) + bsubs(jka,ir))
63 bsubs_0(jk) = p5*(bsubs(jk,i) - bsubs(jka,ir))
64
65 bsupua(jk,i) = p5*(bsupu(jk,i) - bsupu(jka,ir))
66 bsupu_0(jk) = p5*(bsupu(jk,i) + bsupu(jka,ir))
67
68 bsupva(jk,i) = p5*(bsupv(jk,i) - bsupv(jka,ir))
69 bsupv_0(jk) = p5*(bsupv(jk,i) + bsupv(jka,ir))
70 END DO
71
72 bsq(:,i) = bsq_0(:)
73 gsqrt(:,i) = gsqrt_0(:)
74 bsubu(:,i) = bsubu_0(:)
75 bsubv(:,i) = bsubv_0(:)
76 bsupu(:,i) = bsupu_0(:)
77 bsupv(:,i) = bsupv_0(:)
78 bsubs(:,i) = bsubs_0(:)
79
80 END DO
81
82END SUBROUTINE symoutput
integer, dimension(:), allocatable ireflect
two-dimensional array for computing 2pi-v angle
subroutine symoutput(bsq, gsqrt, bsubu, bsubv, bsupu, bsupv, bsubs, bsqa, gsqrta, bsubua, bsubva, bsupua, bsupva, bsubsa)
Symmetrize some quantities so that they can be output (?)
Definition symoutput.f90:22