Skip to content

Commit

Permalink
Address Tim's comments on github
Browse files Browse the repository at this point in the history
See PR #754. Minor renaming and a different way of producing an NaN.
  • Loading branch information
einola committed Dec 6, 2024
1 parent 8f65526 commit 0d81383
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions core/src/include/ModelComponent.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* @file ModelComponent.hpp
*
* @date 1 Jul 2024
* @date 06 Dec 2024
* @author Tim Spain <timothy.spain@nersc.no>
* @author Einar Ólason <einar.olason@nersc.no>
*/
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions core/src/modules/include/IDynamics.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* @file IDynamics.hpp
*
* @date 7 Sep 2023
* @date 06 Dec 2024
* @author Tim Spain <timothy.spain@nersc.no>
*/

Expand Down Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions core/src/modules/include/ProtectedArrayNames.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion dynamics/src/include/BrittleCGDynamicsKernel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ template <int DGadvection> class BrittleCGDynamicsKernel : public CGDynamicsKern
else if (name == vIOStressName)
return cPrime * (vOceanRel * cosOceanAngle + uOceanRel * sinOceanAngle);
else
return std::nan("");
return std::numeric_limits<double>::quiet_NaN();
}

protected:
Expand Down
2 changes: 1 addition & 1 deletion dynamics/src/include/FreeDriftDynamicsKernel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ template <int DGadvection> class FreeDriftDynamicsKernel : public CGDynamicsKern
else if (name == vIOStressName)
return cPrime * (vOceanRel * cosOceanAngle + uOceanRel * sinOceanAngle);
else
return std::nan("");
return std::numeric_limits<double>::quiet_NaN();
}
};
} /* namespace Nextsim */
Expand Down
2 changes: 1 addition & 1 deletion dynamics/src/include/VPCGDynamicsKernel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ template <int DGadvection> class VPCGDynamicsKernel : public CGDynamicsKernel<DG
else if (name == vIOStressName)
return FOcean * absocn * vOcnRel;
else
return std::nan("");
return std::numeric_limits<double>::quiet_NaN();
}

protected:
Expand Down

0 comments on commit 0d81383

Please sign in to comment.