Commit aed07e68 authored by Daniel Wortmann's avatar Daniel Wortmann
Browse files

Fixes for HDF5 version

parent d754b68f
......@@ -50,7 +50,7 @@ CONTAINS
IF (fmpi%irank==0) THEN
call timestart("star-setup")
stars%gmax=input%gmax
call stars%dim(sym,cell)
call stars%dim(sym,cell,input%film)
call stars%init(cell,sym,input%film,input%rkmax)
call timestop("star-setup")
......
......@@ -296,14 +296,6 @@ MODULE m_cdnpot_io_hdf
CALL io_write_integer2(kv3SetID,(/1,1/),dimsInt(:2),stars%kv3)
CALL h5dclose_f(kv3SetID, hdfError)
dims(:2)=(/2,stars%ng2/)
dimsInt=dims
CALL h5screate_simple_f(2,dims(:2),kv2SpaceID,hdfError)
CALL h5dcreate_f(groupID, "kv2", H5T_NATIVE_INTEGER, kv2SpaceID, kv2SetID, hdfError)
CALL h5sclose_f(kv2SpaceID,hdfError)
CALL io_write_integer2(kv2SetID,(/1,1/),dimsInt(:2),stars%kv2)
CALL h5dclose_f(kv2SetID, hdfError)
dims(:1)=(/stars%ng3/)
dimsInt=dims
CALL h5screate_simple_f(1,dims(:1),sk3SpaceID,hdfError)
......@@ -312,14 +304,6 @@ MODULE m_cdnpot_io_hdf
CALL io_write_real1(sk3SetID,(/1/),dimsInt(:1),stars%sk3)
CALL h5dclose_f(sk3SetID, hdfError)
dims(:1)=(/stars%ng2/)
dimsInt=dims
CALL h5screate_simple_f(1,dims(:1),sk2SpaceID,hdfError)
CALL h5dcreate_f(groupID, "sk2", H5T_NATIVE_DOUBLE, sk2SpaceID, sk2SetID, hdfError)
CALL h5sclose_f(sk2SpaceID,hdfError)
CALL io_write_real1(sk2SetID,(/1/),dimsInt(:1),stars%sk2)
CALL h5dclose_f(sk2SetID, hdfError)
dims(:3)=(/2*stars%mx1+1,2*stars%mx2+1,2*stars%mx3+1/)
dimsInt=dims
CALL h5screate_simple_f(3,dims(:3),igSpaceID,hdfError)
......@@ -328,14 +312,6 @@ MODULE m_cdnpot_io_hdf
CALL io_write_integer3(igSetID,(/1,1,1/),dimsInt(:3),stars%ig)
CALL h5dclose_f(igSetID, hdfError)
dims(:1)=(/stars%ng3/)
dimsInt=dims
CALL h5screate_simple_f(1,dims(:1),ig2SpaceID,hdfError)
CALL h5dcreate_f(groupID, "ig2", H5T_NATIVE_INTEGER, ig2SpaceID, ig2SetID, hdfError)
CALL h5sclose_f(ig2SpaceID,hdfError)
CALL io_write_integer1(ig2SetID,(/1/),dimsInt(:1),stars%ig2)
CALL h5dclose_f(ig2SetID, hdfError)
dims(:1)=(/stars%ng3/)
dimsInt=dims
CALL h5screate_simple_f(1,dims(:1),nstrSpaceID,hdfError)
......@@ -344,22 +320,6 @@ MODULE m_cdnpot_io_hdf
CALL io_write_integer1(nstrSetID,(/1/),dimsInt(:1),stars%nstr)
CALL h5dclose_f(nstrSetID, hdfError)
dims(:1)=(/stars%ng2/)
dimsInt=dims
CALL h5screate_simple_f(1,dims(:1),nstr2SpaceID,hdfError)
CALL h5dcreate_f(groupID, "nstr2", H5T_NATIVE_INTEGER, nstr2SpaceID, nstr2SetID, hdfError)
CALL h5sclose_f(nstr2SpaceID,hdfError)
CALL io_write_integer1(nstr2SetID,(/1/),dimsInt(:1),stars%nstr2)
CALL h5dclose_f(nstr2SetID, hdfError)
dims(:1)=(/stars%ng2/)
dimsInt=dims
CALL h5screate_simple_f(1,dims(:1),phi2SpaceID,hdfError)
CALL h5dcreate_f(groupID, "phi2", H5T_NATIVE_DOUBLE, phi2SpaceID, phi2SetID, hdfError)
CALL h5sclose_f(phi2SpaceID,hdfError)
CALL io_write_real1(phi2SetID,(/1/),dimsInt(:1),stars%phi2)
CALL h5dclose_f(phi2SetID, hdfError)
dims(:4)=(/2,2*stars%mx1+1,2*stars%mx2+1,2*stars%mx3+1/)
dimsInt=dims
CALL h5screate_simple_f(4,dims(:4),rgphsSpaceID,hdfError)
......@@ -368,9 +328,48 @@ MODULE m_cdnpot_io_hdf
CALL io_write_complex3(rgphsSetID,(/-1,1,1,1/),dimsInt(:4),stars%rgphs)
CALL h5dclose_f(rgphsSetID, hdfError)
!Film stuff
IF (stars%ng2>0) THEN
dims(:2)=(/2,stars%ng2/)
dimsInt=dims
CALL h5screate_simple_f(2,dims(:2),kv2SpaceID,hdfError)
CALL h5dcreate_f(groupID, "kv2", H5T_NATIVE_INTEGER, kv2SpaceID, kv2SetID, hdfError)
CALL h5sclose_f(kv2SpaceID,hdfError)
CALL io_write_integer2(kv2SetID,(/1,1/),dimsInt(:2),stars%kv2)
CALL h5dclose_f(kv2SetID, hdfError)
dims(:1)=(/stars%ng2/)
dimsInt=dims
CALL h5screate_simple_f(1,dims(:1),sk2SpaceID,hdfError)
CALL h5dcreate_f(groupID, "sk2", H5T_NATIVE_DOUBLE, sk2SpaceID, sk2SetID, hdfError)
CALL h5sclose_f(sk2SpaceID,hdfError)
CALL io_write_real1(sk2SetID,(/1/),dimsInt(:1),stars%sk2)
CALL h5dclose_f(sk2SetID, hdfError)
dims(:1)=(/stars%ng3/)
dimsInt=dims
CALL h5screate_simple_f(1,dims(:1),ig2SpaceID,hdfError)
CALL h5dcreate_f(groupID, "ig2", H5T_NATIVE_INTEGER, ig2SpaceID, ig2SetID, hdfError)
CALL h5sclose_f(ig2SpaceID,hdfError)
CALL io_write_integer1(ig2SetID,(/1/),dimsInt(:1),stars%ig2)
CALL h5dclose_f(ig2SetID, hdfError)
dims(:1)=(/stars%ng2/)
dimsInt=dims
CALL h5screate_simple_f(1,dims(:1),nstr2SpaceID,hdfError)
CALL h5dcreate_f(groupID, "nstr2", H5T_NATIVE_INTEGER, nstr2SpaceID, nstr2SetID, hdfError)
CALL h5sclose_f(nstr2SpaceID,hdfError)
CALL io_write_integer1(nstr2SetID,(/1/),dimsInt(:1),stars%nstr2)
CALL h5dclose_f(nstr2SetID, hdfError)
!dims(:1)=(/stars%ng2/)
!dimsInt=dims
!CALL h5screate_simple_f(1,dims(:1),phi2SpaceID,hdfError)
!CALL h5dcreate_f(groupID, "phi2", H5T_NATIVE_DOUBLE, phi2SpaceID, phi2SetID, hdfError)
!CALL h5sclose_f(phi2SpaceID,hdfError)
!CALL io_write_real1(phi2SetID,(/1/),dimsInt(:1),stars%phi2)
!CALL h5dclose_f(phi2SetID, hdfError)
ENDIF
CALL h5gclose_f(groupID, hdfError)
END SUBROUTINE writeStarsHDF
......@@ -465,51 +464,56 @@ MODULE m_cdnpot_io_hdf
CALL io_read_integer2(kv3SetID,(/1,1/),dimsInt(:2),stars%kv3)
CALL h5dclose_f(kv3SetID, hdfError)
dimsInt(:2)=(/2,stars%ng2/)
CALL h5dopen_f(groupID, 'kv2', kv2SetID, hdfError)
CALL io_read_integer2(kv2SetID,(/1,1/),dimsInt(:2),stars%kv2)
CALL h5dclose_f(kv2SetID, hdfError)
dimsInt(:1)=(/stars%ng3/)
CALL h5dopen_f(groupID, 'sk3', sk3SetID, hdfError)
CALL io_read_real1(sk3SetID,(/1/),dimsInt(:1),stars%sk3)
CALL h5dclose_f(sk3SetID, hdfError)
dimsInt(:1)=(/stars%ng2/)
CALL h5dopen_f(groupID, 'sk2', sk2SetID, hdfError)
CALL io_read_real1(sk2SetID,(/1/),dimsInt(:1),stars%sk2)
CALL h5dclose_f(sk2SetID, hdfError)
dimsInt(:3)=(/2*stars%mx1+1,2*stars%mx2+1,2*stars%mx3+1/)
CALL h5dopen_f(groupID, 'ig', igSetID, hdfError)
CALL io_read_integer3(igSetID,(/1,1,1/),dimsInt(:3),stars%ig)
CALL h5dclose_f(igSetID, hdfError)
dimsInt(:1)=(/stars%ng3/)
CALL h5dopen_f(groupID, 'ig2', ig2SetID, hdfError)
CALL io_read_integer1(ig2SetID,(/1/),dimsInt(:1),stars%ig2)
CALL h5dclose_f(ig2SetID, hdfError)
dimsInt(:1)=(/stars%ng3/)
CALL h5dopen_f(groupID, 'nstr', nstrSetID, hdfError)
CALL io_read_integer1(nstrSetID,(/1/),dimsInt(:1),stars%nstr)
CALL h5dclose_f(nstrSetID, hdfError)
dimsInt(:1)=(/stars%ng2/)
CALL h5dopen_f(groupID, 'nstr2', nstr2SetID, hdfError)
CALL io_read_integer1(nstr2SetID,(/1/),dimsInt(:1),stars%nstr2)
CALL h5dclose_f(nstr2SetID, hdfError)
dimsInt(:1)=(/stars%ng2/)
CALL h5dopen_f(groupID, 'phi2', phi2SetID, hdfError)
CALL io_read_real1(phi2SetID,(/1/),dimsInt(:1),stars%phi2)
CALL h5dclose_f(phi2SetID, hdfError)
dimsInt(:4)=(/2,2*stars%mx1+1,2*stars%mx2+1,2*stars%mx3+1/)
CALL h5dopen_f(groupID, 'rgphs', rgphsSetID, hdfError)
CALL io_read_complex3(rgphsSetID,(/-1,1,1,1/),dimsInt(:4),stars%rgphs)
CALL h5dclose_f(rgphsSetID, hdfError)
IF (stars%ng2>0) THEN
dimsInt(:2)=(/2,stars%ng2/)
CALL h5dopen_f(groupID, 'kv2', kv2SetID, hdfError)
CALL io_read_integer2(kv2SetID,(/1,1/),dimsInt(:2),stars%kv2)
CALL h5dclose_f(kv2SetID, hdfError)
dimsInt(:1)=(/stars%ng2/)
CALL h5dopen_f(groupID, 'sk2', sk2SetID, hdfError)
CALL io_read_real1(sk2SetID,(/1/),dimsInt(:1),stars%sk2)
CALL h5dclose_f(sk2SetID, hdfError)
dimsInt(:1)=(/stars%ng3/)
CALL h5dopen_f(groupID, 'ig2', ig2SetID, hdfError)
CALL io_read_integer1(ig2SetID,(/1/),dimsInt(:1),stars%ig2)
CALL h5dclose_f(ig2SetID, hdfError)
dimsInt(:1)=(/stars%ng2/)
CALL h5dopen_f(groupID, 'nstr2', nstr2SetID, hdfError)
CALL io_read_integer1(nstr2SetID,(/1/),dimsInt(:1),stars%nstr2)
CALL h5dclose_f(nstr2SetID, hdfError)
!dimsInt(:1)=(/stars%ng2/)
!CALL h5dopen_f(groupID, 'phi2', phi2SetID, hdfError)
!CALL io_read_real1(phi2SetID,(/1/),dimsInt(:1),stars%phi2)
!CALL h5dclose_f(phi2SetID, hdfError)
ENDIF
......
......@@ -121,7 +121,7 @@
<xsd:complexType name="DensityType">
<xsd:attribute name="ng3" type="xsd:positiveInteger" use="required"/>
<xsd:attribute name="ng2" type="xsd:positiveInteger" use="required"/>
<xsd:attribute name="ng2" type="xsd:nonNegativeInteger" use="required"/>
</xsd:complexType>
<xsd:complexType name="BandsType">
......
......@@ -76,10 +76,14 @@ def test_CoUnfold(execute_fleur, grep_exists, grep_number):
if with_hdf:
# assert grep_exists(res_files['out'], "it= 1 is completed")
assert grep_exists(res_files['bands_sc.1'], "0.91620.*0.94323")
assert grep_exists(res_files['bands_sc.1'], "14.0343.*0.03976")
assert grep_exists(res_files['bands_sc.2'], "18.1958.*0.62228")
assert grep_exists(res_files['bands_sc.2'], "27.1348.*0.00942")
#assert grep_exists(res_files['bands_sc.1'], "0.91620.*0.94323")
#assert grep_exists(res_files['bands_sc.1'], "14.0343.*0.03976")
#assert grep_exists(res_files['bands_sc.2'], "18.1958.*0.62228")
#assert grep_exists(res_files['bands_sc.2'], "27.1348.*0.00942")
assert grep_exists(res_files['bands_sc.1'], "-8.9216.*0.94323")
assert grep_exists(res_files['bands_sc.1'], "6.028.*0.8807")
assert grep_exists(res_files['bands_sc.2'], "10.489.*0.016")
assert grep_exists(res_files['bands_sc.2'], "15.513.*0.01174")
else:
assert grep_exists(res_files['bands_sc.1'], "-8.9216.*0.94323")
assert grep_exists(res_files['bands_sc.1'], "6.028.*0.8807")
......
......@@ -44,4 +44,4 @@ def test_H2ORelaxBFGS(execute_fleur, grep_number, grep_exists):
#assert grep_exists(res_files['relax.xml'], "0.0101")
tenergy = grep_number(res_files['out'], "total energy=", "=")
assert abs(tenergy - -75.961979) <= 0.000002
assert abs(tenergy - -75.95475) <= 0.000002
......@@ -278,7 +278,10 @@ CONTAINS
ENDIF
END SUBROUTINE init_stars
subroutine dim_stars(stars,sym,cell)
subroutine dim_stars(stars,sym,cell,film)
!! determine the key dimensions of the stars:
!! mx1,mx2,mx3
!! ng3, ng2
USE m_spgrot
USE m_types_cell
USE m_types_sym
......@@ -286,6 +289,7 @@ CONTAINS
CLASS(t_stars),INTENT(INOUT) :: stars
TYPE(t_cell),INTENT(IN) :: cell
TYPE(t_sym),INTENT(IN) :: sym
LOGICAL,INTENT(IN) :: film
INTEGER :: k1,k2,k3,n,kv(3),kr(3,sym%nop)
REAL :: s,g(3),gmax2
......@@ -340,6 +344,7 @@ CONTAINS
ENDDO y_dim
ENDDO x_dim
if (.not.film) stars%ng2=0
DEALLOCATE(stars%ig)
DEALLOCATE(stars%i2g)
......
Supports Markdown
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