      program dotest
      use manager
      implicit none
      integer itemindex1, itemindex2
      call setup ( itemindex1, itemindex2 )
      call lookat ( itemlist(itemindex1), itemlist(itemindex2) )
      call freeitems ( )
      end program dotest

      subroutine lookat ( item1, item2 )
      use manager
      implicit none
#include <common.blk>
      type ( a_itemdata ) :: item1
      type ( a_itemdata ) :: item2
      integer i, j
      do i = 1, item1%numt
         do j = 1, mpt
            write ( *, * ) item1%t(j,i)
         enddo
      enddo
      continue
      return
      end subroutine lookat

      subroutine setup ( itemindex1, itemindex2 )
      use manager
      implicit none
#include <common.blk>
      integer itemindex1, itemindex2, newitem, np(2), nt(2), i, j,
     &        indexes(2), k
      np(1)=5
      nt(1)=4
      np(2)=3
      nt(2)=2

      do k = 1, 2

         indexes(k) = newitem ( np(k), nt(k) ) ! allocate a new item

         ! put some data in the item
         do i = 1, np(k)
            do j = 1, npp
               itemlist(indexes(k))%p(j,i) = dble(j*i)
            enddo
         enddo

         do i = 1, nt(k)
            do j = 1, mpt
               itemlist(indexes(k))%t(j,i) = j*i
            enddo
         enddo

         do i = 1, nt(k)
            do j = 1, npt
               itemlist(indexes(k))%tn(j,i) = dble(j*i)
            enddo
         enddo

         do i = 1, np(k)
            do j = 1, mpv
               itemlist(indexes(k))%v(j,i) = j*i
            enddo
         enddo

         do i = 1, nt(k)
            do j = 1, mpf
               itemlist(indexes(k))%f(j,i) = j*i
            enddo
         enddo

         do i = 1, 3*nt(k)
            do j = 1, mph
               itemlist(indexes(k))%h(j,i) = j*i
            enddo
         enddo

      enddo

      itemindex1 = indexes(1)
      itemindex2 = indexes(2)

      return
      end subroutine setup
