Skip to content

Commit

Permalink
Merge commit '9266710f722b5262f6d1f165d55acb8eeb81933b'
Browse files Browse the repository at this point in the history
  • Loading branch information
ftomei committed Aug 13, 2024
2 parents f5fdf5c + 9266710 commit 0d172d5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
8 changes: 8 additions & 0 deletions agrolib/weatherGenerator/weatherGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1170,6 +1170,14 @@ bool computeSeasonalPredictions(TinputObsData *dailyObsData, TweatherGenClimate
{
outputDailyData[currentIndex].maxTemp = getTMax(myDoy, rainfallThreshold, wgClimate);
outputDailyData[currentIndex].minTemp = getTMin(myDoy, rainfallThreshold, wgClimate);
if (outputDailyData[currentIndex].maxTemp < outputDailyData[currentIndex].minTemp)
{
float average,diff;
average = 0.5*(outputDailyData[currentIndex].maxTemp + outputDailyData[currentIndex].minTemp);
diff = outputDailyData[currentIndex].minTemp - outputDailyData[currentIndex].maxTemp;
outputDailyData[currentIndex].maxTemp = average + 0.5*diff;
outputDailyData[currentIndex].minTemp = average - 0.5*diff;
}
outputDailyData[currentIndex].prec = getPrecip(myDoy, rainfallThreshold, wgClimate);
indexWg.push_back(currentIndex);
}
Expand Down
2 changes: 2 additions & 0 deletions agrolib/weatherGenerator2D/weatherGenerator2D.pro
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ INCLUDEPATH += ../crit3dDate
INCLUDEPATH += ../meteo
INCLUDEPATH += ../gis
INCLUDEPATH += ../crit3dDate
INCLUDEPATH += ../waterTable
INCLUDEPATH += ../weatherGenerator


SOURCES += wg2D.cpp \
randomset.cpp \
wg2D_precipitation.cpp \
Expand Down
6 changes: 3 additions & 3 deletions agrolib/weatherGenerator2D/wg2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -460,9 +460,9 @@ void weatherGenerator2D::computeMonthlyVariables()
weibullDailyParameterLambda[i] = (double*)calloc(365,sizeof(double));
interpolatedDailyValuePrecAverage[i] = (float*)calloc(365,sizeof(float));
interpolatedDailyValuePrecVariance[i] = (float*)calloc(365,sizeof(float));
cubicSplineYearInterpolate(monthlyAveragePrec[i],interpolatedDailyValuePrecAverage[i]);
cubicSplineYearInterpolate(monthlyStdDevPrec[i],interpolatedDailyValuePrecVariance[i]);
for (int j=0;j<365;j++)
interpolation::cubicSplineYearInterpolate(monthlyAveragePrec[i], interpolatedDailyValuePrecAverage[i]);
interpolation::cubicSplineYearInterpolate(monthlyStdDevPrec[i], interpolatedDailyValuePrecVariance[i]);
for (int j=0; j < 365; j++)
{
interpolatedDailyValuePrecVariance[i][j] *= interpolatedDailyValuePrecVariance[i][j];
}
Expand Down

0 comments on commit 0d172d5

Please sign in to comment.