I am a dummy in Fortran 77 and have always been a C++ coder, but I have to modify a code from years long ago…
I want to create a variable size array of strings and I cannot find online how to do this in Fortran 77.
Ideally, it should be array with both dimensions variable but if it is not possible, length of the string I can fix, but I need to have variable number of strings.
I tried this:
CHARACTER*32 STR1*(VAR1)
...
WRITE(6,*) STR1(10)
But this does not work…
Apparently FORTRAN 77 does not support dynamic memory allocation .
You could try allocating memory in a c program and passing the result back to the FORTRAN routine.
As done here
http://owen.sj.ca.us/~rk/howto/FandC/FandC.mem.html
Or more clearly – using some kind of an Interop to call a c method
from
https://engineering.purdue.edu/ECN/Support/KB/Docs/CallingCFromFortran