Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29233 Discussions

Prob:compiling a Lahey fortran 95 code with CVF6

khanjavedgr
Beginner
859 Views
hi,
I am a phd researcher in a university of Patras GREECE.I got a Fortran code ( .f90 ) written with Lahey fortran 95.I am using Digital VF6.When I compile I get always this error:

G:science............. .F90(64832) : Error: This name does not have a type, and must have an explicit type. [POINTER]
locfcn = POINTER( ia(1) )
the function where this error exist is

!+
integer function locfcn(ia)
! ----------------------------------------------------------------------
IMPLICIT NONE
INTEGER ia(*)
locfcn = POINTER( ia(1) )
return
! ==========================================
END Function Locfcn

!+

When I compile with the trial compiler of lahey fortran 95 {lf95 -nf95 -nchk *******.f90} everything is ok.But I can't work with the trial version.

I would appreciate if anyone can help me
0 Kudos
4 Replies
Steven_L_Intel1
Employee
859 Views
Use LOC() instead of POINTER() in CVF, if I understand what Lahey's POINTER does.

Steve
0 Kudos
Intel_C_Intel
Employee
859 Views
Steve is, naturally, right.
Pointer function (note that there is also Pointer statement in LF95) gets address of a variable, array reference or external subprogram. (go to that page for details) Pointer in Compaq Fortran takes two arguments (details in CVF Help system). As far as I know there is some differences/incompatibilities for POINTER function between versions of LF90 and LF95 (cannot take literal constant arguments, only variables or something similar)

As a last resort you can go to that page and check your code conformance with the F90/95 standard.

Artur
0 Kudos
Steven_L_Intel1
Employee
859 Views
A nit - the Compaq Fortran extension POINTER (A,B) is a statement (a declaration), not a function. It is an entirely different beast than Lahey's POINTER.

Steve
0 Kudos
Intel_C_Intel
Employee
859 Views
Steve,
I admit, I mixed things with Compaq statement (I do hope that you're not using British English:-))

Artur
0 Kudos
Reply