diff --git a/in/parameters.json b/in/parameters.json index 8206839..9085ee5 100644 --- a/in/parameters.json +++ b/in/parameters.json @@ -1,103 +1,11 @@ { - "make_geometry": { - "xh": [1.000000, 1.526316, 2.052632, 2.578947, 3.105263, 3.631579, 4.157895, 4.684211, 5.210526, 5.736842, 6.263158, 6.789474, 7.315789, 7.842105, 8.368421, 8.894737, 9.421053, 9.947368, 10.473684, 11.000000], - "yh": [2, 2.31578947368421, 2.63157894736842, 2.94736842105263, 3.26315789473684, 3.57894736842105, 3.89473684210526, 4.21052631578947, 4.52631578947368, 4.84210526315789, 5.15789473684211, 5.47368421052632, 5.78947368421053, 6.10526315789474, 6.42105263157895, 6.73684210526316, 7.05263157894737, 7.36842105263158, 7.68421052631579, 8], - "zh": [8, 7.93799037087873, 7.85250472327737, 7.7258147867945, 7.55028053799672, 7.33022074461027, 7.08085558055934, 6.82458019656734, 6.58548160620157, 6.38344134488803, 6.22926777664632, 6.12204982962276, 6.04938005825495, 5.9903924186702, 5.92087100395428, 5.81917894272337, 5.67155585985099, 5.47548689620891, 5.24031843389046, 4.98496977590764], - "bh": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], - "tot.area": 12, - "dyy": 2, - "xsi": [0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1], - "eta": [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1], - "htyp": 1 - }, - "write_facmat": { - "geometry": "./in/make_geometry_out/geom.Rds", - "write_soilhyd_ini": true, - "write_soil_types": true, - "fac": "./in/fac.dat" - }, - "write_precip": { - "raindat": "./in/raindat.csv", - "start.time": "01.01.2004 00:00:00", - "time.unit": "h", - "faktor.p": 1 - }, - "write_climate": { - "climadat": "./in/climadat.csv", - "start.time": "01.01.2004 00:00:00", - "time.unit": "h", - "rBilart": 1, - "ref.height": 8, - "sw0": -6, - "sw1": 0.7, - "sw2": 2.8e-4, - "trueb": 1.5, - "truebf": 0.1, - "NA.flag": -999 - }, - "write_printout": { - "start.time": "01.01.2004 00:00:00", - "end.time": "03.01.2004 00:00:00", - "intervall": 0.5, - "time.unit": "h", - "flag": 1 - }, - "write_surface_pob": { - "geometry": "./in/make_geometry_out/geom.Rds", - "lu": 33, - "precid": 1, - "climid": 1, - "windid": [1, 1, 1, 1] - }, - "write_control": { - "start.date": "01.01.2004 00:00:00.00", - "end.date": "03.01.2004 00:00:00", - "geo.file": "geometry.geo" - }, - "complete_file_structure": { - }, - "make_geometry_representative_hillslope": { - "flow_accumulation": "./in/geoprocessing/flow_accumulation.tif", - "basin": "./in/geoprocessing/basin.tif", - "elevation2river": "./in/geoprocessing/elev2riv.tif", - "distance2river": "./in/geoprocessing/dist2riv.tif", - "dem": "./in/geoprocessing/dem.tif", - "aspect": "./in/geoprocessing/aspect.tif", - "river_id": "./in/geoprocessing/river_id.tif" - }, - "preprocess_catflow": { - "flow_accumulation": "./in/geoprocessing/flow_accumulation.tif", - "basin": "./in/geoprocessing/basin.tif", - "elevation2river": "./in/geoprocessing/elev2riv.tif", - "distance2river": "./in/geoprocessing/dist2riv.tif", - "dem": "./in/geoprocessing/dem.tif", - "aspect": "./in/geoprocessing/aspect.tif", - "river_id": "./in/geoprocessing/river_id.tif", - "raindat": "./in/raindat.csv", - "start.time": "01.01.2004 00:00:00", - "time.unit": "h", - "faktor.p": 1, - "climadat": "./in/climadat.csv", - "rBilart": 1, - "ref.height": 8, - "sw0": -6, - "sw1": 0.7, - "sw2": 2.8e-4, - "trueb": 1.5, - "truebf": 0.1, - "NA.flag": -999, - "end.time": "03.01.2004 00:00:00", - "intervall": 0.5, - "flag": 1, - "lu": 33, - "precid": 1, - "climid": 1, - "windid": [1, 1, 1, 1] - }, - "timeseries_to_catflow_precip": { - "raindat": "./in/raindat.csv", - "start.time": "01.01.2004 00:00:00", - "time.unit": "h", - "faktor.p": 1 - } + "make_representative_hillslope": { + "parameters":{ + "hillslope_id" : -1, + "no_flow_area" : 0.30, + "min_cells:" : 10, + "hill_type" : 'constant', + "depth:" : 2.1 + } + } } \ No newline at end of file diff --git a/src/catlib.R b/src/catlib.R index b364e1c..2a5f98b 100644 --- a/src/catlib.R +++ b/src/catlib.R @@ -76,6 +76,15 @@ make_geometry_representative_hillslope <- function(params,data_paths) { # assign homogenous width to hill object hill$short_rep_hill$short_width_corr <- rep(c(w), length(hill$short_rep_hill$short_dist)) # Width + # Assign values to x based on the value of params$hill_type + if (params$hill_type == "constant") { + htyp <- 1 + } else if (params$hill_type == "cake") { + htyp <- 2 + } else if (params$hill_type == "variable") { + htyp <- 3 + } + # slope.list as input for make_geometry topo <- list( xh = hill$short_rep_hill$east, # East @@ -84,7 +93,7 @@ make_geometry_representative_hillslope <- function(params,data_paths) { bh = hill$short_rep_hill$short_width_corr, # Width dist = hill$short_rep_hill$short_dist, tot.area = hill$area, # Area - htyp = params$hill_type, # Hillslope type + htyp = htyp, # Hillslope type dyy = params$depth, # Thickness of profile [m] average of drillings 2.1 m xsi = seq(0, 1, length = max(hill$short_rep_hill$short_dist) + 1), # in order to get every 1m a node length of hillslope + 1 # discretitation eta = c(seq(0,0.625,length=6),seq(0.7,0.85, length=3),seq(0.875,1, length=6)), # eta starts at the bottom, upper 50 cm, dx=10cm, 50-400cm dx=25 cm