9#ifndef LDNDC_DATASYNTH_CLIMATE_H_
10#define LDNDC_DATASYNTH_CLIMATE_H_
12#include "synthesizers/synth-base-streamdata.h"
13#include "climate/climatetypes.h"
14#include "time/cbm_date.h"
16#include "math/cbm_math.h"
18#define SYNTH_CLIMATE_REC_SIZE SYNTH_REC_SIZE_(climate)
20#define SYNTH_CLIMATE_INVALIDATE_BUFFER(__buf__) SYNTH_INVALIDATE_BUFFER_(climate,__buf__)
22#define SYNTH_CLIMATE_CHK_MATCHING(__item__) SYNTH_CHK_MATCHING_(climate,__item__)
24#define SYNTH_CLIMATE_RETURN_SUCCESS(__item__) SYNTH_RETURN_SUCCESS_(climate,__item__)
26#define SYNTH_CLIMATE_RECORD_ITEM_COMMON_DECL(__class__,__item_enum__) SYNTH_RECORD_ITEM_COMMON_DECL_(climate,__class__,__item_enum__)
32#define PRECIP_OVERSHOOT_MAX (70.0)
34#define PRECIP_STRETCHING_FACTOR (150.0)
36#define PRECIP_OVERSHOOT_REDUCTION_RATE (0.3)
38#define PRECIP_STRETCHING_PROBABILITY (0.9)
41template <
typename,
unsigned int >
44namespace ldndc{
namespace climate{
namespace synth
46 typedef record::item_type record_item_t;
47 struct CBM_API scratch_t :
public ldndc::synth::streamdata_scratch_base_t< streamdata_info_t >
50 unsigned int julian_day;
52 cbm::random::rng_uniform_t precip_rng;
54 record_item_t precip_generated;
55 record_item_t precip_overshoot;
57 record_item_t precip_d;
58 record_item_t precip_exp;
59 record_item_t precip_value_fact;
64 double precip_value_fact_fun(
69 climate_info_t
const * ,
74 climate_info_t
const * ,
80 struct CBM_API item_base_t :
public ldndc::synth::streamdata_item_base_t< streamdata_info_t, scratch_t >
85 class CBM_API lsynth_climate_t :
public ldndc::synth::streamdata_synth_base_t< streamdata_info_t >
90 climate_info_t
const * ,
95 virtual ~lsynth_climate_t();
103 unsigned int = ldndc::invalid_t< unsigned int >::value );
109 lerr_t synthesize_record(
110 record_item_t
const * , record_item_t * ,
111 record_item_t
const * , record_item_t * ,
115 lvector_t< unsigned int, 1 > * = NULL );
125 record_item_t
const * ,
126 record_item_t
const * )
const;
129 unsigned int subday()
132 return this->scratch_.subday;
136 unsigned int time_resolution_inout()
139 return this->scratch_.t_res_inout;
143 climate_info_t info_;
147 static record::record_item_e
const SYNTH_ORDER[record::RECORD_SIZE];
149 record::record_item_e synth_order_[record::RECORD_SIZE];
151 extern item_base_t
const * climate_synthesizers[record::RECORD_SIZE];
Spatially explicit groundwater model.
Definition airchemistryput.h:15