sll_m_spline_matrix.f90 Source File


This file depends on

sourcefile~~sll_m_spline_matrix.f90~~EfferentGraph sourcefile~sll_m_spline_matrix.f90 sll_m_spline_matrix.f90 sourcefile~sll_m_spline_matrix_banded.f90 sll_m_spline_matrix_banded.f90 sourcefile~sll_m_spline_matrix.f90->sourcefile~sll_m_spline_matrix_banded.f90 sourcefile~sll_m_spline_matrix_base.f90 sll_m_spline_matrix_base.f90 sourcefile~sll_m_spline_matrix.f90->sourcefile~sll_m_spline_matrix_base.f90 sourcefile~sll_m_spline_matrix_dense.f90 sll_m_spline_matrix_dense.f90 sourcefile~sll_m_spline_matrix.f90->sourcefile~sll_m_spline_matrix_dense.f90 sourcefile~sll_m_working_precision.f90 sll_m_working_precision.f90 sourcefile~sll_m_spline_matrix.f90->sourcefile~sll_m_working_precision.f90 sourcefile~sll_m_spline_matrix_banded.f90->sourcefile~sll_m_spline_matrix_base.f90 sourcefile~sll_m_spline_matrix_banded.f90->sourcefile~sll_m_working_precision.f90 sourcefile~sll_m_spline_matrix_base.f90->sourcefile~sll_m_working_precision.f90 sourcefile~sll_m_spline_matrix_dense.f90->sourcefile~sll_m_spline_matrix_base.f90 sourcefile~sll_m_spline_matrix_dense.f90->sourcefile~sll_m_working_precision.f90

Files dependent on this one

