17 REAL(rprec) :: curmid(2*ns)
18 REAL(rprec) :: izeta(ns,nzeta,*), gsqrt(ns,nzeta,*), r12(ns,nzeta,*)
20 REAL(rprec) :: midcur(ns)
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))
29 midcur(2:ns) = r12(2:ns,1,1)/gsqrt(2:ns,1,1)
31 curmid(ns+1:2*ns-1) = 0.5_dp*izeta(2:
ns1,1,1)*(midcur(2:
ns1) + midcur(3:ns))
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)