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

error #7836 with Intel Compiler

Tuki_W_
Beginner
466 Views

Dear all

I am using Intel(R)64, version 11.1.067 version.I continously encountered error # 7836 while compiling a FORTRAN code. From the debug report, I see that the problem is in the following part of the code:

INTEGER, PARAMETER :: nz=2, n=10
REAL, DIMENSION(1,nz) :: z
REAL:: sig, vsig
REAL, DIMENSION(1,n) :: pri
.....
.....

pri(1:1,2:2)=norf(z(1,2),sig,vsig,nz/2)

.....
.....

CONTAINS

FUNCTION norf(x,mu,sigma,dim)

INTEGER, INTENT(IN):: dim
INTEGER :: i
REAL, DIMENSION(1,dim) :: x, mu, sigma, norf
REAL, PARAMETER :: pi=3.14
do i=1,dim
norf(1,i)=1/(sigma(1,i)*sqrt(2*pi))*exp(-(x(1,i)-mu(1,i))**2/(2*sigma(1,i)**2))
end do
END FUNCTION norf

Please Please help!

Thanks

0 Kudos
3 Replies
mecej4
Honored Contributor III
466 Views

Please post complete example source code. I don't know where to look for error messages by a numeric code (#7836), nor do I have the older version (11.0) that you mentioned; therefore, please post the text of the error message.

It appears that you are passing a scalar (sig) where the function declaration calls for a 2-D array.

0 Kudos
Steven_L_Intel1
Employee
466 Views

Tip: To look up an Intel Fortran diagnostic by number, type:

fdiagnnnn

where nnnn is the number, into the search box at the upper right. Indeed, this error is http://software.intel.com/en-us/articles/fdiag7836 as mecej4 suggested. The standard generally prohibits passing a scalar to an array, except in certain circumstances. You probably got away with it before because it's an error most compilers don't diagnose by default in the absence of an explicit interface.. Intel Fortran does when generated interface checking is enabled.

An easy workaround is to surround the scalar arguments with [], turning them into array constructors. This works as long as you don't try to store to the argument.

0 Kudos
Tuki_W_
Beginner
466 Views

It works! Thanks Steve

0 Kudos
Reply