19 #include "pism/stressbalance/sia/SIAFD_diagnostics.hh"
20 #include "pism/stressbalance/sia/BedSmoother.hh"
21 #include "pism/util/Vars.hh"
22 #include "pism/util/array/CellType.hh"
25 namespace stressbalance {
44 .long_name(
"multiplier 'theta' in Schoof's (2003) theory of bed roughness in SIA")
46 m_vars[0][
"valid_range"] = { 0.0, 1.0 };
51 auto result = allocate<array::Scalar>(
"schoofs_theta");
53 model->bed_smoother().theta(*surface, *result);
62 .long_name(
"smoothed bed elevation in Schoof's (2003) theory of bed roughness in SIA")
67 auto result = allocate<array::Scalar>(
"topgsmooth");
69 result->copy_from(
model->bed_smoother().smoothed_bed());
80 "thickness relative to smoothed bed elevation in Schoof's (2003) theory of bed roughness in SIA")
86 const auto &surface = *
m_grid->variables().get_2d_scalar(
"surface_altitude");
87 const auto &thickness = *
m_grid->variables().get_2d_scalar(
"land_ice_thickness");
91 const auto &mask = *
m_grid->variables().get_2d_cell_type(
"mask");
95 auto result = allocate<array::Scalar>(
"thksmooth");
97 model->bed_smoother().smoothed_thk(surface, thickness, cell_type,
108 m_vars[0].long_name(
"diffusivity of SIA mass continuity equation").units(
"m2 s-1");
112 auto result = allocate<array::Scalar>(
"diffusivity");
116 const auto &mask = *
m_grid->variables().get_2d_cell_type(
"mask");
119 bool include_floating_ice =
true;
130 .long_name(
"diffusivity of SIA mass continuity equation on the staggered grid (i-offset)")
133 .long_name(
"diffusivity of SIA mass continuity equation on the staggered grid (j-offset)")
138 auto grid = output.
grid();
142 for (
auto p = grid->points(); p; p.next()) {
143 const int i = p.i(), j = p.j();
145 output(i, j, 0) = input(i, j, 0);
146 output(i, j, 1) = input(i, j, 1);
151 auto result = allocate<array::Staggered>(
"diffusivity");
162 m_vars[0].long_name(
"the x-component of the surface gradient, i-offset").units(
"1");
163 m_vars[1].long_name(
"the x-component of the surface gradient, j-offset").units(
"1");
167 auto result = allocate<array::Staggered>(
"h_x");
178 m_vars[0].long_name(
"the y-component of the surface gradient, i-offset").units(
"1");
179 m_vars[1].long_name(
"the y-component of the surface gradient, j-offset").units(
"1");
184 auto result = allocate<array::Staggered>(
"h_y");
A template derived from Diagnostic, adding a "Model".
const units::System::Ptr m_sys
the unit system
std::vector< SpatialVariableMetadata > m_vars
metadata corresponding to NetCDF variables
std::shared_ptr< Diagnostic > Ptr
std::shared_ptr< const Grid > m_grid
the grid
Makes sure that we call begin_access() and end_access() for all accessed array::Arrays.
void copy_from(const Array2D< T > &source)
std::shared_ptr< const Grid > grid() const
A class for storing and accessing internal staggered-grid 2D fields. Uses dof=2 storage....
virtual std::shared_ptr< array::Array > compute_impl() const
SIAFD_diffusivity_staggered(const SIAFD *m)
Compute diffusivity of the SIA flow (on the staggered grid).
virtual std::shared_ptr< array::Array > compute_impl() const
SIAFD_diffusivity(const SIAFD *m)
Compute diffusivity of the SIA flow.
virtual std::shared_ptr< array::Array > compute_impl() const
SIAFD_h_x(const SIAFD *m)
Reports the x-component of the ice surface gradient on the staggered grid as computed by SIAFD.
SIAFD_h_y(const SIAFD *m)
virtual std::shared_ptr< array::Array > compute_impl() const
Reports the y-component of the ice surface gradient on the staggered grid as computed by SIAFD.
virtual std::shared_ptr< array::Array > compute_impl() const
SIAFD_schoofs_theta(const SIAFD *m)
Computes the multiplier in Schoof's (2003) theory of the effect of bed roughness on the diffusivity ...
virtual std::shared_ptr< array::Array > compute_impl() const
SIAFD_thksmooth(const SIAFD *m)
Computes the thickness relative to the smoothed bed elevation in Schoof's (2003) theory of the effect...
virtual std::shared_ptr< array::Array > compute_impl() const
SIAFD_topgsmooth(const SIAFD *m)
Computes the smoothed bed elevation from Schoof's (2003) theory of the effect of bed roughness on the...
virtual DiagnosticList diagnostics_impl() const
void staggered_to_regular(const array::CellType1 &cell_type, const array::Staggered1 &input, bool include_floating_ice, array::Scalar &result)
static void copy_staggered_vec(const array::Staggered &input, array::Staggered &output)
std::map< std::string, Diagnostic::Ptr > DiagnosticList