spread function compiler bug with gfortran-8

Issue #15 resolved
Joseph Parker created an issue

Currently some of the tests fail with:

Fortran runtime error: rank mismatch in spread()
[snip]
#4  0xd6c8d9 in __dist_fn_MOD_get_init_field
    at /home/joseph/code/gs2/dist_fn.f90:7056

This appears to be a compiler bug in 8.1.0 (for me) and 8.1.1 for this SO. I recommend the comments to answer 1 as an exemplar of constructive discourse...

I think we should just bump the version of gfortran used in the docker image.

Comments (4)

  1. Joseph Parker reporter

    PS: Example program which fails with gfortran 8 and works with gfortran 7:

    PROGRAM test_spread
      integer :: ntgrid = 2
      integer :: ntheta0 = 3
      integer :: naky = 5
      integer, dimension (:,:,:), allocatable :: bmagsp
      integer, dimension (:), allocatable :: bmag
    
      allocate(bmagsp(-ntgrid:ntgrid,ntheta0,naky))
      allocate(bmag(-ntgrid:ntgrid))
    
      bmag = (/ 1, 2, 3, 4 /)
    
      bmagsp=spread(spread(bmag,2,ntheta0),3,naky)
    
      write(*,*) bmagsp
    
    END PROGRAM
    
  2. Peter Hill

    I can confirm this is fixed in 8.2 -- I'm in favour of just bumping the version used in docker image, as you suggest

  3. Log in to comment