Google Answers Logo
View Question
 
Q: Fortran programming ( No Answer,   0 Comments )
Question  
Subject: Fortran programming
Category: Computers > Programming
Asked by: antara-ga
List Price: $20.00
Posted: 06 Oct 2003 07:10 PDT
Expires: 06 Oct 2003 08:12 PDT
Question ID: 263061
Hello,
I would like to read a complex matrix (see the input data below) in
Fortran 77 running on AIX. Following is my program:
------------------------begin program----------
	  Implicit none
	  complex*16 A(8,8), ap(10), aux(12,12) 
             real*8 w(4) 
	  integer i, j, n, iopt, ldz, naux, k ,nmax
          open(1,file='input2.txt')  
          open(2,file='test1005.out')
          n=4
          nmax=8 
          if (n.le.nmax) then
          read(1,*)((A(i,j),j=1,4),i=1,4)
          do 10 i=1,4
          write(2,*)(A(i,j),j=1,4) 
10        continue
c find the solution using the LAPACK routine ZHPEV
c          iopt=20
c         ldz=1
c          naux=12  
c          k = 0
c          do 1 j=1,n
c          do 2 i=1,j
c          k = k+1
c          ap(k)=A(i,j)
c   2      continue
c   1      continue
c	  call ZHPEV(iopt,ap,w,n,aux,naux)
c          do 20 i=1,4
c          write(2,*)w(i)
c20        continue  
          endif
          stop
 	  end 
--------------------end program------------------------------------
Upon compilation, it provides following error message : “1525-043 The
list-directed or NAMELIST READ statement cannot be completed because
the input data in the file input2.txt did not specify a valid complex
value.  The program will recover by discontinuing further processing
of the READ statement.”
--------------------begin input2.txt-----------
(3.0, 0.0) (1.0, 0.0) (0.0, 0.0) (0.0, 2.0)
(1.0, 0.0) (3.0, 0.0) (0.0,-2,0) (0.0, 0.0)
(0.0,-2.0) (0.0, 2.0) (1.0, 0.0) (1.0, 0.0)
(0.0,-2,0) (0.0, 0.0) (1.0, 0.0) (1.0, 0.0)
--------------------end input2.txt------------------

My objective is to read a complex matrix in Fortran. In my data set
the first element is the real part and the second element is the
imaginary part in each cell. I can change the input data format if
needed, for Fortran to understand it. Please let me know if you have
any clarifying question.
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy