Skip to content

Commit

Permalink
Merge commit '6edf85e98f79311aaa16a67c0cf3e4f9469bd838'
Browse files Browse the repository at this point in the history
  • Loading branch information
ftomei committed Jun 12, 2024
2 parents f929b35 + 6edf85e commit e8161b4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion agrolib/outputPoints/dbOutputPointsHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ bool Crit3DOutputPointsDbHandler::saveHourlyCriteria3D_Data(const QString &table
setList += "'" + fieldName + "'=";

int index = i * nrSoilLayers + layer - 1;
QString valueStr = QString::number(values[index], 'f', 2);
QString valueStr = QString::number(values[index], 'f', 3);
setList += valueStr;

if (index < (nrValues - 1))
Expand Down
6 changes: 3 additions & 3 deletions agrolib/soil/soil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ namespace soil
{
double suctionStress = -waterPotential * getDegreeOfSaturation(); // [kPa]

double slopeAngle = asin(slope);
double slopeAngle = std::max(asin(slope), EPSILON);
double frictionAngle = horizonPtr->frictionAngle * DEG_TO_RAD;

double tanAngle = tan(slopeAngle);
Expand Down Expand Up @@ -780,8 +780,8 @@ namespace soil
// surface 2%
if (upperDepth == 0.0) return 0.02;
// first layer 1%
if (upperDepth > 0 && upperDepth < 0.5) return 0.01;
// sub-surface 0.5%
if (upperDepth > 0 && upperDepth < 0.4) return 0.01;
// sub-surface
return MINIMUM_ORGANIC_MATTER;
}

Expand Down
2 changes: 1 addition & 1 deletion agrolib/soilWidget/tabHorizons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ bool TabHorizons::checkHorizonData(int horizonNum)
tableDb->item(horizonNum,5)->setBackground(Qt::red);
}

if (dbData->organicMatter != NODATA && (dbData->organicMatter < 0 || dbData->organicMatter > 100))
if ( dbData->organicMatter != NODATA && ((dbData->organicMatter < 0) || (dbData->organicMatter > 100)) )
{
tableDb->item(horizonNum,6)->setBackground(Qt::red);
}
Expand Down

0 comments on commit e8161b4

Please sign in to comment.