29 SUBROUTINE phasekinetic2(NEL0,TIME,TEMPEL,TEMPO,TEMPMIN,AE1,AE3,BS,MS,FCFER,
30 . FCPER,FCBAI,FGRAIN,FRAC1,FRAC2,FRAC3,FRAC4,FRAC5,X2,X3,X4,X5,
31 . GFAC_F,PHI_F,PSI_F,CR_F,CF,GFAC_P,PHI_P,PSI_P,CR_P,CP,
32 . GFAC_B,PHI_B,PSI_B,CR_B,CB,PHI_M,PSI_M,N_M,FGFER,FGPER,FGBAI,
33 . QR2,QR3,QR4,KPER,KBAIN,ALPHA,XEQ2,XEQ4,XGAMA,TOTFRAC,TIMESTEP,NICOOL,
36#include "implicit_f.inc"
40 INTEGER NEL0,NICOOL,INDEX(NICOOL)
41 my_real ,
intent(in) :: THEACCFACT
43 . TEMPEL(NEL0),TEMPO(NEL0),TEMPMIN(NEL0),TIMESTEP
45 . time,
alpha,tref,ae1,ae3,bs,ms,gsize,nu,fcfer,fcper,fcbai,
46 . fgrain,qr2,qr3,qr4,kper,kbain,xeq2,xeq4,yx,
47 . gfac_f,phi_f,psi_f,cr_f,cf,gfac_p,phi_p,psi_p,cr_p,cp,
51 . frac1(nel0),frac2(nel0),frac3(nel0),frac4(nel0),frac5
53 . x2(nel0),x3(nel0),x4(nel0),x5(nel0
55 . ftemp,ux,vx,udot,vdot,f,const,fdot,x2old(nel0),
56 . x3old(nel0),x4old(nel0),x5old(nel0),gx,gdot,dti,term1,term2 ,term3
60 dti= one/
max(timestep*theaccfact,em10)
65 IF(totfrac(i)<one.AND.tempel(i)<tempmin(i))
THEN
66 IF (tempel(i)<ae3)
THEN
72 IF(x2(i)==zero)x2(i)=em10
73 ftemp = exp(-qr2/tempel(i))*abs(tempel(i)-ae3)**3
74 const = ftemp * fgfer * cf
76 ux = x2(i) **(phi_f*(one-x2(i)))
77 vx = (one-x2(i))**(psi_f*x2(i))
78 gx = exp(cr_f *x2(i)*x2(i))
80 f =(x2(i)-x2old(i))*dti - const * ux*vx /gx
81 udot = phi_f* ux * ((one-x2(i))/
max(em10,x2(i))-log(
max(em10,x2(i))))
82 vdot = psi_f* vx * (log(one-x2(i))-x2(i)/(one-x2(i)))
83 gdot = two * cr_f * x2(i) * gx
84 fdot = dti-const*((udot*vx+vdot*ux)*gx-ux*vx*gdot)/gx/gx
85 x2(i)=
max(em20,x2(i)-f/fdot)
88 frac1(i)=one-frac2(i)-frac3(i)-frac4(i)-frac5(i)
91 ELSEIF(tempel(i)>bs)
THEN
96 IF(x3(i)==zero)x3(i)=em10
97 ftemp=6.17*exp(-qr3/tempel(i))*abs(tempel(i)-ae1)**3
98 const=ftemp* fgper *cp
100 ux = x3(i) **(phi_p*(one-x3(i)))
101 vx = (one-x3(i))**(psi_p*x3(i))
102 gx = exp(cr_p *x3(i)*x3(i))
104 f =(x3(i)-x3old(i))*dti - const * ux*vx /gx
105 udot = phi_p* ux * ((one-x3(i))/
max(em10,x3(i))-log(
max(em10,x3(i))))
106 vdot = psi_p* vx * (log(one-x3(i))-x3(i)/(one-x3(i)))
107 gdot = two * cr_p * x3(i) * gx
108 fdot = dti-const*((udot*vx+vdot*ux)*gx-ux*vx*gdot)/gx/gx
109 x3(i)=
max(em20,x3(i)-f/fdot)
112 frac3(i)=x3(i)*(one-xeq2)
113 frac1(i)=one-frac2(i)-frac3(i)-frac4(i)-frac5(i)
117 ELSEIF(tempel(i)>ms)
THEN
121 IF(x4(i) == zero) x4(i) = x3(i)
123 ftemp=exp(-qr4/tempel(i)) *(tempel(i)-bs)**2
124 const=ftemp* fgbai *cb
126 ux = x4(i) **(phi_b*(one-x4(i)))
127 vx = (one-x4(i))**(psi_b*x4(i))
128 gx = exp(cr_b *x4(i)*x4(i))
130 f =(x4(i)-x4old(i))*dti - const * ux*vx /gx
131 udot = phi_b* ux * ( (one-x4(i))/
max(em10,x4(i))-log(
max(em10,x4(i))) )
132 vdot = psi_b* vx * (log(one-x4(i))-x4
133 gdot = two * cr_b * x4(i) * gx
134 fdot = dti-const*((udot*vx+vdot*ux)*gx-ux*vx*gdot)/gx/gx
135 x4(i)=
max(em20,x4(i)-f/fdot)
137 frac4(i)=x4(i)*(one-x2(i))
138 frac1(i)=one-frac2(i)-frac3(i)-frac4(i)-frac5(i)
143 IF (frac5(i)==zero)xgama(i)= frac1(i)
145 term1 =
alpha*(ms-tempel(i))**n_m
146 term2 =
max(em20,x5(i)
147 IF(psi_m >=zero)
THEN
148 term3 = (one - x5(i)) ** psi_m
150 term3 = (one - x5(i)) ** (psi_m*two -xgama(i) )
152 x5(i) = x5old(i) + (term1 * term2 *term3)*(tempo(i)-tempel(i))
153 frac5(i)=x5(i)*xgama(i)
154 frac1(i)=one-frac2(i)-frac3(i)-frac4(i)-frac5(i)
subroutine phasekinetic2(nel0, time, tempel, tempo, tempmin, ae1, ae3, bs, ms, fcfer, fcper, fcbai, fgrain, frac1, frac2, frac3, frac4, frac5, x2, x3, x4, x5, gfac_f, phi_f, psi_f, cr_f, cf, gfac_p, phi_p, psi_p, cr_p, cp, gfac_b, phi_b, psi_b, cr_b, cb, phi_m, psi_m, n_m, fgfer, fgper, fgbai, qr2, qr3, qr4, kper, kbain, alpha, xeq2, xeq4, xgama, totfrac, timestep, nicool, index, theaccfact)