INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

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

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

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

(OP)
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

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

What is the error message?

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

Which compiler/os are you using

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

The CONTAINS goes inside the main program

CODE

program bla

    program_statements

contains

    real function f

        function_statements
    
    end function f

end program bla 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close