MPAS-Dev / MPAS-Model

Repository for MPAS models and shared framework releases.
241 stars 321 forks source link

Add a new build target, 'gnu', for the GNU Fortran, C, and C++ compilers #1038

Closed mgduda closed 1 year ago

mgduda commented 1 year ago

This PR adds a new build target, gnu, for the GNU Fortran, C, and C++ compilers.

The only difference between the new gnu target and the existing gfortran target is the addition of -std=f2008 to the FFLAGS variable to check for compliance with the Fortran 2008 standard.

With the new gnu target, builds with the GNU 7.4.0 (and presumably, earlier) compilers fail with the error

   mpas_stream_manager.F:5844:32:

        call c_f_pointer(manager_c, manager)
                                1
   Error: TS 29113/TS 18508: Noninteroperable array FPTR at (1) to C_F_POINTER: Expression is a noninteroperable derived type

However, builds with the GNU 8.3.0 and later compilers are successful.

In future, the gfortran target will likely be deprecated and superseded by the gnu target.