[Q-e-developers] Undefined variables in espresso

Andrea Dal Corso dalcorso at sissa.it
Mon Jun 10 10:01:32 CEST 2013


On Mon, 2013-06-10 at 15:38 +0800, Filippo Spiga wrote:
> Dear Vittorio,
> 
> On Jun 10, 2013, at 2:47 PM, Vittorio Zecca <zeccav at gmail.com> wrote:
> > In addusdens.f90 line 104 there is a shape mismatch because tbecsum
> > has one element,
> > while becsum has four.
> 
> 
> 'tbecsum' is a one-dimentional array created to 'store' values of
> 'becsum' varying 'nspin_mag' (latest dimension of a three-dimensional
> array). It can have only one or two or four elements (it depends by
> the input case, see modules/noncol.f90). I said that 'becsum' is
> a three-dimensional array because inside the routine 'addusdens_g' the
> array 'becsum' comes from USPP (Modules/uspp.f90). If you look at the
> file you will see at line 136-137 that 'becsum' is defined as …
> 
> 
>   REAL(DP), ALLOCATABLE :: &
>        becsum(:,:,:)           ! \sum_i f(i) <psi(i)|beta_l><beta_m|
> psi(i)>
> 
> 
> Dimensions across these arrays seems consistent to me. Searching
> across the source code I can find some four-dimensional "becsum"-like
> arrays but they also have different names…
> 
> 
> Carlo? Paolo? Anything to add?

It seems to me that Vittorio is right, tbecsum should be declared nspin,
otherwise in the case in which nspin_mag=1 and nspin=4 you are copying 4
elements of becsum in an array with one element. 
In allocate_nlpot becsum is declared nspin.
Maybe some compilers do not note the problem (so far I had not noticed
it) because you use only one element of tbecsum, but I think it is not
correct fortran.

Andrea

> 
> 
> Regards,
> Filippo
> 
> --
> Mr. Filippo SPIGA, M.Sc.
> http://www.linkedin.com/in/filippospiga ~ skype: filippo.spiga
> 
> «Nobody will drive us out of Cantor's paradise.» ~ David Hilbert
> 
> 
> _______________________________________________
> Q-e-developers mailing list
> Q-e-developers at qe-forge.org
> http://qe-forge.org/mailman/listinfo/q-e-developers
-- 
Andrea Dal Corso                    Tel. 0039-040-3787428
SISSA, Via Bonomea 265              Fax. 0039-040-3787249
I-34136 Trieste (Italy)             e-mail: dalcorso at sissa.it





More information about the developers mailing list