diff --git a/spack_repo/packages/dwd-icon-tools/package.py b/spack_repo/packages/dwd-icon-tools/package.py index 7070cd9f1db1ea3708a34aeef01b7458bb6d3d08..f2f8d06ad3828bec07c204744a4a90a4e9a0409a 100644 --- a/spack_repo/packages/dwd-icon-tools/package.py +++ b/spack_repo/packages/dwd-icon-tools/package.py @@ -23,7 +23,7 @@ from spack.package import * import os from urllib.parse import urlparse - +from packaging import version class DwdIconTools(Package): """DWD Icon Tools""" @@ -45,7 +45,10 @@ class DwdIconTools(Package): depends_on("netcdf-c") depends_on("netcdf-fortran") - depends_on("eccodes+tools") + if version.parse(spack.spack_version) < version.parse("23.0.1"): + depends_on("eccodes+fortran") + else: + depends_on("eccodes+fortran+tools") depends_on("libxml2") # diff --git a/spack_repo/packages/icon-nwp/package.py b/spack_repo/packages/icon-nwp/package.py index 3f3785ee9d6b1644168ad0ea0b221939c225bb08..cf6e8c7a6218d843d0408701a5d24bf49710ed21 100644 --- a/spack_repo/packages/icon-nwp/package.py +++ b/spack_repo/packages/icon-nwp/package.py @@ -8,7 +8,7 @@ import os from urllib.parse import urlparse from spack.package import * - +from packaging import version class IconNwp(Package): """ @@ -57,7 +57,10 @@ class IconNwp(Package): depends_on("mpi") depends_on("netcdf-c") depends_on("netcdf-fortran") - depends_on("eccodes+fortran+tools") + if version.parse(spack.spack_version) < version.parse("23.0.1"): + depends_on("eccodes+fortran") + else: + depends_on("eccodes+fortran+tools") depends_on("libxml2") # If you using inwp_psp=2 (with non-divergent 3D flow), petsc is necessary @@ -137,11 +140,11 @@ class IconNwp(Package): libs.append(f"-L{spec['petsc'].prefix.lib} -lpetsc") if self.spec.satisfies("%gcc"): - FCFLAGS = "-std=legacy -fmodule-private -fimplicit-none -fmax-identifier-length=63 -Wall " \ + FCFLAGS = "-std=gnu -fmodule-private -fimplicit-none -fmax-identifier-length=63 -Wall " \ "-Wcharacter-truncation -Wconversion -Wunderflow -Wunused-parameter " \ "-Wno-surprising -fall-intrinsics -g -mpc64 -w" ARCH_FLAG = f"-mtune={mtune}" - ICON_FCFLAGS = "-std=f2008 -fallow-argument-mismatch -fmodule-private -fimplicit-none -Wall" + ICON_FCFLAGS = "-fallow-argument-mismatch -fmodule-private -fimplicit-none -Wall" elif self.spec.satisfies("%intel"): FCFLAGS = "-stand none -implicitnone -warn all -warn unused -fall-intrinsics -g -w" ARCH_FLAG = f"-xHost" diff --git a/templates/real-from-d2-ana/build_env.sh b/templates/real-from-d2-ana/build_env.sh index 97e731e16ae339a4e2f23605ad817b6299b10540..cffbf36eb3725dc589c69b3160a84c4ab40f1175 100644 --- a/templates/real-from-d2-ana/build_env.sh +++ b/templates/real-from-d2-ana/build_env.sh @@ -18,6 +18,8 @@ cd ${WORKDIR} || exit . ${WORKDIR}/proj/platforms/common/spack_utils.sh load_spack "%spack.init%" "%spack.root%" "%spack.url%" "%spack.branch%" "%spack.externals%" "%spack.compiler%" "%spack.disable_local_config%" "%spack.user_cache_path%" "%spack.user_config_path%" "%spack.upstreams%" +SPACK_BUILD_ICON="%ICON.BUILD_CMD%" +SPACK_LOAD_ICON="%ICON.LOAD_CMD%" if [ ! -z "$SPACK_BUILD_ICON" ]; then echo "cmd=$SPACK_BUILD_ICON"