7 write(fname,
'(a,a)') path(1:kname),
'eq_tim.wr'
14 write(1,*) (time_t(i),i=1,kwr)
15 write(1,*) (torcur(i),i=1,kwr)
16 write(1,*) (rm_t(i),i=1,kwr)
17 write(1,*) (zm_t(i),i=1,kwr)
18 write(1,*) (rxp_t(i),i=1,kwr)
19 write(1,*) (zxp_t(i),i=1,kwr)
20 write(1,*) (betpol_t(i),i=1,kwr)
21 write(1,*) (bettor_t(i),i=1,kwr)
22 write(1,*) (psim_t(i),i=1,kwr)
23 write(1,*) (psib_t(i),i=1,kwr)
38 include
'compol_add.inc'
40 write(fname,
'(a,a)') path(1:kname),
'eq_dump.wr'
44 write(1,*) nr,nt,nr1,nt1,nr2,nt2,iplas,iplas1
45 write(1,*) rm,zm,psim,psip,rx0,zx0,rx1,zx1,rx2,zx2
46 write(1,*) psiax,psibon,ixp1,jxp1,ixp2,jxp2,fvac,fpv
47 write(1,*) alp,alpnew,tok,tokp,cnor,qcen,pscen,psipla
48 write(1,*) rl,zl,clr,clz,rolim,jrolim,iterbf
50 write(1,*) ((r(i,j),i=1,nr),j=1,nt)
51 write(1,*) ((z(i,j),i=1,nr),j=1,nt)
52 write(1,*) ((ro(i,j),i=1,nr),j=1,nt)
53 write(1,*) ((cur(i,j),i=1,nr),j=1,nt)
54 write(1,*) ((psi(i,j),i=1,nr),j=1,nt)
55 write(1,*) ((ronor(i,j),i=1,nr),j=1,nt)
56 write(1,*) ((psie(i,j),i=1,nr),j=1,nt)
57 write(1,*) (teta(j),j=1,nt)
58 write(1,*) (q(i),i=1,iplas)
59 write(1,*) (f(i),i=1,iplas)
60 write(1,*) (
dpdpsi(i),i=1,iplas)
61 write(1,*) (dfdpsi(i),i=1,iplas)
62 write(1,*) (psia(i),i=1,iplas)
63 write(1,*) (dpsda(i),i=1,iplas)
76 include
'compol_add.inc'
78 write(fname,
'(a,a)') path(1:kname),
'eq_dump.wr'
82 read(1,*) nr,nt,nr1,nt1,nr2,nt2,iplas,iplas1
83 read(1,*) rm,zm,psim,psip,rx0,zx0,rx1,zx1,rx2,zx2
84 read(1,*) psiax,psibon,ixp1,jxp1,ixp2,jxp2,fvac,fpv
85 read(1,*) alp,alpnew,tok,tokp,cnor,qcen,pscen,psipla
86 read(1,*) rl,zl,clr,clz,rolim,jrolim,iterbf
88 read(1,*) ((r(i,j),i=1,nr),j=1,nt)
89 read(1,*) ((z(i,j),i=1,nr),j=1,nt)
90 read(1,*) ((ro(i,j),i=1,nr),j=1,nt)
91 read(1,*) ((cur(i,j),i=1,nr),j=1,nt)
92 read(1,*) ((psi(i,j),i=1,nr),j=1,nt)
93 read(1,*) ((ronor(i,j),i=1,nr),j=1,nt)
94 read(1,*) ((psie(i,j),i=1,nr),j=1,nt)
95 read(1,*) (teta(j),j=1,nt)
96 read(1,*) (q(i),i=1,iplas)
97 read(1,*) (f(i),i=1,iplas)
98 read(1,*) (
dpdpsi(i),i=1,iplas)
99 read(1,*) (dfdpsi(i),i=1,iplas)
100 read(1,*) (psia(i),i=1,iplas)
101 read(1,*) (dpsda(i),i=1,iplas)
114 include
'compol_add.inc'
116 common/compsf/ psf(nrp),sqtor(nrp)
117 common /com_jb/ bj_av(nrp),curfi_av(nrp)
118 common/com_but/ sigma(nrp),cbut_b(nrp)
120 write(fname,
'(a,a)') path(1:kname),
'outp.wr'
124 write(1,*) nr,nt,nr1,nt1,nr2,nt2,iplas
126 write(1,*) ((r(i,j),i=1,nr),j=1,nt)
127 write(1,*) ((z(i,j),i=1,nr),j=1,nt)
128 write(1,*) ((g(i,j),i=1,nr),j=1,nt)
129 write(1,*) ((cur(i,j),i=1,nr),j=1,nt)
130 write(1,*) ((psi(i,j),i=1,nr),j=1,nt)
131 write(1,*) ((psii(i,j),i=1,nr),j=1,nt)
132 write(1,*) ((psie(i,j),i=1,nr),j=1,nt)
133 write(1,*) ((aex(i,j),i=1,nr),j=1,nt)
134 write(1,*) (q(i),i=1,iplas)
135 write(1,*) (f(i),i=1,iplas)
136 write(1,*) rm,zm,rx0,zx0,ctim,kstep
139 write(fname,
'(a,a)') path(1:kname),
'ddp.wr'
143 write(1,*) (q(i),i=1,iplas)
144 write(1,*) (f(i),i=1,iplas)
145 write(1,*) (dfdpsi(i),i=1,iplas)
146 write(1,*) (psia(i),i=1,iplas)
147 write(1,*) (psf(i),i=1,iplas)
148 write(1,*) (
dpdpsi(i),i=1,iplas)
149 write(1,*) (curfi_av(i),i=1,iplas)
150 write(1,*) (sigma(i),i=1,iplas)
151 write(1,*) (cbut_b(i),i=1,iplas)
152 write(1,*) ctim,kstep
155 write(fname,
'(a,a)') path(1:kname),
'dps.wr'
176 include
'compol_add.inc'
178 write(fname,
'(a,a)') path(1:kname),
'outfb.wr'
182 read(1,*) idum,nt,idum,nt1,idum,nt2,iplas
183 read(1,*) ((r(i,j),i=1,iplas),j=1,nt)
184 read(1,*) ((z(i,j),i=1,iplas),j=1,nt)
185 read(1,*) ((ro(i,j),i=1,iplas),j=1,nt)
186 read(1,*) ((ronor(i,j),i=1,iplas),j=1,nt)
187 read(1,*) (teta(j),j=1,nt)
188 read(1,*) ((cur(i,j),i=1,iplas),j=1,nt)
189 read(1,*) ((psin(i,j),i=1,iplas),j=1,nt)
190 read(1,*) (q(i),i=1,iplas)
191 read(1,*) (f(i),i=1,iplas)
192 read(1,*) (dfdpsi(i),i=1,iplas)
193 read(1,*) (
dpdpsi(i),i=1,iplas)
194 read(1,*) (psia(i),i=1,iplas)
208 SUBROUTINE out(rbnd,zbnd,zli3,betpol,bettot,parpla)
215 include
'compol_add.inc'
217 dimension rbnd(*),zbnd(*),press(nrp)
218 dimension bro(nrp,ntp),btet(nrp,ntp)
221 common /volpla/ vol_pl
224 write(fname,
'(a,a)') path(1:kname),
'out.pr'
243 if(rmx.lt.rbnd(j))
then
250 if(rmn.gt.rbnd(j))
then
257 if(zmx.lt.zbnd(j))
then
264 if(zmn.gt.zbnd(j))
then
273 a_cen=0.5d0*(rmx-rmn)
274 r_cen=0.5d0*(rmx+rmn)
278 write(1,*)
' right plasma bound:'
279 write(1,*)
' Rmax=',rmx,
' z(rmax)=',z_rmx
281 write(1,*)
' left plasma bound:'
282 write(1,*)
' Rmin=',rmn,
' z(rmin)=',z_rmn
284 write(1,*)
' upper plasma bound:'
285 write(1,*)
' Zmax=',zmx,
' r(zmax)=',r_zmx
287 write(1,*)
' lower plasma bound:'
288 write(1,*)
' Zmin=',zmn,
' r(zmin)=',r_zmn
290 write(1,*)
' minor plasma radius:'
291 write(1,*)
'a=',a_cen
292 write(1,*)
' major plasma radius:'
293 write(1,*)
'Rc=',r_cen
295 c
write(6,*)
'a',a_cen
296 c
write(6,*)
'Rc',r_cen
298 elong=(zmx-zmn)/(rmx-rmn)
300 write(1,*)
'plasma elongation:'
301 write(1,*)
'el',elong
302 c
write(6,*)
'el',elong
304 triang=(r_cen-r_zmx)/a_cen
306 write(1,*)
'plasma triangularity'
307 write(1,*)
'tr',triang
308 c
write(6,*)
'tr',triang
314 press(iplas1)=
dpdpsi(iplas)*(psi(iplas1,2)-psi(iplas,2))*0.5d0
318 press(i)=press(i+1)+
dpdpsi(i+1)*(psi(i,2)-psi(i+2,2))*0.5d0
322 cccc---magnetic field determination
327 bro(i,j)=(psi(i,j+1)-psi(i,j))/sr(i,j)
335 btet(i,j)=(psi(i,j)-psi(i+1,j))/st(i,j)
348 pint_s=pint_s+press(i)*s(i,j)
349 pint_v=pint_v+press(i)*vol(i,j)
350 vol_pl=vol_pl+vol(i,j)
354 bp2_1=( bro(i,j)**2+btet(i,j)**2+
355 + 2.d0*bro(i,j)*btet(i,j)*cos1(i,j) )/sin1(i,j)
357 bp2_2=( bro(i+1,j)**2+btet(i,j)**2+
358 + 2.d0*bro(i+1,j)*btet(i,j)*cos2(i,j) )/sin2(i,j)
360 bp2_3=( bro(i+1,j)**2+btet(i,j+1)**2+
361 + 2.d0*bro(i+1,j)*btet(i,j+1)*cos3(i,j) )/sin3(i,j)
363 bp2_4=( bro(i,j)**2+btet(i,j+1)**2+
364 + 2.d0*bro(i,j)*btet(i,j+1)*cos4(i,j) )/sin4(i,j)
366 bp2_v=bp2_1*vol1(i,j)+bp2_2*vol2(i,j)+
367 + bp2_3*vol3(i,j)+bp2_4*vol4(i,j)
371 bp2_2=( bro(i+1,j)**2+btet(i,j)**2+
372 + 2.d0*bro(i+1,j)*btet(i,j)*cos2(i,j) )/sin2(i,j)
374 bp2_3=( bro(i+1,j)**2+btet(i,j+1)**2+
375 + 2.d0*bro(i+1,j)*btet(i,j+1)*cos3(i,j) )/sin3(i,j)
377 bp2_v= bp2_3*vol3(i,j)+bp2_2*vol2(i,j)
381 bint_v=bint_v+bp2_v*2.d0*pi
390 betpol=8.d0*pi*pint_s/tokp**2
392 zli3=2.d0*bint_v/(r_cen*tokp**2)
396 bettot=2.0d0*paver/bfvac**2
399 c
write(6,*)
'BETpol',betpol
400 c
write(6,*)
'BETtot',bettot
401 c
write(6,*)
'Li3 ',zli3
402 c
write(6,*)
'Fvac ',fvac
403 c
write(6,*)
'BFvac_cen ',bfvac
404 c
write(6,*)
'Paver ',paver
405 c
write(6,*)
'cnor ',cnor
406 c
write(6,*)
'Vol_pl',vol_pl
408 write(1,*) nr,nt,nr1,nt1,nr2,nt2
409 write(1,*)
'alp=',alp
410 write(1,*)
'rxp=',rx0,
'zxp=',zx0
411 write(1,*)
'rm =',rm,
'zm =',zm
412 write(1,*)
'BETpol',betpol
413 write(1,*)
'BETtot',bettot
414 write(1,*)
'Li3 ',zli3
436 write(1,*) (teta(j),j=1,nt)
440 write(1,*) (r(i,j),j=1,nt)
443 write(1,*) (z(i,j),j=1,nt)
446 write(1,*) (g(i,j),j=1,nt)
449 write(1,*) (cur(i,j),j=1,nt)
452 write(1,*) (psi(i,j),j=1,nt)
455 write(1,*) (psii(i,j),j=1,nt)
458 write(1,*) (psie(i,j),j=1,nt)
474 include
'compol_add.inc'
476 write(fname,
'(a,a)') path(1:kname),
'out_test.pr'
481 write(1,*) (teta(j),j=1,nt)
486 write(1,*) (r(i,j),j=1,nt)
492 write(1,*) (z(i,j),j=1,nt)
498 write(1,*) (g(i,j),j=1,nt)
504 write(1,*) (cur(i,j),j=1,nt)
510 write(1,*) (psi(i,j),j=1,nt)
516 write(1,*) (psii(i,j),j=1,nt)
522 write(1,*) (psie(i,j),j=1,nt)
538 include
'compol_add.inc'
540 write(fname,
'(a,a)') path(1:kname),
'out.wr'
544 read(1,*) ni,nj,ni1,nj1,ni2,nj2,nxb
546 read(1,*) ((r(i,j),i=1,nr),j=1,nt)
547 read(1,*) ((z(i,j),i=1,nr),j=1,nt)
548 read(1,*) ((g(i,j),i=1,nr),j=1,nt)
549 read(1,*) ((cur(i,j),i=1,nr),j=1,nt)
565 write(fname,
'(a,a)') path(1:kname),
'rect.wr'
569 read(1,*) ni,nj,ni1,nj1,ni2,nj2,imax,jmax
571 read(1,*) (x(i),i=1,ni)
572 read(1,*) (y(j),j=1,nj)
573 read(1,*) ((u(i,j),i=1,ni),j=1,nj)
574 read(1,*) ((ue(i,j),i=1,ni),j=1,nj)
575 read(1,*) ((un(i,j),i=1,ni),j=1,nj)
576 read(1,*) ((ipr(i,j),i=1,ni),j=1,nj)
577 read(1,*) xm,ym,um,xx0,yx0,ux0,up,qcen,b0ax,r0ax
578 read(1,*) xx1,yx1,xx2,yx2
579 read(1,*) xmax,ymax,xmin,ymin
594 include
'compol_add.inc'
597 character*40 str,dummy
599 write(fname,
'(a,a)') path(1:kname),
'nmwr.wr'
606 write(str,
'(a,a,i1,a)') path(1:kname),
'step',numwr,
'.wr'
607 elseif(numwr.lt.100)
then
608 write(str,
'(a,a,i2,a)') path(1:kname),
'step',numwr,
'.wr'
609 elseif(numwr.lt.1000)
then
610 write(str,
'(a,a,i3,a)') path(1:kname),
'step',numwr,
'.wr'
612 write(str,
'(a,a,i4,a)') path(1:kname),
'step',numwr,
'.wr'
615 open(1,file=str,form=
'formatted')
616 write(1,*) nr,nt,iplas,istep,dtim,ctim
617 write(1,*) ((r(i,j),i=1,iplas),j=1,nt)
618 write(1,*) ((z(i,j),i=1,iplas),j=1,nt)
619 write(1,*) ((ro(i,j),i=1,iplas),j=1,nt)
620 write(1,*) (teta(j),j=1,nt)
621 write(1,*) ((psi(i,j),i=1,iplas),j=1,nt)
622 write(1,*) ((psin(i,j),i=1,iplas),j=1,nt)
623 write(1,*) (psia(i),i=1,iplas)
625 write(1,*) (q(i),i=1,iplas)
626 write(1,*) (f(i),i=1,iplas)
627 write(1,*) (dfdpsi(i),i=1,iplas)
628 write(1,*) (
dpdpsi(i),i=1,iplas)
629 write(1,*) psi_eav,rm,zm,psim-psip,psibon0,tok
632 write(fname,
'(a,a)') path(1:kname),
'wlist.wr'
645 c---------------------------------------------------------------
650 c***************************************************************
subroutine out(rbnd, zbnd, zli3, betpol, bettot, parpla)
real(r8) function dpdpsi(psi_n)
subroutine wr_step(numwr, time, istep)
real(r8) function pressure(flux)