wunfiles Subroutine

public subroutine wunfiles(npol, npnt1, npnt2, npnt3, ielast, tk, emin, emax, ez, wez, efermi, npolsemi, n1semi, n2semi, n3semi, iesemicore, tksemi, ebotsemi, emusemi, fsemicore, vins, visp, vbc, vtrel, btrel, rmrel, drdirel, r2drdirel, zrel, jwsrel, irshift, itscf, scfsteps, cmomhost, ecore, lcore, ncore, qmtet, qmphi, qmphitab, qmtettab, qmgamtab, drotq, nsra, ins, natyp, naez, nineq, nref, nspin, ncls, icst, ipan, ircut, alat, zat, r, drdi, refpot, rmtref, vref, iend, jend, cleb, icleb, atom, cls, rcls, nacls, loflm, solver, socscl, cscl, icc, igf, nlbasis, nrbasis, ncpa, icpa, itcpamax, cpatol, rbasis, rr, ezoa, nshell, nsh1, nsh2, ijtabcalc, ijtabcalc_i, ish, jsh, ijtabsym, ijtabsh, nofgij, nqcalc, iqcalc, kmrot, kaoez, iqat, noq, conc, kmesh, maxmesh, nsymat, symunitary, rrot, dsymll, invmod, icheck, natomimp, ratom, atomimp, rc, crel, rrel, srrel, nrrel, irrel, lefttinvll, righttinvll, vacflag, a, b, ifunm, ifunm1, intervx, intervy, intervz, ititle, lmsp1, ntcell, thetas, lpot, lmpot, nright, nleft, linterface, imix, mixing, qbound, fcm, itdbry, irns, kpre, kshape, kte, kvmad, kxc, lambda_xc, txc, ishift, ixipol, lrhosym, kforce, lmsp, llmsp, rmt, rmtnew, rws, imt, irc, irmin, irws, nfu, hostimp, gsh, ilm_map, imaxsh, idoldau, itrunldau, ntldau, lopt, itldau, ueff, jeff, erefldau, uldau, wldau, phildau, iemxd, irmind, irm, nspotd, npotd, nembd1, lmmaxd, ipand, nembd2, lmax, ncleb, naclsd, nclsd, lm2d, lmaxd1, mmaxd, nr, nsheld, naezdpd, natomimpd, nspind, irid, nfund, ncelld, lmxspd, ngshd, krel, ntotd, ncheb, npan_log, npan_eq, npan_log_at, npan_eq_at, r_log, npan_tot, rnew, rpan_intervall, ipan_intervall, nspindd, thetasnew, socscale, tolrdif, lly, deltae, rclsimp, verbosity, MPI_scheme, special_straight_mixing, bfield)

Uses

This routine was oiginally meant to write unformated files to then be read by other executables, now it does the same job via storing types instead reducing I/O and allowing for MPI communication.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: npol

Number of Matsubara Poles (EMESHT)

integer, intent(in) :: npnt1

number of E points (EMESHT) for the contour integration

integer, intent(in) :: npnt2

number of E points (EMESHT) for the contour integration

integer, intent(in) :: npnt3

number of E points (EMESHT) for the contour integration

integer, intent(in) :: ielast
real(kind=dp), intent(in) :: tk

Temperature

real(kind=dp), intent(inout) :: emin

Energies needed in EMESHT

real(kind=dp), intent(in) :: emax

Energies needed in EMESHT

complex(kind=dp), intent(in), dimension (iemxd) :: ez
complex(kind=dp), intent(in), dimension (iemxd) :: wez
real(kind=dp), intent(in) :: efermi

Fermi energy

integer, intent(in) :: npolsemi

Number of poles for the semicore contour

integer, intent(in) :: n1semi

Number of energy points for the semicore contour

integer, intent(in) :: n2semi

Number of energy points for the semicore contour

integer, intent(in) :: n3semi

Number of energy points for the semicore contour

