Commit f91cf039 authored by Gregor Michalicek's avatar Gregor Michalicek

Even more steps towards changing structure, stars, stepfunction, lattice harmonics in cdn.hdf

This is surely still buggy. ...not as buggy as the last commit.
...There is light at the end of the tunnel.
parent 25e84946
......@@ -15,6 +15,7 @@ io/nocoInputCheck.F90
io/inpnoco.F90
io/loddop.f90
io/cdnpot_io_hdf.F90
io/cdnpot_io_common.F90
io/cdn_io.F90
io/pot_io.F90
io/rw_inp.f90
......
......@@ -19,6 +19,7 @@ MODULE m_cdn_io
USE m_loddop
USE m_wrtdop
USE m_cdnpot_io_hdf
USE m_cdnpot_io_common
#ifdef CPP_HDF
USE hdf5
#endif
......@@ -385,79 +386,10 @@ MODULE m_cdn_io
CALL openCDN_HDF(fileID,currentStarsIndex,currentLatharmsIndex,currentStructureIndex,&
currentStepfunctionIndex,readDensityIndex,lastDensityIndex)
l_storeIndices = .FALSE.
l_writeAll = .FALSE.
IF(currentStructureIndex.EQ.0) THEN
currentStructureIndex = 1
l_storeIndices = .TRUE.
CALL writeStructureHDF(fileID, input, atoms, cell, vacuum, oneD, currentStructureIndex)
ELSE
CALL readStructureHDF(fileID, inputTemp, atomsTemp, cellTemp, vacuumTemp, oneDTemp, currentStructureIndex)
l_writeNew = .FALSE.
IF(atoms%ntype.NE.atomsTemp%ntype) l_writeNew = .TRUE.
IF(atoms%nat.NE.atomsTemp%nat) l_writeNew = .TRUE.
IF(atoms%lmaxd.NE.atomsTemp%lmaxd) l_writeNew = .TRUE.
IF(atoms%jmtd.NE.atomsTemp%jmtd) l_writeNew = .TRUE.
IF(vacuum%dvac.NE.vacuumTemp%dvac) l_writeNew = .TRUE.
IF(ANY(ABS(cell%amat(:,:)-cellTemp%amat(:,:)).GT.1e-10)) l_writeNew = .TRUE.
IF(.NOT.l_writeNew) THEN
IF(ANY(atoms%nz(:).NE.atomsTemp%nz(:))) l_writeNew = .TRUE.
IF(ANY(atoms%lmax(:).NE.atomsTemp%lmax(:))) l_writeNew = .TRUE.
END IF
IF(.NOT.l_writeNew) THEN
DO i = 1, atoms%nat
IF(ANY(ABS(atoms%pos(:,i)-atomsTemp%pos(:,i)).GT.1e-10)) l_writeNew = .TRUE.
END DO
END IF
IF(l_writeNew) THEN
currentStructureIndex = currentStructureIndex + 1
l_storeIndices = .TRUE.
l_writeAll = .TRUE.
CALL writeStructureHDF(fileID, input, atoms, cell, vacuum, oneD, currentStructureIndex)
END IF
END IF
IF (currentStarsIndex.EQ.0) THEN
currentStarsIndex = 1
l_storeIndices = .TRUE.
CALL writeStarsHDF(fileID, currentStarsIndex, stars)
ELSE
CALL readStarsHDF(fileID, currentStarsIndex, starsTemp)
CALL compareStars(stars, starsTemp, l_same)
IF((.NOT.l_same).OR.l_writeAll) THEN
currentStarsIndex = currentStarsIndex + 1
l_storeIndices = .TRUE.
CALL writeStarsHDF(fileID, currentStarsIndex, stars)
END IF
END IF
IF (currentLatharmsIndex.EQ.0) THEN
currentLatharmsIndex = 1
l_storeIndices = .TRUE.
CALL writeLatharmsHDF(fileID, currentLatharmsIndex, sphhar)
ELSE
CALL readLatharmsHDF(fileID, currentLatharmsIndex, sphharTemp)
l_writeNew = .FALSE.
IF(sphhar%ntypsd.NE.sphharTemp%ntypsd) l_writeNew = .TRUE.
IF(sphhar%memd.NE.sphharTemp%memd) l_writeNew = .TRUE.
IF(sphhar%nlhd.NE.sphharTemp%nlhd) l_writeNew = .TRUE.
IF(l_writeNew.OR.l_writeAll) THEN
currentLatharmsIndex = currentLatharmsIndex + 1
l_storeIndices = .TRUE.
CALL writeLatharmsHDF(fileID, currentLatharmsIndex, sphhar)
END IF
END IF
IF(currentStepfunctionIndex.EQ.0) THEN
currentStepfunctionIndex = 1
l_storeIndices = .TRUE.
CALL writeStepfunctionHDF(fileID, currentStepfunctionIndex, currentStarsIndex, stars)
ELSE
CALL readStepfunctionHDF(fileID, currentStepfunctionIndex, starsTemp)
CALL compareStepfunctions(stars, starsTemp, l_same)
IF((.NOT.l_same).OR.l_writeAll) THEN
currentStepfunctionIndex = currentStepfunctionIndex + 1
l_storeIndices = .TRUE.
CALL writeStepfunctionHDF(fileID, currentStepfunctionIndex, currentStarsIndex, stars)
END IF
END IF
CALL checkAndWriteMetadataHDF(fileID, input, atoms, cell, vacuum, oneD, stars, sphhar, sym,&
currentStarsIndex,currentLatharmsIndex,currentStructureIndex,&
currentStepfunctionIndex,l_storeIndices)
previousDensityIndex = readDensityIndex
writeDensityIndex = readDensityIndex
IF(relCdnIndex.NE.0) THEN
......@@ -1019,24 +951,6 @@ MODULE m_cdn_io
END SUBROUTINE readStars
SUBROUTINE compareStars(stars, refStars, l_same)
TYPE(t_stars),INTENT(IN) :: stars
TYPE(t_stars),INTENT(IN) :: refStars
LOGICAL, INTENT(OUT) :: l_same
l_same = .TRUE.
IF(ABS(stars%gmaxInit-refStars%gmaxInit).GT.1e-10) l_same = .FALSE.
IF(stars%ng3.NE.refStars%ng3) l_same = .FALSE.
IF(stars%ng2.NE.refStars%ng2) l_same = .FALSE.
IF(stars%mx1.NE.refStars%mx1) l_same = .FALSE.
IF(stars%mx2.NE.refStars%mx2) l_same = .FALSE.
IF(stars%mx3.NE.refStars%mx3) l_same = .FALSE.
END SUBROUTINE compareStars
SUBROUTINE writeStepfunction(stars)
TYPE(t_stars),INTENT(IN) :: stars
......@@ -1158,22 +1072,6 @@ MODULE m_cdn_io
END SUBROUTINE readStepfunction
SUBROUTINE compareStepfunctions(stars, refStars, l_same)
TYPE(t_stars),INTENT(IN) :: stars
TYPE(t_stars),INTENT(IN) :: refStars
LOGICAL, INTENT(OUT) :: l_same
l_same = .TRUE.
IF(stars%ng3.NE.refStars%ng3) l_same = .FALSE.
IF(stars%mx1.NE.refStars%mx1) l_same = .FALSE.
IF(stars%mx2.NE.refStars%mx2) l_same = .FALSE.
IF(stars%mx3.NE.refStars%mx3) l_same = .FALSE.
END SUBROUTINE compareStepfunctions
SUBROUTINE setStartingDensity(l_noco)
LOGICAL,INTENT(IN) :: l_noco
......
!--------------------------------------------------------------------------------
! Copyright (c) 2017 Peter Grünberg Institut, Forschungszentrum Jülich, Germany
! This file is part of FLEUR and available as free software under the conditions
! of the MIT license as expressed in the LICENSE file in more detail.
!--------------------------------------------------------------------------------
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!
!!! This module contains common subroutines required for density IO
!!! as well as for potential IO
!!!
!!! GM'17
!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
MODULE m_cdnpot_io_common
USE m_types
USE m_juDFT
USE m_cdnpot_io_hdf
#ifdef CPP_HDF
USE hdf5
#endif
CONTAINS
SUBROUTINE compareStars(stars, refStars, l_same)
TYPE(t_stars),INTENT(IN) :: stars
TYPE(t_stars),INTENT(IN) :: refStars
LOGICAL, INTENT(OUT) :: l_same
l_same = .TRUE.
IF(ABS(stars%gmaxInit-refStars%gmaxInit).GT.1e-10) l_same = .FALSE.
IF(stars%ng3.NE.refStars%ng3) l_same = .FALSE.
IF(stars%ng2.NE.refStars%ng2) l_same = .FALSE.
IF(stars%mx1.NE.refStars%mx1) l_same = .FALSE.
IF(stars%mx2.NE.refStars%mx2) l_same = .FALSE.
IF(stars%mx3.NE.refStars%mx3) l_same = .FALSE.
END SUBROUTINE compareStars
SUBROUTINE compareStepfunctions(stars, refStars, l_same)
TYPE(t_stars),INTENT(IN) :: stars
TYPE(t_stars),INTENT(IN) :: refStars
LOGICAL, INTENT(OUT) :: l_same
l_same = .TRUE.
IF(stars%ng3.NE.refStars%ng3) l_same = .FALSE.
IF(stars%mx1.NE.refStars%mx1) l_same = .FALSE.
IF(stars%mx2.NE.refStars%mx2) l_same = .FALSE.
IF(stars%mx3.NE.refStars%mx3) l_same = .FALSE.
END SUBROUTINE compareStepfunctions
SUBROUTINE compareStructure(atoms, vacuum, cell, refAtoms, refVacuum,&
refCell, l_same)
TYPE(t_atoms),INTENT(IN) :: atoms, refAtoms
TYPE(t_vacuum),INTENT(IN) :: vacuum, refVacuum
TYPE(t_cell),INTENT(IN) :: cell, refCell
LOGICAL, INTENT(OUT) :: l_same
l_same = .TRUE.
IF(atoms%ntype.NE.refAtoms%ntype) l_same = .FALSE.
IF(atoms%nat.NE.refAtoms%nat) l_same = .FALSE.
IF(atoms%lmaxd.NE.refAtoms%lmaxd) l_same = .FALSE.
IF(atoms%jmtd.NE.refAtoms%jmtd) l_same = .FALSE.
IF(vacuum%dvac.NE.refVacuum%dvac) l_same = .FALSE.
IF(ANY(ABS(cell%amat(:,:)-refCell%amat(:,:)).GT.1e-10)) l_same = .FALSE.
IF(l_same) THEN
IF(ANY(atoms%nz(:).NE.refAtoms%nz(:))) l_same = .FALSE.
IF(ANY(atoms%lmax(:).NE.refAtoms%lmax(:))) l_same = .FALSE.
END IF
IF(l_same) THEN
DO i = 1, atoms%nat
IF(ANY(ABS(atoms%pos(:,i)-refAtoms%pos(:,i)).GT.1e-10)) l_same = .FALSE.
END DO
END IF
! NOTE: This subroutine certainly is not yet complete. Especially symmetry should
! also be stored and compared for structure considerations.
END SUBROUTINE compareStructure
SUBROUTINE compareLatharms(latharms, refLatharms, l_same)
TYPE(t_sphhar) :: latharms, refLatharms
LOGICAL, INTENT(OUT) :: l_same
l_same = .TRUE.
IF(latharms%ntypsd.NE.refLatharms%ntypsd) l_same = .FALSE.
IF(latharms%memd.NE.refLatharms%memd) l_same = .FALSE.
IF(latharms%nlhd.NE.refLatharms%nlhd) l_same = .FALSE.
END SUBROUTINE compareLatharms
#ifdef CPP_HDF
SUBROUTINE checkAndWriteMetadataHDF(fileID, input, atoms, cell, vacuum, oneD, stars, latharms, sym,&
currentStarsIndex,currentLatharmsIndex,currentStructureIndex,&
currentStepfunctionIndex,l_storeIndices)
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_stars),INTENT(IN) :: stars
TYPE(t_sphhar),INTENT(IN) :: latharms
TYPE(t_sym),INTENT(IN) :: sym
INTEGER(HID_T), INTENT(IN) :: fileID
INTEGER, INTENT(INOUT) :: currentStarsIndex,currentLatharmsIndex
INTEGER, INTENT(INOUT) :: currentStructureIndex,currentStepfunctionIndex
LOGICAL, INTENT(OUT) :: l_storeIndices
TYPE(t_stars) :: starsTemp
TYPE(t_vacuum) :: vacuumTemp
TYPE(t_atoms) :: atomsTemp
TYPE(t_sphhar) :: latharmsTemp
TYPE(t_input) :: inputTemp
TYPE(t_sym) :: symTemp
TYPE(t_cell) :: cellTemp
TYPE(t_oneD) :: oneDTemp
LOGICAL :: l_same, l_writeAll
l_storeIndices = .FALSE.
l_writeAll = .FALSE.
IF(currentStructureIndex.EQ.0) THEN
currentStructureIndex = 1
l_storeIndices = .TRUE.
CALL writeStructureHDF(fileID, input, atoms, cell, vacuum, oneD, currentStructureIndex)
ELSE
CALL readStructureHDF(fileID, inputTemp, atomsTemp, cellTemp, vacuumTemp, oneDTemp, currentStructureIndex)
CALL compareStructure(atoms, vacuum, cell, atomsTemp, vacuumTemp, cellTemp, l_same)
IF(.NOT.l_same) THEN
currentStructureIndex = currentStructureIndex + 1
l_storeIndices = .TRUE.
l_writeAll = .TRUE.
CALL writeStructureHDF(fileID, input, atoms, cell, vacuum, oneD, currentStructureIndex)
END IF
END IF
IF (currentStarsIndex.EQ.0) THEN
currentStarsIndex = 1
l_storeIndices = .TRUE.
CALL writeStarsHDF(fileID, currentStarsIndex, stars)
ELSE
CALL readStarsHDF(fileID, currentStarsIndex, starsTemp)
CALL compareStars(stars, starsTemp, l_same)
IF((.NOT.l_same).OR.l_writeAll) THEN
currentStarsIndex = currentStarsIndex + 1
l_storeIndices = .TRUE.
CALL writeStarsHDF(fileID, currentStarsIndex, stars)
END IF
END IF
IF (currentLatharmsIndex.EQ.0) THEN
currentLatharmsIndex = 1
l_storeIndices = .TRUE.
CALL writeLatharmsHDF(fileID, currentLatharmsIndex, latharms)
ELSE
CALL readLatharmsHDF(fileID, currentLatharmsIndex, latharmsTemp)
CALL compareLatharms(latharms, latharmsTemp, l_same)
IF((.NOT.l_same).OR.l_writeAll) THEN
currentLatharmsIndex = currentLatharmsIndex + 1
l_storeIndices = .TRUE.
CALL writeLatharmsHDF(fileID, currentLatharmsIndex, latharms)
END IF
END IF
IF(currentStepfunctionIndex.EQ.0) THEN
currentStepfunctionIndex = 1
l_storeIndices = .TRUE.
CALL writeStepfunctionHDF(fileID, currentStepfunctionIndex, currentStarsIndex, stars)
ELSE
CALL readStepfunctionHDF(fileID, currentStepfunctionIndex, starsTemp)
CALL compareStepfunctions(stars, starsTemp, l_same)
IF((.NOT.l_same).OR.l_writeAll) THEN
currentStepfunctionIndex = currentStepfunctionIndex + 1
l_storeIndices = .TRUE.
CALL writeStepfunctionHDF(fileID, currentStepfunctionIndex, currentStarsIndex, stars)
END IF
END IF
END SUBROUTINE checkAndWriteMetadataHDF
#endif
END MODULE m_cdnpot_io_common
......@@ -1289,11 +1289,14 @@ MODULE m_cdnpot_io_hdf
INTEGER :: ntype,jmtd,nmzd,nmzxyd,nlhd,ng3,ng2
INTEGER :: nmz, nvac, od_nq2, nmzxy
INTEGER :: hdfError
LOGICAL :: l_film, l_exist
LOGICAL :: l_film, l_exist, l_delete
INTEGER(HID_T) :: archiveID, groupID
CHARACTER(LEN=30) :: groupName, densityTypeName
INTEGER(HSIZE_T) :: dims(7)
INTEGER :: dimsInt(7)
INTEGER :: starsIndexTemp, latharmsIndexTemp
INTEGER :: structureIndexTemp, stepfunctionIndexTemp
INTEGER :: jspinsTemp
INTEGER(HID_T) :: frSpaceID, frSetID
INTEGER(HID_T) :: fpwSpaceID, fpwSetID
......@@ -1303,6 +1306,8 @@ MODULE m_cdnpot_io_hdf
INTEGER(HID_T) :: cdomvzSpaceID, cdomvzSetID
INTEGER(HID_T) :: cdomvxySpaceID, cdomvxySetID
WRITE(*,*) 'writeDensity - start'
WRITE(groupname,'(a,i0)') '/structure-', structureIndex
l_exist = io_groupexists(fileID,TRIM(ADJUSTL(groupName)))
IF(.NOT.l_exist) THEN
......@@ -1358,6 +1363,30 @@ MODULE m_cdnpot_io_hdf
groupName = TRIM(ADJUSTL(archiveName))//TRIM(ADJUSTL(densityTypeName))
l_delete = .FALSE.
IF(l_exist) THEN
CALL h5gopen_f(fileID, TRIM(ADJUSTL(archiveName)), archiveID, hdfError)
CALL io_read_attint0(archiveID,'starsIndex',starsIndexTemp)
CALL io_read_attint0(archiveID,'latharmsIndex',latharmsIndexTemp)
CALL io_read_attint0(archiveID,'structureIndex',structureIndexTemp)
CALL io_read_attint0(archiveID,'stepfunctionIndex',stepfunctionIndexTemp)
CALL io_read_attint0(archiveID,'spins',jspinsTemp)
IF (starsIndex.NE.starsIndexTemp) l_delete = .TRUE.
IF (latharmsIndex.NE.latharmsIndexTemp) l_delete = .TRUE.
IF (structureIndex.NE.structureIndexTemp) l_delete = .TRUE.
IF (stepfunctionIndex.NE.stepfunctionIndexTemp) l_delete = .TRUE.
IF (input%jspins.NE.jspinsTemp) l_delete = .TRUE.
CALL h5gclose_f(archiveID, hdfError)
END IF
IF(l_delete) THEN
CALL h5ldelete_f(fileID, archiveName, hdfError)
l_exist = .FALSE.
END IF
IF(l_exist) THEN
CALL h5gopen_f(fileID, TRIM(ADJUSTL(archiveName)), archiveID, hdfError)
......@@ -1586,6 +1615,8 @@ MODULE m_cdnpot_io_hdf
CALL h5gclose_f(archiveID, hdfError)
END IF
WRITE(*,*) 'writeDensity - end'
END SUBROUTINE writeDensityHDF
SUBROUTINE writePotentialHDF(input, fileID, archiveName, potentialType,&
......@@ -1609,17 +1640,23 @@ MODULE m_cdnpot_io_hdf
INTEGER :: ntype,jmtd,nmzd,nmzxyd,nlhd,ng3,ng2
INTEGER :: nmz, nvac, od_nq2, nmzxy
INTEGER :: hdfError
LOGICAL :: l_film, l_exist
LOGICAL :: l_film, l_exist, l_delete
INTEGER(HID_T) :: archiveID, groupID
CHARACTER(LEN=30) :: groupName, potentialTypeName
INTEGER(HSIZE_T) :: dims(7)
INTEGER :: dimsInt(7)
INTEGER :: starsIndexTemp, latharmsIndexTemp
INTEGER :: structureIndexTemp, stepfunctionIndexTemp
INTEGER :: jspinsTemp
INTEGER(HID_T) :: frSpaceID, frSetID
INTEGER(HID_T) :: fpwSpaceID, fpwSetID
INTEGER(HID_T) :: fzSpaceID, fzSetID
INTEGER(HID_T) :: fzxySpaceID, fzxySetID
WRITE(*,*) 'writePotential - start'
WRITE(groupname,'(a,i0)') '/structure-', structureIndex
l_exist = io_groupexists(fileID,TRIM(ADJUSTL(groupName)))
IF(.NOT.l_exist) THEN
......@@ -1669,6 +1706,30 @@ MODULE m_cdnpot_io_hdf
groupName = TRIM(ADJUSTL(archiveName))//TRIM(ADJUSTL(potentialTypeName))
l_delete = .FALSE.
IF(l_exist) THEN
CALL h5gopen_f(fileID, TRIM(ADJUSTL(archiveName)), archiveID, hdfError)
CALL io_read_attint0(archiveID,'starsIndex',starsIndexTemp)
CALL io_read_attint0(archiveID,'latharmsIndex',latharmsIndexTemp)
CALL io_read_attint0(archiveID,'structureIndex',structureIndexTemp)
CALL io_read_attint0(archiveID,'stepfunctionIndex',stepfunctionIndexTemp)
CALL io_read_attint0(archiveID,'spins',jspinsTemp)
IF (starsIndex.NE.starsIndexTemp) l_delete = .TRUE.
IF (latharmsIndex.NE.latharmsIndexTemp) l_delete = .TRUE.
IF (structureIndex.NE.structureIndexTemp) l_delete = .TRUE.
IF (stepfunctionIndex.NE.stepfunctionIndexTemp) l_delete = .TRUE.
IF (input%jspins.NE.jspinsTemp) l_delete = .TRUE.
CALL h5gclose_f(archiveID, hdfError)
END IF
IF(l_delete) THEN
CALL h5ldelete_f(fileID, archiveName, hdfError)
l_exist = .FALSE.
END IF
IF(l_exist) THEN
CALL h5gopen_f(fileID, TRIM(ADJUSTL(archiveName)), archiveID, hdfError)
......@@ -1799,6 +1860,8 @@ MODULE m_cdnpot_io_hdf
CALL h5gclose_f(archiveID, hdfError)
END IF
WRITE(*,*) 'writePotential - end'
END SUBROUTINE writePotentialHDF
SUBROUTINE readDensityHDF(fileID, input, stars, latharms, atoms, vacuum, oneD,&
......@@ -1857,6 +1920,8 @@ MODULE m_cdnpot_io_hdf
cdomvz = CMPLX(0.0,0.0)
cdomvxy = CMPLX(0.0,0.0)
WRITE(*,*) 'readDensity - start'
l_exist = io_groupexists(fileID,TRIM(ADJUSTL(archiveName)))
IF(.NOT.l_exist) THEN
CALL juDFT_error('density archive '//TRIM(ADJUSTL(archiveName))//' does not exist.' ,calledby ="readDensityHDF")
......@@ -2050,6 +2115,8 @@ MODULE m_cdnpot_io_hdf
CALL h5gclose_f(groupID, hdfError)
CALL h5gclose_f(archiveID, hdfError)
WRITE(*,*) 'readDensity - end'
END SUBROUTINE readDensityHDF
SUBROUTINE readPotentialHDF(fileID, archiveName, potentialType,&
......@@ -2081,6 +2148,7 @@ MODULE m_cdnpot_io_hdf
INTEGER(HID_T) :: fzSetID
INTEGER(HID_T) :: fzxySetID
WRITE(*,*) 'readPotential - start'
l_exist = io_groupexists(fileID,TRIM(ADJUSTL(archiveName)))
IF(.NOT.l_exist) THEN
......@@ -2173,6 +2241,8 @@ MODULE m_cdnpot_io_hdf
CALL h5gclose_f(groupID, hdfError)
CALL h5gclose_f(archiveID, hdfError)
WRITE(*,*) 'readPotential - end'
END SUBROUTINE readPotentialHDF
......@@ -2280,6 +2350,8 @@ MODULE m_cdnpot_io_hdf
INTEGER(HSIZE_T) :: dims(7)
INTEGER :: dimsInt(7)
WRITE(*,*) 'writeCoreDensity - start'
l_exist = io_groupexists(fileID,'/cdnc')
IF(l_exist) THEN ! replace current core density
......@@ -2339,6 +2411,8 @@ MODULE m_cdnpot_io_hdf
CALL h5gclose_f(cdncGroupID, hdfError)
END IF
WRITE(*,*) 'writeCoreDensity - end'
END SUBROUTINE writeCoreDensityHDF
SUBROUTINE readCoreDensityHDF(fileID,input,atoms,dimension,rhcs,tecs,qints)
......@@ -2358,6 +2432,8 @@ MODULE m_cdnpot_io_hdf
LOGICAL l_exist
INTEGER :: dimsInt(7)
WRITE(*,*) 'readCoreDensity - start'
l_exist = io_groupexists(fileID,'/cdnc')
IF(.NOT.l_exist) THEN
CALL juDFT_error("no core density found",calledby ="readCoreDensityHDF")
......@@ -2390,6 +2466,8 @@ MODULE m_cdnpot_io_hdf
CALL h5gclose_f(cdncGroupID, hdfError)
WRITE(*,*) 'readCoreDensity - end'
END SUBROUTINE readCoreDensityHDF
LOGICAL FUNCTION deleteDensityEntryHDF(fileID,archiveName)
......
!--------------------------------------------------------------------------------
! Copyright (c) 2016 Peter Grünberg Institut, Forschungszentrum Jülich, Germany
! Copyright (c) 2017 Peter Grünberg Institut, Forschungszentrum Jülich, Germany
! This file is part of FLEUR and available as free software under the conditions
! of the MIT license as expressed in the LICENSE file in more detail.
!--------------------------------------------------------------------------------
......@@ -19,6 +19,7 @@ MODULE m_pot_io
USE m_loddop
USE m_wrtdop
USE m_cdnpot_io_hdf
USE m_cdnpot_io_common
#ifdef CPP_HDF
USE hdf5
#endif
......@@ -200,27 +201,9 @@ MODULE m_pot_io
CALL openPOT_HDF(fileID,currentStarsIndex,currentLatharmsIndex,&
currentStructureIndex,currentStepfunctionIndex)
l_storeIndices = .FALSE.
IF (currentStarsIndex.EQ.0) THEN
currentStarsIndex = 1
l_storeIndices = .TRUE.
CALL writeStarsHDF(fileID, currentStarsIndex, stars)
END IF
IF (currentLatharmsIndex.EQ.0) THEN
currentLatharmsIndex = 1
l_storeIndices = .TRUE.
CALL writeLatharmsHDF(fileID, currentLatharmsIndex, sphhar)
END IF
IF(currentStructureIndex.EQ.0) THEN
currentStructureIndex = 1
l_storeIndices = .TRUE.
CALL writeStructureHDF(fileID, input, atoms, cell, vacuum, oneD, currentStructureIndex)
END IF
IF(currentStepfunctionIndex.EQ.0) THEN
currentStepfunctionIndex = 1
l_storeIndices = .TRUE.
CALL writeStepfunctionHDF(fileID, currentStepfunctionIndex, currentStarsIndex, stars)
END IF
CALL checkAndWriteMetadataHDF(fileID, input, atoms, cell, vacuum, oneD, stars, sphhar, sym,&
currentStarsIndex,currentLatharmsIndex,currentStructureIndex,&
currentStepfunctionIndex,l_storeIndices)
archiveName = 'illegalPotentialArchive'
IF (archiveType.EQ.POT_ARCHIVE_TYPE_TOT_const) THEN
......
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