Fortran What could be causing a dynamic space array error in a Fortran 77 program?

AI Thread Summary
The discussion revolves around running an executable compiled from Fortran files, specifically those written in Fortran 77, which includes dynamic space arrays. The user encountered a "Command terminated by signal 11" error, traced back to the dynamic array declaration, particularly due to one array being defined with 25 million elements, exceeding their computer's memory capacity. The issue was resolved upon realizing the memory limitation. Participants discussed the compatibility of dynamic arrays in Fortran, noting that standard Fortran 77 does not support them, but some compilers, like ifort and g95, may allow non-standard extensions. The user confirmed that their codebase includes both Fortran 77 and Fortran 90 syntax, with ifort supporting the latest specifications and extensions.
jf22901
Messages
55
Reaction score
1
Hi all

I am trying to run an executable compiled from some Fortran files (not my own), which look like they are written in Fortran 77. One of these includes some dynamic space arrays, where the number of elements depends on an integer value passed to the subroutine, e.g.

Code:
      subroutine assim (plevels,qlevels,row,number)
      implicit none
      
      integer plevels, qlevels, row, number
      
C DYNAMIC SPACE ARRAYS:
      integer array1(number)
      integer array2(number)
      
      ...
      
      return
      end

When I try to run the executable, the program gives the error message below, which I have traced back to the dynamic space array declaration. However, when someone from a different department compiles the code it works on their machine.

I guess this is some sort of memory problem? I've tried using ulimit, but get the same error. Can anyone offer any further help or insight? The error message is:

Command terminated by signal 11
0.63user 0.00system 0:00.86elapsed 74%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+2482minor)pagefaults 0swaps

Many thanks
 
Technology news on Phys.org
After doing a bit more work it seems that one of the arrays is defined to have 25 million elements, hence the reason my computer hasn't enough memory! Ah well, problem sorted I guess. :rolleyes:
 
Hi jf22901. What version of Fortran are you using? I'm just trying to figure out when dynamic arrays entered into the language.
 
Standard Fortran 77 did not have dynamically-allocated arrays. Some F77 compilers may have had them as a non-standard extension, although I don't remember using any such compilers myself.
 
uart said:
Hi jf22901. What version of Fortran are you using? I'm just trying to figure out when dynamic arrays entered into the language.

It's a model that's been developed over the years, so there is some Fortran 77, and some 90. The code where the dynamic arrays are is definitely written in the syntax of Fortran 77. The compiler is ifort (which seems to allow non-standard extensions), but I know that whenever I've tried to use dynamic arrays with gfortran on my laptop it simply refuses!
 
Ok thanks. I expect that iFort will support whatever the most recent Fortran specifications are and possibly some extensions.

BTW. I just now checked this with g95 (the gnu fortran 95 compiler) and it also supports arrays defined like this. This is interesting as I didn't expect that.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...

Similar threads

Replies
4
Views
2K
Replies
2
Views
2K
Replies
5
Views
5K
Replies
8
Views
4K
Replies
8
Views
4K
Replies
4
Views
4K
Replies
2
Views
2K
Replies
13
Views
3K
Back
Top