Skip to content

v12: Support for Flang 22 #1036

@mathomp4

Description

@mathomp4

With the release of Flang 22.1.0, we can now build MAPL and pass all unit tests. So next up is GEOSgcm.

I'm currently testing this now. At a minimum we need FMS 2025 so I am starting from #933

OS Support

Linux

I can build working flang 22 with my build-llvm-flang script

macOS

I have not been able to get a working flang with build-llvm-flang. macOS is just weird enough. Luckily @cho-m is on the case in Homebrew land (see Homebrew/homebrew-core#269143). I already use their gfortran-15 so I hope they can provide us a nice easy flang in the future! → It's on homebrew!

Performance

I have been able to run. Current performance:

Compiler Model Throughput (d/d) Walltime
ifort 336.261 04:53
GNU 415.782 04:16
Flang 0 348.372 04:52
Flang 1 352.001 04:49
Flang 2 363.181 04:49

Key:

  • Flang 0: -O3 -g
  • Flang 1: -O3 -march=znver2 -g
  • Flang 2: -O3 -march=znver2 -funroll-loops -fstack-arrays -g

Latest flags on GEOS-ESM/ESMA_cmake#517

Changes Needed

At present it is:

> mepo status
Checking status...
GEOSgcm                | (b) feature/v12-remove-mom5
env                    | (t) v6.1.0 (DH)
   | g5_modules: modified, not staged
cmake                  | (b) feature/flang-flags
ecbuild                | (t) geos/v3.13.1 (DH)
NCEP_Shared            | (t) v1.4.0 (DH)
   | NCEP_sp/imax_verify.h: modified, not staged
   |       NCEP_sp/splat.f: modified, not staged
   |     NCEP_w3/errexit.f: modified, not staged
GMAO_Shared            | (t) GCMv12-rc22 (DH)
   | GMAO_mpeu/m_random.F: modified, not staged
GEOS_Util              | (t) GCMv12-rc22 (DH)
   |                                  post/rs_numtiles.F90: modified, not staged
   | pre/prepare_ocnExtData/daily_clim_SST_FRACI_eight.F90: modified, not staged
GMAO_perllib           | (t) v1.1.0 (DH)
MAPL                   | (t) v2.65.0 (DH)
GEOSgcm_GridComp       | (b) feature/v12-remove-mom5
   |                              GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSgwd_GridComp/ncar_gwd/gw_convect.F90: modified, not staged
   |                                     GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSmoist_GridComp/CMakeLists.txt: modified, not staged
   |         GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/makebcs/mkMITAquaRaster.F90: modified, not staged
   |             GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/mk_restarts/CatchmentCNRst.F90: modified, not staged
   |               GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/mk_restarts/CatchmentRst.F90: modified, not staged
   |           GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/mk_restarts/SaltImpConverter.F90: modified, not staged
   |            GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/mk_restarts/SaltIntSplitter.F90: modified, not staged
   |                GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/mk_restarts/Scale_Catch.F90: modified, not staged
   |              GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/mk_restarts/Scale_CatchCN.F90: modified, not staged
   |             GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/mk_restarts/cv_SaltRestart.F90: modified, not staged
   |         GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/mk_restarts/mk_CatchCNRestarts.F90: modified, not staged
   |        GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/mk_restarts/mk_GEOSldasRestarts.F90: modified, not staged
   | GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/mk_restarts/mk_LakeLandiceSaltRestarts.F90: modified, not staged
   |                   GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSturbulence_GridComp/GEOS_TurbulenceGridComp.F90: modified, not staged
geos_state_bias        | (t) geos/v1.0.0 (DH)
GigaTraj               | (t) geos/v1.0.0 (DH)
FVdycoreCubed_GridComp | (b) feature/v12-fms2025-useifdef
   | c2c.F90: modified, not staged
fvdycore               | (b) feature/v12-fms2025-useifdef
   | tools/fv_eta.F90: modified, not staged
GEOSchem_GridComp      | (t) GCMv12-rc22 (DH)
HEMCO                  | (t) geos/v2.3.0 (DH)
geos-chem              | (t) geos/v13.0.0-rc1 (DH)
GOCART                 | (b) develop
QuickChem              | (t) v1.0.0 (DH)
RRG                    | (t) v1.1.0 (DH)
TR                     | (t) v1.2.0 (DH)
GMI                    | (t) v1.3.0 (DH)
StratChem              | (t) v1.0.0 (DH)
   | SC_GridComp/SC_GridCompMod.F90: modified, not staged
MAM                    | (t) v1.1.0 (DH)
MATRIX                 | (t) v1.0.0 (DH)
CARMA                  | (t) v1.1.0 (DH)
GAAS                   | (t) v1.0.0 (DH)
   | LDE_Mod.F90: modified, not staged
ACHEM                  | (t) v1.0.1 (DH)
GEOS_OceanGridComp     | (b) feature/v12-remove-mom5
mom6                   | (t) geos/v3.7 (DH)
   | src/ALE/MOM_remapping.F90: modified, not staged
mit                    | (t) checkpoint68o (DH)
cice6                  | (t) geos/v0.2.0 (DH)
icepack                | (t) geos/v0.3.0 (DH)
sis2                   | (t) geos/v0.0.1 (DH)
GEOSradiation_GridComp | (t) GCMv12-rc20 (DH)
RRTMGP                 | (t) geos/v1.8+1.0.0 (DH)
ww3                    | (t) v7.14-geos-r1 (DH)
umwm                   | (t) v2.0.0-geos-r1 (DH)
GEOSgcm_App            | (b) feature/v12-remove-mom5
UMD_Etc                | (t) v1.4.0 (DH)
   |  UMD_oletkf/common_mom4.f90: modified, not staged
   |    UMD_oletkf/letkf_obs.f90: modified, not staged
   |    UMD_utils/anaice2rst.f90: modified, not staged
   |     UMD_utils/ocean_iau.f90: modified, not staged
   | UMD_utils/ocean_moments.f90: modified, not staged
CPLFCST_Etc            | (t) v1.0.1 (DH)
Topo                   | (t) geos/v2.1.0 (DH)
GenCast_GEOS-FP        | (t) geos/v0.3.1 (DH)

A bit of everywhere, almost always because Flang is pretty strict on Fortran.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions