Commit ff3cfdfc authored by Robin Hilgers's avatar Robin Hilgers

Fully Fully seems to be fully functional with hdf.

parent 86c569ea
......@@ -132,7 +132,7 @@ MODULE m_cdn_io
END SUBROUTINE printDensityFileInfo
SUBROUTINE readDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,inOrOutCDN,&
SUBROUTINE readDensity(stars,noco,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,inOrOutCDN,&
relCdnIndex,fermiEnergy,l_qfix,den,inFilename)
TYPE(t_stars),INTENT(IN) :: stars
......@@ -142,6 +142,7 @@ MODULE m_cdn_io
TYPE(t_sphhar),INTENT(IN) :: sphhar
TYPE(t_input),INTENT(IN) :: input
TYPE(t_sym),INTENT(IN) :: sym
TYPE(t_noco),INTENT(IN) :: noco
TYPE(t_oneD),INTENT(IN) :: oneD
TYPE(t_potden),INTENT(INOUT) :: den
......@@ -230,12 +231,12 @@ MODULE m_cdn_io
currentStepfunctionIndex,readDensityIndex,lastDensityIndex,inFilename)
CALL readDensityHDF(fileID, input, stars, sphhar, atoms, vacuum, oneD, archiveName, densityType,&
fermiEnergy,l_qfix,l_DimChange,den)
fermiEnergy,l_qfix,l_DimChange,den,noco%l_mtNocoPot)
CALL closeCDNPOT_HDF(fileID)
IF(l_DimChange) THEN
CALL writeDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,inOrOutCDN,&
CALL writeDensity(stars,noco,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,inOrOutCDN,&
1,-1.0,fermiEnergy,l_qfix,den)
END IF
ELSE
......@@ -363,9 +364,10 @@ MODULE m_cdn_io
END SUBROUTINE readDensity
SUBROUTINE writeDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,inOrOutCDN,&
SUBROUTINE writeDensity(stars,noco,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,inOrOutCDN,&
relCdnIndex,distance,fermiEnergy,l_qfix,den,inFilename)
TYPE(t_noco),INTENT(IN) :: noco
TYPE(t_stars),INTENT(IN) :: stars
TYPE(t_vacuum),INTENT(IN) :: vacuum
TYPE(t_atoms),INTENT(IN) :: atoms
......@@ -384,6 +386,7 @@ MODULE m_cdn_io
CHARACTER(LEN=*), OPTIONAL, INTENT(IN) :: inFilename
TYPE(t_stars) :: starsTemp
TYPE(t_vacuum) :: vacuumTemp
TYPE(t_atoms) :: atomsTemp
......@@ -497,7 +500,7 @@ MODULE m_cdn_io
CALL writeDensityHDF(input, fileID, archiveName, densityType, previousDensityIndex,&
currentStarsIndex, currentLatharmsIndex, currentStructureIndex,&
currentStepfunctionIndex,date,time,distance,fermiEnergy,l_qfix,&
den%iter+relCdnIndex,den)
den%iter+relCdnIndex,den,noco%l_mtNocoPot)
IF(l_storeIndices) THEN
CALL writeCDNHeaderData(fileID,currentStarsIndex,currentLatharmsIndex,currentStructureIndex,&
......@@ -984,7 +987,7 @@ MODULE m_cdn_io
archiveType = MERGE(CDN_ARCHIVE_TYPE_NOCO_const,CDN_ARCHIVE_TYPE_CDN1_const,noco%l_noco)
!read the current density
CALL den%init(stars,atoms,sphhar,vacuum,noco,input%jspins,POTDEN_TYPE_DEN)
CALL readDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,CDN_INPUT_DEN_const,&
CALL readDensity(stars,noco,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,CDN_INPUT_DEN_const,&
0,fermiEnergy,l_qfix,den)
ENDIF
!Now fix the density
......@@ -1002,7 +1005,7 @@ MODULE m_cdn_io
CALL judft_error("Wrong choice of qfix in input")
END SELECT
!Now write the density to file
IF (mpi%irank==0) CALL writedensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,CDN_INPUT_DEN_const,&
IF (mpi%irank==0) CALL writedensity(stars,noco,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,CDN_INPUT_DEN_const,&
0,-1.0,fermiEnergy,l_qfix,den)
#endif
......
This diff is collapsed.
......@@ -40,10 +40,11 @@ MODULE m_pot_io
CONTAINS
SUBROUTINE readPotential(stars,vacuum,atoms,sphhar,input,sym,archiveType,&
SUBROUTINE readPotential(stars,noco,vacuum,atoms,sphhar,input,sym,archiveType,&
iter,fr,fpw,fz,fzxy)
TYPE(t_stars),INTENT(IN) :: stars
TYPE(t_noco),INTENT(IN) :: noco
TYPE(t_vacuum),INTENT(IN) :: vacuum
TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_sphhar),INTENT(IN) :: sphhar
......@@ -103,7 +104,7 @@ MODULE m_pot_io
currentStructureIndex,currentStepfunctionIndex)
CALL readPotentialHDF(fileID, archiveName, potentialType,&
iter,fr,fpw,fz,fzxy)
iter,fr,fpw,fz,fzxy,noco%l_mtNocoPot)
CALL closeCDNPOT_HDF(fileID)
ELSE
......@@ -159,7 +160,7 @@ MODULE m_pot_io
END SUBROUTINE readPotential
SUBROUTINE writePotential(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,&
SUBROUTINE writePotential(stars,noco,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,&
iter,pot,fpw)
TYPE(t_stars),INTENT(IN) :: stars
......@@ -169,6 +170,7 @@ MODULE m_pot_io
TYPE(t_sphhar),INTENT(IN) :: sphhar
TYPE(t_input),INTENT(IN) :: input
TYPE(t_sym),INTENT(IN) :: sym
TYPE(t_noco),INTENT(IN) :: noco
TYPE(t_oneD),INTENT(IN) :: oneD
TYPE(t_potden), INTENT(INOUT) :: pot
......@@ -225,7 +227,7 @@ MODULE m_pot_io
END IF
CALL writePotentialHDF(input, fileID, archiveName, potentialType,&
currentStarsIndex, currentLatharmsIndex, currentStructureIndex,&
currentStepfunctionIndex,iter,pot,fpw)
currentStepfunctionIndex,iter,pot,fpw,noco%l_mtNocoPot)
IF(l_storeIndices) THEN
CALL writePOTHeaderData(fileID,currentStarsIndex,currentLatharmsIndex,&
......
......@@ -136,9 +136,9 @@ SUBROUTINE writeBasis(input,noco,kpts,atoms,sym,cell,enpara,vTot,vCoul,vx,mpi,DI
!-------------------------write potential--------------------
IF(input%gw==1) THEN
CALL writePotential(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,POT_ARCHIVE_TYPE_TOT_const,vTot%iter,vTot,vTot%pw_w)
CALL writePotential(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,POT_ARCHIVE_TYPE_COUL_const,vCoul%iter,vCoul,vCoul%pw_w)
CALL writePotential(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,POT_ARCHIVE_TYPE_X_const,vx%iter,vx,vx%pw_w)
CALL writePotential(stars,noco,vacuum,atoms,cell,sphhar,input,sym,oneD,POT_ARCHIVE_TYPE_TOT_const,vTot%iter,vTot,vTot%pw_w)
CALL writePotential(stars,noco,vacuum,atoms,cell,sphhar,input,sym,oneD,POT_ARCHIVE_TYPE_COUL_const,vCoul%iter,vCoul,vCoul%pw_w)
CALL writePotential(stars,noco,vacuum,atoms,cell,sphhar,input,sym,oneD,POT_ARCHIVE_TYPE_X_const,vx%iter,vx,vx%pw_w)
END IF
......
......@@ -158,7 +158,7 @@ SUBROUTINE cdngen(eig_id,mpi,input,banddos,sliceplot,vacuum,&
IF (sliceplot%slice) THEN
IF (mpi%irank == 0) THEN
CALL writeDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,CDN_ARCHIVE_TYPE_CDN_const,CDN_INPUT_DEN_const,&
CALL writeDensity(stars,noco,vacuum,atoms,cell,sphhar,input,sym,oneD,CDN_ARCHIVE_TYPE_CDN_const,CDN_INPUT_DEN_const,&
0,-1.0,0.0,.FALSE.,outDen,'cdn_slice')
END IF
CALL juDFT_end("slice OK",mpi%irank)
......
......@@ -147,12 +147,12 @@ CONTAINS
archiveType = CDN_ARCHIVE_TYPE_CDN1_const
IF (noco%l_noco) archiveType = CDN_ARCHIVE_TYPE_NOCO_const
IF(mpi%irank.EQ.0) THEN
CALL readDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,CDN_INPUT_DEN_const,&
CALL readDensity(stars,noco,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,CDN_INPUT_DEN_const,&
0,results%ef,l_qfix,inDen)
CALL timestart("Qfix")
CALL qfix(mpi,stars,atoms,sym,vacuum, sphhar,input,cell,oneD,inDen,noco%l_noco,.FALSE.,.false.,fix)
CALL timestop("Qfix")
CALL writeDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,CDN_INPUT_DEN_const,&
CALL writeDensity(stars,noco,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,CDN_INPUT_DEN_const,&
0,-1.0,results%ef,.FALSE.,inDen)
END IF
......
......@@ -168,13 +168,13 @@ contains
!write out mixed density
IF (mpi%irank==0) CALL writeDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,CDN_INPUT_DEN_const,&
IF (mpi%irank==0) CALL writeDensity(stars,noco,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,CDN_INPUT_DEN_const,&
1,results%last_distance,results%ef,.TRUE.,inDen)
#ifdef CPP_HDF
IF (mpi%irank==0.and.judft_was_argument("-last_extra")) THEN
CALL system("rm cdn_last.hdf")
CALL writeDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,CDN_INPUT_DEN_const,&
CALL writeDensity(stars,noco,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,CDN_INPUT_DEN_const,&
1,results%last_distance,results%ef,.TRUE.,inDen,'cdn_last')
END IF
......
......@@ -132,7 +132,7 @@ CONTAINS
!archiveType = CDN_ARCHIVE_TYPE_CDN1_const
!IF (noco%l_noco) archiveType = CDN_ARCHIVE_TYPE_CDN_const
!CALL readDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,&
!CALL readDensity(stars,noco,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,&
! CDN_INPUT_DEN_const,0,fermiEnergyTemp,l_qfix,den)
......
......@@ -47,7 +47,7 @@ contains
archiveType = CDN_ARCHIVE_TYPE_CDN1_const
END IF
CALL readDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,&
CALL readDensity(stars,noco,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,&
CDN_INPUT_DEN_const,0,fermiEnergyTemp,l_qfix,den)
IF ( typmag < atoms%ntype ) THEN
......
......@@ -58,7 +58,7 @@
input%jspins=1
CALL readCoreDensity(input,atoms,dimension,rhoc,tec,qintc)
CALL readDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,CDN_ARCHIVE_TYPE_CDN1_const,&
CALL readDensity(stars,noco,vacuum,atoms,cell,sphhar,input,sym,oneD,CDN_ARCHIVE_TYPE_CDN1_const,&
CDN_INPUT_DEN_const,0,fermiEnergyTemp,l_qfix,den)
input%jspins=2
......@@ -106,7 +106,7 @@
ENDDO
ENDIF
! ----> write the spin-polarized density
CALL writeDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,CDN_ARCHIVE_TYPE_CDN1_const,&
CALL writeDensity(stars,noco,vacuum,atoms,cell,sphhar,input,sym,oneD,CDN_ARCHIVE_TYPE_CDN1_const,&
CDN_INPUT_DEN_const,0,-1.0,0.0,.FALSE.,den)
!
! -----> This part is only used for testing th e magnetic moment in
......
......@@ -69,7 +69,7 @@ SUBROUTINE flipcdn(atoms,input,vacuum,sphhar,stars,sym,noco,oneD,cell)
END IF
! read the charge density
CALL readDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,&
CALL readDensity(stars,noco,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,&
CDN_INPUT_DEN_const,0,fermiEnergyTemp,l_qfix,den)
! flip cdn for each atom with rotation angles given
......@@ -172,7 +172,7 @@ END DO
END IF
! write the spin-polarized density
CALL writeDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,CDN_INPUT_DEN_const,&
CALL writeDensity(stars,noco,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,CDN_INPUT_DEN_const,&
0,-1.0,0.0,.FALSE.,den)
! read enpara and flip lines
......
......@@ -208,7 +208,7 @@ SUBROUTINE stden(mpi,sphhar,stars,atoms,sym,DIMENSION,vacuum,&
! Write superposed density onto density file
den%iter = 0
CALL writeDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,CDN_ARCHIVE_TYPE_CDN1_const,CDN_INPUT_DEN_const,&
CALL writeDensity(stars,noco,vacuum,atoms,cell,sphhar,input,sym,oneD,CDN_ARCHIVE_TYPE_CDN1_const,CDN_INPUT_DEN_const,&
1,-1.0,0.0,.TRUE.,den)
! Check continuity
......
......@@ -307,7 +307,7 @@ SUBROUTINE rdmft(eig_id,mpi,input,kpts,banddos,sliceplot,cell,atoms,enpara,stars
filename = ''
WRITE(filename,'(a,i1.1,a,i4.4,a,i5.5)') 'cdn-', jsp, '-', ikpt, '-', iBand
IF (mpi%irank.EQ.0) THEN
CALL writeDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,CDN_ARCHIVE_TYPE_CDN_const,CDN_INPUT_DEN_const,&
CALL writeDensity(stars,noco,vacuum,atoms,cell,sphhar,input,sym,oneD,CDN_ARCHIVE_TYPE_CDN_const,CDN_INPUT_DEN_const,&
0,-1.0,0.0,.FALSE.,singleStateDen,TRIM(ADJUSTL(filename)))
END IF
#ifdef CPP_MPI
......@@ -416,7 +416,7 @@ SUBROUTINE rdmft(eig_id,mpi,input,kpts,banddos,sliceplot,cell,atoms,enpara,stars
filename = ''
WRITE(filename,'(a,i1.1,a,i4.4,a,i5.5)') 'cdn-', jsp, '-', ikpt, '-', iBand
IF (mpi%irank.EQ.0) THEN
CALL readDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,CDN_ARCHIVE_TYPE_CDN_const,&
CALL readDensity(stars,noco,vacuum,atoms,cell,sphhar,input,sym,oneD,CDN_ARCHIVE_TYPE_CDN_const,&
CDN_INPUT_DEN_const,0,fermiEnergyTemp,l_qfix,singleStateDen,TRIM(ADJUSTL(filename)))
CALL singleStateDen%sum_both_spin()!workden)
END IF
......
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