0

I'm doing a code in Intel Fortran and I have vectors declared with numerically sequenced names. I want to call each vector in a loop according to the number that corresponds to it.

It is a program that reads data files over time, originated in a finite element analysis and each vector corresponds to elements associated with a node.

for example to create numerically sequenced files is declared as follows:

  write(id_fich,'(I4)') itera
  nome_fich='..\Controle\MJTS1_i'//Trim(adjustl(id_fich))//'.dat'
  open(301,file=nome_fich)

something like this I'm trying to do but to call the vectors:

real*8 VP1(10),VP2(10),VP3(10)
integer i,j,k

do i=1,10
do k=1,3

VP//k//(i)=5.0*i

end do
end do
  • Welcome, please take the [tour] and read [ask]. It is important to properly tag your questions so that people can see your question. Use tag [tag:fortran] for all Fortran questions. Make sure to properly format all code in yur posts using the question editor. – Vladimir F Героям слава Jul 21 '19 at 08:04
  • 1
    What you want to do is not possible directly. We have several questions and answers about arrays of arrays using derived type containers or just by having an extra dimension in a large array https://stackoverflow.com/questions/19669412/array-of-arrays-in-fortran https://stackoverflow.com/questions/21568652/fortran-array-inside-array – Vladimir F Героям слава Jul 21 '19 at 08:43
  • A two dimensional array may be the simplest. And don't use real*8. – Ian Bush Jul 21 '19 at 09:38

0 Answers0