Google Answers Logo
View Question
 
Q: Fortran code with LAPACK ( No Answer,   0 Comments )
Question  
Subject: Fortran code with LAPACK
Category: Computers > Programming
Asked by: antara-ga
List Price: $20.00
Posted: 04 Oct 2003 20:40 PDT
Expires: 03 Nov 2003 19:40 PST
Question ID: 262823
Hello,

I have a fortran code where I want to diagonalize a complex Hermitian
matrix. I'm using Lapack subroutine "ZHPEV" for diagonalization.
Following link provides the usage of "ZHPEV":
http://publib.boulder.ibm.com/doc_link/en_US/a_doc_lib/sp34/essl/essl192.html

I'm getting syntax error message for using "ap" parameter where the
"." is used in the place of complex character (in line 25 of the code
below).
-------------------------begin---------------------------
c finding the eigenvalues of a complex matrix using LAPACK
	Implicit none
c declarations, notice double precision
	complex*16 A(3,3), w(3), ap(6), aux(9,9) 
	integer i, j, n, iopt, naux 
         open(2,file='test1004.out') 
c define matrix A
	A(1,1)=(3.1, -1.8)
	A(1,2)=(1.3, 0.2) 
	A(1,3)=(-5.7, -4.3)
	A(2,1)=(1.3, 0)
	A(2,2)=(-6.9, 3.2)
	A(2,3)=(5.8, 2.2)
	A(3,1)=(5.7, -4.0)
	A(3,2)=(5.8, 2.9)
	A(3,3)=(-8.8, 3.2)
        do 10 i=1,3
        write(2,11)(A(i,j),j=1,3) 
10      continue
11      format(f6.2)
c
c find the solution using the LAPACK routine ZGEEV
	call ZGPEV(iopt,ap,w,n,aux,naux)
        iopt=20
        ap(6)=((3.1, .), (1.3, 0.2), (-6.9, .), (-5.7,-4.3),
     &  (5.8, 2.2), (-8.8, .))
        n=3
        naux=9  
c output of eigenvalues
c	if (ok .eq. 0) then
c	   do i=1, 3
c	      write(*,*) w(i)
c	   enddo
c	else
c	   write (*,*) "An error occured"
c	endif
         stop
 	 end
-------------------------end---------------------------
 
I'd appreciate if anyone can help me in fixing this problem.

Request for Question Clarification by hedgie-ga on 04 Oct 2003 21:17 PDT
Hi antara,
 

It would help to post the source with line numbers
and also  the error message.

But, if I am counting lines correctly, your error
happens after the call to the sub and may have
nothing to do with it.

I would check if & is indeed in col. 6,
comment out the subroutine call,
then comment out thr ap(6)= statement (both lines)

and observe when the sysntax error dispappear...

Let us know
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