Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I can't compile this program. May anyone help me?

Status
Not open for further replies.

Otagin

Technical User
Aug 29, 2014
1
BR
PROGRAM MAIN
IMPLICIT NONE
REAL MATRIX
INTEGER :: x, y, q
INTEGER, PARAMETER :: I =18-40 ,J = 18+20,K = 9-18,L = 20-18
q=90-18
REAL, DIMENSION(I:J,K:L) :: A
DO x=I,J
DO y=K,L
A(x,y)=MATRIX(x,y,18)
END DO
END DO

DO x=I,J
DO y=K,L
WRITE (*,advance='no'),A(x,y),' '
END DO
Print *,''
END DO

read(*,*)
END

CONTAINS
REAL FUNCTION MATRIX (x, y, N)
REAL x, y, SUM
INTEGER i, q, N
SUM = 0
q = 90-N
DO i=1,q
SUM = SUM + x*(y**i)
END DO
MATRIX = SUM
RETURN


END
 
What is the error message?

What is your file extension? (.f or .for or .f90 or .f95 etc)

Which compiler/os are you using
 
The CONTAINS goes inside the main program

Code:
program bla

    program_statements

contains

    real function f

        function_statements
    
    end function f

end program bla
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top