Commit c2775cea authored by Gregor Michalicek's avatar Gregor Michalicek

Initial commit for writing input data into out.xml

Note that there are still some known issues:

1. Possibly incorrect data for energy parameters, LOs
2. Incomplete data: electron configuration, comment
3. Not neccessarily explicit data: Bravais matrix
parent a799828d
......@@ -59,7 +59,7 @@
CHARACTER(len=3) :: latnamTemp
INTEGER nu,iofile
INTEGER iggachk
INTEGER n ,iostat, errorStatus
INTEGER n ,iostat, errorStatus, numSpecies
REAL scale,scpos ,zc
REAL ello0(atoms%nlod,atoms%ntype),evac0(2)
......@@ -416,13 +416,13 @@
IF(errorStatus.NE.0) THEN
STOP 'Error: Cannot print out FleurInputSchema.xsd'
END IF
numSpecies = atoms%nat
CALL w_inpXML(&
& atoms,obsolete,vacuum,input,stars,sliceplot,banddos,&
& cell,sym,xcpot,noco,jij,oneD,hybrid,kpts,div,l_gamma,&
& noel,namex,relcor,a1,a2,a3,scale,dtild,name,&
& xmlElectronStates,xmlPrintCoreStates,xmlCoreOccs,&
& atomTypeSpecies,speciesRepAtomType,&
& atomTypeSpecies,speciesRepAtomType,.FALSE.,numSpecies,&
& enpara%el0(:,:,1),enpara%ello0(:,:,1),enpara%evac0(:,1))
IF(juDFT_was_argument("-explicit")) THEN
......
......@@ -3,7 +3,9 @@ MODULE m_rinpXML
CONTAINS
SUBROUTINE r_inpXML(&
& atoms,obsolete,vacuum,input,stars,sliceplot,banddos,dimension,&
& cell,sym,xcpot,noco,jij,oneD,hybrid,kpts,enpara,sphhar,l_opti)
& cell,sym,xcpot,noco,jij,oneD,hybrid,kpts,enpara,sphhar,l_opti,&
& noel,namex,relcor,a1,a2,a3,scale,dtild,xmlElectronStates,&
& xmlPrintCoreStates,xmlCoreOccs,atomTypeSpecies,speciesRepAtomType)
USE iso_c_binding
USE m_juDFT
......@@ -63,7 +65,17 @@ SUBROUTINE r_inpXML(&
TYPE(t_dimension),INTENT(OUT) :: dimension
TYPE(t_enpara) ,INTENT(OUT) :: enpara
TYPE(t_sphhar) ,INTENT(OUT) :: sphhar
LOGICAL, INTENT(OUT) :: l_opti
LOGICAL, INTENT(OUT) :: l_opti
INTEGER, ALLOCATABLE, INTENT(INOUT) :: xmlElectronStates(:,:)
INTEGER, ALLOCATABLE, INTENT(INOUT) :: atomTypeSpecies(:)
INTEGER, ALLOCATABLE, INTENT(INOUT) :: speciesRepAtomType(:)
REAL, ALLOCATABLE, INTENT(INOUT) :: xmlCoreOccs(:,:,:)
LOGICAL, ALLOCATABLE, INTENT(INOUT) :: xmlPrintCoreStates(:,:)
CHARACTER(len=3), ALLOCATABLE, INTENT(INOUT) :: noel(:)
CHARACTER(len=4), INTENT(OUT) :: namex
CHARACTER(len=12), INTENT(OUT) :: relcor
REAL, INTENT(OUT) :: a1(3),a2(3),a3(3)
REAL, INTENT(OUT) :: scale, dtild
CHARACTER(len=8) :: name(10)
......@@ -76,7 +88,7 @@ SUBROUTINE r_inpXML(&
!-odim
! ..
! .. Local Variables
REAL ::dtild ,scpos ,zc
REAL :: scpos ,zc
INTEGER ::nw
INTEGER ieq,i,k,na,n,ii
REAL s3,ah,a,hs2,rest
......@@ -122,11 +134,11 @@ SUBROUTINE r_inpXML(&
INTEGER :: speciesEParams(0:3)
INTEGER :: mrotTemp(3,3,48)
REAL :: tauTemp(3,48)
REAL :: a1(3),a2(3),a3(3), bk(3)
REAL :: bk(3)
LOGICAL :: flipSpin, l_eV, invSym, l_qfix, relaxX, relaxY, relaxZ, l_gga, l_kpts
LOGICAL :: l_vca, coreConfigPresent, l_enpara
REAL :: magMom, radius, logIncrement, qsc(3), latticeScale, dr
REAL :: aTemp, scale, zp, rmtmax, sumWeight, ldau_u, ldau_j, tempReal
REAL :: aTemp, zp, rmtmax, sumWeight, ldau_u, ldau_j, tempReal
REAL :: weightScale
LOGICAL :: l_amf
REAL, PARAMETER :: boltzmannConst = 3.1668114e-6 ! value is given in Hartree/Kelvin
......@@ -138,8 +150,6 @@ SUBROUTINE r_inpXML(&
CHARACTER(LEN=255) :: valueString, lString, nString, token
CHARACTER(LEN=255) :: xPathA, xPathB, xPathC, xPathD, xPathE
CHARACTER(LEN=11) :: latticeType
CHARACTER(len=4) :: namex
CHARACTER(len=12) :: relcor
INTEGER, ALLOCATABLE :: lNumbers(:), nNumbers(:), speciesLLO(:)
INTEGER, ALLOCATABLE :: loOrderList(:)
......@@ -149,9 +159,6 @@ SUBROUTINE r_inpXML(&
INTEGER, ALLOCATABLE :: lmx1(:), nq1(:), nlhtp1(:)
INTEGER, ALLOCATABLE :: speciesLOEDeriv(:)
REAL, ALLOCATABLE :: speciesLOeParams(:), speciesLLOReal(:)
REAL, ALLOCATABLE :: xmlCoreOccs(:,:,:)
LOGICAL, ALLOCATABLE :: xmlCoreStates(:,:)
LOGICAL, ALLOCATABLE :: xmlPrintCoreStates(:,:)
EXTERNAL prp_xcfft_box
......@@ -251,9 +258,25 @@ SUBROUTINE r_inpXML(&
ALLOCATE(noco%soc_opt(atoms%ntype+2),noco%l_relax(atoms%ntype),noco%b_con(2,atoms%ntype))
ALLOCATE(noco%alph(atoms%ntype),noco%beta(atoms%ntype))
ALLOCATE (Jij%alph1(atoms%ntype),Jij%l_magn(atoms%ntype),Jij%M(atoms%ntype) )
ALLOCATE (Jij%magtype(atoms%ntype),Jij%nmagtype(atoms%ntype) )
ALLOCATE (Jij%alph1(atoms%ntype),Jij%l_magn(atoms%ntype),Jij%M(atoms%ntype))
ALLOCATE (Jij%magtype(atoms%ntype),Jij%nmagtype(atoms%ntype))
DEALLOCATE(atomTypeSpecies,speciesRepAtomType)
ALLOCATE(atomTypeSpecies(atoms%ntype))
ALLOCATE(speciesRepAtomType(numSpecies))
atomTypeSpecies = -1
speciesRepAtomType = -1
DEALLOCATE(xmlElectronStates,xmlPrintCoreStates,xmlCoreOccs)
ALLOCATE(xmlElectronStates(29,atoms%ntype))
ALLOCATE(xmlPrintCoreStates(29,atoms%ntype))
ALLOCATE(xmlCoreOccs(2,29,atoms%ntype))
xmlElectronStates = noState_const
xmlPrintCoreStates = .FALSE.
xmlCoreOccs = 0.0
WRITE(*,*) 'Note: core states output (from input) into out.xml file has to be implemented!'
! Read in constants
xPathA = '/fleurInput/constants/constant'
......@@ -1237,6 +1260,8 @@ SUBROUTINE r_inpXML(&
atoms%lda_u(iType)%u = ldau_u
atoms%lda_u(iType)%j = ldau_j
atoms%lda_u(iType)%l_amf = l_amf
atomTypeSpecies(iType) = iSpecies
IF(speciesRepAtomType(iSpecies).EQ.-1) speciesRepAtomType(iSpecies) = iType
END IF
END DO
......@@ -1908,6 +1933,9 @@ SUBROUTINE r_inpXML(&
ALLOCATE(atoms%volmts(atoms%ntype))
ALLOCATE(atoms%vr0(atoms%ntype)) ! This should actually not be in the atoms type!
atoms%vr0(:) = 0.0
na = 0
DEALLOCATE(noel)
ALLOCATE(noel(atoms%ntypd))
DO iType = 1, atoms%ntype
l_vca = .FALSE.
INQUIRE (file="vca.in", exist=l_vca)
......@@ -1944,6 +1972,8 @@ SUBROUTINE r_inpXML(&
atoms%volmts(iType) = (fpi_const/3.0)*atoms%rmt(iType)**3
cell%volint = cell%volint - atoms%volmts(iType)*atoms%neq(iType)
noel(iType) = namat_const(atoms%nz(iType))
END DO
! Read in enpara file iff available
......
This diff is collapsed.
......@@ -20,9 +20,16 @@ MODULE m_xmlOutput
PUBLIC startXMLOutput, endXMLOutput, writeXMLElementPoly, writeXMLElement
PUBLIC openXMLElementPoly, openXMLElementNoAttributes, openXMLElement, closeXMLElement
PUBLIC getXMLOutputUnitNumber
CONTAINS
FUNCTION getXMLOutputUnitNumber()
IMPLICIT NONE
INTEGER getXMLOutputUnitNumber
getXMLOutputUnitNumber = xmlOutputUnit
END FUNCTION getXMLOutputUnitNumber
SUBROUTINE startXMLOutput()
IMPLICIT NONE
maxNumElements = 10
......
......@@ -19,6 +19,7 @@
USE m_ylm
USE m_InitParallelProcesses
USE m_xmlOutput
USE m_winpXML
#ifdef CPP_MPI
USE m_mpi_bc_all, ONLY : mpi_bc_all
#endif
......@@ -48,9 +49,20 @@
LOGICAL, INTENT(OUT):: l_opti
INTEGER, ALLOCATABLE :: xmlElectronStates(:,:)
INTEGER, ALLOCATABLE :: atomTypeSpecies(:)
INTEGER, ALLOCATABLE :: speciesRepAtomType(:)
REAL, ALLOCATABLE :: xmlCoreOccs(:,:,:)
LOGICAL, ALLOCATABLE :: xmlPrintCoreStates(:,:)
CHARACTER(len=3), ALLOCATABLE :: noel(:)
! .. Local Scalars ..
INTEGER :: i,n,l,m1,m2,isym,iisym
INTEGER :: i,n,l,m1,m2,isym,iisym,numSpecies
COMPLEX :: cdum
CHARACTER(len=4) :: namex
CHARACTER(len=12) :: relcor
CHARACTER(len=8) :: comment(10)
REAL :: a1(3),a2(3),a3(3)
REAL :: scale, dtild
#ifdef CPP_MPI
INCLUDE 'mpif.h'
INTEGER ierr(3)
......@@ -90,15 +102,36 @@
END IF
IF (input%l_inpXML) THEN
IF (mpi%irank.EQ.0) THEN
ALLOCATE(noel(1),atomTypeSpecies(1),speciesRepAtomType(1))
ALLOCATE(xmlElectronStates(1,1),xmlPrintCoreStates(1,1))
ALLOCATE(xmlCoreOccs(1,1,1))
namex = ' '
relcor = ' '
comment = ' '
a1 = 0.0
a2 = 0.0
a3 = 0.0
scale = 1.0
CALL r_inpXML(&
atoms,obsolete,vacuum,input,stars,sliceplot,banddos,dimension,&
cell,sym,xcpot,noco,Jij,oneD,hybrid,kpts,enpara,sphhar,l_opti)
cell,sym,xcpot,noco,Jij,oneD,hybrid,kpts,enpara,sphhar,l_opti,&
noel,namex,relcor,a1,a2,a3,scale,dtild,xmlElectronStates,&
xmlPrintCoreStates,xmlCoreOccs,atomTypeSpecies,speciesRepAtomType)
ALLOCATE (results%force(3,atoms%ntype,dimension%jspd))
ALLOCATE (results%force_old(3,atoms%ntype))
results%force(:,:,:) = 0.0
WRITE(*,*) 'TODO: Distribute parameters and arrays to other parallel processes!'
numSpecies = SIZE(speciesRepAtomType)
CALL w_inpXML(&
& atoms,obsolete,vacuum,input,stars,sliceplot,banddos,&
& cell,sym,xcpot,noco,jij,oneD,hybrid,kpts,(/1,1,1/),kpts%l_gamma,&
& noel,namex,relcor,a1,a2,a3,scale,dtild,comment,&!comment is 'name'. Still has to be read in!
& xmlElectronStates,xmlPrintCoreStates,xmlCoreOccs,&
& atomTypeSpecies,speciesRepAtomType,.TRUE.,numSpecies,&
& enpara%el0(:,:,1),enpara%ello0(:,:,1),enpara%evac0(:,1))
DEALLOCATE(noel,atomTypeSpecies,speciesRepAtomType)
DEALLOCATE(xmlElectronStates,xmlPrintCoreStates,xmlCoreOccs)
END IF
#ifdef CPP_MPI
......
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