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

dfloat -> dble #210

Closed
naromero77 opened this issue Jun 11, 2020 · 2 comments · Fixed by #211
Closed

dfloat -> dble #210

naromero77 opened this issue Jun 11, 2020 · 2 comments · Fixed by #211

Comments

@naromero77
Copy link
Contributor

Many Office of Science codes use dfloat(n) where n is some integer to convert to double precision. Unfortunately, this is not a standard Fortran intrinsic procedure. It appears to be some extension that is supported by GCC and Intel (which probably covers well over 80% of the everyday Fortran compiler usage)

The correct way to do this is using dble(n). More info here:
flang-compiler/f18#1077

I grepped through the NWChem source code and there way too many places where dfloat is used, e.g. TCE, DFT, etc., to fix this manually. Maybe there is some macro magic that can handle this or I can push the Flang developers to implement it, but it will probably end up low on their priority list.

I don't expect you guys to switch over to dble(n), but mostly making you aware of the issue. But if you do want to switch over, I am willing to make the PR for it :)

@jeffhammond
Copy link
Collaborator

I would like to fix this globally. DBLE is standard since Fortran 77 so we should be able to use it unconditionally. We can do this with sed.

@jeffhammond
Copy link
Collaborator

Please test the linked pull request @naromero77. The good news is that DBLE is shorter than DFLOAT, so we won't run into 72-column problems :-)

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

Successfully merging a pull request may close this issue.

2 participants