error in reading matrix
- From: rudra <bnrj.rudra@xxxxxxxxx>
- Date: Thu, 9 Oct 2008 20:07:30 -0700 (PDT)
i am facing a strange error.
i have a matrix defined as:
integer,dimension(nasite,ntsite)::map !nasite, ntsite are
integer,parameter
now when i am trying to read the matrix :
open(11,file=ASMAP,status='old',IOSTAT=ios,iomsg=msg)
if (ios/=0)then
write(*,*) msg
stop
endif
read(11,*)map
write(*,*) "Reading AS MAP complete"
close(11)
it is prompting error on another subroutine. In fact, the main error
lies on what it is reading. as the output of first line, i am getting:
2 802 1634 65961 86817 4164
5013 149279 158578 196557 218161 239796
43918
which is wrong
but when i am reading the matrix as
open(11,file=ASMAP,status='old',IOSTAT=ios,iomsg=msg)
if (ios/=0)then
write(*,*) msg
stop
endif
do i=1,nasite
read(11,*)(map(i,j),j=1,ntsite)
end do
write(*,*) "Reading AS MAP complete"
close(11)
and the output is:
2 3 4 5 6
7 8 9 10 11 12
13 14
as is expected.
what is going wrong?
.
- Follow-Ups:
- Re: error in reading matrix
- From: Richard Maine
- Re: error in reading matrix
- Prev by Date: Re: How to compile Mopac 7.1 using g77 or gfortran
- Next by Date: Re: error in reading matrix
- Previous by thread: Alternative to
- Next by thread: Re: error in reading matrix
- Index(es):
Relevant Pages
|