sourcefile~~sll_m_spline_matrix.f90~~AfferentGraph sourcefile~sll_m_spline_matrix.f90 sll_m_spline_matrix.f90 sourcefile~cubic_spline.f90 cubic_spline.f90 sourcefile~cubic_spline.f90->sourcefile~sll_m_spline_matrix.f90 sourcefile~mhd3d_evalfunc.f90 mhd3d_evalfunc.f90 sourcefile~mhd3d_evalfunc.f90->sourcefile~sll_m_spline_matrix.f90 sourcefile~base.f90 base.f90 sourcefile~mhd3d_evalfunc.f90->sourcefile~base.f90 sourcefile~mhd3d_vars.f90 mhd3d_vars.f90 sourcefile~mhd3d_evalfunc.f90->sourcefile~mhd3d_vars.f90 sourcefile~sbase.f90 sbase.f90 sourcefile~sbase.f90->sourcefile~sll_m_spline_matrix.f90 sourcefile~sll_m_spline_interpolator_1d.f90 sll_m_spline_interpolator_1d.f90 sourcefile~sbase.f90->sourcefile~sll_m_spline_interpolator_1d.f90 sourcefile~sll_m_spline_interpolator_1d.f90->sourcefile~sll_m_spline_matrix.f90 sourcefile~analyze.f90 analyze.f90 sourcefile~analyze.f90->sourcefile~cubic_spline.f90 sourcefile~vmec.f90 vmec.f90 sourcefile~analyze.f90->sourcefile~vmec.f90 sourcefile~vmec_vars.f90 vmec_vars.f90 sourcefile~analyze.f90->sourcefile~vmec_vars.f90 sourcefile~analyze.f90->sourcefile~mhd3d_vars.f90 sourcefile~base.f90->sourcefile~sbase.f90 sourcefile~gvec_post.f90 gvec_post.f90 sourcefile~gvec_post.f90->sourcefile~mhd3d_evalfunc.f90 sourcefile~gvec_post.f90->sourcefile~analyze.f90 sourcefile~readstate_vars.f90 readstate_vars.f90 sourcefile~gvec_post.f90->sourcefile~readstate_vars.f90 sourcefile~restart.f90 restart.f90 sourcefile~gvec_post.f90->sourcefile~restart.f90 sourcefile~functional.f90 functional.f90 sourcefile~gvec_post.f90->sourcefile~functional.f90 sourcefile~gvec_post.f90->sourcefile~mhd3d_vars.f90 sourcefile~mhd3d.f90 mhd3d.f90 sourcefile~mhd3d.f90->sourcefile~cubic_spline.f90 sourcefile~mhd3d.f90->sourcefile~mhd3d_evalfunc.f90 sourcefile~mhd3d.f90->sourcefile~analyze.f90 sourcefile~mhd3d.f90->sourcefile~base.f90 sourcefile~mhd3d.f90->sourcefile~restart.f90 sourcefile~mhd3d.f90->sourcefile~vmec.f90 sourcefile~mhd3d.f90->sourcefile~vmec_vars.f90 sourcefile~lambda_solve.f90 lambda_solve.f90 sourcefile~mhd3d.f90->sourcefile~lambda_solve.f90 sourcefile~mhd3d.f90->sourcefile~mhd3d_vars.f90 sourcefile~readstate.f90 readstate.f90 sourcefile~readstate.f90->sourcefile~sbase.f90 sourcefile~readstate.f90->sourcefile~base.f90 sourcefile~readstate.f90->sourcefile~readstate_vars.f90 sourcefile~readstate_vars.f90->sourcefile~sbase.f90 sourcefile~readstate_vars.f90->sourcefile~base.f90 sourcefile~restart.f90->sourcefile~mhd3d_evalfunc.f90 sourcefile~restart.f90->sourcefile~base.f90 sourcefile~restart.f90->sourcefile~readstate.f90 sourcefile~restart.f90->sourcefile~readstate_vars.f90 sourcefile~restart.f90->sourcefile~mhd3d_vars.f90 sourcefile~vmec.f90->sourcefile~cubic_spline.f90 sourcefile~vmec.f90->sourcefile~vmec_vars.f90 sourcefile~vmec_vars.f90->sourcefile~cubic_spline.f90 sourcefile~functional.f90->sourcefile~mhd3d.f90 sourcefile~gvec_to_jorek.f90 gvec_to_jorek.f90 sourcefile~gvec_to_jorek.f90->sourcefile~base.f90 sourcefile~gvec_to_jorek.f90->sourcefile~readstate.f90 sourcefile~gvec_to_jorek.f90->sourcefile~readstate_vars.f90 sourcefile~gvec_to_jorek_vars.f90 gvec_to_jorek_vars.f90 sourcefile~gvec_to_jorek.f90->sourcefile~gvec_to_jorek_vars.f90 sourcefile~gvec_to_jorek_vars.f90->sourcefile~base.f90 sourcefile~lambda_solve.f90->sourcefile~base.f90 sourcefile~mhd3d_vars.f90->sourcefile~base.f90 sourcefile~rungvec.f90 rungvec.f90 sourcefile~rungvec.f90->sourcefile~analyze.f90 sourcefile~rungvec.f90->sourcefile~restart.f90 sourcefile~rungvec.f90->sourcefile~functional.f90 sourcefile~rungvec.f90->sourcefile~mhd3d_vars.f90 sourcefile~sfl_boozer.f90 sfl_boozer.f90 sourcefile~sfl_boozer.f90->sourcefile~base.f90 sourcefile~sfl_boozer.f90->sourcefile~lambda_solve.f90 sourcefile~state.f90 state.f90 sourcefile~state.f90->sourcefile~analyze.f90 sourcefile~state.f90->sourcefile~base.f90 sourcefile~state.f90->sourcefile~readstate_vars.f90 sourcefile~state.f90->sourcefile~restart.f90 sourcefile~state.f90->sourcefile~functional.f90 sourcefile~state.f90->sourcefile~mhd3d_vars.f90 sourcefile~state.f90->sourcefile~sfl_boozer.f90 sourcefile~transform_sfl.f90 transform_sfl.f90 sourcefile~transform_sfl.f90->sourcefile~base.f90 sourcefile~transform_sfl.f90->sourcefile~sfl_boozer.f90 sourcefile~convert_gvec_to_jorek.f90 convert_gvec_to_jorek.f90 sourcefile~convert_gvec_to_jorek.f90->sourcefile~gvec_to_jorek.f90 sourcefile~gvec.f90 gvec.f90 sourcefile~gvec.f90->sourcefile~rungvec.f90 sourcefile~gvec_to_castor3d_vars.f90 gvec_to_castor3d_vars.f90 sourcefile~gvec_to_castor3d_vars.f90->sourcefile~transform_sfl.f90 sourcefile~gvec_to_gene_vars.f90 gvec_to_gene_vars.f90 sourcefile~gvec_to_gene_vars.f90->sourcefile~transform_sfl.f90 sourcefile~gvec_to_hopr_vars.f90 gvec_to_hopr_vars.f90 sourcefile~gvec_to_hopr_vars.f90->sourcefile~transform_sfl.f90 sourcefile~run.f90 run.f90 sourcefile~run.f90->sourcefile~rungvec.f90

