Dynamic and static arrays in legacy code

I am responsible for a number of outdated (F77) programs. In some cases, one or another may fail due to an attempt to exceed the size of a fixed array. My usual fix is ​​the method over the allocated array.

Does anyone have any thoughts or experience changing these fixed arrays to dynamic ones, and what are the implications for the rest of the code, including subroutine calls?

I use a fairly new compiler on OpenVMS, so I think there will be no problems with the compiler.

+3
source share
1 answer

Can you understand a little what you are doing now and what you propose to do? You state that you are "redirecting" arrays, which assumes that you are already using dynamic arrays, and then in the next sentence you ask about changing fixed arrays to dynamic ones.

, , , ? , Fortran . Fortran 90 , , . ALLOCATABLE , ( ) ALLOCATE. , . , , , ALLOCATE , .

, , . , , Fortran, , Fortran 90. , . , , , , . , , . .

, :

  • DEALLOCATE, .
  • , , , - ( , ) Fortran 2003 .
  • ALLOCATE , , .
  • FORTRAN77 ; Fortran 90, , , SIZE. , .
  • , , .
  • stat ALLOCATE.

, .

+4

Source: https://habr.com/ru/post/1766069/


All Articles