integer, intent(in) :: iesemicore
real(kind=dp), intent(in) :: tksemi

Temperature of semi-core contour

real(kind=dp), intent(in) :: ebotsemi
real(kind=dp), intent(in) :: emusemi
real(kind=dp), intent(in) :: fsemicore
real(kind=dp), intent(in), dimension (irmind:irm, lmpot, nspotd) :: vins

Non-spherical part of the potential

real(kind=dp), intent(in), dimension (irm, npotd) :: visp

Spherical part of the potential

real(kind=dp), intent(in), dimension (2) :: vbc

Potential constants

real(kind=dp), intent(inout), dimension (irm*krel+(1-krel), natyp) :: vtrel

potential (spherical part)

real(kind=dp), intent(inout), dimension (irm*krel+(1-krel), natyp) :: btrel

magnetic field

real(kind=dp), intent(inout), dimension (irm*krel+(1-krel), natyp) :: rmrel

radial mesh

real(kind=dp), intent(in), dimension (irm*krel+(1-krel), natyp) :: drdirel
real(kind=dp), intent(in), dimension (irm*krel+(1-krel), natyp) :: r2drdirel
integer, intent(in), dimension (natyp) :: zrel

atomic number (cast integer)

integer, intent(in), dimension (natyp) :: jwsrel

index of the WS radius

integer, intent(in), dimension (natyp) :: irshift

shift of the REL radial mesh with respect no NREL

integer, intent(in) :: itscf
integer, intent(inout) :: scfsteps

number of scf iterations

real(kind=dp), intent(in), dimension (lmpot, nembd1) :: cmomhost

Charge moments of each atom of the (left/right) host

real(kind=dp), intent(in), dimension (20, npotd) :: ecore

Core energies

integer, intent(in), dimension (20, npotd) :: lcore

Angular momentum of core states

integer, intent(in), dimension (npotd) :: ncore

Number of core states

real(kind=dp), intent(in), dimension (naez) :: qmtet

angle of the agnetization with respect to the z-axis

real(kind=dp), intent(in), dimension (naez) :: qmphi

angle of the agnetization with respect to the z-axis

real(kind=dp), intent(in), dimension (naez, 3) :: qmphitab
real(kind=dp), intent(in), dimension (naez, 3) :: qmtettab
real(kind=dp), intent(in), dimension (naez, 3) :: qmgamtab
complex(kind=dp), intent(in), dimension (lmmaxd, lmmaxd, naez) :: drotq

Rotation matrices to change between LOCAL/GLOBAL frame of reference for magnetisation!> Oz or noncollinearity

integer, intent(in) :: nsra
integer, intent(in) :: ins

0 (MT), 1(ASA), 2(Full Potential)

integer, intent(in) :: natyp

Number of kinds of atoms in unit cell

integer, intent(in) :: naez

Number of atoms in unit cell

integer, intent(in) :: nineq

Number of ineq. positions in unit cell

integer, intent(in) :: nref

Number of diff. ref. potentials

integer, intent(in) :: nspin

Counter for spin directions

integer, intent(in) :: ncls

Number of reference clusters

integer, intent(in) :: icst

Number of Born approximation

integer, intent(in), dimension (natyp) :: ipan

Number of panels in non-MT-region

integer, intent(in), dimension (0:ipand, natyp) :: ircut

R points of panel borders

real(kind=dp), intent(in) :: alat

Lattice constant in a.u.

real(kind=dp), intent(in), dimension (natyp) :: zat

Nuclear charge

real(kind=dp), intent(in), dimension (irm, natyp) :: r

Radial mesh ( in units a Bohr)

real(kind=dp), intent(in), dimension (irm, natyp) :: drdi

Derivative dr/di

integer, intent(in), dimension (nembd2) :: refpot

Ref. pot. card at position

real(kind=dp), intent(in), dimension (nref) :: rmtref

Muffin-tin radius of reference system

