Skip to content

Conversation

mgduda
Copy link
Contributor

@mgduda mgduda commented Jun 15, 2023

This PR corrects Fortran 2008 compliance issues in physics modules that were caught by the GNU Fortran compiler when using the -std=f2008 flag. Most of these issues are related to the use of non-standard kind/type specifications.

mgduda added 3 commits June 15, 2023 19:13
This commit corrects several issues of use-before-declaration of dummy arguments
in the cu_ntiedtke.F file. These were caught with the GNU Fortran compiler with
the -std=f2008 flag. For example:

  cu_ntiedtke.F:2530:35:

   2530 |       logical,intent(in),dimension(klon):: ldcum
        |                                   1
  Error: GNU Extension: Symbol ‘klon’ is used before it is typed at (1)
This commit corrects several issues with non-standard kind specifications in
module_libmassv.F. These issues were caught by the GNU Fortran compiler with
-std=f2008. For example:

  module_libmassv.F:25:8:

     25 |  real*8,dimension(*),intent(in):: x
        |        1
  Error: GNU Extension: Nonstandard type declaration REAL*8 at (1)

To provide standard kind specifications, local module variables R4KIND and
R8KIND, that should specify single- and double-precision, respectively, have
been defined as private parameters in module_libmassv.
This commit corrects Fortran 2008 compliance issues in mp_radar.F that were
caught by the GNU Fortran compiler using the -std=f2008 flag. These issues are
related to the use of non-standard kind specifications and intrinsics. For
example:

  mp_radar.F:41:12:

     41 |  complex*16,public:: m_w_0, m_i_0
        |            1
  Error: GNU Extension: Nonstandard type declaration COMPLEX*16 at (1)

  ...

  mp_radar.F:138:37:

    138 |     xxdx(n) = dexp(dfloat(n-1)/dfloat(nrbins) &
        |                                     1
  Error: Function ‘dfloat’ at (1) has no IMPLICIT type

To provide standard kind specifications, local module variables R4KIND and
R8KIND, that should specify single- and double-precision, respectively, have
been defined as private parameters in module_libmassv.
@mgduda mgduda requested a review from ldfowler58 June 15, 2023 19:28
@mgduda mgduda changed the title Atmosphere/physics mmm f2008 compliance Atmosphere/physics_mmm f2008 compliance Jun 15, 2023
@mgduda mgduda changed the title Atmosphere/physics_mmm f2008 compliance Correct several Fortran 2008 compliance issues in physics_mmm Jun 15, 2023
@ldfowler58
Copy link
Contributor

I completely agree with your updates proposed in cu_ntiedtke.F and mp_radar.F. Regarding module_libmassv.F, it may be cleaner to add the definitions of R4KIND and R8KIND in ccpp_kinds.F instead of defining them as private at the top of the modules.

@ldfowler58
Copy link
Contributor

I can work on this, of course, if you agree.

mgduda added a commit that referenced this pull request Jun 15, 2023
#1086)

This merge corrects Fortran 2008 compliance issues in physics modules that were
caught by the GNU Fortran compiler when using the -std=f2008 flag. Most of these
issues are related to the use of non-standard kind/type specifications.
@mgduda mgduda merged commit adbdeae into MPAS-Dev:release-v8.0.0 Jun 15, 2023
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.

2 participants