TABLE OF CONTENTS


ABINIT/m_band2eps_dataset [ Modules ]

[ Top ] [ Modules ]

NAME

  m_band2eps_dataset

FUNCTION

COPYRIGHT

  Copyright (C) 2014-2018 ABINIT group (XG,JCC,CL,MVeithen,XW,MJV)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

PARENTS

CHILDREN

SOURCE

20 #if defined HAVE_CONFIG_H
21 #include "config.h"
22 #endif
23 
24 #include "abi_common.h"
25 
26 module m_band2eps_dataset
27 
28  use defs_basis
29  use m_abicore
30  use m_errors
31 
32  use m_parser,    only : intagm
33 
34  implicit none
35 
36  private
37 
38  public :: band2eps_dataset_type
39  public :: band2eps_dtset_free
40  public :: outvars_band2eps
41  public :: invars11

m_band2eps_dataset/band2eps_dataset_type [ Types ]

[ Top ] [ m_band2eps_dataset ] [ Types ]

NAME

 band2eps_dataset_type

FUNCTION

 The band2eps_dataset_type structured datatype
 gather all the input variables for the band2eps code.

SOURCE

56  type band2eps_dataset_type
57 
58 ! Variables should be declared on separated lines in order to reduce the occurence of git conflicts.
59 ! Since all these input variables are described in the band2eps_help.html
60 ! file, they are not described in length here ...
61 ! Integer
62   integer :: natom
63   integer :: cunit
64   integer :: nlines
65   integer :: ngrad
66   integer :: prtout
67   real(dp) :: min
68   real(dp) :: max
69 
70 
71   integer,allocatable :: nqline(:)
72 ! nqline(nlines)
73 
74   real(dp),allocatable :: scale(:)
75 ! scale(nlines)
76 
77   integer,allocatable :: red(:)
78 ! red(natom)
79 
80   integer,allocatable :: blue(:)
81 ! blue(natom)
82 
83   integer,allocatable :: green(:)
84 ! green(natom)
85 
86   character(len=6),allocatable :: qpoint_name(:)
87 ! qpoint_name(nlines+1)
88 
89 
90  end type band2eps_dataset_type

m_band2eps_dataset/band2eps_dtset_free [ Functions ]

[ Top ] [ m_band2eps_dataset ] [ Functions ]

NAME

   band2eps_dtset_free

FUNCTION

   deallocate remaining arrays in the band2eps_dtset datastructure

INPUTS

  band2eps_dtset = band2eps datastructure

PARENTS

      band2eps

CHILDREN

NOTES

SOURCE

116 subroutine band2eps_dtset_free(band2eps_dtset)
117 
118 
119 !This section has been created automatically by the script Abilint (TD).
120 !Do not modify the following lines by hand.
121 #undef ABI_FUNC
122 #define ABI_FUNC 'band2eps_dtset_free'
123 !End of the abilint section
124 
125  implicit none
126 
127 !Arguments ------------------------------------
128 !scalars
129  type(band2eps_dataset_type), intent(inout) :: band2eps_dtset
130 
131 ! *************************************************************************
132 
133  if (allocated(band2eps_dtset%nqline))  then
134    ABI_DEALLOCATE(band2eps_dtset%nqline)
135  end if
136  if (allocated(band2eps_dtset%scale))  then
137    ABI_DEALLOCATE(band2eps_dtset%scale)
138  end if
139  if (allocated(band2eps_dtset%red))  then
140    ABI_DEALLOCATE(band2eps_dtset%red)
141  end if
142  if (allocated(band2eps_dtset%blue))  then
143    ABI_DEALLOCATE(band2eps_dtset%blue)
144  end if
145  if (allocated(band2eps_dtset%green))  then
146    ABI_DEALLOCATE(band2eps_dtset%green)
147  end if
148  if (allocated(band2eps_dtset%qpoint_name))  then
149    ABI_DEALLOCATE(band2eps_dtset%qpoint_name)
150  end if
151 
152 end subroutine band2eps_dtset_free

m_band2eps_dataset/invars11 [ Functions ]

[ Top ] [ m_band2eps_dataset ] [ Functions ]

