## Libxc test fails and GGAs differ

# Summary

Compiled Fleur locally with libxc. Tested bcc iron with inbuilt PBE and libxc PBE. Inbuilt converges to a magnetic moment (grep mm) of 2.22903, while libxc converges to 3.19598. In the release it was 2.22903 and 2.22778, which agrees a lot better.

Additionally, the Fe_bct_LibXC test fails. But that one seems broken anyways, since it tests for quantities at it=20 while only 4 are set in the inp.xml.

## Input and output file:

## Compute environment

Lenovo laptop with gfortran and gcc compilers. Libxc configured via -libxc TRUE

## This is BUG because:

Basically the same output should happen for both cases.

## The problem only occurs if:

Libxc PBE is used.

## Console output and other logs

```
Welcome to FLEUR (www.flapw.de)
Development Version (based on MaX4.0)
I/O warning : failed to load external entity "relax.xml"
========== k-point set info ==========
Selected k-point list: default
k-point list type: mesh
14 x 14 x 14
Number of k points: 100
--------------------------------------------------------
Number of OMP-threads: 4
--------------------------------------------------------
Iteration: 1 Distance: 12.704005205923478
Iteration: 2 Distance: 12.056919753478228
Iteration: 3 Distance: 10.679534232183169
Iteration: 4 Distance: 4.9730100203784113
Iteration: 5 Distance: 0.64362688586273642
Iteration: 6 Distance: 0.54980119520530735
Iteration: 7 Distance: 8.8803293669267008E-002
Iteration: 8 Distance: 0.13059197168443132
Iteration: 9 Distance: 0.14970405242904142
Iteration: 10 Distance: 5.9528058726395459E-002
Iteration: 11 Distance: 7.0123595764510827E-002
Iteration: 12 Distance: 1.9704764577440588E-002
Iteration: 13 Distance: 3.1446806032679703E-003
Iteration: 14 Distance: 2.5094318748316018E-004
Iteration: 15 Distance: 8.9095067040579918E-004
Iteration: 16 Distance: 4.7400104360158739E-005
Iteration: 17 Distance: 1.0765050565432638E-004
Iteration: 18 Distance: 3.1058666533154713E-006
*****************************************
Run finished successfully
Stop message:
all done
*****************************************
Rank:0 used 0.314 0.023 GB/ 386652 kB
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 812 100 76 100 736 436 4229 --:--:-- --:--:-- --:--:-- 4666
Note: The following floating-point exceptions are signalling: IEEE_DENORMAL
STOP OK
```

vs.

```
Welcome to FLEUR (www.flapw.de)
Development Version (based on MaX4.0)
I/O warning : failed to load external entity "relax.xml"
func_ids 130 101 130 101
The functional 'Perdew, Burke & Ernzerhof' is an exchange functional, it belongs to the 'GGA' family and is defined in the reference(s):
[1] J. P. Perdew, K. Burke, and M. Ernzerhof, Phys. Rev. Lett. 77, 3865 (1996)
[2] J. P. Perdew, K. Burke, and M. Ernzerhof, Phys. Rev. Lett. 78, 1396 (1997)
The functional 'Perdew, Burke & Ernzerhof' is a correlation functional, it belongs to the 'GGA' family and is defined in the reference(s):
[1] J. P. Perdew, K. Burke, and M. Ernzerhof, Phys. Rev. Lett. 77, 3865 (1996)
[2] J. P. Perdew, K. Burke, and M. Ernzerhof, Phys. Rev. Lett. 78, 1396 (1997)
Using same functional for VXC and EXC
========== k-point set info ==========
Selected k-point list: default
k-point list type: mesh
14 x 14 x 14
Number of k points: 100
--------------------------------------------------------
Number of OMP-threads: 4
--------------------------------------------------------
Iteration: 1 Distance: 38.543588748262557
Iteration: 2 Distance: 37.653856669914063
Iteration: 3 Distance: 25.394477599769090
Iteration: 4 Distance: 14.301717219957951
Iteration: 5 Distance: 6.2811319034652042
Iteration: 6 Distance: 4.6971652980274321
Iteration: 7 Distance: 0.54763298670113214
Iteration: 8 Distance: 0.30360727839803758
Iteration: 9 Distance: 9.8499470516907675E-002
Iteration: 10 Distance: 6.8795210512301572E-002
Iteration: 11 Distance: 1.8329920616406235E-002
Iteration: 12 Distance: 2.6960129043923681E-003
Iteration: 13 Distance: 5.5848843316962504E-003
Iteration: 14 Distance: 2.2919481566930513E-004
Iteration: 15 Distance: 2.1918147406961019E-004
Iteration: 16 Distance: 1.3776546134297077E-005
Iteration: 17 Distance: 1.1650989735465065E-005
Iteration: 18 Distance: 1.6849682655515024E-006
*****************************************
Run finished successfully
Stop message:
all done
*****************************************
Rank:0 used 0.314 0.024 GB/ 386800 kB
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 812 100 76 100 736 710 6878 --:--:-- --:--:-- --:--:-- 7588
Note: The following floating-point exceptions are signalling: IEEE_DENORMAL
STOP OK
```

## Ideas for fixes

The problem exists for all GGA functionals it seems (quickly checked with pw91).

@wortmann This is not correlated with your introduction of cutoffs to libxc. I already checked that.

Initially the gmaxxc was 0 for libxc as it was not copied over to the xcpot of the libxc type; this I already fixed.

Also there are differences between the functional determined in both cases (first call in atom2). This difference existed already in the release version and seems to be unconnected. @redies also says that this is expected near the core, where all our calculations are numerically nontrivial. I still attach a picture for comparison [note, that the two spin channels are identical; picture generated for the starting density].