subroutine calc_C (N,Re,C)

	integer :: N, i

	real,dimension(N) :: C, Re

	do i = 1, N
		if ( 1.0<=Re(i) .and. Re(i)< 40.0 ) then
			C(i) = 0.75
		elseif ( 40.0<=Re(i) .and. Re(i) < 1000.0 ) then
			C(i) = 0.51
		elseif ( 1000.0<=Re(i) .and. Re(i)<2.0e5 ) then
			C(i) = 0.26
		elseif ( 2.0e5<=Re(i) .and. Re(i)<1.0e6 ) then
			C(i) = 0.076
		end if

		!Outra opcao
		!if ( 1.0<=Re(i) .and. Re(i)< 40.0 ) C(i) = 0.75
		!if ( 40.0<=Re(i) .and. Re(i) < 1000.0 ) C(i) = 0.51
		!if ( 1000.0<=Re(i) .and. Re(i)<2.0e5 ) C(i) = 0.26
		!if ( 2.0e5<=Re(i) .and. Re(i)<1.0e6 ) C(i) = 0.076

	end do

end subroutine calc_C

!**************************************************************

subroutine calc_m (N,Re,m)

	integer :: N, i

	real,dimension(N) :: m, Re

	do i = 1, N
		if ( 1.0<=Re(i) .and. Re(i)< 40.0 ) then
			m(i) = 0.4
		elseif ( 40.0<=Re(i) .and. Re(i) < 1000.0 ) then
			m(i) = 0.5
		elseif ( 1000.0<=Re(i) .and. Re(i)<2.0e5 ) then
			m(i) = 0.6
		elseif ( 2.0e5<=Re(i) .and. Re(i)<1.0e6 ) then
			m(i) = 0.7
		end if

		!Outra opcao
		!if ( 1.0<=Re(i) .and. Re(i)< 40.0 ) m(i) = 0.4
		!if ( 40.0<=Re(i) .and. Re(i) < 1000.0 ) m(i) = 0.5
		!if ( 1000.0<=Re(i) .and. Re(i)<2.0e5 ) m(i) = 0.6
		!if ( 2.0e5<=Re(i) .and. Re(i)<1.0e6 ) m(i) = 0.7

	end do

end subroutine calc_m

!**************************************************************

subroutine saidas (N,C,m,Re,Nu)

	use portlib

	integer :: N,i, ver
	real,dimension(N) :: C, m, Re, Nu

	open(3,file = 'resultados.txt')

	write(3,1)
	do i = 1, N
		write(3,2) i, C(i), m(i), Re(i), Nu(i)
	end do

	1 format ( "Elemento i - C(i) - m(i) - Re(i) - Nu(i)")
	2 format ( i5, 4(1pe15.6) )

	close(3)

	ver = system('notepad resultados.txt')

end subroutine saidas