!c Description:
!c  入力された Key に対応するスタックを返す. 線形捜索
!c
!c Current Code Owner: 
!c   sugiyama@gfd-dennou.org
!c
!c Histry: 
!c   Version    Date          Comment
!c   -------    ----------    --------
!c   1.0        2003-02-17    作成
!c
!c Copyright (C) SUGIYAMA Ko-ichiro, 2003, All rights reserved


module interface_list_get
  interface list_get

     subroutine list_get_comps(key, object, oneobject)
       use prm_type, only: list_comps, type_comps
       integer                   :: key 
       type(list_comps), pointer    :: object
       type(type_comps), intent(out):: oneobject
     end subroutine list_get_comps

     subroutine list_get_data(key, object, oneobject)
       use prm_type, only: list_data, type_data
       real(8)                      :: key 
       type(list_data), pointer     :: object
       type(type_data), intent(out) :: oneobject
     end subroutine list_get_data

     subroutine list_get_spl(key, object, oneobject)
       use prm_type, only: list_spl, type_spl
       real(8)                      :: key 
       type(list_spl), pointer      :: object  
       type(type_spl), intent(out)  :: oneobject
     end subroutine list_get_spl

  end interface
end module interface_list_get



subroutine list_get_comps(key, object, oneobject)
  use prm_type, only: list_comps, type_comps

  implicit none
  integer                   :: key 
  type(list_comps), pointer    :: object
  type(type_comps), intent(out):: oneobject
  type(list_comps), pointer    :: p

   
  p => object
  do 
     if (.not. associated(p)) exit
     if (p%record%atmnum == key) then
        oneobject = p%record
        exit
     end if
     p => p%next
  end do
  
end subroutine list_get_comps



subroutine list_get_data(key, object, oneobject)
  use prm_type, only: list_data, type_data

  implicit none
  real(8)                      :: key 
  type(list_data), pointer     :: object
  type(type_data), intent(out) :: oneobject
  type(list_data), pointer     :: p

   
  p => object
  do 
     if (.not. associated(p)) exit
     if (p%record%temp == key) then
        oneobject = p%record
        exit
     end if
     p => p%next
  end do
  
end subroutine list_get_data



subroutine list_get_spl(key, object, oneobject)
  use prm_type, only: list_spl, type_spl
  
  implicit none
  real(8)                      :: key 
  type(list_spl), pointer      :: object  
  type(type_spl), intent(out)  :: oneobject
  type(list_spl), pointer      :: p

   
  p => object
  do 
     if (.not. associated(p)) exit
     if (p%record%temp == key) then
        oneobject = p%record
        exit
     end if
     p => p%next
  end do
  
end subroutine list_get_spl