real(kind=dp), intent(in), dimension (nref) :: vref
integer, intent(in) :: iend

Number of nonzero gaunt coefficients

integer, intent(in), dimension (lmpot, 0:lmax, 0:lmax) :: jend

Pointer array for icleb()

real(kind=dp), intent(in), dimension (ncleb, 2) :: cleb

GAUNT coefficients (GAUNT)

integer, intent(in), dimension (ncleb, 4) :: icleb

Pointer array

integer, intent(in), dimension (naclsd, nembd2) :: atom

Atom at site in cluster

integer, intent(in), dimension (nembd2) :: cls

Cluster around atomic sites

real(kind=dp), intent(in), dimension (3, naclsd, nclsd) :: rcls

Real space position of atom in cluster

integer, intent(in), dimension (nclsd) :: nacls

Number of atoms in cluster

integer, intent(in), dimension (lm2d) :: loflm

l of lm=(l,m) (GAUNT)

character(len=10), intent(in) :: solver

Type of solver

real(kind=dp), intent(inout), dimension (krel*lmax+1, krel*natyp+(1-krel)) :: socscl
real(kind=dp), intent(inout), dimension (krel*lmax+1, krel*natyp+(1-krel)) :: cscl

Speed of light scaling

integer, intent(in) :: icc

Enables the calculation of off-diagonal elements of the GF.(0=SCF/DOS; 1=cluster; -1=custom)

integer, intent(in) :: igf

Do not print or print (0/1) the KKRFLEX_* files

integer, intent(in) :: nlbasis

Number of basis layers of left host (repeated units)

integer, intent(in) :: nrbasis

Number of basis layers of right host (repeated units)

integer, intent(in) :: ncpa

NCPA = 0/1 CPA flag

integer, intent(in), dimension (naez) :: icpa

ICPA = 0/1 site-dependent CPA flag

integer, intent(in) :: itcpamax

Max. number of CPA iterations

real(kind=dp), intent(in) :: cpatol

Convergency tolerance for CPA-cycle

real(kind=dp), intent(in), dimension (3, nembd2) :: rbasis

Position of atoms in the unit cell in units of bravais vectors

real(kind=dp), intent(in), dimension (3, 0:nr) :: rr
integer, intent(in), dimension (naclsd, nembd2) :: ezoa

EZ of atom at site in cluster

integer, intent(in), dimension (0:nsheld) :: nshell

Index of atoms/pairs per shell (ij-pairs); nshell(0) = number of shells

integer, intent(in), dimension (nsheld) :: nsh1

Corresponding index of the sites I/J in (NSH1/2) in the unit cell in a shell

integer, intent(in), dimension (nsheld) :: nsh2

Corresponding index of the sites I/J in (NSH1/2) in the unit cell in a shell

integer, intent(in), dimension (nofgij) :: ijtabcalc

Linear pointer, specifying whether the block (i,j) has to be calculated needs set up for ICC=-1, not used for ICC=1

integer, intent(in), dimension (nofgij) :: ijtabcalc_i
integer, intent(in), dimension (nsheld, 2*nsymaxd) :: ish
integer, intent(in), dimension (nsheld, 2*nsymaxd) :: jsh
integer, intent(in), dimension (nofgij) :: ijtabsym

Linear pointer, assigns pair (i,j) to the rotation bringing GS into Gij

integer, intent(in), dimension (nofgij) :: ijtabsh

Linear pointer, assigns pair (i,j) to a shell in the array GS(,,*,NSHELD)

integer, intent(in) :: nofgij

number of GF pairs IJ to be calculated as determined from IJTABCALC<>0

integer, intent(in) :: nqcalc
integer, intent(in), dimension (naez) :: iqcalc
integer, intent(in) :: kmrot

0: no rotation of the magnetisation; 1: individual rotation of the magnetisation for every site

integer, intent(in), dimension (natyp, nembd2) :: kaoez

Kind of atom at site in elem. cell

integer, intent(in), dimension (natyp) :: iqat

