Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
record
azodyn
Commits
bdb543e4
Commit
bdb543e4
authored
Apr 25, 2019
by
Ronan Trepos
Browse files
Pea: fix the calculation of coef_fixmax3
parent
5d2b1d3e
Changes
1
Hide whitespace changes
Inline
Side-by-side
AZODYN/src/Coef_fixmax3.cpp
View file @
bdb543e4
...
...
@@ -37,6 +37,7 @@
#include <vle/utils/DateTime.hpp>
#include <vle/DiscreteTime.hpp>
#include <vle/reader/table_file_reader.hpp>
#include "AzodynUtils.hpp"
namespace
AZODYN
{
...
...
@@ -240,7 +241,7 @@ public:
m_table_reader
.
getFilePath
().
c_str
(),
vu
::
DateTime
::
toJulianDay
(
begin_date
).
c_str
()));
}
for
(
int
toskip
=
int
(
begin_date
+
1
)
-
begin_date_file
;
for
(
int
toskip
=
int
(
begin_date
)
-
(
begin_date_file
)
;
toskip
>
0
;
toskip
--
)
{
res
=
m_table_reader
.
readLine
(
line_read
);
}
...
...
@@ -248,16 +249,19 @@ public:
res
=
m_table_reader
.
readLine
(
line_read
);
}
//*** compute coef_fixmax3
//
*** compute coef_fixmax3
//jump to sowing
coef_fixmax3
.
init
(
this
,
"coef_fixmax3"
,
events
);
int
current_time
=
int
(
begin_date
);
int
sowing_time
=
vu
::
DateTime
::
toJulianDayNumber
(
events
.
getString
(
"date_S"
));
for
(;
current_time
<
sowing_time
;
current_time
++
)
{}
for
(;
current_time
<
sowing_time
;
current_time
++
)
{
res
=
m_table_reader
.
readLine
(
line_read
);
}
//sum temperature betwenn sowing and crop emergence
double
sumT_sowing_emergence
=
0
;
double
ST_S_LEVEE
=
events
.
getDouble
(
"ST_S_LEVEE"
);
double
sumT_sowing_emergence
=
line_read
.
getDouble
(
indexVar_TMC
)
;
double
ST_S_LEVEE
=
Utils
::
extractDouble
(
events
,
"ST_S_LEVEE"
);
for
(;
sumT_sowing_emergence
<
ST_S_LEVEE
;
current_time
++
)
{
res
=
m_table_reader
.
readLine
(
line_read
);
sumT_sowing_emergence
+=
line_read
.
getDouble
(
indexVar_TMC
);
...
...
@@ -265,16 +269,17 @@ public:
std
::
string
date_levee
=
vu
::
DateTime
::
toJulianDay
(
current_time
);
//sum temperature between crop emergence and flowering
double
sumT_emergence_flowering
=
0
;
double
sumT_emergence_flowering
=
line_read
.
getDouble
(
indexVar_TMC
)
;
int
flowering_time
=
vu
::
DateTime
::
toJulianDayNumber
(
events
.
getString
(
"date_FLO"
));
for
(;
current_time
<
=
flowering_time
;
current_time
++
)
{
for
(;
current_time
<
flowering_time
;
current_time
++
)
{
res
=
m_table_reader
.
readLine
(
line_read
);
sumT_emergence_flowering
+=
line_read
.
getDouble
(
indexVar_TMC
);
}
//regression equation
double
coef_fixmax1
=
events
.
getDouble
(
"coef_fixmax1"
);
double
coef_fixmax2
=
events
.
getDouble
(
"coef_fixmax2"
);
double
ST_DF_DRG
=
events
.
getDouble
(
"ST_DF_DRG"
);
double
coef_fixmax1
=
Utils
::
extractDouble
(
events
,
"coef_fixmax1"
);
double
coef_fixmax2
=
Utils
::
extractDouble
(
events
,
"coef_fixmax2"
);
double
ST_DF_DRG
=
Utils
::
extractDouble
(
events
,
"ST_DF_DRG"
);
coef_fixmax3
.
init_value
(
coef_fixmax2
-
(
coef_fixmax1
*
(
sumT_emergence_flowering
+
ST_DF_DRG
)));
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment