Skip to main content

SINEIN.f95

	PROGRAM SINEIN
!
!  Purpose: to read the file A:\ANGLSINE written by the program SINEOUT
!  and display the results on the screen.
!
	IMPLICIT NONE
	REAL:: THETA1, THETA2, THETA3, THETA4
	REAL:: SINE1, SINE2, SINE3, SINE4
!
!  Open the file A:\ ANGLSINE and read the content, in *-format (for
!  simplicity).
!	OPEN(3,FILE='A:\ANGLSINE')
	OPEN(3,FILE='ANGLSINE')
	READ(3,*)THETA1,SINE1
	READ(3,*)THETA2,SINE2
	READ(3,*)THETA3,SINE3
	READ(3,*)THETA4,SINE4
!
!  Now, display the results on the screen, in two columns. The E16.7 format
!  descriptor ensures that all the significant digits are displayed. The
!  angles vary from 1 to 4, so the format descriptor F6.1 is appropriate.
	WRITE(*,100)THETA1,SINE1
	WRITE(*,100)THETA2,SINE2
	WRITE(*,100)THETA3,SINE3
	WRITE(*,100)THETA4,SINE4
!
  100	FORMAT(1X,F6.1,2X,E16.7)
!
	END PROGRAM SINEIN