46 integer ,
intent(in) :: SL_meth, NL_meth
48 integer :: nV, nY, nFY, nFY2
61 & SL_meth, NL_meth, out, check_overflow, Kinv, kry)
64 real(RP) ,
intent(in) :: t0, T, dt
65 integer ,
intent(in) :: SL_meth, NL_meth
67 logical ,
intent(in) :: check_overflow
68 procedure(linsystem_solver),
optional :: Kinv
69 type(
krylov) ,
optional :: kry
71 procedure(ode_nl_ms_solver),
pointer :: slv_NL
72 procedure(ode_lin_solver) ,
pointer :: slv_SL
73 procedure(linsystem_solver),
pointer :: KInv_1
76 real(DP) :: t_NL, t_SL, t_out, t_reac, cpu, t_tot
77 integer :: nS, ii, jj, N, Na, P, n0, n0_F, n0_V
78 logical :: exit_comp, ierr
81 &
"ode_SL_NL_ms_mod: solve" 83 &
" SemiLin multistep solver = ",&
86 &
" NonLin multistep solver = ",&
89 &
" K_inv provided =",&
91 if (.NOT.
present(kinv))
then 93 &
" Krylov settings provided = ",&
103 if (
present(kinv))
then 107 if (
present(kry)) kry_1 = kry
135 ns = int( (t-t0) / dt)
142 tn = t0 +
re(jj-1)*dt
146 call out(tn, sol, exit_comp)
149 &
"ode_SL_NL_ms_mod: solve& 150 & time = ", tn,
': EXIT_COMPp' 153 t_out = t_out +
clock() - cpu
157 call slv_nl(sol, dt, n, p)
158 t_nl = t_nl +
clock() - cpu
162 call slv_sl(sol, ierr, dt, pb, kinv_1)
163 t_sl = t_sl +
clock() - cpu
170 &
"ode_SL_NL_ms_mod: solve,& 171 & time = ", tn,
': lin pb inv error' 178 associate( y=>sol%Y, by=>sol%BY, ay=>sol%AY, &
197 y(n, n0, ii) = v(ii, n0_v)
199 call pb%AB( ay(:, n0_f, ii), by(:, n0_f, ii), &
200 & x(:,ii), tn+dt, y(:, n0, ii), n, na )
208 y(n, n0, ii) = v(ii, n0_v)
210 call pb%AB( ay(:, n0_f, ii), by(:, n0_f, ii), &
211 & x(:,ii), tn+dt, y(:, n0, ii), n, na )
213 by(n, n0_f, ii) = by(n, n0_f, ii) &
214 & + ay(n, n0_f, ii)*v(ii, n0_v)
222 if (check_overflow)
then 227 &
"ode_NL_ms_mod : solve,& 228 & time = ", tn,
': OVERFLOW Y' 236 &
"ode_NL_ms_mod : solve,& 237 & time = ", tn,
': OVERFLOW BY' 245 &
"ode_NL_ms_mod : solve,& 246 & time = ", tn,
': OVERFLOW AY' 252 t_reac = t_reac +
clock() - cpu
257 write(*,*)
"ode_SL_NL_ms_mod: solve, end = timing" 258 write(*,*)
" Non Lin. system integration =", &
260 write(*,*)
" Semilin. eq. integration =", &
262 write(*,*)
" Reaction term evaluation =", &
264 write(*,*)
" Output =", &
266 t_tot =
clock() - t_tot
267 write(*,*)
" Total CPU =", &
277 real(RP),
dimension(:),
intent(inout) :: x
278 logical ,
intent(out) :: bool
279 real(RP),
dimension(:),
intent(in) :: b
289 real(RP),
dimension(:),
intent(out) :: y
290 real(RP),
dimension(:),
intent(in) :: x
293 call pb%S(sol%aux, x)
MULTISTEP SOLVERS FOR A SEMILINEAR ODE coupled with a non-linear ODE system
Type ode_solution: data structure to solve ODE/PDE problems.
subroutine k_default(y, x)
DERIVED TYPE ode_problem: definition of ODE/PDE problems
subroutine, public create_ode_sl_nl_ms_sol(sol, pb, SL_meth, NL_meth)
Create the solution data structure.
real(rp) function, public s_prefactor(method, dt)
When discretising with two matrices, this function returns the prefactor Cs for the matrix S...
The type krylov defines the settings of a linear solver.
subroutine, public set_solver_ode_sl_ms(slv, method)
set the resolution solver
integer, parameter, public sp
simple precision for real numbers
logical function, public overflow(yy)
Detects overflow.
character(len=15) function, public name_ode_method(method)
Get ODE method name.
conversion integers or rational to real
subroutine, public solve_ode_sl_nl_ms(sol, pb, t0, T, dt, SL_meth, NL_meth, out, check_overflow, Kinv, kry)
solve : multistep with constant time step
REAL NUMBERS PRECISION IN CHORAL: selects simple/double/quad
OPENMP OPERATIONS ON 1-DIMENSIONAL REAL ARRAYS
subroutine, public ode_solution_init_indexes(sol)
initialise the ode_indexes
subroutine, public memsize_ode_sl_ms(n_V, n_FY, method)
required sizes to allocate memory
DERIVED TYPE ode_solution: data straucture to solve ODEs
subroutine kinv_default(x, bool, b)
Default solver for K*x = b.
subroutine, public memsize_ode_nl_ms(n_Y, n_FY, method)
required sizes to allocate memory
ALGEBRAIC OPERATIONS ON SETS
BOTTOM LEVEL MODULE FOR ODEs
integer choral_verb
Verbosity level.
x = x + b*y // OR // z = x + b*y
subroutine, public circperm(E)
Circular permutation of an array of integer.
MULTISTEP SOLVERS FOR SEMILINEAR ODEs
DEFINITION OF GLOBAL VARIABLES FOR THE LIBRARY CHORAL
subroutine, public set_solver_ode_nl_ms(slv, method)
set the resolution solver
MULTISTEP SOLVERS FOR NON LINEAR ODEs
Type ode_problem: definition of ODE/PDE problems.
DERIVED TYPE krylov: for the resolution of linear systems