Class module_base
Defined in File module_base.hpp
Inheritance Relationships
Derived Types
public Burridge_iswr
(Class Burridge_iswr)public Cullen_monthly_llra_ta
(Class Cullen_monthly_llra_ta)public Dist_tlapse
(Class Dist_tlapse)public Dodson_NSA_ta
(Class Dodson_NSA_ta)public FSM
(Class FSM)public Gray_inf
(Class Gray_inf)public Harder_precip_phase
(Class Harder_precip_phase)public Iqbal_iswr
(Class Iqbal_iswr)public Kunkel_monthlyTd_rh
(Class Kunkel_monthlyTd_rh)public Lehning_snowpack
(Class Lehning_snowpack)public Liston_monthly_llra_ta
(Class Liston_monthly_llra_ta)public Liston_wind
(Class Liston_wind)public Longwave_from_obs
(Class Longwave_from_obs)public MS_wind
(Class MS_wind)public Marsh_shading_iswr
(Class Marsh_shading_iswr)public PBSM3D
(Class PBSM3D)public PenmanMonteith_evaporation
(Class PenmanMonteith_evaporation)public Richard_albedo
(Class Richard_albedo)public Sicart_ilwr
(Class Sicart_ilwr)public Simple_Canopy
(Class Simple_Canopy)public Thornton_p
(Class Thornton_p)public Walcek_cloud
(Class Walcek_cloud)public WindNinja
(Class WindNinja)public Winstral_parameters
(Class Winstral_parameters)public const_llra_ta
(Class const_llra_ta)public crop_rotation
(Class crop_rotation)public deform_mesh
(Class deform_mesh)public fast_shadow
(Class fast_shadow)public fetchr
(Class fetchr)public iswr
(Class iswr)public iswr_from_nwp
(Class iswr_from_nwp)public iswr_from_obs
(Class iswr_from_obs)public kunkel_rh
(Class kunkel_rh)public lw_no_lapse
(Class lw_no_lapse)public module_template
(Class module_template)public mpi
(Class mpi)public p_from_obs
(Class p_from_obs)public p_lapse
(Class p_lapse)public p_no_lapse
(Class p_no_lapse)public point_mode
(Class point_mode)public rh_from_obs
(Class rh_from_obs)public rh_no_lapse
(Class rh_no_lapse)public scale_wind_vert
(Class scale_wind_vert)public slope_iswr
(Class slope_iswr)public snobal
(Class snobal)public snow_slide
(Class snow_slide)public solar
(Class solar)public sub_grid
(Class sub_grid)public t_no_lapse
(Class t_no_lapse)public threshold_p_phase
(Class threshold_p_phase)public uniform_wind
(Class uniform_wind)
Class Documentation
-
class module_base
Base class for individual modules.
A module must inherent from this class. This provides the interface for all module.
Subclassed by Burridge_iswr, Cullen_monthly_llra_ta, Dist_tlapse, Dodson_NSA_ta, FSM, Gray_inf, Harder_precip_phase, Iqbal_iswr, Kunkel_monthlyTd_rh, Lehning_snowpack, Liston_monthly_llra_ta, Liston_wind, Longwave_from_obs, MS_wind, Marsh_shading_iswr, PBSM3D, PenmanMonteith_evaporation, Richard_albedo, Sicart_ilwr, Simple_Canopy, Thornton_p, Walcek_cloud, WindNinja, Winstral_parameters, const_llra_ta, crop_rotation, deform_mesh, fast_shadow, fetchr, iswr, iswr_from_nwp, iswr_from_obs, kunkel_rh, lw_no_lapse, module_template, mpi, p_from_obs, p_lapse, p_no_lapse, point_mode, rh_from_obs, rh_no_lapse, scale_wind_vert, slope_iswr, snobal, snow_slide, solar, sub_grid, t_no_lapse, threshold_p_phase, uniform_wind
Public Types
-
enum class parallel
A module must declare itself as either parallel data, where the module only operates upon a single mesh element, or parallel domain, where the module operates upon the domain in its entirety. The default is data parallel
Values:
-
enumerator data
Sets that this module is element parallel. That is, this module can compute the solution at this element without needing to communicate with surrounding elements. There is no guarantee on element ordering
-
enumerator domain
Sets that this module is domain parallel. That is, this module requires surrounding elements to compute its answer and that it is dependent upon the order of traversal of elements.
-
enumerator data
Public Functions
-
inline module_base()
Default constructor
-
inline module_base(std::string name = "", parallel type = parallel::data, config_file input_cfg = pt::basic_ptree<std::string, std::string>())
Consturctor that initializes everything
-
inline virtual ~module_base()
Default destructor
-
inline virtual void checkpoint(mesh &domain, netcdf &chkpt)
Checkpoint (save state) the current module. By default this errors out if the modules does not support checkpointing.
- Parameters:
domain –
data –
-
inline virtual void load_checkpoint(mesh &domain, netcdf &chkpt)
-
inline virtual void run(mesh_elem &face)
Needs to be implemented by each data parallel module. This will be called and executed for each timestep
- Parameters:
face – The terrain element (triangle) to be worked upon for an element parallel domain
global_param – A pointer to the shared global paramter space with domain-wide paramters
-
inline virtual void run(mesh &domain)
-
inline virtual void init(mesh &domain)
-
inline boost::shared_ptr<std::vector<variable_info>> provides()
List of the variables that this module provides.
-
inline boost::shared_ptr<std::vector<std::string>> provides_vector()
List of the vetors that this module provides.
-
inline boost::shared_ptr<std::vector<std::string>> provides_parameter()
List of the parameters that this module provides.
-
inline void provides_vector(const std::string &name)
default behaviour is to make it of type NEIGHBOR Set a vector variable that this module provides. ** Currently not used to resolve dependencies ** This is a list of variables that are stored as x,y,z vectors, such as wind velocities Vector_3 so magnitude needs to be stored in a normal _provides variable
- Parameters:
name –
-
inline void provides(const std::string &name)
Set a variable that this module provides
default behaviour is to make it of type NEIGHBOR
-
inline void provides(const std::string &name, SpatialType st)
Set a variable that this module provides
-
inline void provides(const std::string &name, SpatialType st, double distance)
Set a variable that this module provides
-
inline void provides_parameter(const std::string &variable)
Set a parameter that this module provides
-
inline boost::shared_ptr<std::vector<variable_info>> depends()
List of the variables from other modules that this module depends upon
-
inline void conflicts(const std::string &variable)
Modules we conflict with and absolutely cannot run alongside. Use sparingly.
-
inline boost::shared_ptr<std::vector<std::string>> conflicts()
-
inline boost::shared_ptr<std::vector<std::string>> optionals()
List of the optional depends variables from other modules that this module depends upon
-
inline void depends(const std::string &name)
Set a variable, from another module, that this module depends upon
-
inline void depends(const std::string &name, SpatialType st)
-
inline void depends(const std::string &name, SpatialType st, double distance)
-
inline boost::shared_ptr<std::vector<std::string>> depends_from_met()
List of the variables from the met files that this module depends upon
-
inline void depends_from_met(const std::string &variable)
Set a variable, from a met file, that this module depends upon
-
inline void optional(const std::string &variable)
Set an optional (not required) variable, from another module, that this module depends upon.
-
inline bool has_optional(const std::string &variable)
Checks if an optional variable was found
-
inline std::vector<std::string> get_variable_names_from_collection(std::vector<variable_info> collection)
-
inline void set_all_nan_on_skip(mesh_elem &face)
If you want to skip evaluating this current face, call this to set all provides outputs to nan E.g., called if the is_water, is_glacier, etc is true
-
inline void set_optional_found(const std::string &variable)
Set that an optional variable was found
-
inline bool is_nan(const double &variable)
-
inline bool is_water(mesh_elem &face)
-
inline bool is_glacier(mesh_elem &face)
Public Members
-
std::string ID
ID of the module
-
pt::ptree cfg
Configuration file. If module does not need one, then this will contain nothing
-
int IDnum
Upon instantiation the module is assigned a value based upon its initialization order. Primarily used to dependency resolution. No real usage otherwise.
-
boost::shared_ptr<global> global_param
Global parameter store
Protected Attributes
-
boost::shared_ptr<std::vector<variable_info>> _provides
-
boost::shared_ptr<std::vector<std::string>> _provides_parameters
-
boost::shared_ptr<std::vector<variable_info>> _depends
-
boost::shared_ptr<std::vector<std::string>> _depends_from_met
-
boost::shared_ptr<std::vector<std::string>> _optional
-
boost::shared_ptr<std::vector<std::string>> _conflicts
-
boost::shared_ptr<std::vector<std::string>> _vectors
-
std::map<std::string, bool> _optional_found
-
enum class parallel