Skip to content

Fix non-standard BOZ-literal integer constant in module_ra_cam_support - #736

Merged
mgduda merged 1 commit into
MPAS-Dev:hotfix-v7.1from
mgduda:atmosphere/ra_cam_support_BOZ_Fix
Nov 19, 2020
Merged

mgduda merged 1 commit into
MPAS-Dev:hotfix-v7.1from
mgduda:atmosphere/ra_cam_support_BOZ_Fix

Conversation

@mgduda

@mgduda mgduda commented Oct 29, 2020

Copy link
Copy Markdown
Contributor

This merge corrects a non-standard BOZ-literal constant in module_ra_cam_support.

The GNU 10.1.0 compiler identified a non-standard BOZ-literal constant in
module_ra_cam_support.F, failing to compile this file with the following error:

  module_ra_cam_support.F:11:35:

     11 |       integer, parameter:: bigint = O'17777777777'           ! largest possible 32-bit integer
        |                                   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’]

As per the Fortran 2003 standard, this constant should be typed with the INT
intrinsic (or be used in a data statement):

  4.4.1 Integer type

  C410 (R411) A boz-literal-constant shall appear only as a data-stmt-constant in
  a DATA statement, as the actual argument associated with the dummy argument A of
  the numeric intrinsic functions DBLE, REAL or INT, or as the actual argument
  associated with the X or Y dummy argument of the intrinsic function CMPLX.

This commit uses the INT intrinsic with an argument of O'17777777777' to
initialize the bigint parameter.

The GNU 10.1.0 compiler identified a non-standard BOZ-literal constant in
module_ra_cam_support.F, failing to compile this file with the following error:

  module_ra_cam_support.F:11:35:

     11 |       integer, parameter:: bigint = O'17777777777'           ! largest possible 32-bit integer
        |                                   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’]

As per the Fortran 2003 standard, this constant should be typed with the INT
intrinsic (or be used in a data statement):

  4.4.1 Integer type

  C410 (R411) A boz-literal-constant shall appear only as a data-stmt-constant in
  a DATA statement, as the actual argument associated with the dummy argument A of
  the numeric intrinsic functions DBLE, REAL or INT, or as the actual argument
  associated with the X or Y dummy argument of the intrinsic function CMPLX.

This commit uses the INT intrinsic with an argument of O'17777777777' to
initialize the bigint parameter.
@ldfowler58

Copy link
Copy Markdown
Contributor

Hi Michael and Miles:
I do not think that I can really help you as it is a compiler related issue. Better leave it to software engineers. Let me check where bigint is used in MPAS-Model.

@mgduda

mgduda commented Nov 4, 2020

Copy link
Copy Markdown
Contributor Author

@ldfowler58 Since this change modifies code in a physics scheme, I had added you as a reviewer. The code change does not alter the results, but simply expresses a constant in a way that is standards-conformant. If you have no objections, that would be good enough to count as an approval, I think. But, please don't hesitate to let me know if you have any questions or concerns about the code change.

@mgduda
mgduda merged commit 4569999 into MPAS-Dev:hotfix-v7.1 Nov 19, 2020
@mgduda
mgduda deleted the atmosphere/ra_cam_support_BOZ_Fix branch October 6, 2021 21:17
sael9740 pushed a commit to sael9740/MPAS-Model that referenced this pull request Oct 9, 2026
…PAS-Dev#736)

This merge corrects a non-standard BOZ-literal constant in module_ra_cam_support.

The GNU 10.1.0 compiler identified a non-standard BOZ-literal constant in
module_ra_cam_support.F, failing to compile this file with the following error:

  module_ra_cam_support.F:11:35:

     11 |       integer, parameter:: bigint = O'17777777777'           ! largest possible 32-bit integer
        |                                   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’]

As per the Fortran 2003 standard, this constant should be typed with the INT
intrinsic (or be used in a data statement):

  4.4.1 Integer type

  C410 (R411) A boz-literal-constant shall appear only as a data-stmt-constant in
  a DATA statement, as the actual argument associated with the dummy argument A of
  the numeric intrinsic functions DBLE, REAL or INT, or as the actual argument
  associated with the X or Y dummy argument of the intrinsic function CMPLX.

This merge uses the INT intrinsic with an argument of O'17777777777' to
initialize the bigint parameter.

* atmosphere/ra_cam_support_BOZ_Fix:
  Fix non-standard BOZ-literal integer constant in module_ra_cam_support
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants