JGCRI / xanthos

An extensible global hydrologic framework
Other
32 stars 16 forks source link

Fix unit issues with average channel flow #42

Closed calebbraun closed 5 years ago

calebbraun commented 5 years ago

Summary

Routing outputs (average channel flow) are way too low, averaging on the order of 10^-18 m3/s, while the official archived Xanthos runs are significantly higher (see below).

Changes Made

It appears that the equation used to convert runoff values from mm/mth to m3/s was incorrect, giving results 10^18 times smaller than expected (perhaps the (1e6 * 10**9) term was supposed to be (1e6 / 10**9)). Re-calculating the conversion from mm/mth -> m3/s gives very different results that more closely match the archived runs.

Additionally, average channel flow was being treated the same as other variables in the output module. Assuming the spatial and temporal conversions were done correctly in the routing module, the special case for average channel flow does two things differently:

Results

Archived Xanthos Results:

>>> df = pd.read_csv('avgchflow_m3persec_pm_abcd_mrtm_watch_mth_1971_2001.csv')
>>> df.iloc[:, [1, 13, 25, -36, -24, -12]].describe().apply(lambda x:round(x, 5))
             197101        197201        197301        199901        200001        200101
count   67420.00000   67420.00000   67420.00000   67420.00000   67420.00000   67420.00000
mean      208.35486     202.27336     209.13997     215.75312     217.40135     233.68360
std      2340.81348    2435.31804    2429.81124    2310.00733    2270.67291    2571.72749
min         0.00000       0.00000       0.00000      -0.00000      -0.00000      -0.00000
25%         0.84514       0.84316       0.66648       0.41216       0.41551       0.35270
50%         6.18582       5.66907       5.53967       6.92213       6.89836       6.86076
75%        30.01979      29.97153      30.91424      35.77941      36.38768      38.03924
max    147228.52641  150003.56196  149183.18542  141240.73898  149411.05769  156714.00890

Xanthos Results before this PR:

>>> df.iloc[:, [1, 13, 25, -36, -24, -12]].describe()
             197101        197201        197301        199901        200001        200101
count  6.742000e+04  6.742000e+04  6.742000e+04  6.742000e+04  6.742000e+04  6.742000e+04
mean   5.557357e-19  5.548854e-19  5.741850e-19  5.754548e-19  5.804242e-19  6.268520e-19
std    7.117042e-18  7.450842e-18  7.414989e-18  7.012134e-18  6.892747e-18  7.822258e-18
min    0.000000e+00  0.000000e+00  0.000000e+00 -9.200004e-36 -7.137215e-36 -1.071584e-35
25%    1.430781e-21  1.404657e-21  1.132767e-21  8.022964e-22  8.092583e-22  7.786710e-22
50%    1.236531e-20  1.112597e-20  1.082201e-20  1.354047e-20  1.356525e-20  1.320985e-20
75%    6.604950e-20  6.598999e-20  6.867512e-20  7.986689e-20  8.120102e-20  8.470828e-20
max    4.548449e-16  4.633732e-16  4.608717e-16  4.362932e-16  4.615147e-16  4.840954e-16

Xanthos Results after this PR:

>>> df = pd.read_csv('pm_abcd_mrtm_watch_1971_2001_hydro/avgchflow_m3persec_pm_abcd_mrtm_watch_1971_2001_hydro.csv')
>>> df.iloc[:, [1, 13, 25, -36, -24, -12]].describe().apply(lambda x:round(x, 5))
             197101        197201        197301        199901        200001        200101
count   67420.00000   67420.00000   67420.00000   67420.00000   67420.00000   67420.00000
mean      207.86002     201.88028     208.67325     215.35572     216.90523     233.22524
std      2339.27596    2433.84554    2428.30375    2308.48215    2268.91642    2570.07730
min         0.00000       0.00000       0.00000      -0.00000      -0.00000      -0.00000
25%         0.84362       0.84098       0.66587       0.40926       0.41488       0.35130
50%         6.17303       5.65463       5.53106       6.90901       6.88752       6.84717
75%        29.91619      29.85484      30.86446      35.70523      36.30114      37.94253
max    147183.28292  149942.94207  149133.48635  141180.13522  149341.55101  156648.45958
crvernon commented 5 years ago

@calebbraun can you also address the reason for CI failure? Likely due to the testing dataset for average channel flow now being different.