VMEC 8.52
3D Equilibrium solver with nested flux surfaces.
Loading...
Searching...
No Matches
getcurmid.f90
Go to the documentation of this file.
1
3
10SUBROUTINE getcurmid (curmid, izeta, gsqrt, r12)
11
12 USE vmec_input, ONLY: rprec, dp, nzeta
13 USE vmec_dim, ONLY: ns, ns1, ntheta2
14
15 implicit none
16
17 REAL(rprec) :: curmid(2*ns)
18 REAL(rprec) :: izeta(ns,nzeta,*), gsqrt(ns,nzeta,*), r12(ns,nzeta,*)
19
20 REAL(rprec) :: midcur(ns)
21
22 ! THETA = pi, PHI = 0
23 midcur(2:ns) = r12(2:ns,1,ntheta2)/gsqrt(2:ns,1,ntheta2)
24
25 curmid(1) = izeta(ns,1,ntheta2)*midcur(ns)
26 curmid(2:ns1) = 0.5_dp*izeta(ns1:2:-1,1,ntheta2)*(midcur(ns1:2:-1) + midcur(ns:3:-1))
27
28 ! THETA = 0, PHI = 0
29 midcur(2:ns) = r12(2:ns,1,1)/gsqrt(2:ns,1,1)
30
31 curmid(ns+1:2*ns-1) = 0.5_dp*izeta(2:ns1,1,1)*(midcur(2:ns1) + midcur(3:ns))
32
33 curmid(ns) = 0.5_dp*(curmid(ns-1) + curmid(ns+1))
34 curmid(2*ns) = 2*curmid(2*ns-1) - curmid(2*ns-2)
35
36END SUBROUTINE getcurmid
subroutine getcurmid(curmid, izeta, gsqrt, r12)
Get current at midplane (?)
Definition getcurmid.f90:11
integer ns1
ns-1
Definition vmec_dim.f90:18
integer ns
number of flux surfaces
Definition vmec_dim.f90:17
integer ntheta2
Definition vmec_dim.f90:10
integer nzeta