Commit c74e6d87 authored by Daniel Wortmann's avatar Daniel Wortmann

Merge branch 'develop' into release

parents af9fa5b2 8429d14c
init/compileinfo.h
*~
#*
build
*.o
*.mod
*.x
*.swp
cmake_minimum_required(VERSION 2.8)
project(FLEUR LANGUAGES NONE)
include("cmake/Architectures.txt")
include("cmake/ReportConfig.txt")
#Here the targets and the files are defined
include("cmake/Files_and_Targets.txt")
#install(TARGETS fleur inpgen DESTINATION bin)
install(PROGRAMS ${CMAKE_BINARY_DIR}/fleur
CONFIGURATIONS Debug
DESTINATION bin
RENAME fleur_dbg)
The MIT License (MIT)
Copyright (c) 2016 Peter Grünberg Institut, Forschungszentrum Jülich, Germany
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute,
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
Currently, there are no releases or stable commits. Please checkout the development branch by running:
Welcome to the source code of FLEUR
Outline:
1. Short Overview of the code
2. Installation
----------------------------------------------
1. Overview of the code
----------------------------------------------
The source of FLEUR is organized in several
subdirectories. Some of them collect code
specific for particular features, others code
relevant for crutial steps in the code or simply
code that is usually executed together.
Here a short description of the directories:
main: contains the main-program and several core subroutines
init: stuff for the initialization (called from fleur_init in main)
vgen: potential generation (called from vgen in main)
eigen: setup of the eigenproblem
diagonalization: various methods to diagonalize the Hamiltonian
cdn: general code for the generation of charge
cdn_mt: charge generation in MT-spheres
force: code related to the evaluation of forces
mix: charge/potential mixing routines
ldau: routines needed in case of LDA+U calculations
inpgen: code for the input generator (seperate executable inpgen)
fermi: determination of the fermi-level
eigen_secvar: second variational solution of the Hamiltonian
eigen_soc: Spin-orbit related code
core: Core states
dos: Code for Density of states, bandstructures
orbdep: Code for quantities depending on orbitals
optional: code that is used in special cases like inital charge generation
wannier: wannier related code
xc-pot: various exchange-correlation potential routines
mpi: code for parallel execution
io: subroutines doing IO
juDFT: timing, error handling, etc
math: code providing math functionality
include: c-type include files
global: code used everywhere (here you find types.F90 with the data-types)
cmake: definitions used by cmake (see Installation)
If you modify FLEUR please do so in the develop branch by running
git checkout -t origin/develop
after cloning the git repository.
----------------------------------------------
2. Installation
----------------------------------------------
For the compilation of FLEUR you will need:
- Fortran compiler (should support Fortran2008)
- Compatible C compiler for the XML-IO
- cmake for controlling the make-process
- Libraries:
* LAPACK/BLAS
* MPI for parallelization
* SCALAPACK or ELPA or ELEMENTAL if you want to use parallel diagonalization
(without you can only exploit k-point parallelism)
* HDF5 for parallel IO (if you have lots of memory, you might not need to do IO :-)
You should probably create a directory structure like this:
somewhere/src -this is where the source code lives, i.e. the location of this README
somewhere/build -here you can build the code
change to the build directory and type:
cmake ../src
make
This might generate the FLEUR executables. It most probable will only work on systems we know as
only for those there will be specific configurations in the cmake directory.
If you get errors, you have to configure your build system yourself.
There are two options to do that.
- Either set the environment variable FC to either ifort,pgfortran or gfortran.
Then the configuration in the cmake directory will be used from cmake.[ifort|gfortran|pgfortran].config will be used that can again work for your system or can be adjusted.
- Or you run cmake with the option -DFleur_custom_toolchain and you adjust cmake.config to your needs.
You might find inspiration in the cmake.???.config files provided for several systems.
If your build environment is recognized correctly you can obtain the following executables:
inpgen - the input generator of FLEUR
fleur - general version of FLEUR
fleur_INVS - version of FLEUR suitable for systems with inversion symmetry leading to real matrices
fleur_SOC - version of FLEUR with spin-orbit coupling
All codes might also have a _MPI attached to indicate parallel versions.
\ No newline at end of file
List of BUGS/ things not tested or implemented:
-omp bug in vmtxc oder xcall
-Wannier part
-Hybrid functionals
-one-dimensional code
set(fleur_F77 ${fleur_F77}
cdn/diflgr.f
cdn/od_chirot.f
cdn/rcerf.f
cdn/rot_den_mat.f
)
set(fleur_F90 ${fleur_F90}
cdn/cdnovlp.F90
cdn/cdntot.f90
cdn/cdnval.F90
cdn/eparas.f90
cdn/int_21.f90
cdn/int_21lo.f90
cdn/m_perp.f90
cdn/n_mat.f90
cdn/od_abvac.f90
cdn/prp_qfft_map.f90
cdn/pwden.F90
cdn/pwint.f90
cdn/pwint_sl.f90
cdn/q_int_sl.F90
cdn/q_mt_sl.f90
cdn/qal_21.f90
cdn/qpw_to_nmt.f90
cdn/slab_dim.f90
cdn/slabgeom.f90
cdn/vacden.F90
)
This diff is collapsed.
MODULE m_cdntot
! ********************************************************
! calculate the total charge density in the interstial.,
! vacuum, and mt regions c.l.fu
! ********************************************************
CONTAINS
SUBROUTINE cdntot(&
& stars,atoms,sym,&
& vacuum,input,cell,oneD,&
& qpw,rho,rht,l_printData,&
& qtot,qistot)
USE m_intgr, ONLY : intgr3
USE m_constants
USE m_qsf
USE m_pwint
USE m_types
USE m_juDFT
USE m_xmlOutput
IMPLICIT NONE
! ..
! .. Scalar Arguments ..
TYPE(t_stars),INTENT(IN) :: stars
TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_sym),INTENT(IN) :: sym
TYPE(t_vacuum),INTENT(IN):: vacuum
TYPE(t_input),INTENT(IN) :: input
TYPE(t_oneD),INTENT(IN) :: oneD
TYPE(t_cell),INTENT(IN) :: cell
LOGICAL,INTENT(IN) :: l_printData
REAL, INTENT (OUT):: qtot,qistot
! ..
! .. Array Arguments ..
COMPLEX, INTENT (IN) :: qpw(stars%n3d,input%jspins)
REAL, INTENT (IN) :: rho(:,0:,:,:) !(atoms%jmtd,0:sphhar%nlhd,atoms%ntypd,input%jspins)
REAL, INTENT (IN) :: rht(vacuum%nmzd,2,input%jspins)
!-odim
!+odim
! ..
! .. Local Scalars ..
! COMPLEX x
COMPLEX x(stars%ng3)
REAL q,qis,w,mtCharge
INTEGER i,ivac,j,jspin,n,nz
! ..
! .. Local Arrays ..
REAL qmt(atoms%ntypd),qvac(2),q2(vacuum%nmz),rht1(vacuum%nmzd,2,input%jspins)
INTEGER, ALLOCATABLE :: lengths(:,:)
CHARACTER(LEN=20) :: attributes(6), names(6)
! ..
! .. Intrinsic Functions ..
INTRINSIC real
! ..
!
IF (input%film) THEN
ALLOCATE(lengths(4+vacuum%nvac,2))
ELSE
ALLOCATE(lengths(4,2))
END IF
CALL timestart("cdntot")
qtot = 0.e0
qistot = 0.e0
DO jspin = 1,input%jspins
q = 0.e0
! -----mt charge
CALL timestart("MT")
DO 10 n = 1,atoms%ntype
CALL intgr3(rho(:,0,n,jspin),atoms%rmsh(:,n),atoms%dx(n),atoms%jri(n),w)
qmt(n) = w*sfp_const
q = q + atoms%neq(n)*qmt(n)
10 CONTINUE
CALL timestop("MT")
! -----vacuum region
IF (input%film) THEN
DO 20 ivac = 1,vacuum%nvac
DO nz = 1,vacuum%nmz
IF (oneD%odi%d1) THEN
rht1(nz,ivac,jspin) = (cell%z1+(nz-1)*vacuum%delz)*&
& rht(nz,ivac,jspin)
ELSE
rht1(nz,ivac,jspin) = rht(nz,ivac,jspin)
END IF
END DO
CALL qsf(vacuum%delz,rht1(1,ivac,jspin),q2,vacuum%nmz,0)
qvac(ivac) = q2(1)*cell%area
IF (.NOT.oneD%odi%d1) THEN
q = q + qvac(ivac)*2./real(vacuum%nvac)
ELSE
q = q + cell%area*q2(1)
END IF
20 CONTINUE
END IF
! -----is region
qis = 0.
! DO 30 j = 1,nq3
! CALL pwint(
! > k1d,k2d,k3d,n3d,ntypd,natd,nop,invtab,odi,
! > ntype,neq,volmts,taual,z1,vol,volint,
! > symor,tau,mrot,rmt,sk3,bmat,ig2,ig,
! > kv3(1,j),
! < x)
! qis = qis + qpw(j,jspin)*x*nstr(j)
! 30 CONTINUE
CALL pwint_all(&
& stars,atoms,sym,oneD,&
& cell,&
& x)
DO j = 1,stars%ng3
qis = qis + qpw(j,jspin)*x(j)*stars%nstr(j)
ENDDO
qistot = qistot + qis
q = q + qis
WRITE (6,FMT=8000) jspin,q,qis, (qmt(n),n=1,atoms%ntype)
IF (input%film) WRITE (6,FMT=8010) (i,qvac(i),i=1,vacuum%nvac)
WRITE (16,FMT=8000) jspin,q,qis, (qmt(n),n=1,atoms%ntype)
IF (input%film) WRITE (16,FMT=8010) (i,qvac(i),i=1,vacuum%nvac)
mtCharge = SUM(qmt(1:atoms%ntype) * atoms%neq(1:atoms%ntype))
names(1) = 'spin' ; WRITE(attributes(1),'(i0)') jspin ; lengths(1,1)=4 ; lengths(1,2)=1
names(2) = 'total' ; WRITE(attributes(2),'(f14.7)') q ; lengths(2,1)=5 ; lengths(2,2)=14
names(3) = 'interstitial' ; WRITE(attributes(3),'(f14.7)') qis ; lengths(3,1)=12 ; lengths(3,2)=14
names(4) = 'mtSpheres' ; WRITE(attributes(4),'(f14.7)') mtCharge ; lengths(4,1)=9 ; lengths(4,2)=14
IF(l_printData) THEN
IF(input%film) THEN
DO i = 1, vacuum%nvac
WRITE(names(4+i),'(a6,i0)') 'vacuum', i
WRITE(attributes(4+i),'(f14.7)') qvac(i)
lengths(4+i,1)=7
lengths(4+i,2)=14
END DO
CALL writeXMLElementFormPoly('spinDependentCharge',names(1:4+vacuum%nvac),&
attributes(1:4+vacuum%nvac),lengths)
ELSE
CALL writeXMLElementFormPoly('spinDependentCharge',names(1:4),attributes(1:4),lengths)
END IF
END IF
qtot = qtot + q
END DO ! loop over spins
DEALLOCATE (lengths)
WRITE (6,FMT=8020) qtot
WRITE (16,FMT=8020) qtot
IF(l_printData) THEN
CALL writeXMLElementFormPoly('totalCharge',(/'value'/),(/qtot/),reshape((/5,20/),(/1,2/)))
END IF
8000 FORMAT (/,10x,'total charge for spin',i3,'=',f12.6,/,10x,&
& 'interst. charge = ',f12.6,/,&
& (10x,'mt charge= ',4f12.6,/))
8010 FORMAT (10x,'vacuum ',i2,' charge= ',f12.6)
8020 FORMAT (/,10x,'total charge =',f12.6)
CALL timestop("cdntot")
END SUBROUTINE cdntot
END MODULE m_cdntot
This diff is collapsed.
MODULE m_diflgr
CONTAINS
REAL FUNCTION diflgr(x,f)
c **********************************************************
c differentiate the function f,
c given at the points x0,x1,x2,
c at the point x1 by lagrange interpolation
c e.wimmer
c ***********************************************************
C .. Array Arguments ..
IMPLICIT NONE
REAL f(0:2),x(0:2)
C ..
diflgr = (x(1)-x(2))*f(0)/ ((x(0)-x(1))* (x(0)-x(2))) +
+ (2.0e0*x(1)-x(2)-x(0))*f(1)/ ((x(1)-x(0))* (x(1)-x(2))) +
+ (x(1)-x(0))*f(2)/ ((x(2)-x(0))* (x(2)-x(1)))
c print *,'x=',x
c print *,'f=',f
c print *,'diflgr=',diflgr
RETURN
END FUNCTION
END
!--------------------------------------------------------------------------------
! 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.
!--------------------------------------------------------------------------------
MODULE m_eparas
!***********************************************************************
! Calculates qlo, enerlo and sqlo, which are needed to determine the
! new energy parameters.
! Philipp Kurz 99/04
!***********************************************************************
! also the 'normal' energy parameters are now included...
!
! if (l_mcd) then mcd contains mcd spectrum: first index = polarization
! second = core level ; third = band index gb.2001
! corrected to work also for multiple LO's of same l at the same atom
! gb.2005
!*************** ABBREVIATIONS *****************************************
! qlo : charge density of one local orbital at the current k-point
! sqlo : qlo integrated over the Brillouin zone
! enerlo : qlo*energy integrated over the Brillouin zone
!***********************************************************************
!
CONTAINS