Commit 1fcec43a authored by Daniel Wortmann's avatar Daniel Wortmann

Some fixes to compile without HDF

parent 8134ddfd
......@@ -20,6 +20,7 @@ else()
set(diag_test_files diagonalization/elpa.F90)
endif()
if (FLEUR_USE_HDF)
set(diag_test_files ${diag_test_files}
diagonalization/diag_test.F90
diagonalization/eigen_diag.F90
......@@ -47,3 +48,4 @@ target_link_libraries(diag_test ${FLEUR_LIBRARIES})
target_link_libraries(diag_test juDFT)
set_target_properties(diag_test PROPERTIES Fortran_MODULE_DIRECTORY modules/diag_test COMPILE_OPTIONS -Imodules/diag_test RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/tools")
endif()
......@@ -32,6 +32,9 @@ io/writeOutParameters.f90
io/xsf_io.f90
io/xmlIntWrapFort.f90
io/xmlOutput.F90
io/iomatrix_hdf.F90
)
if (FLEUR_USE_HDF)
set(fleur_F90 ${fleur_F90}
io/iomatrix_hdf.F90)
endif()
......@@ -8,8 +8,8 @@ MODULE m_io_matrix
USE m_types_mat
USE m_types_mpimat
USE m_judft
USE m_iomatrix_hdf
#ifdef CPP_HDF
USE m_iomatrix_hdf
USE hdf5
#endif
IMPLICIT NONE
......@@ -17,7 +17,9 @@ MODULE m_io_matrix
TYPE t_iomatrix_handle
INTEGER:: mode=0 !can be 1 for DA or 2 for HDF
INTEGER:: id !file ID in direct-access mode
#ifdef CPP_HDF
INTEGER(hid_t):: fid,did !file-handle in hdf mode
#endif
END TYPE t_iomatrix_handle
TYPE(t_iomatrix_handle)::fh(10)
......@@ -39,8 +41,12 @@ CONTAINS
fh(open_matrix)%mode=1
fh(OPEN_matrix)%id=open_DA(l_real,matsize,no_rec,filename)
CASE(2)
#ifdef CPP_HDF
fh(open_matrix)%mode=2
CALL iomatrix_hdf_open(l_real,matsize,no_rec,filename,fh(open_matrix)%fid,fh(open_matrix)%did)
#else
CALL judft_error("You compiled without HDF5")
#endif
CASE default
CALL judft_error("BUG in io_matrix")
END SELECT
......@@ -60,7 +66,11 @@ CONTAINS
CALL judft_error("Matrix IO for parallel matrix only with HDF5")
END SELECT
CASE(2)
#ifdef CPP_HDF
CALL iomatrix_hdf_read(mat,rec,fh(id)%did)
#else
CALL judft_error("You compiled without HDF5")
#endif
CASE default
CALL judft_error("BUG in io_matrix")
END SELECT
......@@ -79,7 +89,11 @@ CONTAINS
CALL judft_error("Matrix IO for parallel matrix only with HDF5")
END SELECT
CASE(2)
#ifdef CPP_HDF
CALL iomatrix_hdf_write(mat,rec,fh(id)%did)
#else
CALL judft_error("You compiled without HDF5")
#endif
CASE default
CALL judft_error("BUG in io_matrix")
END SELECT
......@@ -91,7 +105,11 @@ CONTAINS
CASE (1)
CALL close_matrix_DA(fh(id)%id)
CASE (2)
#ifdef CPP_HDF
CALL iomatrix_hdf_close(fh(id)%fid,fh(id)%did)
#else
CALL judft_error("You compiled without HDF5")
#endif
CASE default
CALL judft_error("BUG in io_matrix")
END SELECT
......
......@@ -21,7 +21,6 @@ CONTAINS
INTEGER(hsize_t):: dims(4)
INTEGER :: err
REAL,ALLOCATABLE :: dat(:,:,:,:)
SELECT TYPE(mat)
TYPE is (t_mpimat)
mpi_comm=mat%blacsdata%mpi_com !Only information used from mat intent(in)
......
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