Commit 481ba1da authored by Gregor Michalicek's avatar Gregor Michalicek

Initial commit for the introduction of the cdn.hdf file

Note: This functionality is not yet feature complete and
only basic usage has been tested. The cdn.hdf file will still
change.
parent 06ceb878
......@@ -14,7 +14,8 @@ io/eig66_mpi.F90
io/nocoInputCheck.F90
io/inpnoco.F90
io/loddop.f90
io/cdn_io.f90
io/cdnpot_io_hdf.F90
io/cdn_io.F90
io/pot_io.f90
io/rw_inp.f90
io/rw_noco.f90
......
This diff is collapsed.
This diff is collapsed.
......@@ -316,7 +316,8 @@
!*****************************************************************
SUBROUTINE io_write_attint0(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
......@@ -325,13 +326,21 @@
!locals
INTEGER(HSIZE_T)::dims(7)
INTEGER(HID_t)::atid,sid
INTEGER ::hdferr
INTEGER ::hdferr
LOGICAL ::l_exist
l_exist = io_attexists(did,name)
dims=(/1,0,0,0,0,0,0/)
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,DATA,dims, hdferr)
CALL h5aclose_f(atid,hdferr)
CALL h5sclose_f(sid,hdferr)
IF(l_exist) THEN
CALL h5aopen_f(did,name,atid,hdferr)
CALL h5awrite_f(atid,H5T_NATIVE_INTEGER,DATA,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,DATA,dims, hdferr)
CALL h5aclose_f(atid,hdferr)
CALL h5sclose_f(sid,hdferr)
END IF
CALL io_check('io_write_attint0'//name,hdferr)
END SUBROUTINE
!*****************************************************************
......
......@@ -486,7 +486,7 @@
CALL juDFT_error("slice OK",calledby="cdngen")
END IF
CALL writeDensity(stars,vacuum,atoms,sphhar,input,sym,oneD,archiveType,&
CALL writeDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,&
CDN_OUTPUT_DEN_const,0,iter,rho,qpw,rht,rhtxy,cdom,cdomvz,cdomvxy)
ENDIF
......
......@@ -304,7 +304,7 @@ CONTAINS
CALL qfix(stars,atoms,sym,vacuum, sphhar,input,cell,oneD,&
qpw,rhtxy,rho,rht,.FALSE., fix)
CALL writeDensity(stars,vacuum,atoms,sphhar,input,sym,oneD,archiveType,CDN_INPUT_DEN_const,&
CALL writeDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,CDN_INPUT_DEN_const,&
1,iter,rho,qpw,rht,rhtxy,cdom,cdomvz,cdomvxy)
DEALLOCATE ( cdom,cdomvz,cdomvxy )
......
......@@ -165,7 +165,7 @@ CONTAINS
ENDIF
IF (input%total.OR.reap) THEN
CALL writeDensity(stars,vacuum,atoms,sphhar,input,sym,oneD,archiveType,CDN_INPUT_DEN_const,&
CALL writeDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,CDN_INPUT_DEN_const,&
0,iter,rho,qpw,rht,rhtxy,cdom,cdomvz,cdomvxy)
END IF
......
......@@ -108,7 +108,7 @@
ENDDO
ENDIF
! ----> write the spin-polarized density
CALL writeDensity(stars,vacuum,atoms,sphhar,input,sym,oneD,CDN_ARCHIVE_TYPE_CDN1_const,&
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)
!
! -----> This part is only used for testing th e magnetic moment in
......
......@@ -89,7 +89,7 @@
na = na + atoms%neq(n)
ENDDO
! ----> write the spin-polarized density
CALL writeDensity(stars,vacuum,atoms,sphhar,input,sym,oneD,archiveType,CDN_INPUT_DEN_const,&
CALL writeDensity(stars,vacuum,atoms,cell,sphhar,input,sym,oneD,archiveType,CDN_INPUT_DEN_const,&
0,iter,rho,qpw,rht,rhtxy,cdom,cdomvz,cdomvxy)
!
! for lda+U: flip n-matrix
......
......@@ -325,7 +325,7 @@
inp=input
inp%jspins=1
CALL writeDensity(stars,vacuum,atoms,sphhar,inp,sym,oneD,CDN_ARCHIVE_TYPE_CDN_const,CDN_INPUT_DEN_const,&
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)
!---> save mx to file mdnx
......
......@@ -243,7 +243,7 @@
! Write superposed density onto density file
!
iter = 0
CALL writeDensity(stars,vacuum,atoms,sphhar,input,sym,oneD,CDN_ARCHIVE_TYPE_CDN1_const,CDN_INPUT_DEN_const,&
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)
!
! Check continuity
......
......@@ -397,7 +397,7 @@ CONTAINS
!---> write spin-up and -down density on file cdn
CALL writeDensity(stars,vacuum,atoms,sphhar,input,sym,oneD,CDN_ARCHIVE_TYPE_CDN_const,CDN_INPUT_DEN_const,&
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)
DEALLOCATE (qpw,rhtxy,cdom,cdomvz,cdomvxy,&
......
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