- #1
miran.iran
- 2
- 0
Hi,
How could I make a variable name with a variable in it in fortran?
For example I want to use a loop to assign values to a11, a12, a13, a14, a15 and a21, a22, a23
I DO NOT WANT TO USE ARRAY FOR THIS
Real X1,x2,x3,x4,x5
Do I=1,5
Xi(i=1 to5)=i
Enddo
( How should I get through to the fortran that “i “ in the” Xi” is variable.
(((The same thing we do NORMALLY FOR FILE NAMES(characters) but for other type of variables:
character(80) fn
DO N=1,NVIV
WRITE(FN,'(A,A,I2.2,A)') TRIM(WORK_DIR),'WOW',N,'.DAT' )))
Regards
miran
How could I make a variable name with a variable in it in fortran?
For example I want to use a loop to assign values to a11, a12, a13, a14, a15 and a21, a22, a23
I DO NOT WANT TO USE ARRAY FOR THIS
Real X1,x2,x3,x4,x5
Do I=1,5
Xi(i=1 to5)=i
Enddo
( How should I get through to the fortran that “i “ in the” Xi” is variable.
(((The same thing we do NORMALLY FOR FILE NAMES(characters) but for other type of variables:
character(80) fn
DO N=1,NVIV
WRITE(FN,'(A,A,I2.2,A)') TRIM(WORK_DIR),'WOW',N,'.DAT' )))
Regards
miran