16#ifndef LDNDC_DATASYNTH_CLIMATE_H_
17#define LDNDC_DATASYNTH_CLIMATE_H_
19#include "synthesizers/synth-base-streamdata.h"
20#include "climate/climatetypes.h"
21#include "time/cbm_date.h"
23#include "math/cbm_math.h"
25#define SYNTH_CLIMATE_REC_SIZE SYNTH_REC_SIZE_(climate)
27#define SYNTH_CLIMATE_INVALIDATE_BUFFER(__buf__) SYNTH_INVALIDATE_BUFFER_(climate,__buf__)
29#define SYNTH_CLIMATE_CHK_MATCHING(__item__) SYNTH_CHK_MATCHING_(climate,__item__)
31#define SYNTH_CLIMATE_RETURN_SUCCESS(__item__) SYNTH_RETURN_SUCCESS_(climate,__item__)
33#define SYNTH_CLIMATE_RECORD_ITEM_COMMON_DECL(__class__,__item_enum__) SYNTH_RECORD_ITEM_COMMON_DECL_(climate,__class__,__item_enum__)
39#define PRECIP_OVERSHOOT_MAX (70.0)
41#define PRECIP_STRETCHING_FACTOR (150.0)
43#define PRECIP_OVERSHOOT_REDUCTION_RATE (0.3)
45#define PRECIP_STRETCHING_PROBABILITY (0.9)
48template <
typename,
unsigned int >
51namespace ldndc{
namespace climate{
namespace synth
53 typedef record::item_type record_item_t;
54 struct CBM_API scratch_t :
public ldndc::synth::streamdata_scratch_base_t< streamdata_info_t >
57 unsigned int julian_day;
59 cbm::random::rng_uniform_t precip_rng;
61 record_item_t precip_generated;
62 record_item_t precip_overshoot;
64 record_item_t precip_d;
65 record_item_t precip_exp;
68 bool rec_s_given[record::RECORD_SIZE];
69 record_item_t precip_value_fact;
74 double precip_value_fact_fun(
79 climate_info_t
const * ,
84 climate_info_t
const * ,
90 struct CBM_API item_base_t :
public ldndc::synth::streamdata_item_base_t< streamdata_info_t, scratch_t >
95 class CBM_API lsynth_climate_t :
public ldndc::synth::streamdata_synth_base_t< streamdata_info_t >
100 climate_info_t
const * ,
105 virtual ~lsynth_climate_t();
113 unsigned int = ldndc::invalid_t< unsigned int >::value );
119 lerr_t synthesize_record(
120 record_item_t
const * , record_item_t * ,
121 record_item_t
const * , record_item_t * ,
125 lvector_t< unsigned int, 1 > * = NULL );
135 record_item_t
const * ,
136 record_item_t
const * )
const;
139 unsigned int subday()
142 return this->scratch_.subday;
146 unsigned int time_resolution_inout()
149 return this->scratch_.t_res_inout;
153 climate_info_t info_;
157 static record::record_item_e
const SYNTH_ORDER[record::RECORD_SIZE];
159 record::record_item_e synth_order_[record::RECORD_SIZE];
161 extern item_base_t
const * climate_synthesizers[record::RECORD_SIZE];
Spatially explicit groundwater model.
Definition airchemistryput.h:21