The site on which an atom is located on a given site

integer, intent(in), dimension (naez) :: noq

Number of diff. atom types located

real(kind=dp), intent(in), dimension (natyp) :: conc

Concentration of a given atom

integer, intent(in), dimension (iemxd) :: kmesh
integer, intent(in) :: maxmesh
integer, intent(in) :: nsymat
logical, intent(in), dimension (nsymaxd) :: symunitary

unitary/antiunitary symmetry flag

real(kind=dp), intent(in), dimension (48, 3, nsheld) :: rrot
complex(kind=dp), intent(in), dimension (lmmaxd, lmmaxd, nsymaxd) :: dsymll
integer, intent(in) :: invmod

Inversion scheme

integer, intent(in), dimension (naezdpd, naezdpd) :: icheck
integer, intent(in) :: natomimp

Size of the cluster for impurity-calculation output of GF should be 1, if you don't do such a calculation

real(kind=dp), intent(in), dimension (3, nsheld) :: ratom
integer, intent(in), dimension (natomimpd) :: atomimp
complex(kind=dp), intent(in), dimension (lmmaxd, lmmaxd) :: rc

NREL REAL spher. harm. > CMPLX. spher. harm. NREL CMPLX. spher. harm. > REAL spher. harm.

complex(kind=dp), intent(in), dimension (lmmaxd, lmmaxd) :: crel

Non-relat. CMPLX. spher. harm. > (kappa,mue) (kappa,mue) > non-relat. CMPLX. spher. harm.

complex(kind=dp), intent(in), dimension (lmmaxd, lmmaxd) :: rrel

Non-relat. REAL spher. harm. > (kappa,mue) (kappa,mue) > non-relat. REAL spher. harm.

complex(kind=dp), intent(in), dimension (2, 2, lmmaxd) :: srrel
integer, intent(in), dimension (2, lmmaxd) :: nrrel
integer, intent(in), dimension (2, 2, lmmaxd) :: irrel
complex(kind=dp), intent(in), dimension (lmmaxd, lmmaxd, nembd1, nspindd, iemxd) :: lefttinvll
complex(kind=dp), intent(in), dimension (lmmaxd, lmmaxd, nembd1, nspindd, iemxd) :: righttinvll
logical, intent(in), dimension (2) :: vacflag
real(kind=dp), intent(in), dimension (natyp) :: a

Constants for exponential R mesh

real(kind=dp), intent(in), dimension (natyp) :: b

Constants for exponential R mesh

integer, intent(in), dimension (natyp, lmxspd) :: ifunm
integer, intent(in), dimension (lmxspd, natyp) :: ifunm1
integer, intent(in) :: intervx

Number of intervals in x-direction for k-net in IB of the BZ

integer, intent(in) :: intervy

Number of intervals in y-direction for k-net in IB of the BZ

integer, intent(in) :: intervz

Number of intervals in z-direction for k-net in IB of the BZ

integer, intent(in), dimension (20, npotd) :: ititle
integer, intent(in), dimension (lmxspd, natyp) :: lmsp1
integer, intent(in), dimension (natyp) :: ntcell

Index for WS cell

real(kind=dp), intent(in), dimension (irid, nfund, ncelld) :: thetas

shape function THETA=0 outer space THETA =1 inside WS cell in spherical harmonics expansion

integer, intent(in) :: lpot

Maximum l component in potential expansion

integer, intent(in) :: lmpot

(LPOT+1)**2

integer, intent(in) :: nright

Number of repeated basis for right host to get converged electrostatic potentials

integer, intent(in) :: nleft

Number of repeated basis for left host to get converged electrostatic potentials

logical, intent(in) :: linterface

If True a matching with semi-inifinite surfaces must be performed

integer, intent(in) :: imix

Type of mixing scheme used (0=straight, 4=Broyden 2nd, 5=Anderson)

real(kind=dp), intent(in) :: mixing

