11 common /comext/ zaindk(nip,njp,nkp)
30 zpscon=zpscon+vrftfa*curf(i,j)*dri(i)*dzj(j)
73 write(fname,
'(a,a)') path(1:kname),
'exf.wr'
74 open(1,file=fname,form=
'formatted')
77 read(1,*) nkread,nequi
89 read(1,*) ((aindk(i,j),j=1,nj),i=1,ni)
94 ue(i,j)=ue(i,j)+aindk(i,j)*pcequi(iq)*amu0
109 * rk3,zk3,rk4,zk4,ntipe,
119 real*8 aindk(nip,njp)
120 real*8 rk(*),zk(*),tk(*), wecon(*)
121 real*8 rk1(*),zk1(*),rk2(*),zk2(*)
122 real*8 rk3(*),zk3(*),rk4(*),zk4(*)
124 integer ntipe(*), necon(*)
131 ncequi = nequi + nves
133 write(fname,
'(a,a)') path(1:kname),
'exf.wr'
134 open(1,file=fname,form=
'formatted')
137 write(1,*) ncequi, nequi
152 if( necon(ik) .eq. iq )
then
153 ddx=dsqrt( (r(i)-rk(ik))**2 + (z(j)-zk(ik))**2 )
154 zaindk=
greeni(r(i),z(j),rk(ik),zk(ik))/pi
155 aindk(i,j)=aindk(i,j)+zaindk*wecon(ik)
162 write(1,*) ((aindk(i,j),j=1,nj),i=1,ni)
168 if(ibeg.gt.nk) go to 11
171 c print *,
' ibeg nk ncam==',ibeg,nk,nk-ibeg
186 dlong=dsqrt( (
r2-r1)**2 + (z2-z1)**2 )
192 ddx=dsqrt( (r(i)-rk(ik))**2 + (z(j)-zk(ik))**2 )
195 call
bint(r(i),z(j),r1,z1,
r2,z2,fint,1)
196 aindk(i,j)=fint/dlong
198 aindk(i,j)=
greeni(r(i),z(j),rk(ik),zk(ik))/pi
202 write(1,*) ((aindk(i,j),j=1,nj),i=1,ni)
235 real*8 fr_indk(npfc0,npfc0),fz_indk(npfc0,npfc0)
236 real*8 fpr_indk(nip,njp),fpz_indk(nip,njp)
237 real*8 rk(*),zk(*),tk(*), wecon(*)
272 call
grgren(rkk,zkk, rkm,zkm, dgdr,dgdz)
273 sumfrij=sumfrij+dgdr*wecon(k)*wecon(m)/rk(m)/pi
274 sumfzij=sumfzij-dgdz*wecon(k)*wecon(m)*2.d0
290 write(fname,
'(a,a)') path(1:kname),
'forcmat.wr'
291 open(1,file=fname,form=
'formatted')
294 write(1,*) ((fr_indk(i,j),j=1,npfc),i=1,npfc)
295 write(1,*) ((fz_indk(i,j),j=1,npfc),i=1,npfc)
310 call
grgren(r(i),z(j), rk(ik),zk(ik), dgdr,dgdz)
311 sumfrpijk=sumfrpijk+dgdr*wecon(ik)/rk(ik)/pi
312 sumfzpijk=sumfzpijk-dgdz*wecon(ik)*2.d0
314 fpr_indk(i,j)= sumfrpijk
315 fpz_indk(i,j)= sumfzpijk
320 write(1,*) ((fpr_indk(i,j),j=1,nj),i=1,ni)
321 write(1,*) ((fpz_indk(i,j),j=1,nj),i=1,ni)
340 real*8 frcr(npfc0),frcz(npfc0)
342 real*8 fr_indk(npfc0,npfc0),fz_indk(npfc0,npfc0)
343 real*8 fpr_indk(nip,njp),fpz_indk(nip,njp)
350 write(fname,
'(a,a)') path(1:kname),
'forcmat.wr'
351 open(1,file=fname,form=
'formatted')
354 read(1,*) ((fr_indk(i,j),j=1,npfc),i=1,npfc)
355 read(1,*) ((fz_indk(i,j),j=1,npfc),i=1,npfc)
361 if(nepfc(k) .eq. iq)
then
376 frsum=frsum +fr_indk(k,m)*pfcur1(k)*pfcur1(m)
377 fzsum=fzsum -fz_indk(k,m)*pfcur1(k)*pfcur1(m)
390 read(1,*) ((fpr_indk(i,j),j=1,nj),i=1,ni)
391 read(1,*) ((fpz_indk(i,j),j=1,nj),i=1,ni)
397 dcurij=curf(i,j)*(dri(i)*dzj(j))
398 frcr(k)=frcr(k)+fpr_indk(i,j)*dcurij*pfcur1(k)
399 frcz(k)=frcz(k)-fpz_indk(i,j)*dcurij*pfcur1(k)
400 fzpl=fzpl-fpr_indk(i,j)*dcurij*pfcur1(k)
409 write(fname,
'(a,a)') path(1:kname),
'coil_forces.wr'
410 open(1,file=fname,form=
'formatted')
412 write(1,*) (frcr(k),k=1,npfc)
413 write(1,*) (frcz(k),k=1,npfc)
422 open(1,file=
'coil_forces.pr',form=
'formatted')
423 write(1,
'(a6,e13.5)')
'PF1',frcz(1)
424 write(1,
'(a6,e13.5)')
'PF2',frcz(7)
425 write(1,
'(a6,e13.5)')
'PF3',frcz(3)
426 write(1,
'(a6,e13.5)')
'PF5',frcz(5)
427 write(1,
'(a6,e13.5)')
'CS ',frcz(9)
439 dimension frcz(*),frcr(*)
442 fzcsup2= fzcsup1+frcz(3)
443 fzcsup3= fzcsup2+frcz(1)
444 fzcsup4= fzcsup3+frcz(2)
445 fzcsup5= fzcsup4+frcz(4)
446 fzcsup6= fzcsup5+frcz(6)
447 fzmxup= dmax1(fzcsup1,fzcsup2,fzcsup3,fzcsup4,fzcsup5,fzcsup6)
451 fzcsdw2= fzcsdw1+frcz(4)
452 fzcsdw3= fzcsdw2+frcz(2)
453 fzcsdw4= fzcsdw3+frcz(1)
454 fzcsdw5= fzcsdw4+frcz(3)
455 fzcsdw6= fzcsdw5+frcz(5)
456 fzmxdw= dmin1(fzcsdw1,fzcsdw2,fzcsdw3,fzcsdw4,fzcsdw5,fzcsdw6)
477 common /comext/ zaindk(nip,njp,nkp)
498 vrftfa=zaindk(i,j,iq)
499 ue(i,j)=ue(i,j)+vrftfa*egcurr*amu0
517 common /comext/ zaindk(nip,njp,nkp)
521 real*8 aindk(nip,njp)
523 write(fname,
'(a,a)') path(1:kname),
'exf.wr'
524 open(1,file=fname,form=
'formatted')
540 read(1,*) ((aindk(i,j),j=1,nj),i=1,ni)
543 zaindk(i,j,iq)=aindk(i,j)
575 real*8 xk(nbndp),yk(nbndp)
642 call
bint(rr,zz,r0,z0,r1,z1,fint,1)
661 real*8 xk(nbndp),yk(nbndp)
726 if(rr.gt.rmax .OR. rr.lt.rmin .OR.
727 * zz.gt.zmax .OR. zz.lt.zmin )
then
739 call
bint(rr,zz,r0,z0,r1,z1,fint,1)
741 pinadg(nkout,ib)=fint
753 if(rr.ge.r(i) .AND. rr.le.r(i+1))
then
766 if(zz.ge.z(j) .AND. zz.le.z(j+1))
then
786 subroutine flux(psitok,rk,zk,nk)
792 real*8 psitok(*),rk(*),zk(*)
801 if(itok(ik).eq.0)
then
807 psitok(ik)=psitok(ik)+pinadg(ikout,ib)*dgdn(ib)
818 psitok(ik)=
blin(i,j,rk(ik),zk(ik))
824 if(nkin.ne.ikin .OR. nkout.ne.ikout)
then
835 real*8 function blin(i,j,r0,z0)
857 u0=(s1*u1+s2*u2+s3*u3+s4*u4)/(s1+s2+s3+s4)
887 u0=(s1*u1+s2*u2+s3*u3+s4*u4)/(s1+s2+s3+s4)
918 u0=(s1*u1+s2*u2+s3*u3+s4*u4)/(s1+s2+s3+s4)
933 ddr=(rmax-rmin)/dfloat(ni1)
934 ddz=(zmax-zmin)/dfloat(nj1)
962 r12(i)=(r(i+1)+r(i))*0.5d0
964 dri(i)=(r(i+1)-r(i-1))*0.5d0
972 dzj(j)=(z(j+1)-z(j-1))*0.5d0
980 if(rblm(ilm).lt.r(i+1) .AND. rblm(ilm).ge.r(i) )
then
990 if(zblm(ilm).lt.z(j+1) .AND. zblm(ilm).ge.z(j) )
then
998 c...
write(6,*)
' iblm,jblm,ilim',iblm(ilm),jblm(ilm),ilm
1009 include
'double.inc'
1011 include
'comblc.inc'
1019 if(rm0.lt.r(i+1) .AND. rm0.ge.r(i) )
then
1029 if(zm0.lt.z(j+1) .AND. zm0.ge.z(j) )
then
1043 s1=(
r2-rm0)*(z2-zm0)
1044 s3=(rm0-r1)*(zm0-z1)
1045 s2=(rm0-r1)*(z2-zm0)
1046 s4=(
r2-rm0)*(zm0-z1)
1050 tok1=amu0*tok*s1/ssum
1051 tok2=amu0*tok*s2/ssum
1052 tok3=amu0*tok*s3/ssum
1053 tok4=amu0*tok*s4/ssum
1068 curf(ic ,jc )=tok1/(dri(ic)*dzj(jc))
1072 curf(ic+1,jc )=tok2/(dri(ic+1)*dzj(jc))
1076 curf(ic+1,jc+1)=tok3/(dri(ic+1)*dzj(jc+1))
1080 curf(ic,jc+1 )=tok4/(dri(ic)*dzj(jc+1))
1101 include
'double.inc'
1103 include
'comblc.inc'
1109 if(rm0.lt.r(i+1) .AND. rm0.ge.r(i) )
then
1119 if(zm0.lt.z(j+1) .AND. zm0.ge.z(j) )
then
1146 right(il)=-curden*dri(i)*dzj(j)
1148 tokint=tokint+curden*dri(i)*dzj(j)
1169 include
'double.inc'
1171 include
'compol.inc'
1173 sqrt(arg)=dsqrt(arg)
1181 ro0=sqrt(dr0**2+dz0**2)
1184 if(dz0.lt.0.d0)
then
1190 if(tet0.lt.teta(1)) tet0=tet0+2.d0*pi
1191 if(tet0.gt.teta(nt)) tet0=tet0-2.d0*pi
1195 if(tet0.ge.teta(j) .AND. tet0.lt.teta(j+1)) jc=j
1205 rob12=(rob1*(tet2-tet0)+rob2*(tet0-tet1))/(tet2-tet1)
1207 if(ro0.lt.rob12)
then
1216 ro12=(ro1*(tet2-tet0)+ro2*(tet0-tet1))/(tet2-tet1)
1217 ro34=(ro3*(tet2-tet0)+ro4*(tet0-tet1))/(tet2-tet1)
1219 if(ro0.gt.ro12 .AND. ro0.le.ro34)
then
1239 * tet1,tet2,ro1,ro2,ro3,ro4,u1,u2,u3,u4)
1250 * tet1,tet2,ro1,ro2,ro3,ro4,u1,u2,u3,u4)
1252 include
'double.inc'
1254 ro14=(ro1*(tet2-tet0)+ro4*(tet0-tet1))/(tet2-tet1)
1255 ro23=(ro2*(tet2-tet0)+ro3*(tet0-tet1))/(tet2-tet1)
1257 u14=(u1*(tet2-tet0)+u4*(tet0-tet1))/(tet2-tet1)
1258 u23=(u2*(tet2-tet0)+u3*(tet0-tet1))/(tet2-tet1)
1260 blintr=(u14*(ro23-ro0)+u23*(ro0-ro14))/(ro23-ro14)
real *8 function bline(i, j, r0, z0)
subroutine exfmat(rk, zk, tk, nk,
subroutine solve(isol, wdm)
subroutine zero(x1, y1, x2, y2, func, err, x, y, izero, ll)
real *8 function blint(i, j, r0, z0)
REAL *8 function greeni(R, Z, RP, ZP)
real *8 function blintr(tet0, ro0,
subroutine bint(X, Y, R0, Z0, r1, z1, F, I)
subroutine flux(psitok, rk, zk, nk)
subroutine cfr_mat(rk, zk, tk, nk,
subroutine bndint(rk, zk, nk)
subroutine iter_force_limits(frcz, frcr)
subroutine extfil(pcequi, ncequi)
subroutine ext_fil(pcequi, ncequi)
real(r8) function r2(a, x, xr, xs, yr, ys, psi, psir, F_dia)
subroutine cur_map(curden, rk, zk)
subroutine grgren(R0, Z0, R, Z, dGdr, dGdz)
real *8 function blin(i, j, r0, z0)
subroutine psi_fil(psicon, ncequi)