13SUBROUTINE becoil(rad, zee, brvac, bpvac, bzvac)
23 REAL(rprec),
DIMENSION(nuv2),
INTENT(in) :: rad, zee
24 REAL(rprec),
DIMENSION(nr0b,nz0b,np0b),
INTENT(in) :: brvac, bpvac, bzvac
26 CHARACTER(LEN=50),
PARAMETER :: warning =
'Plasma Boundary exceeded Vacuum Grid Size'
28 INTEGER,
SAVE :: icount = 0
29 INTEGER :: i, kv, ir, jz, ir1, jz1
30 REAL(rprec) :: rad0, zee0, ri, zj, pr, qz, w22, w21, w12, w11
65 rad0 = min(rad(i),
rmaxb)
66 rad0 = max(rad0,
rminb)
67 zee0 = min(zee(i),
zmaxb)
68 zee0 = max(zee0,
zminb)
71 kv = 1 + mod(i - 1,nv)
79 ir1 = min(
nr0b,ir + 1)
80 jz1 = min(
nz0b,jz + 1)
86 pr = (rad0 - ri)/
delrb
87 qz = (zee0 - zj)/
delzb
91 w11 = 1 + w22 - (pr + qz)
94 brad(i) = w11*brvac(ir,jz,kv) + w22*brvac(ir1,jz1,kv) + w21*brvac(ir1,jz,kv) + w12*brvac(ir,jz1,kv)
95 bphi(i) = w11*bpvac(ir,jz,kv) + w22*bpvac(ir1,jz1,kv) + w21*bpvac(ir1,jz,kv) + w12*bpvac(ir,jz1,kv)
96 bz(i) = w11*bzvac(ir,jz,kv) + w22*bzvac(ir1,jz1,kv) + w21*bzvac(ir1,jz,kv) + w12*bzvac(ir,jz1,kv)
100 IF (mod(icount,25).eq.0)
THEN
105 IF (rad0 .gt.
rmaxb) i = 1
106 IF (zee0 .gt.
zmaxb) i = i + 2
109 IF (ri .lt.
rminb) i = i + 4
110 IF (zj .lt.
zminb) i = i + 8
114 IF (i/8 .ne. 0) print *,
' zmin = ', zj
116 IF (i/4 .ne. 0) print *,
' rmin = ', ri
118 IF (i/2 .ne. 0) print *,
' zmax = ', zee0
120 IF (i .ne. 0) print *,
' rmax = ', rad0
subroutine becoil(rad, zee, brvac, bpvac, bzvac)
Compute the cylindrical components of the magnetic field due to external coils. by bi-linear interpol...