cosmomc with gfortran 4.1

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Gil Holder
Posts: 27
Joined: September 25 2004
Affiliation: McGill University

cosmomc with gfortran 4.1

Post by Gil Holder » May 26 2006

Has anyone had any luck compiling cosmomc with gfortran? I've managed to hit peculiar snags with both. 4.0 fails catastrophically complaining about compiler internal errors while 4.1 simply doesn't like the syntax.

With gfortran 4.1 it dies with
In file utils.F90:341

Arr(I)%p(1) => Arr(J)%p(1)
1
Error: Pointer assignment to non-POINTER at (1)
In file utils.F90:342

Arr(J)%p => Temp%p
1
Error: The upper bound in the last dimension must appear in the reference to the
assumed size array 'arr' at (1).
In file utils.F90:295

Temp%p => Arr(I)%p
1
Error: The upper bound in the last dimension must appear in the reference to the
assumed size array 'arr' at (1).
Seems to be unhappy with the quicksort that is being done using pointers. I don't know f90 well enough to hack around it, but the frag of code it is complaining about in utils.f90 is
Temp%p => Arr(I)%p
Arr(I)%p => Arr(J)%p
Arr(J)%p => Temp%p
No other compilers seem to have a problem with this, so it is quite likely a gfortran "feature" but any help would be much appreciated.

Christophe Ringeval
Posts: 17
Joined: November 07 2004
Affiliation: Theoretical and Mathematical Physics Group, CP3, Louvain University
Contact:

cosmomc with gfortran 4.1

Post by Christophe Ringeval » May 09 2007

Hi,
I have encountered this issue as well with gfortran 4.2.

The fix is to replace the "star" by a "column" in the "Arr" declaration.

type(real_pointer), dimension(*) :: Arr

should now read

type(real_pointer), dimension(:) :: Arr

This should be changed in the two routines: QuickSortArr_Real and QuickSortArr

Cheers,
Chris.

Post Reply