module_all_integrators.f90 Source File


This file depends on

sourcefile~~module_all_integrators.f90~~EfferentGraph sourcefile~module_all_integrators.f90 module_all_integrators.f90 sourcefile~module_abmv5.f90 module_abmv5.f90 sourcefile~module_all_integrators.f90->sourcefile~module_abmv5.f90 sourcefile~module_rk5.f90 module_rk5.f90 sourcefile~module_all_integrators.f90->sourcefile~module_rk5.f90 sourcefile~module_rk4.f90 module_rk4.f90 sourcefile~module_all_integrators.f90->sourcefile~module_rk4.f90 sourcefile~module_parameters.f90 module_parameters.f90 sourcefile~module_all_integrators.f90->sourcefile~module_parameters.f90 sourcefile~module_kinds.f90 module_kinds.f90 sourcefile~module_abmv5.f90->sourcefile~module_kinds.f90 sourcefile~module_mol.f90 module_mol.f90 sourcefile~module_abmv5.f90->sourcefile~module_mol.f90 sourcefile~module_rk5.f90->sourcefile~module_kinds.f90 sourcefile~module_rk5.f90->sourcefile~module_mol.f90 sourcefile~module_rk4.f90->sourcefile~module_kinds.f90 sourcefile~module_rk4.f90->sourcefile~module_mol.f90 sourcefile~module_parameters.f90->sourcefile~module_kinds.f90 sourcefile~module_mol.f90->sourcefile~module_kinds.f90 sourcefile~module_equations.f90 module_equations.f90 sourcefile~module_mol.f90->sourcefile~module_equations.f90 sourcefile~module_equations.f90->sourcefile~module_kinds.f90

Files dependent on this one

sourcefile~~module_all_integrators.f90~~AfferentGraph sourcefile~module_all_integrators.f90 module_all_integrators.f90 sourcefile~submodule_geod_schw_implementation.f90 submodule_geod_schw_implementation.f90 sourcefile~submodule_geod_schw_implementation.f90->sourcefile~module_all_integrators.f90 sourcefile~submodule_osc_schw_implementation.f90 submodule_osc_schw_implementation.f90 sourcefile~submodule_osc_schw_implementation.f90->sourcefile~module_all_integrators.f90 sourcefile~submodule_scalar_schw_implementation.f90 submodule_scalar_schw_implementation.f90 sourcefile~submodule_scalar_schw_implementation.f90->sourcefile~module_all_integrators.f90 sourcefile~test.f90 test.f90 sourcefile~test.f90->sourcefile~module_all_integrators.f90

Contents


Source Code

module all_integrators
!! Module that provides a single view of all integrators. The implementation
!! is provided in the module itself.

  use rk4_integrator
  use rk5_integrator
  use abmv5_integrator

  implicit none

  type(rk4), target :: rk4_int
  !! The RK4 integrator.
  type(rk5), target :: rk5_int
  !! The RK5 integrator.
  type(abmv5), target :: abmv5_int
  !! The ABMV5 integrator.
  class(integrator), pointer :: mol_int
  !! Pointer that can point to any kind of integrator.

  contains

    subroutine choose_integrator ( )
    !! Routine that chooses an integrator by pointing to one of the
    !! available ones.

      use parameters, only : mol_integrator

      implicit none

      select case ( mol_integrator )
      case ( 'rk4' )
        mol_int => rk4_int
      case ( 'rk5' )
        mol_int => rk5_int
      case ( 'abmv5' )
        mol_int => abmv5_int
      case default
        print*,'Invalid integrator requested'
        stop
      end select

    end subroutine choose_integrator


    function mol_ntmp ( ) result ( ntemp )
    !! Function that interfaces with the ntemp functions provided by the
    !! individual integrators. This function can be called before
    !! [[choose_integrator]] is called.

      use parameters, only : mol_integrator

      implicit none

      integer(ip) :: ntemp
      !! The number of temporary storage levels needed.

      select case ( mol_integrator )
      case ( 'rk4' )
        ntemp = rk4_int%ntemp ( )
      case ( 'rk5' )
        ntemp = rk5_int%ntemp ( )
      case ( 'abmv5' )
        ntemp = abmv5_int%ntemp ( )
      case default
        print*,'Invalid integrator requested'
        stop
      end select

    end function mol_ntmp

end module all_integrators