Commit 451d717c authored by ua741532's avatar ua741532

Merge branch 'develop' of ifflinux.iff.kfa-juelich.de:fleur into develop

parents 5908df78 28d607fd
...@@ -3,8 +3,8 @@ try_compile(FLEUR_USE_ELPA ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/t ...@@ -3,8 +3,8 @@ try_compile(FLEUR_USE_ELPA ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/t
LINK_LIBRARIES ${FLEUR_LIBRARIES}) LINK_LIBRARIES ${FLEUR_LIBRARIES})
if (NOT FLEUR_USE_ELPA) if (NOT FLEUR_USE_ELPA)
set(STORE_FLAGS "${CMAKE_Fortran_FLAGS}")
if (DEFINED ENV{ELPA_MODULES}) if (DEFINED ENV{ELPA_MODULES})
set(STORE_FLAGS ${CMAKE_Fortran_FLAGS})
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -I$ENV{ELPA_MODULES}") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -I$ENV{ELPA_MODULES}")
endif() endif()
if (DEFINED ENV{ELPA_LIB}) if (DEFINED ENV{ELPA_LIB})
...@@ -15,7 +15,7 @@ LINK_LIBRARIES ${TEST_LIBRARIES}) ...@@ -15,7 +15,7 @@ LINK_LIBRARIES ${TEST_LIBRARIES})
if (FLEUR_USE_ELPA) if (FLEUR_USE_ELPA)
set(FLEUR_LIBRARIES "${TEST_LIBRARIES}") set(FLEUR_LIBRARIES "${TEST_LIBRARIES}")
else() else()
set(CMAKE_Fortran_FLAGS ${STORE_FLAGS}) set(CMAKE_Fortran_FLAGS "${STORE_FLAGS}")
endif() endif()
endif() endif()
......
...@@ -47,6 +47,9 @@ CONTAINS ...@@ -47,6 +47,9 @@ CONTAINS
USE m_icorrkeys USE m_icorrkeys
USE m_eig66_io, ONLY : open_eig, write_eig, close_eig,read_eig USE m_eig66_io, ONLY : open_eig, write_eig, close_eig,read_eig
USE m_xmlOutput USE m_xmlOutput
#ifdef CPP_MPI
USE m_mpi_bc_pot
#endif
IMPLICIT NONE IMPLICIT NONE
TYPE(t_results),INTENT(INOUT):: results TYPE(t_results),INTENT(INOUT):: results
...@@ -238,8 +241,16 @@ CONTAINS ...@@ -238,8 +241,16 @@ CONTAINS
& 'Info: and stored in "vxc", the values obtained from the',& & 'Info: and stored in "vxc", the values obtained from the',&
& 'Info: original implementation are saved to "vxc.old".' & 'Info: original implementation are saved to "vxc.old".'
ENDIF ENDIF
CALL readPotential(stars,vacuum,atoms,sphhar,input,sym,POT_ARCHIVE_TYPE_TOT_const,&
iter,vr,vpw,vz,vzxy) IF (mpi%irank.EQ.0) THEN
CALL readPotential(stars,vacuum,atoms,sphhar,input,sym,POT_ARCHIVE_TYPE_TOT_const,&
iter,vr,vpw,vz,vzxy)
END IF
#ifdef CPP_MPI
CALL mpi_bc_pot(mpi,stars,sphhar,atoms,input,vacuum,&
iter,vr,vpw,vz,vzxy)
#endif
999 CONTINUE 999 CONTINUE
IF (mpi%irank.EQ.0) CALL openXMLElementFormPoly('iteration',(/'numberForCurrentRun','overallNumber '/),(/it,iter/),& IF (mpi%irank.EQ.0) CALL openXMLElementFormPoly('iteration',(/'numberForCurrentRun','overallNumber '/),(/it,iter/),&
RESHAPE((/19,13,5,5/),(/2,2/))) RESHAPE((/19,13,5,5/),(/2,2/)))
...@@ -663,8 +674,15 @@ ENDIF ...@@ -663,8 +674,15 @@ ENDIF
ENDDO ENDDO
CLOSE (16) CLOSE (16)
gwc=2 gwc=2
CALL readPotential(stars,vacuum,atoms,sphhar,input,sym,POT_ARCHIVE_TYPE_COUL_const,&
iter,vr,vpw,vz,vzxy) IF (mpi%irank.EQ.0) THEN
CALL readPotential(stars,vacuum,atoms,sphhar,input,sym,POT_ARCHIVE_TYPE_COUL_const,&
iter,vr,vpw,vz,vzxy)
END IF
#ifdef CPP_MPI
CALL mpi_bc_pot(mpi,stars,sphhar,atoms,input,vacuum,&
iter,vr,vpw,vz,vzxy)
#endif
GOTO 999 GOTO 999
ELSE IF ( input%gw.EQ.2.AND.(gwc==2) ) THEN ELSE IF ( input%gw.EQ.2.AND.(gwc==2) ) THEN
CLOSE (12) CLOSE (12)
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
USE m_dwigner USE m_dwigner
USE m_strgn USE m_strgn
USE m_stepf USE m_stepf
USE m_cdn_io
USE m_mapatom USE m_mapatom
USE m_writegw USE m_writegw
USE m_convn USE m_convn
...@@ -136,6 +137,10 @@ ...@@ -136,6 +137,10 @@
CALL od_mapatom(oneD,atoms,sym,cell) CALL od_mapatom(oneD,atoms,sym,cell)
END IF END IF
! Store structure data
CALL storeStructureIfNew(input, atoms, cell, vacuum, oneD, sym)
!+odim !+odim
IF (input%film.OR.(sym%namgrp.NE.'any ')) THEN IF (input%film.OR.(sym%namgrp.NE.'any ')) THEN
CALL strgn1(stars,sym,atoms, vacuum,sphhar, input,cell,xcpot) CALL strgn1(stars,sym,atoms, vacuum,sphhar, input,cell,xcpot)
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
! !
ifftd = 27*stars%mx1*stars%mx2*stars%mx3 ifftd = 27*stars%mx1*stars%mx2*stars%mx3
CALL readStepfunction(stars,l_error) CALL readStepfunction(stars, atoms, cell, vacuum, l_error)
IF(.NOT.l_error) THEN IF(.NOT.l_error) THEN
RETURN RETURN
END IF END IF
......
...@@ -162,9 +162,9 @@ PROGRAM inpgen ...@@ -162,9 +162,9 @@ PROGRAM inpgen
nops = sym%nop nops = sym%nop
symfn = 'sym.out' symfn = 'sym.out'
IF (.not.input%film) sym%nop2=sym%nop IF (.not.input%film) sym%nop2=sym%nop
CALL rw_symfile(& IF ((juDFT_was_argument("-old")).OR.(.NOT.juDFT_was_argument("-explicit"))) THEN
& 'W',symfh,symfn,nops,cell%bmat,& CALL rw_symfile('W',symfh,symfn,nops,cell%bmat,sym%mrot,sym%tau,sym%nop,sym%nop2,sym%symor)
& sym%mrot,sym%tau,sym%nop,sym%nop2,sym%symor) END IF
ALLOCATE (atomTypeSpecies(atoms%ntype)) ALLOCATE (atomTypeSpecies(atoms%ntype))
ALLOCATE (speciesRepAtomType(atoms%nat)) ALLOCATE (speciesRepAtomType(atoms%nat))
......
...@@ -94,6 +94,10 @@ ...@@ -94,6 +94,10 @@
cr = gamma cr = gamma
ENDIF ENDIF
scale(1) = a
scale(2) = b
scale(3) = c
latsys = ADJUSTL(latsys) latsys = ADJUSTL(latsys)
!===> 1: cubic-P (cP) sc !===> 1: cubic-P (cP) sc
...@@ -103,9 +107,10 @@ ...@@ -103,9 +107,10 @@
noangles=.true. noangles=.true.
i_c = 1 i_c = 1
a1 = lmat(:,1,i_c) a1 = lmat(:,1,i_c) * scale(:)
a2 = lmat(:,2,i_c) a2 = lmat(:,2,i_c) * scale(:)
a3 = lmat(:,3,i_c) a3 = lmat(:,3,i_c) * scale(:)
scale = 1.0
IF ( a.NE.b .OR. a.NE.c ) err = 11 IF ( a.NE.b .OR. a.NE.c ) err = 11
IF ( ar.NE.br .OR. ar.NE.cr .OR. ar.NE.(pi_const/2.0) ) err = 12 IF ( ar.NE.br .OR. ar.NE.cr .OR. ar.NE.(pi_const/2.0) ) err = 12
...@@ -117,9 +122,10 @@ ...@@ -117,9 +122,10 @@
noangles=.true. noangles=.true.
i_c = 2 i_c = 2
a1 = lmat(:,1,i_c) a1 = lmat(:,1,i_c) * scale(:)
a2 = lmat(:,2,i_c) a2 = lmat(:,2,i_c) * scale(:)
a3 = lmat(:,3,i_c) a3 = lmat(:,3,i_c) * scale(:)
scale = 1.0
IF ( a.NE.b .OR. a.NE.c ) err = 21 IF ( a.NE.b .OR. a.NE.c ) err = 21
...@@ -130,9 +136,10 @@ ...@@ -130,9 +136,10 @@
noangles=.true. noangles=.true.
i_c = 3 i_c = 3
a1 = lmat(:,1,i_c) a1 = lmat(:,1,i_c) * scale(:)
a2 = lmat(:,2,i_c) a2 = lmat(:,2,i_c) * scale(:)
a3 = lmat(:,3,i_c) a3 = lmat(:,3,i_c) * scale(:)
scale = 1.0
IF ( a.NE.b .OR. a.NE.c ) err = 31 IF ( a.NE.b .OR. a.NE.c ) err = 31
...@@ -143,9 +150,10 @@ ...@@ -143,9 +150,10 @@
noangles=.true. noangles=.true.
i_c = 4 i_c = 4
a1 = lmat(:,1,i_c) a1 = lmat(:,1,i_c) * scale(:)
a2 = lmat(:,2,i_c) a2 = lmat(:,2,i_c) * scale(:)
a3 = lmat(:,3,i_c) a3 = lmat(:,3,i_c) * scale(:)
scale = 1.0
IF ( a.NE.b ) err = 41 IF ( a.NE.b ) err = 41
...@@ -155,9 +163,10 @@ ...@@ -155,9 +163,10 @@
noangles=.true. noangles=.true.
i_c = 4 i_c = 4
a1 = lmat((/2,1,3/),1,i_c) a1 = lmat((/2,1,3/),1,i_c) * scale(:)
a2 = -lmat((/2,1,3/),2,i_c) a2 = -lmat((/2,1,3/),2,i_c) * scale(:)
a3 = lmat(:,3,i_c) a3 = lmat(:,3,i_c) * scale(:)
scale = 1.0
i_c = 9 i_c = 9
IF ( a.NE.b ) err = 41 IF ( a.NE.b ) err = 41
...@@ -173,7 +182,7 @@ ...@@ -173,7 +182,7 @@
a1 = lmat(:,1,i_c) a1 = lmat(:,1,i_c)
a2 = lmat(:,2,i_c) a2 = lmat(:,2,i_c)
a3 = lmat(:,3,i_c) a3 = lmat(:,3,i_c)
IF ( a.NE.b ) err = 51 IF ( a.NE.b ) err = 51
IF ( b.NE.c ) err = 51 IF ( b.NE.c ) err = 51
IF ( alpha.EQ.0.0 .OR. IF ( alpha.EQ.0.0 .OR.
...@@ -234,9 +243,10 @@ ...@@ -234,9 +243,10 @@
noangles=.true. noangles=.true.
i_c = 1 i_c = 1
a1 = lmat(:,1,i_c) a1 = lmat(:,1,i_c) * scale(:)
a2 = lmat(:,2,i_c) a2 = lmat(:,2,i_c) * scale(:)
a3 = lmat(:,3,i_c) a3 = lmat(:,3,i_c) * scale(:)
scale = 1.0
IF ( a.NE.b ) err = 61 IF ( a.NE.b ) err = 61
IF ( ar.NE.br .OR. ar.NE.cr .OR. ar.NE.(pi_const/2.0) ) err= 62 IF ( ar.NE.br .OR. ar.NE.cr .OR. ar.NE.(pi_const/2.0) ) err= 62
...@@ -248,9 +258,10 @@ ...@@ -248,9 +258,10 @@
noangles=.true. noangles=.true.
i_c = 3 i_c = 3
a1 = lmat(:,1,i_c) a1 = lmat(:,1,i_c) * scale(:)
a2 = lmat(:,2,i_c) a2 = lmat(:,2,i_c) * scale(:)
a3 = lmat(:,3,i_c) a3 = lmat(:,3,i_c) * scale(:)
scale = 1.0
IF ( a.NE.b ) err = 61 IF ( a.NE.b ) err = 61
...@@ -261,9 +272,10 @@ ...@@ -261,9 +272,10 @@
noangles=.true. noangles=.true.
i_c = 1 i_c = 1
a1 = lmat(:,1,i_c) a1 = lmat(:,1,i_c) * scale(:)
a2 = lmat(:,2,i_c) a2 = lmat(:,2,i_c) * scale(:)
a3 = lmat(:,3,i_c) a3 = lmat(:,3,i_c) * scale(:)
scale = 1.0
!===> 9: orthorhombic-F (oF) !===> 9: orthorhombic-F (oF)
...@@ -273,9 +285,10 @@ ...@@ -273,9 +285,10 @@
noangles=.true. noangles=.true.
i_c = 2 i_c = 2
a1 = lmat(:,1,i_c) a1 = lmat(:,1,i_c) * scale(:)
a2 = lmat(:,2,i_c) a2 = lmat(:,2,i_c) * scale(:)
a3 = lmat(:,3,i_c) a3 = lmat(:,3,i_c) * scale(:)
scale = 1.0
!===> 10: orthorhombic-I (oI) !===> 10: orthorhombic-I (oI)
...@@ -285,9 +298,10 @@ ...@@ -285,9 +298,10 @@
noangles=.true. noangles=.true.
i_c = 3 i_c = 3
a1 = lmat(:,1,i_c) a1 = lmat(:,1,i_c) * scale(:)
a2 = lmat(:,2,i_c) a2 = lmat(:,2,i_c) * scale(:)
a3 = lmat(:,3,i_c) a3 = lmat(:,3,i_c) * scale(:)
scale = 1.0
!===> 11: orthorhombic-S (oS) (oC) !===> 11: orthorhombic-S (oS) (oC)
...@@ -297,9 +311,10 @@ ...@@ -297,9 +311,10 @@
noangles=.true. noangles=.true.
i_c = 6 i_c = 6
a1 = lmat(:,1,i_c) a1 = lmat(:,1,i_c) * scale(:)
a2 = lmat(:,2,i_c) a2 = lmat(:,2,i_c) * scale(:)
a3 = lmat(:,3,i_c) a3 = lmat(:,3,i_c) * scale(:)
scale = 1.0
!===> 11a: orthorhombic-A (oA) !===> 11a: orthorhombic-A (oA)
...@@ -309,9 +324,10 @@ ...@@ -309,9 +324,10 @@
noangles=.true. noangles=.true.
i_c = 8 i_c = 8
a1 = lmat(:,1,i_c) a1 = lmat(:,1,i_c) * scale(:)
a2 = lmat(:,2,i_c) a2 = lmat(:,2,i_c) * scale(:)
a3 = lmat(:,3,i_c) a3 = lmat(:,3,i_c) * scale(:)
scale = 1.0
!===> 11b: orthorhombic-B (oB) !===> 11b: orthorhombic-B (oB)
...@@ -321,9 +337,10 @@ ...@@ -321,9 +337,10 @@
noangles=.true. noangles=.true.
i_c = 7 i_c = 7
a1 = lmat(:,1,i_c) a1 = lmat(:,1,i_c) * scale(:)
a2 = lmat(:,2,i_c) a2 = lmat(:,2,i_c) * scale(:)
a3 = lmat(:,3,i_c) a3 = lmat(:,3,i_c) * scale(:)
scale = 1.0
!===> 12: monoclinic-P (mP) !===> 12: monoclinic-P (mP)
ELSEIF ( latsys =='monoclinic-P'.OR.latsys =='mP'.OR ELSEIF ( latsys =='monoclinic-P'.OR.latsys =='mP'.OR
...@@ -470,6 +487,8 @@ ...@@ -470,6 +487,8 @@
ENDIF ENDIF
IF (abs(scale(1)) < eps) THEN IF (abs(scale(1)) < eps) THEN
CALL juDFT_error("Illegal program section reached!"
+ ,calledby ="lattice2")
scale(1) = a scale(1) = a
scale(2) = b scale(2) = b
scale(3) = c scale(3) = c
......
...@@ -358,12 +358,15 @@ ...@@ -358,12 +358,15 @@
IF (input%film) atoms%taual(3,:) = atoms%taual(3,:) * a3(3) / dtild IF (input%film) atoms%taual(3,:) = atoms%taual(3,:) * a3(3) / dtild
CLOSE (6) CLOSE (6)
inquire(file="inp",exist=l_exists) INQUIRE(file="inp",exist=l_exists)
IF (l_exists) THEN IF (l_exists) THEN
CALL juDFT_error("Cannot overwrite existing inp-file ",calledby& CALL juDFT_error("inp-file exists. Cannot write another input file in this directory.",calledby="set_inp")
& ="set_inp")
ENDIF ENDIF
INQUIRE(file="inp.xml",exist=l_exists)
IF (l_exists) THEN
CALL juDFT_error("inp.xml-file exists. Cannot write another input file in this directory.",calledby="set_inp")
ENDIF
nu = 8 nu = 8
input%gw = 0 input%gw = 0
...@@ -412,7 +415,7 @@ ...@@ -412,7 +415,7 @@
Jij%phnd=1 Jij%phnd=1
IF(.NOT.juDFT_was_argument("-noXML")) THEN IF(.NOT.juDFT_was_argument("-old")) THEN
nkptOld = kpts%nkpt nkptOld = kpts%nkpt
latnamTemp = cell%latnam latnamTemp = cell%latnam
...@@ -498,7 +501,7 @@ ...@@ -498,7 +501,7 @@
IF (atoms%ntype.GT.999) THEN IF (atoms%ntype.GT.999) THEN
WRITE(*,*) 'More than 999 atom types -> no conventional inp file generated!' WRITE(*,*) 'More than 999 atom types -> no conventional inp file generated!'
WRITE(*,*) 'Use inp.xml file instead!' WRITE(*,*) 'Use inp.xml file instead!'
ELSE ELSE IF (juDFT_was_argument("-old")) THEN
CALL rw_inp(& CALL rw_inp(&
& ch_rw,atoms,obsolete,vacuum,input,stars,sliceplot,banddos,& & ch_rw,atoms,obsolete,vacuum,input,stars,sliceplot,banddos,&
& cell,sym,xcpot,noco,jij,oneD,hybrid,kpts,& & cell,sym,xcpot,noco,jij,oneD,hybrid,kpts,&
......
This diff is collapsed.
...@@ -58,12 +58,13 @@ MODULE m_cdnpot_io_common ...@@ -58,12 +58,13 @@ MODULE m_cdnpot_io_common
END SUBROUTINE compareStepfunctions END SUBROUTINE compareStepfunctions
SUBROUTINE compareStructure(atoms, vacuum, cell, refAtoms, refVacuum,& SUBROUTINE compareStructure(atoms, vacuum, cell, sym, refAtoms, refVacuum,&
refCell, l_same) refCell, refSym, l_same)
TYPE(t_atoms),INTENT(IN) :: atoms, refAtoms TYPE(t_atoms),INTENT(IN) :: atoms, refAtoms
TYPE(t_vacuum),INTENT(IN) :: vacuum, refVacuum TYPE(t_vacuum),INTENT(IN) :: vacuum, refVacuum
TYPE(t_cell),INTENT(IN) :: cell, refCell TYPE(t_cell),INTENT(IN) :: cell, refCell
TYPE(t_sym),INTENT(IN) :: sym, refSym
LOGICAL, INTENT(OUT) :: l_same LOGICAL, INTENT(OUT) :: l_same
...@@ -74,10 +75,14 @@ MODULE m_cdnpot_io_common ...@@ -74,10 +75,14 @@ MODULE m_cdnpot_io_common
IF(atoms%lmaxd.NE.refAtoms%lmaxd) l_same = .FALSE. IF(atoms%lmaxd.NE.refAtoms%lmaxd) l_same = .FALSE.
IF(atoms%jmtd.NE.refAtoms%jmtd) l_same = .FALSE. IF(atoms%jmtd.NE.refAtoms%jmtd) l_same = .FALSE.
IF(vacuum%dvac.NE.refVacuum%dvac) l_same = .FALSE. IF(vacuum%dvac.NE.refVacuum%dvac) l_same = .FALSE.
IF(sym%nop.NE.refSym%nop) l_same = .FALSE.
IF(sym%nop2.NE.refSym%nop2) l_same = .FALSE.
IF(ANY(ABS(cell%amat(:,:)-refCell%amat(:,:)).GT.1e-10)) l_same = .FALSE. IF(ANY(ABS(cell%amat(:,:)-refCell%amat(:,:)).GT.1e-10)) l_same = .FALSE.
IF(l_same) THEN IF(l_same) THEN
IF(ANY(atoms%nz(:).NE.refAtoms%nz(:))) l_same = .FALSE. IF(ANY(atoms%nz(:).NE.refAtoms%nz(:))) l_same = .FALSE.
IF(ANY(atoms%lmax(:).NE.refAtoms%lmax(:))) l_same = .FALSE. IF(ANY(sym%mrot(:,:,:sym%nop).NE.refSym%mrot(:,:,:sym%nop))) l_same = .FALSE.
IF(ANY(ABS(sym%tau(:,:sym%nop)-refSym%tau(:,:sym%nop)).GT.1e-10)) l_same = .FALSE.
END IF END IF
IF(l_same) THEN IF(l_same) THEN
DO i = 1, atoms%nat DO i = 1, atoms%nat
...@@ -128,10 +133,11 @@ MODULE m_cdnpot_io_common ...@@ -128,10 +133,11 @@ MODULE m_cdnpot_io_common
TYPE(t_atoms) :: atomsTemp TYPE(t_atoms) :: atomsTemp
TYPE(t_sphhar) :: latharmsTemp TYPE(t_sphhar) :: latharmsTemp
TYPE(t_input) :: inputTemp TYPE(t_input) :: inputTemp
TYPE(t_sym) :: symTemp
TYPE(t_cell) :: cellTemp TYPE(t_cell) :: cellTemp
TYPE(t_oneD) :: oneDTemp TYPE(t_oneD) :: oneDTemp
TYPE(t_sym) :: symTemp
INTEGER :: starsIndexTemp, structureIndexTemp
LOGICAL :: l_same, l_writeAll LOGICAL :: l_same, l_writeAll
l_storeIndices = .FALSE. l_storeIndices = .FALSE.
...@@ -140,55 +146,69 @@ MODULE m_cdnpot_io_common ...@@ -140,55 +146,69 @@ MODULE m_cdnpot_io_common
IF(currentStructureIndex.EQ.0) THEN IF(currentStructureIndex.EQ.0) THEN
currentStructureIndex = 1 currentStructureIndex = 1
l_storeIndices = .TRUE. l_storeIndices = .TRUE.
CALL writeStructureHDF(fileID, input, atoms, cell, vacuum, oneD, currentStructureIndex) CALL writeStructureHDF(fileID, input, atoms, cell, vacuum, oneD, sym, currentStructureIndex)
ELSE ELSE
CALL readStructureHDF(fileID, inputTemp, atomsTemp, cellTemp, vacuumTemp, oneDTemp, currentStructureIndex) CALL readStructureHDF(fileID, inputTemp, atomsTemp, cellTemp, vacuumTemp, oneDTemp, symTemp, currentStructureIndex)
CALL compareStructure(atoms, vacuum, cell, atomsTemp, vacuumTemp, cellTemp, l_same) CALL compareStructure(atoms, vacuum, cell, sym, atomsTemp, vacuumTemp, cellTemp, symTemp, l_same)
IF(.NOT.l_same) THEN IF(.NOT.l_same) THEN
currentStructureIndex = currentStructureIndex + 1 currentStructureIndex = currentStructureIndex + 1
l_storeIndices = .TRUE. l_storeIndices = .TRUE.
l_writeAll = .TRUE. l_writeAll = .TRUE.
CALL writeStructureHDF(fileID, input, atoms, cell, vacuum, oneD, currentStructureIndex) CALL writeStructureHDF(fileID, input, atoms, cell, vacuum, oneD, sym, currentStructureIndex)
END IF END IF
END IF END IF
IF (currentStarsIndex.EQ.0) THEN IF (currentStarsIndex.EQ.0) THEN
currentStarsIndex = 1 currentStarsIndex = 1
l_storeIndices = .TRUE. l_storeIndices = .TRUE.
CALL writeStarsHDF(fileID, currentStarsIndex, stars) CALL writeStarsHDF(fileID, currentStarsIndex, currentStructureIndex, stars)
ELSE ELSE
CALL readStarsHDF(fileID, currentStarsIndex, starsTemp) CALL peekStarsHDF(fileID, currentStarsIndex, structureIndexTemp)
CALL compareStars(stars, starsTemp, l_same) l_same = structureIndexTemp.EQ.currentStructureIndex
IF(l_same) THEN
CALL readStarsHDF(fileID, currentStarsIndex, starsTemp)
CALL compareStars(stars, starsTemp, l_same)
END IF
IF((.NOT.l_same).OR.l_writeAll) THEN IF((.NOT.l_same).OR.l_writeAll) THEN
currentStarsIndex = currentStarsIndex + 1 currentStarsIndex = currentStarsIndex + 1
l_storeIndices = .TRUE. l_storeIndices = .TRUE.
CALL writeStarsHDF(fileID, currentStarsIndex, stars) CALL writeStarsHDF(fileID, currentStarsIndex, currentStructureIndex, stars)
END IF END IF
END IF END IF
IF (currentLatharmsIndex.EQ.0) THEN IF (currentLatharmsIndex.EQ.0) THEN
currentLatharmsIndex = 1 currentLatharmsIndex = 1
l_storeIndices = .TRUE. l_storeIndices = .TRUE.
CALL writeLatharmsHDF(fileID, currentLatharmsIndex, latharms) CALL writeLatharmsHDF(fileID, currentLatharmsIndex, currentStructureIndex, latharms)
ELSE ELSE