16 subroutine ordinary_diff(s,mi,sigmai,alpha,phii,T,phi,ni,n,rhoi, &
17 rho,m,mu,sigma,chi,zeta0,theta,ti,dt,nu,dij,i_ilj,dtl_dnj, &
18 dzeta0_dnj,dchi0il_dnj)
23 double precision mi(s),sigmai(s),alpha(s,s),phii(s),T,phi, &
24 ni(s),n,rhoi(s),rho,m,mu(s,s),sigma(s,s), &
26 theta(s),Ti(s),DT(s),nu(s,s),Dij(s,s), &
27 I_ilj(s,s,s),dTl_dnj(s,s),dzeta0_dnj(s), &
31 double precision kronecker(s,s),M1,M2,M3,dphi_dnl(s), &
32 dM1_dnl(s),dM2_dnl(s),dM3_dnl(s), &
34 dmuioverT_dnl(s,s),perturbation,delta_ni(s), &
35 delta_phii(s),delta_rhoi(s),chi_ij, &
36 theta_pos(s),Ti_pos(s), &
37 zeta0_pos,group1(s,s),group2(s,s), &
38 p_pos,niTi_pos(s),theta_neg(s), &
39 Ti_neg(s),zeta0_neg,p_neg,niTi_neg(s), &
40 dp_dnj(s),dniTi_dnj(s,s),sum1(s,s), &
41 Amat(s,s),bmat(s,s), &
43 double precision d, twoDeltaNi
49 parameter(pi=3.14159265458979323846d0)
66 m1 = m1 + ni(i)*sigmai(i)
67 m2 = m2 + ni(i)*sigmai(i)**2
68 m3 = m3 + ni(i)*sigmai(i)**3
76 dphi_dnl(l) = pi/6.d0*sigmai(l)**3
77 dm1_dnl(l) = (sigmai(l)-m1)/n
78 dm2_dnl(l) = (sigmai(l)**2-m2)/n
79 dm3_dnl(l) = (sigmai(l)**3-m3)/n
81 dni_dnl(i,l) = kronecker(i,l)
90 dmuiovert_dnl(i,l) = &
91 (3.d0*sigmai(i)*phi*dm2_dnl(l))/(m3*(1.d0 - phi)) - &
92 (3.d0*sigmai(i)*m2*phi*dm3_dnl(l))/(m3**2*(1.d0 - phi)) + &
93 dphi_dnl(l)/(1.d0 - phi) + (3.d0*sigmai(i)*m2* &
94 dphi_dnl(l))/(m3*(1.d0 - phi)) + &
95 (3.d0*sigmai(i)*m2*phi*dphi_dnl(l))/(m3*(1.d0 - phi)**2)+ &
96 3.d0*sigmai(i)**2*((phi*dm1_dnl(l))/(m3*(1.d0 - phi)) + &
97 (2.d0*dlog(1.d0 - phi)*m2*dm2_dnl(l))/m3**2 + &
98 (2.d0*m2*phi*dm2_dnl(l))/(m3**2*(1.d0 - phi)**2) - &
99 (2.d0*dlog(1.d0 - phi)*m2**2*dm3_dnl(l))/m3**3 - &
100 (2.d0*m2**2*phi*dm3_dnl(l))/(m3**3*(1.d0 - phi)**2) - &
101 (m1*phi*dm3_dnl(l))/(m3**2*(1.d0 - phi)) + &
102 (m2**2*dphi_dnl(l))/(m3**2*(1.d0 - phi)**2) - &
103 (m2**2*dphi_dnl(l))/(m3**2*(1.d0 - phi)) + &
104 (m1*dphi_dnl(l))/(m3*(1.d0 - phi)) + &
105 (2.d0*m2**2*phi*dphi_dnl(l))/(m3**2*(1.d0 - phi)**3) + &
106 (m1*phi*dphi_dnl(l))/(m3*(1.d0 - phi)**2)) + &
107 sigmai(i)**3*((3.d0*m2*phi**2*dm1_dnl(l))/ &
108 (m3**2*(1.d0 - phi)**2) - &
109 (6.d0*dlog(1.d0 - phi)*m2**2*dm2_dnl(l))/m3**3 + &
110 (3.d0*m1*phi**2*dm2_dnl(l))/(m3**2*(1.d0 - phi)**2) - &
111 (3.d0*m2**2*phi*(2.d0 - 5.d0*phi + phi**2)* &
112 dm2_dnl(l))/(m3**3*(1.d0 - phi)**3) + &
113 (6.d0*dlog(1.d0 - phi)*m2**3*dm3_dnl(l))/m3**4 - &
114 (phi*dm3_dnl(l))/(m3**2*(1.d0 - phi)) - &
115 (6.d0*m1*m2*phi**2*dm3_dnl(l))/ &
116 (m3**3*(1.d0 - phi)**2) + &
117 (3.d0*m2**3*phi*(2.d0 - 5.d0*phi + phi**2)* &
118 dm3_dnl(l))/(m3**4*(1.d0 - phi)**3) + &
119 (2.d0*m2**3*dphi_dnl(l))/(m3**3*(1.d0 - phi)) + &
120 dphi_dnl(l)/(m3*(1.d0 - phi)) + &
121 (6.d0*m1*m2*phi*dphi_dnl(l))/(m3**2*(1.d0 - phi)**2) + &
122 (phi*dphi_dnl(l))/(m3*(1.d0 - phi)**2) + &
123 (6.d0*m1*m2*phi**2*dphi_dnl(l))/ &
124 (m3**2*(1.d0 - phi)**3) - &
125 (m2**3*(2.d0 - 5.d0*phi + phi**2)*dphi_dnl(l))/ &
126 (m3**3*(1.d0 - phi)**3) - &
127 (3.d0*m2**3*phi*(2.d0 - 5.d0*phi + &
128 phi**2)*dphi_dnl(l))/(m3**3*(1.d0 - phi)**4) - &
129 (m2**3*phi*(-5.d0*dphi_dnl(l) + &
130 2.d0*phi*dphi_dnl(l)))/(m3**3*(1.d0 - phi)**3))
139 dchi0il_dnj(i,l,j) = &
140 (1.5d0*sigmai(i)*sigmai(l)*phi*dm2_dnl(j))/ &
141 (sigma(i,l)*m3*(1.d0 - phi)**2) + &
142 (1.d0*sigmai(i)**2*sigmai(l)**2*m2*phi**2*dm2_dnl(j))/ &
143 (sigma(i,l)**2*m3**2*(1.d0 - phi)**3) - &
144 (1.5d0*sigmai(i)*sigmai(l)*m2*phi*dm3_dnl(j))/ &
145 (sigma(i,l)*m3**2*(1.d0 - phi)**2) - &
146 (1.d0*sigmai(i)**2*sigmai(l)**2*m2**2*phi**2* &
147 dm3_dnl(j))/(sigma(i,l)**2*m3**3*(1.d0 - phi)**3) + &
148 dphi_dnl(j)/(1.d0 - phi)**2 + (1.5d0*sigmai(i)* &
149 sigmai(l)*m2*dphi_dnl(j))/ &
150 (sigma(i,l)*m3*(1.d0 - phi)**2) + (1.d0*sigmai(i)**2* &
151 sigmai(l)**2*m2**2*phi*dphi_dnl(j))/ &
152 (sigma(i,l)**2*m3**2*(1.d0 - phi)**3) + &
153 (3.d0*sigmai(i)*sigmai(l)*m2*phi*dphi_dnl(j))/ &
154 (sigma(i,l)*m3*(1.d0 - phi)**3) + (1.5d0*sigmai(i)**2* &
155 sigmai(l)**2*m2**2*phi**2*dphi_dnl(j))/ &
156 (sigma(i,l)**2*m3**2*(1.d0 - phi)**4)
176 i_ilj(1,2,1) = ( 3.d0/2.d0/pi*(dmuiovert_dnl(1,1)-4.d0*pi/3.d0*chi
225 perturbation = 0.000001d0
229 delta_ni(j) = perturbation*ni(j)
230 delta_phii(j)= perturbation*ni(j)*pi/6.d0*sigmai(j)**3
231 delta_rhoi(j) = perturbation*ni(j)*mi(j)
232 twodeltani = 2d0*delta_ni(j)
234 delta_ni(j) = perturbation
235 delta_phii(j) = perturbation*pi/6.d0*sigmai(j)**3
236 delta_rhoi(j) = perturbation*mi(j)
237 twodeltani = delta_ni(j)
240 ni(j) = ni(j) + delta_ni(j)
242 phii(j) = phii(j)+ delta_phii(j)
243 phi = phi + delta_phii(j)
244 rhoi(j) = rhoi(j) + delta_rhoi(j)
252 call cooling_rate(s,mi,ni,n,m,ti,t,chi,sigmai,alpha,rhoi, &
255 ti_pos(i) = mi(i)*t/(m*theta_pos(i))
258 group1(1,l) = chi(1,l)*ni(l)*mu(l,1)* &
259 sigma(1,l)**2*(1d0+alpha(1,l))
260 group2(1,l) = mu(l,1)/2.d0*(1d0+alpha(1,l))
264 zeta0_pos = zeta0_pos + group1(1,k)* &
265 dsqrt((theta_pos(1)+theta_pos(k)) &
266 /(theta_pos(1)*theta_pos(k))) &
267 * ((1.d0-group2(1,k)*(theta_pos(1)+ &
268 theta_pos(k))/theta_pos(k)))
270 zeta0_pos = 8.d0/3.d0*dsqrt(2.d0*pi*t/m)*zeta0_pos
271 call pressure (s,alpha,ni,n,mu,sigma,chi,t,ti_pos, &
274 niti_pos(i) = ni(i)*ti_pos(i)
277 if(ni(j) /= delta_ni(j))
then 278 ni(j) = ni(j) - 2.d0*delta_ni(j)
279 n = n - 2.d0*delta_ni(j)
280 phii(j) = phii(j) - 2.d0*delta_phii(j)
281 phi = phi - 2.d0*delta_phii(j)
282 rhoi(j) = rhoi(j) - 2.d0*delta_rhoi(j)
284 ni(j) = ni(j) - delta_ni(j)
286 phii(j) = phii(j) - delta_phii(j)
287 phi = phi - delta_phii(j)
288 rhoi(j) = rhoi(j) - delta_rhoi(j)
297 call cooling_rate(s,mi,ni,n,m,ti,t,chi,sigmai,alpha,rhoi, &
300 ti_neg(i) = mi(i)*t/(m*theta_neg(i))
303 group1(1,l) = chi(1,l)*ni(l)*mu(l,1)* &
304 sigma(1,l)**2*(1d0+alpha(1,l))
305 group2(1,l) = mu(l,1)/2.d0*(1d0+alpha(1,l))
309 zeta0_neg = zeta0_neg + group1(1,k)* &
310 dsqrt((theta_neg(1)+theta_neg(k)) &
311 /(theta_neg(1)*theta_neg(k))) &
312 * ((1.d0-group2(1,k)*(theta_neg(1)+ &
313 theta_neg(k))/theta_neg(k)))
315 zeta0_neg = 8.d0/3.d0*dsqrt(2.d0*pi*t/m)*zeta0_neg
316 call pressure (s,alpha,ni,n,mu,sigma,chi,t,ti_neg, &
319 niti_neg(i) = ni(i)*ti_neg(i)
322 dzeta0_dnj(j) = (zeta0_pos - zeta0_neg)/ &
324 dp_dnj(j) = (p_pos - p_neg)/( twodeltani)
326 dtl_dnj(l,j) = (ti_pos(l) - ti_neg(l))/ &
330 dniti_dnj(i,j) = (niti_pos(i) - niti_neg(i))/ &
334 if(ni(j) /= 0d0)
then 335 ni(j) = ni(j) + delta_ni(j)
337 phii(j) = phii(j) + delta_phii(j)
338 phi = phi + delta_phii(j)
339 rhoi(j) = rhoi(j) + delta_rhoi(j)
357 sum1(i,j) = sum1(i,j) + chi(i,l)*sigma(i,l)**3* &
358 mu(l,i)*(1.d0+alpha(i,l)) &
359 *((ti(i)/mi(i)+ti(l)/mi(l))*(kronecker(j,l) &
360 +0.5d0*(ni(l)/chi(i,l)* &
361 dchi0il_dnj(i,l,j)+i_ilj(i,l,j))) &
362 +ni(l)/mi(l)*dtl_dnj(l,j))
369 amat(i,j) = (nu(i,j)-0.5d0*zeta0*kronecker(i,j))* &
371 bmat(i,j) = rho**2/mi(i)/mi(j)*dzeta0_dnj(j)*dt(i) &
372 + rho/mi(i)/mi(j)*dniti_dnj(i,j) &
373 - ni(i)/mi(j)*dp_dnj(j) &
374 + 2.d0*pi/3.d0*rho*ni(i)/mi(j)*sum1(i,j)
384 amat0(i,j) = amat(i,j)
388 bmat0(i) = bmat(i,kk)
391 CALL ludcmp(amat0, s, np, indx, d,
'ordinary_diff')
392 CALL lubksb(amat0, s, np, indx, bmat0)
400 dij(1,1) = -mi(2)/mi(1)*dij(2,1)
401 dij(1,2) = -mi(2)/mi(1)*dij(2,2)
subroutine cooling_rate(s, mi, ni, n, m, Ti, T, chi, sigmai, alpha, rhoi, xve
subroutine ordinary_diff(s, mi, sigmai, alpha, phii, T, phi, ni, n, rhoi, rho, m, mu, sigma, chi, zeta0, theta, Ti, DT, nu, Dij, I_ilj, dTl_dnj, dzeta0_dnj, dchi0il_dnj)
subroutine chi_ij_ghd(s, i, j, sigmai, phi, ni, chi_ij)
subroutine ludcmp(a, n, np, indx, d, calledFrom)
subroutine pressure(s, alpha, ni, n, mu, sigma, chi, T, Ti, p)
subroutine lubksb(a, n, np, indx, b)