19 #ifndef __localMassBalance_hh
20 #define __localMassBalance_hh
22 #include "pism/util/array/Scalar.hh"
23 #include "pism/util/ConfigInterface.hh"
73 std::string
method()
const;
81 const std::vector<double> &
S,
82 const std::vector<double> &T,
83 std::vector<double> &PDDs) = 0;
87 std::vector<double> &precip_rate) = 0;
111 double ice_thickness,
112 double old_firn_depth,
113 double old_snow_depth,
114 double accumulation) = 0;
138 virtual void get_PDDs(
double dt_series,
139 const std::vector<double> &
S,
140 const std::vector<double> &T,
141 std::vector<double> &PDDs);
144 std::vector<double> &precip_rate);
146 Changes
step(
const DegreeDayFactors &ddf,
148 double ice_thickness,
151 double accumulation);
191 virtual void get_PDDs(
double dt_series,
192 const std::vector<double> &
S,
193 const std::vector<double> &T,
194 std::vector<double> &PDDs);
std::shared_ptr< const Config > ConstPtr
double m_pdd_fausto_latitude_beta_w
virtual ~FaustoGrevePDDObject()=default
LocalMassBalance::DegreeDayFactors degree_day_factors(int i, int j, double latitude)
const Config::ConstPtr m_config
std::shared_ptr< const Grid > m_grid
FaustoGrevePDDObject(std::shared_ptr< const Grid > g)
double m_fresh_water_density
double m_refreeze_fraction
void update_temp_mj(const array::Scalar &surfelev, const array::Scalar &lat, const array::Scalar &lon)
Updates mean July near-surface air temperature.
const units::System::Ptr m_unit_system
virtual ~LocalMassBalance()=default
virtual void get_PDDs(double dt_series, const std::vector< double > &S, const std::vector< double > &T, std::vector< double > &PDDs)=0
Count positive degree days (PDDs). Returned value in units of K day.
std::string method() const
virtual Changes step(const DegreeDayFactors &ddf, double PDDs, double ice_thickness, double old_firn_depth, double old_snow_depth, double accumulation)=0
const double m_seconds_per_day
const Config::ConstPtr m_config
virtual void get_snow_accumulation(const std::vector< double > &T, std::vector< double > &precip_rate)=0
LocalMassBalance(Config::ConstPtr config, units::System::Ptr system)
virtual unsigned int get_timeseries_length(double dt)=0
Base class for a model which computes surface mass flux rate (ice thickness per time) from precipitat...
void get_snow_accumulation(const std::vector< double > &T, std::vector< double > &precip_rate)
Extract snow accumulation from mixed (snow and rain) precipitation using the temperature time-series.
bool refreeze_ice_melt
refreeze melted ice
bool precip_as_snow
interpret all the precipitation as snow (no rain)
virtual void get_PDDs(double dt_series, const std::vector< double > &S, const std::vector< double > &T, std::vector< double > &PDDs)
Compute the expected number of positive degree days from the input temperature time-series.
double Tmax
the temperature above which all precipitation is rain
Changes step(const DegreeDayFactors &ddf, double PDDs, double ice_thickness, double firn_depth, double snow_depth, double accumulation)
Compute the surface mass balance at a location from the number of positive degree days and the accumu...
double pdd_threshold_temp
threshold temperature for the PDD computation
double Tmin
the temperature below which all precipitation is snow
PDDMassBalance(Config::ConstPtr config, units::System::Ptr system)
virtual unsigned int get_timeseries_length(double dt)
Compute the number of points for temperature and precipitation time-series.
virtual ~PDDMassBalance()
A PDD implementation which computes the local mass balance based on an expectation integral.
virtual ~PDDrandMassBalance()
virtual unsigned int get_timeseries_length(double dt)
PDDrandMassBalance(Config::ConstPtr config, units::System::Ptr system, Kind kind)
virtual void get_PDDs(double dt_series, const std::vector< double > &S, const std::vector< double > &T, std::vector< double > &PDDs)
An alternative PDD implementation which simulates a random process to get the number of PDDs.
std::shared_ptr< System > Ptr
double ice
m day^-1 K^-1; ice-equivalent amount of ice melted, per PDD
double refreeze_fraction
fraction of melted snow which refreezes as ice
double snow
m day^-1 K^-1; ice-equivalent amount of snow melted, per PDD
A struct which holds degree day factors.
static double S(unsigned n)