selected_real_kind on AMD Opteron?

Hi,

we have some problems porting a numerical model to our AMD Opteron server, using pgf90 version 5.2.

As the model comes from 32bit, it says

INTEGER, PARAMETER :: dp = SELECTED_REAL_KIND(12,307)

and there are a lot of functions like

ELEMENTAL REAL(dp) FUNCTION func1(in1, in2, in3)

Everything was fine on 32bit systems, but we just don’t know how to compile this stuff on an Opteron. We used this Intel thing before, so it is our first try with pgf90.

The pfg90 says:

PGF90-S-0087-Non-constant expression where constant expression required (program.f90: 285)
PGF90-S-0081-Illegal selector - KIND parameter has unknown value for data type (program.f90: 285)

(line 285 is this ELEMENTAL REAL(dp) FUNCTION… line)

It doesn’t seem to be a pgf90 problem, but maybe there’s someone developing under AMD’s 64bit, using pgf90? Is there an ‘easy’ solution like just typing INTEGER, PARAMETER :: dp = SELECTED_REAL_KIND(something else than 12,307)?

Thanx very much,

Thomas

Hi Thomas,

It looks to us like this might be a problem with the compiler’s handling of ELEMENTAL rather than an issue with your 64-bit port. Could you create a small test case from you code and send it with an explaination of the problem to trs@pgroup.com?

Thanks,
Mat

Hi Thomas,

You might try moving “ELEMENTAL” after “REAL(dp)”

ELEMENTAL REAL(dp) FUNCTION func1(in1, in2, in3)

to

REAL(dp) ELEMENTAL FUNCTION func1(in1, in2, in3)

This seems to work for us, but please still send us a problem report so we can get this bug fixed.

Thanks,
Mat

Hi Mat,

that’s great!

I changed all this ELEMENTAL stuff (moving it AFTER real(dp)),
and everything compiles fine!

Thanks very much for your help!!

I will still send a short ‘problem’ report on this to the email adress you mentioned.


Thanks,

Thomas