Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Beginner
7 Views

Stack overflow on legacy MSIMSL f

I am trying to run the code from a 2006 economics paper that uses the now obsolete "use MSIMSL", which I have changed to "use numerical_libraries", to no avail. My hunch is that there is something else that needs to be updated from the old code, but it could also be an configuration or variable assignment issue.

Specifically, I can compile, but running the executable leads to a stack overflow error. Using the \traceback and \check:all options leads to several identical blocks where data is read into the program with the warning (406) ("In call to I/O Read routine, an array temporary was created for argument #1") referring to line 151 of the code, followed by the stack overflow error (severe 170) referring to lines 315 and 323. \heap-arrays seems to make no difference.

I have attached an image of what the warnings and errors look like, as well as the code itself. Notable details:
* Line 151 is the first instance where data is read into the program using a loop, so it makes sense that it's appearing many times.
* Line 316 calls the UMPOL function (minimization using the direct search polytope algorithm), and 323 is the beginning of the subroutine comprising the remainder of the code through line 2237.
* The program reads data from text files (totaling roughly 5.7MB), and includes the following IMSL functions (a minimization, three random numbers functions, and least squares): UMPOL, RNUN, RNNOA, RNPER, RLSE.

I'm running a Windows 7 machine with Visual Studio Community 2015, Intel Parallel Studio XE 2017u2, and the IMSL FNL 2018.0.0. I'm compiling with the standard flags (%F90% %F90FLAGS% estimation.f90 $LINK_FNL%) and executing on via command line (Intel 64 Visual Studio 2015 environment).

Thanks in advance.

0 Kudos
1 Reply
Highlighted
Black Belt Retired Employee
7 Views

Add the  option /heap-arrays to your F90_FLAGS. This may help. If not, you'll need to use /link/stack:some-bigger-number in the link options (put this at the end - I assume it uses the %F90% command to do the linking.) For a "some-bigger-number", start with 10000000 and bump it up by that amount (10 million) until the error goes away.

--
Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran
0 Kudos