1!
2!     CalculiX - A 3-dimensional finite element program
3!              Copyright (C) 1998-2021 Guido Dhondt
4!
5!     This program is free software; you can redistribute it and/or
6!     modify it under the terms of the GNU General Public License as
7!     published by the Free Software Foundation(version 2);
8!
9!
10!     This program is distributed in the hope that it will be useful,
11!     but WITHOUT ANY WARRANTY; without even the implied warranty of
12!     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13!     GNU General Public License for more details.
14!
15!     You should have received a copy of the GNU General Public License
16!     along with this program; if not, write to the Free Software
17!     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18!
19      subroutine writeev(x,nx,xmin,xmax)
20!
21!     writes the eigenvalues in the .dat file and replaces the
22!     eigenvalue by its square root = frequency (in rad/time)
23!
24      implicit none
25!
26      integer j,nx
27      real*8 x(nx),pi,xmin,xmax,xnull
28!
29!     for real symmetric matrices the eigenvalue is real;
30!     the frequency, which is the square root of the eigenvalue
31!     can be real or complex (in the latter case buckling occurs)
32!
33      pi=4.d0*datan(1.d0)
34      xnull=0.d0
35!
36      write(5,*)
37      write(5,*) '    E I G E N V A L U E   O U T P U T'
38      write(5,*)
39      write(5,*) 'MODE NO    EIGENVALUE                       FREQUENCY
40     &  '
41      write(5,*) '                                    REAL PART
42     &   IMAGINARY PART'
43      write(5,*) '                          (RAD/TIME)      (CYCLES/TIME
44     &     (RAD/TIME)'
45      write(5,*)
46!
47      do j=1,nx
48!
49!        user-defined minimum frequency
50!
51         if(xmin.gt.-0.5d0) then
52            if(xmin*xmin.gt.x(j)) cycle
53         endif
54!
55!        user-defined maximum frequency
56!
57         if(xmax.gt.-0.5d0) then
58            if(xmax*xmax.lt.x(j)) exit
59         endif
60!
61         if(x(j).lt.0.d0) then
62            write(5,'(i7,4(2x,e14.7))') j,x(j),xnull,
63     &         xnull,dsqrt(-x(j))
64         else
65            write(5,'(i7,4(2x,e14.7))') j,x(j),dsqrt(x(j)),
66     &     dsqrt(x(j))/(2.d0*pi),xnull
67         endif
68      enddo
69!
70      return
71      end
72
73