Skip to content

Commit 5d2e0e1

Browse files
committed
update 1D
1 parent 4611b39 commit 5d2e0e1

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

criteriaModel/criteria1DProject.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -1576,14 +1576,17 @@ bool Crit1DProject::restoreState(QString dbStateToRestoreName, QString &myError)
15761576
myError = "Invalid NR_LAYER";
15771577
return false;
15781578
}
1579+
15791580
// check values
15801581
if (nrLayer > 0)
15811582
{
15821583
wc = std::min(wc, myCase.soilLayers[unsigned(nrLayer)].SAT);
15831584
wc = std::max(wc, myCase.soilLayers[unsigned(nrLayer)].HH);
15841585
}
1586+
15851587
myCase.soilLayers[unsigned(nrLayer)].waterContent = wc;
15861588
}
1589+
15871590
if (nrLayer == -1)
15881591
{
15891592
myError = "waterContent table: idCase not found";

soil/soil.cpp

+6-5
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ namespace soil
152152

153153
this->fieldCapacity = NODATA;
154154
this->wiltingPoint = NODATA;
155+
155156
this->waterContentSAT = NODATA;
156157
this->waterContentFC = NODATA;
157158
this->waterContentWP = NODATA;
@@ -225,15 +226,15 @@ namespace soil
225226
horizonPtr = horizonPointer;
226227

227228
// [mm]
228-
SAT = horizonPtr->waterContentSAT * thickness * 1000;
229-
FC = horizonPtr->waterContentFC * thickness * 1000;
230-
WP = horizonPtr->waterContentWP * thickness * 1000;
229+
SAT = horizonPtr->waterContentSAT * thickness * 1000.;
230+
FC = horizonPtr->waterContentFC * thickness * 1000.;
231+
WP = horizonPtr->waterContentWP * thickness * 1000.;
231232
critical = FC;
232233

233234
// hygroscopic humidity
234-
double hygroscopicHumidity = -2000; // [kPa]
235+
double hygroscopicHumidity = -2000; // [kPa]
235236
double volWaterContentHH = soil::thetaFromSignPsi(hygroscopicHumidity, *horizonPtr); // [m3 m-3]
236-
HH = volWaterContentHH * horizonPtr->getSoilFraction() * thickness * 1000;
237+
HH = volWaterContentHH * horizonPtr->getSoilFraction() * thickness * 1000.; // [mm]
237238

238239
return true;
239240
}

0 commit comments

Comments
 (0)