Skip to content

Commit

Permalink
Removed all invalid utf-8 characters and fixed docs
Browse files Browse the repository at this point in the history
  • Loading branch information
philippkraft committed Feb 9, 2020
1 parent 10436a0 commit 4484976
Show file tree
Hide file tree
Showing 11 changed files with 8,713 additions and 6,631 deletions.
12,729 changes: 7,398 additions & 5,331 deletions cmf/cmf_core_src/docstrings.i

Large diffs are not rendered by default.

496 changes: 248 additions & 248 deletions cmf/cmf_core_src/math/integrators/bdf2.cpp

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion cmf/cmf_core_src/math/root_finding.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#include "root_finding.h"
#include <cmath>
#include <stdexcept>
Expand Down
2 changes: 1 addition & 1 deletion cmf/cmf_core_src/upslope/vegetation/ET.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ namespace cmf {
// G = SingleMeteorology->daily ? 0 // If calculation takes place on daily basis, the soil heat flux is 0 (FAO 1998,Eq. 42)
// : Rn>0 ? 0.1*Rn : 0.5 * Rn, // On a shorter basis, it is proportional to Rn, different for day and night (FAO 1998,Eq. 45f)
P=cmf::atmosphere::Pressure(h), // Mean Pressure in kPa
gamma=c_p*P/(epsilon*lambda), // psychrometric constant [kPa �C-1]
gamma=c_p*P/(epsilon*lambda), // psychrometric constant [kPa degC-1]
rho_a=P/(1.01*(A.T+273)*R), // mean air density at constant pressure
d=0.666667*h, // zero plane displacement height
z_om=0.123*h, // roughness length governing momentum transfer
Expand Down
38 changes: 19 additions & 19 deletions cmf/cmf_core_src/upslope/vegetation/ET.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ namespace cmf {
namespace ET {


/// Returns the potential ET after Penman-Monteith using some simplifications for a given Radiation balance,
/// Returns the potential ET after Penman-Monteith using some simplifications for a given Radiation balance,
/// aerodynamic and surface resistances, and a vapor pressure deficit
///
/// \f[ ET = \frac{\Delta R_n}{\lambda \Delta + \gamma + \gamma \frac{r_s}{r_a}}
/// \f[ ET = \frac{\Delta R_n}{\lambda \Delta + \gamma + \gamma \frac{r_s}{r_a}}
/// + \frac{c_p\rho_a}{\Delta + \gamma + \gamma \frac{r_s}{r_a}} \frac{e_s - e_a}{r_a} \f]
/// where
/// - \f$ ET \f$ is the evapotranspiration in \f$\frac{kg}{m^2 day}\approx \frac{mm}{day}\f$
Expand All @@ -66,24 +66,24 @@ namespace cmf {
/// - \f$ r_a \left[\frac s m\right] \f$ is the aerodynamic resistance
/// - \f$ \gamma = 0.067 \left[\frac{kPa}{k}\right] \f$ is the psychrometer constant
/// - \f$ e_s - e_a \left[kPa\right]\f$ is the vapor pressure deficit
///
///
/// @param Rn Radiation balance in \f$ \frac{MJ}{m^2 day} \f$
/// @param ra Aerodynamic resistance in \f$ \frac s m \f$
/// @param rs Surface resistance in \f$ \frac s m \f$, is 0 for free water
/// @param T Actual Temperature in \f$ ^\circ C \f$
/// @param vap_press_deficit Deficit of vapor pressure \f$ kPa \f$
real PenmanMonteith(real Rn,real ra,real rs,real T,real vap_press_deficit);
/// Returns the potential ET after Penman-Monteith using some simplifications for a weather and a vegetation object.


/// Returns the potential ET after Penman-Monteith using some simplifications for a weather and a vegetation object.
/// aerodynamic and surface resistances, and a vapor pressure deficit
///
/// @param A Current weather
/// @param veg Vegetation data
/// @param h Height above sea level in m (for air pressure estimation)
real PenmanMonteith(cmf::atmosphere::Weather A,const cmf::upslope::vegetation::Vegetation & veg,double h);


/// @ingroup ET
/// @brief An abstract base class for ET Methods with a WaterStressFunction
class stressedET : public cmf::water::flux_connection {
Expand All @@ -103,21 +103,21 @@ namespace cmf {
}

};

/// @ingroup ET
/// @brief A constant evapotranspiration
///
/// Uses a constant measured or elsewhere modelled ETpot. Actual Evapotranspiration is calculated
/// from rootdepth and actual matrix potential in the layers using Tact. The value of ETpot can be
/// from rootdepth and actual matrix potential in the layers using Tact. The value of ETpot can be
/// changed during runtime
class constantETpot : public stressedET {
protected:
virtual real calc_q(cmf::math::Time t);
public:
real ETpot_value;
real GetETpot(cmf::math::Time t) const {return ETpot_value;}
constantETpot(cmf::upslope::SoilLayer::ptr source,cmf::water::flux_node::ptr ET_target,double constantETpot_value)
: stressedET(source,ET_target,"Constant get_evaporation"),ETpot_value(constantETpot_value)
constantETpot(cmf::upslope::SoilLayer::ptr source,cmf::water::flux_node::ptr ET_target,double constantETpot_value)
: stressedET(source,ET_target,"Constant get_evaporation"),ETpot_value(constantETpot_value)
{
}
virtual real ETpot(cmf::math::Time t) const {
Expand All @@ -128,7 +128,7 @@ namespace cmf {
/// @brief A timeseries driven evapotranspiration
///
/// Uses a timeseries of measured or elsewhere modelled ETpot. Actual Evapotranspiration is calculated
/// from rootdepth and actual matrix potential in the layers using Tact. The value of ETpot can be
/// from rootdepth and actual matrix potential in the layers using Tact. The value of ETpot can be
/// changed during runtime
class timeseriesETpot: public stressedET {
protected:
Expand All @@ -146,7 +146,7 @@ namespace cmf {
/// Calculates the potential evapotranspiration according to FAO(1998)
///
/// Governing equations:
/// \f{eqnarray*}
/// \f[
/// \lambda ET &=& \frac{\Delta\left(R_n - G\right)+\rho_a c_p \frac{e_s - e_a}{r_a}}{\Delta + \gamma\left(1+\frac{r_s}{r_a}\right)} \mbox{ FAO 1998, Eq. 3} \\
/// \mbox{With:} \\
/// \Delta &=& 4098 \frac{0.6108 e^{17.27 T}}{(T+237.3)^2} \frac{kPa}{^\circ C} \mbox{ (FAO 1998, Eq. 13)} \\
Expand All @@ -170,15 +170,15 @@ namespace cmf {
/// u_2 &=& \mbox{ Windspeed in 2m above canopy } \frac m s \\
/// r_s &=& \frac{r_l}{LAI_{Active}} \mbox{ (FAO 1998, Eq. 5/Box 5)} \frac s m \\
/// && r_l=100 \frac s m, LAI_{Active}=0.5 LAI
/// \f}
/// \f]
class PenmanMonteithET : public stressedET {

protected:
real calc_q(cmf::math::Time t);
public:

bool daily;
PenmanMonteithET(cmf::upslope::SoilLayer::ptr source,cmf::water::flux_node::ptr ET_target)
PenmanMonteithET(cmf::upslope::SoilLayer::ptr source,cmf::water::flux_node::ptr ET_target)
: stressedET(source,ET_target,"Penman Monteith transpiration") {
}
static real r_s(const cmf::upslope::vegetation::Vegetation & veg) ;
Expand Down Expand Up @@ -228,7 +228,7 @@ namespace cmf {
/// - \f$ \gamma = 0.4039 \sin(DOY\frac{2 \pi}{365} - 1.405) \f$ solar declination (radians)
/// - \f$ \Phi\f$ geographic latitude (radians)
///
/// @see SAMANI, Zohrab. [Estimating solar radiation and evapotranspiration using minimum climatological data.][1]
/// @see SAMANI, Zohrab. [Estimating solar radiation and evapotranspiration using minimum climatological data.][1]
/// _Journal of Irrigation and Drainage Engineering,_ 2000, 126. Jg., Nr. 4, S. 265-267.
///
/// Crop specific potential evapotranspiration is scaled by LAI: \f$ ET_{pot} = ET_{rc} \frac{LAI}{2.88}\f$.
Expand All @@ -253,7 +253,7 @@ namespace cmf {
/// This ETpot formula is a generalization of two older approaches by introducing
/// parameters to shape the dependency of ETpot from temperature and extraterrestrial radiation
///
/// \f$ \lambda ET_{pot} = R_{a} \cdot \frac{T_{a} + K_2}{K_1}
/// \f$ \lambda ET_{pot} = R_{a} \cdot \frac{T_{a} + K_2}{K_1}\f$
///
/// Oudin et al (2005) found an optimum for \f$K_1=100, K_2=5\f$.
/// The origin of this formula lays in Jensen & Haise (1963) with \f$K_1=40, K_2=0\f$
Expand Down Expand Up @@ -293,7 +293,7 @@ namespace cmf {
protected:
real calc_q(cmf::math::Time t);
public:
TurcET(cmf::upslope::SoilLayer::ptr source,cmf::water::flux_node::ptr ET_target)
TurcET(cmf::upslope::SoilLayer::ptr source,cmf::water::flux_node::ptr ET_target)
: stressedET(source,ET_target,"TurcET") {
}
/// @brief Connects all soil layers with the transpiration node of the cell
Expand Down
Loading

0 comments on commit 4484976

Please sign in to comment.