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

Can not run Fortran 77 program in VS 2013 with XE 2013

Hongjia_L_
Beginner
624 Views

Hi,

I use Visual Studio with Intel Fortran Compiler to compile the fortran 77 code. This code is correctly written without error when it is compiled by another old version fortran compiler. However, there are many errors after compiling by this Visual Studio Intel Fortran (Version 2013). I solved the compiling problems by googling. The big problem is that it can not run now. Attached is the ScreenShot. What's wrong then?

Thank you

0 Kudos
1 Reply
Kevin_D_Intel
Employee
624 Views

The code is failing to compile for the debug configuration due to the check routine interface option which is enabled by default for the Debug configuration only. Your Release configuration would suffer the same compilation failure if you enabled that same diagnostic check.

The CALL statement at 1306 is flagged with the error to indicate the actual arguments passed (i.e. alfacc, alfacc2, dum, dum) are either scalar or array variables but their corresponding dummy arguments declared inside the routine VOIGHT are not; hence, the compiler issued the error #8424.

You must inspect the declarations for the arguments passed to routine VOIGHT and the associated dummy arguments (C2, C4) declared inside the routine VOIGHT itself and make sure those are declared consistently, meaning, they each must be declared in the caller and callee scopes as either a scalar or an array.

The article, Doctor Fortran in "I've Come Here For An Argument", explains this and other aspects of passing arguments.

Here’s a simplistic example showing where the scalar A is mixed with the array B. With the interface check enabled, this is disallowed.

program t
real :: A
  call sub(A)
end

subroutine sub(B)
real :: B(1)
  B(1)=1
end
C:\  ifort  /warn:interfaces  t.f90
Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 17.0.1.143 Build 20161005
Copyright (C) 1985-2016 Intel Corporation.  All rights reserved.

t.f90(3): error #8284: If the actual argument is scalar, the dummy argument shall be scalar unless the actual argument is of type character or is an element of an array that is not assumed shape, pointer, or polymorphic.   
  call sub(A)
-------^
compilation aborted for t.f90 (code 1)

 

0 Kudos
Reply