!!----------------------------------------------------------------------------
!! $Id: read_data.f90,v 1.1 1997/12/19 19:37:59 scott Exp $
!! subroutine read_data:
!!    This subroutine will read in data from the old MC program, this
!!    will have the payoffs
!!    Author: Scott A. Klasky
!!    Date  : 10/19/97
!!----------------------------------------------------------------------------
subroutine read_data(fname,max_params,params,stockprice)
  use PATHS
  use input_params
  implicit none
  integer,intent(IN)                       :: max_params
  real*8,dimension(max_params),intent(IN)  :: params
  real*8,dimension(:,:),intent(OUT)        :: stockprice
  character*(*),intent(IN)                 :: fname

  integer                                  :: i,j
  integer                                  :: iter

  open(20,file=fname)

  do j = 1 , int(params(P_NPATH))
     read(20,*) iter
     do i = 1, int(params(P_NTIME))
        read(20,*) stockprice(i,j)
     end do !i
  end do !j

  close(20)

  return
end subroutine read_data
