Commit c45700d5 authored by Gregor Michalicek's avatar Gregor Michalicek

Added potential and density IO wrappers to some missing spots

parent c8f77bc3
......@@ -20,8 +20,8 @@
USE m_umix
USE m_prpqfftmap
USE m_cdnval
USE m_loddop
USE m_cdn_io
USE m_pot_io
USE m_wrtdop
USE m_cdntot
USE m_cdnovlp
......@@ -92,10 +92,9 @@
!
ALLOCATE(vpw(stars%n3d,dimension%jspd),vzxy(vacuum%nmzxyd,oneD%odi%n2d-1,2,dimension%jspd),&
& vz(vacuum%nmzd,2,dimension%jspd),vr(atoms%jmtd,0:sphhar%nlhd,atoms%ntype,dimension%jspd))
OPEN (8,file='pottot',form='unformatted',status='old')
REWIND (8)
CALL loddop(stars,vacuum,atoms,sphhar, input,sym, 8, iter,vr,vpw,vz,vzxy)
CLOSE (8)
CALL readPotential(stars,vacuum,atoms,sphhar,input,sym,POT_ARCHIVE_TYPE_TOT_const,&
iter,vr,vpw,vz,vzxy)
DEALLOCATE ( vpw,vzxy )
ALLOCATE ( qpw(stars%n3d,dimension%jspd),rhtxy(vacuum%nmzxyd,oneD%odi%n2d-1,2,dimension%jspd) )
ALLOCATE ( rho(atoms%jmtd,0:sphhar%nlhd,atoms%ntype,dimension%jspd),rht(vacuum%nmzd,2,dimension%jspd) )
......
......@@ -279,7 +279,7 @@
CALL timestart("gen. spin-up and -down density")
CALL rhodirgen(&
& dimension,sym,stars,atoms,sphhar,&
& vacuum,26,22,cell,input,oneD)
& vacuum,22,cell,input,oneD)
CALL timestop("gen. spin-up and -down density")
ENDIF
!---> pk non-collinear
......
......@@ -28,7 +28,7 @@ CONTAINS
SUBROUTINE rhodirgen(&
& DIMENSION,sym,stars,&
& atoms,sphhar,vacuum,&
& nrhomfile,ndomfile,&
& ndomfile,&
& cell,input,oneD)
!******** ABBREVIATIONS ***********************************************
......@@ -45,8 +45,7 @@ CONTAINS
!**********************************************************************
USE m_constants
USE m_loddop
USE m_wrtdop
USE m_cdn_io
USE m_qfix
USE m_fft2d
USE m_fft3d
......@@ -64,7 +63,7 @@ CONTAINS
TYPE(t_atoms),INTENT(IN) :: atoms
! .. Scalar Arguments ..
INTEGER, INTENT (IN) :: nrhomfile,ndomfile
INTEGER, INTENT (IN) :: ndomfile
! ..
! ..
!-odim
......@@ -115,35 +114,9 @@ CONTAINS
ENDIF
!---> reload the density matrix from file rhomat_inp
OPEN (nrhomfile,FILE='rhomat_inp',FORM='unformatted',&
& STATUS='unknown')
!---> first the diagonal elements of the density matrix
CALL loddop(stars,vacuum,atoms,sphhar,&
& input,sym,&
& nrhomfile,&
& iter,rho,qpw,rht,rhtxy)
!---> and then the off-diagonal part
READ (nrhomfile,END=100,ERR=50) (cdom(iq3),iq3=1,stars%ng3)
IF (input%film) THEN
READ (nrhomfile,END=75,ERR=50) ((cdomvz(imz,ivac),imz=1,vacuum%nmz)&
& ,ivac=1,vacuum%nvac)
READ (nrhomfile,END=75,ERR=50) (((cdomvxy(imz,iq2-1,ivac)&
& ,imz=1,vacuum%nmzxy),iq2=2,oneD%odi%nq2),ivac=1,vacuum%nvac)
ENDIF
GOTO 150
50 WRITE(6,*)'rhodirgen: ERROR: Problems while reading density'
WRITE(6,*)'matrix from file rhomat_inp.'
CALL juDFT_error("ERROR while reading file rhomat_inp",calledby&
& ="rhodirgen")
75 WRITE(6,*)'rhodirgen: ERROR: reached end of file rhomat_inp'
WRITE(6,*)'while reading the vacuum part of the off-diagonal'
WRITE(6,*)'element of the desity matrix.'
CALL juDFT_error("ERROR while reading file rhomat_inp",calledby&
& ="rhodirgen")
100 WRITE(6,*)'rhodirgen: WARNING: The file rhomat_inp does not'
WRITE(6,*)'contain off-diagonal part of the density matrix.'
WRITE(6,*)'Assuming collinear magnetization.'
150 CLOSE (nrhomfile)
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)
CALL qfix(&
& stars,atoms,sym,vacuum,&
& sphhar,input,cell,oneD,&
......@@ -423,13 +396,9 @@ CONTAINS
CLOSE (ndomfile)
!---> write spin-up and -down density on file cdn
OPEN (70,FILE='cdn',FORM='unformatted',STATUS='unknown')
CALL wrtdop(&
& stars,vacuum,atoms,sphhar,&
& input,sym,&
& 70,&
& iter,rho,qpw,rht,rhtxy)
CLOSE (70)
CALL writeDensity(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)
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