-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "#34: Move R_e calculation to meteostation and make R_e part o…
…f Weather" This reverts commit abb6924
- Loading branch information
philippkraft
committed
Mar 22, 2019
1 parent
abb6924
commit 967297e
Showing
5 changed files
with
137 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,140 +1,132 @@ | ||
// Copyright 2010 by Philipp Kraft | ||
// This file is part of cmf. | ||
// | ||
// cmf is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// cmf is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with cmf. If not, see <http://www.gnu.org/licenses/>. | ||
// | ||
// Get Documentation | ||
|
||
%feature("compactdefaultargs"); | ||
%include "docstrings.i" | ||
%feature("autodoc","1"); | ||
|
||
// Usage for automated downcast | ||
%include "factory.i" | ||
|
||
// Include typemaps for STL | ||
%include "std_string.i" | ||
%include "std_vector.i" | ||
|
||
namespace std { | ||
%template(vector_int) vector<int>; | ||
%template(vector_double) vector<double>; | ||
%template(vector_size_t) vector<size_t>; | ||
}; | ||
|
||
// enable exception support | ||
%include "exception.i" | ||
%exception { | ||
try { | ||
$action | ||
} catch (const std::out_of_range& e) { | ||
SWIG_exception(SWIG_IndexError, e.what()); | ||
} catch (const std::exception& e) { | ||
SWIG_exception(SWIG_RuntimeError, e.what()); | ||
} | ||
|
||
} | ||
%include "attribute.i" | ||
|
||
/* #define SWIG_SHARED_PTR_SUBNAMESPACE */ | ||
%include <std_shared_ptr.i> | ||
%{ | ||
#include "cmfmemory.h" | ||
%} | ||
%include "cmf_swiglib.i" | ||
|
||
%{ | ||
std::string pyrepr(PyObject* o) { | ||
PyObject* s = PyObject_Repr(o); | ||
#if PY_MAJOR_VERSION < 3 | ||
std::string res = PyString_AsString(s); | ||
#else | ||
std::string res = PyUnicode_AsUTF8(s); | ||
#endif | ||
Py_XDECREF(s); | ||
return res; | ||
} | ||
%} | ||
|
||
// Start my Module | ||
%module cmf_core | ||
%include "math/num_array.i" | ||
%include "geometry/geometry.i" | ||
%include "math/time.i" | ||
%include "math/ODEsystem.i" | ||
|
||
%include "water/water.i" | ||
%include "atmosphere/meteorology.i" | ||
%include "upslope/cell.i" | ||
%include "upslope/Layer.i" | ||
%include "reach/Reach.i" | ||
|
||
/////////////////////////// | ||
// Surfacewater | ||
////////////////////////// | ||
|
||
%shared_ptr(cmf::upslope::SurfaceWater); | ||
%attribute(cmf::upslope::SurfaceWater,real,puddledepth,get_puddledepth,set_puddledepth); | ||
%attribute(cmf::upslope::SurfaceWater,real,nManning,get_nManning,set_nManning); | ||
|
||
%include "upslope/surfacewater.h" | ||
%extend__repr__(cmf::upslope::SurfaceWater) | ||
|
||
///////////////////////////// | ||
%{ | ||
#include "upslope/groundwater.h" | ||
#include "upslope/connections/subsurfacefluxes.h" | ||
#include "upslope/connections/surfacefluxes.h" | ||
#include "upslope/connections/AtmosphericFluxes.h" | ||
#include "upslope/connections/infiltration.h" | ||
#include "upslope/connections/Percolation.h" | ||
#include "upslope/vegetation/ET.h" | ||
#include "upslope/vegetation/ShuttleworthWallace.h" | ||
// Include river model | ||
#include "reach/ManningConnection.h" | ||
%} | ||
|
||
%shared_ptr(cmf::upslope::aquifer); | ||
%attribute(cmf::upslope::aquifer,double,base_height,get_base_height); | ||
%attribute(cmf::upslope::aquifer,double,top_height,get_top_height); | ||
%include "upslope/groundwater.h" | ||
%extend__repr__(cmf::upslope::aquifer) | ||
|
||
%include "upslope/connections/subsurfacefluxes.h" | ||
%include "reach/ManningConnection.h" | ||
|
||
%include "upslope/connections/surfacefluxes.h" | ||
%include "upslope/connections/AtmosphericFluxes.h" | ||
%include "upslope/connections/infiltration.h" | ||
%include "upslope/connections/Percolation.h" | ||
%include "upslope/vegetation/waterstress.h" | ||
|
||
%include "upslope/vegetation/ET.h" | ||
|
||
%shared_ptr(cmf::upslope::ET::ShuttleworthWallace); | ||
%include "upslope/vegetation/ShuttleworthWallace.h" | ||
|
||
%include "project.i" | ||
|
||
%include "math/integrator.i" | ||
|
||
|
||
%pythoncode { | ||
ConstantFlux = TechnicalFlux | ||
ConstantStateFlux = statecontrol_connection | ||
WaterBalanceFlux = waterbalance_connection | ||
ConceptualInfiltration = SimpleInfiltration | ||
} | ||
|
||
|
||
// Copyright 2010 by Philipp Kraft | ||
// This file is part of cmf. | ||
// | ||
// cmf is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// cmf is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with cmf. If not, see <http://www.gnu.org/licenses/>. | ||
// | ||
// Get Documentation | ||
|
||
%feature("compactdefaultargs"); | ||
%include "docstrings.i" | ||
%feature("autodoc","1"); | ||
|
||
// Usage for automated downcast | ||
%include "factory.i" | ||
|
||
// Include typemaps for STL | ||
%include "std_string.i" | ||
|
||
// enable exception support | ||
%include "exception.i" | ||
%exception { | ||
try { | ||
$action | ||
} catch (const std::out_of_range& e) { | ||
SWIG_exception(SWIG_IndexError, e.what()); | ||
} catch (const std::exception& e) { | ||
SWIG_exception(SWIG_RuntimeError, e.what()); | ||
} | ||
|
||
} | ||
%include "attribute.i" | ||
|
||
/* #define SWIG_SHARED_PTR_SUBNAMESPACE */ | ||
%include <std_shared_ptr.i> | ||
%{ | ||
#include "cmfmemory.h" | ||
%} | ||
%include "cmf_swiglib.i" | ||
|
||
%{ | ||
std::string pyrepr(PyObject* o) { | ||
PyObject* s = PyObject_Repr(o); | ||
#if PY_MAJOR_VERSION < 3 | ||
std::string res = PyString_AsString(s); | ||
#else | ||
std::string res = PyUnicode_AsUTF8(s); | ||
#endif | ||
Py_XDECREF(s); | ||
return res; | ||
} | ||
%} | ||
|
||
// Start my Module | ||
%module cmf_core | ||
%include "math/num_array.i" | ||
%include "geometry/geometry.i" | ||
%include "math/time.i" | ||
%include "math/ODEsystem.i" | ||
%include "water/water.i" | ||
%include "atmosphere/meteorology.i" | ||
%include "upslope/cell.i" | ||
%include "upslope/Layer.i" | ||
%include "reach/Reach.i" | ||
|
||
/////////////////////////// | ||
// Surfacewater | ||
////////////////////////// | ||
|
||
%shared_ptr(cmf::upslope::SurfaceWater); | ||
%attribute(cmf::upslope::SurfaceWater,real,puddledepth,get_puddledepth,set_puddledepth); | ||
%attribute(cmf::upslope::SurfaceWater,real,nManning,get_nManning,set_nManning); | ||
|
||
%include "upslope/surfacewater.h" | ||
%extend__repr__(cmf::upslope::SurfaceWater) | ||
|
||
///////////////////////////// | ||
%{ | ||
#include "upslope/groundwater.h" | ||
#include "upslope/connections/subsurfacefluxes.h" | ||
#include "upslope/connections/surfacefluxes.h" | ||
#include "upslope/connections/AtmosphericFluxes.h" | ||
#include "upslope/connections/infiltration.h" | ||
#include "upslope/connections/Percolation.h" | ||
#include "upslope/vegetation/ET.h" | ||
#include "upslope/vegetation/ShuttleworthWallace.h" | ||
// Include river model | ||
#include "reach/ManningConnection.h" | ||
%} | ||
|
||
%shared_ptr(cmf::upslope::aquifer); | ||
%attribute(cmf::upslope::aquifer,double,base_height,get_base_height); | ||
%attribute(cmf::upslope::aquifer,double,top_height,get_top_height); | ||
%include "upslope/groundwater.h" | ||
%extend__repr__(cmf::upslope::aquifer) | ||
|
||
%include "upslope/connections/subsurfacefluxes.h" | ||
%include "reach/ManningConnection.h" | ||
|
||
%include "upslope/connections/surfacefluxes.h" | ||
%include "upslope/connections/AtmosphericFluxes.h" | ||
%include "upslope/connections/infiltration.h" | ||
%include "upslope/connections/Percolation.h" | ||
%include "upslope/vegetation/waterstress.h" | ||
|
||
%include "upslope/vegetation/ET.h" | ||
|
||
%shared_ptr(cmf::upslope::ET::ShuttleworthWallace); | ||
%include "upslope/vegetation/ShuttleworthWallace.h" | ||
|
||
%include "project.i" | ||
|
||
%include "math/integrator.i" | ||
|
||
|
||
%pythoncode { | ||
ConstantFlux = TechnicalFlux | ||
ConstantStateFlux = statecontrol_connection | ||
WaterBalanceFlux = waterbalance_connection | ||
ConceptualInfiltration = SimpleInfiltration | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.