10 c--- array dgdn initialization(calculation dg/dn)
20 dgdn(ib) = g(i,2)/dz(1)/r(i)
32 dgdn(ib) = g(ni1,j)/( dr(ni1)*r12(ni1))
44 dgdn(ib) = g(i,nj1)/dz(nj1)/r(i)
56 dgdn(ib) = g(2,j)/(dr(1)*r12(1))
65 dgdn(ib)= (dgdn(ib)+dgdn(ib+1))*0.5
72 zpsi= zpsi+dgdn(ibc)*binadg(ibc,ib)
79 c...boundary condition for ui
119 subroutine right0(ill,jll,icelm,jcelm,ngav1)
127 common/comomg/ omg,sigm
128 real*8 xs(nshp),ys(nshp),
fun(nshp),dp(5),dp1(5),dp2(5),clsq(6)
129 common/comkjf/ curn,nctrli
132 common /comhel/ helinp, helout
141 c---------------------------------------------------------------
146 ccc--- right hand side for
eq. lg=jf in rectangular
box.
151 c---definition of umax- maximum poloidal
flux function value on
156 if(iter.ge.iterbf)
then
159 uem=
bline(icelm,jcelm,rl,zl)
176 if( u(imp,jmp).gt.umax)
then
187 if(ic.ne.imax .OR. jc.ne.jmax)
then
198 if(kpr.eq.1)
write(*,*)
'imax jmax umax',imax,jmax,umax
199 if(kpr.eq.1)
write(*,*)
'iclm jclm ',icelm,jcelm
201 c---definition of um - poloidal
flux function value at magn.
axis.
206 fun(nsh)=u(imax,jmax)
216 if(i.eq.imax .AND. j.eq.jmax) go to 210
226 call
lsq_sur6(xs,ys,
fun,nsh,clsq,rrmm,zzmm,uumm,dp)
232 errm=dsqrt( (rm-rmold)**2+(zm-zmold)**2 )
256 if(iter.lt.iterbf)
then
262 call
shab(ilma,jlma,icelma,jcelma)
263 uem=
bline(icelma,jcelma,rl,zl)
267 c...stabilization by artifical field
272 delcr= -( dp(3)*(rl-rm) + dp(4)*(zl-zm) )*0.5d0/rl
273 delcz= -( dp(5)*(zl-zm) + dp(4)*(rl-rm) )
281 u(i,j)=u(i,j)+delcz*z(j)+delcr*r(i)*r(i)
285 delc = dabs(delcr)+dabs(delcz)
287 if(delc.lt.1.d-9) go to 1010
293 if(kpr.eq.1)
write(*,*)
'*****rm,zm,rl,zl',rm,zm,rl,zl
296 if(kpr.eq.1)
write(*,*)
'*****clr,clz ',clr,clz
300 c---definition ux- poloidal
flux function value on separatris.
305 call
xpoint(ux1,rx1,zx1,ix1,jx1,dp1,1,kodex1)
310 if(kpr.eq.1)
write(*,*)
'xpoint1',kodex1
311 call
xpoint(ux2,rx2,zx2,ix2,jx2,dp2,2,kodex2)
316 if(kpr.eq.1)
write(*,*)
'xpoint2',kodex2
321 if(kpr.eq.1)
write(*,*)
' all x-points out of box'
322 if(kpr.eq.1)
write(*,*)
' only limiter case '
333 if(kpr.eq.1)
write(*,*)
'xpoint=1'
352 if(kpr.eq.1)
write(*,*)
'xpoint=2'
371 if(kpr.eq.1)
write(*,*)
'rx0,zx0,ux0',rx0,zx0,ux0
373 if(uxold.ge.ux0) ux0=(1.d0-sigm)*uxold+sigm*ux0
380 c---definition up- poloidal
flux function value on plasma boundary.
383 ups=um - alp*(um-ux0)
388 if(nctrli.eq.0 )
then
394 elseif(nctrli.lt.0 )
then
396 upp=um - alp*(um-ux0)
397 if(psi_bon.lt.ux0)
then
402 alpnew=(um-up)/(um-ux0)
418 rlim1=
frlim(dp1,zblm(llim),rx1,zx1,rm,zm)
419 rmlim1=
frlim(dp1,zm,rx1,zx1,rm,zm)
426 rlim2=
frlim(dp2,zblm(llim),rx2,zx2,rm,zm)
427 rmlim2=
frlim(dp2,zm,rx2,zx2,rm,zm)
434 if( (rblm(llim)-rlim1)*(rm-rmlim1).le.0.d0)
then
438 elseif( (rblm(llim)-rlim2)*(rm-rmlim2).le.0.d0)
then
447 ublm=
blint(iblm(llim),jblm(llim),rblm(llim),zblm(llim))
448 iprlm=ipr(ilm,jlm)+ipr(ilm+1,jlm)
449 * +ipr(ilm,jlm+1)+ipr(ilm+1,jlm+1)
454 if(ublm.gt.ulmax1)
then
462 if(ublm.gt.ulmax2)
then
475 elseif(neigb.eq.0)
then
483 if(kodxp.eq.0) alpnew=(um-up)/(um-ux0)
488 write(*,*)
'up,numlim',up,numlim,neigb
489 write(*,*)
'psi_bon',psi_bon
490 write(*,*)
'um-up',um-up
491 write(*,*)
'alpnew',alpnew
496 c--- un- normal poloidal
flux.
504 un(i,j)=(u(i,j)-up)/(um-up)
505 delun=dabs(un(i,j)-unold)
506 erru=dmax1(delun,erru)
508 if(kpr.eq.1)
write(*,*)
'erru',erru
510 c--- dimension ipr initialization.
511 c---
if ipr(i,j)=1,
then point(i,j) is in plasma.
524 cccc+
if(z(j).gt.zlim) go to 800
527 rlim1=
frlim(dp1,z(j),rx1,zx1,rm,zm)
528 rmlim1=
frlim(dp1,zm,rx1,zx1,rm,zm)
535 rlim2=
frlim(dp2,z(j),rx2,zx2,rm,zm)
536 rmlim2=
frlim(dp2,zm,rx2,zx2,rm,zm)
544 if(un(i,j).lt.0.d0)
then
548 elseif( (r(i)-rlim1)*(rm-rmlim1).le.0.d0)
then
552 elseif( (r(i)-rlim2)*(rm-rmlim2).le.0.d0)
then
558 isum=ipr(i-1,j-1)+ipr(i,j-1)+ipr(i+1,j-1)+ipr(i-1,j)
559 if(isum.gt.0) ipr(i,j)=1
568 ccc+
if(z(j).gt.zlim) go to 810
571 rlim1=
frlim(dp1,z(j),rx1,zx1,rm,zm)
572 rmlim1=
frlim(dp1,zm,rx1,zx1,rm,zm)
579 rlim2=
frlim(dp2,z(j),rx2,zx2,rm,zm)
580 rmlim2=
frlim(dp2,zm,rx2,zx2,rm,zm)
588 if(un(i,j).lt.0.d0)
then
592 elseif( (r(i)-rlim1)*(rm-rmlim1).le.0.d0)
then
596 elseif( (r(i)-rlim2)*(rm-rmlim2).le.0.d0)
then
602 isum=ipr(i-1,j-1)+ipr(i,j-1)+ipr(i+1,j-1)+ipr(i+1,j)
603 if(isum.gt.0.) ipr(i,j)=1
612 ccc+
if(z(j).lt.zlim) go to 820
615 rlim1=
frlim(dp1,z(j),rx1,zx1,rm,zm)
616 rmlim1=
frlim(dp1,zm,rx1,zx1,rm,zm)
623 rlim2=
frlim(dp2,z(j),rx2,zx2,rm,zm)
624 rmlim2=
frlim(dp2,zm,rx2,zx2,rm,zm)
632 if(un(i,j).lt.0.)
then
636 elseif( (r(i)-rlim1)*(rm-rmlim1).le.0.d0)
then
640 elseif( (r(i)-rlim2)*(rm-rmlim2).le.0.d0)
then
646 isum=ipr(i-1,j+1)+ipr(i,j+1)+ipr(i+1,j+1)+ipr(i-1,j)
647 if(isum.gt.0.) ipr(i,j)=1
656 ccc+
if(z(j).lt.zlim) go to 830
659 rlim1=
frlim(dp1,z(j),rx1,zx1,rm,zm)
660 rmlim1=
frlim(dp1,zm,rx1,zx1,rm,zm)
667 rlim2=
frlim(dp2,z(j),rx2,zx2,rm,zm)
668 rmlim2=
frlim(dp2,zm,rx2,zx2,rm,zm)
676 if(un(i,j).lt.0.d0)
then
680 elseif( (r(i)-rlim1)*(rm-rmlim1).le.0.)
then
684 elseif( (r(i)-rlim2)*(rm-rmlim2).le.0.)
then
690 isum=ipr(i-1,j+1)+ipr(i,j+1)+ipr(i+1,j+1)+ipr(i+1,j)
691 if(isum.gt.0) ipr(i,j)=1
703 c---troidal
current density in plasma
736 if(kodex1.ne.0) go to 2080
738 if(i.gt.ix1.OR. i.lt.ix1-1) go to 2080
739 if(j.gt.jx1 .OR. j.lt.jx1-1) go to 2080
742 call
xdetal(i,j,ix1,jx1,rx1 ,zx1 ,dp1,nloc,
743 * cur1,cur2,cur3,cur4)
749 if(kodex2.ne.0) go to 2090
751 if(i.gt.ix2 .OR. i.lt.ix2-1) go to 2090
752 if(j.gt.jx2 .OR. j.lt.jx2-1) go to 2090
755 call
xdetal(i,j,ix2,jx2,rx2 ,zx2 ,dp2,nloc,
756 * cur1,cur2,cur3,cur4)
767 isum=ipr1+ipr2+ipr3+ipr4
768 if(isum.eq.0) go to 901
787 if(ipr1.eq.0 .AND. u1.gt.0.d0) u1=0.d0
788 if(ipr2.eq.0 .AND. u2.gt.0.d0) u2=0.d0
789 if(ipr3.eq.0 .AND. u3.gt.0.d0) u3=0.d0
790 if(ipr4.eq.0 .AND. u4.gt.0.d0) u4=0.d0
799 sij4=0.25d0*dr(i)*dz(j)
808 cur1=sij4*0.25d0*(funcur(x1,u1)+funcur(x12,u12)
809 + +funcur(x0,u0)+funcur(x14,u14) )
811 cur2=sij4*0.25d0*(funcur(x2,u2)+funcur(x23,u23)
812 + +funcur(x0,u0)+funcur(x12,u12) )
814 cur3=sij4*0.25d0*(funcur(x3,u3)+funcur(x34,u34)
815 + +funcur(x0,u0)+funcur(x23,u23) )
817 cur4=sij4*0.25d0*(funcur(x4,u4)+funcur(x14,u14)
818 + +funcur(x0,u0)+funcur(x34,u34) )
832 cur1=
bcur(x1,x12,x0,x14, z1,z12,z0,z14, u1,u12,u0,u14)
834 elseif(u12.gt.0.d0)
then
836 cur1=
bcur(x12,x0,x14,x1, z12,z0,z14,z1, u12,u0,u14,u1)
838 elseif(u0.gt.0.d0)
then
840 cur1=
bcur(x0,x14,x1,x12, z0,z14,z1,z12, u0,u14,u1,u12)
842 elseif(u14.gt.0.d0)
then
844 cur1=
bcur(x14,x1,x12,x0, z14,z1,z12,z0, u14,u1,u12,u0)
848 c...quadr..(i+1,j)...
852 cur2=
bcur(x2,x23,x0,x12, z2,z23,z0,z12, u2,u23,u0,u12)
854 elseif(u23.gt.0.d0)
then
856 cur2=
bcur(x23,x0,x12,x2, z23,z0,z12,z2, u23,u0,u12,u2)
858 elseif(u0.gt.0.d0)
then
860 cur2=
bcur(x0,x12,x2,x23, z0,z12,z2,z23, u0,u12,u2,u23)
862 elseif(u12.gt.0)
then
864 cur2=
bcur(x12,x2,x23,x0, z12,z2,z23,z0, u12,u2,u23,u0)
868 c...quadr..(i+1,j+1)...
872 cur3=
bcur(x3,x34,x0,x23, z3,z34,z0,z23, u3,u34,u0,u23)
874 elseif(u34.gt.0.d0)
then
876 cur3=
bcur(x34,x0,x23,x3, z34,z0,z23,z3, u34,u0,u23,u3)
878 elseif(u0.gt.0.d0)
then
880 cur3=
bcur(x0,x23,x3,x34, z0,z23,z3,z34, u0,u23,u3,u34)
882 elseif(u23.gt.0.d0)
then
884 cur3=
bcur(x23,x3,x34,x0, z23,z3,z34,z0, u23,u3,u34,u0)
888 c...quadr..(i,j+1)...
892 cur4=
bcur(x4,x14,x0,x34, z4,z14,z0,z34, u4,u14,u0,u34)
894 elseif(u14.gt.0.d0)
then
896 cur4=
bcur(x14,x0,x34,x4, z14,z0,z34,z4, u14,u0,u34,u4)
898 elseif(u0.gt.0.d0)
then
900 cur4=
bcur(x0,x34,x4,x14, z0,z34,z4,z14, u0,u34,u4,u14)
902 elseif(u34.gt.0.d0)
then
904 cur4=
bcur(x34,x4,x14,x0, z34,z4,z14,z0, u34,u4,u14,u0)
910 tokp=tokp+cur1+cur2+cur3+cur4
912 curf(i,j) = curf(i,j) + cur1
913 curf(i+1,j) = curf(i+1,j) + cur2
914 curf(i+1,j+1) = curf(i+1,j+1)+ cur3
915 curf(i,j+1) = curf(i,j+1) + cur4
919 c----------------------------------------------------------
923 if(ngav1.eq.2 .OR. ngav1.eq.3)
then
924 if(iter.ge.iterbf .OR. nnstpp.ge.1)
then
925 uartm=clr*rl*rl+clz*zl
926 tok=tok*(ucen-uem-uartm)/(um-uem-uartm)
932 if(ngav1.eq.4 .OR. ngav1.eq.5)
then
933 if(iter.ge.iterbf .OR. nnstpp.ge.1)
then
934 tok=tok*helinp/helout
935 tok=tok*wght+tokn*(1.d0-wght)
945 c
write(6,*)
'h0, h ', helinp, helout
947 c----------------------------------------------------------
967 curf(i,j) = funcur( xi,psi )*sij
1002 c---right hand side definition
1006 curf(i,j) = cnor*curf(i,j)
1010 right(il)=-curf(i,j)
1012 right(il)=-curf(i,j)*omg-(1.d0-omg)*curn(i,j)
1016 curf(i,j)= curf(i,j)/(dri(i)*dzj(j))
1028 subroutine xpoint(ux,rx,zx,ix,jx,dp,numxp,kodex)
1030 include
'double.inc'
1033 include
'comblc.inc'
1035 real*8 xs(nshp),ys(nshp),
fun(nshp),dp(5)
1046 if(numitc.ge.30)
then
1047 c
write(6,*)
'not correct definition x-point location'
1048 c
write(6,*)
'code=444 (cell,containing x-point)'
1052 if(rx.ge.rmax .OR. rx.le.rmin .OR.
1053 * zx.ge.zmax .OR. zx.le.zmin)
then
1054 ccc
write(6,*)
' xpoint',numxp,
'out of box'
1055 ccc
write(6,*)
' rx,zx ',rx,zx
1062 c---definition of cell, containig x-point
1066 if( (rx.lt.r(i+1)) .AND. (rx.ge.r(i)) ) go to 301
1072 if( (zx.lt.z(j+1)) .AND. (zx.ge.z(j)) ) go to 311
1076 if(icx.eq.1 .OR. icx.eq.ni1 .OR.
1077 * jcx.eq.1 .OR. jcx.eq.nj1)
then
1078 ccc
write(6,*)
' xpoint',numxp,
'in bound cell'
1079 ccc
write(6,*)
' icell,jcell ',icx,jcx
1087 ccc
write(6,*)
'icelx,jcelx',icx,jcx,rx,zx
1089 c---define nearest knote
1097 dlx=dsqrt( (rr-rx)**2+(zz-zx)**2 )
1098 if(dlx.lt.sdmin)
then
1110 ccc
write(6,*)
'ix,jx',ix,jx
1111 ccc
write(6,*)
'ix0,jx0',ix00,jx00
1126 if(k.eq.0 .AND. l.eq.0 ) go to 410
1137 det = dp(3)*dp(5) - dp(4)**2
1146 rx = xs(1) + ( dp(2)*dp(4) - dp(1)*dp(5) )/det
1147 zx = ys(1) + ( dp(1)*dp(4) - dp(2)*dp(3) )/det
1152 ux=
fun(1)+ dp(1)*(rx-rrx) + dp(2)*(zx-zzx)
1153 + + 0.5d0*dp(3)*(rx-rrx)*(rx-rrx)
1154 + + dp(4)*(rx-rrx)*(zx-zzx)
1155 + + 0.5d0*dp(5)*(zx-zzx)*(zx-zzx)
1157 ccc
write(6,*)
'rx zx ux',rx,zx,ux
1159 if( rx.gt.r(ix+1) .OR. rx.lt.r(ix-1) ) go to 444
1160 if( zx.gt.z(jx+1) .OR. zx.lt.z(jx-1) ) go to 444
1168 dlx=dsqrt( (rr-rx)**2+(zz-zx)**2 )
1169 if(dlx.lt.sdmin)
then
1177 if(ixp.ne.ix .OR. jxp.ne.jx)
then
1179 if(numit.ge.20)
then
1180 c
write(6,*)
'not correct definition x-point location'
1181 c
write(6,*)
'code=555 (nearest knote to x-point)'
1192 if(ix.ne.ix00 .OR. jx.ne.jx00)
then
1194 dold=dsqrt( (rx-r(ix00))**2 + (zx-z(jx00))**2 )
1195 dnew=dsqrt( (rx-r(ix))**2 + (zx-z(jx))**2 )
1196 deld01=dabs(dold-dnew)
1198 if(deld01.lt.0.001d0*dr(ix))
then
1211 real*8 function bcur( r1,r2,r3,r4,z1,z2,z3,z4,
1212 + psi1,psi2,psi3,psi4 )
1213 implicit real*8(a-h,o-z)
1215 squtr(x1,x2,x3,y1,y2,y3)=
1216 = 0.5d0*(y3*(x2-x1)+y1*(x3-x2)+y2*(x1-x3))
1218 xzer(x1,x2,v1,v2) = (x1*v2-x2*v1)/(v2-v1+1.d-8)
1223 if(psi2.gt.0.d0 .AND. psi3.gt.0.d0 .AND. psi4.gt.0.d0)
then
1236 cur1=funcur(r1,psi1)
1237 cur2=funcur(
r2,psi2)
1238 cur3=funcur(r3,psi3)
1239 cur4=funcur(r4,psi4)
1241 sij=squtr(r1,
r2,r3,z1,z2,z3)+squtr(r1,r3,r4,z1,z3,z4)
1242 bcur=0.25d0*sij*(cur1+cur2+cur3+cur4)
1247 c.....definition of first
zero
1249 if(psi2.le.0.d0)
then
1251 r10=xzer(r1,
r2,psi1,psi2)
1252 z10=xzer(z1,z2,psi1,psi2)
1255 elseif(psi3.le.0.d0)
then
1257 r10=xzer(
r2,r3,psi2,psi3)
1258 z10=xzer(z2,z3,psi2,psi3)
1261 elseif(psi4.le.0.d0)
then
1264 r10=xzer(r3,r4,psi3,psi4)
1265 z10=xzer(z3,z4,psi3,psi4)
1270 c.....definition of second
zero
1272 if(psi4.le.0.d0)
then
1274 r20=xzer(r1,r4,psi1,psi4)
1275 z20=xzer(z1,z4,psi1,psi4)
1278 elseif(psi3.le.0.d0)
then
1280 r20=xzer(r4,r3,psi4,psi3)
1281 z20=xzer(z4,z3,psi4,psi3)
1284 elseif(psi2.le.0.d0)
then
1287 r20=xzer(r3,
r2,psi3,psi2)
1288 z20=xzer(z3,z2,psi3,psi2)
1295 cur1=funcur(r1,psi1)
1296 cur2=funcur(
r2,psi2)
1297 cur3=funcur(r3,psi3)
1298 cur4=funcur(r4,psi4)
1299 cur10=funcur(r10,psi10)
1300 cur20=funcur(r20,psi20)
1302 zbcur = squtr(r1,r20,r4,z1,z20,z4)*(cur1+cur20+cur4) +
1303 + squtr(r1,r10,r20,z1,z10,z20)*(cur1+cur10+cur20) +
1304 + squtr(r1,
r2,r10,z1,z2,z10)*(cur1+cur2+cur10) +
1305 + iflag1*squtr(
r2,r3,r10,z2,z3,z10)*(cur2+cur3+cur10) +
1306 + iflag2*squtr(r3,r4,r20,z3,z4,z20)*(cur3+cur4+cur20)
1308 c
if(psi3.gt.0. .AND. psi2.lt.0. .AND. psi4.lt.0.)
then
1310 c r30=xzer(r3,
r2,psi3,psi2)
1311 c z30=xzer(z3,z2,psi3,psi2)
1313 c r40=xzer(r4,r3,psi4,psi3)
1314 c z40=xzer(z4,z3,psi4,psi3)
1319 c cur30=funcur(r30,psi30)
1320 c cur40=funcur(r40,psi40)
1323 c + squtr(r3,r40,r30,z3,z40,z30)*(cur3+cur40+cur30) +
1324 c + squtr(r10,r30,r20,z10,z30,z20)*(cur10+cur30+cur20) +
1325 c + squtr(r30,r40,r20,z30,z40,z20)*(cur30+cur40+cur20)
1339 subroutine xdetal(i,j,ix,jx,rxpn ,zxpn ,dp,nloc,
1340 * cur1,cur2,cur3,cur4)
1342 include
'double.inc'
1345 include
'comblc.inc'
1348 real*8 rloc(nlocp),zloc(nlocp)
1349 real*8 uloc(nlocp,nlocp),curloc(nlocp,nlocp)
1355 drloc=(r(i+1)-r(i))/(nloc-1.d0)
1356 dzloc=(z(j+1)-z(j))/(nloc-1.d0)
1362 rloc(is)=rloc(is-1)+drloc
1363 zloc(is)=zloc(is-1)+dzloc
1374 uisjs=uix +dp(1)*(ris-rix) + dp(2)*(zjs-zjx)
1375 + + 0.5*dp(3)*(ris-rix)*(ris-rix)
1376 + + dp(4)*(ris-rix)*(zjs-zjx)
1377 + + 0.5*dp(5)*(zjs-zjx)*(zjs-zjx)
1379 uloc(is,js)=(uisjs-up)/(um-up)
1390 if(psiloc.le.0.d0)
then
1395 rlim=
frlim(dp,zjs,rxpn,zxpn,rm,zm)
1396 rmlim=
frlim(dp,zm,rxpn,zxpn,rm,zm)
1397 if( (ris -rlim)*(rm-rmlim).le.0.)
then
1398 ccc+
if(zjs.gt.zvmax .OR. zjs.lt.zvmin)
then
1403 c
if(psiloc.le.psilim)
then
1404 c curlim=funcur(ris,psilim)
1405 c curloc(is,js)=(curlim*psiloc)/psilim
1408 curloc(is,js)=funcur(ris,psiloc)
1420 cur1=cur1+curloc(is,js)+curloc(is+1,js)+
1421 + curloc(is+1,js+1)+curloc(is,js+1)
1425 cur1=cur1*0.25d0*sloc
1429 do 2000 is=nlc,nloc-1
1432 cur2=cur2+curloc(is,js)+curloc(is+1,js)+
1433 + curloc(is+1,js+1)+curloc(is,js+1)
1437 cur2=cur2*0.25d0*sloc
1441 do 3000 is=nlc,nloc-1
1442 do 3000 js=nlc,nloc-1
1444 cur3=cur3+curloc(is,js)+curloc(is+1,js)+
1445 + curloc(is+1,js+1)+curloc(is,js+1)
1449 cur3=cur3*0.25d0*sloc
1454 do 4000 js=nlc,nloc-1
1456 cur4=cur4+curloc(is,js)+curloc(is+1,js)+
1457 + curloc(is+1,js+1)+curloc(is,js+1)
1461 cur4=cur4*0.25d0*sloc
1470 include
'double.inc'
1472 include
'comblc.inc'
1474 ccc--- right hand side for
eq. lu=jf in rectangular
box.
1485 right(il)=right(il)-ui(i,j-1)*dri(i)/(dzm*ri)
1492 right(il)=right(il)-ui(i,j+1)*dri(i)/(dzp*ri)
1506 right(il)=right(il)-ui(i+1,j)*dzj(j)/(rpl*
drp)
1514 right(il)=right(il)-ui(i-1,j)*dzj(j)/(rmn*drm)
1523 real*8 function frlim(dp,ylim,rx,zx,rm,zm)
1525 implicit real*8(a-h,o-z)
1532 disc=(dxy/dyy)**2 - dxx/dyy
1547 cdpls = -dxy/dyy + dsqrt(disc)
1548 cdmns = -dxy/dyy - dsqrt(disc)
1550 ang1 = 0.5d0*(datan(cdpls)+datan(cdmns))
1551 ang2 =-0.5d0*(datan(1.d0/cdpls)+datan(1.d0/cdmns))
1554 c.........calculation d2u/dl2(direction ang1 )
1557 dl2x=dyy*c1*c1+2.d0*dxy*c1+dxx
1559 c.........calculation d2u/dl2(direction ang2 )
1562 dl2y=dyy*c2*c2+2.*dxy*c2+dxx
1568 elseif(dl2y.lt.0.)
then
1587 frlim=rx+(ylim-zx)/cc
real *8 function bline(i, j, r0, z0)
subroutine zero(x1, y1, x2, y2, func, err, x, y, izero, ll)
subroutine xdetal(i, j, ix, jx, rxpn,zxpn,dp, nloc,
real *8 function blint(i, j, r0, z0)
real *8 function bcur(r1, r2, r3, r4, z1, z2, z3, z4,
subroutine eq(pcequi, psicon, ncequi, nstep, ngrid,
subroutine right0(ill, jll, icelm, jcelm, ngav1)
subroutine flux(psitok, rk, zk, nk)
subroutine deriv5(X, Y, F, M, N, U)
real *8 function frlim(dp, ylim, rx, zx, rm, zm)
subroutine axis(n, h, r, f)
subroutine current(GEOMETRY, PROFILES, TRANSPORT, SOURCES, EVOLUTION, CONTROL, j_boun, ifail, failstring)
CURRENT TRANSPORT EQUATION.
subroutine shab(il, jl, icelm, jcelm)
subroutine lsq_sur6(r, z, u, n, c, rm, zm, um, dp)
real(r8) function r2(a, x, xr, xs, yr, ys, psi, psir, F_dia)
subroutine box(IX1, IX2, IY1, IY2)
subroutine xpoint(ux, rx, zx, ix, jx, dp, numxp, kodex)