Skip to content
This repository was archived by the owner on Apr 15, 2024. It is now read-only.

Commit 24d4ca8

Browse files
committed
flux dims
git-svn-id: https://daisy-model.googlecode.com/svn/trunk@3620 5f5bf4bb-3343-0410-8278-4fa8eb3319dc
1 parent 5160467 commit 24d4ca8

20 files changed

+527
-602
lines changed

ChangeLog

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2010-06-02 Per Abrahamsen <[email protected]>
2+
3+
* select.C (initialize): Multiply spec_dim with 'h' when using
4+
Handle::sum.
5+
* summary.h, summary_simple.C, summary_balance.C: Adjust.
6+
* fetch.h, fetch_pretty.h, fetch_pretty.C: Ditto.
7+
18
2010-05-28 Per Abrahamsen <[email protected]>
29

310
* xysource_xycombine.C: New model.

NEWS

+31-6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,31 @@ release.
1212

1313
Should lead to more evapotranspiration from wet surfaces.
1414

15+
** Dimension change in log files.
16+
17+
The dimension of most flux variables in the standard log files has
18+
changed so it no longer contain the log timestep. For example,
19+
logging "Field water" weekly would have the unit for fluxes be mm/w,
20+
while logging monthly would have the same units be mm/m. Now it will
21+
be mm. The actual values will be the same, the interpretation is
22+
"amount of water since last we logged".
23+
24+
The advantages of this new interpretation are that 1) We avoid weird
25+
units, 2) it works with intervals that have no nice symbol (like
26+
biweekly), and 3) it works with variable timesteps.
27+
28+
Technically, internally in Daisy most flux unit are per time
29+
(independent of the actual timestep used by Daisy). When a log file
30+
parametrization specifies (handle sum) this value will be multiplied
31+
with the length of the timestep. What happens now is that the unit is
32+
also multiplied be the unit of the timestep [h].
33+
34+
If you really want the dimension of flux variables to be per time,
35+
specify (handle average) instead, which will divide the value and unit
36+
by the total time between log entries in hours, returning to the
37+
original unit. You can then tell Daisy to convert this to another
38+
timestep by specifying 'dimension' explicitly.
39+
1540
** Variable timesteps.
1641

1742
Yo can now allow Daisy to temporarily decrease timesteps in order to
@@ -84,9 +109,9 @@ This log will provide information about the timestep.
84109
** The 'none' chemistry is now build in.
85110

86111
So there is no longer any reason to load 'chemistry.dai' just in order
87-
to disable chemstry.
112+
to disable chemistry.
88113

89-
** Biopore wall resistence change.
114+
** Biopore wall resistance change.
90115

91116
The R_primary and R_secondary parameters are gone, instead we have
92117
K_wall_relative, which denote the conductivity of the biopore wall
@@ -115,7 +140,7 @@ The 'type' parameter allows you to select between 'block', 'smooth',
115140
'surface', and 'contour' plots, and the 'top', 'bottom', 'left' and
116141
'right' parameters allows you to zoom into a rectangular subset of the
117142
soil.. More information about generating plots can be found in the
118-
tutorial, and more deails on the 'soil' model can be found in the
143+
tutorial, and more details on the 'soil' model can be found in the
119144
reference manual.
120145

121146
* 4.86
@@ -128,7 +153,7 @@ reference manual.
128153

129154
* 4.84
130155

131-
** Surface decompose rate now defaults to canopy dissipitation rate.
156+
** Surface decompose rate now defaults to canopy dissipation rate.
132157

133158
It use to default to soil decompose rate.
134159

@@ -5636,7 +5661,7 @@ Affects mineralization, nitrification, and denitrification.
56365661

56375662
This action specifies a strategy for managing a specific crop or
56385663
multicrop. To create a crop rotation, you can combine these 'crop'
5639-
action sequenctially using the 'activity' action.
5664+
action sequentially using the 'activity' action.
56405665

56415666
* 1.04
56425667

@@ -5652,7 +5677,7 @@ action sequenctially using the 'activity' action.
56525677

56535678
** Added surface runoff.
56545679

5655-
Controlable with the new 'DetentionCapacity' and 'ReservoirConstant'
5680+
Controllable with the new 'DetentionCapacity' and 'ReservoirConstant'
56565681
surface parameters.
56575682

56585683
** Added mixing of inorganic nitrogen between surface and soil.

TODO

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
TODO --- things that needs to be done with Daisy -*- org -*-
22

