Array slicing in FORTRAN 77

1.1k views Asked by At

According to my search, array slicing feature was added first in Fortran 90. I need something similar to this feature in FORTRAN 77. I have a matrix and I just want to pass one row of it to subroutine. Actually I can assign the values at that row to another array but I want something practical and fast. Is there any trick for that?

1

There are 1 answers

0
casey On

You note in the comments that you are using Intel Fortran 12.0. This compiler is a modern Fortran compiler with partial Fortran 2003 and limited Fortran 2008 support. As such, this compiler supports array slicing, so you shouldn't have any problems using that syntax in your code.

If you concern is maintaining pure FORTRAN 77 code, I personally wouldn't worry about that unless you were limited to using ancient compilers. All of the major vendors distribute modern Fortran compilers and a standard FORTRAN 77 program is also a valid Fortran 90 program. Unless you are forcing the compiler to use strict FORTRAN 77 compliance (and as so much old FORTRAN code uses non standard extensions, I find this unlikely; nor do I see a way in intel fortran to do this) there should be no issues introducing Fortran 90 syntax into your program.