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
LINK_LIBRARIES ${FLEUR_LIBRARIES})
if (NOT FLEUR_USE_ELPA)
set(STORE_FLAGS "${CMAKE_Fortran_FLAGS}")
if (DEFINED ENV{ELPA_MODULES})
set(STORE_FLAGS ${CMAKE_Fortran_FLAGS})
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -I$ENV{ELPA_MODULES}")
endif()
if (DEFINED ENV{ELPA_LIB})
......@@ -15,7 +15,7 @@ LINK_LIBRARIES ${TEST_LIBRARIES})
if (FLEUR_USE_ELPA)
set(FLEUR_LIBRARIES "${TEST_LIBRARIES}")
else()
set(CMAKE_Fortran_FLAGS ${STORE_FLAGS})
set(CMAKE_Fortran_FLAGS "${STORE_FLAGS}")
endif()
endif()
......
......@@ -47,6 +47,9 @@ CONTAINS
USE m_icorrkeys
USE m_eig66_io, ONLY : open_eig, write_eig, close_eig,read_eig
USE m_xmlOutput
#ifdef CPP_MPI
USE m_mpi_bc_pot
#endif
IMPLICIT NONE
TYPE(t_results),INTENT(INOUT):: results
......@@ -238,8 +241,16 @@ CONTAINS
& 'Info: and stored in "vxc", the values obtained from the',&
& 'Info: original implementation are saved to "vxc.old".'
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
IF (mpi%irank.EQ.0) CALL openXMLElementFormPoly('iteration',(/'numberForCurrentRun','overallNumber '/),(/it,iter/),&
RESHAPE((/19,13,5,5/),(/2,2/)))
......@@ -663,8 +674,15 @@ ENDIF
ENDDO
CLOSE (16)
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
ELSE IF ( input%gw.EQ.2.AND.(gwc==2) ) THEN
CLOSE (12)
......
......@@ -39,6 +39,7 @@
USE m_dwigner
USE m_strgn
USE m_stepf
USE m_cdn_io
USE m_mapatom
USE m_writegw
USE m_convn
......@@ -136,6 +137,10 @@
CALL od_mapatom(oneD,atoms,sym,cell)
END IF
! Store structure data
CALL storeStructureIfNew(input, atoms, cell, vacuum, oneD, sym)
!+odim
IF (input%film.OR.(sym%namgrp.NE.'any ')) THEN
CALL strgn1(stars,sym,atoms, vacuum,sphhar, input,cell,xcpot)
......
......@@ -46,7 +46,7 @@
!
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
RETURN
END IF
......
......@@ -162,9 +162,9 @@ PROGRAM inpgen
nops = sym%nop
symfn = 'sym.out'
IF (.not.input%film) sym%nop2=sym%nop
CALL rw_symfile(&
& 'W',symfh,symfn,nops,cell%bmat,&
& sym%mrot,sym%tau,sym%nop,sym%nop2,sym%symor)
IF ((juDFT_was_argument("-old")).OR.(.NOT.juDFT_was_argument("-explicit"))) THEN
CALL rw_symfile('W',symfh,symfn,nops,cell%bmat,sym%mrot,sym%tau,sym%nop,sym%nop2,sym%symor)
END IF
ALLOCATE (atomTypeSpecies(atoms%ntype))
ALLOCATE (speciesRepAtomType(atoms%nat))
......
......@@ -94,6 +94,10 @@
cr = gamma
ENDIF
scale(1) = a
scale(2) = b
scale(3) = c
latsys = ADJUSTL(latsys)
!===> 1: cubic-P (cP) sc
......@@ -103,9 +107,10 @@
noangles=.true.
i_c = 1
a1 = lmat(:,1,i_c)
a2 = lmat(:,2,i_c)
a3 = lmat(:,3,i_c)
a1 = lmat(:,1,i_c) * scale(:)
a2 = lmat(:,2,i_c) * scale(:)
a3 = lmat(:,3,i_c) * scale(:)
scale = 1.0
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
......@@ -117,9 +122,10 @@
noangles=.true.
i_c = 2
a1 = lmat(:,1,i_c)
a2 = lmat(:,2,i_c)
a3 = lmat(:,3,i_c)
a1 = lmat(:,1,i_c) * scale(:)
a2 = lmat(:,2,i_c) * scale(:)
a3 = lmat(:,3,i_c) * scale(:)
scale = 1.0
IF ( a.NE.b .OR. a.NE.c ) err = 21
......@@ -130,9 +136,10 @@
noangles=.true.
i_c = 3
a1 = lmat(:,1,i_c)
a2 = lmat(:,2,i_c)
a3 = lmat(:,3,i_c)
a1 = lmat(:,1,i_c) * scale(:)
a2 = lmat(:,2,i_c) * scale(:)
a3 = lmat(:,3,i_c) * scale(:)
scale = 1.0
IF ( a.NE.b .OR. a.NE.c ) err = 31
......@@ -143,9 +150,10 @@
noangles=.true.
i_c = 4
a1 = lmat(:,1,i_c)
a2 = lmat(:,2,i_c)
a3 = lmat(:,3,i_c)
a1 = lmat(:,1,i_c) * scale(:)
a2 = lmat(:,2,i_c) * scale(:)
a3 = lmat(:,3,i_c) * scale(:)
scale = 1.0
IF ( a.NE.b ) err = 41
......@@ -155,9 +163,10 @@
noangles=.true.
i_c = 4
a1 = lmat((/2,1,3/),1,i_c)
a2 = -lmat((/2,1,3/),2,i_c)
a3 = lmat(:,3,i_c)
a1 = lmat((/2,1,3/),1,i_c) * scale(:)
a2 = -lmat((/2,1,3/),2,i_c) * scale(:)
a3 = lmat(:,3,i_c) * scale(:)
scale = 1.0
i_c = 9
IF ( a.NE.b ) err = 41
......@@ -173,7 +182,7 @@
a1 = lmat(:,1,i_c)
a2 = lmat(:,2,i_c)
a3 = lmat(:,3,i_c)
IF ( a.NE.b ) err = 51
IF ( b.NE.c ) err = 51
IF ( alpha.EQ.0.0 .OR.
......@@ -234,9 +243,10 @@
noangles=.true.
i_c = 1
a1 = lmat(:,1,i_c)
a2 = lmat(:,2,i_c)
a3 = lmat(:,3,i_c)
a1 = lmat(:,1,i_c) * scale(:)
a2 = lmat(:,2,i_c) * scale(:)
a3 = lmat(:,3,i_c) * scale(:)
scale = 1.0
IF ( a.NE.b ) err = 61
IF ( ar.NE.br .OR. ar.NE.cr .OR. ar.NE.(pi_const/2.0) ) err= 62
......@@ -248,9 +258,10 @@
noangles=.true.
i_c = 3
a1 = lmat(:,1,i_c)
a2 = lmat(:,2,i_c)
a3 = lmat(:,3,i_c)
a1 = lmat(:,1,i_c) * scale(:)
a2 = lmat(:,2,i_c) * scale(:)
a3 = lmat(:,3,i_c) * scale(:)
scale = 1.0
IF ( a.NE.b ) err = 61
......@@ -261,9 +272,10 @@
noangles=.true.
i_c = 1
a1 = lmat(:,1,i_c)
a2 = lmat(:,2,i_c)
a3 = lmat(:,3,i_c)
a1 = lmat(:,1,i_c) * scale(:)
a2 = lmat(:,2,i_c) * scale(:)
a3 = lmat(:,3,i_c) * scale(:)
scale = 1.0
!===> 9: orthorhombic-F (oF)
......@@ -273,9 +285,10 @@
noangles=.true.
i_c = 2
a1 = lmat(:,1,i_c)
a2 = lmat(:,2,i_c)
a3 = lmat(:,3,i_c)
a1 = lmat(:,1,i_c) * scale(:)
a2 = lmat(:,2,i_c) * scale(:)
a3 = lmat(:,3,i_c) * scale(:)
scale = 1.0
!===> 10: orthorhombic-I (oI)
......@@ -285,9 +298,10 @@
noangles=.true.
i_c = 3
a1 = lmat(:,1,i_c)
a2 = lmat(:,2,i_c)
a3 = lmat(:,3,i_c)
a1 = lmat(:,1,i_c) * scale(:)
a2 = lmat(:,2,i_c) * scale(:)
a3 = lmat(:,3,i_c) * scale(:)
scale = 1.0
!===> 11: orthorhombic-S (oS) (oC)
......@@ -297,9 +311,10 @@
noangles=.true.
i_c = 6
a1 = lmat(:,1,i_c)
a2 = lmat(:,2,i_c)
a3 = lmat(:,3,i_c)
a1 = lmat(:,1,i_c) * scale(:)
a2 = lmat(:,2,i_c) * scale(:)
a3 = lmat(:,3,i_c) * scale(:)
scale = 1.0
!===> 11a: orthorhombic-A (oA)
......@@ -309,9 +324,10 @@
noangles=.true.
i_c = 8
a1 = lmat(:,1,i_c)
a2 = lmat(:,2,i_c)
a3 = lmat(:,3,i_c)
a1 = lmat(:,1,i_c) * scale(:)
a2 = lmat(:,2,i_c) * scale(:)
a3 = lmat(:,3,i_c) * scale(:)
scale = 1.0
!===> 11b: orthorhombic-B (oB)
......@@ -321,9 +337,10 @@
noangles=.true.
i_c = 7
a1 = lmat(:,1,i_c)
a2 = lmat(:,2,i_c)
a3 = lmat(:,3,i_c)
a1 = lmat(:,1,i_c) * scale(:)
a2 = lmat(:,2,i_c) * scale(:)
a3 = lmat(:,3,i_c) * scale(:)
scale = 1.0
!===> 12: monoclinic-P (mP)
ELSEIF ( latsys =='monoclinic-P'.OR.latsys =='mP'.OR
......@@ -470,6 +487,8 @@
ENDIF
IF (abs(scale(1)) < eps) THEN
CALL juDFT_error("Illegal program section reached!"
+ ,calledby ="lattice2")
scale(1) = a
scale(2) = b
scale(3) = c
......
......@@ -358,12 +358,15 @@
IF (input%film) atoms%taual(3,:) = atoms%taual(3,:) * a3(3) / dtild
CLOSE (6)
inquire(file="inp",exist=l_exists)
INQUIRE(file="inp",exist=l_exists)
IF (l_exists) THEN
CALL juDFT_error("Cannot overwrite existing inp-file ",calledby&
& ="set_inp")
CALL juDFT_error("inp-file exists. Cannot write another input file in this directory.",calledby="set_inp")
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
input%gw = 0
......@@ -412,7 +415,7 @@
Jij%phnd=1
IF(.NOT.juDFT_was_argument("-noXML")) THEN
IF(.NOT.juDFT_was_argument("-old")) THEN
nkptOld = kpts%nkpt
latnamTemp = cell%latnam
......@@ -498,7 +501,7 @@
IF (atoms%ntype.GT.999) THEN
WRITE(*,*) 'More than 999 atom types -> no conventional inp file generated!'
WRITE(*,*) 'Use inp.xml file instead!'
ELSE
ELSE IF (juDFT_was_argument("-old")) THEN
CALL rw_inp(&
& ch_rw,atoms,obsolete,vacuum,input,stars,sliceplot,banddos,&
& cell,sym,xcpot,noco,jij,oneD,hybrid,kpts,&
......
......@@ -33,6 +33,7 @@ MODULE m_cdn_io
PUBLIC readStars, writeStars
PUBLIC readStepfunction, writeStepfunction
PUBLIC setStartingDensity, readPrevEFermi, deleteDensities
PUBLIC storeStructureIfNew
PUBLIC CDN_INPUT_DEN_const, CDN_OUTPUT_DEN_const
PUBLIC CDN_ARCHIVE_TYPE_CDN1_const, CDN_ARCHIVE_TYPE_NOCO_const
PUBLIC CDN_ARCHIVE_TYPE_CDN_const
......@@ -74,7 +75,6 @@ MODULE m_cdn_io
CHARACTER(LEN=19) :: timeStampString
CHARACTER(LEN=15) :: distanceString
CALL getMode(mode)
WRITE(*,*) 'Available densities info:'
......@@ -101,8 +101,8 @@ MODULE m_cdn_io
stepfunctionIndexTemp,previousDensityIndex, jspinsTemp,&
dateTemp, timeTemp, distanceTemp, fermiEnergyTemp, l_qfixTemp)
WRITE(dateString,'(i8)'), dateTemp
WRITE(timeString,'(i6)'), timeTemp
WRITE(dateString,'(i8)') dateTemp
WRITE(timeString,'(i6)') timeTemp
distanceString = ''
IF (distanceTemp.GE.-1e-10) THEN
......@@ -156,7 +156,7 @@ MODULE m_cdn_io
REAL, INTENT (OUT) :: fr(atoms%jmtd,0:sphhar%nlhd,atoms%ntype,input%jspins), fz(vacuum%nmzd,2,input%jspins)
! local variables
INTEGER :: mode, datend, k, i, iVac, j, iUnit
INTEGER :: mode, datend, k, i, iVac, j, iUnit, l
LOGICAL :: l_exist, l_rhomatFile, l_DimChange
CHARACTER(LEN=30) :: filename
......@@ -226,7 +226,6 @@ MODULE m_cdn_io
CALL writeDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,inOrOutCDN,&
1,-1.0,fermiEnergy,l_qfix,iter,fr,fpw,fz,fzxy,cdom,cdomvz,cdomvxy)
END IF
RETURN
ELSE
WRITE(*,*) 'cdn.hdf file or relevant density entry not found.'
WRITE(*,*) 'Falling back to stream access file cdn.str.'
......@@ -240,7 +239,6 @@ MODULE m_cdn_io
IF (l_exist) THEN
!load density from cdn.str and exit subroutine
RETURN
ELSE
WRITE(*,*) 'cdn.str file not found.'
WRITE(*,*) 'Falling back to direct access file cdn1.'
......@@ -310,10 +308,9 @@ MODULE m_cdn_io
cdomvxy = CMPLX(0.0,0.0)
END IF
END IF
CLOSE(iUnit)
END IF
CLOSE(iUnit)
END SUBROUTINE readDensity
SUBROUTINE writeDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,inOrOutCDN,&
......@@ -772,6 +769,67 @@ MODULE m_cdn_io
END SUBROUTINE writeCoreDensity
SUBROUTINE storeStructureIfNew(input, atoms, cell, vacuum, oneD, sym)
TYPE(t_input),INTENT(IN) :: input
TYPE(t_atoms), INTENT(IN) :: atoms
TYPE(t_cell), INTENT(IN) :: cell
TYPE(t_vacuum), INTENT(IN) :: vacuum
TYPE(t_oneD),INTENT(IN) :: oneD
TYPE(t_sym),INTENT(IN) :: sym
TYPE(t_input) :: inputTemp
TYPE(t_atoms) :: atomsTemp
TYPE(t_cell) :: cellTemp
TYPE(t_vacuum) :: vacuumTemp
TYPE(t_oneD) :: oneDTemp
TYPE(t_sym) :: symTemp
INTEGER :: mode
INTEGER :: currentStarsIndex,currentLatharmsIndex,currentStructureIndex
INTEGER :: currentStepfunctionIndex,readDensityIndex,lastDensityIndex
LOGICAL :: l_writeStructure, l_same
#ifdef CPP_HDF
INTEGER(HID_T) :: fileID
#endif
CALL getMode(mode)
IF(mode.EQ.CDN_HDF5_MODE) THEN
#ifdef CPP_HDF
l_writeStructure = .FALSE.
CALL openCDN_HDF(fileID,currentStarsIndex,currentLatharmsIndex,currentStructureIndex,&
currentStepfunctionIndex,readDensityIndex,lastDensityIndex)
IF (currentStructureIndex.EQ.0) THEN
currentStructureIndex = currentStructureIndex + 1
l_writeStructure = .TRUE.
ELSE
CALL readStructureHDF(fileID, inputTemp, atomsTemp, cellTemp, vacuumTemp, oneDTemp, symTemp, currentStructureIndex)
CALL compareStructure(atoms, vacuum, cell, sym, atomsTemp, vacuumTemp, cellTemp, symTemp, l_same)
IF(.NOT.l_same) THEN
currentStructureIndex = currentStructureIndex + 1
l_writeStructure = .TRUE.
END IF
END IF
IF (l_writeStructure) THEN
CALL writeStructureHDF(fileID, input, atoms, cell, vacuum, oneD, sym, currentStructureIndex)
CALL writeCDNHeaderData(fileID,currentStarsIndex,currentLatharmsIndex,currentStructureIndex,&
currentStepfunctionIndex,readDensityIndex,lastDensityIndex)
END IF
CALL closeCDNPOT_HDF(fileID)
#endif
ELSE IF(mode.EQ.CDN_STREAM_MODE) THEN
! Write stars to stars file
STOP 'CDN_STREAM_MODE not yet implemented!'
ELSE
! In direct access mode no structure information is written to any file.
END IF
END SUBROUTINE storeStructureIfNew
SUBROUTINE writeStars(stars,l_xcExtended,l_ExtData)
TYPE(t_stars),INTENT(IN) :: stars
......@@ -800,7 +858,7 @@ MODULE m_cdn_io
currentStepfunctionIndex,readDensityIndex,lastDensityIndex)
currentStarsIndex = currentStarsIndex + 1
CALL writeStarsHDF(fileID, currentStarsIndex, stars)
CALL writeStarsHDF(fileID, currentStarsIndex, currentStructureIndex, stars)
CALL writeCDNHeaderData(fileID,currentStarsIndex,currentLatharmsIndex,currentStructureIndex,&
currentStepfunctionIndex,readDensityIndex,lastDensityIndex)
......@@ -849,6 +907,7 @@ MODULE m_cdn_io
INTEGER :: mode, ioStatus, ngz,izmin,izmax
LOGICAL :: l_exist, l_same
INTEGER :: structureIndexTemp
INTEGER :: currentStarsIndex,currentLatharmsIndex,currentStructureIndex
INTEGER :: currentStepfunctionIndex,readDensityIndex,lastDensityIndex
#ifdef CPP_HDF
......@@ -874,9 +933,12 @@ MODULE m_cdn_io
IF (currentStarsIndex.LT.1) THEN
mode = CDN_DIRECT_MODE ! (no stars entry found in cdn.hdf file)
ELSE
CALL readStarsHDF(fileID, currentStarsIndex, starsTemp)
CALL compareStars(stars, starsTemp, l_same)
WRITE(*,*) 'l_same', l_same
CALL peekStarsHDF(fileID, currentStarsIndex, structureIndexTemp)
l_same = structureIndexTemp.EQ.currentStructureIndex
IF(l_same) THEN
CALL readStarsHDF(fileID, currentStarsIndex, starsTemp)
CALL compareStars(stars, starsTemp, l_same)
END IF
IF(l_same) THEN
CALL readStarsHDF(fileID, currentStarsIndex, stars)
ELSE
......@@ -973,7 +1035,7 @@ MODULE m_cdn_io
currentStepfunctionIndex,readDensityIndex,lastDensityIndex)
currentStepfunctionIndex = currentStepfunctionIndex + 1
CALL writeStepfunctionHDF(fileID, currentStepfunctionIndex, currentStarsIndex, stars)
CALL writeStepfunctionHDF(fileID, currentStepfunctionIndex, currentStarsIndex, currentStructureIndex, stars)
CALL writeCDNHeaderData(fileID,currentStarsIndex,currentLatharmsIndex,currentStructureIndex,&
currentStepfunctionIndex,readDensityIndex,lastDensityIndex)
......@@ -994,14 +1056,25 @@ MODULE m_cdn_io
END SUBROUTINE writeStepfunction
SUBROUTINE readStepfunction(stars, l_error)
SUBROUTINE readStepfunction(stars, atoms, cell, vacuum, l_error)
TYPE(t_stars),INTENT(INOUT) :: stars
LOGICAL, INTENT(OUT) :: l_error
TYPE(t_stars),INTENT(INOUT) :: stars
TYPE(t_atoms), INTENT(IN) :: atoms
TYPE(t_cell), INTENT(IN) :: cell
TYPE(t_vacuum), INTENT(IN) :: vacuum
LOGICAL, INTENT(OUT) :: l_error
TYPE(t_stars) :: starsTemp
TYPE(t_input) :: inputTemp
TYPE(t_atoms) :: atomsTemp
TYPE(t_cell) :: cellTemp
TYPE(t_vacuum) :: vacuumTemp
TYPE(t_oneD) :: oneDTemp
INTEGER :: mode
INTEGER :: ifftd, ng3Temp, ifftdTemp, ioStatus, i, starsIndexTemp
LOGICAL :: l_exist
INTEGER :: structureIndexTemp
LOGICAL :: l_exist, l_same, l_sameTemp
INTEGER :: currentStarsIndex,currentLatharmsIndex,currentStructureIndex
INTEGER :: currentStepfunctionIndex,readDensityIndex,lastDensityIndex
......@@ -1021,12 +1094,13 @@ MODULE m_cdn_io
#ifdef CPP_HDF
CALL openCDN_HDF(fileID,currentStarsIndex,currentLatharmsIndex,currentStructureIndex,&
currentStepfunctionIndex,readDensityIndex,lastDensityIndex)
starsIndexTemp = -1
IF(currentStepfunctionIndex.GT.0) THEN
CALL peekStepfunctionHDF(fileID, currentStepfunctionIndex, starsIndexTemp)
END IF
IF(starsIndexTemp.EQ.currentStarsIndex) THEN
CALL readStepfunctionHDF(fileID, currentStepfunctionIndex, stars)
CALL peekStepfunctionHDF(fileID, currentStepfunctionIndex, starsIndexTemp, structureIndexTemp)
IF((starsIndexTemp.EQ.currentStarsIndex).AND.(structureIndexTemp.EQ.currentStructureIndex)) THEN
CALL readStepfunctionHDF(fileID, currentStepfunctionIndex, stars)
ELSE
mode = CDN_STREAM_MODE ! No adequate stepfunction entry found. Fall back to other IO modes.
END IF
ELSE
mode = CDN_STREAM_MODE ! No adequate stepfunction entry found. Fall back to other IO modes.
END IF
......@@ -1160,22 +1234,39 @@ MODULE m_cdn_io
separatorIndex = -1
startNumber = -1
endNumber = -1
DO i = 1, LEN(TRIM(ADJUSTL(ddString)))
IF(VERIFY(ddString(i:i),'1234567890').NE.0) THEN
IF ((ddString(i:i).EQ.'-').AND.(separatorIndex.EQ.-1)) THEN
separatorIndex = i
ELSE
CALL juDFT_error("density deletion string format error",calledby ="deleteDensities")
IF (TRIM(ADJUSTL(ddString)).EQ.'allbutlast') THEN
CALL getMode(mode)
IF(mode.EQ.CDN_HDF5_MODE) THEN
INQUIRE(FILE='cdn.hdf',EXIST=l_exist)
IF (l_exist) THEN
#ifdef CPP_HDF
CALL openCDN_HDF(fileID,currentStarsIndex,currentLatharmsIndex,currentStructureIndex,&
currentStepfunctionIndex,readDensityIndex,lastDensityIndex)
CALL closeCDNPOT_HDF(fileID)
startNumber = 1
endNumber = lastDensityIndex - 1
END IF
#endif
END IF
END DO
IF(separatorIndex.NE.-1) THEN
READ(ddString(1:separatorIndex-1),'(i)') startNumber
READ(ddString(separatorIndex+1:LEN(TRIM(ADJUSTL(ddString)))),'(i)') endNumber
ELSE
READ(ddString(1:LEN(TRIM(ADJUSTL(ddString)))),'(i)') startNumber
READ(ddString(1:LEN(TRIM(ADJUSTL(ddString)))),'(i)') endNumber
DO i = 1, LEN(TRIM(ADJUSTL(ddString)))
IF(VERIFY(ddString(i:i),'1234567890').NE.0) THEN
IF ((ddString(i:i).EQ.'-').AND.(separatorIndex.EQ.-1)) THEN
separatorIndex = i
ELSE
CALL juDFT_error("density deletion string format error",calledby ="deleteDensities")
END IF
END IF
END DO
IF(separatorIndex.NE.-1) THEN
READ(ddString(1:separatorIndex-1),'(i7)') startNumber
READ(ddString(separatorIndex+1:LEN(TRIM(ADJUSTL(ddString)))),'(i7)') endNumber
ELSE
READ(ddString(1:LEN(TRIM(ADJUSTL(ddString)))),'(i7)') startNumber
READ(ddString(1:LEN(TRIM(ADJUSTL(ddString)))),'(i7)') endNumber
END IF
END IF
CALL getMode(mode)
......@@ -1219,7 +1310,7 @@ MODULE m_cdn_io