- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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).
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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).

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page