! Submdule : specint_m
! Purpose  : Factory routines for specint_m
!
! Copyright 2021-2022 Rich Townsend & The MSG Team
!
! This file is part of MSG. MSG is free software: you can redistribute
! it and/or modify it under the terms of the GNU General Public
! License as published by the Free Software Foundation, version 3.
!
! MSG is distributed in the hope that it will be useful, but WITHOUT
! ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
! or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
! License for more details.
!
! You should have received a copy of the GNU General Public License
! along with this program.  If not, see <http://www.gnu.org/licenses/>.

#:include 'forum.inc'

submodule(specint_m) specint_sm

   ! Uses

   use forum_m

   use limb_specint_m

   use ISO_FORTRAN_ENV

   ! No implicit typing

   implicit none

contains

   function specint_t_type_(type) result(specint)

      character(*), intent(in)      :: type
      class(specint_t), allocatable :: specint

      ! Construct specint by allocating with the indicated type

      select case(type)
      case('limb_specint_t')
         allocate(limb_specint_t::specint)
      case default
         @:ABORT('invalid type')
      end select

      ! Finish

      return

   end function specint_t_type_

end submodule specint_sm
