Commit f16fc490 authored by Daniel Wortmann's avatar Daniel Wortmann

Merge branch 'relaxation' into develop

parents 458fdd5c 1a89bb26
......@@ -36,8 +36,8 @@ SUBROUTINE magMoms(dimension,input,atoms,noco,vTot,moments)
8000 FORMAT (/,/,10x,'spin density at the nucleus:',/,10x,'type',t25,&
'majority valence and input%total density',/)
'majority valence and total density',/)
8010 FORMAT (i13,2x,3e20.8,5x,2e20.8)
WRITE (6,FMT=8020)
# Welcome to FLEUR
This is the documentation of the [MaX release of FLEUR](
For older versions of FLEUR you find the
[documentation here](
* [Installation of FLEUR]( including some hints for configuration.
* [Running FLEUR]( describes the standard workflow to perform a FLEUR calculation.
* [Using the input-generator]( to generate the full input out of a simple file.
* [XML based IO]( documentation of the input of FLEUR, its features and hints how to use them.
* [The AiiDA interface to FLEUR]( can be used to generate, run and store complex workflows.
If you are a more expert user or developer, you might be interested in:
* The [Fleur gitlab repository.](
* [Information for developers]( with the doxygen documentation of the source.
* [The doxygen documentation of the source code](|) You will also find some hints for developing FLEUR there.
* [The coverage analysis]( of the source code showing which part of the code are covered by the standard tests.
* Discussion of reasons why v27 gives [differences]( to v26.
* A [Guide/Manual]( for developers of FLEUR.
Configuration and Installation of FLEUR
We are aware of the fact that installing FLEUR can be a tricky task on many machines. While we tried to make the process
as userfriendly as possible, there are still a couple of challenges you might encounter. Please check with your system administrator to
see if all requirements for using FLEUR can be fulfilled on your system. For help register at the [MailingList]( and post your questions there.
If you manage to compile on some system that can be of general interest, please consider to adjust the '' file in the docs (Or report to if you do not know how to do that).
* [QuickInstall](#quick-guide)
* [Requirements](#requirements)
* [The script & cmake](#configure)
* [How to adjust to your configuration](#how-to-adjust-the-configuration)
* [Running the automatic tests](#ci-tests)
#Quick guide
If you are extremely lucky (and/or your system is directly supported by us) installation can be very simple:
* run the configuration script `'PATH_TO_SOURCE_CODE/`. You can do that in any directory in which the 'build' directory should be created. The script accepts some useful arguments, you can run the script with ` -h` to get a list of supported arguments.
* The script creates the build directory and runs cmake. If all goes well (look at the output) you can then change to the build directory and run `cd build; make`
* If make does not report any error you are done!
Please be aware that there are different executables that could be be build:
* `inpgen`: The input generator used to construct the full input file for FLEUR
* `fleur`: A serial version (i.e. no MPI distributed memory parallelism, multithreading might still be used)
* `fleur_MPI`: A parallel version of FLEUR able to run on multiple nodes using MPI.
Usually only the serial or the MPI version will be build. You can run the MPI-version in serial while it is of course not possible to use the non-MPI version with MPI.
You might want to [run the automatic tests](#ci-tests).
There are a couple of external dependencies in the build process of FLEUR.
**Required are:**
* *cmake*: The build process uses cmake to configure FLEUR. You should have at least version 3.0. Some options might require newer versions. Cmake is available for free at [](
* *Compilers*: You will need a Fortran compiler and a corresponding C-compiler (i.e. the two have to be able to work together via the iso-c bindings of Fortran). Please check our [list of compilers](#compilers) to see if your compiler should work.
* *BLAS/LAPACK*: These standard linear algebra libraries are required. You should try your best not to use a reference implementation from [Netlib]( but look for an optimized version for your system. In general compiler and/or hardware vendors provide optimized libraries such as the MKL (Intel) or ESSL (IBM). If you do not have access to those, check [openBLAS](
* *libxml2*: this is a standard XML-library that is available on most systems. If it is missing on your computer you should really complain with your admin. *Please note that you might need a development package of this library as well.* To compile this library yourself, see [](
FLEUR can benefit significantly if the following further software components are available. Please be aware that some of these can be difficult to use for FLEUR and see the [Instructions for adjusting your configuration](#configure) for details on how to provide input into the build process to use these libraries.
* *MPI*: Probably most important is the possibility to compile a version of FLEUR running on multiple nodes using MPI. If you have a proper MPI installation on your system this should be straightforward to use.
* *HDF5*: FLEUR can use the HDF5 library for input/output. This is useful in two situations. On the one hand you might want to use HDF5 for reading/writing your charge density files to avoid having a machine-dependent format that can prevent portability. Also the HDF5 IO gives you some more features here. On the other hand you have to use parallel-HDF5 if you do IO of the eigenvectors in a MPI parallel calculation. This is needed if you can not store the data in memory or want to preprocess the eigenvectors. Please be aware that you need the Fortran-90 interface of the HDF5!
* *SCALAPACK/ELPA*: If you use MPI and want to solve a single eigenvalue problem with more than a single MPI-Task, you need a Library with a distributed memory eigensolver. Here you can use the SCALAPACK or [[|ELPA]] library. Please note that the ELPA library changed its API several times, hence you might see problems in compiling with it.
* *MAGMA*: FLEUR can also use the MAGMA library to run on GPUs. If you intend to use this feature, please get in contact with us.
You should also check the output of ` -h` for further dependencies and hints.
The `` script found in the main FLEUR source directory can (and should) be used to start the configuration of FLEUR.
It is called as
` [-l LABEL ] [-d] [CONFIG]`
The most used options are:
* -l LABEL specifies a label for the build. This is used to custimize the build-directory to build.LABEL and can be used
to facilitate different builds from the same source.
* -d specifies a debugging build.
* CONFIG is a string to choose one of the preconfigured configurations. It can be useful if you find one which matches your setup.
More options are available. Please check the output of ` -h`
The `` script performs the following steps:
1. It creates a subdirectory called 'build' or 'build.LABEL'. If this directory is already present, the old directory will be overwritten.
2. It copies the CONFIG dependent configuration into this directory (this is actually done in the script 'cmake/'). The special choice of "AUTO" for CONFIG will not provide any further configuration but relies completely on cmake. You can specify a config.cmake file in the working directory (from which you call to modify this AUTO mode.
3 Finally cmake is run in the build directory to determine your configuration.
If you specify -d as argument of, the string "debug" will be added to LABEL and a debugging version of FLEUR will be build, i.e. the corresponding compiler switches will be set.
#How to adjust the Configuration
While `cmake` and the `` script can determine the correct compilation switches automatically in some cases (mostly those known to us), in many other instances
fine-tuning is needed. In particular you might have to:
* provide hints on which compiler to use
* provide hints on how to use libraries.
## Setting of the compiler to use
By defining the environment variables FC and CC to point to the Fortran and C compiler you can make sure that cmake uses the correct compilers. E.g. you might want to say
`export FC=mpif90`.
Please be aware that the use of CONFIG specific settings might overwrite the environment variable.
###Adding flags for the compiler
This should be done using the `-flag` option to ``. So for example you might want to say ` -flag "-r8 -nowarn"`.
In general for a compiler [not known](#compilers) in cmake/compilerflags.cmake you need at least an option to specify the promotion of standard real variables to double precision (like the `-r8`). But additional switches can/should be used.
###Adding include directories
For libraries with a Fortran-90 interface, ELPA, HDF5, MAGMA, ... you probably will have to give an include path. This can
be achieved using the `-includedir` option. So you might want to say something like
` -includedir SOMEPATH`
###Adding linker flags
To add flags to the linker you can do
* add a directory in which the linker looks for libraries with `-libdir SOMEDIR`
* add the corresponding link option(s) with e.g. `-link "-lxml2;-llapack;-lblas"`. Please note that the specification is different from the compiler switches as different switches are separated by ';'.
### Further options:
There are more options you might find useful. Please
check ` -h` for a list.
FLEUR is known to work with the following compilers:
The Intel Fortran compilers (ifort) is able to compile FLEUR. Depending on the version you might experience the following problems:
1. Versions <13.0 will most probably not work correctly
2. Version 19.0 has issues with the debugging version of FLEUR.
GFortran is knwon to work with versions newer thant 6.3.
The PGI compilers also can compile FLEUR. Here you need ad least version 18.4 but might still run into some problems.
After the build was finished you might want to run the automatic test.
Just type `ctest` in the build directory for this purpose.
Please note:
* The tests run on the computer you just compiled on. Hence a cross-compiled executable will not run.
* You can use the environment variables `juDFT_MPI` to specify any additional command needed to start FLEUR_MPI. E.g. say `export juDFT_MPI="mpirun -n2 " `to run with
two MPI tasks.
* You can use the environment variable `juDFT` to give command line arguments to FLEUR. E.g. say `export juDFT='-mem'`.
* To run a specific test only (or a range of tests) use the `-I` option of ctest (check `ctest -h` for details)
* The tests are run in Testing/work. You can check this directory to see why a specific test fails.
This diff is collapsed.
FLEUR development team
FLEUR is mainly developed at the Forschungszentrum Jülich at the Institute of Advanced Simulation and the Peter Grünberg Institut.
Forschungszentrum Jülich GmbH
52428 Jülich
52425 Jülich
52428 Jülich
Eingetragen im Handelsregister des Amtsgerichts Düren Nr. HR B 3498
Umsatzsteuer-Id-Nr. gem. § 27 a Umsatzsteuergesetz: DE 122624631
Steuer-Nr.: 213/5700/0033
Prof. Dr.-Ing. Wolfgang Marquardt (Vorsitzender)
Karsten Beneke (Stellvertr. Vorsitzender)
Prof. Dr. Sebastian M. Schmidt
Prof. Dr. Harald Bolt
Vorsitzender des Aufsichtsrats:
Ministerialdirektor Dr. Karl Eugen Huthmacher
Verantwortlicher nach § 55, Abs. 2, Rundfunkstaatsvertrag:
Prof. Dr. Stefan Blügel
Forschungszentrum Jülich
Wilhelm-Johnen-Straße, 52428 Jülich
Telefon-Sammel-Nr. 02461 61-0
Inhalt der eigenen Seiten
Wir haben die Internet-Seiten sorgfältig zusammengestellt. Allerdings übernehmen wir keine Gewähr oder Haftung für die Aktualität, Vollständigkeit und Richtigkeit der angebotenen Informationen.
Links auf externe Web-Seiten
Die Internet-Seiten enthalten Links auf die Web-Seiten Dritter. Diese Links auf die Web-Seiten Dritter stellen keine Zustimmung zu deren Inhalt dar. Wir haben keinen Einfluss auf die aktuelle oder zukünftige Gestaltung dieser Seiten. Wir übernehmen daher keine Haftung für die Verfügbarkeit oder den Inhalt solcher Web-Seiten und keine Haftung für Schäden, die aus der Nutzung solcher Inhalte entstehen.
Bei jedem Zugriff eines Nutzers auf eine Seite aus dem Angebot der Forschungszentrum Jülich GmbH und bei jedem Abruf einer Datei werden Daten über diesen Vorgang in einer Protokolldatei gespeichert. Diese Daten sind nicht personenbezogen; wir können also nicht nachvollziehen, welcher Nutzer welche Daten abgerufen hat. Personenbezogene Nutzerprofile können daher nicht gebildet werden. Die gespeicherten Daten werden nur zu statistischen Zwecken ausgewertet. Eine Weitergabe an Dritte findet im Falle eines solchen Zugriffs nicht statt.
[Weitere Informationen zum Datenschutz](
Welcome to the developers documentation of FLEUR
These pages are complementing the <A HREF=""> User documentation </A> in which the actual use of FLEUR is documented.
Here we collect information useful for developers or advanced users that actually will modify the source code.
## GitLab
The development process is performed using gitlab. You can access the <A HREF=""> main gitlab page here.</A>
If you checkout the code please be aware that there are several branches. The release branch contains the code of the last release published on <A HREF=""> the FLEUR webpage</A>. You can *not* push to this branch directly.
You probably want to use the development branch to insert your changes. If your changes are large, it might be a good idea to create your own branch first.
Contributors guide
Everyone is very welcome to contribute to the enhancement of FLEUR.
Please use the [gitlab service] ( to obtain the
latest development version of FLEUR.
##Coding rules for FLEUR:
In no particular order we try to collect items to consider when writing code for FLEUR
- Instead of 'stop' use calls to judft_error, judft_warn, judft_end
- Do not read and write any files. Files are neither replacements for common-blocks nor a
storage for status variables.
Only exceptions:
+ you create nice IO subroutines in the subdirectory io
+ you write to the typical FLEUR output files
Useful info for developers
## Using fleur with the HDF5 library and debugging it with valgrind
HDF5 has to be built with the same compiler that is also used to compile fleur. If adapted the following commands can be used to compile a HDF5 library for fleur:
+ 'FC=/usr/local/intel/impi/ CC=/usr/local/intel/impi/ CXX=/usr/local/intel/impi/ ./configure --enable-fortran --enable-fortran2003 --enable-parallel --enable-using-memchecker --enable-clear-file-buffers'
+ 'make'
+ 'make install'
+ 'make check' (optional)
+ The paths have to be adjusted such that that compiler is used which is also used to compile fleur.
+ The parallel switch is not needed for every calculation: Only for parallel calculations in which HDF5 is also used for the eigenvector IO.
+ The last two command line switches in the configure command turn on initializations of irrelevant array parts in HDF5. If valgrind is not needed it is probably the better choice to leave them away. If left away valgrind will complain about missing initializations in the HDF5 library.
+ valgrind gives partially strange behavior if used together with the intel compiler. It would be better to use it together with gfortran.
+ At the moment HDF5 is needed in version 1.8.*. Usage of version 1.10.* yields some problems.
Furthermore to configure and start fleur with HDF5 the following has to be done:
+ In your .bashrc the HDF5 library has to be added to the LD_LIBRARY_PATH. This implies a line like 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/hdf5/current/hdf5/lib'
+ configure fleur with some line like 'CMAKE_Fortran_FLAGS="-I~/hdf5/current/hdf5/include" FLEUR_LIBRARIES="-L~/hdf5/current/hdf5/lib;-lhdf5_fortran;-lhdf5" ./fleur/ IFF'
Downloads of the FLEUR code
Within the [MaX project]( we created a series of FLEUR-releases which can be downloaded here:
* [FLEUR MaX Release 3 of Version 0.27]( Current as of 30/06/2018
* [FLEUR MaX Release 2.1 of Version 0.27]( Current as of 30/11/2017
* [FLEUR MaX Release 2 of Version 0.27]( Current as of 31/08/2017
* [FLEUR MaX Release 1.3 of Version 0.27]( Current as of 27/06/2017
* [FLEUR MaX Release 1.2 of Version 0.27]( Current as of 04/05/2017
* [FLEUR MaX Release 1.1 of Version 0.27]( Current as of 06/12/2016
* [FLEUR MaX Release 1 of Version 0.27]( Current as of 31/08/2016
Quantum Mobile -- A virtual machine with all MaX-codes and AiiDA installed can be found on [Github](
There is also a page with a few [[BinariesDownloads| precompiled binaries]].
After downloading the source we strongly recommend to have a look at the [[User-Documentation/Documentation]].
[+ Releases of older FLEUR versions: +]
(You have to [[Main.Registration|register]] first to obtain a userID for these Downloads)
[+ Here you can download the FLEUR code +]
* [[ | Version 0.22]] Current as of 26/10/2001
* [[ | Version 0.23]] Current as of 25/02/2005
* [[ | Version 0.24]] Current as of 14/02/2006 (Version used at NIC winterschool 2006)
* [[ | Version 0.25]] Current as of 05/07/2006
* [[ | Version 0.26]] Current as of 02/02/2017 ([[VesNotes | update]] v0.26e)
[+ Useful helpers +]
* [[ | Scripts archive]] Current as of Feb 15, 2005
->Please note that assembly of these script is a task i.tgz Version 0.25n progress.
->The contents of this archive are preliminary and may change with time.
->Currently, it contains: \
scripts [[Symmetry Of Bands | band3xmgr]] and [[User-Documentation.CalculatingTheBandStructure |]], program [[User-Documentation.SortingBandsInABandStructurePlot | sortbands.f.]]
* [[ | Archive]] Current as of Sep 16, 2009
-> containing an external program for the analysis of the SOC matrix elements when calculating [[User-Documentation.SsoHowto | spin-spirals + SOC]].
[+ Beta versions +]
* [[ | Version 0.25g]] Current as of 08/06/2009 \
(last [[Bug-fixes | bugfix]] from 24/02/2010)
* [[ | Version 0.26b]] Version as of 06/12/2011 \
(containing complete wannier-part, [[Bug-fixes | bugfixes]] and some new functionality)
* [[ | Version 0.26d]] Version as of 26/10/2012 \
(including spin-spirals & SOC, some new functionality for inpgen and [[Bug-fixes | bugfixes]])
* [[ | Wannier-version 0.25h]] Current as of 20/11/2009
* [[| Beta Version 0.27]] Current as of 19/09/2014 (includes new IO module with the option to keep more data in memory and first OpenMP parallel parts)
# Welcome to the FLEUR-project
This is the homepage of FLEUR, a feature-full, freely available FLAPW (full potential linearized augmented planewave) code, based on density-functional theory.
The FLAPW-Method (Full Potential Linearized Augmented Plane Wave Method) is an all-electron method which within density functional theory is universally applicable to all atoms of the periodic table and to systems with compact as well as open structures. It is widely considered to be the most precise electronic structure method in solid state physics.
FLEUR is one of the flagship codes of the MaX-Centre of Excellence. Within MaX we aim at creating a new FLEUR version fit for the challenges of high-throughput and exascale computing.
Please feel free to [download]( and [run our code](
Fleur is part of the [juDFT family]( of codes developed in Jülich.
This diff is collapsed.
#Support for FLEUR-users
We have established a mailing list for all users and developers of the FLEUR code. To subscribe to the list simply send a mail to <>.
\ No newline at end of file
#Differences between FLEUR v0.26 and v0.27
v0.27 is a major refactoring of FLEUR. Hence one can expect new errors, fixed bugs and in general slightly different results from this release. Here a list of factors that typically lead to changed results:
* When using inpgen new defaults have been set. This will usually result in more LOs and can change results.
* The behaviour of qpw_to_nmt is changed when using inp.xml. There is a new cutoff parameter for the l-expansion which is usually set to 0. This will change the core-tail correction and the generation of the starting charge density. Setting it to a large enough value (>=lmax) will switch back to the old behaviour.
* The previous precompiler option CPP_CORE is now standard. It can be switched in inp.xml.
* The precision of the eV-to-Hartree conversion factor increased. It was 27.2 in the old fleur version and now is 27.21138602. This factor is relevant for the generation of data files for DOS and bandstructure plots.
* The precision of the core solver has been increased. This will also have an influence on the starting density and the energy parameters.
\ No newline at end of file
This diff is collapsed.
site_name: FLEUR
repo_name: GIT
edit_url: edit/develop/docs/mkdocs/
- Welcome:
- Further support:
- User Guide:
- Overview:
- Installation:
- Running FLEUR:
- The input-generator:
- The FLEUR input file:
- The FLEUR-AiiDA interface:
- Developers Infomation:
- Fleur-GITLAB:
- The DOXYGEN documentation of the source code:
- The coverage analysis:
- Developers Guide/Manual:
- About/Impressum:
set(fleur_F77 ${fleur_F77}
set(fleur_F90 ${fleur_F90}
......@@ -16,7 +16,9 @@ force/force_a4_add.f90
! Copyright (c) 2019 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.
MODULE m_fix_by_gaussian
USE m_judft
SUBROUTINE fix_by_gaussian(shift,atoms,stars,mpi,sym,vacuum,sphhar,input,oned,cell,noco,den)
!The idea of this fix is to add an Gaussian to the INT which make the charge flat at the MT-boundary and to
!shift this Gaussian with the displacement.
USE m_qfix
USE m_spgrot
USE m_constants
USE m_types
REAL,INTENT(in) :: shift(:,:)
TYPE(t_mpi),INTENT(IN) :: mpi
TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_sym),INTENT(IN) :: sym
TYPE(t_vacuum),INTENT(IN) :: vacuum
TYPE(t_sphhar),INTENT(IN) :: sphhar
TYPE(t_input),INTENT(IN) :: input
TYPE(t_oneD),INTENT(IN) :: oneD
TYPE(t_cell),INTENT(IN) :: cell
TYPE(t_noco),INTENT(IN) :: noco
TYPE(t_stars),INTENT(IN) :: stars
TYPE(t_potden),INTENT(INOUT):: den
REAL :: slope1,slope2,dr,alpha
REAL :: sigma,a_fac,gauss,x,fix
INTEGER :: kr(3,sym%nop)
COMPLEX :: sf,phas(sym%nop)
INTEGER :: js,n,l,k,nat,j
DO js=1,input%jspins
DO n=1,atoms%ntype
DO l=0,0 !Currently only l=0
! alpha = LOG( den%mt(atoms%jri(n)-1,l,n,js) / den%mt(atoms%jri(n),l,n,js) )
! alpha = SQRT(alpha / ( atoms%rmt(n)*atoms%rmt(n)*( 1.0-EXP( -2.0*atoms%dx(n) ) ) ))
! A_fac= den%mt(atoms%jri(n),l,n,js)/gaussian_r(atoms%rmt(n),alpha)
PRINT *, a_fac, 1/alpha
DO k=2,stars%ng3
CALL spgrot(sym%nop,sym%symor,sym%mrot,sym%tau,sym%invtab,stars%kv3(:,k),kr,phas)
DO nat=SUM(atoms%neq(:n-1))+1,SUM(atoms%neq(:n))
DO j = 1,sym%nop
sf = sf + CMPLX(COS(x),SIN(x))*CONJG(phas(j))
sf = sf - CMPLX(COS(x),SIN(x))*CONJG(phas(j))
CALL qfix(mpi,stars,atoms,sym,vacuum,sphhar,input,cell,oneD,&
END SUBROUTINE fix_by_gaussian
FUNCTION gaussian_r(r,alpha)
REAL,INTENT(IN) :: r,alpha
real :: gaussian_r
END FUNCTION gaussian_r
FUNCTION gaussian_g(g,alpha)
USE m_constants
REAL,INTENT(IN) :: g,alpha
REAL :: gaussian_g
END FUNCTION gaussian_g
END MODULE m_fix_by_gaussian
This diff is collapsed.
! Copyright (c) 2019 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.
MODULE m_forcew
! ************************************************************
! Printing force components
! ************************************************************
SUBROUTINE force_w(mpi,input,atoms,sym,results,cell,oneD,vacuum)
USE m_types
USE m_xmlOutput
USE m_relaxation
TYPE(t_mpi),INTENT(IN) :: mpi
TYPE(t_results),INTENT(INOUT):: results
TYPE(t_oneD),INTENT(IN) :: oneD
TYPE(t_input),INTENT(IN) :: input
TYPE(t_sym),INTENT(IN) :: sym
TYPE(t_cell),INTENT(IN) :: cell
TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_vacuum),INTENT(IN) :: vacuum
! ..
! .. Local Scalars ..
REAL sum
INTEGER i,jsp,n,nat1,ierr
REAL eps_force
LOGICAL :: l_new,l_relax
! ..
! .. Local Arrays ..
REAL forcetot(3,atoms%ntype)
CHARACTER(LEN=20) :: attributes(7)
#ifdef CPP_MPI
include 'mpif.h'