本文整理汇总了C++中Weather::screen_height方法的典型用法代码示例。如果您正苦于以下问题:C++ Weather::screen_height方法的具体用法?C++ Weather::screen_height怎么用?C++ Weather::screen_height使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Weather
的用法示例。
在下文中一共展示了Weather::screen_height方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
PetPM::tick (const Time&, const Weather& weather, const double Rn,
const Vegetation& crops,
const Surface& surface, const Geometry& geo,
const Soil& soil,
const SoilHeat& soil_heat, const SoilWater& soil_water,
Treelog& msg)
{
// Weather.
const double Temp = weather.air_temperature ();
const double VaporPressure = weather.vapor_pressure ();
const double U2 = weather.wind ();
const double AtmPressure = weather.air_pressure ();
const double Cloudiness = weather.cloudiness ();
// Ground heat flux.
const double G = soil_heat.top_flux (geo, soil, soil_water);
const double LAI = crops.LAI ();
if (LAI > 0.0)
{
const double CropHeight = 0.01 * crops.height (); //cm -> m
const double ScreenHeight = weather.screen_height ();
// Dry.
reference_evapotranspiration_dry
= FAO::PenmanMonteith (CropHeight, ScreenHeight,
LAI, crops.rs_min (),
Rn, G, Temp, VaporPressure,
U2, AtmPressure) * 3600;
potential_evapotranspiration_dry
= std::max (0.0, reference_evapotranspiration_dry);
// Wet.
reference_evapotranspiration_wet
= FAO::PenmanMonteith (CropHeight, ScreenHeight,
LAI, 0.0, Rn, G, Temp, VaporPressure,
U2, AtmPressure) * 3600;
potential_evapotranspiration_wet
= std::max (0.0, reference_evapotranspiration_wet);
}
else
{
const double Si = weather.global_radiation ();
// Use reference crop as fallback for bare soil.
const double ref_albedo = 0.23;
net_radiation->tick (Cloudiness, Temp, VaporPressure, Si, ref_albedo,
msg);
const double ref_Rn = net_radiation->net_radiation ();
reference_evapotranspiration_dry
= FAO::RefPenmanMonteith (ref_Rn, G, Temp, VaporPressure, U2,
AtmPressure)
* 3600;
potential_evapotranspiration_dry
= reference_to_potential_dry (crops, surface,
reference_evapotranspiration_dry);
reference_evapotranspiration_wet
= FAO::RefPenmanMonteithWet (ref_Rn, G, Temp, VaporPressure, U2,
AtmPressure, rb)
* 3600;
potential_evapotranspiration_wet
= reference_to_potential_wet (crops, surface,
reference_evapotranspiration_wet);
}
}