Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
Model_MAMESTRABR
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VIPS
Models
Java
Model_MAMESTRABR
Commits
f0a8b9b7
Commit
f0a8b9b7
authored
4 years ago
by
Tor-Einar Skog
Browse files
Options
Downloads
Patches
Plain Diff
Avoiding crash if we're very early in the season and we're
running out of soil temp (not forecasted)
parent
8c682b1c
No related branches found
No related tags found
1 merge request
!1
Master
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/no/nibio/vips/model/mamestrabrassicaemodel/MamestraBrassicaeModel.java
+5
-2
5 additions, 2 deletions
.../model/mamestrabrassicaemodel/MamestraBrassicaeModel.java
with
5 additions
and
2 deletions
src/main/java/no/nibio/vips/model/mamestrabrassicaemodel/MamestraBrassicaeModel.java
+
5
−
2
View file @
f0a8b9b7
...
@@ -94,7 +94,10 @@ public class MamestraBrassicaeModel extends I18nImpl implements Model{
...
@@ -94,7 +94,10 @@ public class MamestraBrassicaeModel extends I18nImpl implements Model{
DecimalFormat
dFormat
=
new
DecimalFormat
(
"###.##"
);
DecimalFormat
dFormat
=
new
DecimalFormat
(
"###.##"
);
List
<
Result
>
retVal
=
new
ArrayList
<>();
List
<
Result
>
retVal
=
new
ArrayList
<>();
Calendar
cal
=
Calendar
.
getInstance
(
timeZone
);
Calendar
cal
=
Calendar
.
getInstance
(
timeZone
);
while
(
currentDate
.
before
(
endDate
))
while
(
currentDate
.
before
(
endDate
)
// Stopping if we're running out of soil temp too early
&&
!(
accumulatedDayDegrees
<
THRESHOLD_TMDD_PUPAE
&&
this
.
dataMatrix
.
getParamValueForDate
(
currentDate
,
DataMatrix
.
TJM10D
)
==
null
)
)
{
{
Double
baseTemp
=
this
.
findT0
(
accumulatedDayDegrees
);
Double
baseTemp
=
this
.
findT0
(
accumulatedDayDegrees
);
Double
todayTemp
=
accumulatedDayDegrees
<
THRESHOLD_TMDD_PUPAE
?
Double
todayTemp
=
accumulatedDayDegrees
<
THRESHOLD_TMDD_PUPAE
?
...
@@ -318,7 +321,7 @@ public class MamestraBrassicaeModel extends I18nImpl implements Model{
...
@@ -318,7 +321,7 @@ public class MamestraBrassicaeModel extends I18nImpl implements Model{
this
.
dataMatrix
.
getFirstDateWithParameterValue
(
DataMatrix
.
TJM10D
)
+
", last day with air temp = "
+
this
.
dataMatrix
.
getFirstDateWithParameterValue
(
DataMatrix
.
TJM10D
)
+
", last day with air temp = "
+
this
.
dataMatrix
.
getLastDateWithParameterValue
(
DataMatrix
.
TMD
));
this
.
dataMatrix
.
getLastDateWithParameterValue
(
DataMatrix
.
TMD
));
}
}
//System.out.println(this.dataMatrix.toCSV());
}
}
private
Double
findT0
(
Double
accumulatedDayDegrees
)
private
Double
findT0
(
Double
accumulatedDayDegrees
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment