Commit e6de5340 authored by Daniel Wortmann's avatar Daniel Wortmann

Added code to do IO in fully-fully noco case. HDF5 version still missing..

parent c041af83
......@@ -24,8 +24,9 @@
INTEGER, INTENT (OUT):: it
! ..
! .. Array Arguments ..
COMPLEX, INTENT (OUT):: fpw(stars%ng3,input%jspins),fzxy(vacuum%nmzxyd,stars%ng2-1,2,input%jspins)
REAL, INTENT (OUT):: fr(atoms%jmtd,0:sphhar%nlhd,atoms%ntype,input%jspins),fz(vacuum%nmzd,2,input%jspins)
COMPLEX, INTENT (OUT):: fpw(:,:),fzxy(:,:,:,:)!(stars%ng3,input%jspins),fzxy(vacuum%nmzxyd,stars%ng2-1,2,input%jspins)
REAL, INTENT (OUT):: fr(:,0:,:,:)!(atoms%jmtd,0:sphhar%nlhd,atoms%ntype,input%jspins)
REAL, INTENT (OUT):: fz(:,:,:)!(vacuum%nmzd,2,input%jspins)
CHARACTER(len=8) :: dop,iop,name(10)
! ..
! .. Local Scalars ..
......@@ -48,15 +49,15 @@
fr = 0 ; fzxy = 0 ; fr = 0 ; fz = 0
IF (sym%invs) ALLOCATE ( fpwr(stars%ng3,input%jspins) )
IF (sym%invs2) ALLOCATE ( fzxyr(vacuum%nmzxyd,stars%ng2-1,2,input%jspins) )
IF (sym%invs) ALLOCATE ( fpwr(stars%ng3,SIZE(fpw,2)) )
IF (sym%invs2) ALLOCATE ( fzxyr(vacuum%nmzxyd,stars%ng2-1,2,SIZE(fzxy,4)) )
name = space
READ (nu,END=200,ERR=200) name
! WRITE (*,FMT=8000) name
! 8000 FORMAT (' loddop title:',10a8)
READ (nu,END=200,ERR=200) iop,dop,it
DO jsp = 1,input%jspins
DO jsp = 1,SIZE(fr,4)
READ (nu,END=200,ERR=200) jspdum
READ (nu,END=200,ERR=200) nn
IF (nn/=atoms%ntype) CALL juDFT_error("nn.NE.ntype",calledby =&
......@@ -94,76 +95,81 @@
na = na + atoms%neq(n)
ENDDO
READ (nu,END=200,ERR=200) nq3n
!+gu
IF (nq3n.GT.stars%ng3) THEN
WRITE (*,*) 'nq3n (',nq3n,') reduced to nq3 (',stars%ng3,')'
nq3n = stars%ng3
IF (jsp<=SIZE(fpw,2)) THEN
READ (nu,END=200,ERR=200) nq3n
!+gu
IF (nq3n.GT.stars%ng3) THEN
WRITE (*,*) 'nq3n (',nq3n,') reduced to nq3 (',stars%ng3,')'
nq3n = stars%ng3
ENDIF
!-gu
IF (sym%invs) THEN
READ (nu,END=200,ERR=200) (fpwr(k,jsp),k=1,nq3n)
fpw(:nq3n,jsp) = CMPLX(fpwr(:nq3n,jsp),0.)
ELSE
READ (nu,END=200,ERR=200) (fpw(k,jsp),k=1,nq3n)
END IF
IF (nq3n.LT.stars%ng3) THEN
fpw(nq3n+1:,jsp) = (0.,0.)
END IF
ENDIF
!-gu
IF (sym%invs) THEN
READ (nu,END=200,ERR=200) (fpwr(k,jsp),k=1,nq3n)
fpw(:nq3n,jsp) = CMPLX(fpwr(:nq3n,jsp),0.)
ELSE
READ (nu,END=200,ERR=200) (fpw(k,jsp),k=1,nq3n)
END IF
IF (nq3n.LT.stars%ng3) THEN
fpw(nq3n+1:,jsp) = (0.,0.)
END IF
IF (input%film) THEN
DO ivac = 1,vacuum%nvac
READ (nu,END=200,ERR=200) ivdummy
READ (nu,END=200,ERR=200) nmzn,z1n,delzn
READ (nu,END=200,ERR=200) (fz(i,ivac,jsp),i=1,nmzn)
IF (vacuum%nvac.EQ.1) THEN
DO i=1,nmzn
fz(i,2,jsp)=fz(i,1,jsp)
ENDDO
ENDIF
READ (nu,END=200,ERR=200) nq2n,nmzxyn
!+gu
IF (nq2n.GT.stars%ng2) THEN
WRITE (*,*) 'nq2n (',nq2n,') reduced to nq2 (',stars%ng2,')'
n_diff = nq2n - stars%ng2
nq2n = stars%ng2
ELSE
n_diff = 0
ENDIF
!-gu
DO k = 2,nq2n
IF (sym%invs2) THEN
READ (nu,END=200,ERR=200) &
& (fzxyr(j,k-1,ivac,jsp),j=1,nmzxyn)
fzxy(:nmzxyn,k-1,ivac,jsp) = CMPLX(fzxyr(:nmzxyn,k-1,ivac,&
& jsp),0.)
ELSE
READ (nu,END=200,ERR=200) &
& (fzxy(j,k-1,ivac,jsp),j=1,nmzxyn)
END IF
IF (jsp<=SIZE(fz,3)) THEN
DO ivac = 1,vacuum%nvac
READ (nu,END=200,ERR=200) ivdummy
READ (nu,END=200,ERR=200) nmzn,z1n,delzn
READ (nu,END=200,ERR=200) (fz(i,ivac,jsp),i=1,nmzn)
IF (vacuum%nvac.EQ.1) THEN
IF (sym%invs) THEN
DO j = 1,nmzxyn
fzxy(j,k-1,2,jsp) = CONJG(fzxy(j,k-1,1,jsp))
ENDDO
DO i=1,nmzn
fz(i,2,jsp)=fz(i,1,jsp)
ENDDO
ENDIF
IF (jsp<=SIZE(fzxy,4)) THEN
READ (nu,END=200,ERR=200) nq2n,nmzxyn
!+gu
IF (nq2n.GT.stars%ng2) THEN
WRITE (*,*) 'nq2n (',nq2n,') reduced to nq2 (',stars%ng2,')'
n_diff = nq2n - stars%ng2
nq2n = stars%ng2
ELSE
DO j = 1,nmzxyn
fzxy(j,k-1,2,jsp) = fzxy(j,k-1,1,jsp)
ENDDO
n_diff = 0
ENDIF
!-gu
DO k = 2,nq2n
IF (sym%invs2) THEN
READ (nu,END=200,ERR=200) &
& (fzxyr(j,k-1,ivac,jsp),j=1,nmzxyn)
fzxy(:nmzxyn,k-1,ivac,jsp) = CMPLX(fzxyr(:nmzxyn,k-1,ivac,&
& jsp),0.)
ELSE
READ (nu,END=200,ERR=200) &
& (fzxy(j,k-1,ivac,jsp),j=1,nmzxyn)
END IF
IF (vacuum%nvac.EQ.1) THEN
IF (sym%invs) THEN
DO j = 1,nmzxyn
fzxy(j,k-1,2,jsp) = CONJG(fzxy(j,k-1,1,jsp))
ENDDO
ELSE
DO j = 1,nmzxyn
fzxy(j,k-1,2,jsp) = fzxy(j,k-1,1,jsp)
ENDDO
ENDIF
ENDIF
ENDDO
!+gu
DO k = 1,n_diff
READ (nu,END=200,ERR=200) dummy
ENDDO
!-gu
IF (nq2n.LT.stars%ng2) THEN
fzxy(:nmzxyn,nq2n:,ivac,jsp) = (0.,0.)
END IF
ENDIF
ENDDO
!+gu
DO k = 1,n_diff
READ (nu,END=200,ERR=200) dummy
ENDDO
!-gu
IF (nq2n.LT.stars%ng2) THEN
fzxy(:nmzxyn,nq2n:,ivac,jsp) = (0.,0.)
END IF
ENDDO
END IF
END IF
ENDIF
ENDDO
!
IF (sym%invs) DEALLOCATE (fpwr)
......
......@@ -25,8 +25,9 @@
INTEGER, INTENT (IN) :: it
! ..
! .. Array Arguments ..
COMPLEX, INTENT (IN):: fpw(stars%ng3,input%jspins),fzxy(vacuum%nmzxyd,stars%ng2-1,2,input%jspins)
REAL, INTENT (IN):: fr(atoms%jmtd,0:sphhar%nlhd,atoms%ntype,input%jspins),fz(vacuum%nmzd,2,input%jspins)
COMPLEX, INTENT (IN):: fpw(:,:),fzxy(:,:,:,:) !(stars%ng3,input%jspins),fzxy(vacuum%nmzxyd,stars%ng2-1,2,input%jspins)
REAL, INTENT (IN):: fr(:,0:,:,:)!(atoms%jmtd,0:sphhar%nlhd,atoms%ntype,input%jspins),
REAL, INTENT (IN):: fz(:,:,:)!(vacuum%nmzd,2,input%jspins)
CHARACTER(len=8):: dop,iop,name(10)
! .. Local Scalars ..
INTEGER i,ivac,izn,jsp,k,lh,n,na
......@@ -44,7 +45,7 @@
! WRITE (6,FMT=8000) name
8000 FORMAT (' wrtdop title:',10a8)
WRITE (nu) iop,dop,it
DO jsp = 1,input%jspins
DO jsp = 1,SIZE(fr,4)
WRITE (nu) jsp
WRITE (nu) atoms%ntype
na = 1
......@@ -58,27 +59,33 @@
ENDDO
na = na + atoms%neq (n)
ENDDO
WRITE (nu) stars%ng3
IF (sym%invs) THEN
WRITE (nu) (REAL(fpw(k,jsp)),k=1,stars%ng3)
ELSE
WRITE (nu) (fpw(k,jsp),k=1,stars%ng3)
END IF
IF (jsp<=SIZE(fpw,2)) THEN
WRITE (nu) stars%ng3
IF (sym%invs) THEN
WRITE (nu) (REAL(fpw(k,jsp)),k=1,stars%ng3)
ELSE
WRITE (nu) (fpw(k,jsp),k=1,stars%ng3)
END IF
ENDIF
IF (input%film) THEN
DO ivac = 1,vacuum%nvac
WRITE (nu) ivac
WRITE (nu) vacuum%nmz,vacuum%dvac,vacuum%delz
WRITE (nu) (fz(i,ivac,jsp),i=1,vacuum%nmz)
WRITE (nu) stars%ng2,vacuum%nmzxy
DO k = 2,stars%ng2
IF (sym%invs2) THEN
WRITE (nu) (REAL(fzxy(i,k-1,ivac,jsp)),i=1,vacuum%nmzxy)
ELSE
WRITE (nu) (fzxy(i,k-1,ivac,jsp),i=1,vacuum%nmzxy)
END IF
ENDDO
ENDDO
END IF
IF (jsp<=SIZE(fz,3)) THEN
DO ivac = 1,vacuum%nvac
WRITE (nu) ivac
WRITE (nu) vacuum%nmz,vacuum%dvac,vacuum%delz
WRITE (nu) (fz(i,ivac,jsp),i=1,vacuum%nmz)
IF (jsp<=SIZE(fzxy,4)) THEN
WRITE (nu) stars%ng2,vacuum%nmzxy
DO k = 2,stars%ng2
IF (sym%invs2) THEN
WRITE (nu) (REAL(fzxy(i,k-1,ivac,jsp)),i=1,vacuum%nmzxy)
ELSE
WRITE (nu) (fzxy(i,k-1,ivac,jsp),i=1,vacuum%nmzxy)
END IF
ENDDO
ENDIF
ENDDO
END IF
ENDIF
ENDDO
!
RETURN
......
......@@ -54,7 +54,7 @@ CONTAINS
REWIND 9
DO io = 1,2
CALL loddop(stars,vacuum,atoms,sphhar, input,sym,&
9, iter,rhsp(1,0,1,1,io),rhpw(1,1,io), rhv0(1,1,1,io),rhv1(1,1,1,1,io))
9, iter,rhsp(:,0:,:,:,io),rhpw(:,:,io), rhv0(:,:,:,io),rhv1(:,:,:,:,io))
ENDDO
CLOSE (9)
IF (input%jspins.EQ.1) 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