42 INTEGER,
INTENT (INOUT) :: ifail
55 REAL (R8) :: rho(
solver%nrho)
60 REAL (R8) :: dy(
solver%nrho)
65 REAL (R8) :: g(
solver%nrho), h
68 REAL (R8) :: v(2), u(2), w(2)
87 equation_loop1:
DO idim = 1, ndim
89 flag =
solver%EQ_FLAG(idim)
91 IF (flag.EQ.0) goto 20
101 rho_loop1:
DO irho=1,nrho
102 rho(irho) =
solver%RHO(irho)
104 y(irho) =
solver%Y(idim,irho)
105 dy(irho) =
solver%DY(idim,irho)
106 ym(irho) =
solver%YM(idim,irho)
108 a(irho) =
solver%A(idim,irho)
109 b(irho) =
solver%B(idim,irho)
110 c(irho) =
solver%C(idim,irho)
111 d(irho) =
solver%D(idim,irho)
112 e(irho) =
solver%E(idim,irho)
113 f(irho) =
solver%F(idim,irho)
114 g(irho) =
solver%G(idim,irho)
140 (nrho,rho,amix, y,ym,dy, a,b,c,d,e,f,g,h, u,v,w)
144 rho_loop3:
DO irho = 1,nrho
147 solver%Y(idim,irho) = y(irho)
148 solver%DY(idim,irho) = dy(irho)
158 END DO equation_loop1
181 aets,bets,cets,dets,eets,fets,gets,tau,uets,vets,wets)
189 REAL (R8) tau,xi,
p,amix,error,errornew
191 REAL (R8) h(n+1),r(n),z(n),zm(n)
192 REAL (R8) dz(n),dzm(n)
193 REAL (R8) aets(n),bets(n),cets(n)
194 REAL (R8) dets(n),eets(n),gets(n),fets(n),gamets(n)
195 REAL (R8) uets(2),vets(2),wets(2)
196 REAL (R8) cs(n),csn(n)
197 REAL (R8) al(n),be(n),so(n),nu(n),dif(n),vel(n),dfl(n)
198 REAL (R8) om(n),dom(n),s(n),ints(n)
199 REAL (R8) a(n),b(n),f(n),u(2),v(2),w(2)
205 al(i) = aets(i)*cets(i)/r(i)
206 be(i) = bets(i)*cets(i)/r(i)
207 so(i) = fets(i)*cets(i)/r(i)
208 nu(i) = gets(i)*cets(i)/r(i)
209 dif(i) = dets(i)/r(i)
210 vel(i) = eets(i)/r(i)
212 dfl(i) = gamets(i)/r(i)
217 FORALL(i=1:n) cs(i)=0.d0
225 p = (1.d0-xi)*al(i)+tau*nu(i)
226 om(i) = xi*al(i)+(
p+dabs(
p))/2.d0
227 s(i) = so(i)+((
p-dabs(
p))/2.d0*z(i)-(om(i)-be(i))*zm(i))/tau
240 a(i) = 3.d0/r(i)-dom(i)/om(i)-vel(i)/dif(i)
241 b(i) = om(i)/tau/dif(i)+2.d0/r(i)*(3.d0/r(i)-a(i))
242 f(i) = om(i)/r(i)/dif(i)* &
243 (ints(i)/r(i)+dif(i)*dzm(i)-vel(i)*zm(i)-dfl(i))
248 IF(wets(1).NE.0.d0)
THEN
249 write(6,*)
'wrong boundary condition: w_1 is not 0'
253 IF(uets(1).EQ.0.d0)
THEN
259 IF(vets(1).EQ.0.d0)
THEN
260 u(1) = b(2)+2.d0/r(2)**2
261 v(1) = -a(2)-2.d0/r(2)
265 w(2) = vets(2)*f(n)+ &
266 om(n)/r(n)*(wets(2)-uets(2)*zm(n)-vets(2)*dzm(n))
267 v(2) = uets(2)+vets(2)*vel(n)/dif(n)
268 u(2) = vets(2)*om(n)/tau/dif(n)+2.d0/r(n)*v(2)
272 CALL
solut3(n,h,a,b,f,u,v,w,y,d)
276 IF(vets(1).EQ.0.d0) y(1)=0.d0
281 csn(i) = (r(i)*d(i)+2.d0*y(i))/om(i)
282 cs(i) = cs(i)*(1.d0-amix)+csn(i)*amix
292 errornew =dsqrt(dabs(1.d0-csn(i)/cs(i)))
293 IF(cs(i).NE.0.d0.AND.error.LT.errornew) error=errornew
296 IF (error.GT.1.d-5*amix) goto 10
326 REAL (R8) h(n+1),a(n),b(n),f(n),y(n),dy(n),lam(10001,2)
327 REAL (R8) u(2),v(2),w(2)
328 REAL (R8) y0(n),y1(10001,2,2)
329 REAL (R8) et(2,2),mu(2),det
330 REAL (R8) c(n),d(n),g(2),x
335 det = a(i)**2/4.d0+b(i)
338 lam(i,k) = -a(i)/2.d0-(-1)**k*dsqrt(det)
342 y1(i,k,l) = dexp(dmin1(200.d0,(-1)**l*lam(i,k) &
349 c(3) = v(1)/(v(1)-h(3)*u(1))
350 d(3) = h(3)*w(1)/(h(3)*u(1)-v(1))
360 et(k,m) = -(-1)**m*(lam(j,m)-lam(i,k) &
361 -(lam(j,l)-lam(i,k))*y1(j,l,l) &
362 /y1(j,m,l))/(lam(j,1)-lam(j,2))
365 mu(m) = -(-1)**m*(y0(i)-y0(j))/y1(i,l,m) &
366 *(lam(j,m)-lam(j,l)*y1(j,l,l) &
367 /y1(j,m,l))/(lam(j,1)-lam(j,2))
370 det = et(1,2)*et(2,1)-et(1,1)*et(2,2) &
371 *y1(i,l,1)/y1(i,2,1) &
378 g(m) = y1(i+(-1)**m,l,l)/y1(i,l,m)* &
379 (et(m,l)-y1(i,l,l)/y1(i,m,l) &
382 dy(i) = dy(i)+lam(i,m)* &
383 (mu(m)*y1(i,l,l)/y1(i,m,l)* &
384 et(l,l)-mu(l)*et(l,m))/det
385 cdy(i,m) = (et(m,l)*lam(i,l)- &
386 y1(i,l,l)/y1(i,m,l)*et(l,l)*lam(i,m))/det
389 x = (mu(1)*(y1(i,2,2)/y1(i,1,2) &
390 *et(2,2)-et(1,2))+mu(2)*(y1(i,1,1) &
391 /y1(i,2,1)*et(1,1)-et(2,1)))/det- &
392 y0(i-1)*g(1)-y0(i+1)*g(2)+y0(i)
393 c(i+1) = g(2)/(1.d0-g(1)*c(i))
394 d(i+1) = (g(1)*d(i)+x)/(1.d0-g(1)*c(i))
398 y(n) = (h(n-1)*w(2)+v(2)*d(n)) &
399 /(h(n-1)*u(2)+v(2)-v(2)*c(n))
402 y(i-1) = c(i)*y(i)+d(i)
411 dy(i) = dy(i)+(y(j)-y0(j))*y1(j,l,l)/y1(i,l,m)*cdy(i,m)
415 dy(2)=(y(3)-y(3))/h(2)
416 dy(n)=(y(n)-y(n-1))/h(n-1)
446 REAL (R8) x(n), y(n), dy1(n)
447 REAL (R8) h(n), dy2(n)
455 dy1(i) = (y(i+1)-y(i-1))/(x(i+1)-x(i-1))
459 dy1(1) = (y(2)-y(1))/(x(2)-x(1))
460 dy1(n) = (y(n)-y(n-1))/(x(n)-x(n-1))
490 REAL (R8) x(n), y(n), dy1(n)
491 REAL (R8) h(n), dy2(n)
502 dy1(i) = ((y(i+1)-y(i))*h(i-1)/h(i) &
503 +(y(i)-y(i-1))*h(i)/h(i-1))/(h(i)+h(i-1))
504 dy2(i) = 2.d0*((y(i-1)-y(i))/h(i-1) &
505 +(y(i+1)-y(i))/h(i))/(h(i)+h(i-1))
509 dy1(1) = dy1(2)-dy2(2)*h(1)
510 dy1(n) = dy1(n-1)+dy2(n-1)*h(n-1)
542 REAL (R8) h(n), r(n), f(n), int(n)
548 den = h(i-1)*(h(i-1)+h(i))*h(i)
549 a(i) = ((f(i+1)-f(i))*h(i-1)**2-(f(i-1)-f(i))*h(i)**2)/den
550 b(i) = ((f(i+1)-f(i))*h(i-1)+(f(i-1)-f(i))*h(i))/den
556 int(2) = f(2)*r(2)**2/2.d0-a(2)*r(2)**3/6.d0+b(2)*r(2)**4/12.d0
560 int(i+1) = int(i)+(r(i)*f(i)+r(i+1)*f(i+1))*h(i)/2.d0+ &
561 (f(i)+r(i)*a(i)-f(i+1)-r(i+1)*a(i+1))*h(i)**2/8.d0+ &
562 (a(i)+r(i)*b(i)+a(i+1)+r(i+1)*b(i+1))*h(i)**3/24.d0+ &
563 (b(i)-b(i+1))*h(i)**4/64.d0
567 int(n) = int(n-1)+(f(n-1)-a(n-1)*r(n-1)+b(n-1)*r(n-1)**2)* &
568 (r(n)**2-r(n-1)**2)/2.d0+(a(n-1)-2.d0*b(n-1)*r(n-1))* &
569 (r(n)**3-r(n-1)**3)/3.d0+b(n-1)*(r(n)**4-r(n-1)**4)/4.d0
599 REAL (R8) h(n), r(n), f(n)
601 f(1) = ((f(2)*r(4)/h(2)+f(4)*r(2)/h(3))*r(3) &
602 -f(3)*(r(2)/h(2)+r(4)/h(3))*r(2)*r(4)/r(3)) &
subroutine derivn21(N, X, Y, DY1)
subroutine solut3(n, h, a, b, f, u, v, w, y, dy)
subroutine axis(n, h, r, f)
real(r8) function p(a, x, xr, xs, yr, ys, psi, psir, F_dia)
subroutine solver_ritm_integral(n, r, amix, z, zm, dz, aets, bets, cets, dets, eets, fets, gets, tau, uets, vets, wets)
subroutine derivn2(N, X, Y, DY1)
subroutine integral(n, h, r, f, int)
subroutine solution2(SOLVER, ifail)
NUMERICAL SOLUTION.