I'm very very new to FORTRAN, so it might be a super easy problem, but I wasn't sure after googling it on web...
Basically consider I have an input.txt file which has size of the 2D array
e.g. input.txt file contains
4 5
So after opening the file and registering the 4 and 5 on variables row and col, I do the following...
Since FORTRAN77 has a specific format where you have to declare before statements, I was thinking about using SUBROUTINE
Here is the idea of SUBROUTINE
SUBROUTINE create(row,col)
INTEGER array(row,col)
RETURN
END
I'm not sure if the code is able to run because it has no statements after declaration, but I already get an error saying that
Error on line x: Declaration error for array: adjustable dimension on non-argument
I'm not sure what's the problem, so I've come down to this
- I'm not using array declaration properly (i.e. logical error)
- In FORTRAN you cannot create array custom size (I don't think this will be the case...)
Sample codes and links are welcome, but summary of what I should know will be great!
In addition, FORTRAN77 will be used to compile my code, so I have to stick with FORTRAN77 style