Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29285 Discussions

How do I create a data type for an entry into a function?

carlls
Beginner
568 Views
Greetings:

Before I get started let me say this is not my choice of how to do things, but we all understand legacys code.

What I have is of the form :
MODULE MY_MODULE

CONTAINS

REAL (KIND=8) FUNCTION FRED(A,B,C)
IMPLICIT NONE

REAL (KIND=8) A, B, C
........................
ENTRY SHORT_CUT(B,C)

FRED=1.0D00
RETURN
END FUNCTION FRED

END MODULE MY_MODULE

The compiler complains thusly:

Intel Fortran Compiler for Intel EM64T-based applications, Version 9.1
Build 20060925
Copyright (C) 1985-2006 Intel Corporation. All rights reserved.

my_func.f90(11) : Error: This name does not have a type, and must have an explic
it type. [SHORT_CUT]
ENTRY SHORT_CUT(B,C)
------------^
my_func.f90(11) : Error: The function and entry names do not have consistent dat
a types. They do not have to be the same data type, but they must be in the sam
e data type group. [SHORT_CUT]
ENTRY SHORT_CUT(B,C)
------------^
compilation aborted for my_func.f90 (code 1)

So how do I assign a type for the entry "SHORT_CUT"

Regards
Carl
0 Kudos
2 Replies
Steven_L_Intel1
Employee
568 Views
[plain]      MODULE MY_MODULE

CONTAINS

REAL (KIND=8) FUNCTION FRED(A,B,C)
IMPLICIT NONE

REAL (KIND=8) A, B, C
REAL SHORT_CUT ! <----
........................
ENTRY SHORT_CUT(B,C)

FRED=1.0D00
RETURN
END FUNCTION FRED

END MODULE MY_MODULE [/plain]

0 Kudos
carlls
Beginner
568 Views
[plain]      MODULE MY_MODULE

CONTAINS

REAL (KIND=8) FUNCTION FRED(A,B,C)
IMPLICIT NONE

REAL (KIND=8) A, B, C
REAL SHORT_CUT ! <----
........................
ENTRY SHORT_CUT(B,C)

FRED=1.0D00
RETURN
END FUNCTION FRED

END MODULE MY_MODULE [/plain]


Except for REAL (KIND=8) SHORT_CUT you got it .... thanks
By the way, only posted the minor correction to help with cut and pasters like me.
0 Kudos
Reply