Commit ad47a05c authored by Matthias Redies's avatar Matthias Redies

create a mpinp type

parent bed49a3e
......@@ -8,13 +8,14 @@ include("../cmake/Generate_Schema.cmake")
add_library(fleurinput STATIC
fleurinput_read_xml.f90 fleurinput_mpi_bc.f90
types_fleurinput_base.f90 types_input.f90 types_oneD.f90
types_coreSpecInput.f90 types_hybrid.f90 types_noco.f90
types_coreSpecInput.f90 types_hybrid.f90 types_noco.f90
types_vacuum.f90 types_banddos.f90 types_wannier.f90
types_cell.f90 types_kpts.f90 types_fleurinput.f90
types_sliceplot.f90 types_sym.f90 types_atoms.F90
types_econfig.F90 types_field.F90 types_xcpot.F90
types_enparaXML.f90 types_forcetheo_data.f90
types_xml.f90
types_sliceplot.f90 types_sym.f90 types_atoms.F90
types_econfig.F90 types_field.F90 types_xcpot.F90
types_enparaXML.f90 types_forcetheo_data.f90
types_mpinp.f90
types_xml.f90
calculator.f constants.f90 mpi_bc_tool.F90 ../io/xml/inputSchema.h ../io/xml/dropInputSchema.c ../io/xml/xmlInterfaceWrapper.c
)
#Set module directories
......
......@@ -34,8 +34,6 @@ MODULE m_types_hybrid
INTEGER, ALLOCATABLE :: nbands(:)
INTEGER, ALLOCATABLE :: nobd(:, :)
REAL, ALLOCATABLE :: div_vv(:, :, :)
real :: g_cutoff = 0.0
real :: linear_dep_tol = 0.0
CONTAINS
PROCEDURE :: read_xml => read_xml_hybrid
PROCEDURE :: mpi_bc => mpi_bc_hybrid
......@@ -102,14 +100,15 @@ CONTAINS
TYPE(t_xml), INTENT(in) :: xml
INTEGER::numberNodes, ntype, itype
CHARACTER(len=100)::xPathA
CHARACTER(len=100) :: xPathA
CHARACTER(len=4), allocatable :: xc_name
ntype = xml%GetNumberOfNodes('/fleurInput/atomGroups/atomGroup')
ALLOCATE (this%lcutm1(ntype), this%lcutwf(ntype), this%select1(4, ntype), source=0)
numberNodes = xml%GetNumberOfNodes('/fleurInput/calculationSetup/prodBasis')
IF (numberNodes == 1) THEN
!this%gcutm1=evaluateFirstOnly(xml%GetAttributeValue('/fleurInput/calculationSetup/prodBasis/@gcutm'))
!this%tolerance1=evaluateFirstOnly(xml%GetAttributeValue('/fleurInput/calculationSetup/prodBasis/@tolerance'))
! this%g_cutoff=evaluateFirstOnly(xml%GetAttributeValue('/fleurInput/calculationSetup/prodBasis/@gcutm'))
! this%linear_dep_tol=evaluateFirstOnly(xml%GetAttributeValue('/fleurInput/calculationSetup/prodBasis/@tolerance'))
this%ewaldlambda = evaluateFirstIntOnly(xml%GetAttributeValue('/fleurInput/calculationSetup/prodBasis/@ewaldlambda'))
this%lexp = evaluateFirstIntOnly(xml%GetAttributeValue('/fleurInput/calculationSetup/prodBasis/@lexp'))
this%bands1 = evaluateFirstIntOnly(xml%GetAttributeValue('/fleurInput/calculationSetup/prodBasis/@bands'))
......@@ -130,5 +129,12 @@ CONTAINS
this%lcutm1(iType) = -1
ENDIF
END DO
xc_name = trim(xml%GetAttributeValue('/fleurInput/xcFunctional/@name'))
if(trim(xc_name) == "pbe0") then
this%l_hybrid = .True.
else
this%l_hybrid = .False.
endif
END SUBROUTINE read_xml_hybrid
END MODULE m_types_hybrid
!--------------------------------------------------------------------------------
! 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_types_mpinp
USE m_judft
USE m_types_fleurinput_base
IMPLICIT NONE
PRIVATE
TYPE, EXTENDS(t_fleurinput_base):: t_mpinp
real :: g_cutoff = 0.0
real :: linear_dep_tol = 0.0
CONTAINS
PROCEDURE :: read_xml => read_xml_mpinp
PROCEDURE :: mpi_bc => mpi_bc_mpinp
END TYPE t_mpinp
PUBLIC t_mpinp
CONTAINS
SUBROUTINE mpi_bc_mpinp(this, mpi_comm, irank)
USE m_mpi_bc_tool
CLASS(t_mpinp), INTENT(INOUT)::this
INTEGER, INTENT(IN):: mpi_comm
INTEGER, INTENT(IN), OPTIONAL::irank
INTEGER ::rank
IF (PRESENT(irank)) THEN
rank = irank
ELSE
rank = 0
END IF
CALL mpi_bc(this%g_cutoff,rank,mpi_comm)
CALL mpi_bc(this%linear_dep_tol,rank,mpi_comm)
END SUBROUTINE mpi_bc_mpinp
SUBROUTINE read_xml_mpinp(this, xml)
USE m_types_xml
CLASS(t_mpinp), INTENT(INout):: this
TYPE(t_xml), INTENT(in) :: xml
INTEGER::numberNodes, ntype, itype
CHARACTER(len=100) :: xPathA
CHARACTER(len=4), allocatable :: xc_name
ntype = xml%GetNumberOfNodes('/fleurInput/atomGroups/atomGroup')
numberNodes = xml%GetNumberOfNodes('/fleurInput/calculationSetup/prodBasis')
IF (numberNodes == 1) THEN
this%g_cutoff=evaluateFirstOnly(xml%GetAttributeValue('/fleurInput/calculationSetup/prodBasis/@gcutm'))
this%linear_dep_tol=evaluateFirstOnly(xml%GetAttributeValue('/fleurInput/calculationSetup/prodBasis/@tolerance'))
ENDIF
END SUBROUTINE read_xml_mpinp
END MODULE m_types_mpinp
......@@ -40,6 +40,7 @@ PROGRAM inpgen
USE m_types_stars
use m_read_old_inp
use m_fleurinput_read_xml
USE m_types_mpinp
IMPLICIT NONE
......@@ -54,6 +55,7 @@ PROGRAM inpgen
TYPE(t_noco) :: noco
TYPE(t_vacuum) :: vacuum
TYPE(t_banddos) :: banddos
TYPE(t_mpinp) :: mpinp
TYPE(t_hybrid) :: hybrid
TYPE(t_xcpot_inbuild_nf)::xcpot
TYPE(t_enpara) :: enpara
......@@ -121,7 +123,7 @@ PROGRAM inpgen
!Set all defaults that have not been specified before or can not be specified in inpgen
CALL make_defaults(atoms,sym,cell,vacuum,input,stars,&
xcpot,noco,hybrid)
xcpot,noco,mpinp,hybrid)
ENDIF
!
! k-points can also be modified here
......@@ -136,7 +138,7 @@ PROGRAM inpgen
!CALL dump_FleurInputSchema()
CALL w_inpxml(&
atoms,vacuum,input,stars,sliceplot,forcetheo,banddos,&
cell,sym,xcpot,noco,oneD,hybrid,kpts,enpara,&
cell,sym,xcpot,noco,oneD,mpinp,hybrid,kpts,enpara,&
l_explicit,l_include,"inp.xml")
if (.not.l_include(1)) CALL sym%print_XML(99,"sym.xml")
ENDIF
......
......@@ -15,7 +15,7 @@ MODULE m_make_defaults
CONTAINS
SUBROUTINE make_defaults(atoms, sym, cell, vacuum, input, stars, &
xcpot, noco, hybrid)
xcpot, noco, mpinp, hybrid)
USE m_types_atoms
USE m_types_cell
USE m_types_sym
......@@ -24,6 +24,7 @@ CONTAINS
USE m_types_input
USE m_types_stars
USE m_types_noco
USE m_types_mpinp
USE m_types_hybrid
USE m_juDFT
......@@ -36,6 +37,7 @@ CONTAINS
TYPE(t_stars), INTENT(INOUT) ::stars
TYPE(t_xcpot_inbuild_nf), INTENT(INOUT) ::xcpot
TYPE(t_noco), INTENT(INOUT) ::noco
TYPE(t_mpinp), INTENT(INOUT) ::mpinp
TYPE(t_hybrid), INTENT(INOUT)::hybrid
integer :: n
......@@ -135,7 +137,7 @@ CONTAINS
hybrid%select1(2, :) = 0
hybrid%select1(3, :) = 4
hybrid%select1(4, :) = 2
hybrid%g_cutoff = round_to_deci(input%rkmax - 0.5, 1)
hybrid%linear_dep_tol = 1e-4
mpinp%g_cutoff = round_to_deci(input%rkmax - 0.5, 1)
mpinp%linear_dep_tol = 1e-4
END SUBROUTINE make_defaults
END MODULE m_make_defaults
......@@ -18,7 +18,7 @@ MODULE m_winpXML
CONTAINS
SUBROUTINE w_inpXML( &
atoms, vacuum, input, stars, sliceplot, forcetheo, banddos, &
cell, sym, xcpot, noco, oneD, hybrid, kpts, enpara, &
cell, sym, xcpot, noco, oneD, mpinp, hybrid, kpts, enpara, &
l_explicitIn, l_includeIn, filename)
use m_types_input
......@@ -28,6 +28,7 @@ CONTAINS
use m_types_vacuum
use m_types_kpts
use m_types_oneD
use m_types_mpinp
use m_types_hybrid
use m_types_cell
use m_types_banddos
......@@ -53,6 +54,8 @@ CONTAINS
TYPE(t_vacuum), INTENT(IN) :: vacuum
TYPE(t_kpts), INTENT(IN) :: kpts
TYPE(t_oneD), INTENT(IN) :: oneD
TYPE(t_mpinp), INTENT(IN) :: mpinp
TYPE(t_hybrid), INTENT(IN) :: hybrid
TYPE(t_cell), INTENT(IN) :: cell
TYPE(t_banddos), INTENT(IN) :: banddos
......@@ -175,7 +178,7 @@ CONTAINS
IF (l_explicit .OR. hybrid%l_hybrid) THEN
155 FORMAT(' <prodBasis gcutm="', f0.8, '" tolerance="', f0.8, '" ewaldlambda="', i0, '" lexp="', i0, '" bands="', i0, '"/>')
WRITE (fileNum, 155) hybrid%g_cutoff, hybrid%linear_dep_tol, hybrid%ewaldlambda, hybrid%lexp, hybrid%bands1
WRITE (fileNum, 155) mpinp%g_cutoff, mpinp%linear_dep_tol, hybrid%ewaldlambda, hybrid%lexp, hybrid%bands1
END IF
IF (l_nocoOpt .OR. l_explicit) THEN
......
......@@ -98,6 +98,7 @@ CONTAINS
TYPE(t_enpara) :: enpara
TYPE(t_results) :: results
TYPE(t_kpts) :: kpts
TYPE(t_mpinp) :: mpinp
TYPE(t_hybrid) :: hybrid
TYPE(t_mpbasis) :: mpbasis
TYPE(t_oneD) :: oneD
......@@ -131,7 +132,7 @@ CONTAINS
CALL timestart("Initialization")
CALL fleur_init(mpi,input,field,atoms,sphhar,cell,stars,sym,noco,vacuum,forcetheo,sliceplot,&
banddos,enpara,xcpot,results,kpts,hybrid,oneD,coreSpecInput,hub1,wann)
banddos,enpara,xcpot,results,kpts,mpinp,hybrid,oneD,coreSpecInput,hub1,wann)
CALL timestop("Initialization")
IF ( ( input%preconditioning_param /= 0 ) .AND. oneD%odi%d1 ) THEN
......
......@@ -8,11 +8,12 @@ MODULE m_fleur_init
CONTAINS
SUBROUTINE fleur_init(mpi,&
input,field,atoms,sphhar,cell,stars,sym,noco,vacuum,forcetheo,&
sliceplot,banddos,enpara,xcpot,results,kpts,hybrid,&
sliceplot,banddos,enpara,xcpot,results,kpts,mpinp,hybrid,&
oneD,coreSpecInput,hub1,wann)
USE m_types
USE m_fleurinput_read_xml
USE m_fleurinput_mpi_bc
USE m_types_mpinp
USE m_judft
USE m_juDFT_init
USE m_init_wannier_defaults
......@@ -71,6 +72,7 @@ CONTAINS
CLASS(t_xcpot),ALLOCATABLE,INTENT(OUT):: xcpot
TYPE(t_results) ,INTENT(OUT):: results
TYPE(t_kpts) ,INTENT(OUT):: kpts
TYPE(t_mpinp) ,INTENT(OUT):: mpinp
TYPE(t_hybrid) ,INTENT(OUT):: hybrid
TYPE(t_oneD) ,INTENT(OUT):: oneD
TYPE(t_coreSpecInput),INTENT(OUT) :: coreSpecInput
......@@ -162,7 +164,7 @@ CONTAINS
IF (mpi%irank.EQ.0) THEN
CALL w_inpXML(&
atoms,vacuum,input,stars,sliceplot,forcetheo,banddos,&
cell,sym,xcpot,noco,oneD,hybrid,kpts,enpara,&
cell,sym,xcpot,noco,oneD,mpinp,hybrid,kpts,enpara,&
.TRUE.,[.TRUE.,.TRUE.,.TRUE.,.TRUE.])
END IF
!
......
......@@ -27,6 +27,7 @@ MODULE m_types
USE m_types_force
USE m_types_forcetheo
USE m_types_hybrid
USE m_types_mpinp
USE m_types_mpbasis
USE m_types_greensf
USE m_types_greensfCoeffs
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment