Commit 583d77fa authored by Gregor Michalicek's avatar Gregor Michalicek

Introduce fermiEnergy and l_qfix to cdn.hdf file

Also in this commit: Fixed a few problems due to the last
commit introducing init/checks.F90. There are still problems
remaining. The code does not compile at the moment.
parent 8b972f92
...@@ -30,6 +30,7 @@ init/tetcon.f ...@@ -30,6 +30,7 @@ init/tetcon.f
set(fleur_F90 ${fleur_F90} set(fleur_F90 ${fleur_F90}
init/compile_descr.F90 init/compile_descr.F90
init/apws_dim.f90 init/apws_dim.f90
init/checks.F90
init/dimen7.F90 init/dimen7.F90
init/dimens.F90 init/dimens.F90
init/efield.f90 init/efield.f90
......
...@@ -12,7 +12,7 @@ MODULE m_checks ...@@ -12,7 +12,7 @@ MODULE m_checks
IMPLICIT NONE IMPLICIT NONE
#ifdef CPP_MPI #ifdef CPP_MPI
INCLUDE 'mpif.h' INCLUDE 'mpif.h'
INTEGER:: isize,ierr INTEGER:: isize,ierr,irank
#endif #endif
IF (juDFT_was_argument("-hdf")) THEN IF (juDFT_was_argument("-hdf")) THEN
#ifndef CPP_HDF #ifndef CPP_HDF
......
...@@ -47,7 +47,7 @@ MODULE m_cdn_io ...@@ -47,7 +47,7 @@ MODULE m_cdn_io
CONTAINS CONTAINS
SUBROUTINE readDensity(stars,vacuum,atoms,sphhar,input,sym,oneD,archiveType,inOrOutCDN,& SUBROUTINE readDensity(stars,vacuum,atoms,sphhar,input,sym,oneD,archiveType,inOrOutCDN,&
relCdnIndex,iter,fr,fpw,fz,fzxy,cdom,cdomvz,cdomvxy) relCdnIndex,fermiEnergy,l_qfix,iter,fr,fpw,fz,fzxy,cdom,cdomvz,cdomvxy)
TYPE(t_stars),INTENT(IN) :: stars TYPE(t_stars),INTENT(IN) :: stars
TYPE(t_vacuum),INTENT(IN) :: vacuum TYPE(t_vacuum),INTENT(IN) :: vacuum
...@@ -61,6 +61,8 @@ MODULE m_cdn_io ...@@ -61,6 +61,8 @@ MODULE m_cdn_io
INTEGER, INTENT (IN) :: relCdnIndex INTEGER, INTENT (IN) :: relCdnIndex
INTEGER, INTENT (OUT) :: iter INTEGER, INTENT (OUT) :: iter
INTEGER, INTENT (IN) :: archiveType INTEGER, INTENT (IN) :: archiveType
REAL, INTENT (OUT) :: fermiEnergy
LOGICAL, INTENT (OUT) :: l_qfix
! .. ! ..
! .. Array Arguments .. ! .. Array Arguments ..
...@@ -83,6 +85,10 @@ MODULE m_cdn_io ...@@ -83,6 +85,10 @@ MODULE m_cdn_io
CHARACTER(LEN=30) :: archiveName CHARACTER(LEN=30) :: archiveName
TYPE(t_cell) :: cellTemp TYPE(t_cell) :: cellTemp
fermiEnergy = 0.0
l_qfix = .FALSE.
WRITE(*,*) 'fermiEnergy and l_qfix set to default values in readDensity!'
CALL getMode(mode) CALL getMode(mode)
IF(mode.EQ.CDN_HDF5_MODE) THEN IF(mode.EQ.CDN_HDF5_MODE) THEN
...@@ -117,7 +123,7 @@ MODULE m_cdn_io ...@@ -117,7 +123,7 @@ MODULE m_cdn_io
END IF END IF
CASE DEFAULT CASE DEFAULT
WRITE(*,*) 'inOrOutCDN = ', inOrOutCDN WRITE(*,*) 'inOrOutCDN = ', inOrOutCDN
CALL juDFT_error("Invalid inOrOutCDN selected.",calledby ="writeDensity") CALL juDFT_error("Invalid inOrOutCDN selected.",calledby ="readDensity")
END SELECT END SELECT
l_exist = isDensityEntryPresentHDF(fileID,archiveName,densityType) l_exist = isDensityEntryPresentHDF(fileID,archiveName,densityType)
CALL closeCDN_HDF(fileID) CALL closeCDN_HDF(fileID)
...@@ -128,7 +134,7 @@ MODULE m_cdn_io ...@@ -128,7 +134,7 @@ MODULE m_cdn_io
readDensityIndex,lastDensityIndex) readDensityIndex,lastDensityIndex)
CALL readDensityHDF(fileID, archiveName, densityType,& CALL readDensityHDF(fileID, archiveName, densityType,&
iter,fr,fpw,fz,fzxy,cdom,cdomvz,cdomvxy) fermiEnergy,l_qfix,iter,fr,fpw,fz,fzxy,cdom,cdomvz,cdomvxy)
CALL closeCDN_HDF(fileID) CALL closeCDN_HDF(fileID)
RETURN RETURN
...@@ -222,7 +228,7 @@ MODULE m_cdn_io ...@@ -222,7 +228,7 @@ MODULE m_cdn_io
END SUBROUTINE readDensity END SUBROUTINE readDensity
SUBROUTINE writeDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,inOrOutCDN,& SUBROUTINE writeDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,inOrOutCDN,&
relCdnIndex,iter,fr,fpw,fz,fzxy,cdom,cdomvz,cdomvxy) relCdnIndex,fermiEnergy,l_qfix,iter,fr,fpw,fz,fzxy,cdom,cdomvz,cdomvxy)
TYPE(t_stars),INTENT(IN) :: stars TYPE(t_stars),INTENT(IN) :: stars
TYPE(t_vacuum),INTENT(IN) :: vacuum TYPE(t_vacuum),INTENT(IN) :: vacuum
...@@ -236,6 +242,8 @@ MODULE m_cdn_io ...@@ -236,6 +242,8 @@ MODULE m_cdn_io
INTEGER, INTENT (IN) :: inOrOutCDN INTEGER, INTENT (IN) :: inOrOutCDN
INTEGER, INTENT (IN) :: relCdnIndex, iter INTEGER, INTENT (IN) :: relCdnIndex, iter
INTEGER, INTENT (IN) :: archiveType INTEGER, INTENT (IN) :: archiveType
REAL, INTENT (IN) :: fermiEnergy
LOGICAL, INTENT (IN) :: l_qfix
! .. ! ..
! .. Array Arguments .. ! .. Array Arguments ..
COMPLEX, INTENT (IN) :: fpw(stars%ng3,input%jspins), fzxy(vacuum%nmzxyd,stars%ng2-1,2,input%jspins) COMPLEX, INTENT (IN) :: fpw(stars%ng3,input%jspins), fzxy(vacuum%nmzxyd,stars%ng2-1,2,input%jspins)
...@@ -267,6 +275,8 @@ MODULE m_cdn_io ...@@ -267,6 +275,8 @@ MODULE m_cdn_io
INTEGER :: previousDensityIndex, densityType INTEGER :: previousDensityIndex, densityType
INTEGER :: starsIndexTemp, latharmsIndexTemp, structureIndexTemp INTEGER :: starsIndexTemp, latharmsIndexTemp, structureIndexTemp
INTEGER :: jspinsTemp INTEGER :: jspinsTemp
REAL :: fermiEnergyTemp
LOGICAL :: l_qfixTemp
CHARACTER(LEN=30) :: archiveName CHARACTER(LEN=30) :: archiveName
CALL getMode(mode) CALL getMode(mode)
...@@ -332,13 +342,13 @@ MODULE m_cdn_io ...@@ -332,13 +342,13 @@ MODULE m_cdn_io
IF(l_exist) THEN IF(l_exist) THEN
CALL peekDensityEntryHDF(fileID, archiveName, DENSITY_TYPE_UNDEFINED_const,& CALL peekDensityEntryHDF(fileID, archiveName, DENSITY_TYPE_UNDEFINED_const,&
iterTemp, starsIndexTemp, latharmsIndexTemp, structureIndexTemp,& iterTemp, starsIndexTemp, latharmsIndexTemp, structureIndexTemp,&
previousDensityIndex, jspinsTemp) previousDensityIndex, jspinsTemp, fermiEnergyTemp, l_qfixTemp)
END IF END IF
END IF END IF
CALL writeDensityHDF(input, fileID, archiveName, densityType, previousDensityIndex,& CALL writeDensityHDF(input, fileID, archiveName, densityType, previousDensityIndex,&
currentStarsIndex, currentLatharmsIndex, currentStructureIndex,& currentStarsIndex, currentLatharmsIndex, currentStructureIndex,&
iter+relCdnIndex,fr,fpw,fz,fzxy,cdom,cdomvz,cdomvxy) fermiEnergy,l_qfix,iter+relCdnIndex,fr,fpw,fz,fzxy,cdom,cdomvz,cdomvxy)
IF(l_storeIndices) THEN IF(l_storeIndices) THEN
CALL writeHeaderData(fileID,currentStarsIndex,currentLatharmsIndex,& CALL writeHeaderData(fileID,currentStarsIndex,currentLatharmsIndex,&
......
...@@ -1033,15 +1033,17 @@ MODULE m_cdnpot_io_hdf ...@@ -1033,15 +1033,17 @@ MODULE m_cdnpot_io_hdf
SUBROUTINE writeDensityHDF(input, fileID, archiveName, densityType, previousDensityIndex,& SUBROUTINE writeDensityHDF(input, fileID, archiveName, densityType, previousDensityIndex,&
starsIndex, latharmsIndex, structureIndex,& starsIndex, latharmsIndex, structureIndex,&
iter,fr,fpw,fz,fzxy,cdom,cdomvz,cdomvxy) fermiEnergy,l_qfix,iter,fr,fpw,fz,fzxy,cdom,cdomvz,cdomvxy)
TYPE(t_input), INTENT(IN) :: input TYPE(t_input), INTENT(IN) :: input
INTEGER(HID_T), INTENT(IN) :: fileID INTEGER(HID_T), INTENT(IN) :: fileID
INTEGER, INTENT(IN) :: densityType, previousDensityIndex INTEGER, INTENT(IN) :: densityType, previousDensityIndex
INTEGER, INTENT(IN) :: starsIndex, latharmsIndex, structureIndex INTEGER, INTENT(IN) :: starsIndex, latharmsIndex, structureIndex
CHARACTER(LEN=*), INTENT(IN) :: archiveName CHARACTER(LEN=*), INTENT(IN) :: archiveName
INTEGER, INTENT (IN) :: iter INTEGER, INTENT (IN) :: iter
REAL, INTENT (IN) :: fermiEnergy
LOGICAL, INTENT (IN) :: l_qfix
REAL, INTENT (IN) :: fr(:,:,:,:) REAL, INTENT (IN) :: fr(:,:,:,:)
REAL, INTENT (IN) :: fz(:,:,:) REAL, INTENT (IN) :: fz(:,:,:)
...@@ -1058,13 +1060,13 @@ MODULE m_cdnpot_io_hdf ...@@ -1058,13 +1060,13 @@ MODULE m_cdnpot_io_hdf
INTEGER(HSIZE_T) :: dims(7) INTEGER(HSIZE_T) :: dims(7)
INTEGER :: dimsInt(7) INTEGER :: dimsInt(7)
INTEGER(HID_T) :: frSpaceID, frSetID INTEGER(HID_T) :: frSpaceID, frSetID
INTEGER(HID_T) :: fpwSpaceID, fpwSetID INTEGER(HID_T) :: fpwSpaceID, fpwSetID
INTEGER(HID_T) :: fzSpaceID, fzSetID INTEGER(HID_T) :: fzSpaceID, fzSetID
INTEGER(HID_T) :: fzxySpaceID, fzxySetID INTEGER(HID_T) :: fzxySpaceID, fzxySetID
INTEGER(HID_T) :: cdomSpaceID, cdomSetID INTEGER(HID_T) :: cdomSpaceID, cdomSetID
INTEGER(HID_T) :: cdomvzSpaceID, cdomvzSetID INTEGER(HID_T) :: cdomvzSpaceID, cdomvzSetID
INTEGER(HID_T) :: cdomvxySpaceID, cdomvxySetID INTEGER(HID_T) :: cdomvxySpaceID, cdomvxySetID
WRITE(groupname,'(a,i0)') '/structure-', structureIndex WRITE(groupname,'(a,i0)') '/structure-', structureIndex
l_exist = io_groupexists(fileID,TRIM(ADJUSTL(groupName))) l_exist = io_groupexists(fileID,TRIM(ADJUSTL(groupName)))
...@@ -1136,6 +1138,9 @@ MODULE m_cdnpot_io_hdf ...@@ -1136,6 +1138,9 @@ MODULE m_cdnpot_io_hdf
IF(l_exist) THEN IF(l_exist) THEN
CALL h5gopen_f(fileID, TRIM(ADJUSTL(groupName)), groupID, hdfError) CALL h5gopen_f(fileID, TRIM(ADJUSTL(groupName)), groupID, hdfError)
CALL io_write_attreal0(groupID,'fermiEnergy',fermiEnergy)
CALL io_write_attlog0(groupID,'l_qfix',l_qfix)
dimsInt(:4)=(/jmtd,nlhd+1,ntype,input%jspins/) dimsInt(:4)=(/jmtd,nlhd+1,ntype,input%jspins/)
CALL h5dopen_f(groupID, 'fr', frSetID, hdfError) CALL h5dopen_f(groupID, 'fr', frSetID, hdfError)
CALL io_write_real4(frSetID,(/1,1,1,1/),dimsInt(:4),fr) CALL io_write_real4(frSetID,(/1,1,1,1/),dimsInt(:4),fr)
...@@ -1183,6 +1188,9 @@ MODULE m_cdnpot_io_hdf ...@@ -1183,6 +1188,9 @@ MODULE m_cdnpot_io_hdf
ELSE ELSE
CALL h5gcreate_f(fileID, TRIM(ADJUSTL(groupName)), groupID, hdfError) CALL h5gcreate_f(fileID, TRIM(ADJUSTL(groupName)), groupID, hdfError)
CALL io_write_attreal0(groupID,'fermiEnergy',fermiEnergy)
CALL io_write_attlog0(groupID,'l_qfix',l_qfix)
dims(:4)=(/jmtd,nlhd+1,ntype,input%jspins/) dims(:4)=(/jmtd,nlhd+1,ntype,input%jspins/)
dimsInt = dims dimsInt = dims
CALL h5screate_simple_f(4,dims(:4),frSpaceID,hdfError) CALL h5screate_simple_f(4,dims(:4),frSpaceID,hdfError)
...@@ -1263,6 +1271,9 @@ MODULE m_cdnpot_io_hdf ...@@ -1263,6 +1271,9 @@ MODULE m_cdnpot_io_hdf
CALL h5gcreate_f(fileID, TRIM(ADJUSTL(groupName)), groupID, hdfError) CALL h5gcreate_f(fileID, TRIM(ADJUSTL(groupName)), groupID, hdfError)
CALL io_write_attreal0(groupID,'fermiEnergy',fermiEnergy)
CALL io_write_attlog0(groupID,'l_qfix',l_qfix)
dims(:4)=(/jmtd,nlhd+1,ntype,input%jspins/) dims(:4)=(/jmtd,nlhd+1,ntype,input%jspins/)
dimsInt = dims dimsInt = dims
CALL h5screate_simple_f(4,dims(:4),frSpaceID,hdfError) CALL h5screate_simple_f(4,dims(:4),frSpaceID,hdfError)
...@@ -1335,13 +1346,15 @@ MODULE m_cdnpot_io_hdf ...@@ -1335,13 +1346,15 @@ MODULE m_cdnpot_io_hdf
END SUBROUTINE writeDensityHDF END SUBROUTINE writeDensityHDF
SUBROUTINE readDensityHDF(fileID, archiveName, densityType,& SUBROUTINE readDensityHDF(fileID, archiveName, densityType,&
iter,fr,fpw,fz,fzxy,cdom,cdomvz,cdomvxy) fermiEnergy,l_qfix,iter,fr,fpw,fz,fzxy,cdom,cdomvz,cdomvxy)
INTEGER(HID_T), INTENT(IN) :: fileID INTEGER(HID_T), INTENT(IN) :: fileID
INTEGER, INTENT(IN) :: densityType INTEGER, INTENT(IN) :: densityType
CHARACTER(LEN=*), INTENT(IN) :: archiveName CHARACTER(LEN=*), INTENT(IN) :: archiveName
INTEGER, INTENT (OUT) :: iter INTEGER, INTENT (OUT) :: iter
REAL, INTENT (OUT) :: fermiEnergy
LOGICAL, INTENT (OUT) :: l_qfix
REAL, INTENT (OUT) :: fr(:,:,:,:) REAL, INTENT (OUT) :: fr(:,:,:,:)
REAL, INTENT (OUT) :: fz(:,:,:) REAL, INTENT (OUT) :: fz(:,:,:)
...@@ -1453,6 +1466,9 @@ MODULE m_cdnpot_io_hdf ...@@ -1453,6 +1466,9 @@ MODULE m_cdnpot_io_hdf
CALL io_read_attint0(groupBID,'ng2',ng2) CALL io_read_attint0(groupBID,'ng2',ng2)
CALL h5gclose_f(groupBID, hdfError) CALL h5gclose_f(groupBID, hdfError)
CALL io_read_attreal0(groupID,'fermiEnergy',fermiEnergy)
CALL io_read_attlog0(groupID,'l_qfix',l_qfix)
dimsInt(:4)=(/jmtd,nlhd+1,ntype,jspins/) dimsInt(:4)=(/jmtd,nlhd+1,ntype,jspins/)
CALL h5dopen_f(groupID, 'fr', frSetID, hdfError) CALL h5dopen_f(groupID, 'fr', frSetID, hdfError)
CALL io_read_real4(frSetID,(/1,1,1,1/),dimsInt(:4),fr) CALL io_read_real4(frSetID,(/1,1,1,1/),dimsInt(:4),fr)
...@@ -1503,15 +1519,18 @@ MODULE m_cdnpot_io_hdf ...@@ -1503,15 +1519,18 @@ MODULE m_cdnpot_io_hdf
SUBROUTINE peekDensityEntryHDF(fileID, archiveName, densityType,& SUBROUTINE peekDensityEntryHDF(fileID, archiveName, densityType,&
iter, starsIndex, latharmsIndex, structureIndex,& iter, starsIndex, latharmsIndex, structureIndex,&
previousDensityIndex, jspins) previousDensityIndex, jspins,&
fermiEnergy, l_qfix)
INTEGER(HID_T), INTENT(IN) :: fileID INTEGER(HID_T), INTENT(IN) :: fileID
INTEGER, INTENT(IN) :: densityType INTEGER, INTENT(IN) :: densityType
CHARACTER(LEN=*), INTENT(IN) :: archiveName CHARACTER(LEN=*), INTENT(IN) :: archiveName
INTEGER, INTENT (OUT) :: iter INTEGER, INTENT(OUT) :: iter
INTEGER,INTENT(OUT) :: starsIndex, latharmsIndex, structureIndex INTEGER, INTENT(OUT) :: starsIndex, latharmsIndex, structureIndex
INTEGER,INTENT(OUT) :: previousDensityIndex, jspins INTEGER, INTENT(OUT) :: previousDensityIndex, jspins
REAL, INTENT(OUT) :: fermiEnergy
LOGICAL, INTENT(OUT) :: l_qfix
INTEGER :: localDensityType INTEGER :: localDensityType
LOGICAL :: l_exist LOGICAL :: l_exist
...@@ -1570,6 +1589,11 @@ MODULE m_cdnpot_io_hdf ...@@ -1570,6 +1589,11 @@ MODULE m_cdnpot_io_hdf
CALL io_read_attint0(archiveID,'spins',jspins) CALL io_read_attint0(archiveID,'spins',jspins)
CALL io_read_attint0(archiveID,'iter',iter) CALL io_read_attint0(archiveID,'iter',iter)
IF (densityType.NE.DENSITY_TYPE_UNDEFINED_const) THEN
CALL io_read_attreal0(groupID,'fermiEnergy',fermiEnergy)
CALL io_read_attlog0(groupID,'l_qfix',l_qfix)
END IF
CALL h5gclose_f(groupID, hdfError) CALL h5gclose_f(groupID, hdfError)
CALL h5gclose_f(archiveID, hdfError) CALL h5gclose_f(archiveID, hdfError)
......
...@@ -91,7 +91,8 @@ ...@@ -91,7 +91,8 @@
!***************************************************************** !*****************************************************************
SUBROUTINE io_write_attlog0(did,name,DATA) SUBROUTINE io_write_attlog0(did,name,DATA)
!***************************************************************** !*****************************************************************
USE hdf5 USE hdf5
USE m_hdf_tools3 !This is for the subroutine io_attexists
IMPLICIT NONE IMPLICIT NONE
INTEGER(HID_T),INTENT(IN) ::did INTEGER(HID_T),INTENT(IN) ::did
...@@ -100,18 +101,27 @@ ...@@ -100,18 +101,27 @@
!locals !locals
INTEGER(HSIZE_T)::dims(7) INTEGER(HSIZE_T)::dims(7)
INTEGER(HID_t)::atid,sid INTEGER(HID_t)::atid,sid
INTEGER ::hdferr,dum INTEGER ::hdferr,dum
LOGICAL ::l_exist
l_exist = io_attexists(did,name)
dims=(/1,0,0,0,0,0,0/) dims=(/1,0,0,0,0,0,0/)
IF (DATA) THEN IF (DATA) THEN
dum=1 dum=1
ELSE ELSE
dum=0 dum=0
ENDIF ENDIF
CALL h5screate_simple_f(1,dims,sid,hdferr) IF(l_exist) THEN
CALL h5acreate_f(did, name,H5T_NATIVE_INTEGER,sid,atid,hdferr) CALL h5aopen_f(did,name,atid,hdferr)
CALL h5awrite_f(atid,H5T_NATIVE_INTEGER,dum,dims, hdferr) CALL h5awrite_f(atid,H5T_NATIVE_INTEGER,dum,dims, hdferr)
CALL h5aclose_f(atid,hdferr) CALL h5aclose_f(atid,hdferr)
CALL h5sclose_f(sid,hdferr) ELSE
CALL h5screate_simple_f(1,dims,sid,hdferr)
CALL h5acreate_f(did, name,H5T_NATIVE_INTEGER,sid,atid,hdferr)
CALL h5awrite_f(atid,H5T_NATIVE_INTEGER,dum,dims, hdferr)
CALL h5aclose_f(atid,hdferr)
CALL h5sclose_f(sid,hdferr)
END IF
CALL io_check('io_write_attlog0'//name,hdferr) CALL io_check('io_write_attlog0'//name,hdferr)
END SUBROUTINE END SUBROUTINE
!***************************************************************** !*****************************************************************
...@@ -158,7 +168,8 @@ ...@@ -158,7 +168,8 @@
!***************************************************************** !*****************************************************************
SUBROUTINE io_write_attreal1(did,name,DATA) SUBROUTINE io_write_attreal1(did,name,DATA)
!***************************************************************** !*****************************************************************
USE hdf5 USE hdf5
USE m_hdf_tools3 !This is for the subroutine io_attexists
IMPLICIT NONE IMPLICIT NONE
INTEGER(HID_T),INTENT(IN) ::did INTEGER(HID_T),INTENT(IN) ::did
...@@ -167,13 +178,22 @@ ...@@ -167,13 +178,22 @@
!locals !locals
INTEGER(HSIZE_T)::dims(7) INTEGER(HSIZE_T)::dims(7)
INTEGER(HID_t)::atid,sid INTEGER(HID_t)::atid,sid
INTEGER ::hdferr INTEGER ::hdferr
dims=(/SIZE(DATA),0,0,0,0,0,0/) LOGICAL ::l_exist
CALL h5screate_simple_f(1,dims,sid,hdferr)
CALL h5acreate_f(did, name,H5T_NATIVE_DOUBLE,sid,atid,hdferr) l_exist = io_attexists(did,name)
CALL h5awrite_f(atid,H5T_NATIVE_DOUBLE,DATA,dims, hdferr) dims=(/SIZE(DATA),0,0,0,0,0,0/)
CALL h5aclose_f(atid,hdferr) IF(l_exist) THEN
CALL h5sclose_f(sid,hdferr) CALL h5aopen_f(did,name,atid,hdferr)
CALL h5awrite_f(atid,H5T_NATIVE_DOUBLE,DATA,dims, hdferr)
CALL h5aclose_f(atid,hdferr)
ELSE
CALL h5screate_simple_f(1,dims,sid,hdferr)
CALL h5acreate_f(did, name,H5T_NATIVE_DOUBLE,sid,atid,hdferr)
CALL h5awrite_f(atid,H5T_NATIVE_DOUBLE,DATA,dims, hdferr)
CALL h5aclose_f(atid,hdferr)
CALL h5sclose_f(sid,hdferr)
END IF
CALL io_check('io_write_attreal1'//name,hdferr) CALL io_check('io_write_attreal1'//name,hdferr)
END SUBROUTINE END SUBROUTINE
!***************************************************************** !*****************************************************************
......
...@@ -58,10 +58,10 @@ ...@@ -58,10 +58,10 @@
! .. ! ..
! .. Local Scalars .. ! .. Local Scalars ..
REAL fix,qtot,scor,seig,smom,stot,sval,dummy REAL fix,qtot,scor,seig,smom,stot,sval,dummy
REAL slmom,slxmom,slymom,sum,thetai,phii REAL slmom,slxmom,slymom,sum,thetai,phii,fermiEnergyTemp
INTEGER iter,ivac,j,jspin,jspmax,k,n,nt,ieig,ikpt INTEGER iter,ivac,j,jspin,jspmax,k,n,nt,ieig,ikpt
INTEGER ityp,ilayer,urec,itype,iatom,archiveType INTEGER ityp,ilayer,urec,itype,iatom,archiveType
LOGICAL l_relax_any,exst,n_exist,l_st LOGICAL l_relax_any,exst,n_exist,l_st,l_qfix
TYPE(t_noco)::noco_new TYPE(t_noco)::noco_new
! .. ! ..
! .. Local Arrays .. ! .. Local Arrays ..
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
IF((.NOT.noco%l_noco).AND.mpi%irank.EQ.0) THEN IF((.NOT.noco%l_noco).AND.mpi%irank.EQ.0) THEN
ALLOCATE(cdom(1),cdomvz(1,1),cdomvxy(1,1,1)) ALLOCATE(cdom(1),cdomvz(1,1),cdomvxy(1,1,1))
CALL readDensity(stars,vacuum,atoms,sphhar,input,sym,oneD,CDN_ARCHIVE_TYPE_CDN1_const,& CALL readDensity(stars,vacuum,atoms,sphhar,input,sym,oneD,CDN_ARCHIVE_TYPE_CDN1_const,&
CDN_INPUT_DEN_const,0,iter,rho,qpw,rht,rhtxy,cdom,cdomvz,cdomvxy) CDN_INPUT_DEN_const,0,fermiEnergyTemp,l_qfix,iter,rho,qpw,rht,rhtxy,cdom,cdomvz,cdomvxy)
DEALLOCATE(cdom,cdomvz,cdomvxy) DEALLOCATE(cdom,cdomvz,cdomvxy)
END IF END IF
...@@ -487,7 +487,7 @@ ...@@ -487,7 +487,7 @@
END IF END IF
CALL writeDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,& CALL writeDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,&
CDN_OUTPUT_DEN_const,0,iter,rho,qpw,rht,rhtxy,cdom,cdomvz,cdomvxy) CDN_OUTPUT_DEN_const,0,results%ef,.FALSE.,iter,rho,qpw,rht,rhtxy,cdom,cdomvz,cdomvxy)
ENDIF ENDIF
DEALLOCATE (cdom,cdomvz,cdomvxy,qa21) DEALLOCATE (cdom,cdomvz,cdomvxy,qa21)
......
...@@ -46,12 +46,12 @@ CONTAINS ...@@ -46,12 +46,12 @@ CONTAINS
! .. ! ..
! .. Local Scalars .. ! .. Local Scalars ..
REAL fix,intfac,vacfac REAL fix,intfac,vacfac, fermiEnergyTemp
INTEGER i,iter,imap,js,mit,nt,irecl INTEGER i,iter,imap,js,mit,nt,irecl
INTEGER mmap,mmaph,nmaph,nmap,mapmt,mapvac,mapvac2 INTEGER mmap,mmaph,nmaph,nmap,mapmt,mapvac,mapvac2
INTEGER iq2,iq3,ivac,imz ,iofl, archiveType INTEGER iq2,iq3,ivac,imz ,iofl, archiveType
INTEGER n_u_keep INTEGER n_u_keep
LOGICAL lexist,l_ldaU LOGICAL lexist,l_ldaU, l_qfix
! .. ! ..
! .. Local Arrays .. ! .. Local Arrays ..
...@@ -183,7 +183,7 @@ CONTAINS ...@@ -183,7 +183,7 @@ CONTAINS
!---> reload densities of current iteration !---> reload densities of current iteration
CALL readDensity(stars,vacuum,atoms,sphhar,input,sym,oneD,archiveType,& CALL readDensity(stars,vacuum,atoms,sphhar,input,sym,oneD,archiveType,&
CDN_INPUT_DEN_const,0,iter,rho,qpw,rht,rhtxy,cdom,cdomvz,cdomvxy) CDN_INPUT_DEN_const,0,fermiEnergyTemp,l_qfix,iter,rho,qpw,rht,rhtxy,cdom,cdomvz,cdomvxy)
! !
!---> put input charge density into arrays sm !---> put input charge density into arrays sm
...@@ -195,7 +195,7 @@ CONTAINS ...@@ -195,7 +195,7 @@ CONTAINS
! load output charge density ! load output charge density
CALL readDensity(stars,vacuum,atoms,sphhar,input,sym,oneD,archiveType,& CALL readDensity(stars,vacuum,atoms,sphhar,input,sym,oneD,archiveType,&
CDN_OUTPUT_DEN_const,0,iter,rho,qpw,rht,rhtxy,cdom,cdomvz,cdomvxy) CDN_OUTPUT_DEN_const,0,fermiEnergyTemp,l_qfix,iter,rho,qpw,rht,rhtxy,cdom,cdomvz,cdomvxy)
! !
!---> put output charge density into arrays fsm !---> put output charge density into arrays fsm
...@@ -305,7 +305,7 @@ CONTAINS ...@@ -305,7 +305,7 @@ CONTAINS
qpw,rhtxy,rho,rht,.FALSE., fix) qpw,rhtxy,rho,rht,.FALSE., fix)
CALL writeDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,CDN_INPUT_DEN_const,& CALL writeDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,CDN_INPUT_DEN_const,&
1,iter,rho,qpw,rht,rhtxy,cdom,cdomvz,cdomvxy) 1,results%ef,.TRUE.,iter,rho,qpw,rht,rhtxy,cdom,cdomvz,cdomvxy)
DEALLOCATE ( cdom,cdomvz,cdomvxy ) DEALLOCATE ( cdom,cdomvz,cdomvxy )
IF ( atoms%n_u > 0 ) THEN IF ( atoms%n_u > 0 ) THEN
......
...@@ -70,8 +70,9 @@ CONTAINS ...@@ -70,8 +70,9 @@ CONTAINS
INTEGER,INTENT (IN) :: it INTEGER,INTENT (IN) :: it
! .. ! ..
! .. Local Scalars .. ! .. Local Scalars ..
REAL rhs,totz, eigSum REAL rhs,totz, eigSum, fermiEnergyTemp
INTEGER n,j,nt,iter,i, archiveType INTEGER n,j,nt,iter,i, archiveType
LOGICAL l_qfix
! .. Local Arrays .. ! .. Local Arrays ..
REAL vmd(atoms%ntype),zintn_r(atoms%ntype) REAL vmd(atoms%ntype),zintn_r(atoms%ntype)
...@@ -146,7 +147,7 @@ CONTAINS ...@@ -146,7 +147,7 @@ CONTAINS
IF (noco%l_noco) archiveType = CDN_ARCHIVE_TYPE_CDN_const IF (noco%l_noco) archiveType = CDN_ARCHIVE_TYPE_CDN_const
CALL readDensity(stars,vacuum,atoms,sphhar,input,sym,oneD,archiveType,& CALL readDensity(stars,vacuum,atoms,sphhar,input,sym,oneD,archiveType,&
CDN_INPUT_DEN_const,0,iter,rho,qpw,rht,rhtxy,cdom,cdomvz,cdomvxy) CDN_INPUT_DEN_const,0,fermiEnergyTemp,l_qfix,iter,rho,qpw,rht,rhtxy,cdom,cdomvz,cdomvxy)
!+for !+for
! ---> reload the COULOMB potential ! ---> reload the COULOMB potential
......
...@@ -78,9 +78,9 @@ CONTAINS ...@@ -78,9 +78,9 @@ CONTAINS
INTEGER ifftd,ifftd2, ifftxc3d,iter,datend INTEGER ifftd,ifftd2, ifftxc3d,iter,datend
INTEGER itypsym,itype,jsp,l,nat,archiveType INTEGER itypsym,itype,jsp,l,nat,archiveType
! INTEGER i_sm,n_sm,i_sta,i_end ! INTEGER i_sm,n_sm,i_sta,i_end
REAL ani,g3,signum,z,rhmn,fix,mfie REAL ani,g3,signum,z,rhmn,fix,mfie,fermiEnergyTemp
REAL sig1dh,vz1dh,zat_l(atoms%ntype),rdum,dpdot ! ,delta,deltb,corr REAL sig1dh,vz1dh,zat_l(atoms%ntype),rdum,dpdot ! ,delta,deltb,corr
LOGICAL l_pottot,l_vdw LOGICAL l_pottot,l_vdw,l_qfix
LOGICAL exi LOGICAL exi
LOGICAL, PARAMETER :: l_xyav=.FALSE. LOGICAL, PARAMETER :: l_xyav=.FALSE.
! .. ! ..
...@@ -152,10 +152,10 @@ CONTAINS ...@@ -152,10 +152,10 @@ CONTAINS
CALL juDFT_error("vgen:1",calledby ="vgen") CALL juDFT_error("vgen:1",calledby ="vgen")
ENDIF ENDIF
CALL readDensity(stars,vacuum,atoms,sphhar,input,sym,oneD,CDN_ARCHIVE_TYPE_CDN1_const,CDN_OUTPUT_DEN_const,& CALL readDensity(stars,vacuum,atoms,sphhar,input,sym,oneD,CDN_ARCHIVE_TYPE_CDN1_const,CDN_OUTPUT_DEN_const,&
0,iter,rho,qpw,rht,rhtxy,cdom,cdomvz,cdomvxy) 0,fermiEnergyTemp,l_qfix,iter,rho,qpw,rht,rhtxy,cdom,cdomvz,cdomvxy)
ELSE ELSE
CALL readDensity(stars,vacuum,atoms,sphhar,input,sym,oneD,archiveType,CDN_INPUT_DEN_const,& CALL readDensity(stars,vacuum,atoms,sphhar,input,sym,oneD,archiveType,CDN_INPUT_DEN_const,&
0,iter,rho,qpw,rht,rhtxy,cdom,cdomvz,cdomvxy) 0,fermiEnergyTemp,l_qfix,iter,rho,qpw,rht,rhtxy,cdom,cdomvz,cdomvxy)
END IF END IF
IF (.NOT.l_xyav) THEN IF (.NOT.l_xyav) THEN
...@@ -166,7 +166,7 @@ CONTAINS ...@@ -166,7 +166,7 @@ CONTAINS
IF (input%total.OR.reap) THEN IF (input%total.OR.reap) THEN
CALL writeDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,CDN_INPUT_DEN_const,& CALL writeDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,CDN_INPUT_DEN_const,&
0,iter,rho,qpw,rht,rhtxy,cdom,cdomvz,cdomvxy) 0,0.0,.FALSE.,iter,rho,qpw,rht,rhtxy,cdom,cdomvz,cdomvxy)
END IF END IF
WRITE (6,FMT=8000) WRITE (6,FMT=8000)
...@@ -403,7 +403,7 @@ CONTAINS ...@@ -403,7 +403,7 @@ CONTAINS
! !
IF (input%jspins.EQ.2) THEN IF (input%jspins.EQ.2) THEN
CALL readDensity(stars,vacuum,atoms,sphhar,input,sym,oneD,archiveType,CDN_INPUT_DEN_const,& CALL readDensity(stars,vacuum,atoms,sphhar,input,sym,oneD,archiveType,CDN_INPUT_DEN_const,&
0,iter,rho,qpw,rht,rhtxy,cdom,cdomvz,cdomvxy) 0,fermiEnergyTemp,l_qfix,iter,rho,qpw,rht,rhtxy,cdom,cdomvz,cdomvxy)
vr(:,0:,:,2) = vr(:,0:,:,1) vr(:,0:,:,2) = vr(:,0:,:,1)
vpw(:,2) = vpw(:,1) vpw(:,2) = vpw(:,1)
IF (input%film) THEN IF (input%film) THEN
...@@ -664,7 +664,7 @@ CONTAINS ...@@ -664,7 +664,7 @@ CONTAINS
IF (noco%l_noco) THEN ! load qpw,rht,rhtxy from 'cdn'-file IF (noco%l_noco) THEN ! load qpw,rht,rhtxy from 'cdn'-file
CALL readDensity(stars,vacuum,atoms,sphhar,input,sym,oneD,CDN_ARCHIVE_TYPE_CDN_const,CDN_INPUT_DEN_const,& CALL readDensity(stars,vacuum,atoms,sphhar,input,sym,oneD,CDN_ARCHIVE_TYPE_CDN_const,CDN_INPUT_DEN_const,&
0,iter,rho,qpw,rht,rhtxy,cdom,cdomvz,cdomvxy) 0,fermiEnergyTemp,l_qfix,iter,rho,qpw,rht,rhtxy,cdom,cdomvz,cdomvxy)
ENDIF ENDIF
! !
! CALCULATE THE INTEGRAL OF n1*Veff1 + n2*Veff2 ! CALCULATE THE INTEGRAL OF n1*Veff1 + n2*Veff2
......
...@@ -21,6 +21,8 @@ contains ...@@ -21,6 +21,8 @@ contains
TYPE(t_oneD),INTENT(IN) :: oneD TYPE(t_oneD),INTENT(IN) :: oneD
INTEGER k,i,ivac ,it INTEGER k,i,ivac ,it
INTEGER type,typmag, archiveType INTEGER type,typmag, archiveType
REAL fermiEnergyTemp
LOGICAL l_qfix
CHARACTER(len=8) filename CHARACTER(len=8) filename
COMPLEX, ALLOCATABLE :: fpw(:,:),fzxy(:,:,:,:) COMPLEX, ALLOCATABLE :: fpw(:,:),fzxy(:,:,:,:)
REAL, ALLOCATABLE :: fz(:,:,:),fr(:,:,:,:) REAL, ALLOCATABLE :: fz(:,:,:),fr(:,:,:,:)
...@@ -49,7 +51,7 @@ contains ...@@ -49,7 +51,7 @@ contains
IF (noco%l_noco) archiveType = CDN_ARCHIVE_TYPE_NOCO_const IF (noco%l_noco) archiveType = CDN_ARCHIVE_TYPE_NOCO_const