I’m migrating my f90(95) code from intel ifort to Portland compiler and encountered some language features intel supports and pgf90 seems not.
- pgf90 gives error on power operation in parameter intialization, i.e
real(DP), parameter :: x=2.2**3.1
is not allowed
- pgf90 gives error if dummy variable has both optional and allocatable attribute, or intent() and allocatable attribute. I.e
real(DP), intent(inout), allocatable, dimension(:) :: x
real(DP), optional, allocatable, dimension(:) :: x
PGF90-S-0134-Illegal attribute - conflict with allocatable (…)
I looked through f95 reference books, and could not find any restriction on such combinations (plus ifort handles them fine). Yes, intent cannot be used with pointers, but not allocatable arrays. But even if ‘intent’ indeed may have little sense for allocatable arrays, ‘optional and allocatable’ is definitely useful.