Branch data Line data Source code
1 : : !!****m* ABINIT/m_scup_dataset
2 : : !! NAME
3 : : !! m_scup_dataset
4 : : !!
5 : : !! FUNCTION
6 : : !! module with the type of the input variables for scale_up
7 : : !! when initialized this is a subtype of multibinit_dtset_type
8 : : !!
9 : : !! COPYRIGHT
10 : : !! Copyright (C) 2014-2026 ABINIT group (AM)
11 : : !! This file is distributed under the terms of the
12 : : !! GNU General Public License, see ~abinit/COPYING
13 : : !! or http://www.gnu.org/copyleft/gpl.txt .
14 : : !!
15 : : !! SOURCE
16 : :
17 : : #if defined HAVE_CONFIG_H
18 : : #include "config.h"
19 : : #endif
20 : :
21 : : #include "abi_common.h"
22 : :
23 : : module m_scup_dataset
24 : :
25 : : use defs_basis
26 : : use m_abicore
27 : : use m_errors
28 : : use m_bz_mesh
29 : :
30 : : use m_parser, only : intagm
31 : : use m_matrix, only : matr3inv
32 : :
33 : : implicit none
34 : :
35 : : private
36 : :
37 : : public :: scup_dtset_type
38 : : public :: scup_dtset_init
39 : : public :: scup_dtset_free
40 : : public :: outvars_scup
41 : : public :: invars10scup
42 : : public :: scup_kpath_new
43 : : public :: scup_kpath_print
44 : : !!***
45 : :
46 : : !!****t* m_scup_dataset/scup_dtset_type
47 : : !! NAME
48 : : !! scup_dtset_type
49 : : !!
50 : : !! FUNCTION
51 : : !! The scup_dtset_type structured datatype
52 : : !! gathers all input variables and options for the SCALE UP part
53 : : !! that is linked with multibinit
54 : : !!
55 : : !! SOURCE
56 : :
57 : : type scup_dtset_type
58 : :
59 : : !Integer
60 : : integer :: scup_nspeck
61 : : integer :: scup_ndivsm
62 : : integer :: scup_printniter
63 : : integer :: scup_startpulay
64 : : integer :: scup_maxscfstep
65 : : !Logicals
66 : : logical :: scup_elec_model
67 : : logical :: scup_initorbocc
68 : : logical :: scup_ismagnetic
69 : : logical :: scup_istddft
70 : : logical :: scup_printbands
71 : : logical :: scup_printeigv
72 : : logical :: scup_printeltic
73 : : logical :: scup_printgeom
74 : : logical :: scup_printorbocc
75 : : logical(1) :: scup_freezden
76 : : !Real
77 : : real*8 :: scup_tcharge
78 : : real*8 :: scup_scfmixing
79 : : real*8 :: scup_scfthresh
80 : : real*8 :: scup_smearing
81 : : !Integer Array
82 : : integer :: scup_ksamp(3)
83 : :
84 : : !Real Array
85 : : real(dp),allocatable :: scup_speck(:,:)
86 : :
87 : : !Kpath Type
88 : : type(kpath_t) :: scup_kpath
89 : :
90 : : end type scup_dtset_type
91 : : !!***
92 : : CONTAINS
93 : :
94 : : !!****f* m_scup_dataset/scup_dtset_init
95 : : !!
96 : : !! NAME
97 : : !! scup_dtset_init
98 : : !!
99 : : !! FUNCTION
100 : : !! Init the scup_dtset type
101 : : !!
102 : : !! INPUTS
103 : : !!
104 : : !!
105 : : !! OUTPUT
106 : : !! scup_dtset <type(scup_dtset_type)> = datatype with all the input variables
107 : : !!
108 : : !! NOTES
109 : : !! Should be executed by one processor only.
110 : : !!
111 : : !! SOURCE
112 : :
113 : 73 : subroutine scup_dtset_init(scup_dtset)
114 : :
115 : :
116 : : !Arguments -------------------------------
117 : : class(scup_dtset_type),intent(inout) :: scup_dtset
118 : : !-----------------------------------------
119 : :
120 : 73 : scup_dtset%scup_ndivsm = 0
121 : 73 : scup_dtset%scup_nspeck = 0
122 : 73 : scup_dtset%scup_elec_model = .FALSE.
123 [ + + ]: 292 : scup_dtset%scup_ksamp = (/ 1, 1, 1 /)
124 : 73 : scup_dtset%scup_tcharge = 0
125 : 73 : scup_dtset%scup_initorbocc = .FALSE.
126 : 73 : scup_dtset%scup_ismagnetic = .FALSE.
127 : 73 : scup_dtset%scup_istddft = .FALSE.
128 : 73 : scup_dtset%scup_printbands = .FALSE.
129 : 73 : scup_dtset%scup_printeigv = .FALSE.
130 : 73 : scup_dtset%scup_printeltic = .FALSE.
131 : 73 : scup_dtset%scup_printgeom = .FALSE.
132 : 73 : scup_dtset%scup_printniter = 0
133 : 73 : scup_dtset%scup_printorbocc = .FALSE.
134 : 73 : scup_dtset%scup_freezden = .FALSE.
135 : 73 : scup_dtset%scup_scfmixing = 0.3
136 : 73 : scup_dtset%scup_scfthresh = tol6
137 : 73 : scup_dtset%scup_smearing = 0.00091873313 ! Room Temperature in Hartree
138 : 73 : scup_dtset%scup_startpulay = 3
139 : 73 : scup_dtset%scup_maxscfstep = 100
140 : :
141 : 73 : end subroutine scup_dtset_init
142 : : !!***
143 : :
144 : : !!****f* m_scup_dataset/scup_dtset_free
145 : : !!
146 : : !! NAME
147 : : !! scup_dtset_free
148 : : !!
149 : : !! FUNCTION
150 : : !! deallocate remaining arrays in the scup_dtset datastructure
151 : : !!
152 : : !! INPUTS
153 : : !! scup_dtset <type(scup_dtset_type)> = scup_dataset structure
154 : : !!
155 : : !! OUTPUTS
156 : : !! scup_dtset <type(scup_dtset_type)> = scup_dataset structure
157 : : !!
158 : : !! SOURCE
159 : :
160 : 73 : subroutine scup_dtset_free(scup_dtset)
161 : :
162 : : !Arguments ------------------------------------
163 : : class(scup_dtset_type), intent(inout) :: scup_dtset
164 : :
165 : : ! *************************************************************************
166 : :
167 [ - + ]: 73 : ABI_SFREE(scup_dtset%scup_speck)
168 : :
169 : 73 : call scup_dtset%scup_kpath%free
170 : :
171 : :
172 : 73 : end subroutine scup_dtset_free
173 : : !!***
174 : :
175 : : !!****f* m_scup_dataset/outvars_scup
176 : : !!
177 : : !! NAME
178 : : !! outvars_scup
179 : : !!
180 : : !! FUNCTION
181 : : !! Takes as an input the input dtset for scup and echoes it to
182 : : !! the output
183 : : !!
184 : : !! INPUTS
185 : : !! multibinit_dtset <type(multibinit_dtset_type)> datatype with all the input variables
186 : : !! nunit=unit number for input or output
187 : : !!
188 : : !! OUTPUT
189 : : !! (only writing)
190 : : !!
191 : : !! NOTES
192 : : !! Should be executed by one processor only.
193 : : !!
194 : : !! SOURCE
195 : :
196 : 0 : subroutine outvars_scup(scup_dtset,nunit)
197 : :
198 : : !Arguments -------------------------------
199 : : !scalars
200 : : integer,intent(in) :: nunit
201 : : class(scup_dtset_type),intent(in) :: scup_dtset
202 : :
203 : : !Local variables -------------------------
204 : : !Set routine version number here:
205 : : !scalars
206 : : !integers for printing
207 : : integer :: int_inorb=0,int_mgn=0,int_tddft=0,int_pband=0
208 : : integer :: int_peigv=0,int_peltic=0,int_pgeom=0,int_porbocc=0
209 : : integer :: int_freezden=0
210 : : !Character for defining format string
211 : : !*********************************************************************
212 : :
213 : : !Check if logicals are true, if yes set integers to one for printing
214 [ # # ]: 0 : if(scup_dtset%scup_initorbocc) int_inorb =1
215 [ # # ]: 0 : if(scup_dtset%scup_ismagnetic) int_mgn =1
216 [ # # ]: 0 : if(scup_dtset%scup_istddft) int_tddft =1
217 [ # # ]: 0 : if(scup_dtset%scup_printbands) int_pband =1
218 [ # # ]: 0 : if(scup_dtset%scup_printeigv) int_peigv =1
219 [ # # ]: 0 : if(scup_dtset%scup_printeltic) int_peltic =1
220 [ # # ]: 0 : if(scup_dtset%scup_printgeom) int_pgeom =1
221 [ # # ]: 0 : if(scup_dtset%scup_printorbocc) int_porbocc =1
222 [ # # ]: 0 : if(scup_dtset%scup_freezden) int_freezden =1
223 : :
224 : : !Print
225 : 0 : write(nunit,'(a)')'Variables for SCALE-UP electronic model :'
226 : 0 : write(nunit,'(1x,a16,3I3)') ' scup_ksamp',scup_dtset%scup_ksamp
227 : 0 : write(nunit,'(1x,a16,F7.3)') ' scup_tcharge',scup_dtset%scup_tcharge
228 : 0 : write(nunit,'(1x,a16,I3)') ' scup_initorbocc',int_inorb
229 : 0 : write(nunit,'(1x,a16,I3)') ' scup_ismagnetic',int_mgn
230 : 0 : write(nunit,'(1x,a16,I3)') ' scup_istddft',int_tddft
231 : 0 : write(nunit,'(1x,a16,I3)') ' scup_printbands',int_pband
232 : 0 : write(nunit,'(1x,a16,I3)') ' scup_printeigv',int_peigv
233 : 0 : write(nunit,'(1x,a16,I3)') ' scup_printeltic',int_peltic
234 : 0 : write(nunit,'(1x,a16,I3)') ' scup_printgeom',int_pgeom
235 : 0 : write(nunit,'(1x,a16,I3)') ' scup_printniter',scup_dtset%scup_printniter
236 : 0 : write(nunit,'(1x,a16,I3)') 'scup_printorbocc',int_porbocc
237 : 0 : write(nunit,'(1x,a16,I3)') ' scup_freezden',int_freezden
238 : 0 : write(nunit,'(1x,a16,I3)') ' scup_nspeck',scup_dtset%scup_nspeck
239 : 0 : write(nunit,'(1x,a16,I3)') ' scup_ndivsm',scup_dtset%scup_ndivsm
240 : 0 : write(nunit,'(1x,a16,F7.3)') ' scup_scfmixing',scup_dtset%scup_scfmixing
241 : 0 : write(nunit,'(1x,a16,ES10.2)') ' scup_scfthresh',scup_dtset%scup_scfthresh
242 : 0 : write(nunit,'(1x,a16,ES10.2)') ' scup_smearing',scup_dtset%scup_smearing
243 : 0 : write(nunit,'(1x,a16,I3)') ' scup_startpulay',scup_dtset%scup_startpulay
244 : 0 : write(nunit,'(1x,a16,I3)') ' scup_maxscfstep',scup_dtset%scup_maxscfstep
245 : :
246 : :
247 : 0 : end subroutine outvars_scup
248 : : !!***
249 : :
250 : : !!****f* m_scup_dataset/invars10scup
251 : : !!
252 : : !! NAME
253 : : !! invars10scup
254 : : !!
255 : : !! FUNCTION
256 : : !! Open input file for the multibinit code, then reads or echoes the input information
257 : : !! for SCALE UP part that is linked with multibinit.
258 : : !!
259 : : !! INPUTS
260 : : !! lenstr=actual length of string
261 : : !! natom=number of atoms, needed for atifc
262 : : !! string*(*)=string of characters containing all input variables and data
263 : : !!
264 : : !! OUTPUT
265 : : !! scup_dtset <type(scup_dtset_type)> = datatype with all the input variables
266 : : !!
267 : : !! NOTES
268 : : !! Should be executed by one processor only.
269 : : !!
270 : : !! SOURCE
271 : :
272 : 73 : subroutine invars10scup(scup_dtset,lenstr,string)
273 : :
274 : : !Arguments -------------------------------
275 : : !scalars
276 : : integer,intent(in) :: lenstr
277 : : character(len=*),intent(in) :: string
278 : : class(scup_dtset_type),intent(inout) :: scup_dtset
279 : :
280 : : !Local variables -------------------------
281 : : !Dummy arguments for subroutine 'intagm' to parse input file
282 : : !Set routine version number here:
283 : : !scalars
284 : : integer :: ii,jdtset,marr,tread
285 : : character(len=500) :: message
286 : : !arrays
287 : 73 : integer,allocatable :: intarr(:)
288 : 73 : real(dp),allocatable :: dprarr(:)
289 : : !tmp integer to transfer to logicals
290 : : integer :: tmp_int
291 : :
292 : : !*********************************************************************
293 : :
294 : 73 : marr=30
295 [ - + ]: 73 : ABI_MALLOC(intarr,(marr))
296 [ - + ]: 73 : ABI_MALLOC(dprarr,(marr))
297 : :
298 : 73 : jdtset=1
299 : :
300 : : !=====================================================================
301 : : ! Initialize Dataset with default values
302 : : !=====================================================================
303 : :
304 : 73 : call scup_dtset_init(scup_dtset)
305 : 73 : tmp_int=0
306 : :
307 : : !=====================================================================
308 : : !start reading in dimensions and non-dependent variables
309 : : !=====================================================================
310 : :
311 : : !A
312 : : !B
313 : : !C
314 : : !D
315 : : !E
316 : 73 : call intagm(dprarr,intarr,jdtset,marr,1,string(1:lenstr),'scup_elec_model',tread,'INT')
317 [ - + ]: 73 : if(tread==1) tmp_int=intarr(1)
318 [ - + ]: 73 : if(tmp_int<0 .or. tmp_int>1 )then
319 : : write(message, '(a,I3,a,a,a,a,a)' )&
320 : 0 : & 'scup_elec_model is',tmp_int,', but the only allowed values',ch10,&
321 : 0 : & 'are 0 and 1.',ch10,&
322 : 0 : & 'Action: correct scup_elec_model in your input file.'
323 : 0 : ABI_ERROR(message)
324 : : end if
325 [ - + ]: 73 : if(tmp_int == 1) scup_dtset%scup_elec_model = .TRUE.
326 : 73 : tmp_int = 0
327 : :
328 : : !F
329 : 73 : call intagm(dprarr,intarr,jdtset,marr,1,string(1:lenstr),'scup_freezden',tread,'INT')
330 [ - + ]: 73 : if(tread==1) tmp_int=intarr(1)
331 [ - + ]: 73 : if(tmp_int<0 .or. tmp_int>1 )then
332 : : write(message, '(a,I3,a,a,a,a,a)' )&
333 : 0 : & 'scup_freezden is',tmp_int,', but the only allowed values',ch10,&
334 : 0 : & 'are 0 and 1.',ch10,&
335 : 0 : & 'Action: correct scup_freezden in your input file.'
336 : 0 : ABI_ERROR(message)
337 : : end if
338 [ - + ]: 73 : if(tmp_int == 1) scup_dtset%scup_freezden = .TRUE.
339 : 73 : tmp_int = 0
340 : :
341 : : !G
342 : : !H
343 : : !I
344 : 73 : call intagm(dprarr,intarr,jdtset,marr,1,string(1:lenstr),'scup_initorbocc',tread,'INT')
345 [ - + ]: 73 : if(tread==1) tmp_int=intarr(1)
346 [ - + ]: 73 : if(tmp_int<0 .or. tmp_int>1 )then
347 : : write(message, '(a,I3,a,a,a,a,a)' )&
348 : 0 : & 'scup_initorbocc is',tmp_int,', but the only allowed values',ch10,&
349 : 0 : & 'are 0 and 1.',ch10,&
350 : 0 : & 'Action: correct scup_initorbocc in your input file.'
351 : 0 : ABI_ERROR(message)
352 : : end if
353 [ - + ]: 73 : if(tmp_int == 1) scup_dtset%scup_initorbocc = .TRUE.
354 : 73 : tmp_int = 0
355 : :
356 : 73 : call intagm(dprarr,intarr,jdtset,marr,1,string(1:lenstr),'scup_ismagnetic',tread,'INT')
357 [ - + ]: 73 : if(tread==1) tmp_int=intarr(1)
358 [ - + ]: 73 : if(tmp_int<0 .or. tmp_int>1 )then
359 : : write(message, '(a,I3,a,a,a,a,a)' )&
360 : 0 : & 'scup_ismagnetic is',tmp_int,', but the only allowed values',ch10,&
361 : 0 : & 'are 0 and 1.',ch10,&
362 : 0 : & 'Action: correct scup_ismagnetic in your input file.'
363 : 0 : ABI_ERROR(message)
364 : : end if
365 [ - + ]: 73 : if(tmp_int == 1) scup_dtset%scup_ismagnetic = .TRUE.
366 : 73 : tmp_int = 0
367 : :
368 : 73 : call intagm(dprarr,intarr,jdtset,marr,1,string(1:lenstr),'scup_istddft',tread,'INT')
369 [ - + ]: 73 : if(tread==1) tmp_int=intarr(1)
370 [ - + ]: 73 : if(tmp_int<0 .or. tmp_int>1 )then
371 : : write(message, '(a,I3,a,a,a,a,a)' )&
372 : 0 : & 'scup_istddft is',tmp_int,', but the only allowed values',ch10,&
373 : 0 : & 'are 0 and 1.',ch10,&
374 : 0 : & 'Action: correct scup_istddft in your input file.'
375 : 0 : ABI_ERROR(message)
376 : : end if
377 [ - + ]: 73 : if(tmp_int == 1) scup_dtset%scup_istddft = .TRUE.
378 : 73 : tmp_int = 0
379 : :
380 : :
381 : : !J
382 : : !K
383 : 73 : call intagm(dprarr,intarr,jdtset,marr,3,string(1:lenstr),'scup_ksamp',tread,'INT')
384 [ - + - - ]: 73 : if(tread==1) scup_dtset%scup_ksamp(1:3)=intarr(1:3)
385 [ + + ]: 292 : do ii=1,3
386 [ - + ]: 292 : if(scup_dtset%scup_ksamp(ii)<1)then
387 : : write(message, '(a,i0,a,i0,a,a,a,i0,a)' )&
388 : 0 : & 'scup_ksamp(',ii,') is',scup_dtset%scup_ksamp(ii),', which is lower than 1 .',ch10,&
389 : 0 : & 'Action: correct scup_ksamp(',ii,') in your input file.'
390 : 0 : ABI_ERROR(message)
391 : : end if
392 : : end do
393 : :
394 : : !L
395 : : !M
396 : 73 : call intagm(dprarr,intarr,jdtset,marr,1,string(1:lenstr),'scup_maxscfstep',tread,'INT')
397 [ - + ]: 73 : if(tread==1) scup_dtset%scup_maxscfstep=intarr(1)
398 [ - + ]: 73 : if(scup_dtset%scup_maxscfstep<=0)then
399 : : write(message, '(a,I3,a,a,a,a,a)' )&
400 : 0 : & 'scup_maxscfstep is',scup_dtset%scup_maxscfstep,', but the only allowed values',ch10,&
401 : 0 : & 'greater than 0',ch10,&
402 : 0 : & 'Action: correct scup_maxscfstep in your input file.'
403 : 0 : ABI_ERROR(message)
404 : : end if
405 : :
406 : : !N
407 : :
408 : 73 : call intagm(dprarr,intarr,jdtset,marr,1,string(1:lenstr),'scup_ndivsm',tread,'INT')
409 [ - + ]: 73 : if(tread==1) scup_dtset%scup_ndivsm=intarr(1)
410 [ - + ]: 73 : if(scup_dtset%scup_ndivsm<0 )then
411 : : write(message, '(a,I3,a,a,a,a,a)' )&
412 : 0 : 'scup_ndivsm is',scup_dtset%scup_ndivsm,', but the only allowed values',ch10,&
413 : 0 : 'are positive.',ch10,&
414 : 0 : 'Action: correct scup_ndivsm in your input file.'
415 : 0 : ABI_ERROR(message)
416 : : end if
417 : :
418 : :
419 : 73 : call intagm(dprarr,intarr,jdtset,marr,1,string(1:lenstr),'scup_nspeck',tread,'INT')
420 [ - + ]: 73 : if(tread==1) scup_dtset%scup_nspeck=intarr(1)
421 [ - + ]: 73 : if(scup_dtset%scup_nspeck<0 )then
422 : : write(message, '(a,I3,a,a,a,a,a)' )&
423 : 0 : 'scup_nspeck is',scup_dtset%scup_nspeck,', but the only allowed values',ch10,&
424 : 0 : 'are positive.',ch10,&
425 : 0 : 'Action: correct scup_nspeck in your input file.'
426 : 0 : ABI_ERROR(message)
427 : : end if
428 : :
429 : : !O
430 : : !P
431 : 73 : call intagm(dprarr,intarr,jdtset,marr,1,string(1:lenstr),'scup_printbands',tread,'INT')
432 [ - + ]: 73 : if(tread==1) tmp_int=intarr(1)
433 [ - + ]: 73 : if(tmp_int<0 .or. tmp_int>1 )then
434 : : write(message, '(a,I3,a,a,a,a,a)' )&
435 : 0 : & 'scup_printbands is',tmp_int,', but the only allowed values',ch10,&
436 : 0 : & 'are 0 and 1.',ch10,&
437 : 0 : & 'Action: correct scup_printbands in your input file.'
438 : 0 : ABI_ERROR(message)
439 : : end if
440 [ - + ]: 73 : if(tmp_int == 1) scup_dtset%scup_printbands = .TRUE.
441 : 73 : tmp_int = 0
442 : :
443 : 73 : call intagm(dprarr,intarr,jdtset,marr,1,string(1:lenstr),'scup_printeigv',tread,'INT')
444 [ - + ]: 73 : if(tread==1) tmp_int=intarr(1)
445 [ - + ]: 73 : if(tmp_int<0 .or. tmp_int>1 )then
446 : : write(message, '(a,I3,a,a,a,a,a)' )&
447 : 0 : & 'scup_printeigv is',tmp_int,', but the only allowed values',ch10,&
448 : 0 : & 'are 0 and 1.',ch10,&
449 : 0 : & 'Action: correct scup_printeigv in your input file.'
450 : 0 : ABI_ERROR(message)
451 : : end if
452 [ - + ]: 73 : if(tmp_int == 1) scup_dtset%scup_printeigv = .TRUE.
453 : 73 : tmp_int = 0
454 : :
455 : 73 : call intagm(dprarr,intarr,jdtset,marr,1,string(1:lenstr),'scup_printeltic',tread,'INT')
456 [ - + ]: 73 : if(tread==1) tmp_int=intarr(1)
457 [ - + ]: 73 : if(tmp_int<0 .or. tmp_int>1 )then
458 : : write(message, '(a,I3,a,a,a,a,a)' )&
459 : 0 : & 'scup_printeltic is',tmp_int,', but the only allowed values',ch10,&
460 : 0 : & 'are 0 and 1.',ch10,&
461 : 0 : & 'Action: correct scup_printeltic in your input file.'
462 : 0 : ABI_ERROR(message)
463 : : end if
464 [ - + ]: 73 : if(tmp_int == 1) scup_dtset%scup_printeltic = .TRUE.
465 : 73 : tmp_int = 0
466 : :
467 : 73 : call intagm(dprarr,intarr,jdtset,marr,1,string(1:lenstr),'scup_printgeom',tread,'INT')
468 [ - + ]: 73 : if(tread==1) tmp_int=intarr(1)
469 [ - + ]: 73 : if(tmp_int<0 .or. tmp_int>1 )then
470 : : write(message, '(a,I3,a,a,a,a,a)' )&
471 : 0 : 'scup_printgeom is',tmp_int,', but the only allowed values',ch10,&
472 : 0 : 'are 0 and 1.',ch10,&
473 : 0 : 'Action: correct scup_printgeom in your input file.'
474 : 0 : ABI_ERROR(message)
475 : : end if
476 [ - + ]: 73 : if(tmp_int == 1) scup_dtset%scup_printgeom = .TRUE.
477 : 73 : tmp_int = 0
478 : :
479 : 73 : call intagm(dprarr,intarr,jdtset,marr,1,string(1:lenstr),'scup_printniter',tread,'INT')
480 [ - + ]: 73 : if(tread==1) scup_dtset%scup_printniter=intarr(1)
481 [ - + ]: 73 : if(scup_dtset%scup_printniter<0 )then
482 : : write(message, '(a,I3,a,a,a,a,a)' )&
483 : 0 : 'scup_printniter is',scup_dtset%scup_printniter,', but the only allowed values',ch10,&
484 : 0 : 'are positive',ch10,&
485 : 0 : 'Action: correct scup_printniter in your input file.'
486 : 0 : ABI_ERROR(message)
487 : : end if
488 : :
489 : 73 : call intagm(dprarr,intarr,jdtset,marr,1,string(1:lenstr),'scup_printorbocc',tread,'INT')
490 [ - + ]: 73 : if(tread==1) tmp_int=intarr(1)
491 [ - + ]: 73 : if(tmp_int<0 .or. tmp_int>1 )then
492 : : write(message, '(a,I3,a,a,a,a,a)' )&
493 : 0 : 'scup_printorbocc is',tmp_int,', but the only allowed values',ch10,&
494 : 0 : 'are 0 and 1.',ch10,&
495 : 0 : 'Action: correct scup_printorbocc in your input file.'
496 : 0 : ABI_ERROR(message)
497 : : end if
498 [ - + ]: 73 : if(tmp_int == 1) scup_dtset%scup_printorbocc = .TRUE.
499 : 73 : tmp_int = 0
500 : :
501 : : !Q
502 : : !R
503 : : !S
504 : :
505 : 73 : call intagm(dprarr,intarr,jdtset,marr,1,string(1:lenstr),'scup_startpulay',tread,'INT')
506 [ - + ]: 73 : if(tread==1) scup_dtset%scup_startpulay=intarr(1)
507 [ - + ]: 73 : if(scup_dtset%scup_startpulay<3)then
508 : : write(message, '(a,I3,a,a,a,a,a)' )&
509 : 0 : & 'scup_startpulay is',scup_dtset%scup_startpulay,', but the only allowed values',ch10,&
510 : 0 : & 'are greater than 3',ch10,&
511 : 0 : & 'Action: correct scup_startpulay in your input file.'
512 : 0 : ABI_ERROR(message)
513 : : end if
514 : :
515 : 73 : call intagm(dprarr,intarr,jdtset,marr,1,string(1:lenstr),'scup_scfmixing',tread,'DPR')
516 [ - + ]: 73 : if(tread==1) scup_dtset%scup_scfmixing=dprarr(1)
517 [ - + ]: 73 : if(scup_dtset%scup_scfmixing<0)then
518 : : write(message, '(a,f10.2,a,a,a,a,a)' )&
519 : 0 : & 'scup_scfmixing is',scup_dtset%scup_scfmixing,', but the only allowed value',ch10,&
520 : 0 : & 'is superior to 0.',ch10,&
521 : 0 : & 'Action: correct scup_scfmixing in your input file.'
522 : 0 : ABI_ERROR(message)
523 : : end if
524 : :
525 : 73 : call intagm(dprarr,intarr,jdtset,marr,1,string(1:lenstr),'scup_scfthresh',tread,'DPR')
526 [ - + ]: 73 : if(tread==1) scup_dtset%scup_scfthresh=dprarr(1)
527 [ - + ]: 73 : if(scup_dtset%scup_scfthresh <= 0)then
528 : : write(message, '(a,f10.2,a,a,a,a,a)' )&
529 : 0 : & 'scup_scfthresh is',scup_dtset%scup_scfthresh,', but the only allowed value',ch10,&
530 : 0 : & 'is superior to 0.',ch10,&
531 : 0 : & 'Action: correct scup_scfthresh in your input file.'
532 : 0 : ABI_ERROR(message)
533 : : end if
534 : :
535 : 73 : call intagm(dprarr,intarr,jdtset,marr,1,string(1:lenstr),'scup_smearing',tread,'DPR')
536 [ - + ]: 73 : if(tread==1) scup_dtset%scup_smearing=dprarr(1)
537 [ - + ]: 73 : if(scup_dtset%scup_smearing < 0)then
538 : : write(message, '(a,f10.2,a,a,a,a,a)' )&
539 : 0 : & 'scup_smearing is',scup_dtset%scup_smearing,', but the only allowed value',ch10,&
540 : 0 : & 'is superior to or equal to 0.',ch10,&
541 : 0 : & 'Action: correct scup_smearing in your input file.'
542 : 0 : ABI_ERROR(message)
543 : : end if
544 : :
545 : : !T
546 : 73 : call intagm(dprarr,intarr,jdtset,marr,1,string(1:lenstr),'scup_tcharge',tread,'DPR')
547 [ - + ]: 73 : if(tread==1) scup_dtset%scup_tcharge=dprarr(1)
548 [ - + ]: 73 : if(scup_dtset%scup_tcharge<0)then
549 : : write(message, '(a,f10.2,a,a,a,a,a)' )&
550 : 0 : & 'scup_tcharge is',scup_dtset%scup_tcharge,', but the only allowed value',ch10,&
551 : 0 : & 'is superior to 0.',ch10,&
552 : 0 : & 'Action: correct scup_tcharge in your input file.'
553 : 0 : ABI_ERROR(message)
554 : : end if
555 : :
556 : :
557 : : !U
558 : : !V
559 : : !W
560 : : !X
561 : : !Y
562 : : !Z
563 : :
564 : : !=====================================================================
565 : : !start reading dimension dependent variables
566 : : !=====================================================================
567 : :
568 : :
569 : : !A
570 : : !B
571 : : !C
572 : : !D
573 : : !E
574 : : !F
575 : : !G
576 : : !H
577 : : !I
578 : : !J
579 : : !K
580 : : !L
581 : : !M
582 : : !N
583 : : !O
584 : : !P
585 : : !Q
586 : : !R
587 : : !S
588 : : !Allocate
589 [ - + ]: 73 : if(scup_dtset%scup_printbands)then
590 [ # # # # : 0 : ABI_MALLOC(scup_dtset%scup_speck,(3,scup_dtset%scup_nspeck))
# # # # #
# # # #
# ]
591 : :
592 : 0 : call intagm(dprarr,intarr,jdtset,marr,3*scup_dtset%scup_nspeck,string(1:lenstr),'scup_speck',tread,'DPR')
593 [ # # ]: 0 : if(tread==1)then
594 [ # # # # : 0 : scup_dtset%scup_speck(:,:)=reshape( dprarr(1:3*scup_dtset%scup_nspeck), [3,scup_dtset%scup_nspeck])
# # ]
595 : : else
596 : : write(message,'(5a)') &
597 : 0 : & 'When scup_printbands is asked, scup_speck must be initialized ',ch10,&
598 : 0 : & 'in the input file, which is not the case.',ch10,&
599 : 0 : & 'Action: initialize scup_speck in your input file, or change printbands.'
600 : 0 : ABI_ERROR(message)
601 : : end if
602 : : end if
603 : :
604 : :
605 : : !T
606 : : !U
607 : : !V
608 : : !W
609 : : !X
610 : : !Y
611 : : !Z
612 : :
613 : : !=======================================================================
614 : : !Finished reading in variables - deallocate
615 : : !=======================================================================
616 : :
617 [ - + ]: 73 : ABI_FREE(dprarr)
618 [ - + ]: 73 : ABI_FREE(intarr)
619 : :
620 : 73 : end subroutine invars10scup
621 : : !!***
622 : :
623 : : !!****f* m_scup_dataset/scup_kpath_new
624 : : !!
625 : : !! NAME
626 : : !! scup_kpath_init
627 : : !!
628 : : !! FUNCTION
629 : : !! Initialize the kpath and all other variables SCALE UP needs to plot electronic bands
630 : : !! along kpath
631 : : !!
632 : : !! INPUTS
633 : : !! speck = array with special k-points along the path
634 : : !! gprimd = reciprocal lattice vectors of cell
635 : : !! ndivsm = number of divisions for smallest segment
636 : : !!
637 : : !! OUTPUT
638 : : !! scup_kpath <type(kpath_t)> = kpath_t with all information about kpath
639 : : !!
640 : : !! NOTES
641 : : !! Should be executed by one processor only.
642 : : !!
643 : : !! m_bz_mesh/kpath_new
644 : : !!
645 : : !! SOURCE
646 : :
647 [ # # # # : 0 : subroutine scup_kpath_new(speck,rprimd,ndivsm,scup_kpath)
# # # # #
# ]
648 : :
649 : : !Arguments -------------------------------
650 : : !scalars
651 : : integer,intent(in) :: ndivsm
652 : :
653 : : !arrays
654 : : real(dp),intent(in) :: speck(:,:),rprimd(3,3)
655 : : type(kpath_t), intent(out) :: scup_kpath
656 : :
657 : : !Local variables -------------------------
658 : : !Dummy arguments for subroutine 'intagm' to parse input file
659 : : !Set routine version number here:
660 : : !scalars
661 : : integer :: nspeck
662 : : !arrays
663 [ # # ]: 0 : integer,allocatable :: ndivs_tmp(:)
664 : : real(dp) :: gprimd(3,3)
665 : :
666 : : !*********************************************************************
667 : :
668 : : !Get gprimd
669 : 0 : call matr3inv(rprimd,gprimd)
670 : :
671 : : !Create Kpath
672 : 0 : call scup_kpath%init(speck,gprimd,ndivsm)
673 : :
674 : : !Change size of scup_kpath%ndivs(:) variable
675 : : !from nspeck-1 to nspeck and put 1 to first entry
676 : 0 : nspeck = size(speck,2)
677 [ # # # # : 0 : ABI_MALLOC(ndivs_tmp,(nspeck))
# # # # #
# # # ]
678 : :
679 : : !First entry is always 1
680 : 0 : ndivs_tmp(1) = 1
681 : : !Copy point/per segments
682 [ # # ]: 0 : ndivs_tmp(2:) = scup_kpath%ndivs(:)
683 : :
684 : : !Delete original segments
685 [ # # ]: 0 : ABI_FREE(scup_kpath%ndivs)
686 : : !Put new path
687 [ # # # # : 0 : ABI_MALLOC(scup_kpath%ndivs,(nspeck))
# # # # ]
688 [ # # # # ]: 0 : scup_kpath%ndivs = ndivs_tmp
689 : : !Free temporary array
690 : 0 : ABI_FREE(ndivs_tmp)
691 : :
692 : 0 : end subroutine scup_kpath_new
693 : : !!***
694 : :
695 : : !!****f* m_scup_dataset/scup_kpath_print
696 : : !!
697 : : !! NAME
698 : : !! scup_kpath_print
699 : : !!
700 : : !! FUNCTION
701 : : !! Print info of kpath provide to SCALE UP
702 : : !!
703 : : !! INPUTS
704 : : !! scup_kpath<type(kpath_t) = kpath_t with all information about kpath
705 : : !!
706 : : !! OUTPUT
707 : : !! Only Printing
708 : : !!
709 : : !! NOTES
710 : : !! Should be executed by one processor only.
711 : : !!
712 : : !! SOURCE
713 : :
714 : 0 : subroutine scup_kpath_print(scup_kpath)
715 : :
716 : : !Arguments ------------------------------------
717 : : class(kpath_t), intent(in) :: scup_kpath
718 : : !Local variables-------------------------------
719 : : integer :: unt
720 : : ! *************************************************************************
721 : :
722 : 0 : unt = std_out
723 : :
724 : 0 : write(unt,'(a)') ch10
725 : 0 : write(unt,'(4a)') ' scup_printbands = 1. Printing of electronic bands active',ch10,&
726 : 0 : ' Kpath information below:',ch10
727 : :
728 [ # # ]: 0 : call scup_kpath%print([std_out])
729 : :
730 : 0 : end subroutine scup_kpath_print
731 : : !!***
732 : :
733 [ # # # # : 0 : end module m_scup_dataset
# # # # #
# # # # #
# # # # #
# # # ]
734 : : !!***
|