Commit 165a8eae authored by Gregor Michalicek's avatar Gregor Michalicek

Fixed bugs in cdn.hdf and pot.hdf

The bugs affected film calculations.
parent 0ccc47ef
......@@ -345,9 +345,24 @@ MODULE m_cdn_io
END IF
END IF
ALLOCATE (fzxyTemp(vacuum%nmzxyd,stars%ng2-1,2,input%jspins))
ALLOCATE (fzTemp(vacuum%nmzd,2,input%jspins))
fzTemp(:,:,:) = fz(:,:,:)
fzxyTemp(:,:,:,:) = fzxy(:,:,:,:)
IF(vacuum%nvac.EQ.1) THEN
fzTemp(:,2,:)=fzTemp(:,1,:)
IF (sym%invs) THEN
fzxyTemp(:,:,2,:) = CONJG(fzxyTemp(:,:,1,:))
ELSE
fzxyTemp(:,:,2,:) = fzxyTemp(:,:,1,:)
END IF
END IF
CALL writeDensityHDF(input, fileID, archiveName, densityType, previousDensityIndex,&
currentStarsIndex, currentLatharmsIndex, currentStructureIndex,&
fermiEnergy,l_qfix,iter+relCdnIndex,fr,fpw,fz,fzxy,cdom,cdomvz,cdomvxy)
fermiEnergy,l_qfix,iter+relCdnIndex,fr,fpw,fzTemp,fzxyTemp,cdom,cdomvz,cdomvxy)
DEALLOCATE(fzTemp,fzxyTemp)
IF(l_storeIndices) THEN
CALL writeCDNHeaderData(fileID,currentStarsIndex,currentLatharmsIndex,&
......
......@@ -58,7 +58,7 @@ MODULE m_pot_io
REAL, INTENT (OUT) :: fr(atoms%jmtd,0:sphhar%nlhd,atoms%ntype,input%jspins), fz(vacuum%nmzd,2,input%jspins)
! local variables
INTEGER :: mode, iUnit
INTEGER :: mode, iUnit, i,j,k,l
LOGICAL :: l_exist
CHARACTER(len=30) :: filename
......@@ -150,8 +150,8 @@ MODULE m_pot_io
CALL loddop(stars,vacuum,atoms,sphhar,input,sym,&
iUnit,iter,fr,fpw,fz,fzxy)
CLOSE(iUnit)
CLOSE(iUnit)
END IF
END SUBROUTINE readPotential
......@@ -188,6 +188,9 @@ MODULE m_pot_io
INTEGER :: potentialType
CHARACTER(LEN=30) :: archiveName
REAL :: fzTemp(vacuum%nmzd,2,input%jspins)
COMPLEX :: fzxyTemp(vacuum%nmzxyd,stars%ng2-1,2,input%jspins)
CALL getMode(mode)
IF(mode.EQ.POT_HDF5_MODE) THEN
......@@ -224,9 +227,19 @@ MODULE m_pot_io
potentialType = POTENTIAL_TYPE_IN_const
fzTemp(:,:,:) = fz(:,:,:)
fzxyTemp(:,:,:,:) = fzxy(:,:,:,:)
IF(vacuum%nvac.EQ.1) THEN
fzTemp(:,2,:)=fzTemp(:,1,:)
IF (sym%invs) THEN
fzxyTemp(:,:,2,:) = CONJG(fzxyTemp(:,:,1,:))
ELSE
fzxyTemp(:,:,2,:) = fzxyTemp(:,:,1,:)
END IF
END IF
CALL writePotentialHDF(input, fileID, archiveName, potentialType,&
currentStarsIndex, currentLatharmsIndex, currentStructureIndex,&
iter,fr,fpw,fz,fzxy)
iter,fr,fpw,fzTemp,fzxyTemp)
IF(l_storeIndices) THEN
CALL writePOTHeaderData(fileID,currentStarsIndex,currentLatharmsIndex,&
......
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