Commit 51d41f4b authored by Gregor Michalicek's avatar Gregor Michalicek

Beautified explicit k point list in inp.xml

parent 31e2f064
...@@ -249,6 +249,7 @@ ...@@ -249,6 +249,7 @@
INTEGER :: nkpts INTEGER :: nkpts
INTEGER :: nkpt INTEGER :: nkpt
INTEGER :: nkptd INTEGER :: nkptd
REAL :: posScale
LOGICAL :: l_gamma LOGICAL :: l_gamma
INTEGER :: nmop(3) !<number of k-points in 3 directions INTEGER :: nmop(3) !<number of k-points in 3 directions
!(3,nkpts) k-vectors internal units !(3,nkpts) k-vectors internal units
......
...@@ -348,10 +348,11 @@ ...@@ -348,10 +348,11 @@
DEALLOCATE(kpts%weight) DEALLOCATE(kpts%weight)
END IF END IF
ALLOCATE(kpts%bk(3,kpts%nkpt),kpts%weight(kpts%nkpt)) ALLOCATE(kpts%bk(3,kpts%nkpt),kpts%weight(kpts%nkpt))
kpts%posScale = REAL(idiv)
DO j = 1, kpts%nkpt DO j = 1, kpts%nkpt
kpts%bk(1,j) = vkxyz(1,j) / real(idiv) kpts%bk(1,j) = vkxyz(1,j)
kpts%bk(2,j) = vkxyz(2,j) / real(idiv) kpts%bk(2,j) = vkxyz(2,j)
kpts%bk(3,j) = vkxyz(3,j) / real(idiv) kpts%bk(3,j) = vkxyz(3,j)
kpts%weight(j) = wghtkp(j) kpts%weight(j) = wghtkp(j)
END DO END DO
ELSE ELSE
......
...@@ -389,16 +389,10 @@ ...@@ -389,16 +389,10 @@
END IF END IF
kpts%nkpts = kpts%nkpt kpts%nkpts = kpts%nkpt
ALLOCATE(kpts%wtkpt(kpts%nkpt)) ALLOCATE(kpts%wtkpt(kpts%nkpt))
sumWeight = 0.0
WRITE(*,*) 'nkpt: ', kpts%nkpt
DO i = 1, kpts%nkpt
sumWeight = sumWeight + kpts%weight(i)
END DO
DO i = 1, kpts%nkpt DO i = 1, kpts%nkpt
kpts%weight(i) = kpts%weight(i) / sumWeight
kpts%wtkpt(i) = kpts%weight(i) kpts%wtkpt(i) = kpts%weight(i)
END DO END DO
kpts%nkptd = kpts%nkpt kpts%nkptd = kpts%nkpt
!set latnam to any !set latnam to any
...@@ -419,6 +413,18 @@ ...@@ -419,6 +413,18 @@
& atomTypeSpecies,speciesRepAtomType,& & atomTypeSpecies,speciesRepAtomType,&
& enpara%el0(:,:,1),enpara%ello0(:,:,1),enpara%evac0(:,1)) & enpara%el0(:,:,1),enpara%ello0(:,:,1),enpara%evac0(:,1))
IF(juDFT_was_argument("-explicit")) THEN
sumWeight = 0.0
WRITE(*,*) 'nkpt: ', kpts%nkpt
DO i = 1, kpts%nkpt
sumWeight = sumWeight + kpts%weight(i)
END DO
DO i = 1, kpts%nkpt
kpts%weight(i) = kpts%weight(i) / sumWeight
kpts%wtkpt(i) = kpts%weight(i)
END DO
END IF
kpts%nkpt = nkptOld kpts%nkpt = nkptOld
cell%latnam = latnamTemp cell%latnam = latnamTemp
END IF !xml output END IF !xml output
......
...@@ -218,10 +218,14 @@ SUBROUTINE w_inpXML(& ...@@ -218,10 +218,14 @@ SUBROUTINE w_inpXML(&
WRITE (5,200) input%zelec,TRIM(ADJUSTL(bzIntMode)),input%tkb WRITE (5,200) input%zelec,TRIM(ADJUSTL(bzIntMode)),input%tkb
IF(juDFT_was_argument("-explicit")) THEN IF(juDFT_was_argument("-explicit")) THEN
205 FORMAT(' <kPointList posScale="',f0.8,'" count="',i0,'">') sumWeight = 0.0
WRITE (5,205) 1.0, kpts%nkpt
DO i = 1, kpts%nkpt DO i = 1, kpts%nkpt
206 FORMAT(' <kPoint weight="',f0.15,'">',f0.15,' ',f0.15,' ',f0.15,'</kPoint>') sumWeight = sumWeight + kpts%weight(i)
END DO
205 FORMAT(' <kPointList posScale="',f0.8,'" weightScale="',f0.8,'" count="',i0,'">')
WRITE (5,205) kpts%posScale, sumWeight, kpts%nkpt
DO i = 1, kpts%nkpt
206 FORMAT(' <kPoint weight="',f12.6,'">',f12.6,' ',f12.6,' ',f12.6,'</kPoint>')
WRITE (5,206) kpts%weight(i), kpts%bk(1,i), kpts%bk(2,i), kpts%bk(3,i) WRITE (5,206) kpts%weight(i), kpts%bk(1,i), kpts%bk(2,i), kpts%bk(3,i)
END DO END DO
WRITE (5,'(a)')(' </kPointList>') WRITE (5,'(a)')(' </kPointList>')
......
...@@ -3,20 +3,20 @@ ...@@ -3,20 +3,20 @@
/* /*
* This method together with the variables defined in inputSchema.h * This method together with the variables defined in inputSchema.h
* writes out the file FleurInputFormat.xsd. * writes out the file FleurInputSchema.xsd.
* GM'16 * GM'16
*/ */
int dropInputSchema() int dropInputSchema()
{ {
char schemaString[FleurInputFormat_xsd_len + 1]; char schemaString[FleurInputSchema_xsd_len + 1];
int i = 0; int i = 0;
int errorCode = 0; int errorCode = 0;
FILE *file; FILE *file;
for (i = 0 ; i < FleurInputFormat_xsd_len ; ++i) for (i = 0 ; i < FleurInputSchema_xsd_len ; ++i)
{ {
schemaString[i] = FleurInputFormat_xsd[i]; schemaString[i] = FleurInputSchema_xsd[i];
} }
schemaString[FleurInputFormat_xsd_len] = '\0'; schemaString[FleurInputSchema_xsd_len] = '\0';
file = fopen("FleurInputSchema.xsd", "w"); file = fopen("FleurInputSchema.xsd", "w");
errorCode = fprintf(file,"%s", schemaString); errorCode = fprintf(file,"%s", schemaString);
fclose(file); fclose(file);
...@@ -31,7 +31,7 @@ int dropInputSchema() ...@@ -31,7 +31,7 @@ int dropInputSchema()
* You have to write it by hand. ;) * You have to write it by hand. ;)
* ...But if you prefer an automatic generation just follow this recipe: * ...But if you prefer an automatic generation just follow this recipe:
* *
* 1. Generate the file FleurInputFormat.xsd with the dropInputSchema * 1. Generate the file FleurInputSchema.xsd with the dropInputSchema
* method in this file. * method in this file.
* 2. Change the XML Schema file as desired. * 2. Change the XML Schema file as desired.
* 3. run: xxd -i FleurInputSchema.xsd inputSchema.h * 3. run: xxd -i FleurInputSchema.xsd inputSchema.h
......
This diff is collapsed.
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