From 5b2bfa39a5b1fbe6bb1d247102679885685c9336 Mon Sep 17 00:00:00 2001 From: DavidBurrows-NCO <82525974+DavidBurrows-NCO@users.noreply.github.com> Date: Fri, 15 Nov 2024 13:40:16 -0500 Subject: [PATCH 1/2] Update to build on both Gaea-C5 and C6 (#995) The Gaea-C5 OS upgrade changed the version numbers for stack-intel and stack-cray-mpich. Point to these versions. Specify either Gaea-C5 or Gaea-C6 when linking the fixed directories. Include separate builds for Gaea-C5 and Gaea-C6. Fixes #994. --- fix/link_fixdirs.sh | 12 ++-- modulefiles/build.container.intel.lua | 55 +++++++++++++++++++ ....gaea.intel.lua => build.gaeac5.intel.lua} | 4 +- ...aeaC6.intel.lua => build.gaeac6.intel.lua} | 28 +++++----- sorc/machine-setup.sh | 14 ++++- 5 files changed, 90 insertions(+), 23 deletions(-) create mode 100644 modulefiles/build.container.intel.lua rename modulefiles/{build.gaea.intel.lua => build.gaeac5.intel.lua} (96%) rename modulefiles/{build.gaeaC6.intel.lua => build.gaeac6.intel.lua} (67%) diff --git a/fix/link_fixdirs.sh b/fix/link_fixdirs.sh index 97136e4db..d3c539fc4 100755 --- a/fix/link_fixdirs.sh +++ b/fix/link_fixdirs.sh @@ -9,7 +9,7 @@ set -ex # 'nco' (copies data). # # $machine - is the machine. Choices are: -# 'wcoss2', 'hera', 'jet', 'orion', 'hercules', 's4', 'gaea' +# 'wcoss2', 'hera', 'jet', 'orion', 'hercules', 's4', 'gaeac5', 'gaeac6' RUN_ENVIR=${1} machine=${2} @@ -17,7 +17,7 @@ machine=${2} if [ $# -lt 2 ]; then set +x echo '***ERROR*** must specify two arguements: (1) RUN_ENVIR, (2) machine' - echo ' Syntax: link_fv3gfs.sh ( nco | emc ) ( wcoss2 | hera | jet | orion | hercules | s4 | gaea )' + echo ' Syntax: link_fv3gfs.sh ( nco | emc ) ( wcoss2 | hera | jet | orion | hercules | s4 | gaeac5 | gaeac6 )' exit 1 fi @@ -28,10 +28,10 @@ if [ $RUN_ENVIR != emc -a $RUN_ENVIR != nco ]; then exit 1 fi -if [ $machine != wcoss2 -a $machine != hera -a $machine != jet -a $machine != orion -a $machine != s4 -a $machine != hercules -a $machine != gaea ]; then +if [ $machine != wcoss2 -a $machine != hera -a $machine != jet -a $machine != orion -a $machine != s4 -a $machine != hercules -a $machine != gaeac5 -a $machine != gaeac6 ]; then set +x echo '***ERROR*** unsupported machine' - echo 'Syntax: link_fv3gfs.sh ( nco | emc ) ( wcoss2 | hera | jet | orion | hercules | s4 | gaea )' + echo 'Syntax: link_fv3gfs.sh ( nco | emc ) ( wcoss2 | hera | jet | orion | hercules | s4 | gaeac5 | gaeac6 )' exit 1 fi @@ -54,8 +54,10 @@ elif [ $machine = "wcoss2" ]; then FIX_DIR="/lfs/h2/emc/global/noscrub/emc.global/FIX/fix" elif [ $machine = "s4" ]; then FIX_DIR="/data/prod/glopara/fix" -elif [ $machine = "gaea" ]; then +elif [ $machine = "gaeac5" ]; then FIX_DIR="/gpfs/f5/ufs-ard/world-shared/global/glopara/data/fix" +elif [ $machine = "gaeac6" ]; then + FIX_DIR="/gpfs/f6/bil-fire8/world-shared/global/glopara/data/fix" fi am_ver=${am_ver:-20220805} diff --git a/modulefiles/build.container.intel.lua b/modulefiles/build.container.intel.lua new file mode 100644 index 000000000..5d4beb308 --- /dev/null +++ b/modulefiles/build.container.intel.lua @@ -0,0 +1,55 @@ +help([[ +Load environment to compile UFS_UTILS in a container using Intel +]]) + +prepend_path("MODULEPATH", "/opt/spack-stack/spack-stack-1.8.0/envs/unified-env/install/modulefiles/Core") + +stack_intel_ver=os.getenv("stack_intel_ver") or "2021.10.0" +load(pathJoin("stack-intel", stack_intel_ver)) + +stack_impi_ver=os.getenv("stack_impi_ver") or "2021.12.1" +load(pathJoin("stack-intel-oneapi-mpi", stack_impi_ver)) + +cmake_ver=os.getenv("cmake_ver") or "3.27.9" +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.5.1" +load(pathJoin("g2", g2_ver)) + +ip_ver=os.getenv("ip_ver") or "5.0.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)) + +sigio_ver=os.getenv("sigio_ver") or "2.3.2" +load(pathJoin("sigio", sigio_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.1" +load(pathJoin("esmf", esmf_ver)) + +nco_ver=os.getenv("nco_ver") or "5.1.6" +load(pathJoin("nco", nco_ver)) + +whatis("Description: UFS_UTILS build environment") diff --git a/modulefiles/build.gaea.intel.lua b/modulefiles/build.gaeac5.intel.lua similarity index 96% rename from modulefiles/build.gaea.intel.lua rename to modulefiles/build.gaeac5.intel.lua index 2898c3a29..e9dd614b3 100644 --- a/modulefiles/build.gaea.intel.lua +++ b/modulefiles/build.gaeac5.intel.lua @@ -7,10 +7,10 @@ load("hsi") prepend_path("MODULEPATH", "/ncrc/proj/epic/spack-stack/spack-stack-1.6.0/envs/unified-env/install/modulefiles/Core") -stack_intel_ver=os.getenv("stack_intel_ver") or "2023.1.0" +stack_intel_ver=os.getenv("stack_intel_ver") or "2023.2.0" load(pathJoin("stack-intel", stack_intel_ver)) -stack_cray_mpich_ver=os.getenv("stack_cray_mpich_ver") or "8.1.25" +stack_cray_mpich_ver=os.getenv("stack_cray_mpich_ver") or "8.1.28" load(pathJoin("stack-cray-mpich", stack_cray_mpich_ver)) cmake_ver=os.getenv("cmake_ver") or "3.23.1" diff --git a/modulefiles/build.gaeaC6.intel.lua b/modulefiles/build.gaeac6.intel.lua similarity index 67% rename from modulefiles/build.gaeaC6.intel.lua rename to modulefiles/build.gaeac6.intel.lua index de35f3959..e1f1cbfec 100644 --- a/modulefiles/build.gaeaC6.intel.lua +++ b/modulefiles/build.gaeac6.intel.lua @@ -1,17 +1,17 @@ help([[ -Load environment to compile UFS_UTILS on GAEA C6 using Intel +Load environment to compile UFS_UTILS on Gaea C6 using Intel ]]) -prepend_path("MODULEPATH", "/autofs/ncrc-svm1_proj/epic/spack-stack/spack-stack-1.6.0/envs/unified-env-c6/install/modulefiles/Core") +prepend_path("MODULEPATH", "/sw/rdtn/modulefiles") +load("hsi") + +prepend_path("MODULEPATH", "/ncrc/proj/epic/spack-stack/c6/spack-stack-1.6.0/envs/unified-env/install/modulefiles/Core") stack_intel_ver=os.getenv("stack_intel_ver") or "2023.2.0" load(pathJoin("stack-intel", stack_intel_ver)) -stack_mpich_ver=os.getenv("stack_mpich_ver") or "8.1.29" -load(pathJoin("stack-cray-mpich", stack_mpich_ver)) - -craype_ver=os.getenv("craype_ver") or "2.7.30" -load(pathJoin("craype", craype_ver)) +stack_cray_mpich_ver=os.getenv("stack_cray_mpich_ver") or "8.1.29" +load(pathJoin("stack-cray-mpich", stack_cray_mpich_ver)) cmake_ver=os.getenv("cmake_ver") or "3.23.1" load(pathJoin("cmake", cmake_ver)) @@ -34,17 +34,18 @@ 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)) -sfcio_ver=os.getenv("sfcio_ver") or "1.4.1" -load(pathJoin("sfcio", sfcio_ver)) - zlib_ver=os.getenv("zlib_ver") or "1.2.13" load(pathJoin("zlib", zlib_ver)) -libpng_ver=os.getenv("libpng_ver") or "1.6.37" -load(pathJoin("libpng", libpng_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)) @@ -55,10 +56,11 @@ 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.5.0" +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/sorc/machine-setup.sh b/sorc/machine-setup.sh index 944c5e48c..2ee8e1565 100644 --- a/sorc/machine-setup.sh +++ b/sorc/machine-setup.sh @@ -30,6 +30,14 @@ if [[ -d /lfs5 ]] ; then elif [[ -d /lfs/h1 ]] ; then target=wcoss2 module reset +elif [[ -d /opt/spack-stack ]] ; then + # We are using a container + if ( ! eval module help > /dev/null 2>&1 ) ; then + echo load the module command 1>&2 + source /apps/lmod/lmod/init/$__ms_shell + fi + target=container + module purge elif [[ -d /scratch1 ]] ; then # We are on NOAA Hera if ( ! eval module help > /dev/null 2>&1 ) ; then @@ -39,7 +47,7 @@ elif [[ -d /scratch1 ]] ; then target=hera module purge elif [[ "$(hostname)" == "gaea5"* && -d /gpfs/f5 ]] ; then - # We are on GAEA. + # We are on GAEAC5. if ( ! eval module help > /dev/null 2>&1 ) ; then # We cannot simply load the module command. The GAEA # /etc/profile modifies a number of module-related variables @@ -49,9 +57,9 @@ elif [[ "$(hostname)" == "gaea5"* && -d /gpfs/f5 ]] ; then source /etc/profile fi module reset - target=gaea + target=gaeac5 elif [[ "$(hostname)" == "gaea6"* && -d /gpfs/f6 ]] ; then - target=gaeaC6 + target=gaeac6 source /opt/cray/pe/lmod/8.7.31/init/$__ms_shell elif [[ "$(hostname)" =~ "Orion" || "$(hostname)" =~ "orion" ]]; then target="orion" From 122010e95cb74701fea676c35ab407c416237bb0 Mon Sep 17 00:00:00 2001 From: GeorgeGayno-NOAA <52789452+GeorgeGayno-NOAA@users.noreply.github.com> Date: Mon, 18 Nov 2024 09:51:03 -0500 Subject: [PATCH 2/2] Port to Intel LLVM on Hera, Orion and Hercules (#996) Also update the Github workflows to Intel LLVM. Retain option to use Intel Classic on those machines. Fixes #879. --- .github/workflows/macos_clang.yaml | 2 +- .github/workflows/ubuntu_gcc.yaml | 2 +- .github/workflows/ubuntu_intel.yaml | 18 ++--- CMakeLists.txt | 17 ++++- build_all.sh | 9 ++- ci/spack.yaml | 5 +- driver_scripts/driver_grid.hera.sh | 2 +- driver_scripts/driver_grid.hercules.sh | 2 +- driver_scripts/driver_grid.orion.sh | 2 +- modulefiles/build.hera.intelllvm.lua | 74 +++++++++++++++++++ modulefiles/build.hercules.intel.lua | 2 +- modulefiles/build.hercules.intelllvm.lua | 68 +++++++++++++++++ modulefiles/build.orion.intel.lua | 2 +- modulefiles/build.orion.intelllvm.lua | 68 +++++++++++++++++ reg_tests/chgres_cube/driver.hera.sh | 2 +- reg_tests/chgres_cube/driver.hercules.sh | 2 +- reg_tests/chgres_cube/driver.orion.sh | 2 +- reg_tests/cpld_gridgen/rt.sh | 10 ++- reg_tests/global_cycle/driver.hera.sh | 2 +- reg_tests/global_cycle/driver.hercules.sh | 2 +- reg_tests/global_cycle/driver.orion.sh | 2 +- reg_tests/grid_gen/driver.hera.sh | 2 +- reg_tests/grid_gen/driver.hercules.sh | 2 +- reg_tests/grid_gen/driver.orion.sh | 2 +- reg_tests/ice_blend/driver.hera.sh | 2 +- reg_tests/ice_blend/driver.hercules.sh | 2 +- reg_tests/ice_blend/driver.orion.sh | 2 +- reg_tests/ocnice_prep/rt.sh | 15 +++- reg_tests/snow2mdl/driver.hera.sh | 2 +- reg_tests/snow2mdl/driver.hercules.sh | 2 +- reg_tests/snow2mdl/driver.orion.sh | 2 +- reg_tests/weight_gen/driver.hera.sh | 2 +- reg_tests/weight_gen/driver.hercules.sh | 2 +- reg_tests/weight_gen/driver.orion.sh | 2 +- sorc/chgres_cube.fd/CMakeLists.txt | 2 +- sorc/cpld_gridgen.fd/CMakeLists.txt | 2 +- sorc/emcsfc_snow2mdl.fd/CMakeLists.txt | 2 +- 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 +- .../tools/make_hgrid/make_hgrid.c | 8 +- sorc/fvcom_tools.fd/CMakeLists.txt | 2 +- sorc/gblevents.fd/CMakeLists.txt | 2 +- sorc/global_cycle.fd/CMakeLists.txt | 2 +- .../filter_topo.fd/CMakeLists.txt | 2 +- sorc/lsm_routines.fd/noah.fd/CMakeLists.txt | 2 +- sorc/ocean_merge.fd/CMakeLists.txt | 2 +- sorc/ocnice_prep.fd/CMakeLists.txt | 2 +- .../inland.fd/CMakeLists.txt | 2 +- .../orog_mask_tools.fd/lake.fd/CMakeLists.txt | 2 +- .../orog_mask_tools.fd/orog.fd/CMakeLists.txt | 2 +- .../orog_gsl.fd/CMakeLists.txt | 2 +- .../mask.fd/CMakeLists.txt | 2 +- .../ramp.fd/CMakeLists.txt | 2 +- .../topo.fd/CMakeLists.txt | 2 +- sorc/sfc_climo_gen.fd/CMakeLists.txt | 2 +- sorc/vcoord_gen.fd/CMakeLists.txt | 2 +- sorc/weight_gen.fd/CMakeLists.txt | 2 +- tests/chgres_cube/CMakeLists.txt | 2 +- tests/chgres_cube/ftst_read_atm_grib2.F90 | 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 -- .../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/orog/CMakeLists.txt | 2 +- tests/sfc_climo_gen/CMakeLists.txt | 2 +- util/gdas_init/driver.hera.sh | 2 +- util/sfc_climo_gen/sfc_gen.sh | 6 +- util/weight_gen/run.hera.sh | 2 +- util/weight_gen/run.hercules.sh | 2 +- util/weight_gen/run.orion.sh | 2 +- 75 files changed, 343 insertions(+), 104 deletions(-) create mode 100644 modulefiles/build.hera.intelllvm.lua create mode 100644 modulefiles/build.hercules.intelllvm.lua create mode 100644 modulefiles/build.orion.intelllvm.lua diff --git a/.github/workflows/macos_clang.yaml b/.github/workflows/macos_clang.yaml index 25f6bc693..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/\[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 b501ef5ef..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/\[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 7c882c313..b90e31234 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 @@ -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, 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=mpiicx + export FC=mpiifx cd ufs_utils mkdir -p build && cd build cmake -DCMAKE_INSTALL_PREFIX=../install .. diff --git a/CMakeLists.txt b/CMakeLists.txt index 5408e7c3b..503a5953f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,7 @@ 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" 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" ON) @@ -67,10 +67,15 @@ 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") +# 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. @@ -86,10 +91,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. diff --git a/build_all.sh b/build_all.sh index eb57c7b2d..7012cd152 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:-"intel"} +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,12 @@ 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.lua ]];then + echo "IntelLLVM not available. Will use Intel Classic." + compiler=intel + fi + fi module load "build.$target.$compiler" > /dev/null module list set -x diff --git a/ci/spack.yaml b/ci/spack.yaml index f0db7c2ac..ee8a4ee1b 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, gcc@10:10, apple-clang@14] specs: - netcdf-c@4.9.2 - netcdf-fortran@4.6.1 @@ -12,8 +12,7 @@ spack: - nemsio@2.5.4 - 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 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 #----------------------------------------------------------------------- diff --git a/modulefiles/build.hera.intelllvm.lua b/modulefiles/build.hera.intelllvm.lua new file mode 100644 index 000000000..64de60839 --- /dev/null +++ b/modulefiles/build.hera.intelllvm.lua @@ -0,0 +1,74 @@ +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)) + +load("gnu") +load("intel/2024.2.1") + +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)) + +setenv("I_MPI_CC", "icx") +setenv("I_MPI_FC", "ifx") + +setenv("CC", "mpicc") +setenv("FC", "mpifc") + +whatis("Description: UFS_UTILS build environment") diff --git a/modulefiles/build.hercules.intel.lua b/modulefiles/build.hercules.intel.lua index 0cdb92e13..23314b7bd 100644 --- a/modulefiles/build.hercules.intel.lua +++ b/modulefiles/build.hercules.intel.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 Intel Classic ]]) prepend_path("MODULEPATH", "/work/noaa/epic/role-epic/spack-stack/hercules/spack-stack-1.6.0/envs/unified-env/install/modulefiles/Core") diff --git a/modulefiles/build.hercules.intelllvm.lua b/modulefiles/build.hercules.intelllvm.lua new file mode 100644 index 000000000..5253076b2 --- /dev/null +++ b/modulefiles/build.hercules.intelllvm.lua @@ -0,0 +1,68 @@ +help([[ +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") + +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)) + +setenv("I_MPI_CC", "icx") +setenv("I_MPI_F90", "ifx") + +setenv("CC", "mpiicc") +setenv("FC", "mpiifort") + +whatis("Description: UFS_UTILS build environment") diff --git a/modulefiles/build.orion.intel.lua b/modulefiles/build.orion.intel.lua index d0f93d9a4..1d51da87a 100644 --- a/modulefiles/build.orion.intel.lua +++ b/modulefiles/build.orion.intel.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 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") diff --git a/modulefiles/build.orion.intelllvm.lua b/modulefiles/build.orion.intelllvm.lua new file mode 100644 index 000000000..9b2464b11 --- /dev/null +++ b/modulefiles/build.orion.intelllvm.lua @@ -0,0 +1,68 @@ +help([[ +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") + +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)) + +setenv("I_MPI_CC", "icx") +setenv("I_MPI_F90", "ifx") + +setenv("CC", "mpiicc") +setenv("FC", "mpiifort") + +whatis("Description: UFS_UTILS build environment") diff --git a/reg_tests/chgres_cube/driver.hera.sh b/reg_tests/chgres_cube/driver.hera.sh index 86bf372b4..df9a7c065 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/chgres_cube/driver.hercules.sh b/reg_tests/chgres_cube/driver.hercules.sh index 05e80bfc5..458ed0a39 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/chgres_cube/driver.orion.sh b/reg_tests/chgres_cube/driver.orion.sh index 2c57df30b..7211af659 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/cpld_gridgen/rt.sh b/reg_tests/cpld_gridgen/rt.sh index 9beea531b..3844ae757 100755 --- a/reg_tests/cpld_gridgen/rt.sh +++ b/reg_tests/cpld_gridgen/rt.sh @@ -108,14 +108,20 @@ 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 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.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/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/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.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/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/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.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/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/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/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.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/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/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.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 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 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 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") 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") 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; 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") 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/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/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") 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") 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") 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 955101450..7d197c593 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 io_utils.F90 orog_utils.F90) set(exe_src mtnlm7_oclsm.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 -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") 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") 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") 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") 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/chgres_cube/ftst_read_atm_grib2.F90 b/tests/chgres_cube/ftst_read_atm_grib2.F90 index 7d19ffeb9..d89ffd9db 100644 --- a/tests/chgres_cube/ftst_read_atm_grib2.F90 +++ b/tests/chgres_cube/ftst_read_atm_grib2.F90 @@ -241,7 +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) - 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 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/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") 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") 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 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 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"