types.F90 27.2 KB
Newer Older
1 2 3 4 5 6
!--------------------------------------------------------------------------------
! Copyright (c) 2016 Peter Grünberg Institut, Forschungszentrum Jülich, Germany
! This file is part of FLEUR and available as free software under the conditions
! of the MIT license as expressed in the LICENSE file in more detail.
!--------------------------------------------------------------------------------

7 8 9 10
       MODULE m_types
!*************************************************************
!     This module contains definitions for all kind of types
!*************************************************************
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
!
! Types for orbital moment calculation:
!
!
! Types for spin-off-diagonal charge density:
!
      TYPE t_mt21                          ! 'normal' contributions
        SEQUENCE
        REAL ::  uun,udn,dun,ddn           ! normes of radial overlaps
        COMPLEX :: uu,ud,du,dd             ! values
      END TYPE t_mt21

      TYPE t_lo21                          ! ocal orbitals & (u,d)
        SEQUENCE
        REAL ::  uulon,dulon,uloun,ulodn   ! normes of radial overlaps
        COMPLEX :: uulo,dulo,ulou,ulod     ! values
      END TYPE t_lo21

      TYPE t_orb                           ! 'normal' contributions
        SEQUENCE
        REAL :: uu,dd                      ! z   component
        COMPLEX :: uup,uum,ddp,ddm         ! +/- component
      END TYPE t_orb

      TYPE t_orbl                          ! local orbitals & (u,d)
        SEQUENCE
        REAL :: uulo,dulo
        COMPLEX :: uulop,uulom,dulop,dulom
      END TYPE t_orbl

      TYPE t_orblo                         ! lo,lo' contributions
        SEQUENCE
        REAL :: z
        COMPLEX :: p,m
      END TYPE t_orblo
   TYPE t_lapw
      INTEGER :: nv(2)
      INTEGER :: nv_tot
      INTEGER :: nmat
      INTEGER,ALLOCATABLE:: k1(:,:)
      INTEGER,ALLOCATABLE:: k2(:,:)
      INTEGER,ALLOCATABLE:: k3(:,:)
53
      INTEGER,ALLOCATABLE:: kp(:,:)
54
      REAL,ALLOCATABLE::rk(:,:)
55
   end type
56 57 58

   TYPE t_tlmplm
      COMPLEX,ALLOCATABLE :: tdd(:,:,:)
59
      COMPLEX,ALLOCATABLE :: tdu(:,:,:)
60 61
                                !(0:lmplmd,ntypd,tspin)
      COMPLEX,ALLOCATABLE :: tud(:,:,:)
62
      COMPLEX,ALLOCATABLE :: tuu(:,:,:)
63
                                !(0:lmplmd,ntypd,tspin)
64
      INTEGER,ALLOCATABLE :: ind(:,:,:,:)
65
                                !(0:lmd,0:lmd,ntypd,tspin)
66
      COMPLEX,ALLOCATABLE :: tdulo(:,:,:,:)
67
                                !(0:lmd,-llod:llod,mlotot,tspin)
68
      COMPLEX,ALLOCATABLE :: tuulo(:,:,:,:)
69
                                !(0:lmd,-llod:llod,mlotot,tspin)
70
      COMPLEX,ALLOCATABLE :: tuloulo(:,:,:,:)
71
                                !(-llod:llod,-llod:llod,mlolotot,tspin)
72
   END TYPE
73 74

   TYPE t_usdus
75 76 77 78 79 80 81 82 83
      REAL,ALLOCATABLE,DIMENSION(:,:,:)   :: us
      REAL,ALLOCATABLE,DIMENSION(:,:,:)   :: dus
      REAL,ALLOCATABLE,DIMENSION(:,:,:)   :: uds
      REAL,ALLOCATABLE,DIMENSION(:,:,:)   :: duds !(0:lmaxd,ntype,jspd)
      REAL,ALLOCATABLE,DIMENSION(:,:,:)   :: ddn  !(0:lmaxd,ntype,jspd)
      REAL,ALLOCATABLE,DIMENSION(:,:,:)   :: ulos
      REAL,ALLOCATABLE,DIMENSION(:,:,:)   :: dulos
      REAL,ALLOCATABLE,DIMENSION(:,:,:)   :: uulon
      REAL,ALLOCATABLE,DIMENSION(:,:,:)   :: dulon !(nlod,ntype,jspd)
84
      REAL,ALLOCATABLE,DIMENSION(:,:,:,:) :: uloulopn!  (nlod,nlod,ntypd,jspd)
85
   END TYPE
86 87 88 89 90 91 92 93 94 95 96



! types for 1D calculations
        TYPE od_dim
          LOGICAL :: d1
          INTEGER :: mb,M,k3,m_cyl
          INTEGER :: chi,rot
          LOGICAL :: invs,zrfs
          INTEGER :: n2d,nq2,nn2d
          INTEGER :: kimax2
