module dados


use VARIAVEIS


! use dflib
use msflib


implicit none

!---------------------------------------------------------------

contains

!-------------------------------------------------

  subroutine le_nomes_arquivos

    dos = systemqq('notepad ice.dad') ! nomes dos arquivos

    open(7,file='ice.dad')

    read(7,*)
    read(7,*)
    read(7,*) arq_saida
    read(7,*) 
    read(7,*) arq_numerico
    read(7,*) 
    read(7,*) n1
    read(7,*) dn
    read(7,*)
    read(7,*) title
    
	close(7)

  end subroutine le_nomes_arquivos

!-------------------------------------------------

  subroutine le_arquivos_numericos

    integer :: k, nlb ! auxiliar
               
    open(7,file=arq_numerico)

    read(7,*)
    read(7,*)
    read(7,*) nv
    read(7,*) ni
    read(7,*) nlb

    do k = 1, nlb
       read(7,*) 
    end do

    allocate ( Tr(nv), head(nv) )

    allocate ( Tn(nv,ni), Ti(nv,ni), pa(nv,ni), psi(nv,ni), &
                                      r(nv,ni), lam(nv,ni)  )

    allocate ( En(nv,ni), Ud(nv,ni), Un(nv,ni), Ufp(nv,ni) )

    do i = 1, nv
       read(7,*) Tr(i), head(i)
    end do

    read(7,*)
    read(7,*)

    do j = 1, ni
       read(7,*) k, (Tn(i,j),i=1,nv)
    end do

    close(7)

  end subroutine le_arquivos_numericos

!-------------------------------------------------

end module dados