stella icon indicating copy to clipboard operation
stella copied to clipboard

Array dimensions in dissipation.f90 too large for older versions of fortran

Open rd1042 opened this issue 4 years ago • 2 comments

In dissipation.f90, there are some arrays which have more than 7 dimensions. This can cause compilation errors, since having an array of rank>7 is only allowed in Fortran 2008 onwards. It is interesting to note that one of the dimensions is "ia", currently hardcoded to 1 so currently redundant (unless it's a placeholder for some future work) e.g. in line ~2100 of dissipation.f90:

        ia = 1

        allocate (deltaj(0:lmax,0:jmax,nspec,nspec,nvpa,nmu,ia,-nzgrid:nzgrid))

Proposed fix: Either remove the "ia" dimensions from these large arrays or include the specification for Fortran >= 2008 in the README

rd1042 avatar Oct 11 '21 09:10 rd1042

@alexvboe, I'm passing this one off to you. Is there any way to reduce the number of dimensions here?

DenSto avatar Oct 11 '21 09:10 DenSto

the ia dimension is indeed a placeholder for the full-flux-surface version of the code, where alpha-dependence will be present. Possible solutions include the introduction of a dedicated type or the use of a super-index for several of the dimensions (even though they're on-processor); in the short term, we can eliminate the ia index, and I can deal with this issue when I get to incorporating collisions into the full-flux-surface version of the code.

mabarnes avatar Oct 11 '21 09:10 mabarnes