stfc / PSyclone

Domain-specific compiler and code transformation system for Finite Difference/Volume/Element Earth-system models in Fortran
BSD 3-Clause "New" or "Revised" License
107 stars 29 forks source link

Hoisting arrays with kind specifiers imported from a module doesn't hoist the import statement `HoistLocalArraysTrans` #2667

Open LonelyCat124 opened 4 months ago

LonelyCat124 commented 4 months ago

In this code

module my_mod
   ...
   contains
subroutine my_sub(...)
   use realtype, only: my_real
   real(kind = my_real), allocatable, dimension(:,:) :: my_array
end subroutine
end module

When the my_array is hoisted to the module in the transformation scripts (using HoistLocalArraysTrans) the my_real declaration isn't hoisted into the module, so the code doesn't compile.