Commit 84bb95e9 authored by Gregor Michalicek's avatar Gregor Michalicek

Some initializations that may prevent writing garbage to the garbage section of cdn.hdf

valgrind reports that some uninitialized bytes are in a buffer to be written out to cdn.hdf.
The bytes surely are in that part of the buffer that does not contain relevant data. To me
The reported line for the error source is the close operation for the file. Therefore
it is not clear whether this originates from fleur or from HDF5. I can only identify that
this appeared while writing out the stars. Therefore I initialized every associated array
that did not seem to be initialized before setting the relevant elements to certain values.

I had to start valgrind with --num-callers=25 to see at least the fleur context for the
reported missing initializations.
parent 73adfb0f
...@@ -75,6 +75,7 @@ CONTAINS ...@@ -75,6 +75,7 @@ CONTAINS
stars%ng2 = 0 stars%ng2 = 0
kv(3) = 0 kv(3) = 0
stars%kv2 = 0
DO k1 = stars%mx1,-stars%mx1,-1 DO k1 = stars%mx1,-stars%mx1,-1
kv(1) = k1 kv(1) = k1
k2_loop:DO k2 = stars%mx2,-stars%mx2,-1 k2_loop:DO k2 = stars%mx2,-stars%mx2,-1
...@@ -183,6 +184,7 @@ CONTAINS ...@@ -183,6 +184,7 @@ CONTAINS
! three dimensional stars ! three dimensional stars
! !
stars%ng3 = 0 stars%ng3 = 0
stars%ig = 0
DO k3 = -stars%mx3,stars%mx3 DO k3 = -stars%mx3,stars%mx3
DO k2 = -stars%mx2,stars%mx2 DO k2 = -stars%mx2,stars%mx2
DO k1 = -stars%mx1,stars%mx1 DO k1 = -stars%mx1,stars%mx1
...@@ -210,6 +212,9 @@ CONTAINS ...@@ -210,6 +212,9 @@ CONTAINS
! zrfs,invs: z-reflection, inversion. ! zrfs,invs: z-reflection, inversion.
IF (sym%zrfs .OR. sym%invs) m0 = 0 IF (sym%zrfs .OR. sym%invs) m0 = 0
stars%ig2 = 0
stars%sk3 = 0.0
stars%kv3 = 0
DO k2 = 1,stars%ng2 DO k2 = 1,stars%ng2
DO k3 = m0,stars%mx3 DO k3 = m0,stars%mx3
s = SQRT(stars%sk2(k2)**2+ (k3*cell%bmat(3,3))**2) s = SQRT(stars%sk2(k2)**2+ (k3*cell%bmat(3,3))**2)
...@@ -434,10 +439,9 @@ CONTAINS ...@@ -434,10 +439,9 @@ CONTAINS
! count number of members for each star ! count number of members for each star
! nstr2 ... members of 2-dim stars ! nstr2 ... members of 2-dim stars
! !
DO k = 1,stars%ng3
stars%nstr2(stars%ig2(k)) = 0 stars%nstr2(:) = 0
stars%nstr(k) = 0 stars%nstr(:) = 0
ENDDO
DO k3 = -stars%mx3,stars%mx3 DO k3 = -stars%mx3,stars%mx3
DO k2 = -mxx2,mxx2 DO k2 = -mxx2,mxx2
......
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