34 USE roots,
ONLY: getroot
50 SUBROUTINE riemann(x0,gamma_,rho_l_,u_l_,p_l_,rho_r_,u_r_,p_r_,t,x,pvar)
53 REAL :: gamma_,t,x0,rho_l_,u_l_,p_l_,rho_r_,u_r_,p_r_
54 REAL,
DIMENSION(:) :: x
55 REAL,
DIMENSION(:,:) :: pvar
58 Real :: rho_lstar, rho_rstar, p_star, u_star, &
60 s_l, s_hl, s_tl, s_r, s_hr, s_tr
87 CALL getroot(
f, 0., 2.e+3, p_star,
error)
93 IF (p_star >
p_l)
THEN 102 IF (p_star >
p_r)
THEN 123 s_tl = u_star - c_lstar
124 s_tr = u_star + c_rstar
127 CALL sample(x(i),pvar(i,1),pvar(i,2),pvar(i,3))
131 SUBROUTINE sample(x,rho,u,p)
139 INTENT(OUT) :: rho, u, p
144 IF (s <= u_star)
THEN 146 IF (p_star >
p_l)
THEN 166 ELSE IF (s > s_tl)
THEN 174 *(
u_l - (x-x0)/t) ) ** (2.0/(
gamma-1.0))
182 IF (p_star >
p_r)
THEN 199 ELSE IF (s < s_tr)
THEN 205 * (
u_r - (x-x0)/t) ) ** (2.0/(
gamma-1.0))
215 SUBROUTINE sedov(gamma_, E0_, rho0_, P1_, time, dim, x, pvar)
218 REAL,
INTENT(IN) :: gamma_, e0_, rho0_, p1_, time
219 INTEGER,
INTENT(IN) :: dim
220 REAL,
DIMENSION(:),
INTENT(IN) :: x
221 REAL,
DIMENSION(:,:),
INTENT(INOUT) :: pvar
223 REAL,
PARAMETER :: eps = 1.0d-09
224 INTEGER,
PARAMETER :: maxit = 1.0d+08
298 pvar(i,3) = pvar(i,1)/
gamma*
zxi*(2.*
r/((2.+dim)*time))**2
307 REAL,
INTENT(IN) :: x1,x2,
xacc 311 SUBROUTINE funcd(x,fx,dfx)
313 REAL,
INTENT(IN) :: x
314 REAL,
INTENT(OUT) :: fx,dfx
318 REAL :: fm,dfm,fl,dfl,fr,dfr
325 CALL funcd(xl,fl,dfl)
326 CALL funcd(xr,fr,dfr)
328 IF (fl*fr.GT.0.0)
THEN 329 WRITE (*,*) xl, xr,fl, fr,
gamma,
"Error: f(x1)*f(x2) should be < 0, aborting!" 336 dx = fl*(xl-xr)/(fl-fr)
339 CALL funcd(xm,fm,dfm)
341 IF (abs(fm).LT.
xacc)
THEN 344 IF (fm*fl.GT.0.0)
THEN 353 WRITE (*,*)
"WARNING: limit of iterations exceeded!" 362 PURE SUBROUTINE f(p,fx,plist)
365 REAL,
INTENT(IN) :: p
366 REAL,
INTENT(OUT) :: fx
367 REAL,
INTENT(IN),
DIMENSION(:),
OPTIONAL :: plist
375 REAL PURE FUNCTION f_x(p, rho_x, u_x, p_x, A_x, B_x, c_x)
378 REAL,
INTENT(IN) :: p, rho_x, u_x, p_x, a_x, b_x, c_x
381 f_x = (p-p_x) * sqrt(a_x/(p+b_x))
390 REAL,
INTENT(IN) :: y
391 REAL,
INTENT(OUT) :: fy,dfy
393 REAL :: Ay,dAy,By,dBy,Cy,dCy
402 fy = ay**2 * by**
n1 * cy**
n2 -
xi**4
403 dfy= day*by*cy + ay*dby*cy + ay*by*dcy
414 REAL,
INTENT(IN) :: y
415 REAL,
INTENT(OUT) :: fy,dfy
417 REAL :: Ay,dAy,By,dBy,Cy,dCy
426 IF (abs(
gamma*y-1.).LT.1.0d-20)
THEN 429 fy = ay**2 * by**
n1 * cy**
n2 -
xi**5
431 fy = ay**2 * by**
n1 * cy**
n2 -
xi**5
432 dfy= day*by*cy + ay*dby*cy + ay*by*dcy
subroutine error(this, modproc, msg, rank, node_info)
Print error message on standard error and terminate the program.
pure subroutine funcd(y, fy, dfy, plist)
subroutine, public sedov(gamma_, E0_, rho0_, P1_, time, dim, x, pvar)
subroutine sample(x, rho, u, p)
subroutine funcd2d(y, fy, dfy)
real pure function f_x(p, rho_x, u_x, p_x, A_x, B_x, c_x)
pure subroutine f(p, fx, plist)
subroutine, public riemann(x0, gamma_, rho_l_, u_l_, p_l_, rho_r_, u_r_, p_r_, t, x, pvar)
real function getroot_test(funcd, x1, x2, xacc)
subroutine funcd3d(y, fy, dfy)