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 Cray-compatible syntax for multi-line string literals #1554

Merged
merged 1 commit into from
Jul 26, 2024

Conversation

J-Lentz
Copy link
Contributor

@J-Lentz J-Lentz commented Jul 12, 2024

Description
The Cray compiler does not support C-style concatenation of string literals, and therefore, the following results in a syntax error:

print "(A)", "Hello " &
             &"world"

All occurrences of the above syntax have therefore been changed to:

print "(A)", "Hello &
             &world"

How Has This Been Tested?

  • Fixes the relevant syntax errors with Cray compiler version 15.0.1 on Gaea
  • Builds with Intel compiler version 2024.1.0 on the AMD box

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • New check tests, if applicable, are included
  • make distcheck passes

The Cray compiler does not support C-style concatenation of string literals, and
therefore, the following results in a syntax error:

```
print "(A)", "Hello " &
             &"world"
```

All occurrences of the above syntax have therefore been changed to:

```
print "(A)", "Hello &
             &world"
```
@bensonr
Copy link
Contributor

bensonr commented Jul 12, 2024

What happens if you concatenate correctly in fortran using // between the two independent strings.

Print "(A)", "Hello "// &
&"world"

@J-Lentz
Copy link
Contributor Author

J-Lentz commented Jul 12, 2024

What happens if you concatenate correctly in fortran using // between the two independent strings.

Print "(A)", "Hello "// &
&"world"

That works fine with Cray. It generates identical object code in gfortran and Cray, but interestingly, different object code with ifort.

@rem1776 rem1776 merged commit 116408f into NOAA-GFDL:main Jul 26, 2024
26 of 28 checks passed
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 this pull request may close these issues.

None yet

5 participants