- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

I'm coding pretty big program on cluster, and in one of the subroutines (big_one) I have 2 external routines (their codes are in the end of my message) for computing max eigenvalue. When I'm using one of them, program works. When I'm using another one program exits with error:

forrtl: severe (40): recursive I/O operation, unit -1, file unknownI don't understand logic of error's appearence. It connected somehow with operators sort of "write(*,*) .... ", but why there is recursive operation, I don't know. By throwing out such operators I can delay error, but eventually it happens around such operator. Maybe, deleting all of them will help, but I'd like to understand what's happening. I'll be grateful for any suggestions and advice.

1) routine, which works:

...

END SUBROUTINE big_one

real*8 function maxermeig(N,A) !ne uchityvaetsa symmetrichnost'

!computes maximal eigenvalue of (A+A*)/2

implicit none

integer, intent (in) :: N

real*8 RWORK(N), eig_max

complex*16, intent (in) :: A(N,N)

complex*16 VL(1,1), VR(1,1), W(N), WORK(3*N)

integer INFO, LDA, LDVL, LDVR, LWORK, i

LDA=N

LDVL=1

LDVR=1

LWORK=3*N

call ZGEEV('N','N',N,(A+conjg(transpose(A)))/2.d0,LDA,W,vL,LDVL,VR,LDVR,WORK,LWORK,RWORK,INFO)

if (INFO.ne.0) then

write(*,*) 'maxermeig warning, info=',INFO

endif

eig_max=-4.D+100

do i=1,N

if (dble(w(i)).gt.eig_max) then

eig_max=dble(w(i))

endif

enddo

maxermeig=eig_max

end function maxermeig

2) routine, which crushes program:

Unfortunately, cluster has gone down and I don't have its code right now. The thing is - matrix is symmetric, so I wanted to use this and find it's eigenvalue by proper routines. I used zhetrd to reduce matrix and dsterg to solve problem.

Link Copied

2 Replies

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

**maxermeig**, and the variable INFO happens to have such a value as to attempt to do I/O in that function, then you will have a situation of recursive I/O, which will either give you a run-time error or mysterious crashes.

The cure is simple. Instead of coding

write(..,..) aa,bb,maxermeig(...),...

do

tmpvar = maxermeig(...)

write(...,...) aa,bb,tmpvar,...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

But anyway thanks for reply, mecej4.

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page