38 if (imore.eq.2)
open (8,
file=
file8,status=
"unknown")
49 open (10,
file=file10,status=
"unknown")
62 print *,
"time-depend",ns
124 open (9,
file=
"at.job",status=
"old")
129 read (9,*) bhm,alpha,
xmd,xlinm,xlinp
131 read (9,*) mesh,rin,rin2,rout1,rout2
133 read (9,*) dt,dtmax,dtmin,nsx,lns
135 read (9,*) (iprint(i),i=1,4),ksfl,irstrt
141 read (9,903) klc,
file9,file10
150 902
format (4x,i2,7x,a6,4x,a6,4x,i2,8x,e12.5)
151 903
format (4x,i6,3x,a6,4x,a8)
155 WRITE (6,*)
'***** INPUT PARAMETERS *****', date
156 WRITE (6,100) bhm,alpha,
xmd,xlinm,xlinp
157 WRITE (6,200) mesh,rin,rout1,rout2
158 WRITE (6,300) dt,dtmax,dtmin,nsx
160 WRITE (6,400) qb,qu,
xkappa
163 100
FORMAT (/1h ,
'BHM =',1pe15.7,5x,
'ALPHA=',1pe15.7,5x,
'XMDOT=',
164 * 1pe15.7/1h ,
'XLINM=',1pe15.7,5x,
'XLINP=',1pe15.7)
165 200
FORMAT (1h ,
'MESH =',i15,5x,
'RIN ='
166 * ,1pe15.7/1h ,
'ROUT1=',1pe15.7,5x,
'ROUT2=',1pe15.7)
167 300
FORMAT (1h ,
'DT =',1pe15.7,5x,
'DTMAX=',1pe15.7,5x,
'DTMIN=',
168 * 1pe15.7/1h ,
'NSX =',i15)
170 400
FORMAT (1h ,
'QB=',1pe15.7,5x,
"QU=",1pe15.7,5x,
'XKAPPA=',
172 500
format (1h ,
"HINI=",1pe9.1,5x,
"RELERR=",1pe9.1,5x
173 & ,
"ABSERR=",1pe9.1//)
177 rg = 2.*gg*bhm*xmsun/(cc*cc)
179 xmcrit = 2.*pi*cc*rg/xkes
184 ai5 = (ain**5)/(ainp1**4)
185 ff1 = (128.*pi*pi*aa*cc/(3.*xkes*xmdot*xmdot*al7))*ai5
186 * *((cc/rmu)**4)*((cc*rg)**3)
188 b2 = (ainp1/ain)/(cc*cc)
191 b5 = 2.*xnpl1/(cc*cc)
222 xlin = 0.5*(xlinp+xlinm)
227 else if (kr .eq. 0)
then
236 if (imore.eq.2)
print *,
" IL=",il+1
238 IF (ic .EQ. 1 ) xlinm = xlin
239 IF (ic .EQ. -1) xlinp = xlin
243 if (imore.eq.2)
WRITE (6,81) il
244 if (imore.eq.2)
write (6,82)
245 if (imore.eq.2)
write (6,*)
"xlin=", xlin,
"IC=",ic
249 if (imore.eq.2)
WRITE (6,80) xlin,r,ic
250 80
FORMAT (1h ,
'LIN = ',1pe22.14,5x,
'R = ',1pe15.7,5x,
'IC = ',i5)
251 81
format (
"LOOP COUNT (INTMDL) IS OVER MAXIMUM IL=",i3)
252 82
format (
" IL IC LIN")
254 if (ic.ne.0)
goto 200
265 SUBROUTINE sadmk (R,ETA,DL)
289 ok = (r/rm1)*sqrt(.5/r3)
292 dlkdr = xlk*(1.5/r - 1./rm1)
293 dlnok = -1./rm1 - .5/r
294 ww = xmdot*(xlk-xlin)/(2.*pi*b3*r*r*alpha)
295 ff2 = (-3.*xkes1*b3*r*alpha*ww*ok*dlnok/(32.*b4*aa*cc))*ww
296 ff3 = ok*ok*ww*ww/(4.*b5)
297 ff4 = (aa/3.)*(ff2**0.9)/(sqrt(ff3)*(rmu**0.4))
301 beta = 0.5*(betan+betax)
302 fff = 1.-beta-ff4*(beta**0.4)
303 IF (fff .GT. 0.) betan=beta
304 IF (fff .LE. 0.) betax=beta
308 pr = (3./aa)*(ff3/ff2)*(1.-beta)
310 te = (de*ff2/pr)**0.25
311 hh = (sqrt(b5*pr/de))/ok
312 vr = xmdot/(4.*pi*b1*r*de*hh)
334 pr = (aa/3.)*(te**4)+rmu*de*te
339 xkff = xkkr1*demn*(temn**(-3.5))
343 hh = (sqrt(b5*pr/de))/ok
347 if (de.le.0.)
print *,
"DE1=",de
348 if (hh.le.0.)
print *,
"HH=",hh
350 fm = 2.*pi*b4*r*16.*aa*cc*(te**4)/(3.*xk*de*hh)
351 ff3 = 4.*pi*b3*r*r*alpha*pr*hh
352 ff4 = -xmdot*(xlk-xlin)*ok*dlnok
354 ph(3)= xmdot*(xlk-xlin)-ff3
366 dlnkdt = -3.5*xkxf/te
367 dlnfdd = -dlnkdd-dlnhdd-1./de
368 dlnfdt = 4./te-dlnkdt-dlnhdt
377 d3dd = -ff3*(dlnpdd+dlnhdd)
378 d3dt = -ff3*(dlnpdt+dlnhdt)
381 det = d3dd*d4dt-d3dt*d4dd
394 deld = (ph(3)*d4dt-ph(4)*d3dt)/det
395 delt = (d3dd*ph(4)-d4dd*ph(3))/det
402 40
FORMAT (1h ,i7,5x,
'DE =',1pe12.4,5x,
'TE =',1pe12.4)
408 IF (abs(deld/de) .GE. eps)
GO TO 100
409 IF (abs(delt/te) .GE. eps)
GO TO 100
416 if (imore.eq.2)
WRITE (6,210)
417 210
FORMAT (1h ,
'LOOP COUNT (SADM) IS OVER MAXIMUM !')
424 pr = (aa/3.)*(te**4)+rmu*de*te
425 hh = (sqrt(b5*pr/de))/ok
427 vr = xmdot/(4.*pi*b1*r*hh*de)
428 eta = vr*vr/(b2*pr/de)
429 ws = ((xlk-xlin)**2)*eta/(r2*alpha*alpha)
431 dlnwr = -2./r+dlkdr/(xlk-xlin)
432 dl = r3*ws*(dlnwr+dlnok)/(2.*xlk)
439 taues = xkes*de*hh*rg
440 xkff = xkkr*demn*(temn**(-3.5))
442 tauff = xkff*de*hh*rg
444 qbr = 2.0*xeff*ajn*de*de*sqrt(te)*hh*rg
445 taup = qbr/(8.*aa*cc*(te**4))
452 IF (iprint(1) .EQ. 0)
RETURN
455 if (imore.eq.2)
WRITE (6,400) de,vr,dl,te,eta
456 400
FORMAT (/1h ,
'***** STANDARD MODEL *****'//1h ,
'DE =',1pe15.7,
457 * 5x,
'VR =',1pe15.7,5x,
'DL =',1pe15.7/1h ,
'TE =',
458 * 1pe15.7,5x,
'ETA =',1pe15.7//)
459 1010
FORMAT (20(1pe12.4))
466 SUBROUTINE sadmk2 (R,ETA,DL,DE,VX,VP,TE)
482 ok = (r/rm1)*sqrt(.5/r3)
485 dlkdr = xlk*(1.5/r - 1./rm1)
486 dlnok = -1./rm1 - .5/r
487 ww = xmdot*(xlk-xlin)/(2.*pi*b3*r*r*alpha)
488 ff2 = (-3.*xkes1*b3*r*alpha*ww*ok*dlnok/(32.*b4*aa*cc))*ww
489 ff3 = ok*ok*ww*ww/(4.*b5)
490 ff4 = (aa/3.)*(ff2**0.9)/(sqrt(ff3)*(rmu**0.4))
494 beta = 0.5*(betan+betax)
495 fff = 1.-beta-ff4*(beta**0.4)
496 IF (fff .GT. 0.) betan=beta
497 IF (fff .LE. 0.) betax=beta
501 pr = (3./aa)*(ff3/ff2)*(1.-beta)
503 te = (de*ff2/pr)**0.25
504 hh = (sqrt(b5*pr/de))/ok
505 vr = xmdot/(4.*pi*b1*r*de*hh)
508 pr = (aa/3.)*(te**4)+rmu*de*te
513 xkff = xkkr1*demn*(temn**(-3.5))
517 hh = (sqrt(b5*pr/de))/ok
521 if (de.le.0.)
print *,
"DE1=",de
522 if (hh.le.0.)
print *,
"HH=",hh
524 fm = 2.*pi*b4*r*16.*aa*cc*(te**4)/(3.*xk*de*hh)
525 ff3 = 4.*pi*b3*r*r*alpha*pr*hh
526 ff4 = -xmdot*(xlk-xlin)*ok*dlnok
528 ph(3)= xmdot*(xlk-xlin)-ff3
540 dlnkdt = -3.5*xkxf/te
541 dlnfdd = -dlnkdd-dlnhdd-1./de
542 dlnfdt = 4./te-dlnkdt-dlnhdt
551 d3dd = -ff3*(dlnpdd+dlnhdd)
552 d3dt = -ff3*(dlnpdt+dlnhdt)
555 det = d3dd*d4dt-d3dt*d4dd
560 deld = (ph(3)*d4dt-ph(4)*d3dt)/det
561 delt = (d3dd*ph(4)-d4dd*ph(3))/det
568 40
FORMAT (1h ,i7,5x,
'DE =',1pe12.4,5x,
'TE =',1pe12.4)
574 IF (abs(deld/de) .GE. eps)
GO TO 100
575 IF (abs(delt/te) .GE. eps)
GO TO 100
582 if (imore.eq.2)
WRITE (6,210)
583 210
FORMAT (1h ,
'LOOP COUNT (SADM) IS OVER MAXIMUM !')
590 pr = (aa/3.)*(te**4)+rmu*de*te
591 hh = (sqrt(b5*pr/de))/ok
593 vr = xmdot/(4.*pi*b1*r*hh*de)
594 eta = vr*vr/(b2*pr/de)
595 ws = ((xlk-xlin)**2)*eta/(r2*alpha*alpha)
597 dlnwr = -2./r+dlkdr/(xlk-xlin)
598 dl = r3*ws*(dlnwr+dlnok)/(2.*xlk)
605 taues = xkes*de*hh*rg
606 xkff = xkkr*demn*(temn**(-3.5))
608 tauff = xkff*de*hh*rg
610 qbr = 2.0*xeff*ajn*de*de*sqrt(te)*hh*rg
611 taup = qbr/(8.*aa*cc*(te**4))
618 IF (iprint(1) .EQ. 0)
RETURN
625 SUBROUTINE sadmn (R,ETA,DL)
643 ok =(r/rm1)*sqrt(.5/r3)
651 ww =(xmdot*xll)/(2.*pi*r2*alpha)*cc/rg
663 hh = sqrt(2.*xnpl1*pd)/ok/cc
664 pr = ww/(2.*ainp1*hh)/rg
666 vr = xmdot/(4.*pi*r*ain*de*hh)/(cc*rg2)
669 xkff = xkkr*demn*(temn**(-3.5))
670 tauff = xkff*de*hh*rg
671 taues = xkes*de*hh*rg
673 qbr = 2.0*xeff*ajn*de*de*sqrt(te)*hh*rg
674 taup = qbr/(8.*aa*cc*(te**4))
675 wwfalse= -8.*aa*(te**4)/(1.5*tau+sqrt(3.)+1./taup)
676 * /(alpha*r*dokdr)*(rg/cc)
677 te4=-ww*(1.5*tau+sqrt(3.)+1./taup)*(alpha*r*dokdr)/(8.*aa)
682 if (wwfalse.gt.wwtrue) t1=te
683 if (wwfalse.lt.wwtrue) t2=te
684 if (abs(wwfalse-wwtrue)/wwtrue.lt.wweps)
goto 100
689 eta = ain*de*vr*vr/(ainp1*pr)*cc*cc
697 xkff = xkkr*demn*(temn**(-3.5))
698 tauff = xkff*de*hh*rg
699 taues = xkes*de*hh*rg
701 qbr = 2.0*xeff*ajn*de*de*sqrt(te)*hh*rg
702 taup = qbr/(8.*aa*cc*(te**4))
703 taueff = sqrt(taup*(tau+2./sqrt(3.)))
714 400
FORMAT (/1h ,
'***** STANDARD MODEL *****'//1h ,
'DE =',1pe15.7,
715 * 5x,
'VR =',1pe15.7,5x,
'DL =',1pe15.7/1h ,
'TE =',
716 * 1pe15.7,5x,
'SS =',1pe15.7//)
717 1000
FORMAT (20(1pe12.4))
718 1010
FORMAT (i5,20(1pe12.4))
724 SUBROUTINE sadmn2 (R,ETA,DL,DE,VX,VP,TE)
733 ok =(r/rm1)*sqrt(.5/r3)
741 ww =(xmdot*xll)/(2.*pi*r2*alpha)*cc/rg
753 hh = sqrt(2.*xnpl1*pd)/ok/cc
754 pr = ww/(2.*ainp1*hh)/rg
756 vr = xmdot/(4.*pi*r*ain*de*hh)/(cc*rg2)
759 xkff = xkkr*demn*(temn**(-3.5))
760 tauff = xkff*de*hh*rg
761 taues = xkes*de*hh*rg
763 qbr = 2.0*xeff*ajn*de*de*sqrt(te)*hh*rg
764 taup = qbr/(8.*aa*cc*(te**4))
765 wwfalse= -8.*aa*(te**4)/(1.5*tau+sqrt(3.)+1./taup)
766 * /(alpha*r*dokdr)*(rg/cc)
767 te4=-ww*(1.5*tau+sqrt(3.)+1./taup)*(alpha*r*dokdr)/(8.*aa)
772 if (wwfalse.gt.wwtrue) t1=te
773 if (wwfalse.lt.wwtrue) t2=te
774 if (abs(wwfalse-wwtrue)/wwtrue.lt.wweps)
goto 100
779 eta = ain*de*vr*vr/(ainp1*pr)*cc*cc
787 xkff = xkkr*demn*(temn**(-3.5))
788 tauff = xkff*de*hh*rg
789 taues = xkes*de*hh*rg
791 qbr = 2.0*xeff*ajn*de*de*sqrt(te)*hh*rg
792 taup = qbr/(8.*aa*cc*(te**4))
793 taueff = sqrt(taup*(tau+2./sqrt(3.)))
802 SUBROUTINE intgrt (R,ETA,DL,IC)
813 dimension f(2),xx(jmax)
819 IF ((iprint(1) .NE. 0).and.(imore.eq.2))
WRITE (6,300)
836 if (ya1.ge.eps) yscal(1)=ya1
837 if (ya1.lt.eps) yscal(1)=eps
838 if (ya2.ge.eps) yscal(2)=ya2
839 if (ya2.lt.eps) yscal(2)=eps
843 aldr = (log10(rout1)-log10(rin))/mesh
852 IF (xold.GT.1000.) xx(jj)=xold/(10.**(aldr/1.))
853 IF (xold.LE.1000.) xx(jj)=xold/(10.**aldr/1.)
855 dxx = xx(jj-1)-xx(jj)
861 IF (dxx.LE.0.3) xx(jj)=xold-0.3*dxx
865 if (xold .le. 3.0) xx(jj)=xold-0.01
874 IF (xx(jj).LT.rin)
GOTO 11
905 call stifbs (yy,f,nv,r,htry,
relerr,yscal,hdid,hnext,
fun,icon)
919 IF ((icon .EQ. 10000) .OR. (icon .EQ. 15000))
THEN
920 if (imore.eq.2)
WRITE (6,100) r,eps
921 ELSE IF (icon .EQ. 16000)
THEN
922 if (imore.eq.2)
WRITE (6,120)
925 ELSE IF (icon .EQ. 30000)
THEN
926 if (imore.eq.2)
WRITE (6,140)
929 100
FORMAT (1h ,
'TOLERANCE RESET. R = ',1pe15.7,5x,
'EPSR = ',1pe15
931 120
FORMAT (1h ,
'NO CONVERGENCE IN CORRECTOR ITERATION')
932 140
FORMAT (1h ,
'INVALID INPUT TO ODGE')
933 IF ((mod(iod,1000).EQ.0).and.(imore.eq.2))
934 &
WRITE (6,*) r,yy(1),yy(2)
942 htry = -min(abs(hnext),rstep)
945 if (ya1.ge.eps) yscal(1) = ya1
946 if (ya1.lt.eps) yscal(1) = eps
949 if (ya2.ge.eps) yscal(2) = ya2
950 if (ya2.lt.eps) yscal(2) = eps
952 if (r.gt.xend)
goto 500
959 IF (ip1 .EQ. 0)
GOTO 1000
960 IF (((mod((j+1),ip1) .EQ. 1) .OR. (ip1 .EQ. 1)).and.(imore.eq.2))
961 &
WRITE (6,220) r,yy(1),yy(2),iod
962 220
FORMAT (1h ,3(1pe15.7),i7)
968 IF (eta .GT. 1.)
THEN
977 300
format (7x,
"R",13x,
"ETA",13x,
"DL")
983 SUBROUTINE fun (XI,YI,YP)
990 dimension yi(2),yp(2)
998 IF (eta .LT. 0.)
THEN
1010 ok = (r/rm1)*sqrt(.5/r3)
1024 dlkdr = xlk*(1.5/r-1./rm1)
1032 xllk2 = 2.*dl*xlk+dl*dl
1033 ws = xll2*eta/(al2*r2)
1043 hh = sqrt(2.*xnpl1*pd)/ok
1044 pr = (xmdot*xll/(4.*pi*r2*alpha*ainp1*hh))*(cc/(rg*rg))
1057 if ((kr.eq.1).or.(r.eq.rout1))
then
1067 xkff = xkkr*demn*(temn**(-3.5))
1086 qbr = 2.0*xeff*ajn*de*de*sqrt(te)*hh*rg
1087 taup = qbr/(8.*aa*cc*(te**4))
1090 b12 = beta+12.*gm1*b10
1091 gg1 = beta+(b11*b11)*gm1/b12
1092 gg3 = 1.+(gg1-beta)/b11
1104 if ((kr.eq.1).or.(r.eq.rout1))
then
1105 qm = ff1*beta4*xll7*eta5/(xkxe*r4)
1107 ff = qbr*rg/cc/cc/cc
1108 qm = 2.*pi*r2*eta/(xmdot*ws)*ff
1110 c1ll = xllk2/(r3*ws)
1123 d22 = (a1*eta-a3*al2)/xll
1124 c1 = (eta+1.)/r+dlnrh+c1ll
1125 c2 = eta*(a1/r-a2*dlnrh)-a3*(qp-qm)/r
1134 dd = d11*d22-d12*d21
1135 xn1d = c1d*d22-c2d*d12
1136 xn2d = d11*c2d-d21*c1d
1150 subroutine jac(xi,yi,yp,dfdr,pdj)
1155 dimension yi(2),pdj(2,2),dj(2,2,3),cj(2,3),cdj(2,3),dnj(2,3),
1156 & ddj(3),dfdr(2),yp(2)
1175 ok = (r/rm1)*sqrt(.5/r3)
1185 ws = xll2*eta/(al2*r2)
1188 xllk2 = 2.*dl*xlk+dl*dl
1189 dlnok =-0.5/r-1./rm1
1191 d2lnrh=-1.5/r2-1./(rm1**2)
1192 dlkdr = xlk*(1.5/r-1./rm1)
1193 hh = sqrt(2.*xnpl1*pd)/ok
1194 pr = (xmdot*xll/(4.*pi*r2*alpha*ainp1*hh))*(cc/(rg**2))
1200 if ((kr.eq.1).or.(r.eq.rout1))
then
1209 xkff = xkkr*demn*(temn**(-3.5))
1213 qbr = 2.0*xeff*ajn*de*de*sqrt(te)*hh*rg
1214 taup = qbr/(8.*aa*cc*(te**4))
1217 b12 = beta+12.*gm1*b10
1218 gg1 = beta+(b11**2)*gm1/b12
1219 gg3 = 1.+(gg1-beta)/b11
1225 if ((kr.eq.1).or.(r.eq.rout1))
then
1226 qm = ff1*beta4*xll7*eta5/(xkxe*r4)
1228 ff = qbr*rg/cc/cc/cc
1229 qm = 2.*pi*r2*eta/(xmdot*ws)*ff
1231 c1ll = xllk2/(r3*ws)
1238 d22 = (a1*eta-a3*al2)/xll
1239 c1 = (eta+1.)/r+dlnrh+c1ll
1240 c2 = eta*(a1/r-a2*dlnrh)-a3*(qp-qm)/r
1243 dd = d11*d22-d12*d21
1244 xn1d= c1d*d22-c2d*d12
1245 xn2d= d11*c2d-d21*c1d
1251 dbde =-b13*(4.5/eta)
1253 if ((kr.eq.1).or.(r.eq.rout1))
then
1254 dg1db = 1.-b11*gm1*(3.*beta+4.+12.*gm1*(2.-3.*beta))/(b12*b12)
1255 dg3db = (dg1db-1.)/b11+3.*(gg1-beta)/(b11*b11)
1269 dtdl = (dpdl-beta*dddl)/b11
1270 dtde = (dpde-beta*ddde)/b11
1271 dtdr = (dpdr-brta*dddr)/b11
1273 dkdl = xkxf*(dddl-3.5*dtdl)
1274 dkde = xkxf*(ddde-3.5*dtde)
1275 dkdr = xkxf*(dddr-3.5*dtdr)
1276 if ((kr.eq.1).or.(r.eq.rout1))
then
1277 dqmde = qm*(4.*dbde/beta+5./eta-dkde)
1278 dqmdl = qm*(4.*dbdl/beta+7./xll-dkdl)
1279 dqmdr = qm*(4.*dbdr/beta-4./r -dkdr)
1281 dqmde = qm*(-1./eta)
1282 dqmdl = qm*(-2./xll)
1283 dqmdr = qm*(0.5*(1.-3./r)/rm1)
1285 dqpdl = qp*(1./xl-1./xll)
1288 d22db = (2.*dg1db*eta-dg3db*al2)/xll
1289 dc2db = eta*(2.*dg1db/r-dg1db*dlnrh)-dg3db*(qp-qm)/r
1298 dj(2,1,1) = d21db*dbde
1299 dj(2,1,2) = d21db*dbdl
1300 dj(2,1,3) = d21db*dbdr
1301 dj(2,2,1) = d22db*dbde+2.*gg1/xll
1302 dj(2,2,2) = d22db*dbdl-d22/xll
1303 dj(2,2,3) = d22db*dbdr
1305 cj(1,1) = 1./r-c1ll*dwsde
1306 cj(1,2) = 2.*xl/(r3*ws)-c1ll*dwsdl
1307 cj(1,3) =-(eta+2.5)/r2-(3./r)*c1ll-1./(rm1*rm1)
1308 cj(2,1) = a1/r-a2*dlnrh+a3*dqmde/r+dc2db*dbde
1309 cj(2,2) =-a3*(dqpdl-dqmdl)/r+dc2db*dbdl
1310 cj(2,3) =-eta*(a1-1.5*a2)/r2+eta*a2/sqrt(rm1)
1311 & +a3*(dqmdr*r+qp-qm)/r2+dc2db*dbdr
1313 cdj(1,1) = cj(1,1)-dj(1,2,1)*dlkdr
1314 cdj(1,2) = cj(1,2)-dj(1,2,2)*dlkdr
1315 cdj(1,3) = cj(1,3)-dj(1,2,3)*dlkdr
1316 & -d12*(dlkdr*(1.5/r-1./rm1)+xlk*(-1.5/r2+1./sqrt(rm1)))
1317 cdj(2,1) = cj(2,1)-dj(2,2,1)*dlkdr
1318 cdj(2,2) = cj(2,2)-dj(2,2,2)*dlkdr
1319 cdj(2,3) = cj(2,3)-dj(2,2,3)*dlkdr
1320 & -d22*(dlkdr*(1.5/r-1./rm1)+xlk*(-1.5/r2+1./sqrt(rm1)))
1322 dnj(1,1) = cdj(1,1)*d22+c1d*dj(2,2,1)-cdj(2,1)*d12-c2d*dj(1,2,1)
1323 dnj(1,2) = cdj(1,2)*d22+c1d*dj(2,2,2)-cdj(2,2)*d12-c2d*dj(1,2,2)
1324 dnj(1,3) = cdj(1,3)*d22+c1d*dj(2,2,3)-cdj(2,3)*d12-c2d*dj(1,2,3)
1325 dnj(2,1) = dj(1,1,1)*c2d+d11*cdj(2,1)-dj(2,1,1)*c1d-d21*cdj(1,1)
1326 dnj(2,2) = dj(1,1,2)*c2d+d11*cdj(2,2)-dj(2,1,2)*c1d-d21*cdj(1,2)
1327 dnj(2,3) = dj(1,1,3)*c2d+d11*cdj(2,3)-dj(2,1,3)*c1d-d21*cdj(1,3)
1329 ddj(1) = dj(1,1,1)*d22+d11*dj(2,2,1)-dj(1,2,1)*d21-d12*dj(2,1,1)
1330 ddj(2) = dj(1,1,2)*d22+d11*dj(2,2,2)-dj(1,2,2)*d21-d12*dj(2,1,2)
1331 ddj(3) = dj(1,1,3)*d22+d11*dj(2,2,3)-dj(1,2,3)*d21-d12*dj(2,1,3)
1333 dfdr(1) = (dnj(1,3)*dd-xn1d*ddj(3))/(dd*dd)
1334 dfdr(2) = (dnj(2,3)*dd-xn2d*ddj(3))/(dd*dd)
1335 pdj(1,1) = (dnj(1,1)*dd-xn1d*ddj(1))/(dd*dd)
1336 pdj(1,2) = (dnj(1,2)*dd-xn1d*ddj(2))/(dd*dd)
1337 pdj(2,1) = (dnj(2,1)*dd-xn2d*ddj(1))/(dd*dd)
1338 pdj(2,2) = (dnj(2,2)*dd-xn2d*ddj(2))/(dd*dd)
1346 DOUBLE PRECISION FUNCTION temp(DE,PR)
1372 fx = tmax**4+a1*tmax+a2
1373 fn = tmin**4+a1*tmin+a2
1375 th = 0.5*(tmax+tmin)
1378 IF (fh*fn .LT. 0.) tmax=th
1379 IF (fh*fn .LT. 0.) fx=fh
1381 IF (fh*fx .LT. 0.) tmin=th
1382 IF (fh*fx .LT. 0.) fn=fh
1397 xx1 = xxx-(xxx**4+a1*xxx+a2)/(4.*xxx**3+a1)
1398 IF (abs((xx1-xxx)/xx1) .LT. eps)
GO TO 120
1405 print *,de,pr,tmax,tmin,fx,fn,th,fh,xxx,xx1
1406 110
FORMAT (1h ,
'LOOP COUNT (TEMP) IS OVER MAXIMUM')
1419 DOUBLE PRECISION FUNCTION ondo(DE,PR,taup,tau)
1424 a1 = 3.*rmu*de/aa*(1.+1./taup/(1.5*tau+sqrt(3.)))
1425 a2 =-3.*pr/aa*(1.+1./taup/(1.5*tau+sqrt(3.)))
1429 fx = tmax**4+a1*tmax+a2
1430 fn = tmin**4+a1*tmin+a2
1432 th = 0.5*(tmax+tmin)
1434 IF (fh*fn .LT. 0.) tmax=th
1435 IF (fh*fn .LT. 0.) fx=fh
1436 IF (fh*fx .LT. 0.) tmin=th
1437 IF (fh*fx .LT. 0.) fn=fh
1443 xx1 = xxx-(xxx**4+a1*xxx+a2)/(4.*xxx**3+a1)
1444 IF (abs((xx1-xxx)/xx1) .LT. eps)
GO TO 120
1449 print *,de,pr,tmax,tmin,fx,fn,th,fh,xxx,xx1
1450 110
FORMAT (1h ,
'LOOP COUNT (TEMP) IS OVER MAXIMUM')
1461 DOUBLE PRECISION FUNCTION fnin(NPL)
1464 IMPLICIT REAL*8 (a-h,o-z)
1477 DOUBLE PRECISION FUNCTION fnjn(NPL)
1480 IMPLICIT REAL*8 (a-h,o-z)
1481 fnjn = 3.1415926/2.0d0
1511 if (r.le.rin2)
goto 200
1530 ok = (r/rm1)*sqrt(.5/r3)
1536 ws = xll2*eta/(al2*r2)
1538 hh = (sqrt(2.*xnpl1*pd))/ok
1539 pr = (xmdot*xll/(4.*pi*r2*alpha*ainp1*hh))*cc/(rg*rg)
1545 tauff = xkff*de*hh*rg
1546 taues = xkes*de*hh*rg
1550 qbr = 2.0*xeff*ajn*de*de*sqrt(te)*hh*rg
1551 taup = qbr/(8.*aa*cc*(te**4))
1556 if ((kr.eq.1).or.(r.eq.rout1))
then
1559 if (
kcool.eq.1) te =
ondo(de,pr,taup,tau)
1563 s0 = (4.*aa/(3.*de))*(te**3)+rmu*((1./gm1)*log(te)-log(de))
1565 a = 3*(1-beta)+beta/gm1
1567 ww = 2*ainp1*hh*pr*rg
1570 vx =-xmdot/(2.*pi*r*ss*cc*rg)
1572 ee = (a+0.5)*ws+0.5*(vx*vx+vp*vp)
1587 xkff = xkkr*demn*(temn**(-3.5))
1589 taues = xkes*de*hh*rg
1591 tauff = xkff*de*hh*rg
1593 qbr = 2.0*xeff*ajn*de*de*sqrt(te)*hh*rg
1594 taup = qbr/(8.*aa*cc*(te**4))
1598 1
format (
"w0=",4e11.3)
1599 2
format (
"x1=",f7.3,
" rs=",e11.3)
1600 3
format (
"u0=",4e11.3)
1602 if (r.lt.rout2)
goto 2000
1607 &
WRITE (6,*)
' ### MESH POINTS = ',jx,
' ###'
1624 dimension u(jmax,4),f(jmax,4),h(jmax,4),y(jmax,4),q1(jmax),
1626 dimension wk(jmax,4)
1627 dimension drp(jmax),drm(jmax),dr(jmax)
1628 dimension betaj(jmax),tej(jmax)
1629 dimension wt(jmax,4),tauabst(jmax),taut(jmax)
1631 dimension okc(jmax),hhc(jmax),prc(jmax),tec(jmax),betac(jmax),
1632 & ssc(jmax),dec(jmax),betao(jmax)
1633 dimension des(jmax),oes1(jmax),ou(jmax,4)
1641 drp(j) = x1(j+1)-x1(j)
1642 drm(j) = x1(j)-x1(j-1)
1643 dr(j) = 0.5*(drp(j)+drm(j))
1645 drp(1) = x1(2) -x1(1)
1646 drm(jx)= x1(jx)-x1(jx-1)
1667 ok = (r/rm1)*sqrt(0.5/r3)
1682 pr = (aa/3.)*(te**4)+rmu*de*te
1684 if (
kcool.eq.1) fac = 1./((1.+1./taup/(1.5*tau+sqrt(3.))))
1685 if (
kcool.eq.0) fac = 1.
1687 pr = (aa/3.)*(te**4)*fac+rmu*de*te
1691 hh = sqrt(b5*pr/de)/ok
1693 ww = 2*ainp1*pr*hh*rg
1696 a = 3*(1-beta)+beta/gm1
1697 ee = (a+0.5)*ws+0.5*(vx*vx+vp*vp)
1707 f(j,2) = rs*(vx*vx+ws)
1708 f(j,3) = rs*(vx*vp+alpha*ws)
1709 f(j,4) = rs*(vx*(ee+ws)+alpha*ws*vp)
1719 xkff = xkkr*demn*(temn**(-3.5))
1720 tauff = xkff*de*hh*rg
1721 taues = xkes*de*hh*rg
1723 qbr = 2.0*xeff*ajn*de*de*sqrt(te)*hh*rg
1724 taup = qbr/(8.*aa*cc*(te**4))
1726 if (
kcool .eq. 1)
then
1727 taueff = sqrt(taup*(tau+2./sqrt(3.)))
1728 else if (
kcool .eq. 0)
then
1729 taueff = sqrt(3*tau*tauff)
1732 if (ns.eq.lns+1)
then
1734 oes1(j)=u(j,4)/u(j,1)-((u(j,2)/u(j,1))*(u(j,2)/u(j,1))
1735 & +(u(j,3)/u(j,1))*(u(j,3)/u(j,1)))/2.
1746 fd = 16*aa*(te**4)/(3*xk*de*hh*cc2)
1747 ff = 2.0*xeff*ajn*de*de*sqrt(te)*hh*rg*rg/cc2/cc
1749 if (
kcool .eq.1)
then
1750 fm = 8.*aa*(te**4)/(1.5*tau+sqrt(3.)+1./taup)*unit
1756 h(j,2) = wc*(1-dlnor)+ss*(2*vp*vk+vp*vp)
1757 h(j,3) =-ss*(vx*vp+vx*dlkdr+alpha*ws)
1758 h(j,4) =-r*rs*(vx*vp+alpha*ws)*dokdr-r*fm
1759 IF (ns.EQ.lns+1)
THEN
1761 fftr = fm/unit/xmcrit/cc
1762 xlumi = xlumi+2.*pi*(r*rg)*(dr(j)*rg)*fftr
1763 if (j.eq.jx) xljx=2.*pi*(r*rg)*(dr(j)*rg)*fftr
1764 if (taueff.le.1.)
xltn=
xltn+2.*pi*(r*rg)*(dr(j)*rg)*fftr
1765 if (taueff.gt.1.) xltk=xltk+2.*pi*(r*rg)*(dr(j)*rg)*fftr
1782 if (ktcond.eq.1)
then
1794 xkei=alpha*ef*okc(j)*(hhc(j)**3)*prc(j)/tec(j)
1795 cn=cv*xkei*(tec(j+1)-tec(j))/drp(j)
1796 & *sqrt(2./xnpl1)*ainp1*unit
1798 f(j,4)=f(j,4)-x1(j)*cn
1806 ave1 = 0.5*(u(j+1,1)+u(j,1))
1807 ave2 = 0.5*(u(j+1,2)+u(j,2))
1808 ave3 = 0.5*(u(j+1,3)+u(j,3))
1809 ave4 = 0.5*(u(j+1,4)+u(j,4))
1810 fsa1 = f(j+1,1)-f(j,1)
1811 fsa2 = f(j+1,2)-f(j,2)
1812 fsa3 = f(j+1,3)-f(j,3)
1813 fsa4 = f(j+1,4)-f(j,4)
1814 swa1 = 0.5*(h(j+1,1)+h(j,1))
1815 swa2 = 0.5*(h(j+1,2)+h(j,2))
1816 swa3 = 0.5*(h(j+1,3)+h(j,3))
1817 swa4 = 0.5*(h(j+1,4)+h(j,4))
1819 y(j,1) = ave1-0.5*dtdx*fsa1+0.5*dt*swa1
1820 y(j,2) = ave2-0.5*dtdx*fsa2+0.5*dt*swa2
1821 y(j,3) = ave3-0.5*dtdx*fsa3+0.5*dt*swa3
1822 y(j,4) = ave4-0.5*dtdx*fsa4+0.5*dt*swa4
1823 es1(j)=y(j,4)/y(j,1)-((y(j,2)/y(j,1))*(y(j,2)/y(j,1))
1824 & +(y(j,3)/y(j,1))*(y(j,3)/y(j,1)))/2.
1827 fsa1 = f(2,1)-f(1,1)
1828 fsa2 = f(2,2)-f(1,2)
1829 fsa3 = f(2,3)-f(1,3)
1830 fsa4 = f(2,4)-f(1,4)
1831 swa1 = 0.5*(h(1,1)+h(2,1))
1832 swa2 = 0.5*(h(1,2)+h(2,2))
1833 swa3 = 0.5*(h(1,3)+h(2,3))
1834 swa4 = 0.5*(h(1,4)+h(2,4))
1835 wk(1,1) = u(1,1)-dtdx*fsa1+dt*swa1
1836 wk(1,2) = u(1,2)-dtdx*fsa2+dt*swa2
1837 wk(1,3) = u(1,3)-dtdx*fsa3+dt*swa3
1838 wk(1,4) = u(1,4)-dtdx*fsa4+dt*swa4
1845 if (kcau1+kcau2.eq.0)
then
1856 q2(j)= qu1*abs(vxp-vxm)
1861 des(j) = dtdx*(q2(j)*(es1(j+1)-es1(j))
1862 & -q2(j-1)*(es1(j)-es1(j-1)))
1865 des(1)=dtdx*q2(1)*(es1(2)-es1(1))
1868 es1(j) = es1(j)+des(j)
1876 if (
nl(j).ge.2)
then
1887 if (y(j,1).le.0.e0)
then
1890 nlmax=max(nlmax,
nl(j))
1896 if (es1(j).le.0.e0)
then
1900 nlmax=max(nlmax,
nl(j))
1904 if (kcau1.eq.1)
then
1908 if (nlmax.le.10)
then
1928 if (y(j,1).le.0.)
then
1931 if (es1(j).le.0.)
then
1941 r = 0.5*(x1(j)+x1(j+1))
1945 ok = r/rm1*sqrt(0.5/r3)
1951 es = ee-0.5*(vx*vx+vp*vp)
1953 hhs = sqrt(b5*(ain/ainp1)/ss)/ok
1963 a = 3*(1-beta)+beta/gm1
1967 de = ss/(2*ain*hh*rg)
1970 xkff = xkkr*demn*(temn**(-3.5))
1971 tauff = xkff*de*hh*rg
1974 taues = xkes*de*hh*rg
1976 qbr = 2.0*xeff*ajn*de*de*sqrt(te)*hh*rg
1977 taup = qbr/(8.*aa*cc*(te**4))
1978 pr = ww/(2*ainp1*hh*rg)
1979 if (
kcool.eq.1)
then
1980 te =
ondo(de,pr,taup,tau)
1981 else if (
kcool.eq.0)
then
1987 if (abs((beta-obeta)/beta) .lt. 1.e-6)
go to 730
1994 if (
kcool .eq. 1)
then
1995 taueff = sqrt(taup*(tau+2./sqrt(3.)))
1997 taueff = sqrt(3*tau*tauff)
2000 if (taueff.gt.1.4618e30)
then
2011 hhs = sqrt(b5*(ain/ainp1)/ss)/ok
2012 a = 3*(1-beta)+beta/gm1
2016 de = ss/(2*ain*hh*rg)
2019 xkff = xkkr*demn*(temn**(-3.5))
2020 tauff = xkff*de*hh*rg
2021 taues = xkes*de*hh*rg
2023 qbr = 2.0*xeff*ajn*de*de*sqrt(te)*hh*rg
2024 taup = qbr/(8.*aa*cc*(te**4))
2025 pr = ww/(2*ainp1*hh*rg)
2026 te =
ondo(de,pr,taup,tau)
2031 f(j,2) = rs*(vx*vx+ws)
2032 f(j,3) = rs*(vx*vp+alpha*ws)
2033 f(j,4) = rs*(vx*(ee+ws)+alpha*ws*vp)
2036 dlnor = -(0.5+r/rm1)
2042 fd = 16*aa*(te**4)/(3*xk*de*hh*cc2)
2044 if (
kcool .eq.1)
then
2045 fm = 8.*aa*(te**4)/(1.5*tau+sqrt(3.)+1./taup)*unit
2051 h(j,2) = wc*(1-dlnor)+ss*(2*vp*vk+vp*vp)
2052 h(j,3) = -ss*(vx*vp+vx*dlkdr+alpha*ws)
2053 h(j,4) = -r*rs*(vx*vp+alpha*ws)*dokdr-r*fm
2067 if (ktcond.eq.1)
then
2079 xkei = alpha*ef*okc(j)*(hhc(j)**3)*prc(j)/tec(j)
2080 cn = cv*xkei*(tec(j+1)-tec(j))/drp(j)
2081 & *sqrt(2./xnpl1)*ainp1*unit
2083 f(j,4)=f(j,4)-x1(j)*cn
2094 fsa1 = f(j,1)-f(j-1,1)
2095 fsa2 = f(j,2)-f(j-1,2)
2096 fsa3 = f(j,3)-f(j-1,3)
2097 fsa4 = f(j,4)-f(j-1,4)
2098 swa1 = 0.5*(h(j,1)+h(j-1,1))
2099 swa2 = 0.5*(h(j,2)+h(j-1,2))
2100 swa3 = 0.5*(h(j,3)+h(j-1,3))
2101 swa4 = 0.5*(h(j,4)+h(j-1,4))
2102 wk(j,1) = u(j,1)-dtdx*fsa1+dt*swa1
2103 wk(j,2) = u(j,2)-dtdx*fsa2+dt*swa2
2104 wk(j,3) = u(j,3)-dtdx*fsa3+dt*swa3
2105 wk(j,4) = u(j,4)-dtdx*fsa4+dt*swa4
2113 if (kcau1+kcau2.eq.0)
then
2122 q1(j)= qb1*abs(vxp-vxm)
2127 d(j,1) = dtdx*(q1(j)*(u(j+1,1)-u(j,1))-q1(j-1)*(u(j,1)-u(j-1,1)))
2128 d(j,2) = dtdx*(q1(j)*(u(j+1,2)-u(j,2))-q1(j-1)*(u(j,2)-u(j-1,2)))
2129 d(j,3) = dtdx*(q1(j)*(u(j+1,3)-u(j,3))-q1(j-1)*(u(j,3)-u(j-1,3)))
2130 d(j,4) = dtdx*(q1(j)*(u(j+1,4)-u(j,4))-q1(j-1)*(u(j,4)-u(j-1,4)))
2134 d(1,1) = dtdx*q1(1)*(u(2,1)-u(1,1))
2135 d(1,2) = dtdx*q1(1)*(u(2,2)-u(1,2))
2136 d(1,3) = dtdx*q1(1)*(u(2,3)-u(1,3))
2137 d(1,4) = dtdx*q1(1)*(u(2,4)-u(1,4))
2140 u(j,1) = wk(j,1)+d(j,1)
2141 u(j,2) = wk(j,2)+d(j,2)
2142 u(j,3) = wk(j,3)+d(j,3)
2143 u(j,4) = wk(j,4)+d(j,4)
2144 es1(j) = u(j,4)/u(j,1)-((u(j,2)/u(j,1))*(u(j,2)/u(j,1))
2145 & +(u(j,3)/u(j,1))*(u(j,3)/u(j,1)))/2.
2150 des(j) = dtdx*(q2(j)*(es1(j+1)-es1(j))
2151 & -q2(j-1)*(es1(j)-es1(j-1)))
2154 des(1)= dtdx*q2(1)*(es1(2)-es1(1))
2157 es1(j) = es1(j)+des(j)
2161 if (
nl(j).ge.2)
then
2173 if (u(j,1).le.0.e14)
then
2176 nlmax=max(nlmax,
nl(j))
2182 if (es1(j).le.0.e14)
then
2186 nlmax=max(nlmax,
nl(j))
2190 if (kcau2.eq.1)
then
2194 if (nlmax.le.10)
then
2214 if (u(j,1).le.0.)
then
2217 if (es1(j).le.0.)
then
2233 ok = r/rm1*sqrt(0.5/r3)
2239 es = ee-0.5*(vx*vx+vp*vp)
2241 hhs = sqrt(b5*(ain/ainp1)/ss)/ok
2251 a = 3*(1-beta)+beta/gm1
2255 de = ss/(2*ain*hh*rg)
2258 xkff = xkkr*demn*(temn**(-3.5))
2260 tauff = xkff*de*hh*rg
2262 if (tauff.le.0.)
print *,
"TAUABS=",tauff,
"LW1D2"
2264 taues = xkes*de*hh*rg
2266 qbr = 2.0*xeff*ajn*de*de*sqrt(te)*hh*rg
2267 taup = qbr/(8.*aa*cc*(te**4))
2268 pr = ww/(2*ainp1*hh*rg)
2269 if (
kcool.eq.1)
then
2270 te=
ondo(de,pr,taup,tau)
2271 else if (
kcool.eq.0)
then
2277 if (abs((beta-obeta)/beta) .lt. 1.e-6)
go to 731
2284 if (
kcool .eq. 1)
then
2285 taueff = sqrt(taup*(tau+2./sqrt(3.)))
2287 taueff = sqrt(3*tau*tauff)
2290 if (taueff.gt.1.4618e30)
then
2301 a = 3*(1-beta)+beta/gm1
2305 de = ss/(2*ain*hh*rg)
2308 xkff = xkkr*demn*(temn**(-3.5))
2309 tauff = xkff*de*hh*rg
2310 taues = xkes*de*hh*rg
2312 qbr = 2.0*xeff*ajn*de*de*sqrt(te)*hh*rg
2313 taup = qbr/(8.*aa*cc*(te**4))
2314 pr = ww/(2*ainp1*hh*rg)
2315 te =
ondo(de,pr,taup,tau)
2320 fd = 16*aa*(te**4)/(3.*xk*de*hh*cc2)
2323 if (
kcool .eq.1)
then
2324 fm = 8.*aa*(te**4)/(1.5*tau+sqrt(3.)+1./taup)*unit
2338 if (
kcool .eq. 1)
then
2339 taueff = sqrt(taup*(tau+2./sqrt(3.)))
2341 taueff = sqrt(3*tau*tauff)
2350 fftr = fm/unit/xmcrit/cc
2351 xlumi = xlumi+2.*pi*(r*rg)*(dr(j)*rg)*fftr
2352 if (taueff.le.1.)
xltn=
xltn+2.*pi*(r*rg)*(dr(j)*rg)*fftr
2353 if (taueff.gt.1.) xltk=xltk+2.*pi*(r*rg)*(dr(j)*rg)*fftr
2356 xmdeff = -2.*pi*r*rg*vx*cc*ss/xmcrit
2359 IF (mod(ns,klc).EQ.0)
then
2361 else if (frag1 .eq. 1)
then
2363 else if (r .ge. 5.)
then
2367 901
WRITE (10,910) time,r,ss,te,xmdeff
2368 910
FORMAT (1pe10.3,1x,1pe10.3,1x,1pe10.3,1x,1pe10.3,1x,1pe10.3,
2387 if (imore .eq. 2)
then
2388 if (mod(ns,200) .eq. 0)
then
2389 write(6,88)
"ns=",ns,
" t=",time,
" dt=",dt,
" L=",xlumi
2390 88
format (a3,i12,2x,a3,1pe9.3,2x,a3,1pe9.3,2x,a3,1pe9.3)
2394 IF (mod(ns,klc).EQ.0)
WRITE (9,900) time,xlumi,
xltn,xltk,dt,ns
2400 900
FORMAT (1pe10.4,2x,1pe10.4,2x,1pe10.4,2x,1pe10.4,2x,1pe10.4,2x,i9)
2410 dimension drp(jmax),drm(jmax),dr(jmax)
2412 dimension u(jmax,4),f(jmax,4),h(jmax,4),y(jmax,4)
2420 drp(j) = x1(j+1)-x1(j)
2421 drm(j) = x1(j)-x1(j-1)
2422 dr(j) = 0.5*(drp(j)+drm(j))
2424 drp(1) = x1(2) -x1(1)
2425 drm(jx)= x1(jx)-x1(jx-1)
2436 ok = (r/rm1)*sqrt(0.5/r3)
2442 pr = (aa/3.)*(te**4)+rmu*de*te
2444 if (
kcool.eq.1)
then
2445 fac = 1./((1.+1./
tauabso(j)/(1.5*
tauo(j)+sqrt(3.))))
2449 pr = (aa/3.)*(te**4)*fac+rmu*de*te
2452 hh = sqrt(b5*pr/de)/ok
2454 ww = 2*ainp1*pr*hh*rg
2458 a2 = beta+12.*gm1*(1.-beta)
2459 gg1 = beta+(a1*a1*gm1)/a2
2460 gg3 = 1.+(gg1-beta)/a1
2461 cs2 = ((3.*gg1-1.)+2.*(gg3-1.)*alpha*alpha)*ws/(gg1+1.)
2463 dtj(j) = dr(j)/(cs+abs(vx))
2464 if (
nl(j).ge.2) dtj(j)=dtmax
2468 xkff = xkkr*demn*(temn**(-3.5))
2469 tauff = xkff*de*hh*rg
2470 taues = xkes*de*hh*rg
2473 if (
kcool .eq. 1)
then
2476 taueff = sqrt(3*tau*
tauabso(j))
2479 if (taueff.gt.taueffjx) dtj(j)=dtmax
2485 dt = min(dt,cfc*dtj(j))
2509 ok = (r/rm1)*sqrt(0.5/r3)
2510 pr = (aa/3.)*(te**4)+rmu*de*te
2511 hh = sqrt(b5*pr/de)/ok
2513 vx = -xmdot/(2.*pi*r*ss)/cc
2531 CALL sadmn2(x1(j),eta,dl,w0(j,1),w0(j,2),w0(j,3),w0(j,4))
2562 & +rp*w0(j,k)*exp(-(x1(j)-rc)*(x1(j)-rc)/xlamda/xlamda)
2595 ok = (r/rm1)*sqrt(0.5/r3)
2596 pr = (aa/3.)*(te**4)+rmu*de*te
2597 hh = sqrt(b5*pr/de)/ok
2599 vx = -xmdot/(2.*pi*r*ss)/cc
2606 dww = dss/xkk/x1(j)*w0(j,1)
2607 dvr = dss/sqrt(xkk*x1(j))*w0(j,2)
2608 dvp = dss/sqrt(xkk*x1(j))*w0(j,3)
2610 write(6,*)
"PERTRB 4"
2619 dimension drp(jmax),drm(jmax),dr(jmax)
2621 if ((krs(j).eq.1).or.(
kes(j).eq.1))
goto 100
2622 IF (mod(ns,iprint(4)).NE.0)
RETURN
2624 IF (iprint(3).NE.0)
THEN
2625 IF (mod(ns,iprint(3)).EQ.0) js = 1
2634 drp(j) = x1(j+1)-x1(j)
2635 drm(j) = x1(j)-x1(j-1)
2636 dr(j) = 0.5*(drp(j)+drm(j))
2638 drp(1) = x1(2) -x1(1)
2639 drm(jx)= x1(jx)-x1(jx-1)
2644 WRITE (6,1000) ns,time,dt,nlmax
2646 IF (imore.EQ.1)
THEN
2648 ELSE IF (imore.EQ.2)
THEN
2659 ok = (r/rm1)*sqrt(0.5/r3)
2666 pr = (aa/3.)*(te**4)+rmu*de*te
2668 if (
kcool .eq.1)
then
2669 fac = 1./((1.+1./
tauabso(j)/(1.5*
tauo(j)+sqrt(3.))))
2673 pr = (aa/3.)*(te**4)*fac+rmu*de*te
2675 else if (kr.eq.1)
then
2676 pr = (aa/3.)*(te**4)+rmu*de*te
2679 pr = (aa/3.)*(te**4)+rmu*de*te
2693 hh = sqrt(b5*pr/de)/ok
2695 ww = 2*ainp1*pr*hh*rg
2700 a2 = beta+12.*gm1*(1.-beta)
2701 gg1 = beta+(a1*a1*gm1)/a2
2702 gg3 = 1.+(gg1-beta)/a1
2704 cs2 = ((3.*gg1-1.)+2.*(gg3-1.)*alpha*alpha)*ws/(gg1+1.)
2706 cfln = dt/dr(j)*(cs+abs(vx))
2712 xmdeff = -2.*pi*r*rg*vx*cc*ss/xmcrit
2713 xmd = -2.*pi*r*ss*vx*rg*cc/xmcrit
2717 xkff = xkkr*demn*(temn**(-3.5))
2718 tauff = xkff*de*hh*rg
2719 taues = xkes*de*hh*rg
2722 qbr = 2.0*xeff*ajn*de*de*sqrt(te)*hh*rg
2723 taup = qbr/(8.*aa*cc*(te**4))
2727 if (
kcool .eq. 1)
then
2730 taueff = sqrt(3*tau*tauff)
2733 t1 =
tauo(j)+2./sqrt(3.)
2740 a = 3*(1-beta)+beta/gm1
2741 ee = (a+0.5)*ws+0.5*(vx*vx+vp*vp)
2743 fmc = 8.*aa*cc*(te**4)/(1.5*
tauo(j)+sqrt(3.)+1./taup)
2745 teff = (4.*fmc/aa/cc)**0.25
2749 qp = 2.*alpha*alpha*xl/xll
2753 eta = vx*vx/(b2*pr/de)
2754 ff = qbr*rg/cc/cc/cc
2755 qm = 2.*pi*r*r*eta/(xmdot*ws)*ff
2763 IF (imore.EQ.1)
THEN
2764 WRITE(6,1010) j,r,dr(j),de,vx,vp,te,cs,cfln,ww,ss,
xmd,hh,es1(j)
2766 ELSE IF (imore.EQ.2)
THEN
2768 WRITE(6,1010) j,r,beta,taueff,te,ss,xmdeff,
xmd,t1,1/t2
2770 WRITE(6,1010) j,r,beta,taueff,te,ss,xmdeff,
xmd,t1,1/t2
2772 else if (imore .eq. 3)
then
2773 write(6,1010) j,r,dr(j),de,te,teff,ss,vx,vp,cs,hh,
tauo(j)
2775 ELSE if (imore .eq. 0)
then
2777 WRITE(6,1010) j,r,beta,teff,te,ss,-vx,vphi,cs,hh,
tauo(j)
2778 * ,taueff,ww,fene,
xmd
2780 WRITE(6,1010) j,r,beta,teff,te,ss,-vx,vphi,cs,hh,
tauo(j)
2781 * ,taueff,ww,fene,
xmd
2787 if (krs(j).ne.0)
then
2788 write (6,1030) j,ns+1,time
2793 if (
kes(j).ne.0)
then
2794 write (6,1031) j,ns+1,time
2803 1000
FORMAT (
'NS=',i12,4x,
'TIME=',f12.3,4x,
'DT=',e10.3,4x,
2805 1002
format (4x,
"J",5x,
"R",11x,
"DR",10x,
"DE",10x,
"VX",
2806 & 10x,
"VP",10x,
"TE",10x,
"CS",9x,
"CFLN",9x,
"WW",10x,
"SS",
2807 & 9x,
"MDOT",9x,
"HH",10x,
"ES1",9x,
"WS",9x,
"BETA",9x,
"TAU")
2811 1004
format (4x,
"J",5x,
"R",10x,
"BETA",8x,
"TAUEFF",7x,
"TE",
2812 & 10x,
"SS",8x,
"MDOTEFF",7x,
"MDOT")
2816 1005
format (4x,
"J",5x,
"R",10x,
"BETA",8x,
"TEFF",8x,
"TE",
2817 & 10x,
"SS",10x,
"VX",10x,
"VP",10x,
"CS",10x,
"HH",
2818 & 10x,
"tauo",8x,
"taueff",6x,
"WW",10x,
"WS",10x,
"MDOT")
2821 1010
FORMAT (i5,20(1pe12.4))
2822 1020
FORMAT (i5,5(1pe12.4),i8)
2823 1030
format (
"CAUTION RS < 0 AT J =",i3,
" NS =",i8,
2825 1031
format (
"CAUTION ES < 0 AT J =",i3,
" NS =",i8,
2841 write (8,904) j,x1(j)
2846 IF ((mod(ns,ksfl).NE.0).AND.(ns.NE.nsx))
RETURN
2851 write (8,905) ns,time
2854 write (8,907) j,(w0(j,k),k=1,4),
tauabso(j),
tauo(j),x1(j)
2863 901
format (
" XLIN=",f18.14)
2864 902
format (
" JX=",i4)
2865 903
format (2x,
"J",10x,
"R")
2866 904
format (i4,1pe15.7)
2867 905
format (
" NS=",i12,
" TIME=",f12.3)
2868 906
format (5x,
"J",11x,
"W0(J,1)",15x,
"W0(J,2)",15x,
"W0(J,3)",15x,
2869 &
"W0(J,4)",13x,
"TAUABSO",15x,
"tau",15x,
"R")
2871 907
format (i7,6(1pe22.14),(1pe15.7))
2872 908
format (
" THE NEXT DT=",e11.3)
2873 909
format (
" XMDOT=",e11.3)
2888 read (7,804) ns,time
2902 if (ns.eq.0) xmdi=
xmd
2906 if (ns.ne.lns)
goto 100
2909 801
format (13x,f18.14)
2911 803
format (4x,1pe15.7)
2912 804
format (4x,i12,8x,f12.3)
2913 805
format (7x,6(1pe22.14),i3)
2914 806
format (13x,e11.3)
2920 subroutine stifbs (y,dydx,nv,x,htry,eps,yscal,hdid,hnext,
2922 implicit real*8 (a-h,o-z)
2924 integer nv,nmax,kmaxx,imax,kpr
2927 dimension dydx(nv),y(nv),yscal(nv)
2929 parameter(nmax=50,kmaxx=7,imax=kmaxx+1,safe1=.25,safe2=.7,
2930 & redmax=1.e-5,redmin=.7,tiny=1.e-30,scalmx=.1)
2931 integer i,iq,k,kk,km,kmax,kopt,nvold,nseq(imax)
2935 dimension a(imax),alf(kmaxx,kmaxx),dfdx(nmax),dfdy(nmax,nmax),
2936 & err(kmaxx),yerr(nmax),ysav(nmax),yseq(nmax)
2937 logical first,reduct
2938 save a,alf,epsold,first,kmax,kopt,nseq,nvold,xnew
2939 data first/.true./,epsold/-1./,nvold/-1/
2941 data nseq /2,6,10,14,22,34,50,70/
2943 if (eps.ne.epsold.or.nv.ne.nvold)
then
2950 a(k+1)=a(k)+nseq(k+1)
2955 alf(k,iq)=eps1**((a(k+1)-a(iq+1))/
2956 & ((a(iq+1)-a(1)+1.)*(2*k+1)))
2964 a(k+1)=a(k)+nseq(k+1)
2967 do 15 kopt=2,kmaxx-1
2968 if (a(kopt+1).gt.a(kopt)*alf(kopt-1,kopt))
goto 1
2978 call jac(x,y,dydx,dfdx,dfdy)
2979 if (kpr.eq.1)
return
2980 if (h.ne.hnext.or.x.ne.xnew)
then
2991 call simpr (ysav,dydx,dfdx,dfdy,nmax,nv,x,h,nseq(k),yseq,
2994 call pzextr (k,xest,yseq,y,yerr,nv)
2998 errmax=max(errmax,abs(yerr(i)/yscal(i)))
3002 err(km)=(errmax/safe1)**(1./(2*km+1))
3004 if (k.ne.1.and.(k.ge.kopt-1.or.first))
then
3005 if (errmax.lt.1.)
goto 4
3006 if (k.eq.kmax.or.k.eq.kopt+1)
then
3009 else if (k.eq.kopt)
then
3010 if (alf(kopt-1,kopt).lt.err(km))
then
3014 else if (kopt.eq.kmax)
then
3015 if (alf(km,kmax-1).lt.err(km))
then
3016 red=alf(km,kmax-1)*safe2/err(km)
3019 else if (alf(km,kopt).lt.err(km))
then
3020 red=alf(km,kopt-1)/err(km)
3026 3 red=min(red,redmin)
3039 fact=max(err(kk),scalmx)
3041 if (work.lt.wrkmin)
then
3049 if (kopt.ge.k.and.kopt.ne.kmax.and..not.reduct)
then
3050 fact=max(scale/alf(kopt-1,kopt),scalmx)
3051 if (a(kopt+1)*fact.le.wrkmin)
then
3062 subroutine simpr (y,dydx,dfdx,dfdy,nmax,n,xs,htot,nstep,yout,
3064 implicit real*8 (a-h,o-z)
3066 integer n,nmax,nstep,nmaxx,kpr
3068 dimension dfdx(n),dfdy(nmax,nmax),dydx(n),y(n),yout(n)
3072 integer i,j,nn,indx(nmaxx)
3074 dimension a(nmaxx,nmaxx),del(nmaxx),ytemp(nmaxx)
3085 call ludcmp (a,n,nmaxx,indx,d)
3089 yout(i)=h*(dydx(i)+h*dfdx(i))
3091 call lubksb (a,n,nmaxx,indx,yout)
3095 ytemp(i)=y(i)+del(i)
3099 call derivs(x,ytemp,yout)
3100 if (kpr.eq.1)
return
3105 yout(i)=h*yout(i)-del(i)
3107 call lubksb (a,n,nmaxx,indx,yout)
3109 del(i)=del(i)+2.*yout(i)
3110 ytemp(i)=ytemp(i)+del(i)
3113 call derivs (x,ytemp,yout)
3114 if (kpr.eq.1)
return
3118 yout(i)=h*yout(i)-del(i)
3120 call lubksb(a,n,nmaxx,indx,yout)
3123 yout(i)=ytemp(i)+yout(i)
3131 subroutine pzextr (iest,xest,yest,yz,dy,nv)
3132 implicit real*8 (a-h,o-z)
3134 integer iest,nv,imax,nmax,kpr
3136 dimension dy(nv),yest(nv),yz(nv)
3140 dimension d(nmax),qcol(nmax,imax),x(imax)
3158 delta=1./(x(iest-k1)-xest)
3180 subroutine ludcmp (a,n,np,indx,d)
3181 implicit real*8 (a-h,o-z)
3183 integer n,np,indx(n),nmax,kpr
3194 if (abs(a(i,j)).gt.aamax) aamax=abs(a(i,j))
3197 if (aamax.eq.0.) stop
"singular matrix in ludcmp"
3204 sum=sum-a(i,k)*a(k,j)
3212 sum=sum-a(i,k)*a(k,j)
3216 if (dum.ge.aamax)
then
3231 if (a(j,j).eq.0.) a(j,j)=tiny
3244 subroutine lubksb (a,n,np,indx,b)
3245 implicit real*8 (a-h,o-z)
3247 integer n,np,indx(n),kpr
3249 dimension a(np,np),b(n)
3260 else if (sum.ne.0.)
then
IMPLICIT REAL *A O Z RG B5 common BPARM XNPL1 common BMESH JX common BSTEP lns common BWRT1 IRSTRT common BPHY0 kf common licur file10 common curve IMORE common swich ktcond c common error abserr common bradi mesh common artvp QU common radia kr common prtrb xmdi common optic xltk common lscal kpr common shoki kes(jmax) common/coula/nlmax
IMPLICIT REAL *A O Z RG B5 common BPARM XNPL1 common BMESH JX common BSTEP lns common BWRT1 IRSTRT common BPHY0 ki
IMPLICIT REAL *A O Z RG B5 common BPARM XNPL1 common BMESH JX common BSTEP lns common BWRT1 IRSTRT common BPHY0 kf common licur file10 common curve IMORE common swich ktcond c common error abserr common bradi mesh common artvp xkappa
IMPLICIT REAL *A O Z RG B5 common BPARM XNPL1 common BMESH JX common BSTEP lns common BWRT1 IRSTRT common BPHY0 kf common licur file10 common curve IMORE common swich ktcond c common error abserr common bradi mesh common artvp QU common radia kr common prtrb pxmdot
IMPLICIT REAL *A O Z RG B5 common BPARM XNPL1 common BMESH JX common BSTEP lns common BWRT1 IRSTRT common BPHY0 kf common licur file10 common curve IMORE common swich ktcond c common error abserr common bradi mesh common artvp QU common radia kr common prtrb pxlin
subroutine intgrt(R, ETA, DL, IC)
IMPLICIT REAL *A O Z RG B5 common BPARM XNPL1 common BMESH JX common BSTEP lns common BWRT1 IRSTRT common BPHY0 kf common licur file10 common curve IMORE common swich ktcond c common error abserr common bradi mesh common artvp QU common radia kr common prtrb pxmd
IMPLICIT REAL *A O Z RG B5 common BPARM XNPL1 common BMESH JX common BSTEP lns common BWRT1 IRSTRT common BPHY0 file8
IMPLICIT REAL *A O Z RG B5 common BPARM XNPL1 common BMESH JX common BSTEP lns common BWRT1 IRSTRT common BPHY0 kf common licur file10 common curve IMORE common swich ktcond c common error abserr common bradi mesh common artvp QU common radia kr common prtrb xmdi common optic xltk common lscal kpr common shoki file9
double precision function temp(DE, PR)
IMPLICIT REAL *A O Z parameter(jmax=500) common/BCLCK/ITIME common/BCNST/PI
IMPLICIT REAL *A O Z RG B5 common BPARM XNPL1 common BMESH JX common BSTEP lns common BWRT1 IRSTRT common BPHY0 kf common licur file10 common curve IMORE common swich ktcond c common error hini
IMPLICIT REAL *A O Z RG B5 common BPARM XNPL1 common BMESH JX common BSTEP lns common BWRT1 IRSTRT common BPHY0 kf common licur file10 common curve IMORE common swich ktcond c common error abserr common bradi mesh common artvp QU common radia kr common prtrb xmdi common optic tauo(jmax) common/lumi/xlumi
IMPLICIT REAL *A O Z RG B5 common BPARM XNPL1 common BMESH JX common BSTEP lns common BWRT1 IRSTRT common BPHY0 kf common licur file10 common curve IMORE common swich ktcond c common error relerr
IMPLICIT REAL *A O Z RG B5 common BPARM XNPL1 common BMESH JX common BSTEP lns common BWRT1 IRSTRT common BPHY0 kf common licur file10 common curve IMORE common swich ktcond c common error abserr common bradi mesh common artvp QU common radia kr common prtrb xmdi common optic xltk common lscal kpr common shoki deini(jmax)
subroutine sadmk2(R, ETA, DL, DE, VX, VP, TE)
subroutine sadmn(R, ETA, DL)
subroutine fun(XI, YI, YP)
subroutine jac(xi, yi, yp, dfdr, pdj)
subroutine lubksb(a, n, np, indx, b)
IMPLICIT REAL *A O Z RG B5 common BPARM XNPL1 common BMESH JX common BSTEP lns common BWRT1 IRSTRT common BPHY0 kf common licur file10 common curve IMORE common swich ktcond c common error abserr common bradi mesh common artvp QU common radia kr common prtrb xmdi common optic xltn
IMPLICIT REAL *A O Z RG B5 common BPARM XNPL1 common BMESH JX common BSTEP lns common BWRT1 IRSTRT common BPHY0 kf common licur file10 common curve IMORE common swich ktcond c common error abserr common bradi mesh common artvp QU common radia kr common prtrb xmdi common optic xltk common lscal kpr common shoki vxini(jmax)
subroutine sadmk(R, ETA, DL)
double precision function fnjn(NPL)
IMPLICIT REAL *A O Z RG B5 common BPARM XNPL1 common BMESH JX common BSTEP lns common BWRT1 IRSTRT common BPHY0 kf common licur file10 common curve IMORE common swich kcool
IMPLICIT REAL *A O Z RG B5 common BPARM XNPL1 common BMESH JX common BSTEP lns common BWRT1 IRSTRT common BPHY0 file7
subroutine simpr(y, dydx, dfdx, dfdy, nmax, n, xs, htot, nstep, yout, derivs)
double precision function fnin(NPL)
double precision function ondo(DE, PR, taup, tau)
IMPLICIT REAL *A O Z RG B5 common BPARM XNPL1 common BMESH JX common BSTEP lns common BWRT1 IRSTRT common BPHY0 kf common licur file10 common curve IMORE common swich ktcond c common error abserr common bradi mesh common artvp QU common radia kr common prtrb xmdi common optic xltk common lscal kpr common shoki vpini(jmax)
IMPLICIT REAL *A O Z RG B5 common BPARM XNPL1 common BMESH JX common BSTEP lns common BWRT1 IRSTRT common BPHY0 kf common licur file10 common curve IMORE common swich ktcond c common error abserr common bradi mesh common artvp QU common radia kr common prtrb xmdi common optic xltk common lscal kpr common shoki teini(jmax) common/cauti/krs(jmax)
IMPLICIT REAL *A O Z RG B5 common BPARM XNPL1 common BMESH JX common BSTEP lns common BWRT1 IRSTRT common BPHY0 kf common licur file10 common curve IMORE common swich ktcond c common error abserr common bradi mesh common artvp QU common radia kr common prtrb xmdi common optic tauabso(jmax)
subroutine pzextr(iest, xest, yest, yz, dy, nv)
IMPLICIT REAL *A O Z RG B5 common BPARM xmd
subroutine sadmn2(R, ETA, DL, DE, VX, VP, TE)
IMPLICIT REAL *A O Z RG B5 common BPARM XNPL1 common BMESH JX common BSTEP lns common BWRT1 IRSTRT common BPHY0 kf common licur file10 common curve IMORE common swich ktcond c common error abserr common bradi mesh common artvp QU common radia kr common prtrb xmdi common optic xltk common lscal kpr common shoki nl(jmax) common/energ/es1(jmax) common/fluxr0/drepsi(jmax)
subroutine stifbs(y, dydx, nv, x, htry, eps, yscal, hdid, hnext, derivs, icon)
subroutine ludcmp(a, n, np, indx, d)