istat
1 2 3
1 2 3
1 2 3
1 2 3
Initializing rank-2 arrays with assignment statements
INTEGER, DIMENSION(4,3) :: istat
DO i = 1, 4
DO j = 1, 3
istat(i, j) = j
END DO
END DO
istat = RESHAPE ( (/1,1,1,1,2,2,2,2,3,3,3,3 /), (/ 4, 3 /) )
Initializing rank-2 arrays with type declaration statements
INTEGER, DIMENSION(4,3) :: istat(4, 3) = RESHAPE ( (/1,1,1,1,2,2,2,2,3,3,3,3 /), (/ 4, 3 /) )
Initializing rank-2 arrays with READ statements
if "initial.dat" file contains the values 1 1 1 1 2 2 2 2 3 3 3 3
INTEGER, DIMENSION(4, 3) :: istat
OPEN (7, FILE = 'initial.dat', STATUS = 'OLD', ACTION = 'READ')
READ(7, *) istat
if "initial.dat" file contains the values 1 2 3 1 2 3 1 2 3 1 2 3
INTEGER :: i, j
INTEGER, DIMENSION(4, 3) :: istat
OPEN (7, FILE = 'initial.dat', STATUS = 'OLD', ACTION = 'READ')
READ(7, *) ((istat(i, j), j = 1, 3), i = 1, 4)
'Programming > Fortran' 카테고리의 다른 글
Explicit-Shape Dummy Arrays (0) | 2008.12.15 |
---|---|
FORALL (0) | 2008.12.15 |
모듈을 이용한 자료 공유(sharing data using moduel) (0) | 2008.12.04 |
Error Handling in Subroutines (0) | 2008.12.03 |
Nested implied DO loops (0) | 2008.12.03 |