!
!	Author: Guilherme Bertoldo
!	Curitiba, 23/04/2010 
!
program main

implicit none

integer :: max, i
real :: u, ni, Pr
real, allocatable, dimension (:) :: x, Re, Nu

external subrotinas
!
! Input data
!
write(*,*) "Enter the maximum number of data (max):"; read(*,*) max
write(*,*) "Enter the speed (u):"; read(*,*) u
write(*,*) "Enter the kinematic viscosity (ni):"; read(*,*) ni
write(*,*) "Enter Prandtl number (Pr)"; read(*,*) Pr
!
allocate(x(max),Re(max),Nu(max))
!
do i=1, max
	x(i) = 0.5*i

	Re(i) = u * x(i) / ni

	if ( Re(i) > 5.E5 ) then

		Nu(i) = (0.037 * Re(i) ** (4./5.) - 871. ) * Pr ** (1./3.)

	else

		Nu(i) = 0.664 * sqrt( Re(i) ) * Pr ** (1./3.)

	end if

end do
!
call saidas (max, u, ni, Pr, x, Re, Nu)
				
end program main