# ---------------------------------------------------------------------------------------------------------
#
# NiO with 4 atoms in DMFT
# low cutoff, low number of k-points
# DMFT with hubbard I tested with self-consistency over density
# Test of paral_kgb with DMFT
#
# ---------------------------------------------------------------------------------------------------------
# -- Datasets and options
ndtset 2
jdtset 1 2
prtvol 4
pawprtvol -1
getwfk2 -1

# -- Parallelization
paral_kgb 1
npband 2
bandpp2 17
npkpt 2
npfft 1
#iomode 1
fftalg 401

# -- Convergence Parameters
nstep1 100
nstep 1
#nline2 10
#nnsclo2 5
ecut  8
# as this cutoff, test is not physical at all (filling of correlated orbitals are obviously wrong)

pawecutdg 20
tolvrs 1.0d-15
nband  34
occopt 3 tsmear 0.003675


##### PHYSICAL PARAMETERS
nsppol 2
nspden 2
natom 4 ntypat 2 typat 1 1 2 2
chkprim 0
#spinat 0 0 8  0 0  -7.99  0 0 0  0 0  0
spinat 0 0 0  0 0 0.0  0 0 0  0 0  0
znucl  28.0 8.0
rprim 0.0 1/2 1/2
      1/2 0.0 1/2
      1.0 1.0 0.0
xred 0 0 0
    0.0 0.0 0.5
    0.5 0.5 0.25
    0.5 0.5 0.75
acell   3*7.927

##### K-POINTS
kptrlatt 2 0 0 0 2 0 0 0 2
istwfk 1 1 1
chksymbreak 0

## == LDA+DMFT
usedmft1 0
usedmft 1
dmftbandi  9
dmftbandf 34
dmft_solv2 2
dmft_iter 2
dmft_nwli 20000
dmft_nwlo 32
dmftcheck 0
dmft_rslf 0
dmft_mxsf 0.3
# for historical reasons, do not use this elsewhere
dmft_occnd_imag2 0
dmft_wanorthnorm2 3

##### DFT+U
usepawu1    1   # DFT+U is not used.
dmatpuopt  1   # choose expression of the density matrix
lpawu   2 -1   # U on d-orbitals of Ni, no U on oxygen
upawu1  0.00  0.0   # values in Hartree
jpawu1  0.0000 0.0  # values in Hartree
upawu2  0.30  0.0   # values in Hartree
jpawu2  0.0000 0.0  # values in Hartree


#%%<BEGIN TEST_INFO>
#%% [setup]
#%% executable = abinit
#%% [files]
#%% psp_files = 28ni.paw, 8o.2.paw
#%% [paral_info]
#%% nprocs_to_test = 4
#%% max_nprocs = 4
#%% [NCPU_4]
#%% files_to_test = t99_MPI4.out, tolnlines=11, tolabs=1.4e+0, tolrel=9.0e-3, fld_options=-medium
#%% [extra_info]
#%% keywords = PAW, DMFT
#%% authors = B. Amadon
#%% description = 
#%%  NiO with 4 atoms in DMFT
#%%  low cutoff, low number of k-points
#%%  DMFT with hubbard I tested with self-consistency over density
#%%  Test of paral_kgb with DMFT
#%%<END TEST_INFO>
