Dynamic memory allocation in fortran77

I am writing a Fortran77 program which uses a 3-dimensional array. I am declaring the array as follows Array_E(0:500,0:1000,0:100). When I execute the program it crashes instantly saying that it is "killed".When I ran strace, what I got was,execve("./yee", ["./yee"], [/* 65 vars */] +++ killed by SIGKILL +++I suspect the problem is that the g77 compiler is not able to allocate memory for the array. In fact there are nine such arrays. In such a case is there a way to dynamically allocate memory on the stack in f77? If this is not the reason for ...Read more

fortran77 - Fortran 77 bug with commenting out write statements

I'm working with an old FORTRAN 77 program, and I've encountered a bizarre bug. As-is, the code appears to run fine, and finishes in less than a second. But it produces a bunch of extraneous output that I'm not interested in. So, I went into the source, and commented out all of the extra WRITE statements.Well, when I comment out a few of the WRITE statements, the code seems to run a little slower (though I'm not sure about that; it might just seem slower since I have fewer lines of text scrolling by to keep me occupied). And when I comment ...Read more

fortran77 - Fortran 77 debugger to check array bounds

I am still green to debugging F77 and am having some problems with array bounds. I recently modified a lengthy code to have new array sizes. Everything 'seemed' okay until I noticed methods to alter one array, altered another. Somewhere in this code, I assume, an assignment is out of bounds and writing to the other arrays.Is there a debugger/tool in the linux environment that will 'catch' the out of bounds exception?I am currently using gfortran...Read more

fortran77 - Read specified number on reals on line

I'm writing a program in Fortran 77 and I need to read a specified number of REAL numbers on one line. For example, the input may look like the following:1.0 2.0 3.0 4.0The number of values on one line will be specified. This will be held in some value, called M.How do I read M REAL values on one line. I've tried doing this with a loop, but I believe the READ statement skips to the next line after it executes. Also, I'm using the VARIABLE INFILE to reference the file unit.Thanks...Read more

fortran77 - Minimal and maximal magnitude in Fortran

I'm trying to rewrite minpack Fortran77 library to Java (for my own needs), so I met this in minpack.f source code:integer mcheps(4)integer minmag(4)integer maxmag(4)double precision dmach(3)equivalence (dmach(1),mcheps(1))equivalence (dmach(2),minmag(1))equivalence (dmach(3),maxmag(1))...data dmach(1) /2.22044604926d-16/data dmach(2) /2.22507385852d-308/data dmach(3) /1.79769313485d+308/dpmpar = dmach(i)returnWhat are minmag and maxmag functions, and why dmach(2) and dmach(3) have these values?There is an explanation in comments: c dpm...Read more

fortran77 - Confusion about "do-continue" and "go to-continue" in FORTRAN

Bad news Everyone,I recently started to learn FORTRAN to understand a code and translate it to C++ (Iknow what the code does is not important for this question, but to give some background,this code solves boundary value problems using collocation method on an adaptive grid).Looking at the code, there are certain "go to" statements combined with "do continue"that really confuse me.Here is an example:do 100 i=1, n C DO SOMETHING HERE if (some condition) go to 90 C DO SOME MORE STUFF HERE 90 continue C EVEN MORE STUFF HERE100 conti...Read more