3-
* Handle::sum skal gange dimension med 'h'
3+
* Ny faveskala til vand (bl�0, hvid1, gul2, orange3, r�d4, sort5)
44

55
* K�rsler
66

fetch.C

+2-29
Original file line numberDiff line numberDiff line change
@@ -78,35 +78,8 @@ Fetch::add (const symbol)
7878
{ type = Error; }
7979

8080
symbol
81-
Fetch::dimension (const symbol period) const
82-
{
83-
if (type != Flux)
84-
return select_dimension;
85-
86-
const size_t size = select_dimension.name ().size ();
87-
if (size > 1)
88-
{
89-
const char last = select_dimension.name ()[size - 1];
90-
const char second_last = select_dimension.name ()[size - 2];
91-
if (second_last == '/'
92-
&& (last == 'h' || last == 'd' || last == 'w'
93-
|| last == 'm' || last == 'y'))
94-
{
95-
const std::string strip
96-
= select_dimension.name ().substr (0, size - 2);
97-
if (period != "")
98-
return strip + "/" + period;
99-
else
100-
return strip;
101-
}
102-
}
103-
if (period == "h")
104-
return select_dimension;
105-
else if (period == "")
106-
return select_dimension + "h";
107-
else
108-
return select_dimension + "h/" + period;
109-
}
81+
Fetch::dimension () const
82+
{ return select_dimension; }
11083

11184
void
11285
Fetch::clear (const std::vector<Fetch*>& fetch)

fetch.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class Fetch : public Destination
5858

5959
// Use.
6060
public:
61-
symbol dimension (const symbol period) const;
61+
symbol dimension () const;
6262

6363
// Create and Destroy.
6464
public:

fetch_pretty.C

+5-25
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,6 @@
2727
#include "mathlib.h"
2828
#include <ostream>
2929

30-
double
31-
FetchPretty::period_factor (const symbol period, const int hours)
32-
{
33-
if (period == "")
34-
return 1.0;
35-
if (period == "y")
36-
return 365.2425 * 24.0 / hours;
37-
if (period == "m")
38-
return 30.0 * 24.0 / hours;
39-
if (period == "w")
40-
return 7.0 * 24.0 / hours;
41-
if (period == "d")
42-
return 24.0 / hours;
43-
if (period == "h")
44-
return 1.0 / hours;
45-
return -42.42e42;
46-
}
47-
4830
int
4931
FetchPretty::width (const double value)
5032
{
@@ -71,8 +53,7 @@ FetchPretty::name_size () const
7153
}
7254

7355
int
74-
FetchPretty::value_size (double& total, const symbol period,
75-
const int hours) const
56+
FetchPretty::value_size (double& total) const
7657
{
7758
double value = 0.0;
7859
switch (type)
@@ -84,16 +65,15 @@ FetchPretty::value_size (double& total, const symbol period,
8465
value = (last - initial) * factor;
8566
break;
8667
case Flux:
87-
value = sum * factor * period_factor (period, hours);
68+
value = sum * factor;
8869
break;
8970
}
9071
total += value;
9172
return width (value);
9273
}
9374

9475
void
95-
FetchPretty::summarize (std::ostream& out, const int width,
96-
const symbol period, const int hours) const
76+
FetchPretty::summarize (std::ostream& out, const int width) const
9777
{
9878
if (type == Content && add_delta)
9979
out << "delta ";
@@ -115,15 +95,15 @@ FetchPretty::summarize (std::ostream& out, const int width,
11595
break;
11696
case Flux:
11797
{
118-
const double value = sum * factor * period_factor (period, hours);
98+
const double value = sum * factor;
11999
out << value;
120100
}
121101
break;
122102
case Error:
123103
out << "bogus data";
124104
break;
125105
}
126-
out << " " << "[" << dimension (period) << "]\n";
106+
out << " " << "[" << dimension () << "]\n";
127107
}
128108

129109
void

fetch_pretty.h

+3-5
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,12 @@ class FetchPretty : public Fetch
3434
const bool add_delta;
3535

3636
// Use.
37-
private:
38-
static double period_factor (symbol period, int hours);
3937
public:
4038
static int width (double value);
4139
size_t name_size () const;
42-
int value_size (double& total, const symbol period, const int hours) const;
43-
void summarize (std::ostream& out, const int width,
44-
const symbol period, const int hours) const;
40+
int value_size (double& total) const;
41+
void summarize (std::ostream& out, const int width) const;
42+
4543
// Create and Destroy.
4644
private:
4745
using Fetch::clear;

0 commit comments

Comments
 (0)