Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8865993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:40:02+00:00 2026-06-14T16:40:02+00:00

In this fortran program I’ve been given and told to debug, I’m getting the

  • 0

In this fortran program I’ve been given and told to debug, I’m getting the error:

“type mismatch in argument ‘p1’ at (1); passed REAL(4) to TYPE(point)”

and I can’t seem to figure out where the error is occuring.
I’ve tried defining different variables to pass to each function instead of p1 and p2 with the same error. Any ideas?

MODULE PointType

TYPE POINT
REAL:: x
REAL:: y
END TYPE

CONTAINS

FUNCTION arePointsEqual(p1, p2)
REAL:: arePointsEqual
TYPE(POINT), INTENT(IN):: p1
TYPE(POINT), INTENT(IN):: p2
LOGICAL :: isEqual
IF ( p1%x == p2%x .AND. p1%y == p2%y) THEN
isEqual = .TRUE.
ELSE
isEqual = .FALSE.
END IF
END FUNCTION

 FUNCTION arePointsNotEqual(p1,p2)
 REAL:: arePointsNotEqual
 TYPE(POINT), INTENT(IN):: p1
 TYPE(POINT), INTENT(IN):: p2
 LOGICAL :: isNotEqual

 IF ( p1%x == p2%x .AND. p1%y == p2%y) THEN
 isNotEqual = .FALSE.
 ELSE
 isNotEqual = .TRUE.
 END IF
 END FUNCTION

 FUNCTION distance(p1, p2)
 REAL:: distance
 TYPE(POINT), INTENT(IN):: p1
 TYPE(POINT), INTENT(IN):: p2
 distance = SQRT((p2%x - p1%x)**2 + (p2%y - p1%y)**2)
 END FUNCTION

 END MODULE

 !MAIN PROGRAM BELOW THIS LINE

 PROGRAM Project3

 USE PointType

 PRINT *, arePointsEqual(p1, p2)

 PRINT *, arePointsNotEqual(p1, p2)

 PRINT *, distance(p1, p2)

 END PROGRAM Project3
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T16:40:03+00:00Added an answer on June 14, 2026 at 4:40 pm

    Hint: try “implicit none”. Always a good idea.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Getting this error while trying to compile a copied code from a Fortran 77
The manual of a program written in Fortran 90 says, All real variables and
I was given a working FORTRAN program and i have to write C# GUI
I have a Fortran code like this: file1.f90 program myprog use func1mod do i=1,N
My Fortran program compiles, but then I get a weird error called 'Bus error.'
The output of this program on fortran 95 displays asterisks instead of digits. Also
I have written a fairly large program in Fortran 90. It has been working
This may sound like a heresy :), but I mostly program in fortran (intel
I have a program where code in C, C++ and Fortran has been compiled
I am converting a Fortran program to C#. This has to be done in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.