17SUBROUTINE bss(r12, rs, zs, ru12, zu12, bsubs, bsupu, bsupv, br, bphi, bz)
25 REAL(rprec),
DIMENSION(nrzt),
INTENT(in) :: r12, rs, zs, ru12, zu12, bsupu, bsupv
26 REAL(rprec),
DIMENSION(nrzt),
INTENT(out) :: br, bphi, bz, bsubs
28 REAL(rprec),
PARAMETER :: p5 = 0.5_dp
29 REAL(rprec),
PARAMETER :: p25 = p5*p5, dshalfds=p25
32 REAL(rprec),
DIMENSION(:),
allocatable :: rv12, zv12, rs12, zs12, gsu, gsv
37 allocate(rv12(nrzt), zv12(nrzt), &
38 rs12(nrzt), zs12(nrzt), &
59 rv12(l) = p5*(
rv(l,0)+
rv(l-1,0) +
shalf(l)*(
rv(l,1) +
rv(l-1,1)))
60 zv12(l) = p5*(
zv(l,0)+
zv(l-1,0) +
shalf(l)*(
zv(l,1) +
zv(l-1,1)))
64 rs12(l) = rs(l) + dshalfds*(
r1(l,1) +
r1(l-1,1))/
shalf(l)
65 zs12(l) = zs(l) + dshalfds*(
z1(l,1) +
z1(l-1,1))/
shalf(l)
67 gsu(l) = rs12(l)*ru12(l) + zs12(l)*zu12(l)
68 gsv(l) = rs12(l)*rv12(l) + zs12(l)*zv12(l)
70 bsubs(l) = bsupu(l)*gsu(l) + bsupv(l)*gsv(l)
74 br(l) = bsupu(l)*ru12(l) + bsupv(l)*rv12(l)
75 bphi(l) = bsupv(l)*r12(l)
76 bz(l) = bsupu(l)*zu12(l) + bsupv(l)*zv12(l)
82 call add_real_3d(
"rv12", ns, nzeta, ntheta3, rv12)
83 call add_real_3d(
"zv12", ns, nzeta, ntheta3, zv12)
85 call add_real_3d(
"rs12", ns, nzeta, ntheta3, rs12)
86 call add_real_3d(
"zs12", ns, nzeta, ntheta3, zs12)
88 call add_real_3d(
"gsu", ns, nzeta, ntheta3, gsu)
89 call add_real_3d(
"gsv", ns, nzeta, ntheta3, gsv)
91 call add_real_3d(
"br", ns, nzeta, ntheta3, br )
92 call add_real_3d(
"bphi", ns, nzeta, ntheta3, bphi)
93 call add_real_3d(
"bz", ns, nzeta, ntheta3, bz )
95 call add_real_3d(
"bsubs", ns, nzeta, ntheta3, bsubs)
100 deallocate(rv12, zv12, rs12, zs12, gsu, gsv)
subroutine bss(r12, rs, zs, ru12, zu12, bsubs, bsupu, bsupv, br, bphi, bz)
Computes br, bphi, bz, bsubs on half-radial mesh.