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
set(fleur_F90 ${fleur_F90}
init/compile_descr.F90
init/apws_dim.f90
init/checks.F90
init/dimen7.F90
init/dimens.F90
init/efield.f90
......
......@@ -12,7 +12,7 @@ MODULE m_checks
IMPLICIT NONE
#ifdef CPP_MPI
INCLUDE 'mpif.h'
INTEGER:: isize,ierr
INTEGER:: isize,ierr,irank
#endif
IF (juDFT_was_argument("-hdf")) THEN
#ifndef CPP_HDF
......
......@@ -47,7 +47,7 @@ MODULE m_cdn_io
CONTAINS
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_vacuum),INTENT(IN) :: vacuum
......@@ -61,6 +61,8 @@ MODULE m_cdn_io
INTEGER, INTENT (IN) :: relCdnIndex
INTEGER, INTENT (OUT) :: iter
INTEGER, INTENT (IN) :: archiveType
REAL, INTENT (OUT) :: fermiEnergy
LOGICAL, INTENT (OUT) :: l_qfix
! ..
! .. Array Arguments ..
......@@ -83,6 +85,10 @@ MODULE m_cdn_io
CHARACTER(LEN=30) :: archiveName
TYPE(t_cell) :: cellTemp
fermiEnergy = 0.0
l_qfix = .FALSE.
WRITE(*,*) 'fermiEnergy and l_qfix set to default values in readDensity!'
CALL getMode(mode)
IF(mode.EQ.CDN_HDF5_MODE) THEN
......@@ -117,7 +123,7 @@ MODULE m_cdn_io
END IF
CASE DEFAULT
WRITE(*,*) 'inOrOutCDN = ', inOrOutCDN
CALL juDFT_error("Invalid inOrOutCDN selected.",calledby ="writeDensity")
CALL juDFT_error("Invalid inOrOutCDN selected.",calledby ="readDensity")
END SELECT
l_exist = isDensityEntryPresentHDF(fileID,archiveName,densityType)
CALL closeCDN_HDF(fileID)
......@@ -128,7 +134,7 @@ MODULE m_cdn_io
readDensityIndex,lastDensityIndex)
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)
RETURN
......@@ -222,7 +228,7 @@ MODULE m_cdn_io
END SUBROUTINE readDensity
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_vacuum),INTENT(IN) :: vacuum
......@@ -236,6 +242,8 @@ MODULE m_cdn_io
INTEGER, INTENT (IN) :: inOrOutCDN
INTEGER, INTENT (IN) :: relCdnIndex, iter
INTEGER, INTENT (IN) :: archiveType
REAL, INTENT (IN) :: fermiEnergy
LOGICAL, INTENT (IN) :: l_qfix
! ..
! .. Array Arguments ..
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
INTEGER :: previousDensityIndex, densityType
INTEGER :: starsIndexTemp, latharmsIndexTemp, structureIndexTemp
INTEGER :: jspinsTemp
REAL :: fermiEnergyTemp
LOGICAL :: l_qfixTemp
CHARACTER(LEN=30) :: archiveName
CALL getMode(mode)
......@@ -332,13 +342,13 @@ MODULE m_cdn_io
IF(l_exist) THEN
CALL peekDensityEntryHDF(fileID, archiveName, DENSITY_TYPE_UNDEFINED_const,&
iterTemp, starsIndexTemp, latharmsIndexTemp, structureIndexTemp,&
previousDensityIndex, jspinsTemp)
previousDensityIndex, jspinsTemp, fermiEnergyTemp, l_qfixTemp)
END IF
END IF
CALL writeDensityHDF(input, fileID, archiveName, densityType, previousDensityIndex,&
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
CALL writeHeaderData(fileID,currentStarsIndex,currentLatharmsIndex,&
......
......@@ -1033,15 +1033,17 @@ MODULE m_cdnpot_io_hdf
SUBROUTINE writeDensityHDF(input, fileID, archiveName, densityType, previousDensityIndex,&
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
INTEGER(HID_T), INTENT(IN) :: fileID
INTEGER, INTENT(IN) :: densityType, previousDensityIndex
INTEGER, INTENT(IN) :: starsIndex, latharmsIndex, structureIndex
INTEGER(HID_T), INTENT(IN) :: fileID
INTEGER, INTENT(IN) :: densityType, previousDensityIndex
INTEGER, INTENT(IN) :: starsIndex, latharmsIndex, structureIndex
CHARACTER(LEN=*), INTENT(IN) :: archiveName
INTEGER, INTENT (IN) :: iter
REAL, INTENT (IN) :: fermiEnergy
LOGICAL, INTENT (IN) :: l_qfix
REAL, INTENT (IN) :: fr(:,:,:,:)
REAL, INTENT (IN) :: fz(:,:,:)
......@@ -1058,13 +1060,13 @@ MODULE m_cdnpot_io_hdf
INTEGER(HSIZE_T) :: dims(7)
INTEGER :: dimsInt(7)
INTEGER(HID_T) :: frSpaceID, frSetID
INTEGER(HID_T) :: fpwSpaceID, fpwSetID
INTEGER(HID_T) :: fzSpaceID, fzSetID
INTEGER(HID_T) :: fzxySpaceID, fzxySetID
INTEGER(HID_T) :: cdomSpaceID, cdomSetID
INTEGER(HID_T) :: cdomvzSpaceID, cdomvzSetID
INTEGER(HID_T) :: cdomvxySpaceID, cdomvxySetID
INTEGER(HID_T) :: frSpaceID, frSetID
INTEGER(HID_T) :: fpwSpaceID, fpwSetID
INTEGER(HID_T) :: fzSpaceID, fzSetID
INTEGER(HID_T) :: fzxySpaceID, fzxySetID
INTEGER(HID_T) :: cdomSpaceID, cdomSetID
INTEGER(HID_T) :: cdomvzSpaceID, cdomvzSetID
INTEGER(HID_T) :: cdomvxySpaceID, cdomvxySetID
WRITE(groupname,'(a,i0)') '/structure-', structureIndex
l_exist = io_groupexists(fileID,TRIM(ADJUSTL(groupName)))
......@@ -1136,6 +1138,9 @@ MODULE m_cdnpot_io_hdf
IF(l_exist) THEN
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/)
CALL h5dopen_f(groupID, 'fr', frSetID, hdfError)
CALL io_write_real4(frSetID,(/1,1,1,1/),dimsInt(:4),fr)
......@@ -1183,6 +1188,9 @@ MODULE m_cdnpot_io_hdf
ELSE
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/)
dimsInt = dims
CALL h5screate_simple_f(4,dims(:4),frSpaceID,hdfError)
......@@ -1263,6 +1271,9 @@ MODULE m_cdnpot_io_hdf
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/)
dimsInt = dims
CALL h5screate_simple_f(4,dims(:4),frSpaceID,hdfError)
......@@ -1335,13 +1346,15 @@ MODULE m_cdnpot_io_hdf
END SUBROUTINE writeDensityHDF
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, INTENT(IN) :: densityType
CHARACTER(LEN=*), INTENT(IN) :: archiveName
INTEGER, INTENT (OUT) :: iter
REAL, INTENT (OUT) :: fermiEnergy
LOGICAL, INTENT (OUT) :: l_qfix
REAL, INTENT (OUT) :: fr(:,:,:,:)
REAL, INTENT (OUT) :: fz(:,:,:)
......@@ -1453,6 +1466,9 @@ MODULE m_cdnpot_io_hdf
CALL io_read_attint0(groupBID,'ng2',ng2)
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/)
CALL h5dopen_f(groupID, 'fr', frSetID, hdfError)
CALL io_read_real4(frSetID,(/1,1,1,1/),dimsInt(:4),fr)
......@@ -1503,15 +1519,18 @@ MODULE m_cdnpot_io_hdf
SUBROUTINE peekDensityEntryHDF(fileID, archiveName, densityType,&
iter, starsIndex, latharmsIndex, structureIndex,&
previousDensityIndex, jspins)
previousDensityIndex, jspins,&
fermiEnergy, l_qfix)
INTEGER(HID_T), INTENT(IN) :: fileID
INTEGER, INTENT(IN) :: densityType
CHARACTER(LEN=*), INTENT(IN) :: archiveName
INTEGER, INTENT (OUT) :: iter
INTEGER,INTENT(OUT) :: starsIndex, latharmsIndex, structureIndex
INTEGER,INTENT(OUT) :: previousDensityIndex, jspins
INTEGER, INTENT(OUT) :: iter
INTEGER, INTENT(OUT) :: starsIndex, latharmsIndex, structureIndex
INTEGER, INTENT(OUT) :: previousDensityIndex, jspins
REAL, INTENT(OUT) :: fermiEnergy
LOGICAL, INTENT(OUT) :: l_qfix
INTEGER :: localDensityType
LOGICAL :: l_exist
......@@ -1570,6 +1589,11 @@ MODULE m_cdnpot_io_hdf
CALL io_read_attint0(archiveID,'spins',jspins)
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(archiveID, hdfError)
......
......@@ -91,7 +91,8 @@
!*****************************************************************
SUBROUTINE io_write_attlog0(did,name,DATA)
!*****************************************************************
USE hdf5
USE hdf5
USE m_hdf_tools3 !This is for the subroutine io_attexists
IMPLICIT NONE
INTEGER(HID_T),INTENT(IN) ::did
......@@ -100,18 +101,27 @@
!locals
INTEGER(HSIZE_T)::dims(7)
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/)
IF (DATA) THEN
dum=1
ELSE
dum=0
ENDIF
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)
ENDIF
IF(l_exist) THEN
CALL h5aopen_f(did,name,atid,hdferr)
CALL h5awrite_f(atid,H5T_NATIVE_INTEGER,dum,dims, hdferr)
CALL h5aclose_f(atid,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)
END SUBROUTINE
!*****************************************************************
......@@ -158,7 +168,8 @@
!*****************************************************************
SUBROUTINE io_write_attreal1(did,name,DATA)
!*****************************************************************
USE hdf5
USE hdf5
USE m_hdf_tools3 !This is for the subroutine io_attexists
IMPLICIT NONE
INTEGER(HID_T),INTENT(IN) ::did
......@@ -167,13 +178,22 @@
!locals
INTEGER(HSIZE_T)::dims(7)
INTEGER(HID_t)::atid,sid
INTEGER ::hdferr
dims=(/SIZE(DATA),0,0,0,0,0,0/)
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)
INTEGER ::hdferr
LOGICAL ::l_exist
l_exist = io_attexists(did,name)
dims=(/SIZE(DATA),0,0,0,0,0,0/)
IF(l_exist) THEN
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)
END SUBROUTINE
!*****************************************************************
......
......@@ -58,10 +58,10 @@
! ..
! .. Local Scalars ..
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 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
! ..
! .. Local Arrays ..
......@@ -107,7 +107,7 @@
IF((.NOT.noco%l_noco).AND.mpi%irank.EQ.0) THEN
ALLOCATE(cdom(1),cdomvz(1,1),cdomvxy(1,1,1))
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)
END IF
......@@ -487,7 +487,7 @@
END IF
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
DEALLOCATE (cdom,cdomvz,cdomvxy,qa21)
......
......@@ -46,12 +46,12 @@ CONTAINS
! ..
! .. Local Scalars ..
REAL fix,intfac,vacfac
REAL fix,intfac,vacfac, fermiEnergyTemp
INTEGER i,iter,imap,js,mit,nt,irecl
INTEGER mmap,mmaph,nmaph,nmap,mapmt,mapvac,mapvac2
INTEGER iq2,iq3,ivac,imz ,iofl, archiveType
INTEGER n_u_keep
LOGICAL lexist,l_ldaU
LOGICAL lexist,l_ldaU, l_qfix
! ..
! .. Local Arrays ..
......@@ -183,7 +183,7 @@ CONTAINS
!---> reload densities of current iteration
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
......@@ -195,7 +195,7 @@ CONTAINS
! load output charge density
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
......@@ -305,7 +305,7 @@ CONTAINS
qpw,rhtxy,rho,rht,.FALSE., fix)
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 )
IF ( atoms%n_u > 0 ) THEN
......
......@@ -70,8 +70,9 @@ CONTAINS
INTEGER,INTENT (IN) :: it
! ..
! .. Local Scalars ..
REAL rhs,totz, eigSum
REAL rhs,totz, eigSum, fermiEnergyTemp
INTEGER n,j,nt,iter,i, archiveType
LOGICAL l_qfix
! .. Local Arrays ..
REAL vmd(atoms%ntype),zintn_r(atoms%ntype)
......@@ -146,7 +147,7 @@ CONTAINS
IF (noco%l_noco) archiveType = CDN_ARCHIVE_TYPE_CDN_const
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
! ---> reload the COULOMB potential
......
......@@ -78,9 +78,9 @@ CONTAINS
INTEGER ifftd,ifftd2, ifftxc3d,iter,datend
INTEGER itypsym,itype,jsp,l,nat,archiveType
! 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
LOGICAL l_pottot,l_vdw
LOGICAL l_pottot,l_vdw,l_qfix
LOGICAL exi
LOGICAL, PARAMETER :: l_xyav=.FALSE.
! ..
......@@ -152,10 +152,10 @@ CONTAINS
CALL juDFT_error("vgen:1",calledby ="vgen")
ENDIF
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
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
IF (.NOT.l_xyav) THEN
......@@ -166,7 +166,7 @@ CONTAINS
IF (input%total.OR.reap) THEN
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
WRITE (6,FMT=8000)
......@@ -403,7 +403,7 @@ CONTAINS
!
IF (input%jspins.EQ.2) THEN
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)
vpw(:,2) = vpw(:,1)
IF (input%film) THEN
......@@ -664,7 +664,7 @@ CONTAINS
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,&
0,iter,rho,qpw,rht,rhtxy,cdom,cdomvz,cdomvxy)
0,fermiEnergyTemp,l_qfix,iter,rho,qpw,rht,rhtxy,cdom,cdomvz,cdomvxy)
ENDIF
!
! CALCULATE THE INTEGRAL OF n1*Veff1 + n2*Veff2
......
......@@ -21,6 +21,8 @@ contains
TYPE(t_oneD),INTENT(IN) :: oneD
INTEGER k,i,ivac ,it
INTEGER type,typmag, archiveType
REAL fermiEnergyTemp
LOGICAL l_qfix
CHARACTER(len=8) filename
COMPLEX, ALLOCATABLE :: fpw(:,:),fzxy(:,:,:,:)
REAL, ALLOCATABLE :: fz(:,:,:),fr(:,:,:,:)
......@@ -49,7 +51,7 @@ contains
IF (noco%l_noco) archiveType = CDN_ARCHIVE_TYPE_NOCO_const
CALL readDensity(stars,vacuum,atoms,sphhar,input,sym,oneD,archiveType,&
CDN_INPUT_DEN_const,0,it,fr,fpw,fz,fzxy,cdom,cdomvz,cdomvxy)
CDN_INPUT_DEN_const,0,fermiEnergyTemp,l_qfix,it,fr,fpw,fz,fzxy,cdom,cdomvz,cdomvxy)
IF ( typmag < atoms%ntype ) THEN
DO type= typmag+1,atoms%ntype
......
......@@ -34,10 +34,10 @@
TYPE(t_dimension),INTENT(IN) :: DIMENSION
! ..
! .. Local Scalars ..
REAL dummy,p,pp,qtot1,qtot2,spmtot,qval,sfp
REAL dummy,p,pp,qtot1,qtot2,spmtot,qval,sfp,fermiEnergyTemp
INTEGER i,iter,ivac,j,k,lh,n,na,jsp_new
INTEGER ios
LOGICAL n_exist
LOGICAL n_exist,l_qfix
! ..
! .. Local Arrays ..
REAL rhoc(atoms%jmtd,atoms%ntype,dimension%jspd)
......@@ -60,7 +60,7 @@
input%jspins=1
CALL readCoreDensity(input,atoms,dimension,rhoc,tec,qintc)
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)
input%jspins=2
qval = 0.
......@@ -109,7 +109,7 @@
ENDIF
! ----> write the spin-polarized density
CALL writeDensity(stars,vacuum,atoms,cell,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,0.0,.FALSE.,iter,rho,qpw,rht,rhtxy,cdom,cdomvz,cdomvxy)
!
! -----> This part is only used for testing th e magnetic moment in
! -----> each sphere
......
......@@ -34,12 +34,12 @@
LOGICAL,INTENT(IN) :: l_noco
! .. Local Scalars ..
REAL rhodummy,rhodumms
REAL rhodummy,rhodumms,fermiEnergyTemp
INTEGER i,iter,n,nt,j,lh,na ,mp,ispin,n_ldau,urec,itype,m
INTEGER archiveType
CHARACTER(len=8) iop,dop
LOGICAL n_exist
LOGICAL n_exist,l_qfix
! ..
! .. Local Arrays ..
COMPLEX, ALLOCATABLE :: n_mmp(:,:,:,:),qpw(:,:),rhtxy(:,:,:,:)
......@@ -61,7 +61,7 @@
! ---> read the charge density
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)
! ---> flip cdn for each atom with nflip=-1
!
......@@ -90,7 +90,7 @@
ENDDO
! ----> write the spin-polarized density
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)
!
! for lda+U: flip n-matrix
!
......
......@@ -326,7 +326,7 @@
inp%jspins=1
CALL writeDensity(stars,vacuum,atoms,cell,sphhar,inp,sym,oneD,CDN_ARCHIVE_TYPE_CDN_const,CDN_INPUT_DEN_const,&
0,iter,rho(:,0:,1:,1:1),qpw(1:,1:1),rht(1:,1:,1:1),rhtxy(1:,1:,1:,1:1),cdom,cdomvz,cdomvxy)
0,0.0,.FALSE.,iter,rho(:,0:,1:,1:1),qpw(1:,1:1),rht(1:,1:,1:1),rhtxy(1:,1:,1:,1:1),cdom,cdomvz,cdomvxy)
!---> save mx to file mdnx
OPEN (72,FILE='mdnx',FORM='unformatted',STATUS='unknown')
......
......@@ -244,7 +244,7 @@
!
iter = 0
CALL writeDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,CDN_ARCHIVE_TYPE_CDN1_const,CDN_INPUT_DEN_const,&
1,iter,rho,qpw,rht,rhtxy,cdom,cdomvz,cdomvxy)
1,0.0,.TRUE.,iter,rho,qpw,rht,rhtxy,cdom,cdomvz,cdomvxy)
!
! Check continuity
!
......
......@@ -73,8 +73,10 @@ CONTAINS
INTEGER imz,ityp,iri,ilh,imesh,iq2,iq3,iter
REAL zero,rho_11,rho_22,rho_21r,rho_21i,rhotot,magmom,phi
REAL rho_up,rho_down,mx,my,mz,eps,pi,fix,vz_r,vz_i,rziw,theta
REAL fermiEnergyTemp
COMPLEX czero
CHARACTER*8 dop,iop,name(10)
LOGICAL l_qfix
! ..
! .. Local Arrays ..
!---> off-diagonal part of the density matrix
......@@ -115,7 +117,7 @@ CONTAINS
!---> reload the density matrix from file rhomat_inp
CALL readDensity(stars,vacuum,atoms,sphhar,input,sym,oneD,CDN_ARCHIVE_TYPE_NOCO_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)
CALL qfix(&
& stars,atoms,sym,vacuum,&
......@@ -398,7 +400,7 @@ CONTAINS
!---> write spin-up and -down density on file cdn
CALL writeDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,CDN_ARCHIVE_TYPE_CDN_const,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)
DEALLOCATE (qpw,rhtxy,cdom,cdomvz,cdomvxy,&
& ris,fftwork,rz,rho,rht)
......
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