stellaGK / stella

stella is a flux tube gyrokinetic code for micro-stability and turbulence simulations of strongly magnetised plasma.
https://stellagk.github.io/stella/
Other
21 stars 10 forks source link

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

Open rd1042 opened 2 years ago

rd1042 commented 2 years ago

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

DenSto commented 2 years ago

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

mabarnes commented 2 years ago

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.