Dear Fortran Forum,
when I try to use the library NEQNF to solve a generic non-linear system, I get the following error:
forrtl: severe (157): Program Exception - access violation
I really do not know what the problem might be, also because I do not have any issues when I use another library, for example ZREAL.
Visual studio actually builds the code, but when I run it, I get this type of error. I'm using VS 2012 in Debug Win32.
What could be the source of this problem and how can I solve it? I write here an example of a code to solve a generic non-linear system:
Can anyone offer any suggestions?
PROGRAM NONLINEARSYSTEM include 'link_fnl_shared.h' USE NEQNF_INT !USE IMSL_LIBRARIES IMPLICIT NONE INTEGER(4) N,ITMAX PARAMETER (N=2) REAL(8) X(N),X0(N) REAL(8) ERRREL EXTERNAL SYST ERRREL = 1.0E-5 X0(1) = 1. X0(2) = 1. ITMAX=10000 CALL NEQNF(SYST, X, ERRREL, N, ITMAX, XGUESS=X0) END PROGRAM SUBROUTINE SYST (X,F,N) IMPLICIT NONE INTEGER(4) N REAL(8) X(N),F(N) F(1) = X(1) * X(1) - X(2) F(2) = X(2) + LOG (X(1)) - 2 RETURN END SUBROUTINE SYST
Your test program runs and gives the final x = [1.31410, 1.72685] after about 8 function evaluations, when built with IFort 2017 Update 4 and IMSL 7.
Please provide details regarding your OS, compiler and IMSL FNL versions.
Please compile and run with the /traceback option added, and report the traceback output in your reply.
I again built the program using the old version IFort 11.1.072 and FNL 7.0.1, and the program ran correctly (IA32 or Intel64). Please state which compiler version you use.
Sorry, I just started working on Visual Studio in Fortran language.
First of all, I would like to thank you for your availability.
Actually my compiler is: Intel (R) Visual Fortran Compiler XE 188.8.131.52 [IA-32]
I attach what I think the traceback output is. Otherwise, please tell me where I can find the traceback output. Again, I thank you for your time.
The traceback has the correct format, but the PC (program counter) values indicate that you probably used the older IMSL installer imsl_7.0.1.027_setup.exe rather than the current imsl_7.0.1.033_setup.exe. Can you confirm this, assuming that you installed IMSL yourself?
I am afraid that there are few IMSL users who use the same versions of VS, Ifort and IMSL as you, so reproducing the bug can be troublesome.
If you can find the file BUILDLOG.HTM (this is produced when Visual Studio is used to build your EXE), please post it, there may be some clues in it.
I just found out that the actual that the actual IMSL version I am using is:
IMSL(R) Fortran Numerical Library
About the file BUILDLOG, this is the output. (Unfortunately, I cannot attach a file with extension .htm)