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

Use of pwr function in parameter statements causes parser error #39

Open
johnmauff opened this issue Dec 6, 2021 · 1 comment
Open

Comments

@johnmauff
Copy link

It appears that the use of the pwr function ()**3 in parameter statements causes a parsing error. I have attached an example Fortran file.

module_mp_nssl_2mom.txt

@domcharrier
Copy link
Collaborator

Confirmed and working on this. However, need to push some other bigger changes first. So it will take a couple of days till I get back here.

To document a workaround:

Assuming you are using the C preprocessor anyway, you could wrap all troublesome parameters as follows:

#ifndef GPUFORT_IGNORE
real, parameter :: myparam = x**3
#endif

This further assumes that these parameters do not appear in a offloaded parallel region.
In the latter case, you could still do:

#ifndef GPUFORT_IGNORE
real, parameter :: myparam = x**3
# else
real, parameter :: myparam
#endif

As GPUFORT also has a C preprocessor, you can run it then with gpufort -DGPUFORT_IGNORE and
it will ignore these parameters or their RHS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants