[Pw_forum] unallocated variable

2011-11-22 Thread Paolo Giannozzi

On Nov 22, 2011, at 5:00 , David Strubbe wrote:

> I compiled with Intel and debugging flags, and
> encountered a runtime error due to use of an
> unallocated variable.

thank you. It was fixed one week ago (rev. 8243)

P.
---
Paolo Giannozzi, Dept of Chemistry,
Univ. Udine, via delle Scienze 208, 33100 Udine, Italy
Phone +39-0432-558216, fax +39-0432-558222






[Pw_forum] unallocated variable

2011-11-21 Thread David Strubbe
Dear developers,

I compiled with Intel and debugging flags, and encountered a runtime error
due to use of an unallocated variable. The value will not ultimately be
used, but it seems like it could cause segmentation faults or memory
corruption, and at any rate makes it harder to use these flags to find
other bugs.

I ran example09, on 4 nodes, ch4.nm.in
intel/11.1.072, mkl/11.1.072, fftw/3.2.2-intel,openmpi/1.4.2-intel
FFLAGS = -g -O0 -check all -traceback

In the output, I get:

Representation #  3 mode #   3

...

End of self-consistent calculation

 Convergence has been achieved

 Number of q in the star =1
 List of q in the star:
  1   0.0   0.0   0.0
forrtl: severe (408): fort: (8): Attempt to fetch from allocatable variable
RAMTNS when it is not allocated

Image  PCRoutineLineSource

ph.x   01A7F16D  Unknown   Unknown  Unknown
ph.x   01A7DC75  Unknown   Unknown  Unknown
ph.x   01A201A0  Unknown   Unknown  Unknown
ph.x   019B853F  Unknown   Unknown  Unknown
ph.x   019B8942  Unknown   Unknown  Unknown
ph.x   0046EFAC  dynmatrix_150
 dynmatrix.f90
ph.x   00443CAA  MAIN__118
 phonon.f90
ph.x   00443A9C  Unknown   Unknown  Unknown
libc.so.6  2B76493A8994  Unknown   Unknown  Unknown
ph.x   004439A9  Unknown   Unknown  Unknown

The offending lines in PH/dynmatrix.f90 are:

 IF (lgamma.AND.done_epsil.AND.done_zeu) THEN
CALL write_dyn_mat_header( fildyn, ntyp, nat, ibrav, nspin_mag, &
 celldm, at, bg, omega, symm_type, atm, pmass, tau, ityp,
m_loc, &
 nqq, epsilon, zstareu, lraman, ramtns*omega/fpi*convfact)

I added

  if(.not. allocated(ramtns)) allocate ( ramtns (3, 3, 3, nat) )

before the call, which allowed the calculation to complete, but what really
ought to be done is to avoid passing this thing at all when lraman ==
.false. since ramtns is an optional parameter to write_dyn_mat_header.

David Strubbe
UC Berkeley
-- next part --
An HTML attachment was scrubbed...
URL: 
http://www.democritos.it/pipermail/pw_forum/attachments/2021/cb486a03/attachment.htm