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

Hexadecimal constants use non-standard Fortran #1270

Closed
billsacks opened this issue Feb 4, 2021 · 0 comments · Fixed by #1271
Closed

Hexadecimal constants use non-standard Fortran #1270

billsacks opened this issue Feb 4, 2021 · 0 comments · Fixed by #1271
Assignees
Labels
bfb bit-for-bit bug something is working incorrectly

Comments

@billsacks
Copy link
Member

Brief summary of bug

While trying to build with gfortran10 on my mac, I ran into an issue with what is apparently non-standard Fortran in the definition of two hexadecimal constants. The fix is easy, and I will open a PR for it shortly. This isn't high priority, but should go into the next simple bfb tag.

General bug information

CTSM version you are using: master

Does this bug cause significantly incorrect results in the model's science? No

Configurations affected: all with gfortran10

Details of bug

The issue appears in two places:

https://github.com/ESCOMP/ctsm/blob/0f6985da747a9e0538df63bf6e3f0ff6b4341229/src/biogeochem/FireEmisFactorsMod.F90#L230

https://github.com/ESCOMP/ctsm/blob/0f6985da747a9e0538df63bf6e3f0ff6b4341229/src/biogeochem/MEGANFactorsMod.F90#L277

This generates a build error like this:

  277 |     integer, parameter :: gen_hash_key_offset = z'000053db'
      |                                               1
Error: BOZ literal constant at (1) is neither a data-stmt-constant nor an actual argument to INT, REAL, DBLE, or CMPLX intrinsic function [see '-fno-allow-invalid-boz']

The fix is simply to wrap this in an 'int()' call. Alternatively, the compilation flag -fallow-invalid-boz can be given to gfortran to bypass the error.

@billsacks billsacks added tag: simple bfb bug something is working incorrectly labels Feb 4, 2021
@billsacks billsacks self-assigned this Feb 4, 2021
billsacks added a commit that referenced this issue Feb 23, 2021
Refactor ozone code, and misc. small fixes

(1) Restructure ozone code (#1276) in
    preparation for new ozone parameterization.

(2) Fix non-standard hexadecimal constant
    (#1271), needed for gfortran 10

(3) Remove support for CISM1 (#1226)

(4) Move final WaterGridcellBalance call out to clm_driver (resolves
    #1286)

(5) Only add WA and QCHARGE history fields if use_aquifer_layer is true
    (resolves #1281)

(6) Consolidate conditional structures for VIC initialization (resolves
    #1287)

- Resolves #1286 (Move call to WaterGridcellBalance out to
  the driver)
- Resolves #1281 (Remove deprecated history output)
- Resolves #1287 (Inconsistent logic for VIC initialization
  can cause crash in debug mode)
- Resolves #1270 (Hexadecimal constants use non-standard
  Fortran)
@samsrabin samsrabin added simple bfb bit-for-bit labels Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bfb bit-for-bit bug something is working incorrectly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants