From 0d813831038d12a34570525593236c2e284c3ec7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Einar=20=C3=96rn=20=C3=93lason?= Date: Fri, 6 Dec 2024 10:31:21 +0100 Subject: [PATCH] Address Tim's comments on github See PR #754. Minor renaming and a different way of producing an NaN. --- core/src/include/ModelComponent.hpp | 6 +++--- core/src/modules/include/IDynamics.hpp | 6 +++--- core/src/modules/include/ProtectedArrayNames.ipp | 4 ++-- dynamics/src/include/BrittleCGDynamicsKernel.hpp | 2 +- dynamics/src/include/FreeDriftDynamicsKernel.hpp | 2 +- dynamics/src/include/VPCGDynamicsKernel.hpp | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/core/src/include/ModelComponent.hpp b/core/src/include/ModelComponent.hpp index 6616a23e9..26f8ae0a0 100644 --- a/core/src/include/ModelComponent.hpp +++ b/core/src/include/ModelComponent.hpp @@ -1,7 +1,7 @@ /*! * @file ModelComponent.hpp * - * @date 1 Jul 2024 + * @date 06 Dec 2024 * @author Tim Spain * @author Einar Ólason */ @@ -64,8 +64,8 @@ namespace Protected { inline constexpr TextTag WIND_V = "WIND_V"; // y(north)-ward component of wind, m s⁻¹ inline constexpr TextTag ICE_U = "ICE_U"; // x(east)-ward ice velocity, m s⁻¹ inline constexpr TextTag ICE_V = "ICE_V"; // y(north)-ward ice velocity, m s⁻¹ - inline constexpr TextTag IO_STRESS_U = "IO_STRESS_U"; // x(east)-ward ice-ocean stress, Pa - inline constexpr TextTag IO_STRESS_V = "IO_STRESS_V"; // y(north)-ward ice-ocean stress, Pa + inline constexpr TextTag IO_STRESS_X = "IO_STRESS_X"; // x(east)-ward ice-ocean stress, Pa + inline constexpr TextTag IO_STRESS_Y = "IO_STRESS_Y"; // y(north)-ward ice-ocean stress, Pa // Slab ocean fields inline constexpr TextTag SLAB_SST = "SLAB_SST"; // Slab ocean sea surface temperature, ˚C inline constexpr TextTag SLAB_SSS = "SLAB_SSS"; // Slab ocean sea surface salinity, ˚C diff --git a/core/src/modules/include/IDynamics.hpp b/core/src/modules/include/IDynamics.hpp index 33c7e17aa..82c8614f4 100644 --- a/core/src/modules/include/IDynamics.hpp +++ b/core/src/modules/include/IDynamics.hpp @@ -1,7 +1,7 @@ /*! * @file IDynamics.hpp * - * @date 7 Sep 2023 + * @date 06 Dec 2024 * @author Tim Spain */ @@ -36,8 +36,8 @@ class IDynamics : public ModelComponent { , m_usesDamage(usesDamageIn) { getStore().registerArray(Shared::DAMAGE, &damage, RW); - getStore().registerArray(Protected::IO_STRESS_U, &taux, RO); - getStore().registerArray(Protected::IO_STRESS_V, &tauy, RO); + getStore().registerArray(Protected::IO_STRESS_X, &taux, RO); + getStore().registerArray(Protected::IO_STRESS_Y, &tauy, RO); } virtual ~IDynamics() = default; diff --git a/core/src/modules/include/ProtectedArrayNames.ipp b/core/src/modules/include/ProtectedArrayNames.ipp index 8dacc6750..7781eb7ad 100644 --- a/core/src/modules/include/ProtectedArrayNames.ipp +++ b/core/src/modules/include/ProtectedArrayNames.ipp @@ -40,5 +40,5 @@ { "sss_slab", "SLAB_SSS" }, // Slab ocean surface salinity PSU { "qdw", "SLAB_QDW" }, // Slab ocean temperature nudging heat flux, W m⁻² { "fdw", "SLAB_FDW" }, // Slab ocean salinity nudging water flux, kg s⁻¹ m⁻² - { "taux", "IO_STRESS_U" }, // Ice-ocean stress x(east) direction, Pa - { "tauy", "IO_STRESS_V" }, // Ice-ocean stress x(east) direction, Pa + { "taux", "IO_STRESS_X" }, // Ice-ocean stress x(east) direction, Pa + { "tauy", "IO_STRESS_Y" }, // Ice-ocean stress y(north) direction, Pa diff --git a/dynamics/src/include/BrittleCGDynamicsKernel.hpp b/dynamics/src/include/BrittleCGDynamicsKernel.hpp index bedd45270..ffe9cd353 100644 --- a/dynamics/src/include/BrittleCGDynamicsKernel.hpp +++ b/dynamics/src/include/BrittleCGDynamicsKernel.hpp @@ -176,7 +176,7 @@ template class BrittleCGDynamicsKernel : public CGDynamicsKern else if (name == vIOStressName) return cPrime * (vOceanRel * cosOceanAngle + uOceanRel * sinOceanAngle); else - return std::nan(""); + return std::numeric_limits::quiet_NaN(); } protected: diff --git a/dynamics/src/include/FreeDriftDynamicsKernel.hpp b/dynamics/src/include/FreeDriftDynamicsKernel.hpp index 973f21395..ccacacc08 100644 --- a/dynamics/src/include/FreeDriftDynamicsKernel.hpp +++ b/dynamics/src/include/FreeDriftDynamicsKernel.hpp @@ -83,7 +83,7 @@ template class FreeDriftDynamicsKernel : public CGDynamicsKern else if (name == vIOStressName) return cPrime * (vOceanRel * cosOceanAngle + uOceanRel * sinOceanAngle); else - return std::nan(""); + return std::numeric_limits::quiet_NaN(); } }; } /* namespace Nextsim */ diff --git a/dynamics/src/include/VPCGDynamicsKernel.hpp b/dynamics/src/include/VPCGDynamicsKernel.hpp index b7c51d8bc..8bb7149a4 100644 --- a/dynamics/src/include/VPCGDynamicsKernel.hpp +++ b/dynamics/src/include/VPCGDynamicsKernel.hpp @@ -102,7 +102,7 @@ template class VPCGDynamicsKernel : public CGDynamicsKernel::quiet_NaN(); } protected: