Commit d0325b36 authored by Gregor Michalicek's avatar Gregor Michalicek

Introduction of labels to each atom position

parent aa3cea83
......@@ -250,6 +250,8 @@
REAL,ALLOCATABLE::pos(:,:)
!pos of atom (relat)(3,nat)
REAL,ALLOCATABLE::taual(:,:)
!labels
CHARACTER(LEN=20), ALLOCATABLE :: label(:)
!lda_u information(ntype)
CHARACTER(len=20), ALLOCATABLE :: speciesName(:)
TYPE(t_utype),ALLOCATABLE::lda_u(:)
......
......@@ -50,6 +50,7 @@ PROGRAM inpgen
CHARACTER(len=7) :: symfn
CHARACTER(len=4) :: dispfn
CHARACTER(LEN=8) :: tempNumberString
CHARACTER(len=20), ALLOCATABLE :: atomLabel(:)
TYPE(t_input) :: input
TYPE(t_atoms) :: atoms
......@@ -77,6 +78,8 @@ PROGRAM inpgen
ALLOCATE ( mmrot(3,3,nop48), ttr(3,nop48) )
ALLOCATE ( atompos(3,natmax),atomid(natmax) )
ALLOCATE (atomLabel(natmax))
atomLabel = ''
! OPEN (5,file='inp2',form='formatted',status='old')
OPEN (6,file='out',form='formatted',status='unknown')
......@@ -90,7 +93,7 @@ PROGRAM inpgen
& nline,xl_buffer,buffer,&
& title,input%film,cal_symm,checkinp,sym%symor,&
& cartesian,oldfleur,a1,a2,a3,vacuum%dvac,aa,scale,i_c,&
& factor,natin,atomid,atompos,ngen,mmrot,ttr,&
& factor,natin,atomid,atompos,ngen,mmrot,ttr,atomLabel,&
& l_hyb,noco%l_soc,noco%l_ss,noco%theta,noco%phi,noco%qss,inistop)!keep
! CLOSE (5)
......@@ -147,7 +150,8 @@ PROGRAM inpgen
ENDIF
DEALLOCATE ( mmrot, ttr, atompos )
ALLOCATE ( atoms%taual(3,atoms%nat),idlist(atoms%ntype) )
ALLOCATE ( atoms%taual(3,atoms%nat),idlist(atoms%ntype) )
ALLOCATE (atoms%label(atoms%nat))
WRITE (6,*)
WRITE (6,'(a6,i3,a6,i3)') 'atoms%ntype=',atoms%ntype,' atoms%nat= ',atoms%nat
na = 0
......@@ -158,13 +162,15 @@ PROGRAM inpgen
WRITE (6,'(3f10.6,10x,i7)')&
& atoms%pos(:,natmap(na+j)),natmap(na+j)
atoms%taual(:,na+j) = atoms%pos(:,natmap(na+j)) ! reorder coordinates
idlist(i) = atomid(natmap(na+j)) ! and atomic id's
idlist(i) = atomid(natmap(na+j)) ! and atomic id's
atoms%label(na+j) = atomLabel(natmap(na+j)) ! and labels
ENDDO
na = na + atoms%neq(i)
ENDDO
DO i=1,atoms%nat
atoms%pos(:,i) = matmul( cell%amat , atoms%taual(:,i) )
ENDDO
DEALLOCATE(atomLabel)
!
! --> write a file 'sym.out' with accepted symmetry operations
......
......@@ -11,6 +11,7 @@
< title,film,cal_symm,checkinp,symor,
< cartesian,oldfleur,a1,a2,a3,dvac,aa,scale,i_c,
< factor,natin,atomid,atompos,ngen,mmrot,ttr,
< atomLabel,
< l_hyb,l_soc,l_ss,theta,phi,qss,inistop)
use m_calculator
......@@ -39,6 +40,7 @@
REAL, INTENT (OUT) :: ttr(3,nop48)
CHARACTER(len=80), INTENT (OUT) :: title
CHARACTER(len=7), INTENT (IN) :: symfn
CHARACTER(LEN=20), INTENT (OUT) :: atomLabel(natmax)
!===> data
REAL, PARAMETER :: eps=1.e-7
......@@ -268,6 +270,11 @@
atompos(1,n)=evaluatefirst(buffer)
atompos(2,n)=evaluatefirst(buffer)
atompos(3,n)=evaluatefirst(buffer)
IF(TRIM(ADJUSTL(buffer)).NE.'') THEN
atomLabel(n) = TRIM(ADJUSTL(buffer))
ELSE
WRITE(atomLabel(n),'(i0)') n
END IF
ENDDO
CALL read_record(infh,xl_buffer,bfh,nline,nbuffer,buffer,ios)
......
......@@ -218,6 +218,7 @@ SUBROUTINE r_inpXML(&
ALLOCATE(atoms%relax(3,atoms%ntype))
ALLOCATE(atoms%neq(atoms%ntype))
ALLOCATE(atoms%taual(3,atoms%nat))
ALLOCATE(atoms%label(atoms%nat))
ALLOCATE(atoms%pos(3,atoms%nat))
ALLOCATE(atoms%rmt(atoms%ntype))
ALLOCATE(atoms%numStatesProvided(atoms%ntype))
......@@ -1590,6 +1591,11 @@ SUBROUTINE r_inpXML(&
DO i = 1, numberNodes
na = na + 1
WRITE(xPathB,*) TRIM(ADJUSTL(xPathA)),'/relPos[',i,']'
IF(xmlGetNumberOfNodes(TRIM(ADJUSTL(xPathB))//'/@label').NE.0) THEN
atoms%label(na) = xmlGetAttributeValue(TRIM(ADJUSTL(xPathB))//'/@label')
ELSE
WRITE(atoms%label(na),'(i0)') na
END IF
valueString = xmlGetAttributeValue(TRIM(ADJUSTL(xPathB)))
atoms%taual(1,na) = evaluatefirst(valueString)
atoms%taual(2,na) = evaluatefirst(valueString)
......@@ -1615,6 +1621,11 @@ SUBROUTINE r_inpXML(&
DO i = 1, numberNodes
na = na + 1
WRITE(xPathB,*) TRIM(ADJUSTL(xPathA)),'/filmPos[',i,']'
IF(xmlGetNumberOfNodes(TRIM(ADJUSTL(xPathB))//'/@label').NE.0) THEN
atoms%label(na) = xmlGetAttributeValue(TRIM(ADJUSTL(xPathB))//'/@label')
ELSE
WRITE(atoms%label(na),'(i0)') na
END IF
valueString = xmlGetAttributeValue(TRIM(ADJUSTL(xPathB)))
atoms%taual(1,na) = evaluatefirst(valueString)
atoms%taual(2,na) = evaluatefirst(valueString)
......
......@@ -570,7 +570,7 @@ SUBROUTINE w_inpXML(&
STOP '1D position output not implemented!'
ELSE IF (input%film) THEN
! <filmPos> x/myConstant y/myConstant 1/myConstant</filmPos>
340 FORMAT(' <filmPos>',a,' ',a,' ',a,'</filmPos>')
340 FORMAT(' <filmPos label="',a20,'">',a,' ',a,' ',a,'</filmPos>')
posString(:) = ''
DO i = 1, 2
IF((scpos(i).NE.1.0).AND.(tempTaual(i,na).NE.0.0)) THEN
......@@ -580,10 +580,11 @@ SUBROUTINE w_inpXML(&
END IF
END DO
WRITE(posString(3),'(f0.10)') tempTaual(3,na)
WRITE (fileNum,340) TRIM(ADJUSTL(posString(1))),TRIM(ADJUSTL(posString(2))),TRIM(ADJUSTL(posString(3)))
WRITE (fileNum,340) TRIM(ADJUSTL(atoms%label(na))), &
TRIM(ADJUSTL(posString(1))),TRIM(ADJUSTL(posString(2))),TRIM(ADJUSTL(posString(3)))
ELSE
! <relPos> x/myConstant y/myConstant z/myConstant</relPos>
350 FORMAT(' <relPos>',a,' ',a,' ',a,'</relPos>')
350 FORMAT(' <relPos label="',a20,'">',a,' ',a,' ',a,'</relPos>')
posString(:) = ''
DO i = 1, 3
IF((scpos(i).NE.1.0).AND.(tempTaual(i,na).NE.0.0)) THEN
......@@ -592,7 +593,8 @@ SUBROUTINE w_inpXML(&
WRITE(posString(i),'(f0.10)') tempTaual(i,na)
END IF
END DO
WRITE (fileNum,350) TRIM(ADJUSTL(posString(1))),TRIM(ADJUSTL(posString(2))),TRIM(ADJUSTL(posString(3)))
WRITE (fileNum,350) TRIM(ADJUSTL(atoms%label(na))), &
TRIM(ADJUSTL(posString(1))),TRIM(ADJUSTL(posString(2))),TRIM(ADJUSTL(posString(3)))
END IF
END DO
! <force calculate="F" relaxX="T" relaxY="T" relaxZ="T"/>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -352,10 +352,13 @@
WRITE(*,*) ''
ALLOCATE(noel(atoms%ntype),atomTypeSpecies(atoms%ntype),speciesRepAtomType(atoms%ntype))
ALLOCATE(xmlElectronStates(29,atoms%ntype),xmlPrintCoreStates(29,atoms%ntype))
ALLOCATE(xmlCoreOccs(1,1,1))
ALLOCATE(xmlCoreOccs(1,1,1),atoms%label(atoms%nat))
filename = 'inpConverted.xml'
xmlElectronStates = noState_const
xmlPrintCoreStates = .FALSE.
DO i = 1, atoms%nat
WRITE(atoms%label(i),'(i0)'), i
END DO
DO i = 1, atoms%ntype
noel(i) = namat_const(atoms%nz(i))
atomTypeSpecies(i) = i
......@@ -381,7 +384,7 @@
xmlElectronStates,xmlPrintCoreStates,xmlCoreOccs,&
atomTypeSpecies,speciesRepAtomType,.FALSE.,filename,&
.TRUE.,numSpecies,enpara)
DEALLOCATE(atoms%speciesName)
DEALLOCATE(atoms%speciesName, atoms%label)
DEALLOCATE(noel,atomTypeSpecies,speciesRepAtomType)
DEALLOCATE(xmlElectronStates,xmlPrintCoreStates,xmlCoreOccs)
CALL juDFT_end("Fleur inp to XML input conversion completed.")
......
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