diff --git a/PW/setup.f90 b/PW/setup.f90 index cc2f2edb5..16bcd0b99 100644 --- a/PW/setup.f90 +++ b/PW/setup.f90 @@ -136,7 +136,15 @@ SUBROUTINE setup() ! ! ... Set the number of electrons equal to the total ionic charge ! +#if defined (__PGI) + IF ( nelec == 0.D0 ) THEN + DO na = 1, nat + nelec = nelec + zv( ityp(na) ) + END DO + END IF +#else IF ( nelec == 0.D0 ) nelec = SUM( zv(ityp(1:nat)) ) +#endif ! ! ... If the occupations are from input, check the consistency with the ! ... number of electrons