37 integer,
intent(in) :: method
60 integer,
intent(out) :: n_FY, n_Y
61 integer,
intent(in) :: method
71 call quit(
"ode_NL_1s_mod: memSize_ode_NL_1s: uncorrect method")
82 integer ,
intent(in) :: method
83 procedure(ode_nl_1s_solver),
pointer :: slv
104 call quit(
"ode_NL_1s_mod: set_solver_ode_NL_1s;& 116 integer ,
intent(in) :: method
122 if (.NOT.bool)
call quit(&
123 &
"ode_NL_1s_mod: create_ode_NL_1s_sol: uncorrect method")
135 & out, check_overflow)
138 real(RP) ,
intent(in) :: t0, T, dt
139 integer ,
intent(in) :: method
141 logical ,
intent(in) :: check_overflow
143 procedure(ode_nl_1s_solver),
pointer :: slv=>null()
150 &
"ode_NL_1s_mod : solve_ode_NL_1s" 152 &
" NonLin onestep solver = ",&
157 ns = int( (t-t0) / dt)
162 tn = t0 +
re(jj-1)*dt
165 call out(tn, sol, exit_comp)
168 &
"ode_NL_1s_mod : solve& 169 & time = ", tn,
': EXIT_COMPp' 173 call slv(sol, dt, tn, pb)
175 if (check_overflow)
then 180 &
"ode_NL_1s_mod : solve,& 181 & time = ", tn,
': OVERFLOW' 202 real(RP) ,
intent(in) :: dt, t
205 real(RP),
dimension(pb%N) :: BY
206 real(RP),
dimension(pb%Na) :: AY
217 & pb%X(:,ii), t, sol%Y(:,1,ii), n, na)
219 sol%Y(:,1,ii) = sol%Y(:,1,ii) + dt*by
221 sol%Y(1:na,1,ii) = sol%Y(1:na,1,ii) / &
234 real(RP) ,
intent(in) :: dt, t
237 real(RP),
dimension(pb%N) :: K, Y
238 real(RP),
dimension(pb%Na) :: AY
254 call pb%AB(ay, k, pb%X(:,ii), t, y, n, na)
255 k(1:na) = k(1:na) + ay*y(1:na)
257 y = sol%Y(:,1,ii) + h2*k
258 call pb%AB(ay, k, pb%X(:,ii), tph2, y, n, na)
259 k(1:na) = k(1:na) + ay*y(1:na)
261 sol%Y(:,1,ii) = sol%Y(:,1,ii) + dt * k
274 elemental subroutine phi_1(z)
275 real(RP),
intent(inout) :: z
278 z = (exp(z) - 1._rp)/z
288 elemental subroutine phi_2(z)
289 real(RP),
intent(inout) :: z
296 z = (exp(z) - z - 1._rp)/z2
310 real(RP) ,
intent(in) :: dt, t
313 real(RP),
dimension(pb%N) :: y, b
314 real(RP),
dimension(pb%Na) :: a
325 call pb%AB(a, b, pb%X(:,ii), t, y, n, na)
326 b(1:na) = b(1:na) + a*y(1:na)
327 sol%Y(:,1,ii) = y + dt*b
339 real(RP) ,
intent(in) :: dt, t
342 real(RP),
dimension(pb%N) :: y, b
343 real(RP),
dimension(pb%Na) :: a
355 & pb%X(:,ii), t, y, n, na)
357 b(1:na) = b(1:na) + a*y(1:na)
361 b(1:na) = a * b(1:na)
381 real(RP) ,
intent(in) :: dt, t
384 real(RP),
dimension(pb%N) :: y, y2, G1, G2
385 real(RP),
dimension(pb%Na) :: A, phi
389 real(RP),
parameter :: C2 = 0.5_rp
391 real(RP),
parameter :: S2 = 1._rp / c2
407 call pb%AB(a, g1, pb%X(:,ii), t, y, n, na)
411 g1(1:na) = g1(1:na) + a*y(1:na)
418 y2(1:na) = phi * y2(1:na)
424 call pb%AB(phi, g2, pb%X(:,ii), t2, y2, n, na)
429 g2(1:na) = g2(1:na) + phi * y2(1:na)
433 g2(1:na) = g2(1:na) + a * y(1:na)
451 g1(1:na) = phi * g1(1:na)
454 g2(1:na) = a * g2(1:na)
456 sol%Y(:,1,ii) = y + dt * (g1 + g2)
473 real(RP) ,
intent(in) :: dt, t
476 real(RP),
dimension(pb%N) :: y, y2, G1, G2
477 real(RP),
dimension(pb%Na) :: A, phi
481 real(RP),
parameter :: C2 = 0.5_rp
483 real(RP),
parameter :: S2 = 1._rp / (2._rp * c2)
484 real(RP),
parameter :: S1 = 1._rp - s2
501 call pb%AB(a, g1, pb%X(:,ii), t, y, n, na)
505 g1(1:na) = g1(1:na) + a*y(1:na)
512 y2(1:na) = phi * y2(1:na)
518 call pb%AB(phi, g2, pb%X(:,ii), t2, y2, n, na)
523 g2(1:na) = g2(1:na) + phi * y2(1:na)
527 g2(1:na) = g2(1:na) + a * y(1:na)
534 g1(1:na) = phi * g1(1:na)
535 g2(1:na) = phi * g2(1:na)
538 sol%Y(:,1,ii) = sol%Y(:,1,ii) + dt*g1
553 real(RP) ,
intent(in) :: dt, t
556 real(RP),
dimension(pb%N) :: y, b, y2
557 real(RP),
dimension(pb%Na) :: a
573 call pb%AB(a, b, pb%X(:,ii), t, y, n, na)
577 b(1:na) = b(1:na) + a*y(1:na)
580 b(1:na) = a * b(1:na)
585 call pb%AB(a, b, pb%X(:,ii), t2, y2, n, na)
589 b(1:na) = b(1:na) + a*y(1:na)
592 b(1:na) = a * b(1:na)
594 sol%Y(:,1,ii) = sol%Y(:,1,ii) + dt*b
608 real(RP) ,
intent(in) :: dt, t
611 real(RP),
dimension(pb%N) :: y1, G1, y2, G2
612 real(RP),
dimension(pb%Na) :: a1, a2, phi1, phi2
628 call pb%AB(a1, g1, pb%X(:,ii), t, y1, n, na)
633 y2(1:na) = y2(1:na) + a1*y1(1:na)
636 y2(1:na) = phi1 * y2(1:na)
641 call pb%AB(a2, g2, pb%X(:,ii), t2, y2, n, na)
645 g1(1:na) = g1(1:na) + a1*y1(1:na)
651 phi1 = phi1 - 2._rp*phi2
652 g1(1:na) = g1(1:na) * phi1
654 g2(1:na) = g2(1:na) + a2*y1(1:na)
658 g2(1:na) = g2(1:na) * phi2
661 sol%Y(:,1,ii) = y1 + dt*g1
676 real(RP) ,
intent(in) :: dt, t
679 real(RP),
dimension(pb%N) :: K1, K2, K3, K4, Y
680 real(RP),
dimension(pb%Na) :: AY
681 real(RP) :: h6, h3, h2, tph, tph2
699 call pb%AB(ay, k1, pb%X(:,ii), t, y, n, na)
700 k1(1:na) = k1(1:na) + ay*y(1:na)
702 y = sol%Y(:,1,ii) + h2*k1
703 call pb%AB(ay, k2, pb%X(:,ii), tph2, y, n, na)
704 k2(1:na) = k2(1:na) + ay*y(1:na)
706 y = sol%Y(:,1,ii) + h2*k2
707 call pb%AB(ay, k3, pb%X(:,ii), tph2, y, n, na)
708 k3(1:na) = k3(1:na) + ay*y(1:na)
710 y = sol%Y(:,1,ii) + dt*k3
711 call pb%AB(ay, k4, pb%X(:,ii), tph, y, n, na)
712 k4(1:na) = k4(1:na) + ay*y(1:na)
714 y = k1*h6 + k2*h3 + k3*h3 + k4*h6
715 sol%Y(:,1,ii) = sol%Y(:,1,ii) + y
Type ode_solution: data structure to solve ODE/PDE problems.
DERIVED TYPE ode_problem: definition of ODE/PDE problems
integer, parameter ode_rk4
RK4.
integer, parameter ode_erk2_b
Exp. RK2, type b.
subroutine, public set_solver_ode_nl_1s(slv, method)
set the solver 'slv' to a predefined solver being given a method
integer, parameter ode_modif_erk2_b
modified ERK2_B
subroutine nl_1s_erk1(sol, dt, t, pb)
Exponential Euler.
logical function, public overflow(yy)
Detects overflow.
character(len=15) function, public name_ode_method(method)
Get ODE method name.
subroutine nl_1s_modif_erk2_a(sol, dt, t, pb)
Modified ERK2_A.
conversion integers or rational to real
REAL NUMBERS PRECISION IN CHORAL: selects simple/double/quad
subroutine nl_1s_erk2_b(sol, dt, t, pb)
Exponential RK2, type B ref = "Explicit Exponential Runge-Kutta Methods for Semilinear Parabo...
logical function, public check_ode_method_nl_1s(method)
is 'method' a one-step non-linear ODE solver ?
subroutine nl_1s_fe(sol, dt, t, pb)
Forward Euler.
integer, parameter ode_erk2_a
Exp. RK2, type a.
integer, parameter ode_fbe
Forward / backward Euler.
DERIVED TYPE ode_solution: data straucture to solve ODEs
subroutine, public solve_ode_nl_1s(sol, pb, t0, T, dt, method, out, check_overflow)
solve with constant time-step
elemental subroutine phi_1(z)
phi_1 = ( exp(z) - 1 ) / z
elemental subroutine phi_2(z)
phi_2 = (exp(z) - z - 1._RP)/z^2
integer, parameter ode_erk1
Exponential Euler.
subroutine nl_1s_modif_erk2_b(sol, dt, t, pb)
Modified ERK2_B.
BOTTOM LEVEL MODULE FOR ODEs
subroutine, public memsize_ode_nl_1s(n_Y, n_FY, method)
required sizes to allocate memory
integer choral_verb
Verbosity level.
subroutine, public create_ode_nl_1s_sol(sol, pb, method)
create memory for the ode_solution structure 'sol'
subroutine nl_1s_rk2(sol, dt, t, pb)
RK2.
ONE-STEP SOLVERS FOR NON LINEAR ODEs
real(rp), parameter, public real_tol
subroutine nl_1s_fbe(sol, dt, t, pb)
FORWARD/BacWard Euler.
subroutine nl_1s_erk2_a(sol, dt, t, pb)
Exponential RK2, type A ref = "Explicit Exponential Runge-Kutta Methods for Semilinear Parabo...
DEFINITION OF GLOBAL VARIABLES FOR THE LIBRARY CHORAL
subroutine nl_1s_rk4(sol, dt, t, pb)
RK4.
integer, parameter ode_rk2
RK2.
integer, parameter ode_fe
Forward Euler.
Type ode_problem: definition of ODE/PDE problems.