Dear all,

I am trying to make my subroutine like this:

```
subroutine doubleSum(data,nan)
real, optional :: nan
real, intent(in out) :: data(:,:)
integer, parameter :: nx= size(data,1), ny = size(data,2)
double precision :: dData(nx,ny)
dData = dble(data)
print *,sum(dData) / (nx*ny)
end subroutine doubleSum
```

When I compile this, I get the following message:

PGF90-S-0087-Non-constant expression where constant expression required (doubleSum.f90: 4)

PGF90-S-0087-Non-constant expression where constant expression required (doubleSum.f90: 4)

PGF90-W-0435-Array declared with zero size (doubleSum.f90: 5)

PGF90-W-0435-Array declared with zero size (doubleSum.f90: 5)

0 inform, 2 warnings, 2 severes, 0 fatal for doublesum

It compiles and works fine in gfortran. Does anybody have any idea how to make this work in PGI fortran as well? The same code should work in both compilers.

It just puzzles me…

Thanks for your suggestions,

Vandome