NAME

 invars11

FUNCTION

 Open input file for the band2eps code, then reads or echoes the input information.

INPUTS

 lenstr=actual length of string
 natom=number of atoms, needed for atifc
 string*(*)=string of characters containing all input variables and data

OUTPUT

 band2eps_dtset= (derived datatype) contains all the input variables

NOTES

 Should be executed by one processor only.

PARENTS

      band2eps

CHILDREN

SOURCE

184 subroutine invars11 (band2eps_dtset,lenstr,string)
185 
186 
187 !This section has been created automatically by the script Abilint (TD).
188 !Do not modify the following lines by hand.
189 #undef ABI_FUNC
190 #define ABI_FUNC 'invars11'
191 !End of the abilint section
192 
193  implicit none
194 
195 !Arguments -------------------------------
196 !scalars
197  integer,intent(in) :: lenstr
198  character(len=strlen),intent(in) :: string
199  type(band2eps_dataset_type),intent(inout) :: band2eps_dtset
200 
201 !Local variables -------------------------
202 !Dummy arguments for subroutine 'intagm' to parse input file
203 !Set routine version number here:
204 !scalars
205  integer :: ii,position,jdtset,marr,tread
206  character(len=500) :: message
207  character(len=fnlen) :: name_qpoint
208 !arrays
209  integer,allocatable :: intarr(:)
210  real(dp),allocatable :: dprarr(:)
211 
212 !*********************************************************************
213  marr=3
214  ABI_ALLOCATE(intarr,(marr))
215  ABI_ALLOCATE(dprarr,(marr))
216 
217  jdtset=1
218 
219 ! Need to get the number of atom
220  band2eps_dtset%natom = 0
221  call intagm(dprarr,intarr,jdtset,marr,1,string(1:lenstr),'natom',tread,'INT')
222  if(tread==1) band2eps_dtset%natom=intarr(1)
223  if (band2eps_dtset%natom <= tol10) then
224    write(message,'(a,I5,3a)' )&
225 &   'natom ',band2eps_dtset%natom,', is not allowed ',ch10,&
226 &   'Action: correct natom in your input file.'
227    MSG_ERROR(message)
228  end if
229 
230 ! Need to get the number of lines
231  band2eps_dtset%nlines = 0
232  call intagm(dprarr,intarr,jdtset,marr,1,string(1:lenstr),'nlines',tread,'INT')
233  if(tread==1) band2eps_dtset%nlines=intarr(1)
234  if (band2eps_dtset%nlines <= tol10) then
235    write(message,'(a,I5,3a)' )&
236 &   'nlines ',band2eps_dtset%nlines,', is not allowed ',ch10,&
237 &   'Action: correct nlines in your input file.'
238    MSG_ERROR(message)
239  end if
240 
241 ! Need to get the number of lines
242  band2eps_dtset%cunit = 0
243  call intagm(dprarr,intarr,jdtset,marr,1,string(1:lenstr),'cunit',tread,'INT')
244  if(tread==1) band2eps_dtset%cunit=intarr(1)
245  if (band2eps_dtset%cunit < 1 .or. band2eps_dtset%cunit > 2) then
246    write(message,'(a,I5,3a)' )&
247 &   'cunit ',band2eps_dtset%cunit,', is not allowed ',ch10,&
248 &   'Action: correct cunit in your input file (1 or 2).'
249    MSG_ERROR(message)
250  end if
251 
252 ! Need to get the number of lines
253  band2eps_dtset%ngrad = 0
254  call intagm(dprarr,intarr,jdtset,marr,1,string(1:lenstr),'ngrad',tread,'INT')
255  if(tread==1) band2eps_dtset%ngrad=intarr(1)
256  if (band2eps_dtset%ngrad < 0) then
257    write(message,'(a,I5,3a)' )&
258 &   'ngrad ',band2eps_dtset%ngrad,', is not allowed ',ch10,&
259 &   'Action: correct ngrad in your input file (positive value).'
260    MSG_ERROR(message)
261  end if
262 
263 ! Need to get the number of lines
264  band2eps_dtset%min = zero
265  call intagm(dprarr,intarr,jdtset,marr,1,string(1:lenstr),'min',tread,'DPR')
266  if(tread==1) band2eps_dtset%min=dprarr(1)
267 
268 ! Need to get the number of lines
269  band2eps_dtset%max = zero
270  call intagm(dprarr,intarr,jdtset,marr,1,string(1:lenstr),'max',tread,'DPR')
271  if(tread==1) band2eps_dtset%max=dprarr(1)
272 
273  ABI_ALLOCATE(band2eps_dtset%red,(band2eps_dtset%natom))
274  ABI_ALLOCATE(band2eps_dtset%blue,(band2eps_dtset%natom))
275  ABI_ALLOCATE(band2eps_dtset%green,(band2eps_dtset%natom))
276  band2eps_dtset%red(:) = 0
277  band2eps_dtset%blue(:) = 0
278  band2eps_dtset%green(:) = 0
279 
280 ! Read prtout
281  band2eps_dtset%prtout = 0
282  call intagm(dprarr,intarr,jdtset,marr,1,string(1:lenstr),'prtout',tread,'INT')
283  if(tread==1) band2eps_dtset%prtout=intarr(1)
284  if (band2eps_dtset%prtout < 0 .or. band2eps_dtset%prtout > 1) then
285    write(message,'(a,I5,3a)' )&
286 &   'prtout ',band2eps_dtset%prtout,', is not allowed ',ch10,&
287 &   'Action: correct prtout in your input file (0 or 1).'
288    MSG_ERROR(message)
289  end if
290 
291 !natom dimension
292  if(band2eps_dtset%natom > marr)then
293    marr = band2eps_dtset%natom
294    ABI_DEALLOCATE(intarr)
295    ABI_DEALLOCATE(dprarr)
296    ABI_ALLOCATE(intarr,(marr))
297    ABI_ALLOCATE(dprarr,(marr))
298  end if
299  call intagm(dprarr,intarr,jdtset,marr,band2eps_dtset%natom,string(1:lenstr),'red',tread,'INT')
300  if(tread==1) band2eps_dtset%red(1:band2eps_dtset%natom) = intarr(1:band2eps_dtset%natom)
301 
302  call intagm(dprarr,intarr,jdtset,marr,band2eps_dtset%natom,string(1:lenstr),'blue',tread,'INT')
303  if(tread==1) band2eps_dtset%blue(1:band2eps_dtset%natom) = intarr(1:band2eps_dtset%natom)
304 
305  call intagm(dprarr,intarr,jdtset,marr,band2eps_dtset%natom,string(1:lenstr),'green',tread,'INT')
306  if(tread==1) band2eps_dtset%green(1:band2eps_dtset%natom) = intarr(1:band2eps_dtset%natom)
307 
308 !nlines dimenstion
309  ABI_ALLOCATE(band2eps_dtset%nqline,(band2eps_dtset%nlines))
310  ABI_ALLOCATE(band2eps_dtset%scale,(band2eps_dtset%nlines))
311  band2eps_dtset%nqline(:) = 0
312  band2eps_dtset%scale(:) = zero
313 
314  if(band2eps_dtset%nlines > marr)then
315    marr = band2eps_dtset%nlines
316    ABI_DEALLOCATE(intarr)
317    ABI_DEALLOCATE(dprarr)
318    ABI_ALLOCATE(intarr,(marr))
319    ABI_ALLOCATE(dprarr,(marr))
320  end if
321 
322  call intagm(dprarr,intarr,jdtset,marr,band2eps_dtset%nlines,string(1:lenstr),'nqline',tread,'INT')
323  if(tread==1) band2eps_dtset%nqline(1:band2eps_dtset%nlines) = intarr(1:band2eps_dtset%nlines)
324 !REMOVE THE LAST LINE OF NQLINE
325   band2eps_dtset%nqline(band2eps_dtset%nlines) = band2eps_dtset%nqline(band2eps_dtset%nlines) - 1
326 
327  call intagm(dprarr,intarr,jdtset,marr,band2eps_dtset%nlines,string(1:lenstr),'scale',tread,'DPR')
328  if(tread==1) band2eps_dtset%scale(1:band2eps_dtset%nlines) = dprarr(1:band2eps_dtset%nlines)
329 
330 !nline+1 dimension
331  ABI_ALLOCATE(band2eps_dtset%qpoint_name,(band2eps_dtset%nlines+1))
332  band2eps_dtset%qpoint_name(:) = ""
333  position = index(string(1:lenstr),trim("QPOINT_NAME")) + 11
334  name_qpoint = trim(string(position:(position + &
335 &          len(band2eps_dtset%qpoint_name(1))*band2eps_dtset%nlines+1)))
336  read(name_qpoint,*) (band2eps_dtset%qpoint_name(ii),ii=1,band2eps_dtset%nlines+1)
337 
338 end subroutine invars11

