- #1
Davoodk
- 11
- 0
Hi,
i am truing to generate a matrix of my big file in which each line must be assigned as a vector into a matrix. on the other word, i have a big file by 24480 row and 6828 column, so i want to define that each row is been as a vector in a big matrix. using below program i was facing by an error which says "integer overflow".
PROGRAM Matrixgenome
IMPLICIT NONE
INTEGER::OPENSTATUS, j
CHARACTER*10000::row
TYPE anim
INTEGER::animal(10)
INTEGER::id
INTEGER::genome(1,6828)
END TYPE anim
TYPE (anim),ALLOCATABLE::animal(:)
INTEGER,ALLOCATABLE::length(:)
INTEGER,ALLOCATABLE::genome(:,:)
INTEGER,ALLOCATABLE::line(:)
!Allocate(animal(24480)) !for test
OPEN(UNIT=18, FILE="genome.txt", STATUS="OLD", IOSTAT=OPENSTATUS)
IF (OPENSTATUS>0) STOP "***CANNOT OPEN FILE***"
READ(18,fmt='(a6828)') row
length= len_trim(row)
rewind(18)
ALLOCATE(genome(10,6828))
ALLOCATE(line(6828))
DO j=1, 10
READ(18,fmt='(6828i1)') line(:)
!PRINT*, "length of row:", size(line)
animal(j)%id=j
animal(j)%genome(j,1:6828)=line(6828)
PRINT*, animal(j)
PRINT*, '(genome1)', genome(1,1:6828)
PRINT*, "size", size(animal(1)%genome(1,
WRITE(*, '(200i1)') animal(j)%genome(1,1:200)
END DO
DEALLOCATE(line)
DEALLOCATE(genome)
END PROGRAM Matrixgenome
So, how can i solve this error.
I am so grateful for any help
i am truing to generate a matrix of my big file in which each line must be assigned as a vector into a matrix. on the other word, i have a big file by 24480 row and 6828 column, so i want to define that each row is been as a vector in a big matrix. using below program i was facing by an error which says "integer overflow".
PROGRAM Matrixgenome
IMPLICIT NONE
INTEGER::OPENSTATUS, j
CHARACTER*10000::row
TYPE anim
INTEGER::animal(10)
INTEGER::id
INTEGER::genome(1,6828)
END TYPE anim
TYPE (anim),ALLOCATABLE::animal(:)
INTEGER,ALLOCATABLE::length(:)
INTEGER,ALLOCATABLE::genome(:,:)
INTEGER,ALLOCATABLE::line(:)
!Allocate(animal(24480)) !for test
OPEN(UNIT=18, FILE="genome.txt", STATUS="OLD", IOSTAT=OPENSTATUS)
IF (OPENSTATUS>0) STOP "***CANNOT OPEN FILE***"
READ(18,fmt='(a6828)') row
length= len_trim(row)
rewind(18)
ALLOCATE(genome(10,6828))
ALLOCATE(line(6828))
DO j=1, 10
READ(18,fmt='(6828i1)') line(:)
!PRINT*, "length of row:", size(line)
animal(j)%id=j
animal(j)%genome(j,1:6828)=line(6828)
PRINT*, animal(j)
PRINT*, '(genome1)', genome(1,1:6828)
PRINT*, "size", size(animal(1)%genome(1,
WRITE(*, '(200i1)') animal(j)%genome(1,1:200)
END DO
DEALLOCATE(line)
DEALLOCATE(genome)
END PROGRAM Matrixgenome
So, how can i solve this error.
I am so grateful for any help