[PATCH 5 of 5] SedimentLoadCalculation: Handle boring cases in total sed load calculation

Wald Commits scm-commit at wald.intevation.org
Fri Jun 28 13:51:31 CEST 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1372420815 -7200
# Node ID f3b3742fbdad142ffb05eb4f6d9cbd82f7e6a908
# Parent  857f4d51d859c79eda0c4f7eff791dd4d427f58b
SedimentLoadCalculation: Handle boring cases in total sed load calculation.

diff -r 857f4d51d859 -r f3b3742fbdad artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadCalculation.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadCalculation.java	Fri Jun 28 13:59:45 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadCalculation.java	Fri Jun 28 14:00:15 2013 +0200
@@ -465,6 +465,20 @@
             else {
                 // Some values are missing or no intersection with former values.
                 // Stay as we are.
+                if (hasButSuspValues(fraction)) {
+                    double total = fraction.getCoarse() +
+                        fraction.getFineMiddle() +
+                        fraction.getSand() +
+                        fraction.getSuspSand();
+                    lastOtherRange = fraction.getCoarseRange();
+                    lastOtherValue = total;
+                    lastSuspRange = null;
+                }
+                else if (hasOnlySuspValues(fraction)) {
+                    lastSuspRange = fraction.getSuspSedimentRange();
+                    lastSuspValue = fraction.getSuspSediment();
+                    lastOtherRange = null;
+                }
             }
         }
         return fairLoad;


More information about the Dive4elements-commits mailing list