m_band2eps_dataset/outvars_band2eps [ Functions ]

[ Top ] [ m_band2eps_dataset ] [ Functions ]

NAME

 outvars_band2eps

FUNCTION

 Open input file for the band2eps code, then
 echoes the input information.

INPUTS

 band2eps_dtset= (derived datatype) contains all the input variables
 nunit=unit number for input or output

OUTPUT

  (only writing)

NOTES

 Should be executed by one processor only.

PARENTS

      band2eps

CHILDREN

SOURCE

369 subroutine outvars_band2eps (band2eps_dtset,nunit)
370 
371 
372 !This section has been created automatically by the script Abilint (TD).
373 !Do not modify the following lines by hand.
374 #undef ABI_FUNC
375 #define ABI_FUNC 'outvars_band2eps'
376 !End of the abilint section
377 
378  implicit none
379 
380 !Arguments -------------------------------
381 !scalars
382  integer,intent(in) :: nunit
383  type(band2eps_dataset_type),intent(in) :: band2eps_dtset
384 
385 !Local variables -------------------------
386 !Set routine version number here:
387 !scalars
388  integer :: ii
389 
390 !*********************************************************************
391 
392 !Write the heading
393  write(nunit,'(80a,a)') ('=',ii=1,80),ch10
394  write(nunit, '(a,a)' )&
395 & ' -outvars_band2eps: echo values of input variables ----------------------',ch10
396 
397 !The flags
398  if(band2eps_dtset%natom/=0 )then
399    write(nunit,'(a)')' Informations :'
400    if(band2eps_dtset%natom/=0)write(nunit,'(3x,a9,3i10)')'  natom',band2eps_dtset%natom
401    if(band2eps_dtset%cunit/=0)write(nunit,'(3x,a9,3i10)')'  cunit',band2eps_dtset%cunit
402    if(band2eps_dtset%nlines/=0)write(nunit,'(3x,a9,3i10)')' nlines',band2eps_dtset%nlines
403    if(band2eps_dtset%min/=0)write(nunit,'(3x,a9,3f12.4)')'    Min',band2eps_dtset%min
404    if(band2eps_dtset%max/=0)write(nunit,'(3x,a9,3f12.4)')'    Max',band2eps_dtset%max
405    if(band2eps_dtset%ngrad/=0)write(nunit,'(3x,a9,3i10)')'  ngrad',band2eps_dtset%ngrad
406    write(nunit,'(3x,a9,6i10)')'    red',(band2eps_dtset%red(ii),ii=1,band2eps_dtset%natom)
407    write(nunit,'(3x,a9,6i10)')'   blue',(band2eps_dtset%blue(ii),ii=1,band2eps_dtset%natom)
408    write(nunit,'(3x,a9,6i10)')'  green',(band2eps_dtset%green(ii),ii=1,band2eps_dtset%natom)
409    write(nunit,'(3x,a9,8i10)')' nqline',(band2eps_dtset%nqline(ii),ii=1,band2eps_dtset%nlines)
410    write(nunit,'(3x,a9,8a)')'    point',(band2eps_dtset%qpoint_name(ii),ii=1,band2eps_dtset%nlines+1)
411  end if
412 
413  write(nunit,'(a,80a,a)') ch10,('=',ii=1,80),ch10
414 
415 end subroutine outvars_band2eps