2 * na1,yeqpf,yeqff,fp,ipl,
3 * rtor,btor,rho,roc,nstep,yreler,mu,
4 * cc,te,cubs,cd,key_ini,eqdfn,pres,cu,
14 parameter(nbtabp=1000)
15 parameter(nursp=1000,nursp4=nursp+4,nursp6=nursp4*6)
18 common /creler/ relerr
19 common /com_0st/ key_0st,key_prs
21 real*8 rout(nrp,ntp),zout(nrp,ntp)
23 real t_start, t_finish
25 real*8 rzbnd(*),yeqpf(*),yeqff(*),fp(*),ipl,ybetpl,yli3,
26 * rtor,btor,rho(*),roc,yreler,mu(*),
27 * cc(*),te(*),cubs(*),cd(*),pres(*),cu(*)
31 real(8),
allocatable :: eqpf(:), eqff(:)
33 allocate( eqpf(na1), eqff(na1) )
47 if(nbnd.gt.nbtabp)
then
48 write(*,*)
'spider:nbnd exeeds maximum value',nbtabp
49 write(*,*)
'nbnd=',nbnd
50 write(*,*)
'program is interrupted'
55 write(*,*)
'spider:na1 exeeds maximum value',nursp
57 write(*,*)
'program is interrupted'
61 if( neql.gt.nrp .or. nteta.gt.ntp)
then
62 write(*,*)
'spider: neql or nteta exeeds maximum value'
63 write(*,*)
'neql=',neql,
'nrp=',nrp
64 write(*,*)
'nteta=',nteta,
'ntp=',ntp
65 write(*,*)
'program is interrupted'
87 if(nstep.eq.0 .AnD. key_ini.eq.0)
then
88 call
tab_efit(tokf,psax,eqdfn,rax,zax,b0,r0)
118 %deallocate( pstab, pptab, fptab )
119 allocate( pstab(na1+1), pptab(na1+1), fptab(na1+1) )
124 %deallocate( rbtab, zbtab )
125 allocate( rbtab(nbtab), zbtab(nbtab) )
130 zbtab(ib)=rzbnd(ib+nbnd)
154 if(rbtab(ib).ge.rbmax) rbmax=rbtab(ib)
155 if(rbtab(ib).le.rbmin) rbmin=rbtab(ib)
156 if(zbtab(ib).ge.zbmax) zbmax=zbtab(ib)
157 if(zbtab(ib).le.zbmin) zbmin=zbtab(ib)
161 rc0=0.5d0*(rbmax+rbmin)
162 zc0=0.5d0*(zbmax+zbmin)
176 if(key_0st.eq.1)
then
191 pstab(i)=(rho(i-1)/rho(na1))**2
194 call
profro_cu(na1,neql,rtor,btor,cu,rho,roc)
198 elseif(key_0st.eq.0)
then
219 ps0=(ps1*rh2**2-ps2*rh1**2)/(rh2**2-rh1**2)
230 pstab(i)=(fp(i-1)-ps0)/(psb-ps0)
231 if(pstab(i).le.pstab(i-1))
then
232 write(*,*)
'psi is nonmonotonic!!! ', pstab(i),i
255 call
extrp2(rh0,ppx0, rh1,rh2,rh3, ppx1,ppx2,ppx3)
256 call
extrp2(rh0,ffx0, rh1,rh2,rh3, ffx1,ffx2,ffx3)
273 pptab(i)=pptab(i)/rtor
274 fptab(i)=fptab(i)*rtor
299 if(key_dmf.ne.0)
then
301 call
profro_cu(na1,neql,rtor,btor,cu,rho,roc)
303 if(key_pres.eq.0)
then
304 call
profro_p(na1,neql,rtor,eqpf,rho,roc)
309 if(key_dmf.eq.-2 .OR. key_dmf.eq.-3)
then
310 call
profro_sbc(na1,neql,rtor,btor,cc,te,cubs,cd,rho,roc)
316 call
profro(na1,neql,rtor,eqpf,eqff,rho,roc)
370 * g11,g22,g33,vr,vrs,slat,gradro,rocnew,
371 * mu,ipol,bmaxt,bmint,bdb02,b0db2,bdb0,droda,
372 * yreler,yli3,ni_p,nj_p,platok,cu,fp,pres,w_dj,
381 parameter(nbtabp=1000)
382 parameter(nursp=1000,nursp4=nursp+4,nursp6=nursp4*6)
385 common /creler/ relerr
386 integer na1,ni_p,nj_p
387 real*8 rout(ni_p,nj_p),zout(ni_p,nj_p)
390 * g11(na1),g22(na1),g33(na1),
391 * vr(na1),vrs(na1),slat(na1),gradro(na1),
392 * rocnew,ybetpl,betpol,platok,
393 * mu(na1),ipol(na1),bmaxt(na1),bmint(na1),
394 * bdb02(na1),bdb0(na1),b0db2(na1),droda(na1),
395 * rtor,btor,rho(na1),roc,cu(na1),fp(na1),pres(na1),
396 * w_dj(na1),yfofb(na1),traps(na1)
402 call
get_rz(rout,zout,ni_p,nj_p)
407 cw
write(*,*)
'after eqb'
411 call
comet(na1,platok,
412 * rtor,btor,rho,roc,nstep,
413 * g11,g22,g33,vr,vrs,slat,gradro,rocnew,
414 * mu,ipol,bmaxt,bmint,bdb02,b0db2,bdb0,droda,
415 * ybetpl,yli3,cu,fp,pres,w_dj,yfofb,traps)
428 * rtor,btor,rho,roc,nstep,
429 * g11,g22,g33,vr,vrs,slat,gradro,rocnew,
430 * mu,ipol,bmaxt,bmint,bdb02,b0db2,bdb0,droda,
431 * ybetpl,yli3,cu,fp,pres,w_dj,yfofb,traps)
435 parameter(nrpl=nrp+1)
436 parameter(nrpl4=nrpl+4,nrpl6=nrpl4*6)
438 common /combsh/ rm0,zm0,rc0,zc0,asp0,el_up,el_lw,tr_up,tr_lw,nbsh
439 common /com_jb/ bj_av(nrp),curfi_av(nrp)
440 common/com_heat_dj/ wdj(nrp)
441 common /com_trap/ trap(nrp)
443 real*8 rhos(nrp),vols(nrpl),g11s(nrpl),g22s(nrpl),g33s(nrpl)
444 real*8 gradrs(nrpl),amus(nrpl),fnors(nrpl),drodas(nrpl)
445 real*8 dvdro(nrpl),sa(nrp),rhocs(nrpl),rhocn(nrpl),rhosn(nrpl)
446 real*8 b_maxt(nrpl),b_mint(nrpl),b_db02(nrpl),b_db0(nrpl),
447 * b_0db2(nrpl),d_roda(nrpl)
451 real*8 rrk(nrpl4),cck(nrpl4),wrk(nrpl6)
454 real(8),
allocatable :: rhowr(:), rhowrh(:)
456 real*8 rtor,btor,rho(na1),roc,ybetpl,yli3,
457 * g11(na1),g22(na1),g33(na1),
458 * vr(na1),vrs(na1),slat(na1),gradro(na1),rocnew,droda(na1),
459 * mu(na1),ipol(na1),bmaxt(na1),bmint(na1),
460 * bdb02(na1),b0db2(na1),bdb0(na1),
461 * cu(na1),fp(na1),pres(na1),w_dj(na1)
466 dimension btot(nrp,ntp)
478 allocate( rhowr(na1), rhowrh(na1) )
484 rhos(i)=sqrt(flx_fi(i)/(pi*btor))
490 psi_1(i)=(psi(i,2)+psi_bn1)*2.d0*pi
495 prs_1(i)=funppp(psn)*(psim-psip)*cnor/amu0
503 rhocs(i)=0.5d0*(rhos(i-1)+rhos(i))
507 rhocs(iplas+1)=rhos(iplas)
509 c=============================andrey=02.03.2003vvvvvvvvvvvvv
514 spw1=(arc0-arc2)*(arc0-arc3)
515 & /(arc1-arc2)/(arc1-arc3)
516 spw2=(arc0-arc1)*(arc0-arc3)
517 & /(arc2-arc1)/(arc2-arc3)
518 spw3=(arc0-arc1)*(arc0-arc2)
519 & /(arc3-arc1)/(arc3-arc2)
520 q(iplas)=spw1*q(iplas-1)+spw2*q(iplas-2)+spw3*q(iplas-3)
524 c=============================andrey=02.03.2003^^^^^^^^^^^^^^
529 rhocn(i)=rhocs(i)/rhos(iplas)
534 rhosn(i)=rhos(i)/rhos(iplas)
546 rhowr(na1)=1.d0-1.d-9
550 rhowrh(i)=(rhowr(i)+rhowr(i+1))*0.5d0
552 rhowrh(na)=rhowrh(na-1)+(rhowr(2)-rhowr(1))
553 rhowrh(na1)=1.d0-1.d-9
556 cw
write(*,*) (rhocn(j),j=1,iplas)
557 cw
write(*,*) (rhosn(j),j=1,iplas)
582 r0=(r1+
r2+r3+r4)*0.25d0
591 dadr= 0.5d0*((u1+u2)*(z2-z1)+(u2+u3)*(z3-z2)+
592 * (u3+u4)*(z4-z3)+(u4+u1)*(z1-z4))/sss
594 dadz=-0.5d0*((u1+u2)*(
r2-r1)+(u2+u3)*(r3-
r2)+
595 * (u3+u4)*(r4-r3)+(u4+u1)*(r1-r4))/sss
599 av_gr1=av_gr1+vol(i,j)*sqrt(gr2)
600 av_gr2=av_gr2+vol(i,j)*gr2
601 av_grr2=av_grr2+vol(i,j)*gr2/r0**2
602 av_r2=av_r2+vol(i,j)/r0**2
607 gradrs(i+1)=av_gr1/dvoli
608 amus(i+1)=(2.d0*pi)/q(i)
609 fnors(i+1)=f(i)/(rtor*btor)
611 dvdro(i+1)=2.d0*pi*dvoli/(rhos(i+1)-rhos(i))
612 cc g11s(i+1)=av_gr2/dvoli
613 cc g22s(i+1)=av_grr2/(dvoli*4.d0*pi*pi)*rtor
614 g11s(i+1)=av_gr2*dvdro(i+1)/dvoli
615 g22s(i+1)=av_grr2*dvdro(i+1)/(dvoli*4.d0*pi*pi)*rtor/fnors(i+1)
616 g33s(i+1)=av_r2*rtor**2/dvoli
621 cw
write(*,*)
'before b'
643 r0=(r1+
r2+r3+r4)*0.25d0
645 bm_pol=psim*(psia(i+1)-psia(i))/st(i,j)
646 bp_pol=psim*(psia(i+1)-psia(i))/st(i,j+1)
649 bpol2v=bm_pol**2*( vol1(i,j)/sin1(i,j)+vol2(i,j)/sin2(i,j))+
650 + bp_pol**2*( vol3(i,j)/sin3(i,j)+vol4(i,j)/sin4(i,j))
652 bpol2v=bm_pol**2*( vol2(i,j)/sin2(i,j))+
653 + bp_pol**2*( vol3(i,j)/sin3(i,j) )
656 bpol2=bpol2v /vol(i,j)
668 bavr2=bavr2+b_tot2*vol(i,j)
669 bavr =bavr +b_tot *vol(i,j)
670 bavrd2=bavrd2+vol(i,j)/(b_tot2+1.d-8)
676 b_db02(i+1)=bavr2/(dvoli*btor**2)
677 b_0db2(i+1)=(bavrd2*btor**2)/(dvoli)
678 b_db0(i+1)=bavr/(dvoli*btor)
682 b_maxt(1)=.5d0*(b_maxt(2)+b_mint(2))
689 c yli3 =4.d0*pi*bp2av/(rtor*tokp*tokp)
690 yli3 = 4.d0*pi*
bp2/(rtor*(.4d0*pi*tokp)**2)
700 bmax=dmax1(bmax,b_ij)
708 & (b0ax/btot(i,j))**2
709 & *( 1.d0-dsqrt(1.d0-bnor)*(1.d0+.5d0*bnor) )*vol(i,j)
732 call
b_extrp(x0, x1,x2,x3, ip1,ip2,ip3,ip0,g11s,jerr)
734 call
b_extrp(x0,x1,x2,x3, ip1,ip2,ip3,ip0,g22s,jerr)
737 call
b_extrp(x0,x1,x2,x3, ip1,ip2,ip3,ip0,g33s,jerr)
740 call
b_extrp(x0,x1,x2,x3, ip1,ip2,ip3,ip0,fnors,jerr)
743 call
b_extrp(x0,x1,x2,x3, ip1,ip2,ip3,ip0,gradrs,jerr)
746 call
b_extrp(x0,x1,x2,x3, ip1,ip2,ip3,ip0,amus,jerr)
748 call
b_extrp(x0,x1,x2,x3, ip1,ip2,ip3,ip0,traps,jerr)
771 cw
write(*,*)
'passed 1'
773 call
b_extrp(x0, x1,x2,x3, ip3,ip2,ip1,ip0,gradrs,jerr)
776 call
b_extrp(x0, x1,x2,x3, ip3,ip2,ip1,ip0,amus,jerr)
780 call
b_extrp(x0, x1,x2,x3, ip3,ip2,ip1,ip0,dvdro,jerr)
784 call
b_extrp(x0, x1,x2,x3, ip3,ip2,ip1,ip0,g11s,jerr)
787 call
b_extrp(x0, x1,x2,x3, ip3,ip2,ip1,ip0,g22s,jerr)
790 call
b_extrp(x0,x1,x2,x3, ip3,ip2,ip1,ip0,g33s,jerr)
793 call
b_extrp(x0, x1,x2,x3, ip3,ip2,ip1,ip0,b_maxt,jerr)
796 call
b_extrp(x0, x1,x2,x3, ip3,ip2,ip1,ip0,b_mint,jerr)
799 call
b_extrp(x0, x1,x2,x3, ip3,ip2,ip1,ip0,b_db02,jerr)
803 call
b_extrp(x0, x1,x2,x3, ip3,ip2,ip1,ip0,b_0db2,jerr)
807 call
b_extrp(x0, x1,x2,x3, ip3,ip2,ip1,ip0,b_db0,jerr)
810 call
b_extrp(x0, x1,x2,x3, ip3,ip2,ip1,ip0,traps,jerr)
820 fnors(iplas+1)=fvac/(rtor*btor)
825 cw
write(*,*) (b_mint(i), i=1,iplas)
828 CALL
e01baf(n3spl,rhocn,b_mint,rrk,cck,
829 * n3spl+4,wrk,6*n3spl+16,ifail)
834 CALL
e02bcf(n3spl+4,rrk,cck,zspl,0,cwk,ifail)
837 bmint(na1)=b_mint(iplas)
839 cw
write(*,*)
'bmint'
843 CALL
e01baf(n3spl,rhocn,b_maxt,rrk,cck,
844 * n3spl+4,wrk,6*n3spl+16,ifail)
849 CALL
e02bcf(n3spl+4,rrk,cck,zspl,0,cwk,ifail)
852 bmaxt(na1)=b_maxt(iplas)
854 cw
write(*,*)
'bmaxt'
858 CALL
e01baf(n3spl,rhocn,b_db02,rrk,cck,
859 * n3spl+4,wrk,6*n3spl+16,ifail)
864 CALL
e02bcf(n3spl+4,rrk,cck,zspl,0,cwk,ifail)
867 bdb02(na1)=b_db02(iplas)
869 cw
write(*,*)
'bdb02'
873 CALL
e01baf(n3spl,rhocn,b_0db2,rrk,cck,
874 * n3spl+4,wrk,6*n3spl+16,ifail)
879 CALL
e02bcf(n3spl+4,rrk,cck,zspl,0,cwk,ifail)
882 b0db2(na1)=b_0db2(iplas)
884 cw
write(*,*)
'b0db2'
888 CALL
e01baf(n3spl,rhocn,b_db0,rrk,cck,
889 * n3spl+4,wrk,6*n3spl+16,ifail)
894 CALL
e02bcf(n3spl+4,rrk,cck,zspl,0,cwk,ifail)
897 bdb0(na1)=b_db0(iplas)
904 CALL
e01baf(n3spl,rhosn,bj_av,rrk,cck,
905 * n3spl+4,wrk,6*n3spl+16,ifail)
909 CALL
e02bcf(n3spl+4,rrk,cck,zspl,0,cwk,ifail)
910 cu(i)=cwk(1)/btor/amu0
912 cu(na1)=bj_av(iplas)/btor/amu0
918 CALL
e01baf(n3spl,rhosn,prs_1,rrk,cck,
919 * n3spl+4,wrk,6*n3spl+16,ifail)
923 CALL
e02bcf(n3spl+4,rrk,cck,zspl,0,cwk,ifail)
926 pres(na1)=prs_1(iplas)
932 CALL
e01baf(n3spl,rhosn,psi_1,rrk,cck,
933 * n3spl+4,wrk,6*n3spl+16,ifail)
937 CALL
e02bcf(n3spl+4,rrk,cck,zspl,0,cwk,ifail)
940 fp(na1)=-psi_1(iplas)
946 CALL
e01baf(n3spl,rhosn,wdj,rrk,cck,
947 * n3spl+4,wrk,6*n3spl+16,ifail)
951 CALL
e02bcf(n3spl+4,rrk,cck,zspl,0,cwk,ifail)
965 CALL
e01baf(n3spl,rhosn,sa,rrk,cck,
966 * n3spl+4,wrk,6*n3spl+16,ifail)
971 CALL
e02bcf(n3spl+4,rrk,cck,zspl,0,cwk,ifail)
981 CALL
e01baf(n3spl,rhocn,fnors,rrk,cck,
982 * n3spl+4,wrk,6*n3spl+16,ifail)
986 CALL
e02bcf(n3spl+4,rrk,cck,zspl,0,cwk,ifail)
989 ipol(na1)=fnors(iplas+1)
992 CALL
e01baf(n3spl,rhocn,amus,rrk,cck,
993 * n3spl+4,wrk,6*n3spl+16,ifail)
998 CALL
e02bcf(n3spl+4,rrk,cck,zspl,0,cwk,ifail)
1001 mu(na1)=amus(iplas+1)
1005 CALL
e01baf(n3spl,rhocn,traps,rrk,cck,
1006 * n3spl+4,wrk,6*n3spl+16,ifail)
1011 CALL
e02bcf(n3spl+4,rrk,cck,zspl,0,cwk,ifail)
1014 yfofb(na1)=traps(iplas+1)
1018 CALL
e01baf(n3spl,rhocn,dvdro,rrk,cck,
1019 * n3spl+4,wrk,6*n3spl+16,ifail)
1023 CALL
e02bcf(n3spl+4,rrk,cck,zspl,0,cwk,ifail)
1030 CALL
e02bcf(n3spl+4,rrk,cck,zspl,0,cwk,ifail)
1033 vrs(na1)=dvdro(iplas)
1037 cw
write(*,*)
'g11s',(g11s(j),j=1,iplas)
1039 CALL
e01baf(n3spl,rhocn,g11s,rrk,cck,
1040 * n3spl+4,wrk,6*n3spl+16,ifail)
1045 CALL
e02bcf(n3spl+4,rrk,cck,zspl,0,cwk,ifail)
1048 g11(na1)=g11s(iplas+1)
1054 CALL
e01baf(n3spl,rhocn,g22s,rrk,cck,
1055 * n3spl+4,wrk,6*n3spl+16,ifail)
1060 CALL
e02bcf(n3spl+4,rrk,cck,zspl,0,cwk,ifail)
1065 g22(na1)=g22s(iplas+1)
1069 CALL
e01baf(n3spl,rhocn,g33s,rrk,cck,
1070 * n3spl+4,wrk,6*n3spl+16,ifail)
1074 CALL
e02bcf(n3spl+4,rrk,cck,zspl,0,cwk,ifail)
1082 CALL
e01baf(n3spl,rhocn,gradrs,rrk,cck,
1083 * n3spl+4,wrk,6*n3spl+16,ifail)
1088 CALL
e02bcf(n3spl+4,rrk,cck,zspl,0,cwk,ifail)
1091 gradro(na1)=gradrs(iplas+1)
1095 CALL
e01baf(n3spl,rhocn,drodas,rrk,cck,
1096 * n3spl+4,wrk,6*n3spl+16,ifail)
1100 CALL
e02bcf(n3spl+4,rrk,cck,zspl,0,cwk,ifail)
1112 * rtor,btor,rho,roc,nstep,
1113 * g11,g22,g33,vr,vrs,slat,gradro,rocnew,
1114 * mu,ipol,bmaxt,bmint,bdb02,b0db2,bdb0,droda,
1117 include
'double.inc'
1119 parameter(nrpl=nrp+1)
1120 parameter(nrpl4=nrpl+4,nrpl6=nrpl4*6)
1121 include
'compol.inc'
1122 common /combsh/ rm0,zm0,rc0,zc0,asp0,el_up,el_lw,tr_up,tr_lw,nbsh
1123 real*8 rhos(nrp),vols(nrpl),g11s(nrpl),g22s(nrpl),g33s(nrpl)
1124 real*8 gradrs(nrpl),amus(nrpl),fnors(nrpl),drodas(nrpl)
1125 real*8 dvdro(nrpl),sa(nrp),rhocs(nrpl),rhocn(nrpl),rhosn(nrpl)
1126 real*8 b_maxt(nrpl),b_mint(nrpl),b_db02(nrpl),b_db0(nrpl),
1127 * b_0db2(nrpl),d_roda(nrpl)
1128 real*8 rrk(nrpl4),cck(nrpl4),wrk(nrpl6)
1131 real*8 rtor,btor,rho(*),roc,ybetpl,yli3,
1132 * g11(na1),g22(na1),g33(na1),
1133 * vr(na1),vrs(na1),slat(na1),gradro(na1),rocnew,droda(na1),
1134 * mu(na1),ipol(na1),bmaxt(na1),bmint(na1),
1135 * bdb02(na1),b0db2(na1),bdb0(na1)
1144 rhos(i)=sqrt(flx_fi(i)/(pi*btor))
1152 rhocs(i)=0.5d0*(rhos(i-1)+rhos(i))
1156 rhocs(iplas+1)=rhos(iplas)
1158 c=============================andrey=02.03.2003vvvvvvvvvvvvv
1163 spw1=(arc0-arc2)*(arc0-arc3)
1164 & /(arc1-arc2)/(arc1-arc3)
1165 spw2=(arc0-arc1)*(arc0-arc3)
1166 & /(arc2-arc1)/(arc2-arc3)
1167 spw3=(arc0-arc1)*(arc0-arc2)
1168 & /(arc3-arc1)/(arc3-arc2)
1169 q(iplas)=spw1*q(iplas-1)+spw2*q(iplas-2)+spw3*q(iplas-3)
1171 c=============================andrey=02.03.2003^^^^^^^^^^^^^^
1176 rhocn(i)=rhocs(i)/rhos(iplas)
1181 rhosn(i)=rhos(i)/rhos(iplas)
1193 rhowr(na1)=1.d0-1.d-9
1196 cw
write(*,*) (rhocn(j),j=1,iplas)
1197 cw
write(*,*) (rhosn(j),j=1,iplas)
1215 dvoli=dvoli+vol(i,j)
1222 r0=(r1+
r2+r3+r4)*0.25d0
1231 dadr= 0.5d0*((u1+u2)*(z2-z1)+(u2+u3)*(z3-z2)+
1232 * (u3+u4)*(z4-z3)+(u4+u1)*(z1-z4))/sss
1234 dadz=-0.5d0*((u1+u2)*(
r2-r1)+(u2+u3)*(r3-
r2)+
1235 * (u3+u4)*(r4-r3)+(u4+u1)*(r1-r4))/sss
1239 av_gr1=av_gr1+vol(i,j)*sqrt(gr2)
1240 av_gr2=av_gr2+vol(i,j)*gr2
1241 av_grr2=av_grr2+vol(i,j)*gr2/r0**2
1242 av_r2=av_r2+vol(i,j)/r0**2
1245 sa(i+1)=dsqi*2.d0*pi
1247 gradrs(i+1)=av_gr1/dvoli
1248 amus(i+1)=(2.d0*pi)/q(i)
1249 fnors(i+1)=f(i)/(rtor*btor)
1251 dvdro(i+1)=2.d0*pi*dvoli/(rhos(i+1)-rhos(i))
1252 cc g11s(i+1)=av_gr2/dvoli
1253 cc g22s(i+1)=av_grr2/(dvoli*4.d0*pi*pi)*rtor
1254 g11s(i+1)=av_gr2*dvdro(i+1)/dvoli
1255 g22s(i+1)=av_grr2*dvdro(i+1)/(dvoli*4.d0*pi*pi)*rtor/fnors(i+1)
1256 g33s(i+1)=av_r2*rtor**2/dvoli
1261 cw
write(*,*)
'before b'
1277 dvoli=dvoli+vol(i,j)
1283 r0=(r1+
r2+r3+r4)*0.25d0
1285 bm_pol=psim*(psia(i+1)-psia(i))/st(i,j)
1286 bp_pol=psim*(psia(i+1)-psia(i))/st(i,j+1)
1288 bpol2v=bm_pol**2*( vol1(i,j)/sin1(i,j)+vol2(i,j)/sin2(i,j))+
1289 + bp_pol**2*( vol3(i,j)/sin3(i,j)+vol4(i,j)/sin4(i,j))
1291 bpol2=bpol2v /vol(i,j)
1297 bmx=dmax1(b_tot,bmx)
1298 bmn=dmin1(b_tot,bmn)
1300 bavr2=bavr2+b_tot2*vol(i,j)
1301 bavr =bavr +b_tot *vol(i,j)
1302 bavrd2=bavrd2+vol(i,j)/(b_tot2+1.d-8)
1308 b_db02(i+1)=bavr2/(dvoli*btor**2)
1309 b_0db2(i+1)=(bavrd2*btor**2)/(dvoli)
1310 b_db0(i+1)=bavr/(dvoli*btor)
1314 b_maxt(1)=.5d0*(b_maxt(2)+b_mint(2))
1321 c yli3 =4.d0*pi*bp2av/(rtor*tokp*tokp)
1322 yli3 = 4.d0*pi*
bp2/(rtor*(.4d0*pi*tokp)**2)
1337 call
b_extrp(x0, x1,x2,x3, ip1,ip2,ip3,ip0,g11s,jerr)
1339 call
b_extrp(x0,x1,x2,x3, ip1,ip2,ip3,ip0,g22s,jerr)
1342 call
b_extrp(x0,x1,x2,x3, ip1,ip2,ip3,ip0,g33s,jerr)
1345 call
b_extrp(x0,x1,x2,x3, ip1,ip2,ip3,ip0,fnors,jerr)
1348 call
b_extrp(x0,x1,x2,x3, ip1,ip2,ip3,ip0,gradrs,jerr)
1351 call
b_extrp(x0,x1,x2,x3, ip1,ip2,ip3,ip0,amus,jerr)
1374 cw
write(*,*)
'passed 1'
1376 call
b_extrp(x0, x1,x2,x3, ip3,ip2,ip1,ip0,gradrs,jerr)
1379 call
b_extrp(x0, x1,x2,x3, ip3,ip2,ip1,ip0,amus,jerr)
1383 call
b_extrp(x0, x1,x2,x3, ip3,ip2,ip1,ip0,dvdro,jerr)
1387 call
b_extrp(x0, x1,x2,x3, ip3,ip2,ip1,ip0,g11s,jerr)
1390 call
b_extrp(x0, x1,x2,x3, ip3,ip2,ip1,ip0,g22s,jerr)
1393 call
b_extrp(x0,x1,x2,x3, ip3,ip2,ip1,ip0,g33s,jerr)
1396 call
b_extrp(x0, x1,x2,x3, ip3,ip2,ip1,ip0,b_maxt,jerr)
1399 call
b_extrp(x0, x1,x2,x3, ip3,ip2,ip1,ip0,b_mint,jerr)
1402 call
b_extrp(x0, x1,x2,x3, ip3,ip2,ip1,ip0,b_db02,jerr)
1406 call
b_extrp(x0, x1,x2,x3, ip3,ip2,ip1,ip0,b_0db2,jerr)
1410 call
b_extrp(x0, x1,x2,x3, ip3,ip2,ip1,ip0,b_db0,jerr)
1421 fnors(iplas+1)=fvac/(rtor*btor)
1426 cw
write(*,*) (b_mint(i), i=1,iplas)
1429 CALL
e01baf(n3spl,rhocn,b_mint,rrk,cck,
1430 * n3spl+4,wrk,6*n3spl+16,ifail)
1433 zspl=(rhowr(i)+rhowr(i+1))*0.5d0
1434 CALL
e02bcf(n3spl+4,rrk,cck,zspl,0,cwk,ifail)
1437 bmint(na1)=b_mint(iplas)
1439 cw
write(*,*)
'bmint'
1443 CALL
e01baf(n3spl,rhocn,b_maxt,rrk,cck,
1444 * n3spl+4,wrk,6*n3spl+16,ifail)
1447 zspl=(rhowr(i)+rhowr(i+1))*0.5d0
1448 CALL
e02bcf(n3spl+4,rrk,cck,zspl,0,cwk,ifail)
1451 bmaxt(na1)=b_maxt(iplas)
1453 cw
write(*,*)
'bmaxt'
1457 CALL
e01baf(n3spl,rhocn,b_db02,rrk,cck,
1458 * n3spl+4,wrk,6*n3spl+16,ifail)
1461 zspl=(rhowr(i)+rhowr(i+1))*0.5d0
1462 CALL
e02bcf(n3spl+4,rrk,cck,zspl,0,cwk,ifail)
1465 bdb02(na1)=b_db02(iplas)
1467 cw
write(*,*)
'bdb02'
1471 CALL
e01baf(n3spl,rhocn,b_0db2,rrk,cck,
1472 * n3spl+4,wrk,6*n3spl+16,ifail)
1475 zspl=(rhowr(i)+rhowr(i+1))*0.5d0
1476 CALL
e02bcf(n3spl+4,rrk,cck,zspl,0,cwk,ifail)
1479 b0db2(na1)=b_0db2(iplas)
1481 cw
write(*,*)
'b0db2'
1485 CALL
e01baf(n3spl,rhocn,b_db0,rrk,cck,
1486 * n3spl+4,wrk,6*n3spl+16,ifail)
1489 cp zspl=(rhowr(i)+rhowr(i+1))*0.5d0
1490 zspl=(rhowr(i)+rhowr(i+1))*0.5d0
1491 CALL
e02bcf(n3spl+4,rrk,cck,zspl,0,cwk,ifail)
1494 bdb0(na1)=b_db0(iplas)
1496 cw
write(*,*)
'bdb0'
1502 CALL
e01baf(n3spl,rhosn,sa,rrk,cck,
1503 * n3spl+4,wrk,6*n3spl+16,ifail)
1506 zspl=(rhowr(i)+rhowr(i+1))*0.5d0
1507 CALL
e02bcf(n3spl+4,rrk,cck,zspl,0,cwk,ifail)
1517 CALL
e01baf(n3spl,rhocn,fnors,rrk,cck,
1518 * n3spl+4,wrk,6*n3spl+16,ifail)
1522 CALL
e02bcf(n3spl+4,rrk,cck,zspl,0,cwk,ifail)
1525 ipol(na1)=fnors(iplas+1)
1528 CALL
e01baf(n3spl,rhocn,amus,rrk,cck,
1529 * n3spl+4,wrk,6*n3spl+16,ifail)
1532 zspl=(rhowr(i)+rhowr(i+1))*0.5d0
1533 CALL
e02bcf(n3spl+4,rrk,cck,zspl,0,cwk,ifail)
1536 mu(na1)=amus(iplas+1)
1541 CALL
e01baf(n3spl,rhocn,dvdro,rrk,cck,
1542 * n3spl+4,wrk,6*n3spl+16,ifail)
1546 CALL
e02bcf(n3spl+4,rrk,cck,zspl,0,cwk,ifail)
1551 zspl=(rhowr(i)+rhowr(i+1))*0.5d0
1552 CALL
e02bcf(n3spl+4,rrk,cck,zspl,0,cwk,ifail)
1555 vrs(na1)=dvdro(iplas)
1559 cw
write(*,*)
'g11s',(g11s(j),j=1,iplas)
1561 CALL
e01baf(n3spl,rhocn,g11s,rrk,cck,
1562 * n3spl+4,wrk,6*n3spl+16,ifail)
1565 zspl=(rhowr(i)+rhowr(i+1))*0.5d0
1566 CALL
e02bcf(n3spl+4,rrk,cck,zspl,0,cwk,ifail)
1569 g11(na1)=g11s(iplas+1)
1575 CALL
e01baf(n3spl,rhocn,g22s,rrk,cck,
1576 * n3spl+4,wrk,6*n3spl+16,ifail)
1579 zspl=(rhowr(i)+rhowr(i+1))*0.5d0
1580 CALL
e02bcf(n3spl+4,rrk,cck,zspl,0,cwk,ifail)
1585 g22(na1)=g22s(iplas+1)
1589 CALL
e01baf(n3spl,rhocn,g33s,rrk,cck,
1590 * n3spl+4,wrk,6*n3spl+16,ifail)
1594 CALL
e02bcf(n3spl+4,rrk,cck,zspl,0,cwk,ifail)
1602 CALL
e01baf(n3spl,rhocn,gradrs,rrk,cck,
1603 * n3spl+4,wrk,6*n3spl+16,ifail)
1606 zspl=(rhowr(i)+rhowr(i+1))*0.5d0
1607 CALL
e02bcf(n3spl+4,rrk,cck,zspl,0,cwk,ifail)
1610 gradro(na1)=gradrs(iplas+1)
1614 CALL
e01baf(n3spl,rhocn,drodas,rrk,cck,
1615 * n3spl+4,wrk,6*n3spl+16,ifail)
1619 CALL
e02bcf(n3spl+4,rrk,cck,zspl,0,cwk,ifail)
1630 subroutine profro(na1,neql,rtor,eqpf,eqff,rho,roc)
1632 include
'double.inc'
1633 parameter(nursp=1000,nursp4=nursp+4,nursp6=nursp4*6)
1635 include
'compol.inc'
1637 real*8 rosn(nrp),ppr(nursp),ffpr(nursp),rhow(nursp)
1638 real*8 rrk(nursp4),cck(nursp4),wrk(nursp6)
1641 real*8 eqpf(*),eqff(*),rho(*),rtor,roc
1648 rosn(i)=(i-1.d0)/(iplas-1.d0)
1667 call
extrp2(rh0,ppx0, rh1,rh2,rh3, ppx1,ppx2,ppx3)
1668 call
extrp2(rh0,ffx0, rh1,rh2,rh3, ffx1,ffx2,ffx3)
1677 rhow(i)=rho(i-1)/roc
1684 dfdpsi(iplas)=ffpr(na1+1)
1687 CALL
e01baf(nspl,rhow,ppr,rrk,cck,
1688 * nspl+4,wrk,6*nspl+16,ifail)
1693 CALL
e02bcf(nspl+4,rrk,cck,zrho,0,cwk,ifail)
1699 CALL
e01baf(nspl,rhow,ffpr,rrk,cck,
1700 * nspl+4,wrk,6*nspl+16,ifail)
1705 CALL
e02bcf(nspl+4,rrk,cck,zrho,0,cwk,ifail)
1712 dfdpsi(i)=dfdpsi(i)*rtor
1722 include
'double.inc'
1723 parameter(nursp=1000,nursp4=nursp+4,nursp6=nursp4*6)
1725 include
'compol.inc'
1727 real*8 rosn(nrp),rhot(nursp),ppr(nursp),ffpr(nursp),rhow(nursp)
1728 real*8 rrk(nursp4),cck(nursp4),wrk(nursp6)
1731 real*8 eqpf(*),rho(*),rtor,roc
1736 rosn(i)=(i-1.d0)/(iplas-1.d0)
1755 call
extrp2(rh0,ppx0, rh1,rh2,rh3, ppx1,ppx2,ppx3)
1765 rhow(i)=rho(i-1)/roc
1775 CALL
e01baf(nspl,rhow,ppr,rrk,cck,
1776 * nspl+4,wrk,6*nspl+16,ifail)
1781 CALL
e02bcf(nspl+4,rrk,cck,zrho,0,cwk,ifail)
1810 include
'double.inc'
1811 parameter(nursp=1000,nursp4=nursp+4,nursp6=nursp4*6)
1813 include
'compol.inc'
1815 real*8 rosn(nrp),rhot(nursp),ppr(nursp),ffpr(nursp),rhow(nursp)
1816 real*8 rrk(nursp4),cck(nursp4),wrk(nursp6)
1819 real*8 eqpf(*),rho(*),rtor,roc
1824 rosn(i)=(i-1.d0)/(iplas-1.d0)
1843 call
extrp2(rh0,ppx0, rh1,rh2,rh3, ppx1,ppx2,ppx3)
1854 rhow(i)=rho(i-1)/roc
1870 if(zrho.le.rhow(ic+1) .AnD. zrho.gt.rhow(ic))
then
1871 dpdpsi(i)=( ppr(ic)*(rhow(ic+1)-zrho)
1872 * +ppr(ic+1)*(zrho-rhow(ic)) )
1873 * /(rhow(ic+1)-rhow(ic))
1921 include
'double.inc'
1922 parameter(nursp=1000,nursp4=nursp+4,nursp6=nursp4*6)
1924 include
'compol.inc'
1925 common /com_sigcd/ c_sig(nrp),t_el(nrp),c_bts(nrp),c_driv(nrp)
1927 real*8 rosn(nrp),funw(nursp),rhow(nursp)
1928 real*8 rrk(nursp4),cck(nursp4),wrk(nursp6)
1931 real*8 rho(*),rtor,btor,roc,cc(*),te(*),cubs(*),cd(*)
1936 rosn(i)=(i-1.d0)/(iplas-1.d0)
1963 call
extrp2(rh0,ccx0, rh1,rh2,rh3, ccx1,ccx2,ccx3)
1964 call
extrp2(rh0,cdx0, rh1,rh2,rh3, cdx1,cdx2,cdx3)
1965 call
extrp2(rh0,cbx0, rh1,rh2,rh3, cbx1,cbx2,cbx3)
1966 call
extrp2(rh0,cex0, rh1,rh2,rh3, cex1,cex2,cex3)
1975 rhow(i)=rho(i-1)/roc
1979 c_sig(iplas)=funw(na1+1)
1981 CALL
e01baf(nspl,rhow,funw,rrk,cck,
1982 * nspl+4,wrk,6*nspl+16,ifail)
1987 CALL
e02bcf(nspl+4,rrk,cck,zrho,0,cwk,ifail)
2001 rhow(i)=rho(i-1)/roc
2005 c_driv(iplas)=funw(na1+1)
2007 CALL
e01baf(nspl,rhow,funw,rrk,cck,
2008 * nspl+4,wrk,6*nspl+16,ifail)
2013 CALL
e02bcf(nspl+4,rrk,cck,zrho,0,cwk,ifail)
2027 rhow(i)=rho(i-1)/roc
2031 c_bts(iplas)=funw(na1+1)
2033 CALL
e01baf(nspl,rhow,funw,rrk,cck,
2034 * nspl+4,wrk,6*nspl+16,ifail)
2039 CALL
e02bcf(nspl+4,rrk,cck,zrho,0,cwk,ifail)
2053 rhow(i)=rho(i-1)/roc
2057 t_el(iplas)=funw(na1+1)
2059 CALL
e01baf(nspl,rhow,funw,rrk,cck,
2060 * nspl+4,wrk,6*nspl+16,ifail)
2065 CALL
e02bcf(nspl+4,rrk,cck,zrho,0,cwk,ifail)
2073 c_bts(i)=c_bts(i)*btor
2074 c_driv(i)=c_driv(i)*btor
2075 t_el(i)=t_el(i)*1.d3
2084 include
'double.inc'
2085 parameter(nursp=1000,nursp4=nursp+4,nursp6=nursp4*6)
2087 include
'compol.inc'
2088 common /com_sigcd/ c_sig(nrp),t_el(nrp),c_bts(nrp),c_driv(nrp)
2090 real*8 rosn(nrp),funw(nursp),rhow(nursp)
2091 real*8 rrk(nursp4),cck(nursp4),wrk(nursp6)
2094 real*8 rho(*),rtor,btor,roc,cc(*),te(*),cubs(*),cd(*)
2099 rosn(i)=(i-1.d0)/(iplas-1.d0)
2126 call
extrp2(rh0,ccx0, rh1,rh2,rh3, ccx1,ccx2,ccx3)
2127 call
extrp2(rh0,cdx0, rh1,rh2,rh3, cdx1,cdx2,cdx3)
2128 call
extrp2(rh0,cbx0, rh1,rh2,rh3, cbx1,cbx2,cbx3)
2129 call
extrp2(rh0,cex0, rh1,rh2,rh3, cex1,cex2,cex3)
2139 rhow(i)=rho(i-1)/roc
2143 c_sig(iplas)=funw(na1+1)
2157 call
linsplin(nspl,funw,rhow, iplas,c_sig,rosn)
2169 rhow(i)=rho(i-1)/roc
2173 c_driv(iplas)=funw(na1+1)
2187 call
linsplin(nspl,funw,rhow, iplas,c_driv,rosn)
2199 rhow(i)=rho(i-1)/roc
2203 c_bts(iplas)=funw(na1+1)
2217 call
linsplin(nspl,funw,rhow, iplas,c_bts,rosn)
2229 rhow(i)=rho(i-1)/roc
2233 t_el(iplas)=funw(na1+1)
2247 call
linsplin(nspl,funw,rhow, iplas,t_el,rosn)
2252 c_bts(i)=c_bts(i)*btor
2253 c_driv(i)=c_driv(i)*btor
2254 t_el(i)=t_el(i)*1.d3
2264 include
'double.inc'
2265 parameter(nursp=1000,nursp4=nursp+4,nursp6=nursp4*6)
2267 include
'compol.inc'
2269 common /com_jb/ bj_av(nrp),curfi_av(nrp)
2270 real*8 rosn(nrp),funw(nursp),rhow(nursp)
2271 real*8 rrk(nursp4),cck(nursp4),wrk(nursp6)
2274 real*8 rho(*),rtor,btor,roc,cu(*)
2279 rosn(i)=(i-1.d0)/(iplas-1.d0)
2295 call
extrp2(rh0,cux0, rh1,rh2,rh3, cux1,cux2,cux3)
2305 rhow(i)=rho(i-1)/roc
2309 bj_av(iplas)=funw(na1+1)
2323 call
linsplin(nspl,funw,rhow, iplas,bj_av,rosn)
2329 bj_av(i)=bj_av(i)*btor*amu0
2339 include
'double.inc'
2340 parameter(nursp=1000,nursp4=nursp+4,nursp6=nursp4*6)
2342 include
'compol.inc'
2344 common /com_jb/ bj_av(nrp),curfi_av(nrp)
2345 real*8 rosn(nrp),funw(nursp),rhow(nursp)
2346 real*8 rrk(nursp4),cck(nursp4),wrk(nursp6)
2349 real*8 rho(*),rtor,btor,roc,cu(*)
2354 rosn(i)=(i-1.d0)/(iplas-1.d0)
2370 call
extrp2(rh0,cux0, rh1,rh2,rh3, cux1,cux2,cux3)
2379 rhow(i)=rho(i-1)/roc
2383 bj_av(iplas)=funw(na1+1)
2385 CALL
e01baf(nspl,rhow,funw,rrk,cck,
2386 * nspl+4,wrk,6*nspl+16,ifail)
2391 CALL
e02bcf(nspl+4,rrk,cck,zrho,0,cwk,ifail)
2399 bj_av(i)=bj_av(i)*btor*amu0
2409 include
'double.inc'
2410 parameter(nursp=1000,nursp4=nursp+4,nursp6=nursp4*6)
2412 include
'compol.inc'
2413 common /com_pres/ p_rho(0:nrp),dpdro(nrp),dpdfi(1:nrp),romin
2415 real*8 rocn(nrp),funw(nursp),rhow(nursp)
2416 real*8 rrk(nursp4),cck(nursp4),wrk(nursp6)
2419 real*8 rho(*),roc,pres(*)
2426 rocn(i)=(i-0.5d0)/(iplas-1.d0)
2432 rokn(i)=((i-1.d0)/(iplas-1.d0))
2451 call
extrp2(rh0,px0, rh1,rh2,rh3, px1,px2,px3)
2461 rhow(i)=rho(i-1)/roc
2465 p_rho(iplas)=funw(na1+1)
2467 CALL
e01baf(nspl,rhow,funw,rrk,cck,
2468 * nspl+4,wrk,6*nspl+16,ifail)
2473 CALL
e02bcf(nspl+4,rrk,cck,zrho,0,cwk,ifail)
2481 CALL
e02bcf(nspl+4,rrk,cck,zrho,0,cwk,ifail)
2482 dpdfi(i)=cwk(2)/zrho
2488 if(zrho.lt.rhow(2)) zrho=rhow(2)
2489 CALL
e02bcf(nspl+4,rrk,cck,zrho,0,cwk,ifail)
2490 dpdro(i)=0.5d0*cwk(2)/zrho
2512 include
'double.inc'
2515 include
'compol.inc'
2516 common /com_pres/ p_rho(0:nrp),dpdro(nrp),dpdfi(1:nrp),romin
2522 real*8 rho(*),roc,pres(*)
2525 real(8),
allocatable :: pxin(:), pyin(:), pxout(:), pyout(:),
2526 + pyoutp(:), pyoutpp(:), py2(:), pwork(:),
2527 + pamat(:,:), pyinnew(:)
2529 real(8),
allocatable :: p05_prim(:),rho05(:),d2pf(:)
2531 allocate(rho05(na1+1))
2532 allocate(p05_prim(na1+1))
2533 allocate(d2pf(neql))
2536 rho05(i)=0.5d0*( rho(i-1)**2+rho(i)**2 )/rho(na1)**2
2542 p05_prim(i)=( pres(i)-pres(i-1) )
2543 & /(rho(i)**2-rho(i-1)**2)*rho(na1)**2
2558 call
extrp2(rh0,px0, rh1,rh2,rh3, px1,px2,px3)
2574 call
extrp2(rh0,px0, rh1,rh2,rh3, px1,px2,px3)
2582 rocn(i)=((i-0.5d0)/(iplas-1.d0))**2
2588 rokn(i)=((i-1.d0)/(iplas-1.d0))**2
2600 allocate(pyinnew(knin))
2602 allocate(pwork(knin))
2606 allocate(pamat(mdamat,knin))
2607 CALL
intrptau(rho05,p05_prim,pyinnew,py2,knin,rokn,dpdfi,d2pf,
2608 + pyoutpp,knout,kopt,ptaus,pwork,pamat,mdamat,pbclft,pbcrgt)
2619 include
'double.inc'
2620 parameter(nursp=1000,nursp4=nursp+4,nursp6=nursp4*6)
2622 include
'compol.inc'
2623 common /com_pres/ p_rho(0:nrp),dpdro(nrp),dpdfi(1:nrp),romin
2625 real*8 rocn(nrp),funw(nursp),rhow(nursp)
2626 real*8 rrk(nursp4),cck(nursp4),wrk(nursp6)
2629 real*8 rho(*),roc,pres(*)
2636 rocn(i)=((i-0.5d0)/(iplas-1.d0))**2
2642 rokn(i)=((i-1.d0)/(iplas-1.d0))**2
2661 call
extrp2(rh0,px0, rh1,rh2,rh3, px1,px2,px3)
2670 rhow(i)=(rho(i-1)/roc)**2
2674 p_rho(iplas)=funw(na1+1)
2676 CALL
e01baf(nspl,rhow,funw,rrk,cck,
2677 * nspl+4,wrk,6*nspl+16,ifail)
2682 CALL
e02bcf(nspl+4,rrk,cck,zrho,0,cwk,ifail)
2690 CALL
e02bcf(nspl+4,rrk,cck,zrho,0,cwk,ifail)
2703 include
'double.inc'
2704 parameter(nursp=1000)
2706 include
'compol.inc'
2707 common /com_pres/ p_rho(0:nrp),dpdro(nrp),dpdfi(1:nrp),romin
2709 real*8 rocn(nrp),funw(nursp),rhow(nursp)
2710 real*8 rho(*),roc,pres(*)
2716 rocn(i)=(i-0.5d0)/(iplas-1.d0)
2734 call
extrp2(rh0,px0, rh1,rh2,rh3, px1,px2,px3)
2743 rhow(i)=rho(i-1)/roc
2747 p_rho(iplas)=funw(na1+1)
2753 if( zrho.gt.rhow(j) .AnD. zrho.le.rhow(j+1) )
then
2754 pres_rho=( funw(j)*(rhow(j+1)-zrho) +
2755 & funw(j+1)*(zrho-rhow(j)) )
2756 & /( rhow(j+1)-rhow(j) )
2761 100 p_rho(i)=pres_rho
2774 include
'double.inc'
2776 parameter(nrsp=nrp+1,nrsp4=nrsp+4,nrsp6=nrsp4*6)
2777 include
'compol.inc'
2778 common /com_pres/ p_rho(0:nrp),dpdro(nrp),dpdfi(1:nrp),romin
2780 real*8 rhocn(nrp+1),funw(nrsp),rhokn(nrp)
2781 real*8 rrk(nrsp4),cck(nrsp4),wrk(nrsp6)
2786 rhocn(i+1)=(i-0.5d0)/(iplas-1.d0)
2793 rhokn(i)=(i-1.d0)/(iplas-1.d0)
2808 call
extrp2(rh0,qx0, rh1,rh2,rh3, qx1,qx2,qx3)
2811 dpdpsi(1)=-amu0*qx0*dpdfi(1)/flucfm
2820 CALL
e01baf(n3spl,rhocn,funw,rrk,cck,
2821 * n3spl+4,wrk,6*n3spl+16,ifail)
2825 CALL
e02bcf(n3spl+4,rrk,cck,zrho,0,cwk,ifail)
2828 dpdpsi(i)=-amu0*qkn*dpdfi(i)/flucfm
2843 include
'double.inc'
2845 include
'compol.inc'
2847 real*8 rout(ni_p,nj_p),zout(ni_p,nj_p)
2861 c----------------------------------------------------------------------|
2862 c define
size of the edge cell to be: .6 <= hroa/hro < 1.8
2863 c with a hysteresis of 0.2*hro, so that
2864 c hroa<=0.6*hro jumps to hroa<=1.6*hro
2865 c hroa>=1.8*hro jumps to hroa>=0.8*hro
2866 c
write(*,*)na1,time,rho(na1),
" -> ",roc
2867 c----------------------------------------------------------------------|
2868 include
'double.inc'
2870 include
'compol.inc'
2874 roc=sqrt(flx_fi(iplas)/(pi*btor))
2876 c
write(*,*)na1,roc,hro*(na+0.1),hro*(na1+0.3),hro*(nb1-0.49)
2877 c
write(*,
'(1P,6E13.5)')(rho(j),j=na-2,na1+1)
2878 c
write(*,
'(1P,6E13.5)')(ametr(j),j=na-2,na1+1)
2879 if (roc .gt. hro*(nb1-0.49))
then
2880 c rho_edge gets
out of the
grid
2881 write(*,*)
'>>> WARNING: the allocated grid is too small'
2882 write(*,*)
'Time =',time,
' Rho_b =',roc,
2883 >
' Rho_max = ',hro*(nb1-0.5)
2884 write(*,*)
'Try to increase AWALL'
2885 write(*,*)
'If this does not help inspect equilibrium input'
2887 elseif (roc .le. hro*(na+0.1))
then
2889 c
write(*,*)
" <- ",roc,hro*na,rho(na1),hro*na1,na1
2892 c
write(*,*)j,na*hro,roc,(na+1)*hro,roc/hro-(na-0.5)
2893 if (roc .gt. hro*(j+0.1)) goto 10
2895 elseif (roc .gt. hro*(na1+0.3))
then
2897 c
write(*,*)
" -> ",roc,hro*na,rho(na1),hro*na1,na1
2900 c
write(*,*)j,na*hro,roc,(na+1)*hro
2901 if (roc .le. hro*(j+1.3)) goto 10
2906 c hro*(na+0.6) < roc <= hro*(na+1.8)
2907 c
write(*,*)ab,abc,time,tstart
2908 c
write(*,*)na+1,na+1-na1,hro*(na+0.6),roc,hro*(na+1.8)
2919 c======================================================================|
2924 include
'double.inc'
2926 include
'compol.inc'
2929 roc=sqrt(flx_fi(iplas)/(pi*btor))
2937 include
'double.inc'
2939 include
'compol.inc'
2952 include
'double.inc'
2954 include
'compol.inc'
2955 common /com_volt/ upls(nrp)
2956 common /com_psisave/ psi_0(nrp)
2962 upls(i)=(psi(i,2)+psi_bn1-psi_0(i))/dt
2971 include
'double.inc'
2973 include
'compol.inc'
2974 common /com_psisave/ psi_0(nrp)
2980 psi_0(i)=psi(i,2)+psi_bn1
2989 include
'double.inc'
2991 common/selcon/ psi_d(nrp),fi_d(nrp),f_d(nrp),ri_d(nrp),
2992 * ps_pnt(nrp),del_psb,psi_bn1
3000 include
'double.inc'
3002 include
'comblc.inc'
3011 if(ipr(i,j).eq.1)
then
3013 spsj=spsj+curf(i,j)*ue(i,j)
3025 include
'double.inc'
3026 real*8 usp(nspl),xsp(nspl)
3037 if(zx.le.xsp(ic+1) .AnD. zx.gt.xsp(ic))
then
3038 u(i)=( usp(ic)*(xsp(ic+1)-zx)
3039 * + usp(ic+1)*(zx-xsp(ic)) )
3040 * /(xsp(ic+1)-xsp(ic))
3056 include
'double.inc'
3058 include
'compol.inc'
3060 parameter(nursp=1000,nursp4=nursp+4,nursp6=nursp4*6)
3062 real*8 rosn(nrp),funw(nursp),rhow(nursp)
3063 real*8 rrk(nursp4),cck(nursp4),wrk(nursp6)
3066 real*8 rho(*),arras(*),arrsp(*),roc
3071 rosn(i)=(i-1.d0)/(iplas-1.d0)
3087 call
extrp2(rh0,cux0, rh1,rh2,rh3, cux1,cux2,cux3)
3097 rhow(i)=rho(i-1)/roc
3101 arrsp(iplas)=funw(na1+1)
3115 call
linsplin(nspl,funw,rhow, iplas,arrsp,rosn)
subroutine proffi_pres(na1, neql, pres, rho, roc)
subroutine profro_p_l(na1, neql, rtor, eqpf, rho, roc)
subroutine profro_p(na1, neql, rtor, eqpf, rho, roc)
subroutine e02bcf(NCAP7, K, C, X, LEFT, S, IFAIL)
subroutine proffi_pres_(na1, neql, pres, rho, roc)
subroutine profro(na1, neql, rtor, eqpf, eqff, rho, roc)
subroutine put_ipl(placur)
real(r8) function bp2(a, x, xr, xs, yr, ys, psi, psir, F_dia)
subroutine tab_efit(tokf, psax, eqdfn, rax, zax, b0, r0)
subroutine newgrd_ss(ROC, HRO, NB1, NA1, RHO, btor, HROA)
subroutine profro_sbc_l(na1, neql, rtor, btor, cc, Te, cubs, cd, rho, roc)
subroutine out(rbnd, zbnd, zli3, betpol, bettot, parpla)
subroutine get_roc(ROC, btor)
real(r8) function dpdpsi(psi_n)
subroutine e01baf(M, X, Y, K, C, LCK, WRK, LWRK, IFAIL)
subroutine extrp2(X, F, X1, X2, X3, F1, F2, F3)
subroutine b_extrp(x0, X1, X2, X3, j1, j2, j3, j, yarr, jerr)
subroutine flux_state(flx_st)
subroutine profro_pres_l(na1, neql, pres, rho, roc)
subroutine profro_pres(na1, neql, pres, rho, roc)
subroutine astra2spider(neql, nteta, nbnd, rzbnd, key_dmf,
subroutine profro_cu(na1, neql, rtor, btor, cu, rho, roc)
subroutine profro_sbc(na1, neql, rtor, btor, cc, Te, cubs, cd, rho, roc)
subroutine linsplin(nspl, usp, xsp, n, u, x)
subroutine comet(na1, platok,
real(r8) function r2(a, x, xr, xs, yr, ys, psi, psir, F_dia)
subroutine comet_(na1, platok,
subroutine get_rz(rout, zout, ni_p, nj_p)
subroutine get_psibon(psi_bnd)
subroutine profro_cu_l(na1, neql, rtor, btor, cu, rho, roc)
subroutine prof_ast_sp_l(na1, neql, ArrAS, ArrSP, rho, roc)
subroutine spider2astra(rout, zout, rtor, btor, rho, roc, na1,
subroutine intrptau(PXIN, PYIN, PYINNEW, PY2, KNIN, PXOUT, PYOUT, PYOUTP, PYOUTPP, KNOUT, KOPT, PTAUS, PWORK, PAMAT, MDAMAT, PBCLFT, PBCRGT)