Source Code

! Copyright (c) INRIA
! License: CECILL-B
!
!> @ingroup splines
!> @brief   Access point to matrix class providing factory function
!> @author  Yaman Güçlü  - IPP Garching
!> @author  Edoardo Zoni - IPP Garching

module sll_m_spline_matrix

!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#include "sll_errors.h"

  use sll_m_working_precision, only: f64

  use sll_m_spline_matrix_base           , only: sll_c_spline_matrix
  use sll_m_spline_matrix_dense          , only: sll_t_spline_matrix_dense
  use sll_m_spline_matrix_banded         , only: sll_t_spline_matrix_banded
!  use sll_m_spline_matrix_periodic_banded, only: sll_t_spline_matrix_periodic_banded

  implicit none

  public :: &
    sll_c_spline_matrix, &
    sll_s_spline_matrix_new

  private
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

  !> Working precision
  integer, parameter :: wp = f64

!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
contains
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

  subroutine sll_s_spline_matrix_new( matrix, matrix_type, n, kl, ku )
    class( sll_c_spline_matrix ), allocatable, intent(  out) :: matrix
    character(len=*)                         , intent(in   ) :: matrix_type
    integer                                  , intent(in   ) :: n
    integer                                  , intent(in   ) :: kl
    integer                                  , intent(in   ) :: ku

    character(len=*), parameter :: this_sub_name = "sll_s_spline_matrix_new"
    character(len=256) :: msg

    ! Allocate correct linear solver type
    select case ( matrix_type )

    case ( "dense" )
      allocate( sll_t_spline_matrix_dense  :: matrix )

    case ( "banded" )
      allocate( sll_t_spline_matrix_banded :: matrix )

!    case ( "periodic_banded" )
!      allocate( sll_t_spline_matrix_periodic_banded :: matrix )

    case default
      msg = "Unrecognized matrix type: " // trim( matrix_type )
      SLL_ERROR( this_sub_name, msg )

    end select

    ! Initialize matrix (and linear solver)
    select type ( matrix )

    type is ( sll_t_spline_matrix_dense )
      call matrix % init( n )

    type is ( sll_t_spline_matrix_banded )
      call matrix % init( n, kl, ku )

!    type is ( sll_t_spline_matrix_periodic_banded )
!      if (kl /= ku) then
!        msg = "Periodic banded matrix: Schur complement solver requires kl=ku, using their maximum instead."
!        SLL_WARNING( this_sub_name, msg )
!        call matrix % init( n, max(kl,ku), max(kl,ku) )
!      else
!        call matrix % init( n, kl, ku )
!      end if

    end select

  end subroutine sll_s_spline_matrix_new

end module sll_m_spline_matrix