Magnitude of the mixing parameter

real(kind=dp), intent(in) :: qbound

Convergence parameter for the potential

real(kind=dp), intent(in) :: fcm
integer, intent(in) :: itdbry

Number of SCF steps to remember for the Broyden mixing

integer, intent(in), dimension (natyp) :: irns

Position of atoms in the unit cell in units of bravais vectors

integer, intent(in) :: kpre
integer, intent(in) :: kshape

Exact treatment of WS cell

integer, intent(in) :: kte

Calculation of the total energy On/Off (1/0)

integer, intent(in) :: kvmad
integer, intent(in) :: kxc

Type of xc-potential 0=vBH 1=MJW 2=VWN 3=PW91

real(kind=dp), intent(in), dimension (natyp) :: lambda_xc

Scale magnetic moment (0! Lambda_XC! 1, 0=zero moment, 1= full moment)

character(len=124), intent(in), dimension (6) :: txc
integer, intent(in) :: ishift
integer, intent(in), dimension (natyp) :: ixipol

Constraint of spin pol.

logical, intent(in) :: lrhosym
integer, intent(in) :: kforce

Calculation of the forces

integer, intent(in), dimension (natyp, lmxspd) :: lmsp

0,1 : non/-vanishing lm=(l,m) component of non-spherical potential

integer, intent(in), dimension (natyp, nfund) :: llmsp

lm=(l,m) of 'nfund'th nonvanishing component of non-spherical pot.

real(kind=dp), intent(in), dimension (natyp) :: rmt

Muffin-tin radius of true system

real(kind=dp), intent(in), dimension (natyp) :: rmtnew

Adapted muffin-tin radius

real(kind=dp), intent(in), dimension (natyp) :: rws

Wigner Seitz radius

integer, intent(in), dimension (natyp) :: imt

R point at MT radius

integer, intent(in), dimension (natyp) :: irc

R point for potential cutting

integer, intent(in), dimension (natyp) :: irmin

Max R for spherical treatment

integer, intent(in), dimension (natyp) :: irws

R point at WS radius

integer, intent(in), dimension (natyp) :: nfu
integer, intent(in), dimension (0:natyp) :: hostimp
real(kind=dp), intent(in), dimension (ngshd) :: gsh
integer, intent(in), dimension (ngshd, 3) :: ilm_map
integer, intent(in), dimension (0:lmpot) :: imaxsh
integer, intent(in) :: idoldau

flag to perform LDA+U

integer, intent(in) :: itrunldau

Iteration index for LDA+U

integer, intent(in) :: ntldau

number of atoms on which LDA+U is applied

integer, intent(in), dimension (natyp) :: lopt

angular momentum QNUM for the atoms on which LDA+U should be applied (-1 to switch it OFF)

integer, intent(in), dimension (natyp) :: itldau

integer pointer connecting the NTLDAU atoms to heir corresponding index in the unit cel

real(kind=dp), intent(in), dimension (natyp) :: ueff

input U parameter for each atom

real(kind=dp), intent(in), dimension (natyp) :: jeff

input J parameter for each atom

real(kind=dp), intent(in), dimension (natyp) :: erefldau

the energies of the projector's wave functions (REAL)

real(kind=dp), intent(in), dimension (mmaxd, mmaxd, mmaxd, mmaxd, natyp) :: uldau

calculated Coulomb matrix elements (EREFLDAU)

real(kind=dp), intent(in), dimension (mmaxd, mmaxd, nspind, natyp) :: wldau

potential matrix

complex(kind=dp), intent(in), dimension (irm, natyp) :: phildau
integer, intent(in) :: iemxd

Dimension for energy-dependent arrays

integer, intent(in) :: irmind

IRM-IRNSD

integer, intent(in) :: irm

Maximum number of radial points

integer, intent(in) :: nspotd

Number of potentials for storing non-sph. potentials

integer, intent(in) :: npotd

