1 subroutine promat (n,dfdpsi,dpdpsi,f,flx_fi,psia,q,rm,psim,iter,
2 * kstep,fvac,psi_eav,pspl_av,psibon0,cur_mu)
6 implicit real*8 (a-h,o-z),
integer*4 (i-n)
9 common /com_fixbon/ key_fixfree
12 common/selcon/ psi_d(nrp),fi_d(nrp),f_d(nrp),ri_d(nrp),
13 * ps_pnt(nrp),del_psb,psi_bn1
14 common/savt0/ psi0(nrp),fi0(nrp),f0(nrp),ri0(nrp),q0(nrp),
15 * dpsidt(nrp),dfidt(nrp),rm0,ac0n,skcen0
17 common/com_but/ sigma(nrp),cbut_b(nrp)
18 dimension dfdpsi(n),
dpdpsi(n),f(n),flx_fi(n),psia(n),q(n)
54 if(key_boncon.eq.0)
then
69 call
cof_bon(cps_bon,bps_bon,dps_bon)
70 pspl_tst=-cps_bon*(psia(n)-psia(n-1))*psim
71 * +bps_bon*dfdpsi(n)+dps_bon*
dpdpsi(n)
75 psi_bnd=psi_ext+pspl_av
81 call
metcof(alfa22,alfa33,ds,dv,ac0,skcen,ri,
86 psi(i)=psim*psia(i)+psi_bnd
88 if(kstep.ne.kstep_prev)
then
89 jumpstep=kstep - kstep_prev
90 del_psb=psi_bn1-psibon0
91 if((jumpstep.eq.1 .AnD. kstep.gt.1) .OR. key_fixfree.eq.0)
then
94 psi0(i)=psim*psia(i)+psibon0
104 xa=dsqrt(flx_fi(i)/flx_fi(n))
116 if(key_boncon.eq.0)
then
130 wrk(i)=dsqrt(dabs(alfa22(i)))
140 f(i)=alfa33(i)*(fi(i+1)-fi(i))/ds(i)
141 ri(i)=alfa22(i)*(psi(i+1)-psi(i))/ds(i)
142 q(i)=-(fi(i+1)-fi(i))/(psi(i+1)-psi(i))
147 ffprim = rm*( ac0*(psi(1)-psi(2))/skcen - rm*
dpdpsi(1) )
148 delf(1) = ffprim - dfdpsi(1)
151 ffprim = (f(i)**2-f(i-1)**2)/(psi(i+1)-psi(i-1))
152 delf(i) = ffprim - dfdpsi(i)
159 dfdpsi(n) = (f(n)**2-f(n-1)**2)/(psi(n)-psi(n-1))
166 dpsi(i)=0.5d0*(psi(i+1)-psi(i-1))
167 dfi(i) =0.5d0*(fi(i+1)-fi(i-1))
168 dri(i) =ri(i)-ri(i-1)
170 fk(i) =0.5d0*(f(i)+f(i-1))
171 rik(i) =0.5d0*(ri(i)+ri(i-1))
173 qk(i) =-(dsk(i)/alp33k(i))*(f(i)+f(i-1))/(psi(i+1)-psi(i-1))
180 if(dpsdt.GE.0.d0)
then
187 if(dfldt.LE.0.d0)
then
193 d2psi=0.5d0*(psi(i+1)-2.d0*psi(i)+psi(i-1))
194 d2fi=0.5d0*(fi(i+1)-2.d0*fi(i)+fi(i-1))
196 a(i,1)= 0.5d0*dfidt(i)-( fk(i)+0.5d0*df(i) )*
197 + ( alfa22(i-1)/ds(i-1) )/sigma(i)
198 + -0.5d0*dfidt(i)*capsi
200 a(i,2)=-0.5d0*dpsidt(i)+( rik(i)+0.5d0*dri(i) )*
201 + ( alfa33(i-1)/ds(i-1) )/sigma(i)
202 + +0.5d0*dpsidt(i)*capfi
204 a(i,3)=-0.5d0*dri(i)/dpsi(i) + alfa22(i-1)/ds(i-1)
206 a(i,4)= qk(i)*alfa33(i-1)/ds(i-1)
207 + +0.5d0*(df(i)/dpsi(i))*(dsk(i)/alp33k(i))*(alfa33(i-1)/ds(i-1))
210 b(i,1)=-0.5d0*dfidt(i)+( 0.5d0*df(i)-fk(i) )*
211 + ( alfa22(i)/ds(i) )/sigma(i)
212 + -0.5d0*dfidt(i)*capsi
214 b(i,2)= 0.5d0*dpsidt(i)+( rik(i)-0.5d0*dri(i) )*
215 + ( alfa33(i)/ds(i) )/sigma(i)
216 + +0.5d0*dpsidt(i)*capfi
218 b(i,3)= 0.5d0*dri(i)/dpsi(i)+alfa22(i)/ds(i)
220 b(i,4)= qk(i)*alfa33(i)/ds(i)
221 + -0.5d0*(df(i)/dpsi(i))*(dsk(i)/alp33k(i))*(alfa33(i)/ds(i))
224 c(i,1)=-dfi(i)/dt-( fk(i)*(alfa22(i)/ds(i)+alfa22(i-1)/ds(i-1))
225 + -0.5d0*df(i)*( alfa22(i)/ds(i)-alfa22(i-1)/ds(i-1) ) )/sigma(i)
229 + ( 0.5d0*dri(i)*(alfa33(i-1)/ds(i-1)-alfa33(i)/ds(i)) +
230 + rik(i)*(alfa33(i)/ds(i)+alfa33(i-1)/ds(i-1)) )/sigma(i)
233 c(i,3)= alfa22(i)/ds(i)+alfa22(i-1)/ds(i-1)
235 c(i,4)= qk(i)*( alfa33(i)/ds(i)+alfa33(i-1)/ds(i-1) )
236 + +0.5d0*(df(i)/dpsi(i))*(dsk(i)/alp33k(i))
237 + *( alfa33(i-1)/ds(i-1)-alfa33(i)/ds(i) )
239 fk0 =0.5d0*(f0(i)+f0(i-1))
240 rik0 =0.5d0*(ri0(i)+ri0(i-1))
241 qk0 =0.5d0*(q0(i)+q0(i-1))
242 dri0 =ri0(i)-ri0(i-1)
245 h(i,1)= dpsidt(i)*dfi(i)-dfidt(i)*dpsi(i)
246 + +dpsidt(i)*capfi*d2fi-dfidt(i)*capsi*d2psi
247 + +( cbut_b(i)*dvk(i) )/sigma(i)
249 + -(f(i)*f(i-1))*( ri(i)/f(i)-ri(i-1)/f(i-1) )/sigma(i)
254 h(i,2)= dri(i)-dfdpsi(i)*dsk(i)/alp33k(i)-
dpdpsi(i)*dvk(i)
259 b(1,1)= rm*ac0/(sigma(1)*skcen)
264 c(1,1)= rm*ac0/(sigma(1)*skcen)-1.d0/dt
269 h(1,1)= dpsidt(1)-rm*ac0*(psi(1)-psi(2))/(sigma(1)*skcen)
270 * +cbut_b(1)*rm**2/f(1)/sigma(1)
275 if(key_boncon.eq.0)
then
286 h(n,1)= psi_ext+cps_bon*psi(n-1)-(cps_bon+1.d0)*psi(n)
288 h(n,2)= fbnd*ds(n-1)/alfa33(n-1)-(fi(n)-fi(n-1))
292 include
'pcof_e_in.inc'
308 psi(i)= psi(i) + y(i,1)
309 fi(i) = fi(i) + y(i,2)
310 dpsidt(i)=(psi(i)-psi0(i))/dt
311 dfidt(i )=(fi(i)-fi0(i))/dt
315 f(i)=alfa33(i)*(fi(i+1)-fi(i))/ds(i)
316 ri(i)=alfa22(i)*(psi(i+1)-psi(i))/ds(i)
317 q(i)=-(fi(i+1)-fi(i))/(psi(i+1)-psi(i))
320 ffprim=rm*(ac0*(psi(1)-psi(2))/skcen-rm*
dpdpsi(1))
321 delf(1) = ffprim - dfdpsi(1)
325 ffprim = (f(i)**2-f(i-1)**2)/(psi(i+1)-psi(i-1))
326 delf(i) = ffprim - dfdpsi(i)
333 ri(n)=dsqrt( ri(n-1)**2+alfa22n/alp33k(n)*(f(n)**2-f(n-1)**2)
334 * +alfa22n*
dpdpsi(n)*(psi(n)-psi(n-1))*dvk(n)/dsk(n) )
335 dfdpsi(n) = (f(n)**2-f(n-1)**2)/(psi(n)-psi(n-1))
341 if (aby.ge.deltamax) deltamax=aby
348 if(dpsdt.GE.0.d0)
then
355 if(dfldt.LE.0.d0)
then
361 d2psi= (psi(i+1)-2.d0*psi(i)+psi(i-1))
362 d2fi= (fi(i+1)-2.d0*fi(i)+fi(i-1))
364 znv=(dpsidt(i)*(fi(i+1)-fi(i-1))-dfidt(i)*(psi(i+1)-psi(i-1)))
365 *-(f(i)*f(i-1))*( ri(i)/f(i)-ri(i-1)/f(i-1) )*2.0d0
368 + +dpsidt(i)*capfi*d2fi-dfidt(i)*capsi*d2psi
376 zn(i,2)= (ri(i)-ri(i-1)) - dfdpsi(i)*dsk(i)/alp33k(i)
384 if (abd.ge.ddivmax) ddivmax=abd
390 if (deltamax.le.epsel)
exit
394 write(*,*)
'no newton iterations convergence in promat'
395 write(*,*)
'execution was terminated'
409 dfdpsi(i)=f_wght*dfdpsi(i)+(1.d0-f_wght)*dfdpsn(i)
415 psi_d(i)=psi(i)-psi(n)
428 subroutine promat_i (n,dfdpsi,dpdpsi,f,flx_fi,psia,q,rm,psim,iter,
429 * kstep,fvac,psi_eav,pspl_av,psibon0,tok)
433 implicit real*8 (a-h,o-z),
integer*4 (i-n)
436 common/selcon/ psi_d(nrp),fi_d(nrp),f_d(nrp),ri_d(nrp),
437 * ps_pnt(nrp),del_psb,psi_bn1
438 common/savt0/ psi0(nrp),fi0(nrp),f0(nrp),ri0(nrp),q0(nrp),
439 * dpsidt(nrp),dfidt(nrp),rm0,ac0n,skcen0
441 common/com_but/ sigma(nrp),cbut_b(nrp)
442 common /com_fixbon/ key_fixfree
443 common/com_flag/kastr
444 dimension dfdpsi(n),
dpdpsi(n),f(n),flx_fi(n),psia(n),q(n)
504 psi_eav=psi_bnd-pspl_av
507 call
metcof(alfa22,alfa33,ds,dv,ac0,skcen,ri,
512 psi(i)=psim*psia(i)+psi_bnd
515 if(kstep.ne.kstep_prev)
then
516 jumpstep=kstep - kstep_prev
517 del_psb=psi_bn1-psibon0
518 if((jumpstep.eq.1 .AnD. kstep.gt.1) .OR. key_fixfree.eq.0)
then
521 psi0(i)=psim*psia(i)+psibon0
535 xa=dsqrt(flx_fi(i)/flx_fi(n))
558 wrk(i)=dsqrt(dabs(alfa22(i)))
564 fi(i)=fi(n)*(i-1.d0)**2/(n-1.d0)**2
568 f(i)=alfa33(i)*(fi(i+1)-fi(i))/ds(i)
569 ri(i)=alfa22(i)*(psi(i+1)-psi(i))/ds(i)
570 q(i)=-(fi(i+1)-fi(i))/(psi(i+1)-psi(i))
576 ffprim=rm*(ac0*(psi(1)-psi(2))/skcen-rm*
dpdpsi(1))
577 delf(1) = ffprim - dfdpsi(1)
580 ffprim = (f(i)**2-f(i-1)**2)/(psi(i+1)-psi(i-1))
581 delf(i) = ffprim - dfdpsi(i)
583 dfdpsn(i) =alp33k(i)*(ri(i)-ri(i-1))/dsk(i)
587 dfdpsi(n) = (f(n)**2-f(n-1)**2)/(psi(n)-psi(n-1))
594 dpsi(i)=0.5d0*(psi(i+1)-psi(i-1))
595 dfi(i) =0.5d0*(fi(i+1)-fi(i-1))
596 dri(i) =ri(i)-ri(i-1)
598 fk(i) =0.5d0*(f(i)+f(i-1))
599 rik(i) =0.5d0*(ri(i)+ri(i-1))
601 qk(i) =-(dsk(i)/alp33k(i))*(f(i)+f(i-1))/(psi(i+1)-psi(i-1))
608 if(dpsdt.GE.0.d0)
then
615 if(dfldt.LE.0.d0)
then
621 d2psi=0.5d0*(psi(i+1)-2.d0*psi(i)+psi(i-1))
622 d2fi=0.5d0*(fi(i+1)-2.d0*fi(i)+fi(i-1))
624 a(i,1)= 0.5d0*dfidt(i)-( fk(i)+0.5d0*df(i) )*
625 + ( alfa22(i-1)/ds(i-1) )/sigma(i)
626 + -0.5d0*dfidt(i)*capsi
628 a(i,2)=-0.5d0*dpsidt(i)+( rik(i)+0.5d0*dri(i) )*
629 + ( alfa33(i-1)/ds(i-1) )/sigma(i)
630 + +0.5d0*dpsidt(i)*capfi
632 a(i,3)=-0.5d0*dri(i)/dpsi(i) + alfa22(i-1)/ds(i-1)
634 a(i,4)= qk(i)*alfa33(i-1)/ds(i-1)
635 + +0.5d0*(df(i)/dpsi(i))*(dsk(i)/alp33k(i))*(alfa33(i-1)/ds(i-1))
638 b(i,1)=-0.5d0*dfidt(i)+( 0.5d0*df(i)-fk(i) )*
639 + ( alfa22(i)/ds(i) )/sigma(i)
640 + -0.5d0*dfidt(i)*capsi
642 b(i,2)= 0.5d0*dpsidt(i)+( rik(i)-0.5d0*dri(i) )*
643 + ( alfa33(i)/ds(i) )/sigma(i)
644 + +0.5d0*dpsidt(i)*capfi
646 b(i,3)= 0.5d0*dri(i)/dpsi(i)+alfa22(i)/ds(i)
648 b(i,4)= qk(i)*alfa33(i)/ds(i)
649 + -0.5d0*(df(i)/dpsi(i))*(dsk(i)/alp33k(i))*(alfa33(i)/ds(i))
652 c(i,1)=-dfi(i)/dt-( fk(i)*(alfa22(i)/ds(i)+alfa22(i-1)/ds(i-1))
653 + -0.5d0*df(i)*( alfa22(i)/ds(i)-alfa22(i-1)/ds(i-1) ) )/sigma(i)
657 + ( 0.5d0*dri(i)*(alfa33(i-1)/ds(i-1)-alfa33(i)/ds(i)) +
658 + rik(i)*(alfa33(i)/ds(i)+alfa33(i-1)/ds(i-1)) )/sigma(i)
661 c(i,3)= alfa22(i)/ds(i)+alfa22(i-1)/ds(i-1)
663 c(i,4)= qk(i)*( alfa33(i)/ds(i)+alfa33(i-1)/ds(i-1) )
664 + +0.5d0*(df(i)/dpsi(i))*(dsk(i)/alp33k(i))
665 + *( alfa33(i-1)/ds(i-1)-alfa33(i)/ds(i) )
667 fk0 =0.5d0*(f0(i)+f0(i-1))
668 rik0 =0.5d0*(ri0(i)+ri0(i-1))
669 qk0 =0.5d0*(q0(i)+q0(i-1))
670 dri0 =ri0(i)-ri0(i-1)
673 h(i,1)= dpsidt(i)*dfi(i)-dfidt(i)*dpsi(i)
674 + +dpsidt(i)*capfi*d2fi-dfidt(i)*capsi*d2psi
675 + +( cbut_b(i)*dvk(i) )/sigma(i)
677 + -(f(i)*f(i-1))*( ri(i)/f(i)-ri(i-1)/f(i-1) )/sigma(i)
682 h(i,2)= dri(i)-dfdpsi(i)*dsk(i)/alp33k(i)-
dpdpsi(i)*dvk(i)
687 b(1,1)= rm*ac0/(sigma(1)*skcen)
692 c(1,1)= rm*ac0/(sigma(1)*skcen)-1.d0/dt
697 h(1,1)= dpsidt(1)-rm*ac0*(psi(1)-psi(2))/(sigma(1)*skcen)
698 * +cbut_b(1)*rm**2/f(1)/sigma(1)
719 include
'pcof_e_I_in.inc'
734 psi(i)= psi(i) + y(i,1)
735 fi(i) = fi(i) + y(i,2)
736 dpsidt(i)=(psi(i)-psi0(i))/dt
737 dfidt(i )=(fi(i)-fi0(i))/dt
741 f(i)=alfa33(i)*(fi(i+1)-fi(i))/ds(i)
742 ri(i)=alfa22(i)*(psi(i+1)-psi(i))/ds(i)
743 q(i)=-(fi(i+1)-fi(i))/(psi(i+1)-psi(i))
746 ffprim=rm*(ac0*(psi(1)-psi(2))/skcen-rm*
dpdpsi(1))
747 delf(1) = ffprim - dfdpsi(1)
751 ffprim = (f(i)**2-f(i-1)**2)/(psi(i+1)-psi(i-1))
752 delf(i) = ffprim - dfdpsi(i)
754 dfdpsn(i) =alp33k(i)*(ri(i)-ri(i-1))/dsk(i)
760 dfdpsi(n) = (f(n)**2-f(n-1)**2)/(psi(n)-psi(n-1))
766 if (aby.ge.deltamax) deltamax=aby
773 if(dpsdt.GE.0.d0)
then
780 if(dfldt.LE.0.d0)
then
786 d2psi= (psi(i+1)-2.d0*psi(i)+psi(i-1))
787 d2fi= (fi(i+1)-2.d0*fi(i)+fi(i-1))
789 znv=(dpsidt(i)*(fi(i+1)-fi(i-1))-dfidt(i)*(psi(i+1)-psi(i-1)))
790 *-(f(i)*f(i-1))*( ri(i)/f(i)-ri(i-1)/f(i-1) )*2.0d0
793 + +dpsidt(i)*capfi*d2fi-dfidt(i)*capsi*d2psi
801 zn(i,2)= (ri(i)-ri(i-1)) - dfdpsi(i)*dsk(i)/alp33k(i)
809 if (abd.ge.ddivmax) ddivmax=abd
813 if (deltamax.le.epsel)
exit
817 write(*,*)
'no newton iterations convergence in promat'
818 write(*,*)
'execution was terminated'
834 psi_d(i)=psi(i)-psi(n)
849 implicit real*8 (a-h,o-z),
integer*4 (i-n)
851 dimension y(nrp,2),a(nrp,4),b(nrp,4),c(nrp,4),f(nrp,2)
861 det=c(1,1)*c(1,4)-c(1,2)*c(1,3)
867 alfa(1,1) = c1i1*b(1,1)+c1i2*b(1,3)
868 alfa(1,2) = c1i1*b(1,2)+c1i2*b(1,4)
869 alfa(1,3) = c1i3*b(1,1)+c1i4*b(1,3)
870 alfa(1,4) = c1i3*b(1,2)+c1i4*b(1,4)
872 beta(1,1) = c1i1*f(1,1)+c1i2*f(1,2)
873 beta(1,2) = c1i3*f(1,1)+c1i4*f(1,2)
876 cmb1 = c(j,1) - a(j,1)*alfa(j-1,1)-a(j,2)*alfa(j-1,3)
877 cmb2 = c(j,2) - a(j,1)*alfa(j-1,2)-a(j,2)*alfa(j-1,4)
878 cmb3 = c(j,3) - a(j,3)*alfa(j-1,1)-a(j,4)*alfa(j-1,3)
879 cmb4 = c(j,4) - a(j,3)*alfa(j-1,2)-a(j,4)*alfa(j-1,4)
881 det=cmb1*cmb4-cmb2*cmb3
887 alfa(j,1) = cmbi1*b(j,1)+cmbi2*b(j,3)
888 alfa(j,2) = cmbi1*b(j,2)+cmbi2*b(j,4)
889 alfa(j,3) = cmbi3*b(j,1)+cmbi4*b(j,3)
890 alfa(j,4) = cmbi3*b(j,2)+cmbi4*b(j,4)
892 fab1 = f(j,1) + a(j,1)*beta(j-1,1)+a(j,2)*beta(j-1,2)
893 fab2 = f(j,2) + a(j,3)*beta(j-1,1)+a(j,4)*beta(j-1,2)
895 beta(j,1) = cmbi1*fab1+cmbi2*fab2
896 beta(j,2) = cmbi3*fab1+cmbi4*fab2
903 y(j,1) = alfa(j,1)*y(j+1,1)+alfa(j,2)*y(j+1,2) + beta(j,1)
904 y(j,2) = alfa(j,3)*y(j+1,1)+alfa(j,4)*y(j+1,2) + beta(j,2)
914 implicit real*8(a-h,o-z)
916 common /com_tim/ dtim,ctim
917 common /com_sigcd/ c_sig(nrp),t_el(nrp),c_bts(nrp),c_driv(nrp)
921 fun_sig_tst=-(8.d0*pi/3.d0)*dabs(t)**1.5d0*(1.d-4/dtim)
928 implicit real*8(a-h,o-z)
936 elseif(a.gt.a0 .AND. a.le.a1)
then
937 sigma=sigm1+(sigm0-sigm1)*
939 * dabs( dcos(0.5d0*pi*(a-a0)/(a1-a0)) )**1.5
949 implicit real*8(a-h,o-z)
957 elseif(a.gt.a0 .AND. a.le.a1)
then
958 sigma=sigm1+(sigm0-sigm1)*
960 * ( dcos(0.5d0*pi*(a-a0)/(a1-a0)) )**3
970 implicit real*8(a-h,o-z)
980 t= tb + (t2-tb)*(1.d0-((a-a2)/(1.d0-a2))**2)
983 elseif(a.gt.a0 .AND. a.lt.a1)
then
984 t=t1 + (t0-t1)*(1.d0-((a-a0)/(a1-a0))**2)
985 elseif(a.ge.a1 .AND. a.lt.a2)
then
986 t=t2+(a-a2)*(t1-t2)/(a1-a2)
988 fun_sig=-(8.d0*pi/3.d0)*dabs(t)**1.5d0
995 implicit real*8(a-h,o-z)
996 common /com_tim/ dtim,ctim
1019 elseif(a.gt.a0 .AND. a.lt.a1)
then
1020 t=t1 + (t0-t1)*(1.d0-((a-a0)/(a1-a0))**2)
1027 fun_sig=-(8.d0*pi/3.d0)*dabs(t)**1.5d0
1034 implicit real*8(a-h,o-z)
1041 te=0.5d0*tp*( dtanh( (d-1.d0)/c ) +1.d0 )
1044 t=(t0-tp-ts+te)*(1-a**pa)**pb +.5*tp*(dtanh((d-a)/c) + 1)+ts-te
1047 fun_sig=-(8.d0*pi/3.d0)*dabs(t)**1.5d0
1055 implicit real*8(a-h,o-z)
1057 common /com_sigcd/ c_sig(nrp),t_el(nrp),c_bts(nrp),c_driv(nrp)
1059 fun_jb=(c_bts(i)+c_driv(i))*amu0
1067 implicit real*8(a-h,o-z)
1068 include
'dimpl1.inc'
1069 common/com_jb/ bj_av(nrp),curfi_av(nrp)
1075 fun=bj_av(1)*( 1.d0-dtanh(((a0-a)/w)**2) )
1084 subroutine promat_j (n,dfdpsi,dpdpsi,f,flx_fi,psia,q,rm,
1085 * psim,iter,kstep,fvac,psi_eav,pspl_av,psibon0)
1088 implicit real*8 (a-h,o-z),
integer*4 (i-n)
1089 include
'dimpl1.inc'
1091 common /com_jb/ bj_av(nrp),curfi_av(nrp)
1092 common/savt0/ psi0(nrp),fi0(nrp),f0(nrp),ri0(nrp),q0(nrp),
1093 * dpsidt(nrp),dfidt(nrp),rm0,ac0n,skcen0
1095 common/com_but/ sigma(nrp),cbut_b(nrp)
1096 dimension dfdpsi(n),
dpdpsi(n),f(n),flx_fi(n),psia(n),q(n)
1142 call
cof_bon(cps_bon,bps_bon,dps_bon)
1143 pspl_tst=-cps_bon*(psia(n)-psia(n-1))*psim
1144 * +bps_bon*dfdpsi(n)+dps_bon*
dpdpsi(n)
1151 call
metcof(alfa22,alfa33,ds,dv,ac0,skcen,ri,
1156 psi(i)=psim*psia(i)+psi_bnd
1158 if(kstep.ne.kstep_prev)
then
1159 psi0(i)=psim*psia(i)+psibon0
1165 dpsidt(i)=(psi(i)-psi0(i))/dt
1168 xa=dfloat(i-1)/dfloat(n-1)
1184 wrk(i)=dsqrt(dabs(alfa22(i)))
1190 fi(i)=fi(n)*(i-1.d0)**2/(n-1.d0)**2
1194 f(i)=alfa33(i)*(fi(i+1)-fi(i))/ds(i)
1195 ri(i)=alfa22(i)*(psi(i+1)-psi(i))/ds(i)
1196 q(i)=-(fi(i+1)-fi(i))/(psi(i+1)-psi(i))
1201 ffprim=rm*(ac0*(psi(1)-psi(2))/skcen-rm*
dpdpsi(1))
1202 delf(1) = ffprim - dfdpsi(1)
1205 ffprim = (f(i)**2-f(i-1)**2)/(psi(i+1)-psi(i-1))
1206 delf(i) = ffprim - dfdpsi(i)
1208 dfdpsn(i) =alp33k(i)*(ri(i)-ri(i-1))/dsk(i)
1213 dfdpsi(n) = (f(n)**2-f(n-1)**2)/(psi(n)-psi(n-1))
1220 dpsi(i)=0.5d0*(psi(i+1)-psi(i-1))
1221 dfi(i) =0.5d0*(fi(i+1)-fi(i-1))
1222 dri(i) =ri(i)-ri(i-1)
1224 fk(i) =0.5d0*(f(i)+f(i-1))
1225 rik(i) =0.5d0*(ri(i)+ri(i-1))
1227 qk(i) =-(dsk(i)/alp33k(i))*(f(i)+f(i-1))/(psi(i+1)-psi(i-1))
1234 if(dpsdt.GE.0.d0)
then
1241 if(dfldt.LE.0.d0)
then
1247 d2psi=0.5d0*(psi(i+1)-2.d0*psi(i)+psi(i-1))
1248 d2fi=0.5d0*(fi(i+1)-2.d0*fi(i)+fi(i-1))
1250 a(i,1)= 0.5d0*dfidt(i)-( fk(i)+0.5d0*df(i) )*
1251 + ( alfa22(i-1)/ds(i-1) )/sigma(i)
1252 + -0.5d0*dfidt(i)*capsi
1254 a(i,2)=-0.5d0*dpsidt(i)+( rik(i)+0.5d0*dri(i) )*
1255 + ( alfa33(i-1)/ds(i-1) )/sigma(i)
1256 + +0.5d0*dpsidt(i)*capfi
1258 a(i,3)=-0.5d0*dri(i)/dpsi(i) + alfa22(i-1)/ds(i-1)
1260 a(i,4)= qk(i)*alfa33(i-1)/ds(i-1)
1261 + +0.5d0*(df(i)/dpsi(i))*(dsk(i)/alp33k(i))*(alfa33(i-1)/ds(i-1))
1264 b(i,1)=-0.5d0*dfidt(i)+( 0.5d0*df(i)-fk(i) )*
1265 + ( alfa22(i)/ds(i) )/sigma(i)
1266 + -0.5d0*dfidt(i)*capsi
1268 b(i,2)= 0.5d0*dpsidt(i)+( rik(i)-0.5d0*dri(i) )*
1269 + ( alfa33(i)/ds(i) )/sigma(i)
1270 + +0.5d0*dpsidt(i)*capfi
1272 b(i,3)= 0.5d0*dri(i)/dpsi(i)+alfa22(i)/ds(i)
1274 b(i,4)= qk(i)*alfa33(i)/ds(i)
1275 + -0.5d0*(df(i)/dpsi(i))*(dsk(i)/alp33k(i))*(alfa33(i)/ds(i))
1278 c(i,1)=-dfi(i)/dt-( fk(i)*(alfa22(i)/ds(i)+alfa22(i-1)/ds(i-1))
1279 + -0.5d0*df(i)*( alfa22(i)/ds(i)-alfa22(i-1)/ds(i-1) ) )/sigma(i)
1283 + ( 0.5d0*dri(i)*(alfa33(i-1)/ds(i-1)-alfa33(i)/ds(i)) +
1284 + rik(i)*(alfa33(i)/ds(i)+alfa33(i-1)/ds(i-1)) )/sigma(i)
1287 c(i,3)= alfa22(i)/ds(i)+alfa22(i-1)/ds(i-1)
1289 c(i,4)= qk(i)*( alfa33(i)/ds(i)+alfa33(i-1)/ds(i-1) )
1290 + +0.5d0*(df(i)/dpsi(i))*(dsk(i)/alp33k(i))
1291 + *( alfa33(i-1)/ds(i-1)-alfa33(i)/ds(i) )
1293 fk0 =0.5d0*(f0(i)+f0(i-1))
1294 rik0 =0.5d0*(ri0(i)+ri0(i-1))
1295 qk0 =0.5d0*(q0(i)+q0(i-1))
1296 dri0 =ri0(i)-ri0(i-1)
1299 h(i,1)= dpsidt(i)*dfi(i)-dfidt(i)*dpsi(i)
1300 + +dpsidt(i)*capfi*d2fi-dfidt(i)*capsi*d2psi
1302 + -(f(i)*f(i-1))*( ri(i)/f(i)-ri(i-1)/f(i-1) )/sigma(i)
1303 + +( cbut_b(i)*dvk(i) )/sigma(i)
1308 h(i,2)= dri(i)-dfdpsi(i)*dsk(i)/alp33k(i)-
dpdpsi(i)*dvk(i)
1313 b(1,1)= rm*ac0/(sigma(1)*skcen)
1318 c(1,1)= rm*ac0/(sigma(1)*skcen)-1.d0/dt
1323 h(1,1)= dpsidt(1)-rm*ac0*(psi(1)-psi(2))/(sigma(1)*skcen)
1324 * +cbut_b(1)*rm**2/f(1)/sigma(1)
1345 include
'pcof_jb_in.inc'
1360 psi(i)= psi(i) + y(i,1)
1361 fi(i) = fi(i) + y(i,2)
1362 dpsidt(i)=(psi(i)-psi0(i))/dt
1363 dfidt(i )=(fi(i)-fi0(i))/dt
1367 f(i)=alfa33(i)*(fi(i+1)-fi(i))/ds(i)
1368 ri(i)=alfa22(i)*(psi(i+1)-psi(i))/ds(i)
1369 q(i)=-(fi(i+1)-fi(i))/(psi(i+1)-psi(i))
1372 ffprim=rm*(ac0*(psi(1)-psi(2))/skcen-rm*
dpdpsi(1))
1373 delf(1) = ffprim - dfdpsi(1)
1377 ffprim = (f(i)**2-f(i-1)**2)/(psi(i+1)-psi(i-1))
1378 delf(i) = ffprim - dfdpsi(i)
1380 dfdpsn(i) =alp33k(i)*(ri(i)-ri(i-1))/dsk(i)
1386 dfdpsi(n) = (f(n)**2-f(n-1)**2)/(psi(n)-psi(n-1))
1392 if (aby.ge.deltamax) deltamax=aby
1399 if(dpsdt.GE.0.d0)
then
1406 if(dfldt.LE.0.d0)
then
1412 d2psi= (psi(i+1)-2.d0*psi(i)+psi(i-1))
1413 d2fi= (fi(i+1)-2.d0*fi(i)+fi(i-1))
1415 znv=(dpsidt(i)*(fi(i+1)-fi(i-1))-dfidt(i)*(psi(i+1)-psi(i-1)))
1416 *-(f(i)*f(i-1))*( ri(i)/f(i)-ri(i-1)/f(i-1) )*2.0d0
1419 + +dpsidt(i)*capfi*d2fi-dfidt(i)*capsi*d2psi
1427 zn(i,2)= (ri(i)-ri(i-1)) - dfdpsi(i)*dsk(i)/alp33k(i)
1435 if (abd.ge.ddivmax) ddivmax=abd
1439 if (deltamax.le.epsel)
exit
1442 ri(n)=dsqrt(ri(n-1)**2+alfa22(n)/alp33k(n)*(f(n)**2-f(n-1)**2)
1443 * +alfa22n*
dpdpsi(n)*(psi(n)-psi(n-1))*dvk(n)/dsk(n) )
1446 write(*,*)
'no newton iterations convergence in promat'
1447 write(*,*)
'execution was terminated'
1465 common /com_fixbon/ key_fixfree
1466 integer k,key_fixfree
subroutine cof_bon(cps_bon, bps_bon, dps_bon)
real *8 function fun_sig(a, i)
real *8 function fun_sig_a(a, i)
subroutine mtrx_prog(n, y, a, b, c, f)
subroutine promat(n, dfdpsi, dpdpsi, f, flx_fi, psia, q, rm, psim, iter, kstep, fvac, psi_eav, pspl_av, psibon0, cur_mu)
real(r8) function dpdpsi(psi_n)
real *8 function fun_sig__(a)
subroutine put_key_fix(k)
real *8 function fun_jb(a, i)
real *8 function fun___sig(a)
subroutine metcof(alp22, alp33, delsc, delv, ac0, skcen, cur_I,
real *8 function fun_sig_(a)
real *8 function fun_jb_a(a, i)
subroutine promat_i(n, dfdpsi, dpdpsi, f, flx_fi, psia, q, rm, psim, iter, kstep, fvac, psi_eav, pspl_av, psibon0, tok)
subroutine promat_j(n, dfdpsi, dpdpsi, f, flx_fi, psia, q, rm, psim, iter, kstep, fvac, psi_eav, pspl_av, psibon0, cur_mu)
real *8 function fun_sigm(a)