97
          INTEGER :: nop,nat
98 99 100 101 102 103
        END TYPE od_dim

        TYPE od_inp
          LOGICAL :: d1
          INTEGER :: mb,M,k3,m_cyl
          INTEGER :: chi,rot
104
          LOGICAL :: invs,zrfs
105 106 107
          INTEGER :: n2d,nq2,nn2d
          INTEGER :: kimax2
          INTEGER, POINTER :: ig(:,:)  !(-k3:k3,-M:M)
108
          INTEGER, POINTER :: kv(:,:)        !(2,n2d)
109 110 111 112 113 114 115 116 117 118
          INTEGER, POINTER :: nst2(:)        !(n2d)
        END TYPE od_inp

        TYPE od_sym
          INTEGER :: nop,nat
          INTEGER, POINTER :: ngopr(:)     !(nat)
          REAL   , POINTER :: mrot(:,:,:)  !(3,3,nop)
          REAL   , POINTER :: tau(:,:)     !(3,nop)
          INTEGER, POINTER :: invtab(:)    !(nop)
          INTEGER, POINTER :: multab(:,:)  !(nop,nop)
119
        END TYPE od_sym
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135

        TYPE od_lda
          INTEGER :: nn2d
          INTEGER, POINTER :: igf(:,:)  !(0:nn2d-1,2)
          REAL   , POINTER :: pgf(:)    !(0:nn2d-1)
        END TYPE od_lda

        TYPE od_gga
          INTEGER          :: nn2d
          REAL, POINTER    :: pgfx(:)  ! (0:nn2d-1)
          REAL, POINTER    :: pgfy(:)
          REAL, POINTER    :: pgfxx(:)
          REAL, POINTER    :: pgfyy(:)
          REAL, POINTER    :: pgfxy(:)
        END TYPE od_gga

136

137 138 139 140 141
!
! Type for LDA+U:
!
      TYPE t_utype
        SEQUENCE
142 143 144 145
        REAL u,j         ! the actual U and J parameters
        INTEGER l        ! the l quantum number to which this U parameter belongs
        INTEGER atomType ! The atom type to which this U parameter belongs
        LOGICAL :: l_amf ! logical switch to choose the "around mean field" LDA+U limit
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
      END TYPE t_utype

!
! Type for the HF total energy
!
      TYPE t_energy_hf
        REAL :: valence
        REAL :: core
      END TYPE t_energy_hf

!
! Type for the electric field
!
      TYPE t_efield
        REAL    :: zsigma  = 10.0  ! Distance to the charged plates
        REAL    :: sigma   =  0.0  ! charge at the plates
        REAL    :: sig_b(2)=  0.0  ! Extra charge for the top/bottom plate
        COMPLEX :: vslope  =  0.0  ! Dirichlet bnd. cond.: Slope
        REAL,    ALLOCATABLE :: sigEF(:,:,:) ! (nx, ny, nvac)
        COMPLEX, ALLOCATABLE :: rhoEF(:,:)   ! (g_||, nvac)
        COMPLEX, ALLOCATABLE :: C1(:), C2(:) ! Coeff. for Dirichlet bnd.cond.
        LOGICAL :: l_segmented = .false.
        LOGICAL :: plot_charge = .false. ! Plot charge as inputted
        LOGICAL :: plot_rho    = .false. ! Plot Fourier-transformed charge
        LOGICAL :: autocomp    = .true.  ! Auto-compensate film charge
        LOGICAL :: dirichlet = .false. ! Dirichlet vs. Neumann boundary cond.
        LOGICAL :: l_dirichlet_coeff = .false. ! For MPI, true if C1/C2 set
      END TYPE t_efield

175 176 177

      TYPE t_atoms
       !<no of types
178
       INTEGER :: ntype
179 180 181
       !<total-no of atoms
       INTEGER :: nat
       !<dimensions of LO's
182 183 184 185
       INTEGER ::nlod
       INTEGER ::llod
       INTEGER ::nlotot
       !lmaxd=maxval(lmax)
186
       INTEGER:: lmaxd
187
       ! no of lda+us
188
       INTEGER ::n_u
189
       ! dimensions
190 191 192 193 194 195 196 197 198
       INTEGER :: jmtd
       !No of element
       INTEGER,ALLOCATABLE ::nz(:)
       !atoms per type
       INTEGER,ALLOCATABLE::neq(:)
       !radial grid points
       INTEGER,ALLOCATABLE::jri(:)
       !core states
       INTEGER,ALLOCATABLE::ncst(:)
199 200
       !How many states are explicitely provided?
       INTEGER,ALLOCATABLE::numStatesProvided(:)
