Report Typos and Errors    
Semi-Lagrangian Library
Modular library for kinetic and gyrokinetic simulations of plasmas in fusion energy devices.
sll_m_spline_matrix.F90
Go to the documentation of this file.
1 
5 
7 
8 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
9 #include "sll_errors.h"
10 
11  use sll_m_working_precision, only: f64
12 
17 
18  implicit none
19 
20  public :: &
23 
24  private
25 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
26 
28  integer, parameter :: wp = f64
29 
30 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
31 contains
32 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
33 
34  subroutine sll_s_spline_matrix_new(matrix, matrix_type, n, kl, ku)
35  class(sll_c_spline_matrix), allocatable, intent(out) :: matrix
36  character(len=*), intent(in) :: matrix_type
37  integer, intent(in) :: n
38  integer, intent(in) :: kl
39  integer, intent(in) :: ku
40 
41  character(len=*), parameter :: this_sub_name = "sll_s_spline_matrix_new"
42  character(len=256) :: msg
43 
44  ! Allocate correct linear solver type
45  select case (matrix_type)
46 
47  case ("dense")
48  allocate (sll_t_spline_matrix_dense :: matrix)
49 
50  case ("banded")
51  allocate (sll_t_spline_matrix_banded :: matrix)
52 
53  case ("periodic_banded")
54  allocate (sll_t_spline_matrix_periodic_banded :: matrix)
55 
56  case default
57  msg = "Unrecognized matrix type: "//trim(matrix_type)
58  sll_error(this_sub_name, msg)
59 
60  end select
61 
62  ! Initialize matrix (and linear solver)
63  select type (matrix)
64 
66  call matrix%init(n)
67 
69  call matrix%init(n, kl, ku)
70 
72  if (kl /= ku) then
73  msg = "Periodic banded matrix: Schur complement solver requires kl=ku, using their maximum instead."
74  sll_warning(this_sub_name, msg)
75  call matrix%init(n, max(kl, ku), max(kl, ku))
76  else
77  call matrix%init(n, kl, ku)
78  end if
79 
80  end select
81 
82  end subroutine sll_s_spline_matrix_new
83 
84 end module sll_m_spline_matrix
Derived type for banded matrices.
Abstract class for small matrix library with basic operations: set matrix element,...
Derived type for dense matrices.
Derived type for periodic banded matrices.
Access point to matrix class providing factory function.
integer, parameter wp
Working precision.
subroutine, public sll_s_spline_matrix_new(matrix, matrix_type, n, kl, ku)
Module to select the kind parameter.
integer, parameter, public f64
f64 is the kind type for 64-bit reals (double precision)
    Report Typos and Errors