Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7589997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:18:03+00:00 2026-05-30T20:18:03+00:00

I am trying to get the ZGEEV routine in Lapack to work for a

  • 0

I am trying to get the ZGEEV routine in Lapack to work for a test problem and having some difficulties. I just started coding in FORTRAN a week ago, so I think it is probably something very trivial that I am missing.

I have to diagonalize rather large complex symmetric matrices. To get started, using Matlab I created a 200 by 200 matrix, which I have verified is diagonalizable. When I run the code, it brings up no errors and the INFO = 0, suggesting a success. However, all the eigenvalues are (0,0) which I know is wrong.

Attached is my code.

PROGRAM speed_zgeev
  IMPLICIT NONE
  INTEGER(8)  :: N
  COMPLEX*16, DIMENSION(:,:), ALLOCATABLE :: MAT
  INTEGER(8) :: INFO, I, J
  COMPLEX*16, DIMENSION(:), ALLOCATABLE :: RWORK
  COMPLEX*16, DIMENSION(:), ALLOCATABLE :: D
  COMPLEX*16, DIMENSION(1,1) :: VR, VL
  INTEGER(8) :: LWORK = -1
  COMPLEX*16, DIMENSION(:), ALLOCATABLE :: WORK
  DOUBLE PRECISION :: RPART, IPART

  EXTERNAL ZGEEV
  N = 200

  ALLOCATE(D(N))
  ALLOCATE(RWORK(2*N))
  ALLOCATE(WORK(N))
  ALLOCATE(MAT(N,N))

  OPEN(UNIT = 31, FILE = "newmat.txt")
  OPEN(UNIT = 32, FILE = "newmati.txt")
  DO J = 1,N
     DO I = 1,N
    READ(31,*) RPART
    READ(32,*) IPART
    MAT(I,J) = CMPLX(RPART, IPART)
     END DO
  END DO

  CLOSE(31)
  CLOSE(32)

  CALL ZGEEV('N','N', N, MAT, N, D, VL, 1, VR, 1, WORK, LWORK, RWORK, INFO)
  INFO = WORK(1)

  DEALLOCATE(WORK)
  ALLOCATE(WORK(INFO))

  CALL ZGEEV('N','N', N, MAT, N, D, VL, 1, VR, 1, WORK, LWORK, RWORK, INFO)

  IF (INFO .EQ. 0) THEN
     PRINT*, D(1:10)
  ELSE
     PRINT*, INFO
  END IF

  DEALLOCATE(MAT)
  DEALLOCATE(D)
  DEALLOCATE(RWORK)
  DEALLOCATE(WORK)


END PROGRAM speed_zgeev

I have tried the same code on smaller matrices, of size 30 by 30 and they work fine. Any help would be appreciated! Thanks.

I forgot to mention that I am loading the matrices from a test file which I have verified to be working right.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T20:18:03+00:00Added an answer on May 30, 2026 at 8:18 pm

    Maybe LWORK = WORK (1) instead of INFO = WORK(1)? Also change ALLOCATE(WORK(INFO)).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying get Struts 2 and Tiles to work and I am using
trying to get some data from a plist into the MWPhotoBrowser sample app. Any
I'm trying get all of the current stack frames and do some inspection on
Hello everyone I been trying get php uploader working but having a lot of
I've been at this for 12+ exhausting hours trying get it to work on
Ok, I just bought the new 27 inch iMac and I am trying get
I'm trying get LocalConnection to work between two swf's placed within two different IFRAMES.
Well, I'm trying get some values from places.sqlite database. But when I do $
I'm trying get some licensing code from AndroidPit.com working, but I get Unable to
I am trying get Javascript popup calendar control to work which doesnt work. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.