(2(KREL+KORBIT)+(1-(KREL+KORBIT))NSPIND)*NATYP)

integer, intent(in) :: nembd1

NEMB+1

integer, intent(in) :: lmmaxd

(KREL+KORBIT+1)(LMAX+1)^2

integer, intent(in) :: ipand

Number of panels in non-spherical part

integer, intent(in) :: nembd2
integer, intent(in) :: lmax

Maximum l component in wave function expansion

integer, intent(in) :: ncleb

Number of Clebsch-Gordon coefficients

integer, intent(in) :: naclsd

Maximum number of atoms in a TB-cluster

integer, intent(in) :: nclsd

Maximum number of different TB-clusters

integer, intent(in) :: lm2d

(2LMAX+1)*2

integer, intent(in) :: lmaxd1
integer, intent(in) :: mmaxd

2*LMAX+1

integer, intent(in) :: nr

Number of real space vectors rr

integer, intent(in) :: nsheld

Number of blocks of the GF matrix that need to be calculated (NATYP + off-diagonals in case of impurity)

integer, intent(in) :: naezdpd
integer, intent(in) :: natomimpd

Size of the cluster for impurity-calculation output of GF should be 1, if you don't do such a calculation

integer, intent(in) :: nspind

KREL+(1-KREL)*(NSPIN+1)

integer, intent(in) :: irid

Shape functions parameters in non-spherical part

integer, intent(in) :: nfund

Shape functions parameters in non-spherical part

integer, intent(in) :: ncelld

Number of cells (shapes) in non-spherical part

integer, intent(in) :: lmxspd

(2LPOT+1)*2

integer, intent(in) :: ngshd

Shape functions parameters in non-spherical part

integer, intent(in) :: krel

Switch for non-relativistic/relativistic (0/1) program. Attention: several other parameters depend explicitly on KREL, they are set automatically Used for Dirac solver in ASA

integer, intent(in) :: ntotd
integer, intent(in) :: ncheb

Number of Chebychev pannels for the new solver

integer, intent(in) :: npan_log

Variables for the pannels for the new solver

integer, intent(in) :: npan_eq

Variables for the pannels for the new solver

integer, intent(in), dimension (natyp) :: npan_log_at
integer, intent(in), dimension (natyp) :: npan_eq_at
real(kind=dp), intent(in) :: r_log
integer, intent(in), dimension (natyp) :: npan_tot
real(kind=dp), intent(in), dimension (ntotd*(ncheb+1), natyp) :: rnew
real(kind=dp), intent(in), dimension (0:ntotd, natyp) :: rpan_intervall
integer, intent(in), dimension (0:ntotd, natyp) :: ipan_intervall
integer, intent(in) :: nspindd

NSPIND-KORBIT

real(kind=dp), intent(in), dimension (ntotd*(ncheb+1), nfund, ncelld) :: thetasnew
real(kind=dp), intent(in), dimension (natyp) :: socscale

Spin-orbit scaling

real(kind=dp), intent(in) :: tolrdif

Tolerance for r<tolrdif (a.u.) to handle vir. atoms

integer, intent(in) :: lly

LLY!> 0 : apply Lloyds formula

complex(kind=dp), intent(in) :: deltae

Energy difference for numerical derivative

real(kind=dp), intent(in), dimension (3, natomimpd) :: rclsimp
integer, intent(in) :: verbosity

verbosity level for timings and output: 0=old default, 1,2,3 = timing and ouput verbosity level the same (low,medium,high)

integer, intent(in) :: MPI_scheme

!! scheme for MPI parallelization: 0 = automatic (default), 1 = atoms, 2 = energies, 3 = select best of (1,2)

integer, intent(in) :: special_straight_mixing

id to specify modified straight mixing scheme: 0=normal, 1=alternating mixing factor (i.e. reduced mixing factor in every odd iteration), 2=charge-neurality based mixing factor (former: 'alt mix' and 'spec mix')

type(type_bfield), intent(in) :: bfield