From 8ace80fc84677879a1a48756afd58ee39758dc91 Mon Sep 17 00:00:00 2001 From: George Gayno Date: Mon, 12 Aug 2024 15:11:53 -0500 Subject: [PATCH 01/45] Updates to build emcsfc_snow2mdl with intelLLVM. Fixes #879. --- CMakeLists.txt | 30 +++++++++++++------------- modulefiles/build.hercules.intel.lua | 3 +++ sorc/emcsfc_snow2mdl.fd/CMakeLists.txt | 2 +- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5408e7c3b..5ed722b66 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,24 +17,24 @@ option(OPENMP "use OpenMP threading" ON) option(ENABLE_DOCS "Enable generation of doxygen-based documentation." OFF) # Utilities to be built (Default: ALL) -option(ICEBLEND "Enable building emcsfc_ice_blend.fd" ON) +option(ICEBLEND "Enable building emcsfc_ice_blend.fd" OFF) option(SNOW2MDL "Enable building emcsfc_snow2mdl.fd" ON) -option(GCYCLE "Enable building global_cycle.fd" ON) -option(FRENCTOOLS "Enable building fre-nctools.fd" ON) -option(GRIDTOOLS "Enable building grid_tools.fd" ON) -option(CHGRES "Enable building chgres_cube.fd" ON) +option(GCYCLE "Enable building global_cycle.fd" OFF) +option(FRENCTOOLS "Enable building fre-nctools.fd" OFF) +option(GRIDTOOLS "Enable building grid_tools.fd" OFF) +option(CHGRES "Enable building chgres_cube.fd" OFF) option(CHGRES_ALL "Build chgres with all input data options." OFF) -option(OROG_MASK_TOOLS "Enable building orog_mask_tools.fd" ON) +option(OROG_MASK_TOOLS "Enable building orog_mask_tools.fd" OFF) # OROG_MASK_TOOLS must be ON for OROG_NETCDF_TOOLS to build. option(OROG_NETCDF_TOOLS "Enable building orog_netcdf_tools.fd" OFF) -option(SFC_CLIMO_GEN "Enable building sfc_climo_gen.fd" ON) -option(VCOORD_GEN "Enable building vcoord_gen.fd" ON) -option(FVCOMTOOLS "Enable building fvcom_tools.fd" ON) -option(GBLEVENTS "Enable building gblevents.fd" ON) -option(CPLD_GRIDGEN "Enable building cpld_gridgen.fd" ON) -option(OCNICE_PREP "Enable building ocnice_prep.fd" ON) -option(WEIGHT_GEN "Enable building weight_gen.fd" ON) -option(OCEAN_MERGE "Enable building ocean_merge.fd" ON) +option(SFC_CLIMO_GEN "Enable building sfc_climo_gen.fd" OFF) +option(VCOORD_GEN "Enable building vcoord_gen.fd" OFF) +option(FVCOMTOOLS "Enable building fvcom_tools.fd" OFF) +option(GBLEVENTS "Enable building gblevents.fd" OFF) +option(CPLD_GRIDGEN "Enable building cpld_gridgen.fd" OFF) +option(OCNICE_PREP "Enable building ocnice_prep.fd" OFF) +option(WEIGHT_GEN "Enable building weight_gen.fd" OFF) +option(OCEAN_MERGE "Enable building ocean_merge.fd" OFF) # Option to build application specific utilities option(GFS "Enable building GFS-only utilities" OFF) @@ -67,7 +67,7 @@ if(NOT CMAKE_BUILD_TYPE MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel)$") endif() # Set compiler flags. -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g -traceback") set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -fp-model precise") set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -check all -ftrapuv") diff --git a/modulefiles/build.hercules.intel.lua b/modulefiles/build.hercules.intel.lua index 0cdb92e13..9dc0cc3c4 100644 --- a/modulefiles/build.hercules.intel.lua +++ b/modulefiles/build.hercules.intel.lua @@ -59,4 +59,7 @@ load(pathJoin("esmf", esmf_ver)) nco_ver=os.getenv("nco_ver") or "5.0.6" load(pathJoin("nco", nco_ver)) +setenv("CC", "icx") +setenv("FC", "ifx") + whatis("Description: UFS_UTILS build environment") diff --git a/sorc/emcsfc_snow2mdl.fd/CMakeLists.txt b/sorc/emcsfc_snow2mdl.fd/CMakeLists.txt index 08997374c..f3e1ca206 100644 --- a/sorc/emcsfc_snow2mdl.fd/CMakeLists.txt +++ b/sorc/emcsfc_snow2mdl.fd/CMakeLists.txt @@ -12,7 +12,7 @@ set(lib_src set(exe_src driver.F90) -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -convert big_endian -assume byterecl") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-real-8 -fconvert=big-endian") From 8b2e37c69949fc718862ae8a518ac2e578f71806 Mon Sep 17 00:00:00 2001 From: George Gayno Date: Mon, 12 Aug 2024 15:27:01 -0500 Subject: [PATCH 02/45] Updates to build weight_gen using intelLLVM. Fixes #879. --- CMakeLists.txt | 2 +- sorc/weight_gen.fd/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ed722b66..182795fab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,7 +33,7 @@ option(FVCOMTOOLS "Enable building fvcom_tools.fd" OFF) option(GBLEVENTS "Enable building gblevents.fd" OFF) option(CPLD_GRIDGEN "Enable building cpld_gridgen.fd" OFF) option(OCNICE_PREP "Enable building ocnice_prep.fd" OFF) -option(WEIGHT_GEN "Enable building weight_gen.fd" OFF) +option(WEIGHT_GEN "Enable building weight_gen.fd" ON) option(OCEAN_MERGE "Enable building ocean_merge.fd" OFF) # Option to build application specific utilities diff --git a/sorc/weight_gen.fd/CMakeLists.txt b/sorc/weight_gen.fd/CMakeLists.txt index ce0190650..4c408d441 100644 --- a/sorc/weight_gen.fd/CMakeLists.txt +++ b/sorc/weight_gen.fd/CMakeLists.txt @@ -2,7 +2,7 @@ list(APPEND fortran_src scrip.F90 ) -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -i4 -convert big_endian") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-real-8") From 6b4440477d84386e2b6f77f03b19ae6bc3ceefbe Mon Sep 17 00:00:00 2001 From: George Gayno Date: Tue, 13 Aug 2024 08:46:12 -0500 Subject: [PATCH 03/45] Updates to vcoord_gen to build with IntelLLVM. Fixes #879. --- CMakeLists.txt | 2 +- sorc/vcoord_gen.fd/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 182795fab..8028d08eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,7 +28,7 @@ option(OROG_MASK_TOOLS "Enable building orog_mask_tools.fd" OFF) # OROG_MASK_TOOLS must be ON for OROG_NETCDF_TOOLS to build. option(OROG_NETCDF_TOOLS "Enable building orog_netcdf_tools.fd" OFF) option(SFC_CLIMO_GEN "Enable building sfc_climo_gen.fd" OFF) -option(VCOORD_GEN "Enable building vcoord_gen.fd" OFF) +option(VCOORD_GEN "Enable building vcoord_gen.fd" ON) option(FVCOMTOOLS "Enable building fvcom_tools.fd" OFF) option(GBLEVENTS "Enable building gblevents.fd" OFF) option(CPLD_GRIDGEN "Enable building cpld_gridgen.fd" OFF) diff --git a/sorc/vcoord_gen.fd/CMakeLists.txt b/sorc/vcoord_gen.fd/CMakeLists.txt index 328e2ab15..b5ac92627 100644 --- a/sorc/vcoord_gen.fd/CMakeLists.txt +++ b/sorc/vcoord_gen.fd/CMakeLists.txt @@ -10,7 +10,7 @@ set(lib_src set(exe_src driver.f90) -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-real-8") From 5e262cec235a01a9b5db934462921f95bbccc5f1 Mon Sep 17 00:00:00 2001 From: George Gayno Date: Tue, 13 Aug 2024 09:30:40 -0500 Subject: [PATCH 04/45] Update the ocnice_prep compilation to use intelLLVM. Fixes #879. --- CMakeLists.txt | 4 ++-- sorc/ocnice_prep.fd/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8028d08eb..c85b888f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,7 @@ option(OPENMP "use OpenMP threading" ON) option(ENABLE_DOCS "Enable generation of doxygen-based documentation." OFF) # Utilities to be built (Default: ALL) -option(ICEBLEND "Enable building emcsfc_ice_blend.fd" OFF) +option(ICEBLEND "Enable building emcsfc_ice_blend.fd" ON) option(SNOW2MDL "Enable building emcsfc_snow2mdl.fd" ON) option(GCYCLE "Enable building global_cycle.fd" OFF) option(FRENCTOOLS "Enable building fre-nctools.fd" OFF) @@ -32,7 +32,7 @@ option(VCOORD_GEN "Enable building vcoord_gen.fd" ON) option(FVCOMTOOLS "Enable building fvcom_tools.fd" OFF) option(GBLEVENTS "Enable building gblevents.fd" OFF) option(CPLD_GRIDGEN "Enable building cpld_gridgen.fd" OFF) -option(OCNICE_PREP "Enable building ocnice_prep.fd" OFF) +option(OCNICE_PREP "Enable building ocnice_prep.fd" ON) option(WEIGHT_GEN "Enable building weight_gen.fd" ON) option(OCEAN_MERGE "Enable building ocean_merge.fd" OFF) diff --git a/sorc/ocnice_prep.fd/CMakeLists.txt b/sorc/ocnice_prep.fd/CMakeLists.txt index 86f954ed4..98d1279f8 100644 --- a/sorc/ocnice_prep.fd/CMakeLists.txt +++ b/sorc/ocnice_prep.fd/CMakeLists.txt @@ -13,7 +13,7 @@ set(lib_src set(exe_src ocniceprep.F90) -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -assume byterecl") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-0 -fdefault-real-8") From 28c90a14215a685cd35977429686bc3c5f47dbc7 Mon Sep 17 00:00:00 2001 From: George Gayno Date: Tue, 13 Aug 2024 12:07:25 -0500 Subject: [PATCH 05/45] Update chgres and cpld_gridgen builds to use intelLLVM. Fixes #879. --- CMakeLists.txt | 4 ++-- sorc/chgres_cube.fd/CMakeLists.txt | 2 +- sorc/cpld_gridgen.fd/CMakeLists.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c85b888f3..f965312ed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,7 +22,7 @@ option(SNOW2MDL "Enable building emcsfc_snow2mdl.fd" ON) option(GCYCLE "Enable building global_cycle.fd" OFF) option(FRENCTOOLS "Enable building fre-nctools.fd" OFF) option(GRIDTOOLS "Enable building grid_tools.fd" OFF) -option(CHGRES "Enable building chgres_cube.fd" OFF) +option(CHGRES "Enable building chgres_cube.fd" ON) option(CHGRES_ALL "Build chgres with all input data options." OFF) option(OROG_MASK_TOOLS "Enable building orog_mask_tools.fd" OFF) # OROG_MASK_TOOLS must be ON for OROG_NETCDF_TOOLS to build. @@ -31,7 +31,7 @@ option(SFC_CLIMO_GEN "Enable building sfc_climo_gen.fd" OFF) option(VCOORD_GEN "Enable building vcoord_gen.fd" ON) option(FVCOMTOOLS "Enable building fvcom_tools.fd" OFF) option(GBLEVENTS "Enable building gblevents.fd" OFF) -option(CPLD_GRIDGEN "Enable building cpld_gridgen.fd" OFF) +option(CPLD_GRIDGEN "Enable building cpld_gridgen.fd" ON) option(OCNICE_PREP "Enable building ocnice_prep.fd" ON) option(WEIGHT_GEN "Enable building weight_gen.fd" ON) option(OCEAN_MERGE "Enable building ocean_merge.fd" OFF) diff --git a/sorc/chgres_cube.fd/CMakeLists.txt b/sorc/chgres_cube.fd/CMakeLists.txt index 94f0906bc..4ff86450f 100644 --- a/sorc/chgres_cube.fd/CMakeLists.txt +++ b/sorc/chgres_cube.fd/CMakeLists.txt @@ -25,7 +25,7 @@ set(exe_src chgres.F90) add_subdirectory(msis2.1.fd) -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -assume byterecl") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-0 -fdefault-real-8") diff --git a/sorc/cpld_gridgen.fd/CMakeLists.txt b/sorc/cpld_gridgen.fd/CMakeLists.txt index c4e99ae63..415b8be44 100644 --- a/sorc/cpld_gridgen.fd/CMakeLists.txt +++ b/sorc/cpld_gridgen.fd/CMakeLists.txt @@ -21,7 +21,7 @@ set(lib_src set(exe_src gen_fixgrid.F90) -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -assume byterecl") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-0 -fdefault-real-8") From b56fe412268826da04aa38c5c98e1fddb4b7a8ec Mon Sep 17 00:00:00 2001 From: George Gayno Date: Tue, 13 Aug 2024 12:41:54 -0500 Subject: [PATCH 06/45] Update glbevents and global_cycle builds to use IntelLLVM. Fixes #879. --- CMakeLists.txt | 4 ++-- sorc/gblevents.fd/CMakeLists.txt | 2 +- sorc/global_cycle.fd/CMakeLists.txt | 2 +- sorc/lsm_routines.fd/noah.fd/CMakeLists.txt | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f965312ed..41006ac3b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,7 @@ option(ENABLE_DOCS "Enable generation of doxygen-based documentation." OFF) # Utilities to be built (Default: ALL) option(ICEBLEND "Enable building emcsfc_ice_blend.fd" ON) option(SNOW2MDL "Enable building emcsfc_snow2mdl.fd" ON) -option(GCYCLE "Enable building global_cycle.fd" OFF) +option(GCYCLE "Enable building global_cycle.fd" ON) option(FRENCTOOLS "Enable building fre-nctools.fd" OFF) option(GRIDTOOLS "Enable building grid_tools.fd" OFF) option(CHGRES "Enable building chgres_cube.fd" ON) @@ -30,7 +30,7 @@ option(OROG_NETCDF_TOOLS "Enable building orog_netcdf_tools.fd" OFF) option(SFC_CLIMO_GEN "Enable building sfc_climo_gen.fd" OFF) option(VCOORD_GEN "Enable building vcoord_gen.fd" ON) option(FVCOMTOOLS "Enable building fvcom_tools.fd" OFF) -option(GBLEVENTS "Enable building gblevents.fd" OFF) +option(GBLEVENTS "Enable building gblevents.fd" ON) option(CPLD_GRIDGEN "Enable building cpld_gridgen.fd" ON) option(OCNICE_PREP "Enable building ocnice_prep.fd" ON) option(WEIGHT_GEN "Enable building weight_gen.fd" ON) diff --git a/sorc/gblevents.fd/CMakeLists.txt b/sorc/gblevents.fd/CMakeLists.txt index 22086de19..42835ed38 100644 --- a/sorc/gblevents.fd/CMakeLists.txt +++ b/sorc/gblevents.fd/CMakeLists.txt @@ -1,5 +1,5 @@ -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8") set(CMAKE_Fortran_FLAGS_RELEASE "-O3") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") diff --git a/sorc/global_cycle.fd/CMakeLists.txt b/sorc/global_cycle.fd/CMakeLists.txt index f52c2d86d..f8120f00a 100644 --- a/sorc/global_cycle.fd/CMakeLists.txt +++ b/sorc/global_cycle.fd/CMakeLists.txt @@ -13,7 +13,7 @@ set(lib_src set(exe_src cycle.f90) -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-real-8") diff --git a/sorc/lsm_routines.fd/noah.fd/CMakeLists.txt b/sorc/lsm_routines.fd/noah.fd/CMakeLists.txt index daa252e56..3e159b10e 100644 --- a/sorc/lsm_routines.fd/noah.fd/CMakeLists.txt +++ b/sorc/lsm_routines.fd/noah.fd/CMakeLists.txt @@ -8,7 +8,7 @@ set(fortran_src sflx_snippet.f90 bulk_snow_module.f90) -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -convert big_endian") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-real-8 -fconvert=big-endian") From e87daf51e82327abde8ca169aa310d3dd2d53fe3 Mon Sep 17 00:00:00 2001 From: George Gayno Date: Tue, 13 Aug 2024 14:38:05 -0500 Subject: [PATCH 07/45] Update build for sfc_climo_gen and grid_tools. Fixes #879. --- CMakeLists.txt | 4 ++-- sorc/grid_tools.fd/filter_topo.fd/CMakeLists.txt | 2 +- sorc/sfc_climo_gen.fd/CMakeLists.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 41006ac3b..5874c0f91 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,13 +21,13 @@ option(ICEBLEND "Enable building emcsfc_ice_blend.fd" ON) option(SNOW2MDL "Enable building emcsfc_snow2mdl.fd" ON) option(GCYCLE "Enable building global_cycle.fd" ON) option(FRENCTOOLS "Enable building fre-nctools.fd" OFF) -option(GRIDTOOLS "Enable building grid_tools.fd" OFF) +option(GRIDTOOLS "Enable building grid_tools.fd" ON) option(CHGRES "Enable building chgres_cube.fd" ON) option(CHGRES_ALL "Build chgres with all input data options." OFF) option(OROG_MASK_TOOLS "Enable building orog_mask_tools.fd" OFF) # OROG_MASK_TOOLS must be ON for OROG_NETCDF_TOOLS to build. option(OROG_NETCDF_TOOLS "Enable building orog_netcdf_tools.fd" OFF) -option(SFC_CLIMO_GEN "Enable building sfc_climo_gen.fd" OFF) +option(SFC_CLIMO_GEN "Enable building sfc_climo_gen.fd" ON) option(VCOORD_GEN "Enable building vcoord_gen.fd" ON) option(FVCOMTOOLS "Enable building fvcom_tools.fd" OFF) option(GBLEVENTS "Enable building gblevents.fd" ON) diff --git a/sorc/grid_tools.fd/filter_topo.fd/CMakeLists.txt b/sorc/grid_tools.fd/filter_topo.fd/CMakeLists.txt index e8789caaf..229440a3e 100644 --- a/sorc/grid_tools.fd/filter_topo.fd/CMakeLists.txt +++ b/sorc/grid_tools.fd/filter_topo.fd/CMakeLists.txt @@ -4,7 +4,7 @@ set(lib_src set(exe_src filter_topo.F90) -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -assume byterecl -real-size 64 -fno-alias -stack-temps -safe-cray-ptr -ftz") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-0 -fdefault-real-8") diff --git a/sorc/sfc_climo_gen.fd/CMakeLists.txt b/sorc/sfc_climo_gen.fd/CMakeLists.txt index a9103106f..aa0f3c217 100644 --- a/sorc/sfc_climo_gen.fd/CMakeLists.txt +++ b/sorc/sfc_climo_gen.fd/CMakeLists.txt @@ -17,7 +17,7 @@ set(lib_src set(exe_src driver.F90) -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-0 -fdefault-real-8") From ab25159fceefec86ec345e32e51aea2be473a44d Mon Sep 17 00:00:00 2001 From: George Gayno Date: Wed, 14 Aug 2024 07:14:36 -0500 Subject: [PATCH 08/45] Update build for the orography related codes. Fixes #879. --- CMakeLists.txt | 6 +++--- sorc/orog_mask_tools.fd/inland.fd/CMakeLists.txt | 2 +- sorc/orog_mask_tools.fd/lake.fd/CMakeLists.txt | 2 +- sorc/orog_mask_tools.fd/orog.fd/CMakeLists.txt | 2 +- sorc/orog_mask_tools.fd/orog_gsl.fd/CMakeLists.txt | 2 +- .../orog_netcdf_tools.fd/mask.fd/CMakeLists.txt | 2 +- .../orog_netcdf_tools.fd/ramp.fd/CMakeLists.txt | 2 +- .../orog_netcdf_tools.fd/topo.fd/CMakeLists.txt | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5874c0f91..64c4d474f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,13 +20,13 @@ option(ENABLE_DOCS "Enable generation of doxygen-based documentation." OFF) option(ICEBLEND "Enable building emcsfc_ice_blend.fd" ON) option(SNOW2MDL "Enable building emcsfc_snow2mdl.fd" ON) option(GCYCLE "Enable building global_cycle.fd" ON) -option(FRENCTOOLS "Enable building fre-nctools.fd" OFF) +option(FRENCTOOLS "Enable building fre-nctools.fd" ON) option(GRIDTOOLS "Enable building grid_tools.fd" ON) option(CHGRES "Enable building chgres_cube.fd" ON) option(CHGRES_ALL "Build chgres with all input data options." OFF) -option(OROG_MASK_TOOLS "Enable building orog_mask_tools.fd" OFF) +option(OROG_MASK_TOOLS "Enable building orog_mask_tools.fd" ON) # OROG_MASK_TOOLS must be ON for OROG_NETCDF_TOOLS to build. -option(OROG_NETCDF_TOOLS "Enable building orog_netcdf_tools.fd" OFF) +option(OROG_NETCDF_TOOLS "Enable building orog_netcdf_tools.fd" ON) option(SFC_CLIMO_GEN "Enable building sfc_climo_gen.fd" ON) option(VCOORD_GEN "Enable building vcoord_gen.fd" ON) option(FVCOMTOOLS "Enable building fvcom_tools.fd" OFF) diff --git a/sorc/orog_mask_tools.fd/inland.fd/CMakeLists.txt b/sorc/orog_mask_tools.fd/inland.fd/CMakeLists.txt index 189cd17e7..d116090e2 100644 --- a/sorc/orog_mask_tools.fd/inland.fd/CMakeLists.txt +++ b/sorc/orog_mask_tools.fd/inland.fd/CMakeLists.txt @@ -1,7 +1,7 @@ set(lib_src nb.F90) set(exe_src inland.F90) -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -assume byterecl") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fno-range-check") diff --git a/sorc/orog_mask_tools.fd/lake.fd/CMakeLists.txt b/sorc/orog_mask_tools.fd/lake.fd/CMakeLists.txt index 1b9b2108f..f558a74ef 100644 --- a/sorc/orog_mask_tools.fd/lake.fd/CMakeLists.txt +++ b/sorc/orog_mask_tools.fd/lake.fd/CMakeLists.txt @@ -4,7 +4,7 @@ set(lib_src set(exe_src lakefrac.F90) -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -assume byterecl") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fno-range-check") diff --git a/sorc/orog_mask_tools.fd/orog.fd/CMakeLists.txt b/sorc/orog_mask_tools.fd/orog.fd/CMakeLists.txt index 6fbed0573..8c2923bca 100644 --- a/sorc/orog_mask_tools.fd/orog.fd/CMakeLists.txt +++ b/sorc/orog_mask_tools.fd/orog.fd/CMakeLists.txt @@ -1,7 +1,7 @@ set(lib_src netcdf_io.F90) set(exe_src mtnlm7_oclsm.F) -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -convert big_endian -assume byterecl") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-real-8 -fconvert=big-endian -fno-range-check") diff --git a/sorc/orog_mask_tools.fd/orog_gsl.fd/CMakeLists.txt b/sorc/orog_mask_tools.fd/orog_gsl.fd/CMakeLists.txt index e37889f46..3149cc21f 100644 --- a/sorc/orog_mask_tools.fd/orog_gsl.fd/CMakeLists.txt +++ b/sorc/orog_mask_tools.fd/orog_gsl.fd/CMakeLists.txt @@ -4,7 +4,7 @@ set(lib_src set(exe_src gsl_oro_data.f90) -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -assume byterecl") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-real-8 -fno-range-check") diff --git a/sorc/orog_mask_tools.fd/orog_netcdf_tools.fd/mask.fd/CMakeLists.txt b/sorc/orog_mask_tools.fd/orog_netcdf_tools.fd/mask.fd/CMakeLists.txt index c9d6b34f2..bacaaa8b4 100644 --- a/sorc/orog_mask_tools.fd/orog_netcdf_tools.fd/mask.fd/CMakeLists.txt +++ b/sorc/orog_mask_tools.fd/orog_netcdf_tools.fd/mask.fd/CMakeLists.txt @@ -2,7 +2,7 @@ list(APPEND fortran_src mask.f90 ) -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -i4 -convert big_endian") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-real-8") diff --git a/sorc/orog_mask_tools.fd/orog_netcdf_tools.fd/ramp.fd/CMakeLists.txt b/sorc/orog_mask_tools.fd/orog_netcdf_tools.fd/ramp.fd/CMakeLists.txt index 384176eff..9c8a870e4 100644 --- a/sorc/orog_mask_tools.fd/orog_netcdf_tools.fd/ramp.fd/CMakeLists.txt +++ b/sorc/orog_mask_tools.fd/orog_netcdf_tools.fd/ramp.fd/CMakeLists.txt @@ -2,7 +2,7 @@ list(APPEND fortran_src ramp.f90 ) -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -i4 -convert big_endian") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-real-8") diff --git a/sorc/orog_mask_tools.fd/orog_netcdf_tools.fd/topo.fd/CMakeLists.txt b/sorc/orog_mask_tools.fd/orog_netcdf_tools.fd/topo.fd/CMakeLists.txt index e34d448ee..d782fd663 100644 --- a/sorc/orog_mask_tools.fd/orog_netcdf_tools.fd/topo.fd/CMakeLists.txt +++ b/sorc/orog_mask_tools.fd/orog_netcdf_tools.fd/topo.fd/CMakeLists.txt @@ -2,7 +2,7 @@ list(APPEND fortran_src topo.f90 ) -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -i4 -convert big_endian") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-real-8") From 322802522893e4651db5f63ae5ec81e7577a1f21 Mon Sep 17 00:00:00 2001 From: George Gayno Date: Wed, 14 Aug 2024 07:27:21 -0500 Subject: [PATCH 09/45] Update ocean_merge compilation. Fixes #879. --- CMakeLists.txt | 2 +- sorc/ocean_merge.fd/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 64c4d474f..45c65bd47 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,7 +34,7 @@ option(GBLEVENTS "Enable building gblevents.fd" ON) option(CPLD_GRIDGEN "Enable building cpld_gridgen.fd" ON) option(OCNICE_PREP "Enable building ocnice_prep.fd" ON) option(WEIGHT_GEN "Enable building weight_gen.fd" ON) -option(OCEAN_MERGE "Enable building ocean_merge.fd" OFF) +option(OCEAN_MERGE "Enable building ocean_merge.fd" ON) # Option to build application specific utilities option(GFS "Enable building GFS-only utilities" OFF) diff --git a/sorc/ocean_merge.fd/CMakeLists.txt b/sorc/ocean_merge.fd/CMakeLists.txt index 60d0a6b46..661060a19 100644 --- a/sorc/ocean_merge.fd/CMakeLists.txt +++ b/sorc/ocean_merge.fd/CMakeLists.txt @@ -2,7 +2,7 @@ list(APPEND fortran_src merge_lake_ocnmsk.f90 ) -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -i4 -convert big_endian") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-real-8") From 76c137acc25dfb1c1cf988d5b49fe0f120b0f23f Mon Sep 17 00:00:00 2001 From: George Gayno Date: Wed, 14 Aug 2024 07:40:19 -0500 Subject: [PATCH 10/45] Turn on compilation of fvcom_tools. Fixes #879. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 45c65bd47..95dc62e87 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,7 +29,7 @@ option(OROG_MASK_TOOLS "Enable building orog_mask_tools.fd" ON) option(OROG_NETCDF_TOOLS "Enable building orog_netcdf_tools.fd" ON) option(SFC_CLIMO_GEN "Enable building sfc_climo_gen.fd" ON) option(VCOORD_GEN "Enable building vcoord_gen.fd" ON) -option(FVCOMTOOLS "Enable building fvcom_tools.fd" OFF) +option(FVCOMTOOLS "Enable building fvcom_tools.fd" ON) option(GBLEVENTS "Enable building gblevents.fd" ON) option(CPLD_GRIDGEN "Enable building cpld_gridgen.fd" ON) option(OCNICE_PREP "Enable building ocnice_prep.fd" ON) From 82bfcd8f828449fa4bcdd30f3e4e964114a0817f Mon Sep 17 00:00:00 2001 From: George Gayno Date: Wed, 14 Aug 2024 08:54:54 -0500 Subject: [PATCH 11/45] Minor source code updates to fre-nctools to eliminate compiler warnings. Fixes #879. --- sorc/fre-nctools.fd/shared_lib/create_xgrid.c | 8 ++++---- sorc/fre-nctools.fd/shared_lib/interp.c | 4 ++-- sorc/fre-nctools.fd/shared_lib/mosaic_util.c | 6 +++--- sorc/fre-nctools.fd/tools/make_hgrid/make_hgrid.c | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sorc/fre-nctools.fd/shared_lib/create_xgrid.c b/sorc/fre-nctools.fd/shared_lib/create_xgrid.c index 4f4cb71c8..9a25026d4 100644 --- a/sorc/fre-nctools.fd/shared_lib/create_xgrid.c +++ b/sorc/fre-nctools.fd/shared_lib/create_xgrid.c @@ -2115,7 +2115,7 @@ double poly_ctrlon(const double x[], const double y[], int n, double clon) if( dphi2 > M_PI) dphi2 -= 2.0*M_PI; if( dphi2 <-M_PI) dphi2 += 2.0*M_PI; - if(abs(dphi2 -dphi1) < M_PI) { + if(fabs(dphi2 -dphi1) < M_PI) { ctrlon -= dphi * (dphi1*f1+dphi2*f2)/2.0; } else { @@ -2123,7 +2123,7 @@ double poly_ctrlon(const double x[], const double y[], int n, double clon) fac = M_PI; else fac = -M_PI; - fint = f1 + (f2-f1)*(fac-dphi1)/abs(dphi); + fint = f1 + (f2-f1)*(fac-dphi1)/fabs(dphi); ctrlon -= 0.5*dphi1*(dphi1-fac)*f1 - 0.5*dphi2*(dphi2+fac)*f2 + 0.5*fac*(dphi1+dphi2)*fint; } @@ -2183,7 +2183,7 @@ double box_ctrlon(double ll_lon, double ll_lat, double ur_lon, double ur_lat, do if( dphi2 > M_PI) dphi2 -= 2.0*M_PI; if( dphi2 <-M_PI) dphi2 += 2.0*M_PI; - if(abs(dphi2 -dphi1) < M_PI) { + if(fabs(dphi2 -dphi1) < M_PI) { ctrlon -= dphi * (dphi1*f1+dphi2*f2)/2.0; } else { @@ -2191,7 +2191,7 @@ double box_ctrlon(double ll_lon, double ll_lat, double ur_lon, double ur_lat, do fac = M_PI; else fac = -M_PI; - fint = f1 + (f2-f1)*(fac-dphi1)/abs(dphi); + fint = f1 + (f2-f1)*(fac-dphi1)/fabs(dphi); ctrlon -= 0.5*dphi1*(dphi1-fac)*f1 - 0.5*dphi2*(dphi2+fac)*f2 + 0.5*fac*(dphi1+dphi2)*fint; } diff --git a/sorc/fre-nctools.fd/shared_lib/interp.c b/sorc/fre-nctools.fd/shared_lib/interp.c index 1e4381cb7..c52474e47 100644 --- a/sorc/fre-nctools.fd/shared_lib/interp.c +++ b/sorc/fre-nctools.fd/shared_lib/interp.c @@ -78,7 +78,7 @@ End slopes d[0] = 0.0; } else { - if ( delta[0]*delta[1] < 0.0 && abs(d[0]) > abs(3.0*delta[0])) { + if ( delta[0]*delta[1] < 0.0 && fabs(d[0]) > fabs(3.0*delta[0])) { d[0]=3.0*delta[0]; } } @@ -88,7 +88,7 @@ End slopes d[kmax] = 0.0; } else { - if ( delta[kmax-1]*delta[kmax-2] < 0.0 && abs(d[kmax]) > abs(3.0*delta[kmax-1])) { + if ( delta[kmax-1]*delta[kmax-2] < 0.0 && fabs(d[kmax]) > fabs(3.0*delta[kmax-1])) { d[kmax]=3.0*delta[kmax-1]; } } diff --git a/sorc/fre-nctools.fd/shared_lib/mosaic_util.c b/sorc/fre-nctools.fd/shared_lib/mosaic_util.c index 99868ba71..9751a4268 100644 --- a/sorc/fre-nctools.fd/shared_lib/mosaic_util.c +++ b/sorc/fre-nctools.fd/shared_lib/mosaic_util.c @@ -528,8 +528,8 @@ double spherical_angle(const double *v1, const double *v2, const double *v3) angle = 0. ; else { ddd = (px*qx+py*qy+pz*qz) / sqrt(ddd); - if( fabs(ddd-1) < EPSLN30 ) ddd = 1; - if( fabs(ddd+1) < EPSLN30 ) ddd = -1; + if( fabsl(ddd-1) < EPSLN30 ) ddd = 1; + if( fabsl(ddd+1) < EPSLN30 ) ddd = -1; if ( ddd>1. || ddd<-1. ) { /*FIX (lmh) to correctly handle co-linear points (angle near pi or 0) */ if (ddd < 0.) @@ -731,7 +731,7 @@ int invert_matrix_3x3(long double m[], long double m_inv[]) { #ifdef test_invert_matrix_3x3 printf("det = %Lf\n", det); #endif - if (fabs(det) < EPSLN15 ) return 0; + if (fabsl(det) < EPSLN15 ) return 0; const long double deti = 1.0/det; diff --git a/sorc/fre-nctools.fd/tools/make_hgrid/make_hgrid.c b/sorc/fre-nctools.fd/tools/make_hgrid/make_hgrid.c index 06fcff476..ccde3aa5e 100644 --- a/sorc/fre-nctools.fd/tools/make_hgrid/make_hgrid.c +++ b/sorc/fre-nctools.fd/tools/make_hgrid/make_hgrid.c @@ -1037,7 +1037,7 @@ int main(int argc, char* argv[]) } } - if (verbose) fprintf(stderr, "[INFO] Allocating arrays of size %d for x, y based on nxp: %d nyp: %d ntiles: %d\n", size1, nxp, nyp, ntiles); + if (verbose) fprintf(stderr, "[INFO] Allocating arrays of size %lu for x, y based on nxp: %d nyp: %d ntiles: %d\n", size1, nxp, nyp, ntiles); x = (double *) malloc(size1*sizeof(double)); y = (double *) malloc(size1*sizeof(double)); area = (double *) malloc(size4*sizeof(double)); @@ -1198,7 +1198,7 @@ int main(int argc, char* argv[]) if(out_halo ==0) { if (verbose) { - fprintf(stderr, "[INFO] START NC XARRAY write out_halo=0 tile number = n: %d offset = pos_c: %d\n", n, pos_c); + fprintf(stderr, "[INFO] START NC XARRAY write out_halo=0 tile number = n: %d offset = pos_c: %ld\n", n, pos_c); fprintf(stderr, "[INFO] XARRAY: n: %d x[0]: %f x[1]: %f x[2]: %f x[3]: %f x[4]: %f x[5]: %f x[10]: %f\n", n, x[pos_c], x[pos_c+1], x[pos_c+2], x[pos_c+3], x[pos_c+4], x[pos_c+5], x[pos_c+10]); if (n > 0) fprintf(stderr, "[INFO] XARRAY: n: %d x[0]: %f x[-1]: %f x[-2]: %f x[-3]: %f x[-4]: %f x[-5]: %f x[-10]: %f\n", @@ -1259,9 +1259,9 @@ int main(int argc, char* argv[]) nxp = nx + 1; nyp = ny + 1; - if (verbose) fprintf(stderr, "[INFO] INDEX Before increment n: %d pos_c %d nxp %d nyp %d nxp*nyp %d\n", n, pos_c, nxp, nyp, nxp*nyp); + if (verbose) fprintf(stderr, "[INFO] INDEX Before increment n: %d pos_c %ld nxp %d nyp %d nxp*nyp %d\n", n, pos_c, nxp, nyp, nxp*nyp); pos_c += nxp*nyp; - if (verbose) fprintf(stderr, "[INFO] INDEX After increment n: %d pos_c %d.\n", n, pos_c); + if (verbose) fprintf(stderr, "[INFO] INDEX After increment n: %d pos_c %ld.\n", n, pos_c); pos_e += nxp*ny; pos_n += nx*nyp; pos_t += nx*ny; From 8a50fb0988b81ee07799eea69da49549b1b86833 Mon Sep 17 00:00:00 2001 From: George Gayno Date: Wed, 14 Aug 2024 13:47:03 -0500 Subject: [PATCH 12/45] Update build module on Orion. Fixes #879. --- modulefiles/build.orion.intel.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modulefiles/build.orion.intel.lua b/modulefiles/build.orion.intel.lua index d0f93d9a4..52a9a0463 100644 --- a/modulefiles/build.orion.intel.lua +++ b/modulefiles/build.orion.intel.lua @@ -59,4 +59,7 @@ load(pathJoin("esmf", esmf_ver)) nco_ver=os.getenv("nco_ver") or "5.0.6" load(pathJoin("nco", nco_ver)) +setenv("CC", "icx") +setenv("FC", "ifx") + whatis("Description: UFS_UTILS build environment") From 13f8bc05404c7e9ff0e1d00a3dfb2e8ab81fb6f6 Mon Sep 17 00:00:00 2001 From: George Gayno Date: Mon, 19 Aug 2024 09:14:26 -0500 Subject: [PATCH 13/45] Update Orion build to match UFSWM. Fixes #879. --- modulefiles/build.orion.intel.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modulefiles/build.orion.intel.lua b/modulefiles/build.orion.intel.lua index 52a9a0463..b06349a18 100644 --- a/modulefiles/build.orion.intel.lua +++ b/modulefiles/build.orion.intel.lua @@ -59,7 +59,10 @@ load(pathJoin("esmf", esmf_ver)) nco_ver=os.getenv("nco_ver") or "5.0.6" load(pathJoin("nco", nco_ver)) -setenv("CC", "icx") -setenv("FC", "ifx") +setenv("I_MPI_CC", "icx") +setenv("I_MPI_F90", "ifx") + +setenv("CC", "mpiicc") +setenv("FC", "mpiifort") whatis("Description: UFS_UTILS build environment") From 4737e0767c04ea438c129eeadfa5750a131f50f1 Mon Sep 17 00:00:00 2001 From: George Gayno Date: Mon, 19 Aug 2024 09:17:58 -0500 Subject: [PATCH 14/45] Update hercules build to match UFSWM. Fixes #879. --- modulefiles/build.hercules.intel.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modulefiles/build.hercules.intel.lua b/modulefiles/build.hercules.intel.lua index 9dc0cc3c4..ff05676a2 100644 --- a/modulefiles/build.hercules.intel.lua +++ b/modulefiles/build.hercules.intel.lua @@ -59,7 +59,10 @@ load(pathJoin("esmf", esmf_ver)) nco_ver=os.getenv("nco_ver") or "5.0.6" load(pathJoin("nco", nco_ver)) -setenv("CC", "icx") -setenv("FC", "ifx") +setenv("I_MPI_CC", "icx") +setenv("I_MPI_F90", "ifx") + +setenv("CC", "mpiicc") +setenv("FC", "mpiifort") whatis("Description: UFS_UTILS build environment") From baf6edd8ff5fd5cdcaeb76c5ce95794c4857c96f Mon Sep 17 00:00:00 2001 From: George Gayno Date: Mon, 19 Aug 2024 19:18:28 +0000 Subject: [PATCH 15/45] Update hera build module following the example of the UFSWM. Fixes #879. --- modulefiles/build.hera.intel.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modulefiles/build.hera.intel.lua b/modulefiles/build.hera.intel.lua index 377b0dda6..4d7bf5fd0 100644 --- a/modulefiles/build.hera.intel.lua +++ b/modulefiles/build.hera.intel.lua @@ -13,6 +13,9 @@ load(pathJoin("stack-intel", stack_intel_ver)) stack_impi_ver=os.getenv("stack_impi_ver") or "2021.5.1" load(pathJoin("stack-intel-oneapi-mpi", stack_impi_ver)) +load("gnu") +load("intel/2023.2.0") + cmake_ver=os.getenv("cmake_ver") or "3.23.1" load(pathJoin("cmake", cmake_ver)) @@ -62,4 +65,10 @@ load(pathJoin("esmf", esmf_ver)) nco_ver=os.getenv("nco_ver") or "5.0.6" load(pathJoin("nco", nco_ver)) +setenv("I_MPI_CC", "icx") +setenv("I_MPI_FC", "ifx") + +setenv("CC", "mpicc") +setenv("FC", "mpifc") + whatis("Description: UFS_UTILS build environment") From e23e79cb5e97ae991bd54e86a448524b92ea4d24 Mon Sep 17 00:00:00 2001 From: George Gayno Date: Mon, 19 Aug 2024 20:43:45 +0000 Subject: [PATCH 16/45] Update build for unit tests. Fixes #879. --- tests/chgres_cube/CMakeLists.txt | 2 +- tests/cpld_gridgen/CMakeLists.txt | 2 +- tests/emcsfc_snow2mdl/CMakeLists.txt | 2 +- tests/filter_topo/CMakeLists.txt | 4 ++-- tests/fre-nctools/shared_lib/CMakeLists.txt | 6 ------ tests/fre-nctools/shared_lib/tst_create_xgrid.c | 5 ++++- tests/fvcom_tools/CMakeLists.txt | 2 +- tests/global_cycle/CMakeLists.txt | 2 +- tests/ocnice_prep/CMakeLists.txt | 2 +- tests/sfc_climo_gen/CMakeLists.txt | 2 +- 10 files changed, 13 insertions(+), 16 deletions(-) diff --git a/tests/chgres_cube/CMakeLists.txt b/tests/chgres_cube/CMakeLists.txt index a5bb4ffff..55ebe2b96 100644 --- a/tests/chgres_cube/CMakeLists.txt +++ b/tests/chgres_cube/CMakeLists.txt @@ -20,7 +20,7 @@ endforeach() include (LibMPI) -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -assume byterecl") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-0 -fdefault-real-8") diff --git a/tests/cpld_gridgen/CMakeLists.txt b/tests/cpld_gridgen/CMakeLists.txt index 62bffce77..2554db027 100644 --- a/tests/cpld_gridgen/CMakeLists.txt +++ b/tests/cpld_gridgen/CMakeLists.txt @@ -9,7 +9,7 @@ set(GRID_FILE "ocean_hgrid.nc") PULL_DATA(${CPLDGRIDGEN_URL} ${GRID_FILE}) -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -assume byterecl") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-0 -fdefault-real-8") diff --git a/tests/emcsfc_snow2mdl/CMakeLists.txt b/tests/emcsfc_snow2mdl/CMakeLists.txt index ae43bf418..788423eb1 100644 --- a/tests/emcsfc_snow2mdl/CMakeLists.txt +++ b/tests/emcsfc_snow2mdl/CMakeLists.txt @@ -3,7 +3,7 @@ # # George Gayno -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -assume byterecl") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-0 -fdefault-real-8") diff --git a/tests/filter_topo/CMakeLists.txt b/tests/filter_topo/CMakeLists.txt index 0928b3e24..33bd0039a 100644 --- a/tests/filter_topo/CMakeLists.txt +++ b/tests/filter_topo/CMakeLists.txt @@ -3,8 +3,8 @@ # # George Gayno, Ed Hartnett -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -assume byterecl") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -real-size 64 -assume byterecl") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-0 -fdefault-real-8") endif() diff --git a/tests/fre-nctools/shared_lib/CMakeLists.txt b/tests/fre-nctools/shared_lib/CMakeLists.txt index 5827563c2..8054a6482 100644 --- a/tests/fre-nctools/shared_lib/CMakeLists.txt +++ b/tests/fre-nctools/shared_lib/CMakeLists.txt @@ -8,9 +8,3 @@ include_directories(${CMAKE_SOURCE_DIR}/sorc/fre-nctools.fd/shared_lib) add_executable(tst_create_xgrid tst_create_xgrid.c) add_test(NAME fre-nctools-tst_create_xgrid COMMAND tst_create_xgrid) target_link_libraries(tst_create_xgrid NetCDF::NetCDF_C shared_lib m) - - - - - - diff --git a/tests/fre-nctools/shared_lib/tst_create_xgrid.c b/tests/fre-nctools/shared_lib/tst_create_xgrid.c index 7fd0ae58b..561d76026 100644 --- a/tests/fre-nctools/shared_lib/tst_create_xgrid.c +++ b/tests/fre-nctools/shared_lib/tst_create_xgrid.c @@ -4,6 +4,9 @@ #include #include +#include "mosaic_util.h" +#include "create_xgrid.h" + #define D2R (M_PI/180) #define R2D (180/M_PI) #define MAXPOINT 1000 @@ -495,7 +498,7 @@ int main(int argc, char* argv[]) } area1 = (double *)malloc((nlon1)*(nlat1)*sizeof(double)); - get_grid_great_circle_area_(&nlon1, &nlat1, lon1_in, lat1_in, area1); + get_grid_great_circle_area(&nlon1, &nlat1, lon1_in, lat1_in, area1); printf("xgrid area sum is %g, grid 1 area is %g\n", area_sum, area1[0]); } diff --git a/tests/fvcom_tools/CMakeLists.txt b/tests/fvcom_tools/CMakeLists.txt index 125d2c956..dc3ccb41c 100644 --- a/tests/fvcom_tools/CMakeLists.txt +++ b/tests/fvcom_tools/CMakeLists.txt @@ -12,7 +12,7 @@ foreach(THE_FILE IN LISTS FVCOM_FILE SFCDATA_FILE) PULL_DATA(${FVCOM_URL} ${THE_FILE}) endforeach() -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -assume byterecl") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-0 -fdefault-real-8") diff --git a/tests/global_cycle/CMakeLists.txt b/tests/global_cycle/CMakeLists.txt index 7937d229c..2396f97d3 100644 --- a/tests/global_cycle/CMakeLists.txt +++ b/tests/global_cycle/CMakeLists.txt @@ -19,7 +19,7 @@ endforeach() # Include cmake to allow parallel I/O tests. include (LibMPI) -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -assume byterecl") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-0 -fdefault-real-8") diff --git a/tests/ocnice_prep/CMakeLists.txt b/tests/ocnice_prep/CMakeLists.txt index 622d647d0..de13267e6 100644 --- a/tests/ocnice_prep/CMakeLists.txt +++ b/tests/ocnice_prep/CMakeLists.txt @@ -3,7 +3,7 @@ # # George Gayno, Ed Hartnett -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -assume byterecl") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-0 -fdefault-real-8") diff --git a/tests/sfc_climo_gen/CMakeLists.txt b/tests/sfc_climo_gen/CMakeLists.txt index 0067900d7..2c6dccf3b 100644 --- a/tests/sfc_climo_gen/CMakeLists.txt +++ b/tests/sfc_climo_gen/CMakeLists.txt @@ -20,7 +20,7 @@ PULL_DATA(${SFCGEN2_URL} ${VEG_FILE}) # Include cmake to allow parallel I/O tests. include (LibMPI) -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -assume byterecl") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-0 -fdefault-real-8") From 97d8e444ec3c8a913954bef9de9d22dcca9783e2 Mon Sep 17 00:00:00 2001 From: George Gayno Date: Tue, 20 Aug 2024 12:41:58 -0500 Subject: [PATCH 17/45] Update fvcom_tools build for IntelLLVM. Fixes #879. --- sorc/fvcom_tools.fd/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sorc/fvcom_tools.fd/CMakeLists.txt b/sorc/fvcom_tools.fd/CMakeLists.txt index 97c66afff..0728f2d1c 100644 --- a/sorc/fvcom_tools.fd/CMakeLists.txt +++ b/sorc/fvcom_tools.fd/CMakeLists.txt @@ -10,7 +10,7 @@ set(fortran_src set(exe_src process_FVCOM.f90) -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-0 -fdefault-real-8") From 1056ef500d201e35fc1ff5530f842cf69765eff3 Mon Sep 17 00:00:00 2001 From: George Gayno Date: Tue, 20 Aug 2024 15:08:59 -0500 Subject: [PATCH 18/45] Update main CMakeLists.txt to set 'C' compiler options. Fixes #879. --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 95dc62e87..4e3d764c6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,10 +86,14 @@ elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -ggdb -Wall -fcheck=all") endif() -if(CMAKE_C_COMPILER_ID MATCHES "^(Intel)$") +if(CMAKE_C_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -traceback") - set(CMAKE_C_FLAGS_RELEASE "-O2") set(CMAKE_C_FLAGS_DEBUG "-O0") + if(CMAKE_C_COMPILER_ID MATCHES "^(Intel)$") + set(CMAKE_C_FLAGS_RELEASE "-O2") + else() + set(CMAKE_C_FLAGS_RELEASE "-O1") + endif() endif() # Find packages. From c10e85addabd951d10270da1d0744ed2a57dfa16 Mon Sep 17 00:00:00 2001 From: George Gayno Date: Thu, 22 Aug 2024 14:12:19 -0500 Subject: [PATCH 19/45] Update ubuntu_intel.yaml workflow file to use IntelLLVM. Fixes #879. --- .github/workflows/ubuntu_intel.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ubuntu_intel.yaml b/.github/workflows/ubuntu_intel.yaml index 7c882c313..9b2da1e65 100644 --- a/.github/workflows/ubuntu_intel.yaml +++ b/.github/workflows/ubuntu_intel.yaml @@ -7,14 +7,14 @@ defaults: run: shell: bash -leo pipefail {0} -# Set I_MPI_CC/F90 so Intel MPI wrapper uses icc/ifort instead of gcc/gfortran +# Set I_MPI_CC/F90 so IntelLLVM is used. env: cache_key: intel - CC: icc - FC: ifort - CXX: icpc - I_MPI_CC: icc - I_MPI_F90: ifort + CC: mpiicc + FC: mpiifort + CXX: mpiicpc + I_MPI_CC: icx + I_MPI_F90: ifx # The jobs are split into: # 1. a dependency build step (setup), and From 56bf5e1ea228f0e71c6f4020f7622442933cd624 Mon Sep 17 00:00:00 2001 From: George Gayno Date: Tue, 27 Aug 2024 12:55:06 -0500 Subject: [PATCH 20/45] Update speck build. Fixes #879. --- .github/workflows/macos_clang.yaml | 2 +- .github/workflows/ubuntu_gcc.yaml | 2 +- .github/workflows/ubuntu_intel.yaml | 6 +++--- ci/spack.yaml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/macos_clang.yaml b/.github/workflows/macos_clang.yaml index 25f6bc693..f3fc4b27b 100644 --- a/.github/workflows/macos_clang.yaml +++ b/.github/workflows/macos_clang.yaml @@ -47,7 +47,7 @@ jobs: run: | git clone -c feature.manyFiles=true https://github.com/JCSDA/spack.git source spack/share/spack/setup-env.sh - sed "s/\[intel, gcc@10:10, apple-clang@14\]/\[apple-clang@14\]/g" ufs_utils/ci/spack.yaml > spack_ci.yaml + sed "s/\[oneapi, intel, gcc@10:10, apple-clang@14\]/\[apple-clang@14\]/g" ufs_utils/ci/spack.yaml > spack_ci.yaml spack env create ufs_utils-env spack_ci.yaml spack env activate ufs_utils-env spack external find diff --git a/.github/workflows/ubuntu_gcc.yaml b/.github/workflows/ubuntu_gcc.yaml index b501ef5ef..065e6d152 100644 --- a/.github/workflows/ubuntu_gcc.yaml +++ b/.github/workflows/ubuntu_gcc.yaml @@ -47,7 +47,7 @@ jobs: run: | git clone -c feature.manyFiles=true https://github.com/JCSDA/spack.git source spack/share/spack/setup-env.sh - sed "s/\[intel, gcc@10:10, apple-clang@14\]/\[gcc@10:10\]/g" ufs_utils/ci/spack.yaml > spack_ci.yaml + sed "s/\[oneapi, intel, gcc@10:10, apple-clang@14\]/\[gcc@10:10\]/g" ufs_utils/ci/spack.yaml > spack_ci.yaml spack env create ufs_utils-env spack_ci.yaml spack env activate ufs_utils-env sudo apt install cmake diff --git a/.github/workflows/ubuntu_intel.yaml b/.github/workflows/ubuntu_intel.yaml index 9b2da1e65..e721a44a4 100644 --- a/.github/workflows/ubuntu_intel.yaml +++ b/.github/workflows/ubuntu_intel.yaml @@ -59,7 +59,7 @@ jobs: run: | git clone -c feature.manyFiles=true https://github.com/JCSDA/spack.git source spack/share/spack/setup-env.sh - sed "s/\[intel, gcc@10:10, apple-clang@14\]/\[intel\]/g" ufs_utils/ci/spack.yaml > spack_ci.yaml + sed "s/\[oneapi, intel, gcc@10:10, apple-clang@14\]/\[oneapi\]/g" ufs_utils/ci/spack.yaml > spack_ci.yaml spack env create ufs_utils-env spack_ci.yaml spack env activate ufs_utils-env spack compiler find @@ -99,8 +99,8 @@ jobs: run: | source spack/share/spack/setup-env.sh spack env activate ufs_utils-env - export CC=mpiicc - export FC=mpiifort + export CC + export FC cd ufs_utils mkdir -p build && cd build cmake -DCMAKE_INSTALL_PREFIX=../install .. diff --git a/ci/spack.yaml b/ci/spack.yaml index f0db7c2ac..c72a0f3b1 100644 --- a/ci/spack.yaml +++ b/ci/spack.yaml @@ -2,7 +2,7 @@ spack: packages: all: - compiler: [intel, gcc@10:10, apple-clang@14] + compiler: [oneapi, intel, gcc@10:10, apple-clang@14] specs: - netcdf-c@4.9.2 - netcdf-fortran@4.6.1 From 98f840afab077cf04c547762f201da190cd51ac3 Mon Sep 17 00:00:00 2001 From: George Gayno Date: Wed, 28 Aug 2024 12:26:58 +0000 Subject: [PATCH 21/45] Change definitions of CC and FC. Fixes #879. --- .github/workflows/ubuntu_intel.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ubuntu_intel.yaml b/.github/workflows/ubuntu_intel.yaml index e721a44a4..ae221b0c5 100644 --- a/.github/workflows/ubuntu_intel.yaml +++ b/.github/workflows/ubuntu_intel.yaml @@ -99,8 +99,8 @@ jobs: run: | source spack/share/spack/setup-env.sh spack env activate ufs_utils-env - export CC - export FC + export CC=mpiicx + export FC=mpiifx cd ufs_utils mkdir -p build && cd build cmake -DCMAKE_INSTALL_PREFIX=../install .. From c1524bc2c1d8781acafe317d944f51c8711dc871 Mon Sep 17 00:00:00 2001 From: George Gayno Date: Mon, 30 Sep 2024 15:22:41 -0500 Subject: [PATCH 22/45] Update the orog unit test build for IntelLLVM. Fixes #879. --- tests/orog/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/orog/CMakeLists.txt b/tests/orog/CMakeLists.txt index b1bd2179b..863a4d47d 100644 --- a/tests/orog/CMakeLists.txt +++ b/tests/orog/CMakeLists.txt @@ -2,7 +2,7 @@ # # George Gayno, Ed Hartnett -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-0 -fdefault-real-8") From 0147b590afef1fe20f8f1393ac1bb5aa942c495f Mon Sep 17 00:00:00 2001 From: George Gayno Date: Tue, 22 Oct 2024 09:57:33 -0500 Subject: [PATCH 23/45] Update spack.yaml to use sigio v2.3.3, which as updated to use oneapi. Fixes #879. --- ci/spack.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/spack.yaml b/ci/spack.yaml index c72a0f3b1..2804073b3 100644 --- a/ci/spack.yaml +++ b/ci/spack.yaml @@ -13,7 +13,7 @@ spack: - sp@2.5.0 - w3emc@2.10.0 - sfcio@1.4.1 - - sigio@2.3.2 + - sigio@2.3.3 - nccmp@1.9.0.1 - parallelio@2.5.10+fortran~pnetcdf - esmf@8.6.0 From 082fb20b1d954dcb15686971917ab1d34e4adedf Mon Sep 17 00:00:00 2001 From: George Gayno Date: Tue, 22 Oct 2024 15:09:49 -0500 Subject: [PATCH 24/45] Rename hercules build module so both the new and old intel compilers may be used. Fixes #879. --- build_all.sh | 2 +- .../{build.hercules.intel.lua => build.hercules.intelllvm.lua} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename modulefiles/{build.hercules.intel.lua => build.hercules.intelllvm.lua} (96%) diff --git a/build_all.sh b/build_all.sh index eb57c7b2d..bf0a3a5fe 100755 --- a/build_all.sh +++ b/build_all.sh @@ -19,7 +19,7 @@ source "${DIR_ROOT}/sorc/machine-setup.sh" # User Options target=${target:-"NULL"} -compiler=${compiler:-"intel"} +compiler=${compiler:-"intelllvm"} if [[ "$target" == "linux.*" || "$target" == "macosx.*" ]]; then unset -f module diff --git a/modulefiles/build.hercules.intel.lua b/modulefiles/build.hercules.intelllvm.lua similarity index 96% rename from modulefiles/build.hercules.intel.lua rename to modulefiles/build.hercules.intelllvm.lua index ff05676a2..5253076b2 100644 --- a/modulefiles/build.hercules.intel.lua +++ b/modulefiles/build.hercules.intelllvm.lua @@ -1,5 +1,5 @@ help([[ -Load environment to compile UFS_UTILS on Hercules using Intel +Load environment to compile UFS_UTILS on Hercules using IntelLLVM ]]) prepend_path("MODULEPATH", "/work/noaa/epic/role-epic/spack-stack/hercules/spack-stack-1.6.0/envs/unified-env/install/modulefiles/Core") From 9a4ae70b78f9b5a378b017cb9a7563405d46b7ce Mon Sep 17 00:00:00 2001 From: George Gayno Date: Tue, 22 Oct 2024 15:12:21 -0500 Subject: [PATCH 25/45] Add back the intel classic build module for hercules. Fixes #879. --- modulefiles/build.hercules.intel.lua | 62 ++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 modulefiles/build.hercules.intel.lua diff --git a/modulefiles/build.hercules.intel.lua b/modulefiles/build.hercules.intel.lua new file mode 100644 index 000000000..23314b7bd --- /dev/null +++ b/modulefiles/build.hercules.intel.lua @@ -0,0 +1,62 @@ +help([[ +Load environment to compile UFS_UTILS on Hercules using Intel Classic +]]) + +prepend_path("MODULEPATH", "/work/noaa/epic/role-epic/spack-stack/hercules/spack-stack-1.6.0/envs/unified-env/install/modulefiles/Core") + +stack_intel_ver=os.getenv("stack_intel_ver") or "2021.9.0" +load(pathJoin("stack-intel", stack_intel_ver)) + +stack_impi_ver=os.getenv("stack_impi_ver") or "2021.9.0" +load(pathJoin("stack-intel-oneapi-mpi", stack_impi_ver)) + +cmake_ver=os.getenv("cmake_ver") or "3.23.1" +load(pathJoin("cmake", cmake_ver)) + +bacio_ver=os.getenv("bacio_ver") or "2.4.1" +load(pathJoin("bacio", bacio_ver)) + +g2_ver=os.getenv("g2_ver") or "3.4.5" +load(pathJoin("g2", g2_ver)) + +ip_ver=os.getenv("ip_ver") or "4.3.0" +load(pathJoin("ip", ip_ver)) + +nemsio_ver=os.getenv("nemsio_ver") or "2.5.4" +load(pathJoin("nemsio", nemsio_ver)) + +sp_ver=os.getenv("sp_ver") or "2.5.0" +load(pathJoin("sp", sp_ver)) + +w3emc_ver=os.getenv("w3emc_ver") or "2.10.0" +load(pathJoin("w3emc", w3emc_ver)) + +-- Uncomment when CHGRES_ALL is ON +--sfcio_ver=os.getenv("sfcio_ver") or "1.4.1" +--load(pathJoin("sfcio", sfcio_ver)) + +sigio_ver=os.getenv("sigio_ver") or "2.3.2" +load(pathJoin("sigio", sigio_ver)) + +zlib_ver=os.getenv("zlib_ver") or "1.2.13" +load(pathJoin("zlib", zlib_ver)) + +png_ver=os.getenv("png_ver") or "1.6.37" +load(pathJoin("libpng", png_ver)) + +netcdf_c_ver=os.getenv("netcdf_c_ver") or "4.9.2" +load(pathJoin("netcdf-c", netcdf_c_ver)) + +netcdf_fortran_ver=os.getenv("netcdf_fortran_ver") or "4.6.1" +load(pathJoin("netcdf-fortran", netcdf_fortran_ver)) + +nccmp_ver=os.getenv("nccmp_ver") or "1.9.0.1" +load(pathJoin("nccmp", nccmp_ver)) + +esmf_ver=os.getenv("esmf_ver") or "8.6.0" +load(pathJoin("esmf", esmf_ver)) + +nco_ver=os.getenv("nco_ver") or "5.0.6" +load(pathJoin("nco", nco_ver)) + +whatis("Description: UFS_UTILS build environment") From 948331c17bb49019651280636a29bf3b95b59ec0 Mon Sep 17 00:00:00 2001 From: George Gayno Date: Tue, 22 Oct 2024 15:20:59 -0500 Subject: [PATCH 26/45] Rename orion build module to reflect new compiler. Fixes #879. --- modulefiles/{build.orion.intel.lua => build.orion.intelllvm.lua} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modulefiles/{build.orion.intel.lua => build.orion.intelllvm.lua} (100%) diff --git a/modulefiles/build.orion.intel.lua b/modulefiles/build.orion.intelllvm.lua similarity index 100% rename from modulefiles/build.orion.intel.lua rename to modulefiles/build.orion.intelllvm.lua From dfb8730ed9f879d83d5366d32d5d6983bae7a6ec Mon Sep 17 00:00:00 2001 From: George Gayno Date: Tue, 22 Oct 2024 15:23:02 -0500 Subject: [PATCH 27/45] Add back intel classic build module for orion. Fixes #879. --- modulefiles/build.orion.intel.lua | 62 +++++++++++++++++++++++++++ modulefiles/build.orion.intelllvm.lua | 2 +- 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 modulefiles/build.orion.intel.lua diff --git a/modulefiles/build.orion.intel.lua b/modulefiles/build.orion.intel.lua new file mode 100644 index 000000000..1d51da87a --- /dev/null +++ b/modulefiles/build.orion.intel.lua @@ -0,0 +1,62 @@ +help([[ +Load environment to compile UFS_UTILS on Orion using Intel classic +]]) + +prepend_path("MODULEPATH", "/work/noaa/epic/role-epic/spack-stack/orion/spack-stack-1.6.0/envs/unified-env-rocky9/install/modulefiles/Core") + +stack_intel_ver=os.getenv("stack_intel_ver") or "2021.9.0" +load(pathJoin("stack-intel", stack_intel_ver)) + +stack_impi_ver=os.getenv("stack_impi_ver") or "2021.9.0" +load(pathJoin("stack-intel-oneapi-mpi", stack_impi_ver)) + +cmake_ver=os.getenv("cmake_ver") or "3.23.1" +load(pathJoin("cmake", cmake_ver)) + +bacio_ver=os.getenv("bacio_ver") or "2.4.1" +load(pathJoin("bacio", bacio_ver)) + +g2_ver=os.getenv("g2_ver") or "3.4.5" +load(pathJoin("g2", g2_ver)) + +ip_ver=os.getenv("ip_ver") or "4.3.0" +load(pathJoin("ip", ip_ver)) + +nemsio_ver=os.getenv("nemsio_ver") or "2.5.4" +load(pathJoin("nemsio", nemsio_ver)) + +sp_ver=os.getenv("sp_ver") or "2.5.0" +load(pathJoin("sp", sp_ver)) + +w3emc_ver=os.getenv("w3emc_ver") or "2.10.0" +load(pathJoin("w3emc", w3emc_ver)) + +-- Uncomment when CHGRES_ALL is ON +--sfcio_ver=os.getenv("sfcio_ver") or "1.4.1" +--load(pathJoin("sfcio", sfcio_ver)) + +sigio_ver=os.getenv("sigio_ver") or "2.3.2" +load(pathJoin("sigio", sigio_ver)) + +zlib_ver=os.getenv("zlib_ver") or "1.2.13" +load(pathJoin("zlib", zlib_ver)) + +png_ver=os.getenv("png_ver") or "1.6.37" +load(pathJoin("libpng", png_ver)) + +netcdf_c_ver=os.getenv("netcdf_c_ver") or "4.9.2" +load(pathJoin("netcdf-c", netcdf_c_ver)) + +netcdf_fortran_ver=os.getenv("netcdf_fortran_ver") or "4.6.1" +load(pathJoin("netcdf-fortran", netcdf_fortran_ver)) + +nccmp_ver=os.getenv("nccmp_ver") or "1.9.0.1" +load(pathJoin("nccmp", nccmp_ver)) + +esmf_ver=os.getenv("esmf_ver") or "8.6.0" +load(pathJoin("esmf", esmf_ver)) + +nco_ver=os.getenv("nco_ver") or "5.0.6" +load(pathJoin("nco", nco_ver)) + +whatis("Description: UFS_UTILS build environment") diff --git a/modulefiles/build.orion.intelllvm.lua b/modulefiles/build.orion.intelllvm.lua index b06349a18..9b2464b11 100644 --- a/modulefiles/build.orion.intelllvm.lua +++ b/modulefiles/build.orion.intelllvm.lua @@ -1,5 +1,5 @@ help([[ -Load environment to compile UFS_UTILS on Orion using Intel +Load environment to compile UFS_UTILS on Orion using IntelLLVM ]]) prepend_path("MODULEPATH", "/work/noaa/epic/role-epic/spack-stack/orion/spack-stack-1.6.0/envs/unified-env-rocky9/install/modulefiles/Core") From a4136ebbeade06fca8b28f8da362a4641cf62b8d Mon Sep 17 00:00:00 2001 From: George Gayno Date: Wed, 23 Oct 2024 14:56:52 +0000 Subject: [PATCH 28/45] Remove sfcio library from spack.yaml as it is not used by the unit tests. Fixes #879. --- ci/spack.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/ci/spack.yaml b/ci/spack.yaml index 2804073b3..6922b58b7 100644 --- a/ci/spack.yaml +++ b/ci/spack.yaml @@ -12,7 +12,6 @@ spack: - nemsio@2.5.4 - sp@2.5.0 - w3emc@2.10.0 - - sfcio@1.4.1 - sigio@2.3.3 - nccmp@1.9.0.1 - parallelio@2.5.10+fortran~pnetcdf From f47f84d1de3fb2395f8ecaba69dfd3c73086f8a8 Mon Sep 17 00:00:00 2001 From: George Gayno Date: Wed, 23 Oct 2024 17:23:06 +0000 Subject: [PATCH 29/45] Add diagnostic print to chgres_cube test. Fixes #879. --- tests/chgres_cube/ftst_read_atm_grib2.F90 | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/chgres_cube/ftst_read_atm_grib2.F90 b/tests/chgres_cube/ftst_read_atm_grib2.F90 index 7d19ffeb9..8c7c7b6b0 100644 --- a/tests/chgres_cube/ftst_read_atm_grib2.F90 +++ b/tests/chgres_cube/ftst_read_atm_grib2.F90 @@ -241,6 +241,7 @@ program read_atm_grib2 if (abs(data3d_one_tile(i_check(2),j_check(2),k_check(2)) - expected_values_zwind(2)) > EPSILON) stop 29 call ESMF_FieldGather(ps_input_grid, data_one_tile, rootPet=0, rc=rc) + print*,'got here ', data_one_tile(i_check(1),j_check(1)), expected_values_ps(1) if (abs(data_one_tile(i_check(1),j_check(1)) - expected_values_ps(1)) > EPSILON) stop 32 call ESMF_FieldGather(terrain_input_grid, data_one_tile, rootPet=0, rc=rc) From 6c57bf9bd2daeb57a46eebb1df9786a6b94cf747 Mon Sep 17 00:00:00 2001 From: George Gayno Date: Wed, 23 Oct 2024 17:57:26 +0000 Subject: [PATCH 30/45] Increase error threshold for the chgres/ftst_read_atm_grib2.F90 check of pressure. Fixes #879. --- tests/chgres_cube/ftst_read_atm_grib2.F90 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/chgres_cube/ftst_read_atm_grib2.F90 b/tests/chgres_cube/ftst_read_atm_grib2.F90 index 8c7c7b6b0..d89ffd9db 100644 --- a/tests/chgres_cube/ftst_read_atm_grib2.F90 +++ b/tests/chgres_cube/ftst_read_atm_grib2.F90 @@ -241,8 +241,7 @@ program read_atm_grib2 if (abs(data3d_one_tile(i_check(2),j_check(2),k_check(2)) - expected_values_zwind(2)) > EPSILON) stop 29 call ESMF_FieldGather(ps_input_grid, data_one_tile, rootPet=0, rc=rc) - print*,'got here ', data_one_tile(i_check(1),j_check(1)), expected_values_ps(1) - if (abs(data_one_tile(i_check(1),j_check(1)) - expected_values_ps(1)) > EPSILON) stop 32 + if (abs(data_one_tile(i_check(1),j_check(1)) - expected_values_ps(1)) > (20.0*EPSILON)) stop 32 call ESMF_FieldGather(terrain_input_grid, data_one_tile, rootPet=0, rc=rc) if (abs(data_one_tile(i_check(1),j_check(1)) - expected_values_terrain(1)) > EPSILON) stop 34 From b2e987b0a643f09f64db3fa6776bcbf73379dfb7 Mon Sep 17 00:00:00 2001 From: George Gayno Date: Wed, 23 Oct 2024 18:14:42 +0000 Subject: [PATCH 31/45] Rename hera build module as intelllvm. Fixes #879. --- modulefiles/{build.hera.intel.lua => build.hera.intelllvm.lua} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modulefiles/{build.hera.intel.lua => build.hera.intelllvm.lua} (100%) diff --git a/modulefiles/build.hera.intel.lua b/modulefiles/build.hera.intelllvm.lua similarity index 100% rename from modulefiles/build.hera.intel.lua rename to modulefiles/build.hera.intelllvm.lua From ba8d2412118305cb64864255980f84f28bc8c08b Mon Sep 17 00:00:00 2001 From: George Gayno Date: Wed, 23 Oct 2024 18:17:30 +0000 Subject: [PATCH 32/45] Add back hera intel classic build modules. Fixes #879. --- modulefiles/build.hera.intel.lua | 65 ++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 modulefiles/build.hera.intel.lua diff --git a/modulefiles/build.hera.intel.lua b/modulefiles/build.hera.intel.lua new file mode 100644 index 000000000..377b0dda6 --- /dev/null +++ b/modulefiles/build.hera.intel.lua @@ -0,0 +1,65 @@ +help([[ +Load environment to compile UFS_UTILS on Hera using Intel +]]) + +hpss_ver=os.getenv("hpss_ver") or "" +load(pathJoin("hpss", hpss_ver)) + +prepend_path("MODULEPATH", "/scratch1/NCEPDEV/nems/role.epic/spack-stack/spack-stack-1.6.0/envs/unified-env-rocky8/install/modulefiles/Core") + +stack_intel_ver=os.getenv("stack_intel_ver") or "2021.5.0" +load(pathJoin("stack-intel", stack_intel_ver)) + +stack_impi_ver=os.getenv("stack_impi_ver") or "2021.5.1" +load(pathJoin("stack-intel-oneapi-mpi", stack_impi_ver)) + +cmake_ver=os.getenv("cmake_ver") or "3.23.1" +load(pathJoin("cmake", cmake_ver)) + +bacio_ver=os.getenv("bacio_ver") or "2.4.1" +load(pathJoin("bacio", bacio_ver)) + +g2_ver=os.getenv("g2_ver") or "3.4.5" +load(pathJoin("g2", g2_ver)) + +ip_ver=os.getenv("ip_ver") or "4.3.0" +load(pathJoin("ip", ip_ver)) + +nemsio_ver=os.getenv("nemsio_ver") or "2.5.4" +load(pathJoin("nemsio", nemsio_ver)) + +sp_ver=os.getenv("sp_ver") or "2.5.0" +load(pathJoin("sp", sp_ver)) + +w3emc_ver=os.getenv("w3emc_ver") or "2.10.0" +load(pathJoin("w3emc", w3emc_ver)) + +-- Uncomment when CHGRES_ALL is ON +--sfcio_ver=os.getenv("sfcio_ver") or "1.4.1" +--load(pathJoin("sfcio", sfcio_ver)) + +sigio_ver=os.getenv("sigio_ver") or "2.3.2" +load(pathJoin("sigio", sigio_ver)) + +zlib_ver=os.getenv("zlib_ver") or "1.2.13" +load(pathJoin("zlib", zlib_ver)) + +png_ver=os.getenv("png_ver") or "1.6.37" +load(pathJoin("libpng", png_ver)) + +netcdf_c_ver=os.getenv("netcdf_c_ver") or "4.9.2" +load(pathJoin("netcdf-c", netcdf_c_ver)) + +netcdf_fortran_ver=os.getenv("netcdf_fortran_ver") or "4.6.1" +load(pathJoin("netcdf-fortran", netcdf_fortran_ver)) + +nccmp_ver=os.getenv("nccmp_ver") or "1.9.0.1" +load(pathJoin("nccmp", nccmp_ver)) + +esmf_ver=os.getenv("esmf_ver") or "8.6.0" +load(pathJoin("esmf", esmf_ver)) + +nco_ver=os.getenv("nco_ver") or "5.0.6" +load(pathJoin("nco", nco_ver)) + +whatis("Description: UFS_UTILS build environment") From 8ae6efabe974ccd0d48f7339d79e2f657384f6e0 Mon Sep 17 00:00:00 2001 From: George Gayno Date: Thu, 24 Oct 2024 13:46:35 +0000 Subject: [PATCH 33/45] Remove some references to intel classic in workflow files. Fixes #879. --- .github/workflows/macos_clang.yaml | 2 +- .github/workflows/ubuntu_gcc.yaml | 2 +- .github/workflows/ubuntu_intel.yaml | 2 +- ci/spack.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/macos_clang.yaml b/.github/workflows/macos_clang.yaml index f3fc4b27b..817acd38f 100644 --- a/.github/workflows/macos_clang.yaml +++ b/.github/workflows/macos_clang.yaml @@ -47,7 +47,7 @@ jobs: run: | git clone -c feature.manyFiles=true https://github.com/JCSDA/spack.git source spack/share/spack/setup-env.sh - sed "s/\[oneapi, intel, gcc@10:10, apple-clang@14\]/\[apple-clang@14\]/g" ufs_utils/ci/spack.yaml > spack_ci.yaml + sed "s/\[oneapi, gcc@10:10, apple-clang@14\]/\[apple-clang@14\]/g" ufs_utils/ci/spack.yaml > spack_ci.yaml spack env create ufs_utils-env spack_ci.yaml spack env activate ufs_utils-env spack external find diff --git a/.github/workflows/ubuntu_gcc.yaml b/.github/workflows/ubuntu_gcc.yaml index 065e6d152..850434efe 100644 --- a/.github/workflows/ubuntu_gcc.yaml +++ b/.github/workflows/ubuntu_gcc.yaml @@ -47,7 +47,7 @@ jobs: run: | git clone -c feature.manyFiles=true https://github.com/JCSDA/spack.git source spack/share/spack/setup-env.sh - sed "s/\[oneapi, intel, gcc@10:10, apple-clang@14\]/\[gcc@10:10\]/g" ufs_utils/ci/spack.yaml > spack_ci.yaml + sed "s/\[oneapi, gcc@10:10, apple-clang@14\]/\[gcc@10:10\]/g" ufs_utils/ci/spack.yaml > spack_ci.yaml spack env create ufs_utils-env spack_ci.yaml spack env activate ufs_utils-env sudo apt install cmake diff --git a/.github/workflows/ubuntu_intel.yaml b/.github/workflows/ubuntu_intel.yaml index ae221b0c5..b90e31234 100644 --- a/.github/workflows/ubuntu_intel.yaml +++ b/.github/workflows/ubuntu_intel.yaml @@ -59,7 +59,7 @@ jobs: run: | git clone -c feature.manyFiles=true https://github.com/JCSDA/spack.git source spack/share/spack/setup-env.sh - sed "s/\[oneapi, intel, gcc@10:10, apple-clang@14\]/\[oneapi\]/g" ufs_utils/ci/spack.yaml > spack_ci.yaml + sed "s/\[oneapi, gcc@10:10, apple-clang@14\]/\[oneapi\]/g" ufs_utils/ci/spack.yaml > spack_ci.yaml spack env create ufs_utils-env spack_ci.yaml spack env activate ufs_utils-env spack compiler find diff --git a/ci/spack.yaml b/ci/spack.yaml index 6922b58b7..ee8a4ee1b 100644 --- a/ci/spack.yaml +++ b/ci/spack.yaml @@ -2,7 +2,7 @@ spack: packages: all: - compiler: [oneapi, intel, gcc@10:10, apple-clang@14] + compiler: [oneapi, gcc@10:10, apple-clang@14] specs: - netcdf-c@4.9.2 - netcdf-fortran@4.6.1 From 4c6d932573d1c87861e055fe59036b5420c4e8a4 Mon Sep 17 00:00:00 2001 From: "George.Gayno" Date: Fri, 25 Oct 2024 12:46:16 +0000 Subject: [PATCH 34/45] Add logic to build_all.sh script to default to Intel classic if Intel LLVM is not available. Fixes #879. --- build_all.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/build_all.sh b/build_all.sh index bf0a3a5fe..8b9a800e2 100755 --- a/build_all.sh +++ b/build_all.sh @@ -19,7 +19,8 @@ source "${DIR_ROOT}/sorc/machine-setup.sh" # User Options target=${target:-"NULL"} -compiler=${compiler:-"intelllvm"} +compiler=${compiler:-"intelllvm"} # If IntelLLVM is not available on the machine, will + # default to Intel classic. if [[ "$target" == "linux.*" || "$target" == "macosx.*" ]]; then unset -f module @@ -29,6 +30,14 @@ if [[ "$target" == "linux.*" || "$target" == "macosx.*" ]]; then else set +x module use "${DIR_ROOT}/modulefiles" + if [[ "$compiler" == "intelllvm" ]]; then + if [[ ! -f ${DIR_ROOT}/modulefiles/build.$target.$compiler ]];then + set +x + echo "IntelLLVM not available. Will use Intel Classic." + set -x + compiler=intel + fi + fi module load "build.$target.$compiler" > /dev/null module list set -x From addccd331d639d142722ab21aac671df8de2a157 Mon Sep 17 00:00:00 2001 From: George Gayno Date: Fri, 25 Oct 2024 08:06:37 -0500 Subject: [PATCH 35/45] Correct bug in build_all.sh. Fixex #879. --- build_all.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/build_all.sh b/build_all.sh index 8b9a800e2..7012cd152 100755 --- a/build_all.sh +++ b/build_all.sh @@ -31,10 +31,8 @@ else set +x module use "${DIR_ROOT}/modulefiles" if [[ "$compiler" == "intelllvm" ]]; then - if [[ ! -f ${DIR_ROOT}/modulefiles/build.$target.$compiler ]];then - set +x + if [[ ! -f ${DIR_ROOT}/modulefiles/build.$target.$compiler.lua ]];then echo "IntelLLVM not available. Will use Intel Classic." - set -x compiler=intel fi fi From 203b2de2fc2c277071339f3c90a575d214b82de1 Mon Sep 17 00:00:00 2001 From: George Gayno Date: Fri, 25 Oct 2024 08:14:28 -0500 Subject: [PATCH 36/45] Update grid driver scripts to use intelLLVM and Hercules, Orion and Hera. Fixes #879. --- driver_scripts/driver_grid.hera.sh | 2 +- driver_scripts/driver_grid.hercules.sh | 2 +- driver_scripts/driver_grid.orion.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/driver_scripts/driver_grid.hera.sh b/driver_scripts/driver_grid.hera.sh index 8c46694f9..e990ac948 100755 --- a/driver_scripts/driver_grid.hera.sh +++ b/driver_scripts/driver_grid.hera.sh @@ -64,7 +64,7 @@ set -x -compiler=${compiler:-"intel"} +compiler=${compiler:-"intelllvm"} source ../sorc/machine-setup.sh > /dev/null 2>&1 module use ../modulefiles module load build.$target.$compiler diff --git a/driver_scripts/driver_grid.hercules.sh b/driver_scripts/driver_grid.hercules.sh index c76366005..516bb50ea 100644 --- a/driver_scripts/driver_grid.hercules.sh +++ b/driver_scripts/driver_grid.hercules.sh @@ -64,7 +64,7 @@ set -x source ../sorc/machine-setup.sh > /dev/null 2>&1 module use ../modulefiles -module load build.$target.intel +module load build.$target.intelllvm module list #----------------------------------------------------------------------- diff --git a/driver_scripts/driver_grid.orion.sh b/driver_scripts/driver_grid.orion.sh index 656afcf33..36d07cc5f 100755 --- a/driver_scripts/driver_grid.orion.sh +++ b/driver_scripts/driver_grid.orion.sh @@ -64,7 +64,7 @@ set -x source ../sorc/machine-setup.sh > /dev/null 2>&1 module use ../modulefiles -module load build.$target.intel +module load build.$target.intelllvm module list #----------------------------------------------------------------------- From 2d44d8bfdecec9f84d0e99a71b798e79626ee09a Mon Sep 17 00:00:00 2001 From: George Gayno Date: Fri, 25 Oct 2024 08:19:36 -0500 Subject: [PATCH 37/45] Update the weight_gen utility driver scripts on Hercules, Hera and Orion to default to intelLLVM. Fixes #879. --- util/weight_gen/run.hera.sh | 2 +- util/weight_gen/run.hercules.sh | 2 +- util/weight_gen/run.orion.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/util/weight_gen/run.hera.sh b/util/weight_gen/run.hera.sh index d3b68f3dc..5e216ba80 100755 --- a/util/weight_gen/run.hera.sh +++ b/util/weight_gen/run.hera.sh @@ -34,7 +34,7 @@ set -x UFS_DIR=$PWD/../.. source $UFS_DIR/sorc/machine-setup.sh > /dev/null 2>&1 module use $UFS_DIR/modulefiles -module load build.$target.intel +module load build.$target.intelllvm module list export CRES="C48" diff --git a/util/weight_gen/run.hercules.sh b/util/weight_gen/run.hercules.sh index 59e7841c7..792ef43a6 100755 --- a/util/weight_gen/run.hercules.sh +++ b/util/weight_gen/run.hercules.sh @@ -34,7 +34,7 @@ set -x UFS_DIR=$PWD/../.. source $UFS_DIR/sorc/machine-setup.sh > /dev/null 2>&1 module use $UFS_DIR/modulefiles -module load build.$target.intel +module load build.$target.intelllvm module list export CRES="C48" diff --git a/util/weight_gen/run.orion.sh b/util/weight_gen/run.orion.sh index 67c35dee8..d4964a4c4 100755 --- a/util/weight_gen/run.orion.sh +++ b/util/weight_gen/run.orion.sh @@ -34,7 +34,7 @@ set -x UFS_DIR=$PWD/../.. source $UFS_DIR/sorc/machine-setup.sh > /dev/null 2>&1 module use $UFS_DIR/modulefiles -module load build.$target.intel +module load build.$target.intelllvm module list export CRES="C48" From 31c62bd209d9c8549248c1613cf9106cf667b83c Mon Sep 17 00:00:00 2001 From: George Gayno Date: Fri, 25 Oct 2024 08:24:17 -0500 Subject: [PATCH 38/45] Update the gdas_init utility driver scrip on Hera to use intelLLVM. Fixes #879. --- util/gdas_init/driver.hera.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/gdas_init/driver.hera.sh b/util/gdas_init/driver.hera.sh index 9f2387835..faa244d07 100755 --- a/util/gdas_init/driver.hera.sh +++ b/util/gdas_init/driver.hera.sh @@ -8,7 +8,7 @@ set -x -compiler=${compiler:-"intel"} +compiler=${compiler:-"intelllvm"} source ../../sorc/machine-setup.sh > /dev/null 2>&1 module use ../../modulefiles module load build.$target.$compiler From 3fa0aa5cf49d71568ce780eded2b377edd16d470 Mon Sep 17 00:00:00 2001 From: George Gayno Date: Fri, 25 Oct 2024 16:12:00 -0500 Subject: [PATCH 39/45] Update the hercules regression test scripts to load the intelLLVM module. Fixes #879. --- reg_tests/chgres_cube/driver.hercules.sh | 2 +- reg_tests/cpld_gridgen/rt.sh | 8 +++++++- reg_tests/global_cycle/driver.hercules.sh | 2 +- reg_tests/grid_gen/driver.hercules.sh | 2 +- reg_tests/ice_blend/driver.hercules.sh | 2 +- reg_tests/ocnice_prep/rt.sh | 15 +++++++++++---- reg_tests/snow2mdl/driver.hercules.sh | 2 +- reg_tests/weight_gen/driver.hercules.sh | 2 +- 8 files changed, 24 insertions(+), 11 deletions(-) diff --git a/reg_tests/chgres_cube/driver.hercules.sh b/reg_tests/chgres_cube/driver.hercules.sh index 2ef2800b3..32535d4c0 100755 --- a/reg_tests/chgres_cube/driver.hercules.sh +++ b/reg_tests/chgres_cube/driver.hercules.sh @@ -29,7 +29,7 @@ set -x source ../../sorc/machine-setup.sh > /dev/null 2>&1 module use ../../modulefiles -module load build.$target.intel +module load build.$target.intelllvm module list ulimit -s unlimited diff --git a/reg_tests/cpld_gridgen/rt.sh b/reg_tests/cpld_gridgen/rt.sh index fa7e997d2..59f64c69f 100755 --- a/reg_tests/cpld_gridgen/rt.sh +++ b/reg_tests/cpld_gridgen/rt.sh @@ -114,8 +114,14 @@ MEM_dflt="--mem=16g" export MEM=$MEM_dflt cd $PATHRT -export compiler=${compiler:-intel} +export compiler=${compiler:-intelllvm} source $PATHTR/sorc/machine-setup.sh >/dev/null 2>&1 +if [[ "$compiler" == "intelllvm" ]]; then + if [[ ! -f ${PATHTR}/modulefiles/build.$target.$compiler.lua ]];then + echo "IntelLLVM not available. Will use Intel Classic." + compiler=intel + fi +fi echo "Machine: $target" echo "Compiler: $compiler" diff --git a/reg_tests/global_cycle/driver.hercules.sh b/reg_tests/global_cycle/driver.hercules.sh index db1cf8431..f6d5abccd 100755 --- a/reg_tests/global_cycle/driver.hercules.sh +++ b/reg_tests/global_cycle/driver.hercules.sh @@ -22,7 +22,7 @@ set -x source ../../sorc/machine-setup.sh > /dev/null 2>&1 module use ../../modulefiles -module load build.$target.intel +module load build.$target.intelllvm module list ulimit -s unlimited diff --git a/reg_tests/grid_gen/driver.hercules.sh b/reg_tests/grid_gen/driver.hercules.sh index b5da4c807..54095354b 100755 --- a/reg_tests/grid_gen/driver.hercules.sh +++ b/reg_tests/grid_gen/driver.hercules.sh @@ -24,7 +24,7 @@ source ../../sorc/machine-setup.sh > /dev/null 2>&1 module use ../../modulefiles -module load build.$target.intel +module load build.$target.intelllvm module list set -x diff --git a/reg_tests/ice_blend/driver.hercules.sh b/reg_tests/ice_blend/driver.hercules.sh index f541ac367..46c3f35e6 100755 --- a/reg_tests/ice_blend/driver.hercules.sh +++ b/reg_tests/ice_blend/driver.hercules.sh @@ -31,7 +31,7 @@ set -x source ../../sorc/machine-setup.sh > /dev/null 2>&1 module use ../../modulefiles -module load build.$target.intel +module load build.$target.intelllvm module list ulimit -s unlimited diff --git a/reg_tests/ocnice_prep/rt.sh b/reg_tests/ocnice_prep/rt.sh index fe700195d..75ee4821e 100755 --- a/reg_tests/ocnice_prep/rt.sh +++ b/reg_tests/ocnice_prep/rt.sh @@ -112,11 +112,18 @@ export WLCLK=$WLCLK_dflt MEM_dflt="--mem=24g" export MEM=$MEM_dflt -cd $PATHRT -export compiler=${compiler:-intel} +set -x source $PATHTR/sorc/machine-setup.sh >/dev/null 2>&1 +export compiler=${compiler:-intelllvm} +if [[ "$compiler" == "intelllvm" ]]; then + if [[ ! -f ${PATHTR}/modulefiles/build.$target.$compiler.lua ]];then + echo "IntelLLVM not available. Will use Intel Classic." + compiler=intel + fi +fi echo "Machine: $target" echo "Compiler: $compiler" +cd $PATHRT COMPILE_LOG=compile.log REGRESSIONTEST_LOG=RegressionTests_$target.$compiler.log @@ -158,8 +165,8 @@ elif [[ $target = hercules ]]; then BASELINE_ROOT=/work/noaa/nems/role-nems/ufs_utils.hercules/reg_tests/ocnice_prep/baseline_data WEIGHTS_ROOT=/work/noaa/nems/role-nems/ufs_utils.hercules/reg_tests/cpld_gridgen/baseline_data INPUT_ROOT=/work/noaa/nems/role-nems/ufs_utils.hercules/reg_tests/ocnice_prep/input_data - ACCOUNT=${ACCOUNT:-nems} - QUEUE=${QUEUE:-batch} + ACCOUNT=${ACCOUNT:-fv3-cpu} + QUEUE=${QUEUE:-debug} NCCMP=nccmp PARTITION=hercules ulimit -s unlimited diff --git a/reg_tests/snow2mdl/driver.hercules.sh b/reg_tests/snow2mdl/driver.hercules.sh index ea64eecbf..03f5a301a 100755 --- a/reg_tests/snow2mdl/driver.hercules.sh +++ b/reg_tests/snow2mdl/driver.hercules.sh @@ -22,7 +22,7 @@ set -x source ../../sorc/machine-setup.sh > /dev/null 2>&1 module use ../../modulefiles -module load build.$target.intel +module load build.$target.intelllvm module list ulimit -s unlimited diff --git a/reg_tests/weight_gen/driver.hercules.sh b/reg_tests/weight_gen/driver.hercules.sh index 369796d61..afa5c0d84 100755 --- a/reg_tests/weight_gen/driver.hercules.sh +++ b/reg_tests/weight_gen/driver.hercules.sh @@ -29,7 +29,7 @@ set -x -compiler=${compiler:-"intel"} +compiler=${compiler:-"intelllvm"} source ../../sorc/machine-setup.sh > /dev/null 2>&1 module use ../../modulefiles From 12117853ac9e60fead04d66407c0ffbdf564f66c Mon Sep 17 00:00:00 2001 From: George Gayno Date: Mon, 28 Oct 2024 14:31:32 +0000 Subject: [PATCH 40/45] Update module load in the sfc_climo_gen utility. Fixes #879. --- util/sfc_climo_gen/sfc_gen.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/util/sfc_climo_gen/sfc_gen.sh b/util/sfc_climo_gen/sfc_gen.sh index 18c93d8ed..762fd11f4 100755 --- a/util/sfc_climo_gen/sfc_gen.sh +++ b/util/sfc_climo_gen/sfc_gen.sh @@ -117,7 +117,11 @@ ulimit -s unlimited source ${BASE_DIR}/sorc/machine-setup.sh > /dev/null 2>&1 module use ${BASE_DIR}/modulefiles -module load build.$target.intel +if [[ -f ${BASE_DIR}/modulefiles/build.$target.intelllvm.lua ]]; then + module load build.$target.intelllvm +else + module load build.$target.intel +fi module list rm -fr $WORK_DIR $SAVE_DIR From 2324720c51b659b988b8ce8f7a5f79cfc5f1d6ce Mon Sep 17 00:00:00 2001 From: George Gayno Date: Thu, 31 Oct 2024 18:58:40 +0000 Subject: [PATCH 41/45] Update the intelLLVM version 2024 on Hera. Fixes #879. --- modulefiles/build.hera.intelllvm.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modulefiles/build.hera.intelllvm.lua b/modulefiles/build.hera.intelllvm.lua index 4d7bf5fd0..64de60839 100644 --- a/modulefiles/build.hera.intelllvm.lua +++ b/modulefiles/build.hera.intelllvm.lua @@ -14,7 +14,7 @@ stack_impi_ver=os.getenv("stack_impi_ver") or "2021.5.1" load(pathJoin("stack-intel-oneapi-mpi", stack_impi_ver)) load("gnu") -load("intel/2023.2.0") +load("intel/2024.2.1") cmake_ver=os.getenv("cmake_ver") or "3.23.1" load(pathJoin("cmake", cmake_ver)) From adf1650a989733d6a921a40b576ee2ef779b100d Mon Sep 17 00:00:00 2001 From: George Gayno Date: Thu, 31 Oct 2024 19:28:54 +0000 Subject: [PATCH 42/45] Update regression test scripts to default to intelLLVM. Fixes #879. --- reg_tests/chgres_cube/driver.hera.sh | 2 +- reg_tests/global_cycle/driver.hera.sh | 2 +- reg_tests/grid_gen/driver.hera.sh | 2 +- reg_tests/ice_blend/driver.hera.sh | 2 +- reg_tests/snow2mdl/driver.hera.sh | 2 +- reg_tests/weight_gen/driver.hera.sh | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/reg_tests/chgres_cube/driver.hera.sh b/reg_tests/chgres_cube/driver.hera.sh index cd817ad43..5f7c4cb4e 100755 --- a/reg_tests/chgres_cube/driver.hera.sh +++ b/reg_tests/chgres_cube/driver.hera.sh @@ -29,7 +29,7 @@ set -x -compiler=${compiler:-"intel"} +compiler=${compiler:-"intelllvm"} source ../../sorc/machine-setup.sh > /dev/null 2>&1 module use ../../modulefiles diff --git a/reg_tests/global_cycle/driver.hera.sh b/reg_tests/global_cycle/driver.hera.sh index b0f4f938c..bb2d87fc8 100755 --- a/reg_tests/global_cycle/driver.hera.sh +++ b/reg_tests/global_cycle/driver.hera.sh @@ -20,7 +20,7 @@ set -x -compiler=${compiler:-"intel"} +compiler=${compiler:-"intelllvm"} source ../../sorc/machine-setup.sh > /dev/null 2>&1 module use ../../modulefiles diff --git a/reg_tests/grid_gen/driver.hera.sh b/reg_tests/grid_gen/driver.hera.sh index 00dbc1e79..5449316bf 100755 --- a/reg_tests/grid_gen/driver.hera.sh +++ b/reg_tests/grid_gen/driver.hera.sh @@ -21,7 +21,7 @@ # #----------------------------------------------------------------------------- -compiler=${compiler:-"intel"} +compiler=${compiler:-"intelllvm"} source ../../sorc/machine-setup.sh > /dev/null 2>&1 module use ../../modulefiles diff --git a/reg_tests/ice_blend/driver.hera.sh b/reg_tests/ice_blend/driver.hera.sh index ec31d773f..7a6fb4c86 100755 --- a/reg_tests/ice_blend/driver.hera.sh +++ b/reg_tests/ice_blend/driver.hera.sh @@ -29,7 +29,7 @@ set -x -compiler=${compiler:-"intel"} +compiler=${compiler:-"intelllvm"} source ../../sorc/machine-setup.sh > /dev/null 2>&1 module use ../../modulefiles diff --git a/reg_tests/snow2mdl/driver.hera.sh b/reg_tests/snow2mdl/driver.hera.sh index f2c07ba5a..e0996f47d 100755 --- a/reg_tests/snow2mdl/driver.hera.sh +++ b/reg_tests/snow2mdl/driver.hera.sh @@ -20,7 +20,7 @@ set -x -compiler=${compiler:-"intel"} +compiler=${compiler:-"intelllvm"} source ../../sorc/machine-setup.sh > /dev/null 2>&1 module use ../../modulefiles diff --git a/reg_tests/weight_gen/driver.hera.sh b/reg_tests/weight_gen/driver.hera.sh index ae8131f38..d88011cc7 100755 --- a/reg_tests/weight_gen/driver.hera.sh +++ b/reg_tests/weight_gen/driver.hera.sh @@ -29,7 +29,7 @@ set -x -compiler=${compiler:-"intel"} +compiler=${compiler:-"intelllvm"} source ../../sorc/machine-setup.sh > /dev/null 2>&1 module use ../../modulefiles From f1532e5f85c5567edb9d5c8175a72e8b353a2383 Mon Sep 17 00:00:00 2001 From: George Gayno Date: Thu, 31 Oct 2024 19:56:25 +0000 Subject: [PATCH 43/45] Modify the "-check all" compiler option for intelLLVM as on Hera it caused a compilation error when choosing 'debug' mode. Fixes #879. --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4e3d764c6..503a5953f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,6 +71,11 @@ if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|IntelLLVM)$") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g -traceback") set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -fp-model precise") set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -check all -ftrapuv") +# On some machines (Hera), using -check all results in an error +# at the linking step. The uninit check is the culprit. + if(CMAKE_Fortran_COMPILER_ID MATCHES "^(IntelLLVM)$") + set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -check nouninit") + endif() if(APPLE) # The linker on macOS does not include `common symbols` by default. # Passing the -c flag includes them and fixes an error with undefined symbols. From 7efdbedd90b960e13781c1840ab88aea82d57b63 Mon Sep 17 00:00:00 2001 From: George Gayno Date: Thu, 31 Oct 2024 15:19:16 -0500 Subject: [PATCH 44/45] Update Orion regresson test driver scripts to default to intel LLVM. Fixes #879. --- reg_tests/chgres_cube/driver.orion.sh | 2 +- reg_tests/global_cycle/driver.orion.sh | 2 +- reg_tests/grid_gen/driver.orion.sh | 2 +- reg_tests/ice_blend/driver.orion.sh | 2 +- reg_tests/snow2mdl/driver.orion.sh | 2 +- reg_tests/weight_gen/driver.orion.sh | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/reg_tests/chgres_cube/driver.orion.sh b/reg_tests/chgres_cube/driver.orion.sh index ae1ebf8ce..d948537f6 100755 --- a/reg_tests/chgres_cube/driver.orion.sh +++ b/reg_tests/chgres_cube/driver.orion.sh @@ -27,7 +27,7 @@ set -x source ../../sorc/machine-setup.sh > /dev/null 2>&1 module use ../../modulefiles -module load build.$target.intel +module load build.$target.intelllvm module list ulimit -s unlimited diff --git a/reg_tests/global_cycle/driver.orion.sh b/reg_tests/global_cycle/driver.orion.sh index 472608dcf..f5cf0361d 100755 --- a/reg_tests/global_cycle/driver.orion.sh +++ b/reg_tests/global_cycle/driver.orion.sh @@ -22,7 +22,7 @@ set -x source ../../sorc/machine-setup.sh > /dev/null 2>&1 module use ../../modulefiles -module load build.$target.intel +module load build.$target.intelllvm module list export WORK_DIR="${WORK_DIR:-/work/noaa/stmp/$LOGNAME}" diff --git a/reg_tests/grid_gen/driver.orion.sh b/reg_tests/grid_gen/driver.orion.sh index e41f1c40d..2a529d806 100755 --- a/reg_tests/grid_gen/driver.orion.sh +++ b/reg_tests/grid_gen/driver.orion.sh @@ -23,7 +23,7 @@ source ../../sorc/machine-setup.sh > /dev/null 2>&1 module use ../../modulefiles -module load build.$target.intel +module load build.$target.intelllvm module list set -x diff --git a/reg_tests/ice_blend/driver.orion.sh b/reg_tests/ice_blend/driver.orion.sh index d5704b5ab..8ab6a7fe7 100755 --- a/reg_tests/ice_blend/driver.orion.sh +++ b/reg_tests/ice_blend/driver.orion.sh @@ -31,7 +31,7 @@ set -x source ../../sorc/machine-setup.sh > /dev/null 2>&1 module use ../../modulefiles -module load build.$target.intel +module load build.$target.intelllvm module load grib-util/1.3.0 module load wgrib2/2.0.8 module list diff --git a/reg_tests/snow2mdl/driver.orion.sh b/reg_tests/snow2mdl/driver.orion.sh index 8d4b40f7a..2797c16b8 100755 --- a/reg_tests/snow2mdl/driver.orion.sh +++ b/reg_tests/snow2mdl/driver.orion.sh @@ -22,7 +22,7 @@ set -x source ../../sorc/machine-setup.sh > /dev/null 2>&1 module use ../../modulefiles -module load build.$target.intel +module load build.$target.intelllvm module load grib-util/1.3.0 module load wgrib2/2.0.8 module list diff --git a/reg_tests/weight_gen/driver.orion.sh b/reg_tests/weight_gen/driver.orion.sh index 43b6f0b92..a660e2e64 100755 --- a/reg_tests/weight_gen/driver.orion.sh +++ b/reg_tests/weight_gen/driver.orion.sh @@ -29,7 +29,7 @@ set -x -compiler=${compiler:-"intel"} +compiler=${compiler:-"intelllvm"} source ../../sorc/machine-setup.sh > /dev/null 2>&1 module use ../../modulefiles From 332c65a3cd701566a740cc6e61bd1b333e3e0eca Mon Sep 17 00:00:00 2001 From: George Gayno Date: Mon, 18 Nov 2024 08:31:12 -0600 Subject: [PATCH 45/45] Request additional wall clock time for the cpld_gridgen test. Fixes #879. --- reg_tests/cpld_gridgen/rt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reg_tests/cpld_gridgen/rt.sh b/reg_tests/cpld_gridgen/rt.sh index 5903ed03d..3844ae757 100755 --- a/reg_tests/cpld_gridgen/rt.sh +++ b/reg_tests/cpld_gridgen/rt.sh @@ -108,7 +108,7 @@ TESTS_FILE="$PATHRT/rt.conf" export TEST_NAME= # for C3072 on hera, use WLCLK=60 and MEM="--exclusive" -WLCLK_dflt=35 +WLCLK_dflt=50 export WLCLK=$WLCLK_dflt MEM_dflt="--mem=16g" export MEM=$MEM_dflt