Line data Source code
1 : !--------------------------------------------------------------------------------
2 : ! Copyright (c) 2016 Peter Grünberg Institut, Forschungszentrum Jülich, Germany
3 : ! This file is part of FLEUR and available as free software under the conditions
4 : ! of the MIT license as expressed in the LICENSE file in more detail.
5 : !--------------------------------------------------------------------------------
6 :
7 : MODULE m_cdnread
8 : use m_juDFT
9 : #ifdef CPP_MPI
10 : use mpi
11 : #endif
12 : !------------------------------------------------------------------------
13 : ! Two subroutines to read in the information stored on the 'eig'-file
14 : ! cdn_read0: reads energy-parameters and number of bands stored/pe
15 : ! cdn_read : reads finally the eigenvalues and vectors
16 : ! gb`04
17 : !------------------------------------------------------------------------
18 : CONTAINS
19 2 : SUBROUTINE cdn_read0(
20 : > eig_id,
21 : > irank,isize,jspin,jspins,
22 : > l_noco,
23 2 : < n_bands,n_size)
24 : USE m_eig66_io, ONLY : read_eig
25 : IMPLICIT NONE
26 :
27 : ! Arguments ...
28 : INTEGER, INTENT (IN) :: eig_id,irank,isize
29 : INTEGER, INTENT (IN) :: jspin,jspins
30 : LOGICAL, INTENT (IN) :: l_noco
31 :
32 :
33 : INTEGER, INTENT (OUT) :: n_size
34 :
35 : INTEGER, INTENT (OUT) :: n_bands(0:) !n_bands(0:neigd)
36 :
37 : INTEGER isp
38 :
39 2 : isp = MERGE(1,jspin,l_noco)
40 :
41 2 : CALL read_eig(eig_id,1,isp,neig=n_bands(1))
42 :
43 : c n_size is the number of records per k-point,
44 : c n_bands(i) the number of ev's processed on n_rank=0...i-1
45 :
46 2 : n_size = 1
47 :
48 2 : n_bands(0) = 0
49 :
50 2 : END SUBROUTINE cdn_read0
51 : !
52 : !--------------------------------------------------------------------
53 : !--------------------------------------------------------------------
54 : !
55 48 : SUBROUTINE cdn_read(
56 : > eig_id,nvd,jspd,irank,isize,
57 : > ikpt,jspin,nbasfcn,l_ss,l_noco,
58 : > noccbd,n_start,n_end,
59 48 : < nbands,eig,zmat)
60 :
61 : USE m_eig66_io, ONLY : read_eig
62 : USE m_types
63 :
64 : IMPLICIT NONE
65 : !
66 : ! Arguments ...
67 : !
68 : INTEGER, INTENT (IN) :: eig_id,irank,isize,ikpt,nbasfcn
69 : INTEGER, INTENT (IN) :: nvd,jspd,jspin
70 : INTEGER, INTENT (IN) :: noccbd,n_start,n_end
71 : LOGICAL, INTENT (IN) :: l_ss,l_noco
72 : INTEGER, INTENT (OUT) :: nbands
73 :
74 : REAL, INTENT (OUT) :: eig(:) !bkpt(3),eig(neigd)
75 :
76 : TYPE(t_mat), INTENT (INOUT) :: zmat !z(nbasfcn,noccbd) !can be real/complex
77 :
78 : ! Local variables ...
79 : INTEGER :: isp,i
80 : #ifdef CPP_MPI
81 : INTEGER mpiierr
82 : #endif
83 :
84 48 : isp = MERGE(1,jspin,l_noco)
85 :
86 48 : CALL timestart("cdn_read")
87 :
88 : CALL read_eig(eig_id,ikpt,isp,list=[(i,i=n_start,n_end)],
89 912 : < neig=nbands,eig=eig,zmat=zmat)
90 :
91 48 : CALL timestop("cdn_read")
92 :
93 : ! IF (nbands>neigd) CALL juDFT_error("nbands.GT.neigd",calledby
94 : ! + ="cdn_read")
95 :
96 48 : END SUBROUTINE cdn_read
97 : END MODULE m_cdnread
|