201 202 203 204 205 206
       !core state occupations
       REAL,ALLOCATABLE::coreStateOccs(:,:,:)
       !core state nprnc
       INTEGER,ALLOCATABLE::coreStateNprnc(:,:)
       !core state kappa
       INTEGER,ALLOCATABLE::coreStateKappa(:,:)
207 208 209 210 211 212 213 214 215 216 217 218
       !lmax
       INTEGER,ALLOCATABLE::lmax(:)
       !lmax non-spherical
       INTEGER,ALLOCATABLE::lnonsph(:)
       !expansion of pseudo-charge
       INTEGER,ALLOCATABLE::ncv(:)
       !no of LO
       INTEGER,ALLOCATABLE::nlo(:)
       !l of LO (nlo,ntype)
       INTEGER,ALLOCATABLE::llo(:,:)
       !lmax for lapw (ntype)
       INTEGER,ALLOCATABLE::lapw_l(:)
219
       !first LO with a given l (max(nlo
220 221 222
       INTEGER,ALLOCATABLE::lo1l(:,:)
       !??
       INTEGER,ALLOCATABLE::ulo_der(:,:)
223
       !no of LOs per l (max(nlo1),ntype
224
       INTEGER,ALLOCATABLE::nlol(:,:)
225
       !true if LO is formed by \dot u (
226 227 228 229 230
       LOGICAL,ALLOCATABLE::l_dulo(:,:)
       !no of op that maps atom into
       INTEGER,ALLOCATABLE::ngopr(:)
       !symetry of atom (nat)
       INTEGER,ALLOCATABLE::ntypsy(:)
231
       !no of sphhar for atom type(ntype
232
       INTEGER,ALLOCATABLE ::nlhtyp(:)
233
       !atom mapped to by inversion (nat
234
       INTEGER,ALLOCATABLE ::invsat(:)
235 236
       !Claculate forces for this atom?
       LOGICAL,ALLOCATABLE :: l_geo(:)
237 238 239 240 241 242
       !MT-Radius (ntype)
       REAL,ALLOCATABLE::rmt(:)
       !log increment(ntype)
       REAL,ALLOCATABLE::dx(:)
       !vol of MT(ntype)
       REAL,ALLOCATABLE::volmts(:)
243
       !radial grid points(max(jri),ntyp
244 245 246 247 248 249 250 251 252 253
       REAL,ALLOCATABLE::rmsh(:,:)
       !charge of nucleus(ntype)
       REAL,ALLOCATABLE::zatom(:)
       !initial mag moment(ntype)
       REAL,ALLOCATABLE::bmu(:)
       !pos of atom (absol) (3,nat)
       REAL,ALLOCATABLE::pos(:,:)
       !pos of atom (relat)(3,nat)
       REAL,ALLOCATABLE::taual(:,:)
       !lda_u information(ntype)
254
       CHARACTER(len=20), ALLOCATABLE :: speciesName(:)
255
       TYPE(t_utype),ALLOCATABLE::lda_u(:)
256
       INTEGER,ALLOCATABLE :: relax(:,:) !<(3,ntype)
257
       INTEGER, ALLOCATABLE :: nflip(:) !<flip magnetisation of this atom
258
       REAL,ALLOCATABLE:: vr0(:) !< Average Coulomb potential for atoms
259
      END TYPE
260

261
      TYPE t_kpts
262
       INTEGER :: specificationType
263
       !no
264
       INTEGER :: nkpt
265
       INTEGER :: ntet
266
       REAL    :: posScale
267
       LOGICAL :: l_gamma
268
       INTEGER :: nmop(3) !<number of k-points in 3 directions
269 270 271 272
       !(3,nkpts) k-vectors internal units
       REAL,ALLOCATABLE ::bk(:,:)
       !(nkpts) weights
       REAL,ALLOCATABLE ::wtkpt(:)
273 274 275 276 277
       INTEGER, ALLOCATABLE :: pntgptd(:)
       INTEGER, ALLOCATABLE :: pntgpt(:,:,:,:,:)
       INTEGER               ::  nkptf !<k-vectors in full BZ
       INTEGER               ::  nkpt3(3)
       REAL   ,ALLOCATABLE   ::  bkf(:,:)
278
       INTEGER,ALLOCATABLE   ::  bkp(:)
279
       INTEGER,ALLOCATABLE   ::  bksym(:)
280 281 282
       INTEGER                       :: numSpecialPoints
       CHARACTER(LEN=50),ALLOCATABLE :: specialPointNames(:)
       REAL   ,ALLOCATABLE           :: specialPoints(:,:)
283 284
       INTEGER,ALLOCATABLE           :: ntetra(:,:)
       REAL   ,ALLOCATABLE           :: voltet(:)
285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306
      ENDTYPE


      TYPE t_cell
       !name of 2D-lattice type
       CHARACTER*3::latnam
       !vol of dtilde box
       REAL::omtil
       !2D area
       REAL::area
       !bravais matrix
       REAL::amat(3,3)
       !rez. bravais matrx
       REAL::bmat(3,3)
       !square of bbmat
       REAL::bbmat(3,3)
       !d-value
       REAL::z1
       !volume of cell
       REAL::vol
       !volume of interstitial
       REAL::volint
307
       REAL:: c
308 309 310 311 312 313
      END TYPE

      !The stars
      TYPE t_stars
        !max-length of star
        REAL :: gmax
314
        REAL :: gmaxInit
315 316 317 318 319
        !no of 3d-stars
        INTEGER :: ng3
        !no of 2d-stars
        INTEGER :: ng2
        !dim of box
320 321
        INTEGER ::mx1
        INTEGER ::mx2
322
        INTEGER ::mx3
323 324 325 326 327 328
        !No of elements in FFT
        INTEGER ::kimax
        !No of elements in 2D-FFT
        INTEGER ::kimax2
       
        !Box for FFT in pwden
329 330 331
        integer :: kq1_fft
        integer :: kq2_fft
        integer :: kq3_fft
332 333 334 335 336 337 338
        integer :: kmxq_fft !no of g-vectors in sphere

        !fft box for xc-pot
        integer :: kxc1_fft
        integer :: kxc2_fft
        integer :: kxc3_fft

339 340 341 342 343
        INTEGER :: ng3_fft
        INTEGER :: kmxxc_fft !<number of g-vectors forming the nxc3_fft stars in the charge density or xc-density sphere

        INTEGER :: nxc3_fft !< number of stars in the  charge density  fft-box

344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359
        !rep. g-vector of star
        INTEGER,ALLOCATABLE ::kv3(:,:)
        !length of star
        REAL,ALLOCATABLE    ::sk3(:)
        !mapping of g-vectors to stars
        INTEGER,ALLOCATABLE ::ig(:,:,:)
        !No of g-vectors in star
        INTEGER,ALLOCATABLE ::nstr(:)
        !rep. g-vector of 2D-star
        INTEGER,ALLOCATABLE ::kv2(:,:)
        !length of 2D-star
        REAL,ALLOCATABLE    ::sk2(:)
        !No of g-vecs in 2D-star
        INTEGER,ALLOCATABLE ::nstr2(:)
        !mapping of
        INTEGER,ALLOCATABLE ::ig2(:)
360
        !
361 362 363 364 365 366 367 368 369 370 371
        REAL,ALLOCATABLE:: phi2(:) !<(n2d)
        !phase phactor of g-vector
        COMPLEX,ALLOCATABLE    ::rgphs(:,:,:)
        !mapping of stars to FFT-box
        INTEGER, ALLOCATABLE :: igfft(:,:)
        !same for 2D
        INTEGER, ALLOCATABLE :: igfft2(:,:)
        !phasefactors for mapping
        COMPLEX,ALLOCATABLE  :: pgfft(:)
        !same of 2D
        COMPLEX,ALLOCATABLE  :: pgfft2(:)
372
        !
373 374 375
        REAL,ALLOCATABLE     :: ft2_gfx(:),ft2_gfy(:)
        COMPLEX, ALLOCATABLE :: ustep(:)
        REAL, ALLOCATABLE    :: ufft(:)
376
     END TYPE
377

378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476
     TYPE t_oneD
        TYPE (od_dim) :: odd
        TYPE (od_inp) :: odi
        TYPE (od_sym) :: ods
        TYPE (od_lda) :: odl
        TYPE (od_gga) :: odg
        INTEGER,  POINTER :: ig1(:,:)
        INTEGER,  POINTER :: kv1(:,:)
        INTEGER,  POINTER :: nstr1(:)
        INTEGER,  POINTER :: ngopr1(:)
        REAL,     POINTER :: mrot1(:,:,:)
        REAL,     POINTER :: tau1(:,:)
        INTEGER,  POINTER :: invtab1(:)
        INTEGER,  POINTER :: multab1(:,:)
        INTEGER,  POINTER :: igfft1(:,:)
        REAL,     POINTER :: pgfft1(:)
        REAL,     POINTER :: pgft1x(:)
        REAL,     POINTER :: pgft1y(:)
        REAL,     POINTER :: pgft1xx(:)
        REAL,     POINTER :: pgft1yy(:)
        REAL,     POINTER :: pgft1xy(:)
     END TYPE

     TYPE t_hybrid
      INTEGER               ::  ewaldlambda
      INTEGER               ::  lexp
      INTEGER               ::  bands1
      INTEGER               ::  bands2
      INTEGER(4)            ::  maxlcutm1
      INTEGER(4)            ::  maxindxm1
      INTEGER(4)            ::  maxbasm1
      INTEGER               ::  maxlcutm2
      INTEGER               ::  maxindxm2
      INTEGER               ::  maxbasm2
      INTEGER               ::  maxindxp1
      INTEGER               ::  maxindxp2
      INTEGER               ::  maxgptm
      INTEGER               ::  maxgptm1
      INTEGER               ::  maxgptm2
      INTEGER               ::  maxindx
      INTEGER               ::  maxlmindx
      INTEGER               ::  gptmd
      INTEGER,ALLOCATABLE   ::  nindx(:,:)
      INTEGER(4),ALLOCATABLE::  select1(:,:)
      INTEGER(4),ALLOCATABLE::  lcutm1(:)
      INTEGER(4),ALLOCATABLE::  select2(:,:)
      INTEGER,ALLOCATABLE   ::  lcutm2(:)
      INTEGER,ALLOCATABLE   ::  nindxm1(:,:)
      INTEGER,ALLOCATABLE   ::  nindxm2(:,:)
      INTEGER,ALLOCATABLE   ::  gptm(:,:)
      INTEGER,ALLOCATABLE   ::  ngptm1(:)
      INTEGER,ALLOCATABLE   ::  pgptm1(:,:)
      INTEGER,ALLOCATABLE   ::  ngptm2(:)
      INTEGER,ALLOCATABLE   ::  pgptm2(:,:)
      INTEGER,ALLOCATABLE   ::  ngptm (:)
      INTEGER,ALLOCATABLE   ::  pgptm (:,:)
      INTEGER,ALLOCATABLE   ::  nindxp1(:,:)
      INTEGER,ALLOCATABLE   ::  nindxp2(:,:)
      INTEGER,ALLOCATABLE   ::  lcutwf(:)
      INTEGER,ALLOCATABLE   ::  map(:,:)
      INTEGER,ALLOCATABLE   ::  tvec(:,:,:)
      REAL(8)               ::  radshmin
      REAL                  ::  gcutm1
      REAL                  ::  gcutm2
      REAL                  ::  tolerance1
      REAL                  ::  tolerance2
      REAL(8),ALLOCATABLE   ::  ddist(:)
      REAL   ,ALLOCATABLE   ::  basm1(:,:,:,:)
      REAL   ,ALLOCATABLE   ::  basm2(:,:,:,:)
      COMPLEX,ALLOCATABLE   ::  d_wgn2(:,:,:,:)
      LOGICAL               ::  l_subvxc
      LOGICAL               ::  l_calhf
      LOGICAL,ALLOCATABLE   ::  l_exxc(:,:)
     END TYPE

     TYPE t_dimension
        INTEGER :: jspd
        INTEGER :: nspd
        INTEGER :: nvd
        INTEGER :: nv2d
        INTEGER :: neigd
        INTEGER :: neigd2
        INTEGER :: ncvd
        INTEGER :: nn2d
        INTEGER :: nn3d
        INTEGER :: nstd
        INTEGER :: msh
        INTEGER :: lmd
        INTEGER :: lmplmd
        INTEGER :: nbasfcn
     END TYPE

     TYPE t_Jij
         LOGICAL :: l_J
         INTEGER :: nqpt
         INTEGER :: nqptd
         INTEGER ::phnd
         INTEGER ::nsh
         INTEGER ::mtypes
477
         INTEGER :: nmopq(3)
478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500
         REAL    :: thetaJ
         REAL    :: qn
         INTEGER :: nmagn
         INTEGER :: nkpt_l
         LOGICAL :: l_disp
         LOGICAL :: l_wr
         LOGICAL :: l_jenerg
         REAL, ALLOCATABLE :: qj(:,:)
         LOGICAL, ALLOCATABLE:: l_magn(:)
         REAL, ALLOCATABLE   :: M(:)
         INTEGER, ALLOCATABLE:: magtype(:)
         INTEGER, ALLOCATABLE::nmagtype(:)
         REAL, ALLOCATABLE :: eig_l(:,:)
          REAL, ALLOCATABLE :: alph1(:)
     END TYPE

     TYPE t_noco
        LOGICAL:: l_noco
        LOGICAL:: l_ss
        LOGICAL:: l_mperp
        LOGICAL:: l_constr
        REAL:: qss(3)
        REAL:: mix_b
501
        LOGICAL, ALLOCATABLE :: l_relax(:)
502
        REAL, ALLOCATABLE :: alphInit(:)
503 504 505
        REAL, ALLOCATABLE :: alph(:)
        REAL, ALLOCATABLE :: beta(:)
        REAL, ALLOCATABLE :: b_con(:,:)
506 507 508
        LOGICAL              :: l_soc
        LOGICAL, ALLOCATABLE :: soc_opt(:)
        REAL                 :: theta
509
        REAL                 :: phi
510 511 512 513 514 515 516
     END TYPE

     TYPE t_xcpot
        INTEGER :: icorr
        INTEGER :: igrd
        REAL    :: gmaxxc
     END TYPE
517

518 519 520 521 522 523 524 525 526

     TYPE t_input
        LOGICAL :: strho
        LOGICAL :: cdinf
        LOGICAL :: vchk
        LOGICAL :: l_f
        LOGICAL :: eonly
        LOGICAL :: film
        LOGICAL :: ctail
527
        INTEGER :: coretail_lmax
528
        INTEGER :: itmax
529
        REAL    :: minDistance
530 531 532 533
        INTEGER :: maxiter
        INTEGER :: imix
        INTEGER :: gw
        INTEGER :: gw_neigd
534
        INTEGER :: qfix
535 536 537 538 539 540 541 542 543 544 545 546 547 548
        REAL    :: xa !< mixing parameter for geometry optimzer
        REAL    :: thetad !< Debey temperature for first step of geometry optimzer
        REAL    :: epsdisp !< minimal displacement. If all displacements are < epsdisp stop
        REAL    :: epsforce !< minimal force. If all forces <epsforce stop
        INTEGER :: isec1
        INTEGER :: krla
        REAL    :: delgau
        REAL    :: alpha
        REAL    :: spinf
        REAL    :: tkb
        LOGICAL :: gauss
        LOGICAL :: l_bmt
        !INTEGER:: scale
        INTEGER:: jspins
549
        INTEGER:: kcrel
550 551 552 553 554 555 556 557 558 559 560 561 562
        LOGICAL:: frcor
        LOGICAL:: lflip
        LOGICAL:: score
        LOGICAL:: swsp
        LOGICAL:: tria
        LOGICAL:: integ
        LOGICAL:: pallst
        LOGICAL:: l_wann
        LOGICAL:: secvar
        LOGICAL:: evonly(2)
        LOGICAL:: eigvar(3)
        LOGICAL:: sso_opt(2)
        LOGICAL:: total
563
        LOGICAL:: l_inpXML
564 565 566 567
        REAL :: ellow
        REAL :: elup
        REAL :: rkmax
        REAL :: zelec
568
        CHARACTER(LEN=8) :: comment(10)
569
        TYPE(t_efield)::efield
570
        LOGICAL :: l_core_confpot
571
        LOGICAL :: l_useapw
572
     END TYPE
573

574 575 576 577 578
     type t_sliceplot
        logical :: iplot
        logical :: slice
        logical :: plpot
        integer :: kk
579
        integer :: nnne
580
        real    :: e1s
581
        real    :: e2s
582 583 584
     end type
     TYPE t_banddos
       LOGICAL :: dos
585
       LOGICAL :: band
586 587
       LOGICAL :: l_mcd
       LOGICAL :: l_orb
588 589
       LOGICAL :: vacdos
       INTEGER :: ndir
590
       INTEGER :: orbCompAtom
591 592 593 594 595 596
       REAL    :: e1_dos
       real    :: e2_dos
       real    :: sig_dos
     END TYPE

     TYPE t_obsolete
597
        INTEGER:: lepr !floating energy parameters...
598 599 600 601 602 603 604 605 606
        LOGICAL:: disp
        INTEGER:: ndvgrd
        REAL   :: chng
        LOGICAL :: lwb
        LOGICAL:: l_u2f
        LOGICAL:: l_f2u
        LOGICAL :: pot8
     END TYPE

607

608 609 610 611
     TYPE t_enpara
      REAL, ALLOCATABLE :: el0(:,:,:)
      REAL, ALLOCATABLE :: evac0(:,:)
      REAL, ALLOCATABLE :: ello0(:,:,:)
612
      REAL, ALLOCATABLE :: enmix(:)
613
      INTEGER, ALLOCATABLE :: skiplo(:,:)
614
      LOGICAL, ALLOCATABLE :: lchange(:,:,:)
615
      LOGICAL, ALLOCATABLE :: lchg_v(:,:)
616 617
      LOGICAL, ALLOCATABLE :: llochg(:,:,:)
      REAL                 :: epara_min
618 619 620 621 622 623 624 625 626 627
     end type

     TYPE t_vacuum
        !Stuff for the vacuum
        INTEGER ::nmz
        INTEGER ::nmzd
        INTEGER ::nmzxy
        INTEGER ::nmzxyd
        INTEGER :: layerd
        INTEGER :: layers
628
        INTEGER :: nvac
629 630 631 632 633 634 635 636 637 638
        INTEGER :: nvacd
        REAL :: delz
        REAL :: dvac
        INTEGER::nstars
        INTEGER:: nstm
        REAL :: tworkf
        REAL :: locx(2)
        REAL :: locy(2)
        LOGICAL ::starcoeff
        INTEGER, ALLOCATABLE :: izlay(:,:)
639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654
      END TYPE


                          !Data for the spherical harmonics
      TYPE t_sphhar
        !No of symmetry types (must
        !equal maxval(atoms%ntypsy)
        INTEGER ::ntypsd
        !Max no of members of sphhar
        INTEGER ::memd
        !max of nlh
        INTEGER ::nlhd
        !No of sphhar (ntypsd)
        INTEGER,ALLOCATABLE ::nlh(:)
        !l's of sphhar (0:nlhd,ntypsd)
        INTEGER,ALLOCATABLE ::llh(:,:)
655
        !No of members in sphhar (0:nlh
656
        INTEGER,ALLOCATABLE ::nmem(:,:)
657
        !lm's of of members (max(nmem),
658
        INTEGER,ALLOCATABLE ::mlh(:,:,:)
659
        !phasefactors (max(nmem),0:nlhd
660 661 662 663 664
        COMPLEX,ALLOCATABLE ::clnu(:,:,:)
      END TYPE

      !symmetry information
      TYPE t_sym
665
       INTEGER :: symSpecType
666
       !Symophic group
667 668 669
       LOGICAL ::symor
       INTEGER ::nsymt
       INTEGER               ::  nsym
670

671
       COMPLEX,ALLOCATABLE:: d_wgn(:,:,:,:)
672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691
       !2D-inv-sym
       LOGICAL ::invs2
       !Inversion-sym
       LOGICAL ::invs
       !Z-refls. sym
       LOGICAL ::zrfs
       !No of sym ops
       INTEGER ::nop
       !No of 2D-sym ops
       INTEGER ::nop2
       !Rot-matrices (3,3,nop)
       INTEGER,ALLOCATABLE::mrot(:,:,:)
       !inverse operation (nop)
       INTEGER,ALLOCATABLE::invtab(:)
       !translation vectors (3,nop)
       REAL,ALLOCATABLE::tau(:,:)
       !Name of lattice type
       CHARACTER*3   :: latnam
       !Name of sym
       CHARACTER*4   :: namgrp
692 693 694 695 696
      INTEGER, ALLOCATABLE :: multab(:,:)
      INTEGER, ALLOCATABLE :: invsatnr(:)
      INTEGER, ALLOCATABLE :: invarop(:,:)
      INTEGER, ALLOCATABLE :: invarind(:)

697
      END TYPE
698 699 700 701 702 703 704 705 706 707 708 709 710 711 712

      TYPE t_results
        REAL, ALLOCATABLE :: force(:,:,:)   !< Forces calculated on all atoms (for each spin)
        REAL, ALLOCATABLE :: force_old(:,:) !< Forces on all atoms from last iteration
        REAL              :: ef        !<Fermie energy
        REAL              :: seigc     !<sum of the core eigenvalues
        REAL              :: seigsc    !<weighted sum of the semi-core eigenvalues
        REAL              :: seigv     !<weighted sum of the occupied valence eigenvalues
        REAL              :: seigscv   !<sum of seigv and seigsc
        REAL              :: ts        !<entropy contribution to the free energy
        REAL              :: te_vcoul  !<charge density-coulomb potential integral
        REAL              :: te_veff   !<charge density-effective potential integral
        REAL              :: te_exc    !<charge density-ex-corr.energy density integral
        REAL              :: e_ldau    !<total energy contribution of LDA+U
        REAL              :: tote
713
        REAL              :: last_distance
714
        REAL              :: bandgap
715 716 717 718 719 720 721 722 723 724
        TYPE(t_energy_hf) ::  te_hfex
        REAL              ::  te_hfex_loc(2)
        REAL, ALLOCATABLE :: w_iks(:,:,:)
      END TYPE


      TYPE t_mpi
       INTEGER :: mpi_comm !< replaces MPI_COMM_WORLD
       INTEGER :: irank    !< rank of task in mpi_comm
       INTEGER :: isize    !< no of tasks in mpi_comm
Daniel Wortmann's avatar
Daniel Wortmann committed
725 726 727 728 729 730
       INTEGER :: n_start  !< no of first k-point to calculate on this PE
       INTEGER :: n_stride !< stride for k-loops
       INTEGER :: n_size   !< PE per kpoint, i.e. "isize" for eigenvalue parallelization
       INTEGER :: n_groups !< No of k-loops per PE
       INTEGER :: sub_comm !< Sub-Communicator for eigenvalue parallelization (all PE working on same k-point)
       INTEGER :: n_rank   !< rank in sub_comm
731
      END TYPE
732

733 734 735 736
      TYPE t_zMat
        LOGICAL              :: l_real
        INTEGER              :: nbasfcn
        INTEGER              :: nbands
737 738
        REAL,    ALLOCATABLE :: z_r(:,:) ! z_r(nbasfcn,nbands)
        COMPLEX, ALLOCATABLE :: z_c(:,:) ! z_c(nbasfcn,nbands)
739
      END TYPE
740

741 742 743 744 745 746
      TYPE t_hamOvlp
        LOGICAL              :: l_real
        INTEGER              :: matsize
        REAL,    ALLOCATABLE :: a_r(:), b_r(:)
        COMPLEX, ALLOCATABLE :: a_c(:), b_c(:)
      END TYPE
Daniel Wortmann's avatar
Daniel Wortmann committed
747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833
!
! type for wannier-functions
!
      type t_wann
        integer :: wan90version
        integer :: oc_num_orbs
        integer,allocatable :: oc_orbs(:)
        logical :: l_unformatted
        logical :: l_oc_f
        logical :: l_ndegen
        logical :: l_orbitalmom
        logical :: l_orbcomp
        logical :: l_orbcomprs
        logical :: l_denmat
        logical :: l_perturbrs
        logical :: l_perturb
        logical :: l_nedrho
        logical :: l_anglmomrs
        logical :: l_anglmom
        logical :: l_spindisp
        logical :: l_spindisprs
        logical :: l_socspicom
        logical :: l_socspicomrs
        logical :: l_offdiposoprs
        logical :: l_offdiposop
        logical :: l_torque
        logical :: l_torquers
        logical :: l_atomlist
        integer :: atomlist_num
        integer,allocatable :: atomlist(:)
        logical :: l_berry
        logical :: l_perpmagrs
        logical :: l_perpmag
        logical :: l_perpmagat
        logical :: l_perpmagatrs
        logical :: l_socmatrs
        logical :: l_socmat
        logical :: l_soctomom
        logical :: l_kptsreduc2
        logical :: l_nablapaulirs
        logical :: l_nablars
        logical :: l_surfcurr
        logical :: l_updown
        logical :: l_ahe
        logical :: l_she
        logical :: l_rmat
        logical :: l_nabla
        logical :: l_socodi
        logical :: l_pauli
        logical :: l_pauliat
        logical :: l_potmat
        logical :: l_projgen
        logical :: l_plot_symm
        logical :: l_socmmn0
        logical :: l_bzsym
        logical :: l_hopping
        logical :: l_kptsreduc
        logical :: l_prepwan90
        logical :: l_plot_umdat
        logical :: l_wann_plot
        logical :: l_bynumber
        logical :: l_stopopt
        logical :: l_matrixmmn
        logical :: l_matrixamn
        logical :: l_projmethod
        logical :: l_wannierize
        logical :: l_plotw90
        logical :: l_byindex
        logical :: l_byenergy
        logical :: l_proj_plot
        logical :: l_bestproj
        logical :: l_ikptstart
        logical :: l_lapw
        logical :: l_plot_lapw
        logical :: l_fermi
        logical :: l_dipole
        logical :: l_dipole2
        logical :: l_dipole3
        logical :: l_mmn0
        logical :: l_mmn0at
        logical :: l_manyfiles
        logical :: l_collectmanyfiles
        logical :: l_ldauwan
        logical :: l_lapw_kpts
        logical :: l_lapw_gfleur
        logical :: l_kpointgen
        logical :: l_w90kpointgen
834 835 836 837 838
        logical :: l_finishnocoplot
        logical :: l_finishgwf
        logical :: l_skipkov
        logical :: l_matrixuHu
        logical :: l_matrixuHu_dmi
Daniel Wortmann's avatar
Daniel Wortmann committed
839 840 841 842 843 844 845
        integer :: ikptstart
        integer :: band_min(1:2)
        integer :: band_max(1:2)
        integer :: gfthick
        integer :: gfcut
        integer :: unigrid(6)
        integer :: mhp(3)
846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866
!---> gwf
        LOGICAL :: l_ms
        LOGICAL :: l_sgwf
        LOGICAL :: l_socgwf
        LOGICAL :: l_gwf
        LOGICAL :: l_bs_comf
        LOGICAL :: l_exist
        LOGICAL :: l_opened
        LOGICAL :: l_cleverskip
        LOGICAL :: l_dim(3)
        REAL    :: scale_param
        REAL    :: aux_latt_const
        REAL    :: hdwf_t1
        REAL    :: hdwf_t2
        INTEGER :: nparampts
        CHARACTER(len=20) :: fn_eig
        CHARACTER(len=20) :: param_file
        REAL,ALLOCATABLE :: param_vec(:,:)
        REAL,ALLOCATABLE :: param_alpha(:,:)
!---> gwf

Daniel Wortmann's avatar
Daniel Wortmann committed
867
      end type t_wann
868

869
      END