7 common /compsf/ psf(nrp), sqtor(nrp)
8 common/selcon/ psi_d(nrp),fi_d(nrp),f_d(nrp),ri_d(nrp),
9 * ps_pnt(nrp),del_psb,psi_bn1
11 common /com_jb/ bj_av(nrp),curfi_av(nrp)
12 common /com_b2/ b2_av(nrp)
14 common/savt0/ psi0(nrp),fi0(nrp),f0(nrp),ri0(nrp),q0(nrp),
15 * dpsidt(nrp),dfidt(nrp),rm0,ac0n,skcen0
18 common /com_volt/ upls(nrp)
19 common /fp_dot/ dfpdt(1000),nna1
28 character*10 etitl(5),
date
35 write(fname,
'(a,a)') path(1:kname),
'outp.wr'
38 write(1,*) nr,nt,nr1,nt1,nr2,nt2,iplas
39 write(1,*) ((r(i,j),i=1,iplas),j=1,nt)
40 write(1,*) ((z(i,j),i=1,iplas),j=1,nt)
41 write(1,*) ((cur(i,j),i=1,iplas),j=1,nt)
42 write(1,*) ((psi(i,j),i=1,iplas),j=1,nt)
43 write(1,*) (q(i),i=1,iplas)
44 write(1,*) (f(i),i=1,iplas)
47 write(fname,
'(a,a)') path(1:kname),
'ddp.wr'
51 write(1,*) (q(i),i=1,iplas)
52 write(1,*) (f(i),i=1,iplas)
53 write(1,*) (dfdpsi(i),i=1,iplas)
54 write(1,*) (psia(i),i=1,iplas)
55 write(1,*) (sqtor(i),i=1,iplas)
58 write(1,*) (
dpdpsi(i),i=1,iplas)
59 write(1,*) (bj_av(i),i=1,iplas)
61 write(1,*) (b2_av(i),i=1,iplas)
65 write(fname,
'(a,a)') path(1:kname),
'tabppf.wr'
70 write(1,*) 1.d0-psia(i),
dpdpsi(i),dfdpsi(i)
87 write(fname,
'(a,a)') path(1:kname),
'q.wr'
92 write(1,*) 1.d0-0.5d0*(psia(i)+psia(i+1)),0.5d0*q(i)/pi,i
94 write(1,*) 1.d0-psia(i),0.5d0*q(i)/pi,i
101 write(fname,
'(a,a)') path(1:kname),
'efit_comp.wr'
106 write(1,2020) rm,zm,psim*0.4d0*pi,psip*0.4d0*pi,tok*1.d3
107 write(1,2020) (f(i)*0.4d0*pi,i=1,nrr-1)
108 write(1,2020) (
dpdpsi(i)*1.d7/4.d0/pi,i=1,nrr)
109 write(1,2020) (dfdpsi(i)*0.4d0*pi,i=1,nrr)
110 write(1,2020) ((r(i,j),i=1,nrr),j=1,nt)
111 write(1,2020) ((z(i,j),i=1,nrr),j=1,nt)
112 write(1,2020) ((psi(i,j)*0.4d0*pi,i=1,nrr),j=1,nt)
113 write(1,2020) (q(i),i=1,nrr-1)
114 write(1,2020) (r(nrr,j),z(nrr,j),j=1,nt)
118 write(fname,
'(a,a)') path(1:kname),
'tab_bnd.wr'
123 write(1,*) r(iplas,ib),z(iplas,ib)
134 3000
format(1p4e19.12)
145 SUBROUTINE rd_step(numwr,dt,time,istep,psex_bnd,psi0_bnd)
152 character*40 str,dummy
154 write(fname,
'(a,a)') path(1:kname),
'nmwr.wr'
155 open(1,file=fname,form=
'formatted')
161 write(str,
'(a,a,i1,a)') path(1:kname),
'step',numwr,
'.wr'
162 elseif(numwr.lt.100)
then
163 write(str,
'(a,a,i2,a)') path(1:kname),
'step',numwr,
'.wr'
165 write(str,
'(a,a,i3,a)') path(1:kname),
'step',numwr,
'.wr'
168 open(1,file=str,form=
'formatted')
169 read(1,*) nr,nt,iplas,istep,dt,time
170 read(1,*) psex_bnd,rm,zm,psim,psi0_bnd,platok
171 read(1,*) ((r(i,j),i=1,iplas),j=1,nt)
172 read(1,*) ((z(i,j),i=1,iplas),j=1,nt)
173 read(1,*) ((ro(i,j),i=1,iplas),j=1,nt)
174 read(1,*) (teta(j),j=1,nt)
175 read(1,*) ((psi(i,j),i=1,iplas),j=1,nt)
176 read(1,*) ((psin(i,j),i=1,iplas),j=1,nt)
177 read(1,*) (psia(i),i=1,iplas)
196 c---------------------------------------------------------------
206 common /compsf/ psf(nrp), sqtor(nrp)
207 common/selcon/ psi_d(nrp),fi_d(nrp),f_d(nrp),ri_d(nrp),
208 * ps_pnt(nrp),del_psb,psi_bn1
210 common /com_jb/ bj_av(nrp),curfi_av(nrp)
211 common /com_b2/ b2_av(nrp)
219 character*10 etitl(5),
date
223 write(fname,
'(a,a)') path(1:kname),
'outp0.wr'
224 open(1,file=fname,form=
'formatted')
226 write(1,*) nr,nt,nr1,nt1,nr2,nt2,iplas
227 write(1,*) ((r(i,j),i=1,iplas),j=1,nt)
228 write(1,*) ((z(i,j),i=1,iplas),j=1,nt)
229 write(1,*) ((cur(i,j),i=1,iplas),j=1,nt)
230 write(1,*) ((psi(i,j),i=1,iplas),j=1,nt)
231 write(1,*) (q(i),i=1,iplas)
232 write(1,*) (f(i),i=1,iplas)
235 write(fname,
'(a,a)') path(1:kname),
'ddp0.wr'
236 open(1,file=fname,form=
'formatted')
239 write(1,*) (q(i),i=1,iplas)
240 write(1,*) (f(i),i=1,iplas)
241 write(1,*) (dfdpsi(i),i=1,iplas)
242 write(1,*) (psia(i),i=1,iplas)
243 write(1,*) (sqtor(i),i=1,iplas)
244 write(1,*) (
dpdpsi(i),i=1,iplas)
245 write(1,*) (curfi_av(i),i=1,iplas)
246 write(1,*) (b2_av(i),i=1,iplas)
249 write(fname,
'(a,a)') path(1:kname),
'dps.wr'
250 open(1,file=fname,form=
'formatted')
253 ddps=psia(i)*psim-psi_d(i)
254 ddfi=flx_fi(i)-fi_d(i)
256 write(1,*) ddps,ddfi,ddf,i
258 write(1,*)
' dpsidt from promat'
259 write(1,*) (ps_pnt(i),i=1,iplas)
260 write(1,*)
'del_psb from promat',del_psb
264 write(fname,
'(a,a)') path(1:kname),
'q0.wr'
265 open(1,file=fname,form=
'formatted')
269 write(1,*) 1.d0-0.5d0*(psia(i)+psia(i+1)),0.5d0*q(i)/pi,i
271 write(1,*) 1.d0-psia(i),0.5d0*q(i)/pi,i
278 write(fname,
'(a,a)') path(1:kname),
'efit_comp.wr'
279 open(1,file=fname,form=
'formatted')
283 write(1,2020) rm,zm,psim*0.4d0*pi,psip*0.4d0*pi,tok*1.d3
284 write(1,2020) (f(i)*0.4d0*pi,i=1,nrr-1)
285 write(1,2020) (
dpdpsi(i)*1.d7/4.d0/pi,i=1,nrr)
286 write(1,2020) (dfdpsi(i)*0.4d0*pi,i=1,nrr)
287 write(1,2020) ((r(i,j),i=1,nrr),j=1,nt)
288 write(1,2020) ((z(i,j),i=1,nrr),j=1,nt)
289 write(1,2020) ((psi(i,j)*0.4d0*pi,i=1,nrr),j=1,nt)
290 write(1,2020) (q(i),i=1,nrr-1)
291 write(1,2020) (r(nrr,j),z(nrr,j),j=1,nt)
302 3000
format(1p4e19.12)
308 write(*,*)
'wrb:writing iz done'
369 c
write(17,*)
'r(i,j): j=1,nt; i=',i
370 c
write(17,*) (r(i,j),j=1,nt)
371 c
write(17,*)
'z(i,j): j=1,nt; i=',i
372 c
write(17,*) (z(i,j),j=1,nt)
373 c
write(17,*)
'cur(i,j): j=1,nt; i=',i
374 c
write(17,*) (cur(i,j),j=1,nt)
375 c
write(17,*)
'psi(i,j): j=1,nt; i=',i
376 c
write(17,*) (psi(i,j),j=1,nt)
383 SUBROUTINE wrdump(numwr,time,istep,psiplb,psiexb,psimag,flu_tor)
389 dimension psiplb(*),psiexb(*),psimag(*),flu_tor(*)
390 character*40 str,dummy
392 write(fname,
'(a,a)') path(1:kname),
'nmwr.wr'
393 open(1,file=fname,form=
'formatted')
399 write(str,
'(a,a,i1,a)') path(1:kname),
'writ',numwr,
'.wr'
401 if(numwr.lt.100)
then
402 write(str,
'(a,a,i2,a)') path(1:kname),
'writ',numwr,
'.wr'
404 write(str,
'(a,a,i3,a)') path(1:kname),
'writ',numwr,
'.wr'
408 open(1,file=str,form=
'formatted')
409 write(1,*) nr,nt,nr1,nt1,nr2,nt2,iplas,istep
410 write(1,*) ((r(i,j),i=1,iplas),j=1,nt)
411 write(1,*) ((z(i,j),i=1,iplas),j=1,nt)
412 write(1,*) ((cur(i,j),i=1,iplas),j=1,nt)
413 write(1,*) ((psi(i,j),i=1,iplas),j=1,nt)
414 write(1,*) (q(i),i=1,iplas)
415 write(1,*) (f(i),i=1,iplas)
416 write(1,*) (dfdpsi(i),i=1,iplas)
417 write(1,*) (psia(i),i=1,iplas)
418 write(1,*) (
dpdpsi(i),i=1,iplas)
419 write(1,*) (psiplb(i),i=1,istep)
420 write(1,*) (psiexb(i),i=1,istep)
421 write(1,*) (psimag(i),i=1,istep)
422 write(1,*) (psimag(i),i=1,istep)
423 write(1,*) (flu_tor(i),i=1,istep)
426 write(fname,
'(a,a)') path(1:kname),
'wlist.wr'
427 open(1,file=fname,form=
'formatted')
439 c---------------------------------------------------------------
444 c***************************************************************
447 subroutine tab_efit( tokf, psax, eqdfn, rax,zax, b0,r0 )
453 parameter(np=1000,nbp=np*4)
455 real*8 ps(np),
p(np),f(np),q(np)
458 dimension psirz(np,np),
459 * rbbbs(nbp),zbbbs(nbp)
461 common/com_eqd/ fpol(np),pres(np),qpsi(np),
462 * ffprim(np),pprime(np),
463 * rlimtr(np),zlimtr(np),
case,simag,sibry,
470 common/efites/ fcefit,rcentr,iefit
471 common/comefi/ x(np),y(np),u(np,np)
476 c--------------------------------------------------------------------
481 write(*,*)
'************************* '
482 write(*,*)
' Entry of subr."tab_efit":'
483 write(*,*)
'------------------------- '
485 write(fname,
'(a,a40)') path(1:kname),eqdfn
486 open(1,file=fname,form=
'formatted')
489 read(1,2000) (
case(i),i=1,6),idum,nw,nh
490 write(*,*) idum,nw,nh
492 read(1,2020) rdim,zdim,rcentr,rleft,zmid
493 read(1,2020) rmaxis,zmzxis,simag,sibry,bcentr
494 read(1,2020)
current,simag,xdum,rmaxis,xdum
495 read(1,2020) zmaxis,xdum,sibry,xdum,xdum
496 read(1,2020) (fpol(i),i=1,nw)
497 read(1,2020) (pres(i),i=1,nw)
498 read(1,2020) (ffprim(i),i=1,nw)
499 read(1,2020) (pprime(i),i=1,nw)
500 read(1,2020) ((psirz(i,j),i=1,nw),j=1,nh)
501 read(1,2020) (qpsi(i),i=1,nw)
502 read(1,2022) nbbbs,limitr
503 read(1,2020) (rbbbs(i),zbbbs(i),i=1,nbbbs)
504 read(1,2020) (rlimtr(i),zlimtr(i),i=1,limitr)
511 p_intgr=p_intgr+pprime(i)
514 if(p_intgr.lt.0.d0)
then
525 fpol(i)=fpol(i)*i_sign
526 ffprim(i)=ffprim(i)*i_sign
527 pprime(i)=pprime(i)*i_sign
529 psirz(i,j)=psirz(i,j)*i_sign
550 c------------------------------------------------
553 % deallocate( pstab, pptab, fptab )
554 allocate( pstab(nw), pptab(nw), fptab(nw) )
563 pstab(i)= dfloat(i-1)/dfloat(nw-1)
564 pptab(i)= pprime(i)*amu0*1.d-6
575 c------------------------------------------------
586 c------------------------------------------------
588 % deallocate( rbtab, zbtab )
589 allocate( rbtab(nbbbs), zbtab(nbbbs) )
609 c------------------------------------------------
621 c------------------------------------------------
628 c------------------------------------------------
634 psax = -(sibry-simag)
657 write(fname,
'(a,a)') path(1:kname),
'spik.wr'
658 open(1,file=fname,form=
'formatted')
661 write(1,*) iplas,nt1,nm,psim,psibon,1
664 write(1,*)(dsqrt(1.d0-psia(i)),i=1,iplas),
666 * (dfdpsi(i),i=1,iplas),
669 * (r(iplas,j),j=1,nt1),
670 * (z(iplas,j),j=1,nt1),
671 * ((ro(i,j)/ro(iplas,j),j=1,nt1),i=1,iplas),
672 * (q(i)/2.d0/pi,i=1,iplas),fvac
REAL(R8) function date(X, T)
subroutine tab_efit(tokf, psax, eqdfn, rax, zax, b0, r0)
real(r8) function dpdpsi(psi_n)
subroutine current(GEOMETRY, PROFILES, TRANSPORT, SOURCES, EVOLUTION, CONTROL, j_boun, ifail, failstring)
CURRENT TRANSPORT EQUATION.
real(r8) function p(a, x, xr, xs, yr, ys, psi, psir, F_dia)
subroutine rd_step(numwr, dt, time, istep, psex_bnd, psi0_bnd)
subroutine wrdump(numwr, time, istep, psiplb, psiexb, psimag, flu_tor)