Commit 534a81c4 authored by Ethan Coon's avatar Ethan Coon
Browse files

missing add files

parent e868f05f
#ifndef CANOPY_HYDROLOGY_FRACH20SFC_IMPL_HH_
#define CANOPY_HYDROLOGY_FRACH20SFC_IMPL_HH_
#include <algorithm>
#include <stdio.h>
#include <cmath>
#include <iostream>
#include <string>
#include "landunit_varcon.h"
using namespace std;
using std::min ;
using std::max ;
namespace ELM {
NATURE void CanopyHydrology_FracH2OSfc(const double& dtime,
const double& min_h2osfc,
const int& ltype,
const double& micro_sigma,
const double& h2osno,
double& h2osfc,
double& h2osoi_liq,
double& frac_sno,
double& frac_sno_eff,
double& qflx_h2osfc2topsoi,
double& frac_h2osfc)
{
bool no_update = false;
double shr_const_pi=4.0e0*atan(1.0e0) ;
bool no_update_l ;
double d,fd,dfdd,sigma ;
if (!no_update) {
no_update_l = false; }
else { no_update_l = no_update; }
qflx_h2osfc2topsoi = 0.0 ;
if ( ltype == istsoil || ltype == istcrop) {
if (h2osfc > min_h2osfc) {
d=0.0 ;
sigma=1.0e3 * micro_sigma ;
for(int l = 0 ; l < 10; l++) {
fd = 0.5*d*(1.00+erf(d/(sigma*sqrt(2.0)))) + sigma/sqrt(2.0*shr_const_pi)*exp(-pow(d,2)/(2.0*pow(sigma,2))) -h2osfc;
dfdd = 0.5*(1.00+erf(d/(sigma*sqrt(2.0))));
d = d - fd/dfdd;
}
frac_h2osfc = 0.5*(1.00+erf(d/(sigma*sqrt(2.0)))) ; }
else {
frac_h2osfc = 0.0 ;
h2osoi_liq = h2osoi_liq + h2osfc ;
qflx_h2osfc2topsoi = h2osfc/dtime ;
h2osfc=0.0 ;
}
if (!no_update_l) {
if (frac_sno > (1.0 - frac_h2osfc) && h2osno > 0) {
if (frac_h2osfc > 0.010) {
frac_h2osfc = max(1.00 - frac_sno,0.010) ;
frac_sno = 1.00 - frac_h2osfc; }
else {
frac_sno = 1.00 - frac_h2osfc;
}
frac_sno_eff=frac_sno;
}
}
}
else {
frac_h2osfc = 0.0;
}
}
}
#endif
#ifndef ELM_CANOPY_HYDROLOGY_DECL_HH_
#define ELM_CANOPY_HYDROLOGY_DECL_HH_
#ifndef NATURE
#define NATURE
#endif
namespace ELM {
NATURE void CanopyHydrology_Interception(double dtime,
const double& forc_rain,
const double& forc_snow,
const double& irrig_rate,
const int& ltype, const int& ctype,
const bool& urbpoi, const bool& do_capsnow,
const double& elai, const double& esai,
const double& dewmx, const int& frac_veg_nosno,
double& h2ocan,
int n_irrig_steps_left, // need to be fixed
double& qflx_prec_intr,
double& qflx_irrig,
double& qflx_prec_grnd,
double& qflx_snwcp_liq,
double& qflx_snwcp_ice,
double& qflx_snow_grnd_patch,
double& qflx_rain_grnd) ;
NATURE void CanopyHydrology_FracWet(const int& frac_veg_nosno,
const double& h2ocan,
const double& elai,
const double& esai,
const double& dewmx,
double& fwet,
double& fdry) ;
template<typename Array_d>
NATURE void CanopyHydrology_SnowWater(const double& dtime,
const double& qflx_floodg,
const int& ltype,
const int& ctype,
const bool& urbpoi,
const bool& do_capsnow,
const int& oldfflag,
const double& forc_air_temp,
const double& t_grnd,
const double& qflx_snow_grnd_col,
const double& qflx_snow_melt,
const double& n_melt,
const double& frac_h2osfc,
double& snow_depth,
double& h2osno,
double& integrated_snow,
Array_d swe_old,
Array_d h2osoi_liq,
Array_d h2osoi_ice,
Array_d t_soisno,
Array_d frac_iceold,
int& snow_level,
Array_d dz,
Array_d z,
Array_d zi,
int& newnode,
double& qflx_floodc,
double& qflx_snow_h2osfc,
double& frac_sno_eff,
double& frac_sno) ;
NATURE void CanopyHydrology_FracH2OSfc(const double& dtime,
const double& min_h2osfc,
const int& ltype,
const double& micro_sigma,
const double& h2osno,
double& h2osfc,
double& h2osoi_liq,
double& frac_sno,
double& frac_sno_eff,
double& qflx_h2osfc2topsoi,
double& frac_h2osfc) ;
} // namespace
#endif
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment