当前位置: 首页>>代码示例>>C++>>正文


C++ Weather::air_pressure方法代码示例

本文整理汇总了C++中Weather::air_pressure方法的典型用法代码示例。如果您正苦于以下问题:C++ Weather::air_pressure方法的具体用法?C++ Weather::air_pressure怎么用?C++ Weather::air_pressure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Weather的用法示例。


在下文中一共展示了Weather::air_pressure方法的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);
    }
}
开发者ID:pamoakoy,项目名称:daisy-model,代码行数:70,代码来源:pet_PM.C


注:本文中的Weather::air_pressure方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。