This code compile OK with v.6.0 not v.6.1-2... is it a bug ?

Hi,

I can compile a prog with pfg90 v6.0 but not v6.1-2
Here’s the prog :


PROGRAM essai
IMPLICIT NONE

INTEGER PNB_EPHNUM_QUALITE
PARAMETER (PNB_EPHNUM_QUALITE = 100)
DOUBLE PRECISION PXPASEPHNUM
PARAMETER (PXPASEPHNUM = EPSILON(1.d0))
DOUBLE PRECISION PXPASQEPHFINES
PARAMETER (PXPASQEPHFINES= dble(PNB_EPHNUM_QUALITE) * PXPASEPHNUM) <----- here’s the bug

WRITE(,) “Hello World”


WRITE (,) PXPASQEPHFINES, EPSILON(1.d0)*DBLE(PNB_EPHNUM_QUALITE), PXPASQEPHFINES - EPSILON(1.d0)*DBLE(PNB_EPHNUM_QUALITE)


END PROGRAM essai

With version 6.1-2, I get :
PGF90-S-0091-Constant expression of wrong data type (essai.F90: 9)
PGF90-S-0091-Constant expression of wrong data type (essai.F90: 9)
0 inform, 0 warnings, 2 severes, 0 fatal for essai

And nothing with v.6.0. Is it a bug or I need to add a compilation option or something else with the new version ???

Thanks, Pierre.

Hi Pierre,

For some reason, the compiler isn’t recognizing that “dble(PNB_EPHNUM_QUALITE)” is a constant expression. I’ve filed a technical problem report (TPR#3812) and will have one of our compiler engineers take a look.

The work around is to remove “dble” from the parameter. The compiler automatically promotes PNB_EPHNUM_QUALITE to a double for the calculation, so “dble” is not necessary. Below is the results using pgf90 6.0 using the original source versus pgf90 6.1 compiling source where I have removed “dble” from the parameter at line 9.

% pgf90 uf489_org.f90 -o uf489_60.out -V6.0
% pgf90 uf489_mod.f90 -o uf489_61.out -V6.1
% uf489_60.out
 Hello World
   2.2204460492503131E-014   2.2204460492503131E-014    0.000000000000000
% uf489_61.out
 Hello World
   2.2204460492503131E-014   2.2204460492503131E-014    0.000000000000000

Thank you for bring this to our attention,
Mat

Thanks !

Hi,

I’m getting the same PGF90-S-0091 error on the following bit
of code:

INTEGER4, PARAMETER :: NCAMS
REAL, PARAMETER :: TLINE = 0.0408
INTEGER
4, PARAMETER, DIMENSION(NCAMS) :: DELTATL =
C (/ 0,1468,2760,
C 3887,5000,6113,
C 7240,8532,10000 /)
REAL, DIMENSION(NCAMS) :: DELTAT = DELTATL*TLINE

The error occurs on the last line of code, defining DELTAT.

I’m using V6.1 of the PGF90 compiler, with the -r4 and -i4
options.

Thanks,

Catherine

Hi Catherine,

Thank you for the report. This appears to be a different bug than the one Pierre reported so I’ve sent a report to our compiler team and issued a techincal problem report (TPR#3854). As a work around, you can intialize DELTAT using an array constructor. For example:

REAL, DIMENSION(NCAMS) :: DELTAT  = (/ (DELTATL(I) * TLINE, I = 1,NCAMS) /)
  • Mat