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

forrtl: severe (157): Program Exception - access violation

Alex_P_4
Beginner
3,597 Views

Dear Forum,

I keep getting 'forrtl: severe (157): Program Exception - access violation' error on execution and I have no clue how to fix it. I know this topic has been discussed before but in different contexts. I need a fresh eye to see the problem in my program.

I am am minimizing a finction by calling a minimization routine in the main program:

use definitions

integer, parameter :: N1=2
    integer :: IPARAM(7)
    double precision :: X(N1), X0(N1), XLB(N1), XUB(N1), RPARAM(7)
    double precision :: F

XLB = (/-2.d0,-1.d0/)
XUB = (/.5d0,2.d0/)
X0 = (/.1d0,.25d0/)
!X = (/1.0d0,2.d0/)
IPARAM(1) = 0
F=2.d0

!CALL D_BCONF (FCN, IBTYPE, XLB(N), XUB(N), X(N) ,| N, XGUESS(N), XSCALE(N), FSCALE, IPARAM, RPARAM, FVALUE)
CALL D_BCONF (FCN1, 0, XLB, XUB, X, 2, X0, , , IPARAM, RPARAM, F)
write(*,*) X, F

Function FCN1 is called from a different file containing module 'definitions':

MODULE definitions
INCLUDE 'link_fnl_static.h'
!DEC$ OBJCOMMENT LIB:'libiomp5md.lib'
!use imsl_libraries

implicit none
save

............ (other routines in the module)

SUBROUTINE FCN1 (N1, X, F)
implicit none
integer :: N1
double precision:: X(*), F

F = 1.0d2*(X(2)-X(1)*X(1))**2 + (1.0d0-X(1))**2

END subroutine FCN1

end module

I have done it before many times in Compaq Visual Fortran and it always worked. Now it refuses to do it.

I noticed that if I remove comment mark from statement !X = (/1.0d0,2.d0/), it executes but it appears that fortran does not see the minimization call CALL D_BCONF(). There is no output, X is still the same and the function value is F = 0.25 (I do not know where it comes from).

Any ideas as to how I can make it work? I will provide any other info necessary to resolve the issue.

Thanks for any help.

0 Kudos
1 Solution
Steven_L_Intel1
Employee
3,597 Views

If you are going to call the "Fortran 90" interface versions of the IMSL routines, you MUST have USE BCONF_INT, etc. (or USE IMSL_LIBRARIES). You commented that out. Otherwise there will be an argument passing mismatch. Also, please do not use the D_ and S_ versions of the names - call the generic name instead (BCONF).

View solution in original post

0 Kudos
2 Replies
andrew_4619
Honored Contributor III
3,597 Views

I think the error is the optional aguamnents with ,,,

try something like : 

CALL D_BCONF (FCN1, 0, XLB, XUB, X, 2, X0,IPARAM=IPARAM, RPARAM=RPARAM, FVALUE=F)

0 Kudos
Steven_L_Intel1
Employee
3,598 Views

If you are going to call the "Fortran 90" interface versions of the IMSL routines, you MUST have USE BCONF_INT, etc. (or USE IMSL_LIBRARIES). You commented that out. Otherwise there will be an argument passing mismatch. Also, please do not use the D_ and S_ versions of the names - call the generic name instead (BCONF).

0 Kudos
Reply