20 if(psi(i,j).gt.psimax)
then
33 if(imax.eq.1 .and. erro.lt.5.d-4) iswtch=1
36 write(*,*)
'mesh:imax jmax iswth',imax,jmax,iswtch
44 if(ngav.le.0) iswtch=0
47 call
prgrid(imax,jmax,erro,imov,errpsi)
52 call
regrid(erro,imov,errpsi)
60 subroutine prgrid(imax,jmax,erro,imov,errpsi)
67 dimension ron(ntp),rop(ntp),rn(ntp),zn(ntp),tetn(ntp)
68 dimension rob(ntp),teti(ntp),roi(ntp)
69 dimension xs(nshp),ys(nshp),
fun(nshp),dp(5)
83 write(*,*)
'prgrid:::'
93 fun(nsh)=psi(imax,jmax)
102 elseif(imax.eq.2)
then
121 if(i.ne.imax .OR. j.ne.jmax)
then
134 det = dp(3)*dp(5) - dp(4)**2
135 rm = xs(1) + ( dp(2)*dp(4) - dp(1)*dp(5) )/det
136 zm = ys(1) + ( dp(1)*dp(4) - dp(2)*dp(3) )/det
138 erro=dsqrt( (rm-rm0)**2+(zm-zm0)**2 )
143 psim=
fun(1)+ dp(1)*(rm-rmx) + dp(2)*(zm-zmx)
144 + + 0.5d0*dp(3)*(rm-rmx)*(rm-rmx)
145 + + dp(4)*(rm-rmx)*(zm-zmx)
146 + + 0.5d0*dp(5)*(zm-zmx)*(zm-zmx)
149 write(6,*)
'rm zm psim',rm,zm,psim
150 write(6,*)
'prgrid:errma',erro
163 psin(i,j)=(psi(i,j)-psip)/(psim-psip)
164 delpsn=dabs(psin(i,j)-psnn)
166 if(delpsn.gt.errpsi)
then
188 robj=sqrt(drx**2+dzx**2)
200 if(teta(j).lt.teta(j-1))
then
201 teta(j)=teta(j)+2.d0*pi
204 if(teta(j).lt.teta(j-1))
then
205 teta(j)=teta(j)+2.d0*pi
210 teta(1)=teta(nt1)-2.d0*pi
211 teta(nt)=teta(2)+2.d0*pi
213 ccc
grid moving along rais
218 if(psia(i).lt.psinm0)
then
235 if(zps.le.ps0 .and. zps.ge.pspl)
then
243 grad=-(pspl-ps0)/(ropl-ro0)
245 zro=ro0-(psia(i)-ps0)/grad
251 rnj=rm0+ron(j)*cos(tetn(j))
252 znj=zm0+ron(j)*sin(tetn(j))
257 roi(j)=sqrt(drx**2+dzx**2)
258 tetp=acos(drx/roi(j))
269 if(teti(j).lt.teti(j-1))
then
270 teti(j)=teti(j)+2.d0*pi
273 if(teti(j).lt.teti(j-1))
then
274 teti(j)=teti(j)+2.d0*pi
279 teti(1)=teti(nt1)-2.d0*pi
280 teti(nt)=teti(2)+2.d0*pi
289 if(tetv.lt.teti(1)) tetv=tetv+2.d0*pi
290 if(tetv.lt.teti(1)) tetv=tetv+2.d0*pi
291 if(tetv.gt.teti(nt)) tetv=tetv-2.d0*pi
292 if(tetv.gt.teti(nt)) tetv=tetv-2.d0*pi
302 if(tetv.le.ttpl .and. tetv.ge.tt0)
then
303 zro=((ttpl-tetv)*ro0+(tetv-tt0)*ropl)/(ttpl-tt0)
312 r(i,j)=rop(j)*cos(teta(j))+rm
313 z(i,j)=rop(j)*sin(teta(j))+zm
324 ps0=psip+zps*(psim-psip)
329 ro2j=(ps0-psim)/( 0.5d0*dp(3)*cos(ttj)**2
330 + + dp(4)*cos(ttj)*sin(ttj)
331 + + 0.5d0*dp(5)*sin(ttj)**2 )
337 r(i,j)=rm+rop(j)*cos(teta(j))
338 z(i,j)=zm+rop(j)*sin(teta(j))
348 ros1=(r(2,j)-rm)**2+(z(2,j)-zm)**2
349 ros2=(r(ibeg,j)-rm)**2+(z(ibeg,j)-zm)**2
356 rosi=( (psa2-psai)*ros1+(psai-psa1)*ros2 )/(psa2-psa1)
359 r(i,j)=rm+rosi*cos(teta(j))
360 z(i,j)=zm+rosi*sin(teta(j))
371 ro(i,j)=dsqrt((r(i,j)-rm)**2+(z(i,j)-zm)**2)
379 r(iplas,j)=rob(j)*cos(teta(j))+rm
380 z(iplas,j)=rob(j)*sin(teta(j))+zm
405 psi(i,j)=psip+psin(i,j)*(psim-psip)
424 dimension ron(ntp),rop(ntp),rn(ntp),zn(ntp),tetn(ntp)
425 dimension rob(ntp),teti(ntp),roi(ntp)
426 dimension roplt(nrp,ntp)
441 write(*,*)
'regrid:::'
453 write(*,*)
'rm,zm,psim',rm,zm,psim
456 call
axdef(rma,zma,psima,dp)
459 write(*,*)
'rma,zma,psima',rma,zma,psima
466 erro=dsqrt((rmold-rm)**2+(zmold-zm)**2)
469 write(6,*)
'erro mag.axis',erro
478 psin(i,j)=(psi(i,j)-psip)/(psim-psip)
479 delpsn=dabs(psin(i,j)-psnn)
481 if(delpsn.gt.errpsi)
then
495 write(*,*)
'i,j errpsi',ierm,jerm,errpsi,(psim-psip)
499 cc definition of new angle
grid teta(j)
510 robj=sqrt(drx**2+dzx**2)
523 if(teta(j).lt.teta(j-1))
then
524 teta(j)=teta(j)+2.d0*pi
527 if(teta(j).lt.teta(j-1))
then
528 teta(j)=teta(j)+2.d0*pi
533 teta(1)=teta(nt1)-2.d0*pi
534 teta(nt)=teta(2)+2.d0*pi
541 ps0=psip+zps*(psim-psip)
547 ro2j=(ps0-psim)/( 0.5d0*dp(3)*cos(ttj)**2
548 + + dp(4)*cos(ttj)*sin(ttj)
549 + + 0.5d0*dp(5)*sin(ttj)**2 )
553 r(i,j)=rm+rop(j)*cos(teta(j))
554 z(i,j)=zm+rop(j)*sin(teta(j))
560 ccc
grid moving along rais
594 gradpl=-(pspl-ps0)/(ropl-ro0)
595 gradmn=-(ps0-psmn)/(ro0-romn)
597 grad=dmax1(gradpl,gradmn)
602 alfa=1.0d0+0.45d0*dabs(q(i)-q(1))/q(1)
605 if(alfa.lt.1.5d0) alfa=1.5d0
607 if(ngav.gt.0) grad=grad*alfa
609 zro=ro0-(psia(i)-ps0)/grad
617 rnj=rmold+ron(j)*cos(tetn(j))
618 znj=zmold+ron(j)*sin(tetn(j))
623 roi(j)=sqrt(drx**2+dzx**2)
624 tetp=acos(drx/roi(j))
635 if(teti(j).lt.teti(j-1))
then
636 teti(j)=teti(j)+2.d0*pi
639 if(teti(j).lt.teti(j-1))
then
640 teti(j)=teti(j)+2.d0*pi
645 teti(1)=teti(nt1)-2.d0*pi
646 teti(nt)=teti(2)+2.d0*pi
655 if(tetv.lt.teti(1)) tetv=tetv+2.d0*pi
656 if(tetv.lt.teti(1)) tetv=tetv+2.d0*pi
657 if(tetv.gt.teti(nt)) tetv=tetv-2.d0*pi
658 if(tetv.gt.teti(nt)) tetv=tetv-2.d0*pi
670 if(tetv.le.ttpl .and. tetv.ge.tt0)
then
671 zro=((ttpl-tetv)*ro0+(tetv-tt0)*ropl)/(ttpl-tt0)
682 roerr=dabs(ron(j)-ro(i,j))
684 if(roerr.gt.erro)
then
690 roplt(i,j)=ron(j)-ro(i,j)
692 r(i,j)=rop(j)*cos(teta(j))+rm
693 z(i,j)=rop(j)*sin(teta(j))+zm
700 write(6,*)
'erro max.',erro
701 write(6,*)
'i,j erro',ierm,jerm,erro
706 ro(i,j)=dsqrt((r(i,j)-rm)**2+(z(i,j)-zm)**2)
707 ronor(i,j)=ro(i,j)/rob(j)
716 r(iplas,j)=rob(j)*cos(teta(j))+rm
717 z(iplas,j)=rob(j)*sin(teta(j))+zm
732 ronor(i,1)=ronor(i,nt1)
733 ronor(i,nt)=ronor(i,2)
741 roplt(i,1)=roplt(i,nt1)
742 roplt(i,nt)=roplt(i,2)
751 psi(i,j)=psip+psin(i,j)*(psim-psip)
765 dimension ron(ntp),rop(ntp),rn(ntp),zn(ntp),tetn(ntp)
766 dimension rob(ntp),teti(ntp),roi(ntp)
767 dimension roplt(nrp,ntp)
782 write(*,*)
'regrid0:::'
794 write(*,*)
'rm,zm,psim',rm,zm,psim
796 call
axdef(rma,zma,psima,dp)
799 write(*,*)
'rma,zma,psima',rma,zma,psima
806 erro=dsqrt((rmold-rm)**2+(zmold-zm)**2)
809 write(*,*)
'erro mag.axis',erro
818 psin(i,j)=(psi(i,j)-psip)/(psim-psip)
819 delpsn=dabs(psin(i,j)-psnn)
821 if(delpsn.gt.errpsi)
then
835 write(*,*)
'i,j errpsi',ierm,jerm,errpsi,(psim-psip)
840 cc definition of new angle
grid teta(j)
853 robj=sqrt(drx**2+dzx**2)
866 if(teta(j).lt.teta(j-1))
then
867 teta(j)=teta(j)+2.d0*pi
870 if(teta(j).lt.teta(j-1))
then
871 teta(j)=teta(j)+2.d0*pi
876 teta(1)=teta(nt1)-2.d0*pi
877 teta(nt)=teta(2)+2.d0*pi
884 ps0=psip+zps*(psim-psip)
890 ro2j=(ps0-psim)/( 0.5d0*dp(3)*cos(ttj)**2
891 + + dp(4)*cos(ttj)*sin(ttj)
892 + + 0.5d0*dp(5)*sin(ttj)**2 )
896 r(i,j)=rm+rop(j)*cos(teta(j))
897 z(i,j)=zm+rop(j)*sin(teta(j))
903 ccc
grid moving along rais
922 if(zps.le.ps0 .and. zps.ge.pspl)
then
923 zro=((pspl-zps)*ro0-(ps0-zps)*ropl)/(pspl-ps0)
962 rnj=rmold+ron(j)*cos(tetn(j))
963 znj=zmold+ron(j)*sin(tetn(j))
968 roi(j)=sqrt(drx**2+dzx**2)
969 tetp=acos(drx/roi(j))
980 if(teti(j).lt.teti(j-1))
then
981 teti(j)=teti(j)+2.d0*pi
984 if(teti(j).lt.teti(j-1))
then
985 teti(j)=teti(j)+2.d0*pi
991 teti(1)=teti(nt1)-2.d0*pi
992 teti(nt)=teti(2)+2.d0*pi
1001 if(tetv.lt.teti(1)) tetv=tetv+2.d0*pi
1002 if(tetv.lt.teti(1)) tetv=tetv+2.d0*pi
1003 if(tetv.gt.teti(nt)) tetv=tetv-2.d0*pi
1004 if(tetv.gt.teti(nt)) tetv=tetv-2.d0*pi
1016 if(tetv.le.ttpl .and. tetv.ge.tt0)
then
1017 zro=((ttpl-tetv)*ro0+(tetv-tt0)*ropl)/(ttpl-tt0)
1028 roerr=dabs(ron(j)-ro(i,j))
1030 if(roerr.gt.erro)
then
1036 roplt(i,j)=ron(j)-ro(i,j)
1038 r(i,j)=rop(j)*cos(teta(j))+rm
1039 z(i,j)=rop(j)*sin(teta(j))+zm
1046 write(*,*)
'erro max.',erro
1047 write(*,*)
'i,j erro',ierm,jerm,erro
1052 ro(i,j)=dsqrt((r(i,j)-rm)**2+(z(i,j)-zm)**2)
1053 ronor(i,j)=ro(i,j)/rob(j)
1062 r(iplas,j)=rob(j)*cos(teta(j))+rm
1063 z(iplas,j)=rob(j)*sin(teta(j))+zm
1078 ronor(i,1)=ronor(i,nt1)
1079 ronor(i,nt)=ronor(i,2)
1087 roplt(i,1)=roplt(i,nt1)
1088 roplt(i,nt)=roplt(i,2)
1098 psi(i,j)=psip+psin(i,j)*(psim-psip)
1116 include
'double.inc'
1118 parameter(nbtabp=1000)
1119 parameter(nb4=nbtabp+4,nb6=nb4*6)
1120 include
'compol.inc'
1122 common /combsh/ rm0,zm0,rc0,zc0,asp0,el_up,el_lw,tr_up,tr_lw,nbsh
1124 real*8 robn(nbtabp),tetbn(nbtabp)
1125 real*8 rrk(nb4),cck(nb4),wrk(nb6),cwk(4)
1158 if(rbtab(ib).gt.rbomax) rbomax=rbtab(ib)
1159 if(rbtab(ib).lt.rbomin) rbomin=rbtab(ib)
1160 if(zbtab(ib).gt.zbomax) zbomax=zbtab(ib)
1161 if(zbtab(ib).lt.zbomin) zbomin=zbtab(ib)
1164 rc0new=0.5d0*(rbomax+rbomin)
1165 zc0new=0.5d0*(zbomax+zbomin)
1191 robn(ib)=sqrt(drx**2+dzx**2)
1192 tetp=dacos(drx/robn(ib))
1193 if(dzx.lt.0.d0)
then
1198 if(rbtab(ib).gt.rbomax) rbomax=rbtab(ib)
1199 if(rbtab(ib).lt.rbomin) rbomin=rbtab(ib)
1200 if(zbtab(ib).gt.zbomax) zbomax=zbtab(ib)
1201 if(zbtab(ib).lt.zbomin) zbomin=zbtab(ib)
1204 rc0=0.5d0*(rbomax+rbomin)
1205 zc0=0.5d0*(zbomax+zbomin)
1209 if(tetbn(ib).lt.tetbn(ib-1)) tetbn(ib)=tetbn(ib)+2.d0*pi
1212 if(tetbn(ib).lt.tetbn(ib-1)) tetbn(ib)=tetbn(ib)+2.d0*pi
1216 if(tetbn(1)+2.d0*pi-tetbn(nbn) .GT. 1.d-4)
then
1218 tetbn(nbn)=tetbn(1)+2.d0*pi
1225 ro(iplas,j+1)=robn(j)
1230 teta(1)=teta(nt1)-2.d0*pi
1231 teta(nt)=teta(2)+2.d0*pi
1232 ro(iplas,nt)=ro(iplas,2)
1233 ro(iplas,1)=ro(iplas,nt1)
1238 r(iplas,j)=rm+ro(iplas,j)*dcos(tetp)
1239 z(iplas,j)=zm+ro(iplas,j)*dsin(tetp)
1248 ro(i,j)=ro(iplas,j)*ronor(i,j)
1256 r(i,j)=rm+ro(i,j)*dcos(teta(j))
1257 z(i,j)=zm+ro(i,j)*dsin(teta(j))
1277 psin(i,1)=psin(i,nt1)
1282 psin(i,nt)=psin(i,2)
1289 psi(i,j)=psip+psin(i,j)*(psim-psip)
1312 include
'double.inc'
1314 parameter(nbtabp=1000)
1315 parameter(nb4=nbtabp+4,nb6=nb4*6)
1316 include
'compol.inc'
1319 real*8 robn(nbtabp),tetbn(nbtabp)
1320 real*8 rrk(nb4),cck(nb4),wrk(nb6),cwk(4)
1343 robn(ib)=sqrt(drx**2+dzx**2)
1344 tetp=dacos(drx/robn(ib))
1345 if(dzx.lt.0.d0)
then
1350 if(rbtab(ib).gt.rbomax) rbomax=rbtab(ib)
1351 if(rbtab(ib).lt.rbomin) rbomin=rbtab(ib)
1354 rc0=0.5d0*(rbomax+rbomin)
1358 if(tetbn(ib).lt.tetbn(ib-1)) tetbn(ib)=tetbn(ib)+2.d0*pi
1361 if(tetbn(ib).lt.tetbn(ib-1)) tetbn(ib)=tetbn(ib)+2.d0*pi
1365 if(tetbn(1)+2.d0*pi-tetbn(nbn) .GT. 1.d-4)
then
1367 tetbn(nbn)=tetbn(1)+2.d0*pi
1371 CALL
e01baf(nbn,tetbn,robn,rrk,cck,nbn+4,wrk,6*nbn+16,ifail)
1375 if(tetp.lt.tetbn(1))
then
1377 elseif(tetp.gt.tetbn(nbn))
then
1380 if(tetp.lt.tetbn(1))
then
1382 elseif(tetp.gt.tetbn(nbn))
then
1386 CALL
e02bcf(nbn+4,rrk,cck,tetp ,0,cwk,ifail)
1391 r(iplas,j)=rm+ro(iplas,j)*dcos(tetp)
1392 z(iplas,j)=zm+ro(iplas,j)*dsin(tetp)
1401 ro(i,j)=ro(iplas,j)*ronor(i,j)
1409 r(i,j)=rm+ro(i,j)*dcos(teta(j))
1410 z(i,j)=zm+ro(i,j)*dsin(teta(j))
1430 psin(i,1)=psin(i,nt1)
1434 psin(i,nt)=psin(i,2)
1441 psi(i,j)=psip+psin(i,j)*(psim-psip)
1458 include
'double.inc'
1460 include
'compol.inc'
1471 include
'double.inc'
1473 include
'compol.inc'
1488 include
'double.inc'
1493 parameter(nbtabp=1000)
1494 parameter(nb4=nbtabp+4,nb6=nb4*6)
1495 include
'compol.inc'
1498 common /combsh/ rm0,zm0,rc0,zc0,asp0,el_up,el_lw,tr_up,tr_lw,nbsh
1502 real*8 drds(ntp),dzds(ntp),rcrv(ntp),rcrn(ntp)
1503 real*8 dls(ntp),drodt(ntp)
1504 real*8 ron(ntp),tetn(ntp)
1505 real*8 robn(nbtabp),tetbn(nbtabp)
1506 real*8 rrk(nb4),cck(nb4),wrk(nb6),cwk(4)
1511 frbon(r0,aa,tr,tet)=r0+(r0/aa)*dcos(tet+tr*dsin(tet))
1512 fzbon(r0,z0,aa,el,tet)=z0+(r0/aa)*el*dsin(tet)
1528 psia(i)=(iplas-i)/(iplas-1.d0)
1538 elseif(igdf.eq.1 .OR. igdf.eq.2 .OR. igdf.eq.3)
then
1541 psia(i)=1.d0-((i-1)/(iplas-1.d0))**2
1545 dpsda(i)=(1-2*i)/(iplas-1.d0)
1566 teta(j)=teta(j-1)+dtet
1569 teta(1)=teta(nt1)-2.d0*pi
1570 teta(nt)=teta(2)+2.d0*pi
1576 tri=0.5d0*(tr_up+tr_lw+(tr_up-tr_lw)*sin(tet))
1577 ell=0.5d0*(el_up+el_lw+(el_up-el_lw)*sin(tet))
1579 rrr=frbon(rc0,asp0,tri,tet)
1581 zzz=fzbon(rc0,zc0,asp0,ell,tet)
1584 roxx=sqrt((r(iplas,j)-rm)**2+(z(iplas,j)-zm)**2)
1594 rbtab(ib)= r(iplas,ib)
1595 zbtab(ib)= z(iplas,ib)
1641 robn(ib)=sqrt(drx**2+dzx**2)
1643 tetp=dacos(drx/robn(ib))
1645 if(dzx.lt.0.d0)
then
1652 if(rbtab(ib).gt.rbomax) rbomax=rbtab(ib)
1653 if(rbtab(ib).lt.rbomin) rbomin=rbtab(ib)
1654 if(zbtab(ib).gt.zbomax) zbomax=zbtab(ib)
1655 if(zbtab(ib).lt.zbomin) zbomin=zbtab(ib)
1659 rc0=0.5d0*(rbomax+rbomin)
1660 zc0=0.5d0*(zbomax+zbomin)
1663 if(tetbn(ib).lt.tetbn(ib-1)) tetbn(ib)=tetbn(ib)+2.d0*pi
1667 if(tetbn(ib).lt.tetbn(ib-1)) tetbn(ib)=tetbn(ib)+2.d0*pi
1672 if(tetbn(1)+2.d0*pi-tetbn(nbn) .GT. 1.d-4)
then
1676 tetbn(nbn)=tetbn(1)+2.d0*pi
1684 ro(iplas,j+1)=robn(j)
1689 teta(1)=teta(nt1)-2.d0*pi
1690 teta(nt)=teta(2)+2.d0*pi
1694 r(iplas,j)=rm+ro(iplas,j)*dcos(tetp)
1695 z(iplas,j)=zm+ro(iplas,j)*dsin(tetp)
1720 ro(i,j)=ro(iplas,j)*dsqrt(1.d0-psia(i))
1726 r(i,j)=rm+ro(i,j)*dcos(teta(j))
1727 z(i,j)=zm+ro(i,j)*dsin(teta(j))
1748 psin(i,1)=psin(i,nt1)
1752 psin(i,nt)=psin(i,2)
1759 psi(i,j)=psip+psin(i,j)*(psim-psip)
1778 include
'double.inc'
1783 parameter(nbtabp=1000)
1784 parameter(nb4=nbtabp+4,nb6=nb4*6)
1785 include
'compol.inc'
1788 common /combsh/ rm0,zm0,rc0,zc0,asp0,el_up,el_lw,tr_up,tr_lw,nbsh
1792 real*8 drds(ntp),dzds(ntp),rcrv(ntp),rcrn(ntp)
1793 real*8 dls(ntp),drodt(ntp)
1794 real*8 ron(ntp),tetn(ntp)
1795 real*8 robn(nbtabp),tetbn(nbtabp)
1796 real*8 rrk(nb4),cck(nb4),wrk(nb6),cwk(4)
1798 frbon(r0,aa,tr,tet)=r0+(r0/aa)*dcos(tet+tr*dsin(tet))
1799 fzbon(r0,z0,aa,el,tet)=z0+(r0/aa)*el*dsin(tet)
1814 psia(i)=(iplas-i)/(iplas-1.d0)
1824 elseif(igdf.eq.1 .OR. igdf.eq.2)
then
1827 psia(i)=1.d0-((i-1)/(iplas-1.d0))**2
1831 dpsda(i)=(1-2*i)/(iplas-1.d0)
1842 teta(j)=teta(j-1)+dtet
1845 teta(1)=teta(nt1)-2.d0*pi
1846 teta(nt)=teta(2)+2.d0*pi
1863 tri=0.5d0*(tr_up+tr_lw+(tr_up-tr_lw)*sin(tet))
1864 ell=0.5d0*(el_up+el_lw+(el_up-el_lw)*sin(tet))
1866 rrr=frbon(rc0,asp0,tri,tet)
1868 zzz=fzbon(rc0,zc0,asp0,ell,tet)
1871 roxx=sqrt((r(iplas,j)-rm)**2+(z(iplas,j)-zm)**2)
1908 robn(ib)=sqrt(drx**2+dzx**2)
1910 tetp=dacos(drx/robn(ib))
1912 if(dzx.lt.0.d0)
then
1918 if(rbtab(ib).gt.rbomax) rbomax=rbtab(ib)
1919 if(rbtab(ib).lt.rbomin) rbomin=rbtab(ib)
1923 rc0=0.5d0*(rbomax+rbomin)
1925 c
write(6,*)
'Subr."grid_0": rc0 = ', rc0
1928 if(tetbn(ib).lt.tetbn(ib-1)) tetbn(ib)=tetbn(ib)+2.d0*pi
1932 if(tetbn(ib).lt.tetbn(ib-1)) tetbn(ib)=tetbn(ib)+2.d0*pi
1937 if(tetbn(1)+2.d0*pi-tetbn(nbn) .GT. 1.d-4)
then
1941 tetbn(nbn)=tetbn(1)+2.d0*pi
1949 CALL
e01baf(nbn,tetbn,robn,rrk,cck,nbn+4,wrk,6*nbn+16,ifail)
1957 if(tetp.lt.tetbn(1))
then
1959 elseif(tetp.gt.tetbn(nbn))
then
1963 if(tetp.lt.tetbn(1))
then
1965 elseif(tetp.gt.tetbn(nbn))
then
1969 CALL
e02bcf(nbn+4,rrk,cck,tetp ,0,cwk,ifail)
1974 r(iplas,j)=rm+ro(iplas,j)*dcos(tetp)
1975 z(iplas,j)=zm+ro(iplas,j)*dsin(tetp)
1990 drob=sqrt(drx**2+dzx**2)
1992 if(dzx.lt.0.d0)
then
2001 if(teta(j).lt.teta(j-1))
then
2002 teta(j)=teta(j)+2.d0*pi
2005 if(teta(j).lt.teta(j-1))
then
2006 teta(j)=teta(j)+2.d0*pi
2011 teta(1)=teta(nt1)-2.d0*pi
2012 teta(nt)=teta(2)+2.d0*pi
2017 ro(i,j)=ro(iplas,j)*dsqrt(1.d0-psia(i))
2023 r(i,j)=rm+ro(i,j)*dcos(teta(j))
2024 z(i,j)=zm+ro(i,j)*dsin(teta(j))
2043 psin(i,1)=psin(i,nt1)
2047 psin(i,nt)=psin(i,2)
2054 psi(i,j)=psip+psin(i,j)*(psim-psip)
2076 include
'parrc1.inc'
2077 include
'double.inc'
2078 include
'comrec.inc'
2080 dimension rxb(nbndp2),zxb(nbndp2)
2082 real*8 roxb(nbndp2),tetxb(nbndp2)
2083 real*8 rrk(nbndp4),cck(nbndp4),wrk(nbndp6)
2084 real*8 cwk(4),tetpol(*),ro0(*)
2088 xzer(x1,x2,v1,v2) = (x1*v2-x2*v1)/(v2-v1)
2090 c
write(6,*)
'***loop95:enter'
2103 if(xm.le.x(i+1) .AND. xm.gt.x(i)) icell=i
2107 if(ym.le.y(j+1) .AND. ym.gt.y(j)) jcell=j
2117 ut(ii,jj)=un(ii,jj)-u0
2126 if(ut(i,j)*ut(i+1,j).le.0.d0)
then
2131 rxb(ig)=xzer(x(i+1),x(i),ut(i+1,j),ut(i,j))
2141 write(6,*)
'loop95: first point was not find'
2159 if(ut(i+1,j)*ut(i,j).le.0.d0 .AND. lin.ne.1)
then
2166 rxb(ig)=xzer(x(i+1),x(i),ut(i+1,j),ut(i,j))
2169 elseif(ut(i+1,j+1)*ut(i+1,j).le.0.d0.AND. lin.ne.2)
then
2177 zxb(ig)=xzer(y(j+1),y(j),ut(i+1,j+1),ut(i+1,j))
2179 elseif(ut(i+1,j+1)*ut(i,j+1).le.0.d0 .AND. lin.ne.3)
then
2186 rxb(ig)=xzer(x(i+1),x(i),ut(i+1,j+1),ut(i,j+1))
2189 elseif(ut(i,j+1)*ut(i,j).le.0.d0.AND. lin.ne.4)
then
2197 zxb(ig)=xzer(y(j+1),y(j),ut(i,j+1),ut(i,j))
2201 c
write(6,*)
'loop:ic,jc',ic,jc,ig
2203 if(jc.eq.jc1 .AND. ic.eq.ic1)
then
2226 if(drx.lt.0.d0) tetp=tetp+pi
2227 deltet=tetp-tetxb(ig-1)
2228 if(deltet.lt.0.d0) tetp=tetp+2.d0*pi
2232 roxb(ig)=dsqrt(drx**2+dzx**2)
2234 c
write(6,*)
'ig,ro,tet',ig,roxb(ig),tetxb(ig)
2238 CALL
e01baf(nxb,tetxb,roxb,rrk,cck,nxb+4,wrk,6*nxb+16,ifail)
2240 c
write(6,*)
'ifail=',ifail
2244 if(tetp.lt.tetxb(1))
then
2246 elseif(tetp.gt.tetxb(nxb))
then
2249 CALL
e02bcf(nxb+4,rrk,cck,tetp ,0,cwk,ifail)
2251 c
write(6,*)
'ifail=',ifail,j
2263 common /comind/ ni,nj,ni1,nj1,ni2,nj2,nbnd,nkin,nkout
2264 common /comrz/ x(nip),y(njp),dx(nip),dy(njp),
2265 + dxi(nip),dyj(njp),x12(nip)
2267 common /compot/ u(nip,njp),ue(nip,njp),un(nip,njp),
2268 + ui(nip,njp),g(nip,njp),
2269 + ux0,ux1,ux2,up,um,xm,ym,
2270 + xx0,yx0,xx1,yx1,xx2,yx2,imax,jmax,
2272 + xx10,yx10,xx20,yx20,xm0,ym0,
2275 dimension rxb(nbndp2),zxb(nbndp2)
2279 real*8 roxb(nbndp2),tetxb(nbndp2)
2281 real*8 tetpol(*),ro0(*)
2285 xzer(x1,x2,v1,v2) = (x1*v2-x2*v1)/(v2-v1)
2287 c
write(6,*)
'*** loopL_b: enter'
2300 if(xm.le.x(i+1) .AND. xm.gt.x(i)) icell=i
2304 if(ym.le.y(j+1) .AND. ym.gt.y(j)) jcell=j
2314 ut(ii,jj)=un(ii,jj)-u0
2325 if(ut(i,j)*ut(i+1,j).le.0.d0)
then
2330 rxb(ig)=xzer(x(i+1),x(i),ut(i+1,j),ut(i,j))
2338 write(*,*)
'loopL: first point was not find'
2356 if(ut(i+1,j)*ut(i,j).le.0.d0 .AND. lin.ne.1)
then
2363 rxb(ig)=xzer(x(i+1),x(i),ut(i+1,j),ut(i,j))
2366 elseif(ut(i+1,j+1)*ut(i+1,j).le.0.d0.AND. lin.ne.2)
then
2374 zxb(ig)=xzer(y(j+1),y(j),ut(i+1,j+1),ut(i+1,j))
2376 elseif(ut(i+1,j+1)*ut(i,j+1).le.0.d0 .AND. lin.ne.3)
then
2383 rxb(ig)=xzer(x(i+1),x(i),ut(i+1,j+1),ut(i,j+1))
2386 elseif(ut(i,j+1)*ut(i,j).le.0.d0.AND. lin.ne.4)
then
2394 zxb(ig)=xzer(y(j+1),y(j),ut(i,j+1),ut(i,j))
2398 c
write(6,*)
'loopL:ic,jc',ic,jc,ig
2400 if(jc.eq.jc1 .AND. ic.eq.ic1)
then
2423 if(drx.lt.0.d0) tetp=tetp+pi
2424 deltet=tetp-tetxb(ig-1)
2425 if(deltet.lt.0.d0) tetp=tetp+2.d0*pi
2430 roxb(ig)=dsqrt(drx**2+dzx**2)
2432 c
write(6,*)
'ig,ro,tet',ig,roxb(ig),tetxb(ig)
2436 c
write(6,*)
'ifail=',ifail
2440 if(tetp.lt.tetxb(1))
then
2442 elseif(tetp.gt.tetxb(nxb))
then
2451 if(tetp.le.tetpl .AnD. tetp.ge.tetmn) go to 347
2456 ro0(j)=(ropl*(tetp-tetmn)+romn*(tetpl-tetp))/(tetpl-tetmn)
2469 include
'double.inc'
2471 include
'parrc1.inc'
2473 include
'compol.inc'
2475 parameter(nbtabp=1000)
2476 parameter(nb4=nbtabp+4,nb6=nb4*6)
2477 common /com_bas/ rbtab(nbtabp),zbtab(nbtabp),nbtab
2479 common /comrz/ x(nip),y(njp),dx(nip),dy(njp),
2480 + dxi(nip),dyj(njp),x12(nip)
2482 common /compot/ u(nip,njp),ue(nip,njp),un(nip,njp),
2483 + ui(nip,njp),g(nip,njp),
2484 + ux0,ux1,ux2,up,um,xm,ym,
2485 + xx0,yx0,xx1,yx1,xx2,yx2,imax,jmax,
2487 + xx10,yx10,xx20,yx20,xm0,ym0,
2490 real*8 ron(ntp),ronm(ntp)
2491 real*8 xs(nshp),ys(nshp),
fun(nshp),dp(5)
2507 psia(i)=(iplas-i)/(iplas-1.d0)
2514 elseif(igdf.eq.1 .OR. igdf.eq.2 .OR. igdf.eq.3)
then
2517 psia(i)=1.d0-((i-1)/(iplas-1.d0))**2
2521 dpsda(i)=(1-2*i)/(iplas-1.d0)
2538 teta(j)=teta(j-1)+dtet
2541 teta(1)=teta(nt1)-2.d0*pi
2542 teta(nt)=teta(2)+2.d0*pi
2550 fun(nsh)=u(imax,jmax)
2557 if(ii.ne.imax .OR. jj.ne.jmax)
then
2573 stpx=(x(imax+1)-x(imax))
2574 stpy=(y(jmax+1)-y(jmax))*0.75d0
2585 ro2j=(ur0-um)/( 0.5d0*dp(3)*cos(ttj)**2
2586 + + dp(4)*cos(ttj)*sin(ttj)
2587 + + 0.5d0*dp(5)*sin(ttj)**2 )
2592 r(i,j)=rm+ron(j)*cos(teta(j))
2593 z(i,j)=zm+ron(j)*sin(teta(j))
2602 c
write(6,*)
'ro(1)',ro(i,1),ro(i,2),stpx,stpy
2604 if( ron(2) .GT. dmax1(stpx,stpy) ) go to 2799
2612 do 100 i=iplas,ibeg,-1
2618 c
write(6,*)
'loopL i=',i,u0
2624 if(ron(j) .LT. ronm(j))
then
2625 ron(j)=(ro(i+1,j)+ronm(j)*(i-ibeg+1.d0))/(i-ibeg+2.d0)
2634 r(i,j)=rm+ron(j)*cos(teta(j))
2635 z(i,j)=zm+ron(j)*sin(teta(j))
2664 teta(1)=teta(nt1)-2.d0*pi
2665 teta(nt)=teta(2)+2.d0*pi
2670 psi(i,j)=psip+psin(i,j)*(psim-psip)
2706 include
'double.inc'
2708 include
'parrc1.inc'
2710 include
'compol.inc'
2713 common /comrz/ x(nip),y(njp),dx(nip),dy(njp),
2714 + dxi(nip),dyj(njp),x12(nip)
2716 common /compot/ u(nip,njp),ue(nip,njp),un(nip,njp),
2717 + ui(nip,njp),g(nip,njp),
2718 + ux0,ux1,ux2,up,um,xm,ym,
2719 + xx0,yx0,xx1,yx1,xx2,yx2,imax,jmax,
2721 + xx10,yx10,xx20,yx20,xm0,ym0,
2724 real*8 ron(ntp),ronm(ntp)
2725 real*8 xs(nshp),ys(nshp),
fun(nshp),dp(5)
2746 teta(j)=teta(j-1)+dtet
2749 teta(1)=teta(nt1)-2.d0*pi
2750 teta(nt)=teta(2)+2.d0*pi
2757 c
write(6,*)
'loopL i=',i,u0
2767 ro(i,j)=ronor(i,j)*ron(j)
2769 r(i,j)=rm+ro(i,j)*cos(teta(j))
2770 z(i,j)=zm+ro(i,j)*sin(teta(j))
2796 ronor(i,1)=ronor(i,nt1)
2802 ronor(i,nt)=ronor(i,2)
2808 psi(i,j)=psip+psin(i,j)*(psim-psip)
2832 include
'double.inc'
2839 parameter(ntz=1000, nsz=6*ntz+16)
2840 real*8 uk1(ntz), vk1(ntz)
2841 real*8 ukw(ntz), vkw(ntz)
2842 real*8 t1(ntz), t1n(ntz)
2843 real*8 w1(nsz), w2(nsz), w3(nsz)
2850 dr=dabs(rbtab(ib)-rbtab(1))
2851 dz=dabs(zbtab(ib)-zbtab(1))
2852 if(dr.lt.1.d-6 .AND. dz.lt.1.d-6)
then
2869 cx min(z) as a starting
2873 c
if(vkw(j).lt.zmin)
then
2878 cx x-point as starting
2879 cx internal point as middle
2885 if(ukw(j).lt.rmin)
then
2888 if(ukw(j).gt.rmax)
then
2891 if(vkw(j).lt.zmin)
then
2894 if(vkw(j).gt.zmax)
then
2898 rint=0.5d0*(rmin+rmax)
2899 zint=0.5d0*(zmin+zmax)
2901 clock=(ukw(1)-rint)*(vkw(2)-zint)-(vkw(1)-zint)*(ukw(2)-rint)
2903 cmin=((ukw(j)-ukw(m-1))*(ukw(j+1)-ukw(j))
2904 & +(vkw(j)-vkw(m-1))*(vkw(j+1)-vkw(j)))
2905 & /dsqrt(((ukw(j)-ukw(m-1))**2+(vkw(j)-vkw(m-1))**2)
2906 & *((ukw(j+1)-ukw(j))**2+(vkw(j+1)-vkw(j))**2))
2909 ccur=((ukw(j)-ukw(j-1))*(ukw(j+1)-ukw(j))
2910 & +(vkw(j)-vkw(j-1))*(vkw(j+1)-vkw(j)))
2911 & /dsqrt(((ukw(j)-ukw(j-1))**2+(vkw(j)-vkw(j-1))**2)
2912 & *((ukw(j+1)-ukw(j))**2+(vkw(j+1)-vkw(j))**2))
2914 if(ccur.lt.cmin)
then
2921 uk1(j-jvmin+1)=ukw(j)
2922 vk1(j-jvmin+1)=vkw(j)
2925 uk1(m-jvmin+j)=ukw(j)
2926 vk1(m-jvmin+j)=vkw(j)
2932 write(*,*)
' bound points ',m
2933 write(*,*)
' bound start point ',uk1(1),vk1(1)
2934 write(*,*)
' min angle ',
2935 &(1.d0-dacos(cmin)/(4.d0*datan(1.d0)))*180.d0,
' degree'
2938 if((1.d0-dacos(cmin)/(4.d0*datan(1.d0)))*180.d0.lt.100.d0)
then
2939 uk1(2)=0.5d0*(uk1(1)+uk1(3))
2940 uk1(m-1)=0.5d0*(uk1(m)+uk1(m-2))
2941 vk1(2)=0.5d0*(vk1(1)+vk1(3))
2942 vk1(m-1)=0.5d0*(vk1(m)+vk1(m-2))
2944 write(*,*)
' linear interpolated near x-point '
2952 cx second x-point search
2954 cmin=((ukw(j)-ukw(j-1))*(ukw(j+1)-ukw(j))
2955 & +(vkw(j)-vkw(j-1))*(vkw(j+1)-vkw(j)))
2956 & /dsqrt(((ukw(j)-ukw(j-1))**2+(vkw(j)-vkw(j-1))**2)
2957 & *((ukw(j+1)-ukw(j))**2+(vkw(j+1)-vkw(j))**2))
2960 ccur=((ukw(j)-ukw(j-1))*(ukw(j+1)-ukw(j))
2961 & +(vkw(j)-vkw(j-1))*(vkw(j+1)-vkw(j)))
2962 & /dsqrt(((ukw(j)-ukw(j-1))**2+(vkw(j)-vkw(j-1))**2)
2963 & *((ukw(j+1)-ukw(j))**2+(vkw(j+1)-vkw(j))**2))
2965 if(ccur.lt.cmin)
then
2970 cx check the x-point angle
2971 if((1.d0-dacos(cmin)/(4.d0*datan(1.d0)))*180.d0.lt.100.d0)
then
2975 uk1(jvmin2+1)=0.5d0*(uk1(jvmin2)+uk1(jvmin2+2))
2976 uk1(jvmin2-1)=0.5d0*(uk1(jvmin2)+uk1(jvmin2-2))
2977 vk1(jvmin2+1)=0.5d0*(vk1(jvmin2)+vk1(jvmin2+2))
2978 vk1(jvmin2-1)=0.5d0*(vk1(jvmin2)+vk1(jvmin2-2))
2981 write(*,*)
' min angle ',
2982 & (1.d0-dacos(cmin)/(4.d0*datan(1.d0)))*180.d0,
' degree'
2983 write(*,*)
' linear interpolated near the second x-point '
2986 cx
arclength from the first to the second x-point
2990 culen=dsqrt((uk1(j)-uk1(j-1))**2+(vk1(j)-vk1(j-1))**2)
2992 if(j.le.jvmin2)
then
2996 cx distribute the point over the two branches
2999 m1x=(m11-1)*(x2len/tolen)+1
3010 CALL
arcm(mx,uk1,vk1,t1n)
3011 CALL
splna1(ntz,mx,t1n,uk1,m1x,t1,nsz,w1,w2,w3)
3012 CALL
splna1(ntz,mx,t1n,vk1,m1x,t1,nsz,w1,w2,w3)
3019 CALL
arcm(m1x ,uk1,vk1,t1n)
3020 CALL
splna1(ntz,m1x ,t1n,uk1,m1x,t1,nsz,w1,w2,w3)
3021 CALL
splna1(ntz,m1x ,t1n,vk1,m1x,t1,nsz,w1,w2,w3)
3024 abo=dmax1(abo,dabs(t1n(j)-t1(j)))
3026 IF(abo.LE.epsbo) go to 7776
3035 uk1(j+m1x-1)=ukw(j+jvmin2-1)
3036 vk1(j+m1x-1)=vkw(j+jvmin2-1)
3044 CALL
arcm(mx,uk1(m1x),vk1(m1x),t1n)
3045 CALL
splna1(ntz,mx,t1n,uk1(m1x),m2x,t1,nsz,w1,w2,w3)
3046 CALL
splna1(ntz,mx,t1n,vk1(m1x),m2x,t1,nsz,w1,w2,w3)
3053 CALL
arcm(m2x ,uk1(m1x),vk1(m1x),t1n)
3054 CALL
splna1(ntz,m2x ,t1n,uk1(m1x),m2x,t1,nsz,w1,w2,w3)
3055 CALL
splna1(ntz,m2x ,t1n,vk1(m1x),m2x,t1,nsz,w1,w2,w3)
3058 abo=dmax1(abo,dabs(t1n(j)-t1(j)))
3060 IF(abo.LE.epsbo) go to 7777
3064 WRITE(*,*)
' 2x ITERATIONS TO MATCH ARCL. DISTR. ',
3065 &
'AT THE BOUNDARY ',isbw
3070 cx no second x-point
3079 CALL
arcm(m ,uk1,vk1,t1n)
3080 CALL
splna1(ntz,m ,t1n,uk1,m11,t1,nsz,w1,w2,w3)
3082 CALL
splna1(ntz,m ,t1n,vk1,m11,t1,nsz,w1,w2,w3)
3086 c...
arclength mesh for new bo. (isbo iterations)
3091 CALL
arcm(m11 ,uk1,vk1,t1n)
3092 CALL
splna1(ntz,m11 ,t1n,uk1,m11,t1,nsz,w1,w2,w3)
3093 CALL
splna1(ntz,m11 ,t1n,vk1,m11,t1,nsz,w1,w2,w3)
3096 abo=dmax1(abo,dabs(t1n(j)-t1(j)))
3098 IF(abo.LE.epsbo) go to 7778
3109 deallocate( rbtab, zbtab )
3110 allocate( rbtab(nbtab), zbtab(nbtab) )
3115 if(clock.gt.0.)
then
3119 rbtab(j)=uk1(m11-j+1)
3120 zbtab(j)=vk1(m11-j+1)
3136 implicit real*8(a-h,o-z)
3138 dimension us(1:m),vs(1:m),aw(1:m)
3139 c... a.l. computation
3142 awj=dsqrt( (us(j)-us(j-1))**2+(vs(j)-vs(j-1))**2 )
3154 c...
spline recostruction for fu given new mesh: sk(nk)
3156 SUBROUTINE splna1(NAZ,N,S,FU,NK,SK,NSZ,W,WW,WWW)
3157 implicit real*8(a-h,o-z)
3162 dimension w(1:nsz),ww(1:nsz),www(1:nsz)
3173 CALL
e01baf(n,s,fu,w,ww,nsz,www,nsz,ifail)
3175 c CALL e02bbf(n4,w,ww,sk(i),cw,ifail)
3176 CALL
e02bcf(n4,w,ww,sk(i),0,cw,ifail)
3185 include
'double.inc'
3187 parameter(nbtabp=1000)
3188 parameter(nb4=nbtabp+4,nb6=nb4*6)
3189 include
'compol.inc'
3190 common /com_bas/ rbtab(nbtabp),zbtab(nbtabp),nbtab
3191 common /combsh/ rm0,zm0,rc0,zc0,asp0,el_up,el_lw,tr_up,tr_lw,nbsh
3193 real*8 robn(nbtabp),tetbn(nbtabp)
3194 real*8 rrk(nb4),cck(nb4),wrk(nb6),cwk(4)
3202 rbtab(ib)=rbtab(ib)+0.01
3210 include
'double.inc'
3212 include
'compol.inc'
3214 dimension af_r(nrp,0:mdim),bf_r(nrp,0:mdim)
3215 dimension af_z(nrp,0:mdim),bf_z(nrp,0:mdim)
3217 dimension x(nrp,ntp),y(nrp,ntp)
3243 rc=0.5d0*(r(i,j)+r(i,j+1))
3244 zc=0.5d0*(z(i,j)+z(i,j+1))
3245 dtet=0.5d0*(teta(j+1)-teta(j))/pi
3246 af_r(i,0)=af_r(i,0)+rc*dtet
3247 af_z(i,0)=af_z(i,0)+zc*dtet
3259 rc=0.5d0*(r(i,j)+r(i,j+1))
3260 zc=0.5d0*(z(i,j)+z(i,j+1))
3261 tetc=0.5d0*(teta(j+1)+teta(j))*m
3262 dtet=(teta(j+1)-teta(j))/pi
3263 af_r1=af_r(i,m)+rc*dtet*cos(tetc)
3264 af_z1=af_z(i,m)+zc*dtet*cos(tetc)
3265 bf_r1=bf_r(i,m)+rc*dtet*sin(tetc)
3266 bf_z1=bf_z(i,m)+zc*dtet*sin(tetc)
3267 af_r2=af_r(i,m)+0.5d0*(r0*cos(tet0)+r1*cos(tet1))*dtet
3268 af_z2=af_z(i,m)+0.5d0*(z0*cos(tet0)+z1*cos(tet1))*dtet
3269 bf_r2=bf_r(i,m)+0.5d0*(r0*sin(tet0)+r1*sin(tet1))*dtet
3270 bf_z2=bf_z(i,m)+0.5d0*(z0*sin(tet0)+z1*sin(tet1))*dtet
3271 af_r(i,m)=0.5d0*(af_r1+af_r2)
3272 af_z(i,m)=0.5d0*(af_z1+af_z2)
3273 bf_r(i,m)=0.5d0*(bf_r1+bf_r2)
3274 bf_z(i,m)=0.5d0*(bf_z1+bf_z2)
3298 x(i,j)=x(i,j) + af_r(i,m)*cos(m*tetk)+ bf_r(i,m)*sin(m*tetk)
3299 y(i,j)=y(i,j) + af_z(i,m)*cos(m*tetk)+ bf_z(i,m)*sin(m*tetk)
subroutine e02bcf(NCAP7, K, C, X, LEFT, S, IFAIL)
subroutine spider_remesh(erro, errpsi, imov)
subroutine interpolation(type_interp, xn1, xn2, xn3, xn4, r, s, x, xr, xs, xrs, xrr, xss, yn1, yn2, yn3, yn4, pn1, pn2, pn3, pn4, yr, ys, ps)
subroutine regrid0(erro, imov, errpsi)
subroutine grid_b(igdf, nstep)
subroutine grid_p1(igdf, nstep)
subroutine loopl_b(tetpol, ntet, ro0, u0)
subroutine e01baf(M, X, Y, K, C, LCK, WRK, LWRK, IFAIL)
subroutine grid_b1(igdf, nstep)
subroutine spline(N, X, Y, ALFA, BETA, TYP, A, B, C, D)
subroutine loop95_b(tetpol, ntet, ro0, u0)
subroutine deriv5(X, Y, F, M, N, U)
subroutine grid_00(igdf, nstep)
subroutine arc_x_bnd(nteta)
subroutine regrid(erro, imov, errpsi)
subroutine axdef(rma, zma, psima, dpm)
subroutine splna1(NAZ, N, S, FU, NK, SK, NSZ, W, WW, WWW)
subroutine prgrid(imax, jmax, erro, imov, errpsi)
subroutine arclength(fr, mfm, theta, dtc, wr, ws)
subroutine grid_p0(igdf, nstep)
subroutine furgrid(mdim, mg, af_r, bf_r, af_z, bf_z)
subroutine grid_11(igdf, nstep)
subroutine arcm(M, US, VS, AW)
subroutine grid_1(igdf, nstep)
subroutine grid_0(igdf, nstep)