Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot extract constant size arrays and non-allocatable arrays in modules #2889

Open
hiker opened this issue Feb 10, 2025 · 0 comments
Open
Labels
NG-ARCH Issues relevant to the GPU parallelisation of LFRic and other models expected to be used in NG-ARCH PSyKE Related to the kernel extraction and driver creation PSyKE

Comments

@hiker
Copy link
Collaborator

hiker commented Feb 10, 2025

if an array is used from a module that has a fixed size, e.g.:

  REAL(KIND = r_def), PUBLIC :: profile_data(100)

the driver does not compile. Reason is that the generic interface ReadVariable in the driver for 1d-real (or double) arrays declares the variable to be allocatable, so it doesn't match.

Unfortunately, at the same time, it is not possible to declare a generic interface for allocatable and non-allocatable arrays at the same time (see e.g. https://fortran-lang.discourse.group/t/how-to-have-a-generic-interface-for-both-allocatable-and-non-allocatable-dummy/6114/19).

My current idea is that we have two generic interfaces in ReadVariabe, one for allocatable arrays, one for non-allocatable arrays (with a different, generic name). And then hope that PSyclone has the type information so it can decide which of the two generic interfaces to use.

@hiker hiker added NG-ARCH Issues relevant to the GPU parallelisation of LFRic and other models expected to be used in NG-ARCH PSyData PSyKE Related to the kernel extraction and driver creation PSyKE and removed PSyData labels Feb 10, 2025
hiker added a commit that referenced this issue Feb 14, 2025
…r when we support non-array allocatable types.
hiker added a commit that referenced this issue Feb 18, 2025
hiker added a commit that referenced this issue Feb 18, 2025
hiker added a commit that referenced this issue Feb 18, 2025
hiker added a commit that referenced this issue Feb 21, 2025
hiker added a commit that referenced this issue Feb 23, 2025
hiker added a commit that referenced this issue Feb 23, 2025
hiker added a commit that referenced this issue Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NG-ARCH Issues relevant to the GPU parallelisation of LFRic and other models expected to be used in NG-ARCH PSyKE Related to the kernel extraction and driver creation PSyKE
Projects
None yet
Development

No branches or pull requests

1 participant