Commit 9722f9b6 authored by Daniel Wortmann's avatar Daniel Wortmann

Merge branch 'develop' of ssh://fleur-git/fleur into develop

parents c6a8dc8f ec38e10e
......@@ -12,10 +12,10 @@ project(FLEUR LANGUAGES C Fortran)
set(FLEUR_LIBRARIES ${FLEUR_LIBRARIES} $ENV{FLEUR_LIBRARIES})
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${FLEUR_Fortran_FLAGS} $ENV{CMAKE_Fortran_FLAGS}")
if (DEFINED ENV{FLEUR_NO_SERIAL})
set(FLEUR_USE_SERIAL false)
if (DEFINED ENV{FLEUR_USE_SERIAL})
set(FLEUR_USE_SERIAL ENV{FLEUR_USE_SERIAL})
else()
set(FLEUR_USE_SERIAL true)
set(FLEUR_USE_SERIAL TRUE)
endif()
......
set(FLEUR_DEFINITIONS ${FLEUR_DEFINITIONS} "CPP_DOUBLE")
set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_DOUBLE")
include("cmake/tests/test_doxygen.cmake")
include("cmake/compilerflags.cmake")
include("cmake/tests/test_XML.cmake")
include("cmake/tests/test_LAPACK.cmake")
include("cmake/tests/test_MPI.cmake")
include("cmake/tests/test_HDF5.cmake")
include("cmake/tests/test_MAGMA.cmake")
include("cmake/tests/test_GPU.cmake")
if (FLEUR_USE_MPI)
include("cmake/tests/test_SCALAPACK.cmake")
include("cmake/tests/test_ELPA.cmake")
......
message("************Summary***************")
message("Compiler: ${CMAKE_Fortran_COMPILER}")
message("Compiler ID:${CMAKE_Fortran_COMPILER_ID}")
message("Flags: ${CMAKE_Fortran_FLAGS}")
message("Libraries:${FLEUR_LIBRARIES}")
message("\nThese Libraries are required:")
message("XML Library found:${FLEUR_USE_XML}")
message("LAPACK Library found:${FLEUR_USE_LAPACK}")
message("\nThese Libraries are optional:")
message("HDF5 Library found:${FLEUR_USE_HDF5}")
message("MPI Library found:${FLEUR_USE_MPI}")
if(NOT WIN32)
string(ASCII 27 Esc)
set(CReset "${Esc}[m")
set(Bold "${Esc}[1m")
set(Red "${Esc}[31m")
set(Green "${Esc}[32m")
set(BRed "${Esc}[1;31m")
set(BGreen "${Esc}[1;32m")
endif()
message("${BRed}\n\n************************Summary***************************${CReset}")
message("${Green}Compiler : ${CReset}${CMAKE_Fortran_COMPILER}")
message("${Green}Compiler ID: ${CReset}${CMAKE_Fortran_COMPILER_ID}")
message("${Green}Flags : ${CReset}${CMAKE_Fortran_FLAGS}")
message("${Green}Libraries : ${CReset}${FLEUR_LIBRARIES}")
message("\n${Red}These Libraries are required:${CReset}")
message("${Green} XML Library found :${CReset} ${FLEUR_USE_XML}")
message("${Green} LAPACK Library found:${CReset} ${FLEUR_USE_LAPACK}")
message("${Red}These Libraries are optional:${CReset}")
message("${Green} HDF5 Library found :${CReset} ${FLEUR_USE_HDF5}")
message("${Green} MAGMA Library found:${CReset} ${FLEUR_USE_MAGMA}")
message("${Green} MPI Library found :${CReset} ${FLEUR_USE_MPI}")
if (FLEUR_USE_MPI)
message("SCALAPACK Library found:${FLEUR_USE_SCALAPACK}")
message("ELPA Library found:${FLEUR_USE_ELPA}")
message("${Green} SCALAPACK Library found:${CReset}${FLEUR_USE_SCALAPACK}")
message("${Green} ELPA Library found :${CReset}${FLEUR_USE_ELPA}")
else()
message("${Green} SCALAPACK Library found:${CReset} ---")
message("${Green} ELPA Library found :${CReset} ---")
endif()
message("${Green} Compile GPU version: ${CReset} ${FLEUR_USE_GPU}")
message("\n${Green}Compile serial version : ${CReset}${FLEUR_USE_SERIAL}")
message("${Green}Compile parallel version: ${CReset}${FLEUR_USE_MPI}")
message("\n${Green}Git describe : ${CReset}${git_describe}")
message("${Green}Git hash : ${CReset}${git_hash}")
message("${Green}Doxygen found : ${CReset}${FLEUR_USE_DOXYGEN}")
message("${BRed}************************-------***************************${CReset}")
#some checks
if (NOT FLEUR_USE_XML)
message(FATAL_ERROR "${BRed}No libxml2 Library found. This is required.${CReset}")
endif()
if (NOT FLEUR_USE_LAPACK)
message(FATAL_ERROR "${BRed}No LAPACK Library found. This is required.${CReset}")
endif()
message("Git describe:${git_describe}")
message("Git hash:${git_hash}")
message("************-------***************")
if (NOT (FLEUR_USE_SERIAL OR FLEUR_USE_MPI))
message(FATAL_ERROR "You should either compile a parallel or serial version (or both)")
endif()
......@@ -13,6 +13,7 @@ elseif(${CMAKE_Fortran_COMPILER_ID} MATCHES "PGI")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mp -Mr8 -Mr8intrinsics -Mcuda:kepler+ -ta:tesla:cuda7.5 -DUSE_STREAMS -DNUM_STREAMS=${N_STREAMS} -Minfo=accel -acc")
set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -fast -O3")
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -C -traceback -O0 -g -Mchkstk -Mchkptr")
set(FLEUR_LIBRARIES ${FLEUR_LIBRARIES} "-lstdc++;-L$ENV{MKLROOT}/lib/intel64;-lmkl_scalapack_lp64;-lmkl_intel_lp64;-lmkl_pgi_thread;-lmkl_core;-lmkl_blacs_intelmpi_lp64")
elseif(${CMAKE_Fortran_COMPILER_ID} MATCHES "XL")
message("IBM/BG Fortran detected")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -qsmp=omp -qnosave -qarch=qp -qtune=qp -qrealsize=8 -qfixed -qsuppress=1520-022 -qessl")
......
ml purge
ml PGI MVAPICH2 CMake libxml2/.2.9.4
ml PGI MVAPICH2 CMake libxml2/.2.9.4 imkl
#Check if we can compile with GPU
if ($ENV{FLEUR_USE_GPU})
#No check is done
set(FLEUR_USE_GPU TRUE)
set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_GPU")
set(FLEUR_DEFINITIONS ${FLEUR_DEFINITIONS} "CPP_GPU")
else()
set(FLEUR_USE_GPU FALSE)
endif()
\ No newline at end of file
......@@ -54,6 +54,20 @@ if ( FLEUR_USE_HDF5)
endif()
message("HDF5 Library found:${FLEUR_USE_HDF5}")
if (DEFINED ENV{FLEUR_USE_HDF5})
if (ENV{FLEUR_USE_HDF5})
if (NOT FLEUR_USE_HDF5)
message(FATAL_ERROR "You asked for HDF5 but cmake couldn't find it. Please set HDF5_ROOT and or give additional compiler/linker flags")
endif()
else()
if (FLEUR_USE_HDF5)
message("HDF5 library found, but you explicitely asked not to use it")
set(FLEUR_USE_HDF5 FALSE)
endif()
endif()
endif()
if (FLEUR_USE_HDF5)
message("Parallel HDF5 Library found:${FLEUR_USE_HDF5}")
set(FLEUR_DEFINITIONS ${FLEUR_DEFINITIONS} "CPP_HDF")
......
#First check if we can compile with ELPA
try_compile(FLEUR_USE_MAGMA ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_MAGMA.f90
LINK_LIBRARIES ${FLEUR_LIBRARIES}
)
message("MAGMA Library found:${FLEUR_USE_MAGMA}")
if (FLEUR_USE_MAGMA)
set(FLEUR_DEFINITIONS ${FLEUR_DEFINITIONS} "CPP_MAGMA")
endif()
program test
use magma
IMPLICIT NONE
integer :: mout,err,iwork(5)
REAL :: eigtemp(5),rwork(5)
COMPLEX :: a(5,5),b(5,5),work(5)
call magmaf_zhegvdx_2stage_m(1,1,MagmaVec,MagmaRangeI,MagmaLower,5,a,5,b,5,&
0.0,0.0,1,2,mout,eigTemp,work,5,rwork,5,iwork,5,err)
end
......@@ -5,6 +5,19 @@ LINK_LIBRARIES ${FLEUR_LIBRARIES}
message("MPI Library found:${FLEUR_USE_MPI}")
if (DEFINED ENV{FLEUR_USE_MPI})
if (ENV{FLEUR_USE_MPI})
if (NOT FLEUR_USE_MPI)
message(FATAL_ERROR "You asked for MPI but cmake couldn't find it. Please check your Fortran compiler settings")
endif()
else()
if (FLEUR_USE_MPI)
message("MPI library found, but you explicitely asked not to use it")
set(FLEUR_USE_MPI FALSE)
endif()
endif()
endif()
if (FLEUR_USE_MPI)
set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_MPI")
endif()
\ No newline at end of file
find_package(Doxygen)
set(FLEUR_USE_DOXYGEN ${DOXYGEN_FOUND})
......@@ -194,7 +194,12 @@ CONTAINS
#endif
#ifdef CPP_MAGMA
CASE (diag_magma)
CALL magma_diag(lapw%nmat,eig,ne_found,hamOvlp%a_r,hamOvlp%b_r,zMat%z_r,hamOvlp%a_c,hamOvlp%b_c,zMat%z_c)
if (l_real) THEN
call juDFT_error("REAL diagonalization not implemented in magma.F90")
else
print *,"Start magma_diag"
CALL magma_diag(lapw%nmat,eig,ne_found,a_c=hamOvlp%a_c,b_c=hamOvlp%b_c,z_c=zMat%z_c)
endif
#endif
CASE (diag_lapack2)
if (noco%l_ss) call juDFT_error("zsymsecloc not tested with noco%l_ss")
......
......@@ -13,6 +13,7 @@ MODULE m_magma
!**********************************************************
CONTAINS
SUBROUTINE magma_diag(nsize,eig,ne,a_r,b_r,z_r,a_c,b_c,z_c)
use m_packed_to_full
#ifdef CPP_MAGMA
use magma
#endif
......@@ -62,17 +63,19 @@ CONTAINS
if (l_real) THEN
call packed_to_full(nsize,a_r,largea_r)
call packed_to_full(nsize,b_r,largeb_r)
deallocate(a_r,b_r)
!deallocate(a_r,b_r)
ELSE
call packed_to_full(nsize,a_c,largea_c)
call packed_to_full(nsize,b_c,largeb_c)
deallocate(a_c,b_c)
!deallocate(a_c,b_c)
Endif
if (l_real) call juDFT_error("REAL diagonalization not implemented in magma.F90")
!Query the workspace size
allocate(work(1),rwork(1),iwork(1))
print *,"Magma workspace query"
call flush()
call magmaf_zhegvdx_2stage_m(NGPU_CONST,1,MagmaVec,MagmaRangeI,MagmaLower,nsize,largea_c,nsize,largeb_c,nsize,&
0.0,0.0,1,ne,mout,eigTemp,work,-1,rwork,-1,iwork,-1,err)
lwork=work(1)
......@@ -83,6 +86,8 @@ CONTAINS
allocate(work(lwork),rwork(lrwork),iwork(liwork))
if (err/=0) call juDFT_error("Failed to allocate workspaces",calledby="magma.F90")
!Now the diagonalization
print *,"Magma diagonalization"
print *,nsize,shape(largea_c),shape(eigTemp),ne
call magmaf_zhegvdx_2stage_m(NGPU_CONST,1,MagmaVec,MagmaRangeI,MagmaLower,nsize,largea_c,nsize,largeb_c,nsize,&
0.0,0.0,1,ne,mout,eigTemp,work,lwork,rwork,lrwork,iwork,liwork,err)
print*,"MAGMA info:",err
......@@ -91,8 +96,9 @@ CONTAINS
DO i = 1, ne
eig(i) = eigTemp(i)
z_c(:nsize,i)=largea_c(:nsize,i)
END DO
call judft_error("Eigenvectors are not calculated in MAGMA")
!call judft_error("Eigenvectors are not calculated in MAGMA")
#endif
END SUBROUTINE magma_diag
END MODULE m_magma
......
# add a target to generate API documentation with Doxygen
find_package(Doxygen)
if(DOXYGEN_FOUND)
if(FLEUR_USE_DOXYGEN)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/docs/Doxyfile @ONLY)
add_custom_target(doc
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/docs/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/docs
COMMENT "Generating API documentation with Doxygen" VERBATIM
)
endif(DOXYGEN_FOUND)
endif()
......@@ -475,18 +475,18 @@
OPEN (18,FILE='bands'//spin12(jspin))
ntb = minval(nevk(:))
kx(1) = 0.0
vkr(:,1)=matmul(cell%bmat,vk(:,1))
vkr(:,1)=matmul(vk(:,1),cell%bmat)
DO k = 2, kpts%nkpt
vkr(:,k)=matmul(cell%bmat,vk(:,k))
dk = ( vkr(1,k) - vkr(1,k-1) )**2 + ( vkr(2,k) - vkr(2,k-1) )**2 +&
( vkr(3,k) - vkr(3,k-1) )**2
kx(k) = kx(k-1) + sqrt(dk)
vkr(:,k)=matmul(vk(:,k),cell%bmat)
dk = (vkr(1,k)-vkr(1,k-1))**2 + (vkr(2,k)-vkr(2,k-1) )**2 + &
(vkr(3,k)-vkr(3,k-1))**2
kx(k) = kx(k-1) + sqrt(dk)
ENDDO
DO i = 1, ntb
DO k = 1, kpts%nkpt
write(18,'(2f15.9)') kx(k),ev(i,k)
ENDDO
DO k = 1, kpts%nkpt
write(18,'(2f15.9)') kx(k),ev(i,k)
ENDDO
ENDDO
CLOSE (18)
ENDIF
......
......@@ -30,3 +30,6 @@ eigen/tlo.f90
eigen/vacfun.f90
eigen/vec_for_lo.f90
)
if (FLEUR_USE_GPU)
set(fleur_F90 ${fleur_F90} eigen/hsmt_nonsph_GPU.F90)
endif()
......@@ -66,6 +66,9 @@ CONTAINS
#include"cpp_double.h"
USE m_hsmt_socinit
USE m_hsmt_nonsph
#ifdef CPP_GPU
USE m_hsmt_nonsph_gpu
#endif
USE m_hsmt_sph
USE m_hsmt_extra
USE m_types
......@@ -233,10 +236,18 @@ CONTAINS
kveclo,l_real,hamOvlp%a_r,hamOvlp%b_r,hamOvlp%a_c,hamOvlp%b_c) !out/in
CALL timestop("hsmt extra")
CALL timestart("hsmt non-spherical")
#ifndef CPP_GPU
CALL hsmt_nonsph(DIMENSION,atoms,sym,SUB_COMM,n_size,n_rank,input,isp,nintsp,&
hlpmsize,noco,l_socfirst,lapw,cell,tlmplm,fj,gj,gk,vk,oneD,l_real,hamOvlp%a_r,hamOvlp%a_c)
CALL timestop("hsmt non-spherical")
#else
CALL timestart("hsmt non-spherical-GPU")
CALL hsmt_nonsph_gpu(DIMENSION,atoms,sym,SUB_COMM,n_size,n_rank,input,isp,nintsp,&
hlpmsize,noco,l_socfirst,lapw,cell,tlmplm,fj,gj,gk,vk,oneD,l_real,hamOvlp%a_r,hamOvlp%a_c)
CALL timestop("hsmt non-spherical-GPU")
#endif
ENDIF
ENDDO
#if 1==2
......
This diff is collapsed.
......@@ -516,8 +516,8 @@ CONTAINS
print *,stars%mx1, mxx1, stars%mx2, mxx2
CALL judft_error("BUG in strgn")
endif
stars%mx1=mxx1
stars%mx2=mxx2
!stars%mx1=mxx1
!stars%mx2=mxx2
!
!---> write /str0/ and /str1/ to unit 51
!
......@@ -894,7 +894,7 @@ CONTAINS
ENDDO
ENDDO
ENDIF
if ( stars%mx1 .ne. mxx1 .or. stars%mx2 .ne. mxx2 .or. stars%mx3 .ne. mxx3 ) call &
if ( stars%mx1 < mxx1 .or. stars%mx2 < mxx2 .or. stars%mx3 < mxx3 ) call &
judft_error("BUG 1 in strgen")
stars%ng2 = 2 ; stars%kv2 = 0 ; stars%ig2 = 0 ; igz = 0 ; stars%kimax2= 0 ; stars%igfft2 = 0
stars%sk2 = 0.0 ; stars%pgfft2 = 0.0 ; stars%nstr2 = 0
......
......@@ -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.
......@@ -31,7 +31,7 @@ CONTAINS
IF (ok) RETURN
!Test for environment variable as well
CALL GET_ENVIRONMENT_VARIABLE("juDFT",str,status=i)
IF (i==0) ok=INDEX(str,ADJUSTL(arg))>0
IF (i==0) ok=INDEX(str//' ',TRIM(ADJUSTL(arg))//' ')>0
END FUNCTION juDFT_was_argument
......
......@@ -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
!*****************************************************************
......
......@@ -1641,33 +1641,31 @@
& ncount(:)
COMPLEX(rkind),INTENT(OUT) ::DATA(:,:,:,:,:)
INTEGER(HID_T),INTENT(IN),OPTIONAL::trans
!locals
INTEGER::foffset(SIZE(start))
REAL,ALLOCATABLE::a(:,:,:,:,:),b(:,:,:,:,:)
ALLOCATE(A(SIZE(DATA,1),SIZE(DATA,2),SIZE(DATA,3),SIZE(DATA,4) &
& ,SIZE(DATA,5)),B(SIZE(DATA,1),SIZE(DATA,2),SIZE(DATA,3) &
& ,SIZE(DATA,4),SIZE(DATA,5)))
!locals
INTEGER::foffset(SIZE(start)),fncount(SIZE(start))
REAL,ALLOCATABLE::a(:,:,:,:,:,:)
!
foffset=start
fncount=ncount
!DO 2 calls to read real values
WHERE(start<0)
foffset=1
ENDWHERE
IF (PRESENT(trans)) THEN
CALL io_read_real5(did,foffset,ncount,a,trans)
ELSE
CALL io_read_real5(did,foffset,ncount,a)
ENDIF
WHERE(start<0)
foffset=2
foffset=1
fncount=2
ENDWHERE
IF (PRESENT(trans)) THEN
CALL io_read_real5(did,foffset,ncount,b,trans)
ELSE
CALL io_read_real5(did,foffset,ncount,b)
ENDIF
DATA=CMPLX(a,b)
DEALLOCATE(a,b)
if (count(start<0)/=1) CPP_error("Wrong no of negatives")
if (start(1)<0) then
ALLOCATE(A(2,SIZE(DATA,1),size(data,2),size(data,3),size(data,4),size(data,5)))
CALL io_read_real6(did,foffset,fncount,a,trans)
DATA=CMPLX(a(1,:,:,:,:,:),a(2,:,:,:,:,:))
else if (start(6)<0) then
ALLOCATE(A(SIZE(DATA,1),size(data,2),size(data,3),size(data,4),size(data,5),2))
CALL io_read_real6(did,foffset,fncount,a,trans)
DATA=CMPLX(a(:,:,:,:,:,1),a(:,:,:,:,:,2))
else
CPP_error("Wrong position of negative")
endif
DEALLOCATE(a)
END SUBROUTINE
SUBROUTINE io_write_complex0(did,start,ncount,DATA,trans)
!*****************************************************************
......@@ -1784,26 +1782,20 @@
INTEGER(HID_T),INTENT(IN),OPTIONAL::trans
!locals
INTEGER::foffset(SIZE(start)),fncount(SIZE(start))
real::a(2,size(data,1),size(data,2),size(data,3),size(data,4))
a(1,:,:,:,:)=real(data)
a(2,:,:,:,:)=aimag(data)
fncount=ncount
!
foffset=start
!DO 2 calls to read real values
WHERE(start<0)
foffset=1
ENDWHERE
IF (PRESENT(trans)) THEN
CALL io_write_real4(did,foffset,ncount,REAL(DATA),trans)
ELSE
CALL io_write_real4(did,foffset,ncount,REAL(DATA))
ENDIF
WHERE(start<0)
foffset=2
foffset=1
fncount=2
ENDWHERE
IF (PRESENT(trans)) THEN
CALL io_write_real4(did,foffset,ncount,AIMAG(DATA),trans)
ELSE
CALL io_write_real4(did,foffset,ncount,AIMAG(DATA))
ENDIF
CALL io_write_real5(did,foffset,fncount,a,trans)
END SUBROUTINE
SUBROUTINE io_write_complex5(did,start,ncount,DATA,trans)
!*****************************************************************
......@@ -1817,26 +1809,20 @@
INTEGER(HID_T),INTENT(IN),OPTIONAL::trans
!locals
INTEGER::foffset(SIZE(start)),fncount(SIZE(start))
real::a(2,size(data,1),size(data,2),size(data,3),size(data,4),size(data,5))
a(1,:,:,:,:,:)=real(data)
a(2,:,:,:,:,:)=aimag(data)
fncount=ncount
!
foffset=start
!DO 2 calls to read real values
WHERE(start<0)
foffset=1
ENDWHERE
IF (PRESENT(trans)) THEN
CALL io_write_real5(did,foffset,ncount,REAL(DATA),trans)
ELSE
CALL io_write_real5(did,foffset,ncount,REAL(DATA))
ENDIF
WHERE(start<0)
foffset=2
foffset=1
fncount=2
ENDWHERE
IF (PRESENT(trans)) THEN
CALL io_write_real5(did,foffset,ncount,AIMAG(DATA),trans)
ELSE
CALL io_write_real5(did,foffset,ncount,AIMAG(DATA))
ENDIF
CALL io_write_real6(did,foffset,fncount,a,trans)
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
......
......@@ -26,6 +26,7 @@
USE m_xmlOutput
USE m_winpXML
USE m_setupMPI
USE m_cdn_io
#ifdef CPP_MPI
USE m_mpi_bc_all, ONLY : mpi_bc_all
#endif
......@@ -97,7 +98,7 @@
!-t3e
IF (mpi%irank.EQ.0) THEN
CALL startXMLOutput()
#ifndef __TOS_BGQ__
#if !(defined(__TOS_BGQ__)||defined(__PGI))
!Do not open out-file on BlueGene
OPEN (6,file='out',form='formatted',status='unknown')
#endif
......@@ -488,6 +489,10 @@
!Finalize the MPI setup
CALL setupMPI(kpts%nkpt,mpi)
IF (mpi%irank.EQ.0) THEN
CALL setStartingDensity(noco%l_noco)
END IF
!new check mode will only run the init-part of FLEUR
IF (judft_was_argument("-check")) CALL judft_end("Check-mode done",mpi%irank)
......
......@@ -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
......
......@@ -7,10 +7,9 @@ jt::testrun($executable,$workdir);
#now test output
$result=jt::test_fileexists("$workdir/out");
$result+=jt::test_fileexists("$workdir/cdn1");
$result+=min(jt::test_fileexists("$workdir/cdn1"),jt::test_fileexists("$workdir/cdn.hdf"));
$result+=jt::test_grepexists("$workdir/out","total charge");
$result+=jt::test_grepnumber("$workdir/out","qfix","qfix= *([^ ]*)",1.0,0.00001);
jt::stageresult($workdir,$result,"1");