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

Fixes for Intel 2024.2 #352

Merged
merged 2 commits into from
Jul 30, 2024
Merged

Conversation

mathomp4
Copy link
Member

@mathomp4 mathomp4 commented Jul 19, 2024

GEOSgcm (and thus GEOSadas) will soon move to use Intel oneAPI 2024.2 which is Intel ifort 2021.13 and icx 2024.2.

Tests showed two issues. First there was a plain Fortran bug in GMAO_ods/ods_diagnc4.F90:

     ods%data%time(1:nobs) = int(rvals * 60,)

That trailing comma is just wrong. Per @gmao-msienkie below, this should be a "." and is such now.

icx also threw an error with some C code:

/discover/swdev/mathomp4/Models/GEOSadas-MAPLdevelop-Baselibs-7.25.0/src/Shared/@GMAO_Shared/GMAO_pyobs/VegType_io.c:17:5: error: call to undeclared library function 'exit' with type 'void (int) __attribute__((noreturn))'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
   17 |     exit(1);
      |     ^
/discover/swdev/mathomp4/Models/GEOSadas-MAPLdevelop-Baselibs-7.25.0/src/Shared/@GMAO_Shared/GMAO_pyobs/VegType_io.c:17:5: note: include the header <stdlib.h> or explicitly provide a declaration for 'exit'

As the error states, we add #include <stdlib.h>

GEOSgcm (and thus GEOSadas) will soon move to use Intel oneAPI 2024.2
which is Intel `ifort` 2021.13 and `icx` 2024.2.

Tests showed two issues. First there was a plain Fortran bug in
`GMAO_ods/ods_diagnc4.F90`:

```fortran
     ods%data%time(1:nobs) = int(rvals * 60,)
```

That trailing comma is just wrong.

`icx` also threw an error with some C code:

```
/discover/swdev/mathomp4/Models/GEOSadas-MAPLdevelop-Baselibs-7.25.0/src/Shared/@GMAO_Shared/GMAO_pyobs/VegType_io.c:17:5: error: call to undeclared library function 'exit' with type 'void (int) __attribute__((noreturn))'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
   17 |     exit(1);
      |     ^
/discover/swdev/mathomp4/Models/GEOSadas-MAPLdevelop-Baselibs-7.25.0/src/Shared/@GMAO_Shared/GMAO_pyobs/VegType_io.c:17:5: note: include the header <stdlib.h> or explicitly provide a declaration for 'exit'
```

As the error states, we add `#include <stdlib.h>`
@mathomp4 mathomp4 added the 0 diff The changes in this pull request have verified to be zero-diff with the target branch. label Jul 19, 2024
@mathomp4 mathomp4 requested review from a team as code owners July 19, 2024 14:27
@gmao-msienkie
Copy link
Contributor

Tests showed two issues. First there was a plain Fortran bug in GMAO_ods/ods_diagnc4.F90:

     ods%data%time(1:nobs) = int(rvals * 60,)

I think that the comma was supposed to be a period. Typing commas for periods is something that I frequently do but I almost always catch the mistake.
I started developing that code when we were supposed to be dropping the binary format diag files in favor of the nc4 output. As it turned out that didn't happen and so the code is not needed now.

@sdrabenh sdrabenh merged commit 4508f00 into main Jul 30, 2024
13 checks passed
@sdrabenh sdrabenh deleted the bugfix/mathomp4/fixes-for-intel2024.2 branch July 30, 2024 14:10
@mathomp4 mathomp4 restored the bugfix/mathomp4/fixes-for-intel2024.2 branch July 31, 2024 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 diff The changes in this pull request have verified to be zero-diff with the target branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants