lect_data_prop.F90 6.68 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
!!-------------------------------------------------------
!!---- Relaxed Selected Excitation (RelaxSE)
!!-------------------------------------------------------
!!---- This file is part of RelaxSE
!!---- 
!!---- The RelaxSE project is distributed under LGPL. In agreement with the
!!---- Intergovernmental Convention of the ILL, this software cannot be used
!!---- in military applications.
!!---- 
!!---- Copyright (C) 2016-2021  Institut Laue-Langevin (ILL), Grenoble, FRANCE
!!----                          Institut Neel - CNRS-UPR2940 (CNRS), Grenoble, FRANCE
!!---- 
!!---- Authors: Elisa REBOLINI (ILL)             rebolini@ill.fr
!!----          Marie-Bernadette LEPETIT (CNRS)  Marie-Bernadette.Lepetit@neel.cnrs.fr
!!---- 
!!---- RelaxSE is free software; you can redistribute it and/or
!!---- modify it under the terms of the GNU Lesser General Public
!!---- License as published by the Free Software Foundation; either
!!---- version 3.0 of the License, or (at your option) any later version.
!!---- 
!!---- RelaxSE is distributed in the hope that it will be useful,
!!---- but WITHOUT ANY WARRANTY; without even the implied warranty of
!!---- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
!!---- Lesser General Public License for more details.
!!---- 
!!---- You should have received a copy of the GNU Lesser General Public
!!---- License along with this library; if not, see <http://www.gnu.org/licenses/>.
!!---- 


!!$==================================================================== 
!$====================================================================
!> @brief Read the x_info for property code 
!> @author MBL
!> @date avril 2020
!
!> @param[inout] prog_info,g_info,o_info,v_info,det_info,sym_info,f_info
!$====================================================================
Subroutine lect_info(prog_info,g_info,o_info,v_info,det_info,&
     nblock,shtblkdet,nblkdet,deter_index,sym_info,iunit)
  use files
  use info
  use info_prop

  implicit none
  
  type(prog_infotype),   intent(inout) :: prog_info
  type(g_infotype),      intent(inout) :: g_info
  type(o_infotype),      intent(inout) :: o_info
  type(v_infotype),      intent(inout) :: v_info
  type(det_infotype),    intent(inout) :: det_info
  type(sym_infotype),    intent(inout) :: sym_info
  Integer, dimension(:), allocatable, intent(out) :: shtblkdet, nblkdet, deter_index
  integer,               intent(inout) :: nblock
  integer,               intent(in)    :: iunit

  read(iunit) prog_info
  read(iunit) g_info
  read(iunit) o_info
  read(iunit) v_info
  read(iunit) det_info
  read(iunit) nblock
  allocate(shtblkdet(nblock), nblkdet(nblock), deter_index(nblock))
  shtblkdet(:) = 0
  nblkdet(:)   = 0
  deter_index  = 99
  print *, "  nblock=",nblock
  read(iunit) shtblkdet(1:nblock), nblkdet(1:nblock), deter_index(1:nblock)
  read(iunit) sym_info

end Subroutine lect_info


!$====================================================================
!> @brief Read input for properties prop_info
!> @author MBL
!> @date avril 2020
!
!> @param[in] iunit Input file unit
!> @param[inout] prop_info Type for properties added info
!$====================================================================
subroutine read_propinp(prop_info, nref0lu, iunit)
  use dimensions
  use utils_char
  use info_prop

  implicit none
  integer, intent(in)                :: iunit
  type(prop_infotype), intent(inout) :: prop_info
  integer(kd_int),     intent(inout) :: nref0lu
  integer(kd_int) :: nprop
  character*5, dimension(:), allocatable :: whichprop
  integer (KIND=kd_int) :: stot, sz, vec_irrep, nvec, &
       nref0, nelact, itmp
95
  Real (KIND=kd_dble) :: seuilcoef
96
  
97
  namelist /propinp/ nprop, whichprop, seuilcoef
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
  namelist /vecinp/ stot, sz, vec_irrep, nvec, nref0, nelact

  ! vecinp
  stot = 1
  sz   = 0
  vec_irrep = 1
  nvec = 1

  nref0 = 1
  nelact = 0
  read(iunit, vecinp)

  nref0lu = nref0

  ! prop_info
  rewind(iunit)
  nprop = 0
  allocate(whichprop(nprop_max))
  whichprop(1:nprop_max) = "xxxxx"
117
  seuilcoef = 0.05d0
118
119
120
121
  read(iunit, propinp)

  prop_info%nprop = nprop
  prop_info%whichprop(1:nprop) =  whichprop(1:nprop)
122
  prop_info%seuilcoef = seuilcoef
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205

end subroutine read_propinp

!$====================================================================
!> @brief Read bdet file
!> @author MBL
!> @date avril 2020
!
!> @param[in] iunit Input file unit
!> @param[in] ndet Input number of det to be read
!> @param[inout] det array
!$===================================================================
subroutine  read_bdet(det,ndet,iunit)
  use typedet

  implicit none
  type(deter), dimension(ndet), intent(inout) ::  det
  integer,                         intent(in) :: iunit, ndet
  integer :: idet
  
  do idet = 1,ndet
     read(iunit) det(idet)%detact, det(idet)%dettr,  det(idet)%detprt
  end do
  
end subroutine read_bdet


  !$====================================================================
  !> @brief Read vectors  file f_restart
  !> @author MBL
  !> @date Avril  2020
  !
  !> @param[inout] psi :  vectors
  !> @param[in] ndet : Nb of determinants
  !> @param[in] nvec : Number of states 
  !$==================================================================== 
subroutine  lect_vect(psi, ener, ndet, nvec)
  use dimensions
  use files
  implicit none
  integer, intent(in) :: ndet, nvec
  real(kd_dble), dimension(ndet,nvec), intent(inout) :: psi
  real(kd_dble), dimension(nvec),      intent(inout) :: ener
  real(kd_dble) :: Ecoeur, potnuc
  Integer :: nvectot, ndettot, nconv, iter
  Integer :: idet, ivec, ierr

  rewind (f_restart)
  read(f_restart) nvectot,ndettot,nconv, iter
  if (nvec.ne.nvectot) then
     call SASS_quit('Error in nb of vectors read from file', f_output)
  end if
  if (ndet.ne.ndettot) then
     write(f_output,'("   ndet =", i10, "  ndettot =", i10)') ndet, ndettot
     call SASS_quit('Error in nb of determinants read from file', f_output)
  end if
  !print *, " nvectot,ndettot,nconv, iter=", nvectot,ndettot,nconv, iter
  
  read(f_restart) Ecoeur,PotNuc
  !print *, " Ecoeur,PotNuc=",Ecoeur,PotNuc
  
  read(f_restart) (ener(ivec), ivec =1,nvec)
  ener(1:nvec) =   ener(1:nvec) + Ecoeur + PotNuc
  !print *, "ener read ", ener
  
  do ivec = 1, nvectot
     read(f_restart,iostat=ierr) (psi(idet,ivec),idet=1,ndet)
  end do
  
  write(f_output,*) "    Vectors read from file"
  write(f_output,*) "    Nbre of vectors read      =", nvectot
  write(f_output,*) "    Nbre of determinants      =", ndettot
  write(f_output,*) "    Nbre of converged vectors =", nconv
  write(f_output,*) "    Last iteration            =", iter
  write(f_output,*) "    Nuclear potential energy  =", PotNuc
  write(f_output,*) "    Core electrons energy     =", Ecoeur
  flush(f_output)
  
end subroutine lect_vect

!!$ Local Variables:
!!$   coding: utf-8-unix
!!$ End: