diff --git a/docs/changelog.rst b/docs/changelog.rst index d82ff627..35e0a014 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -20,6 +20,8 @@ Added - better support for WflowModel states with new methods: **read_states**, **write_states** and **clip_states**. PR #252 - new function **setup_cold_states** to prepare cold states for WflowModel. PR #252 - new utils method **get_grid_from_config** to get the right wflow staticmaps variable based on the TOML configuration (e.g. detects name in netcdf, value, scale and offset). Only applied now to prepare cold states (e.g. not yet in read_grid). PR #252 +- Added support for the "GLCNMO" land-use dataset, with a default parameter mapping table (similar to the existing tables). PR #272 +- Added the `alpha_h1` parameter (based on land use maps). This parameter represents whether root water uptake reduction at soil water pressure head h1 occurs or not. By default, it is set to 0.0 for all "non-natural" vegetation (crops) and to 1.0 for all "natural vegetation" PR #272 Changed ------- diff --git a/examples/linux64/wflow_piave_clip/staticmaps.nc b/examples/linux64/wflow_piave_clip/staticmaps.nc index c04951a6..79e524ee 100644 Binary files a/examples/linux64/wflow_piave_clip/staticmaps.nc and b/examples/linux64/wflow_piave_clip/staticmaps.nc differ diff --git a/examples/linux64/wflow_piave_clip/wflow_sbm.toml b/examples/linux64/wflow_piave_clip/wflow_sbm.toml index 0c615ac6..8b90f558 100644 --- a/examples/linux64/wflow_piave_clip/wflow_sbm.toml +++ b/examples/linux64/wflow_piave_clip/wflow_sbm.toml @@ -65,6 +65,7 @@ canopystorage = "canopystorage" glacierstore = "glacierstore" [input.vertical] +alpha_h1 = "alpha_h1" altitude = "wflow_dem" c = "c" cf_soil = "cf_soil" diff --git a/examples/linux64/wflow_piave_subbasin/staticmaps.nc b/examples/linux64/wflow_piave_subbasin/staticmaps.nc index b5fa7b86..514b4bf4 100644 Binary files a/examples/linux64/wflow_piave_subbasin/staticmaps.nc and b/examples/linux64/wflow_piave_subbasin/staticmaps.nc differ diff --git a/examples/linux64/wflow_piave_subbasin/wflow_sbm.toml b/examples/linux64/wflow_piave_subbasin/wflow_sbm.toml index 73aba1d1..74d658f6 100644 --- a/examples/linux64/wflow_piave_subbasin/wflow_sbm.toml +++ b/examples/linux64/wflow_piave_subbasin/wflow_sbm.toml @@ -65,6 +65,7 @@ canopystorage = "canopystorage" glacierstore = "glacierstore" [input.vertical] +alpha_h1 = "alpha_h1" altitude = "wflow_dem" c = "c" cf_soil = "cf_soil" diff --git a/examples/linux64/wflow_sediment_piave_subbasin/staticmaps.nc b/examples/linux64/wflow_sediment_piave_subbasin/staticmaps.nc index f3b9d3b7..3d378d7a 100644 Binary files a/examples/linux64/wflow_sediment_piave_subbasin/staticmaps.nc and b/examples/linux64/wflow_sediment_piave_subbasin/staticmaps.nc differ diff --git a/examples/wflow_piave_clip/staticmaps.nc b/examples/wflow_piave_clip/staticmaps.nc index 46a1e6e4..ccb69299 100644 Binary files a/examples/wflow_piave_clip/staticmaps.nc and b/examples/wflow_piave_clip/staticmaps.nc differ diff --git a/examples/wflow_piave_clip/wflow_sbm.toml b/examples/wflow_piave_clip/wflow_sbm.toml index 0c615ac6..8b90f558 100644 --- a/examples/wflow_piave_clip/wflow_sbm.toml +++ b/examples/wflow_piave_clip/wflow_sbm.toml @@ -65,6 +65,7 @@ canopystorage = "canopystorage" glacierstore = "glacierstore" [input.vertical] +alpha_h1 = "alpha_h1" altitude = "wflow_dem" c = "c" cf_soil = "cf_soil" diff --git a/examples/wflow_piave_subbasin/staticmaps.nc b/examples/wflow_piave_subbasin/staticmaps.nc index 9365dc5b..4d97e6b6 100644 Binary files a/examples/wflow_piave_subbasin/staticmaps.nc and b/examples/wflow_piave_subbasin/staticmaps.nc differ diff --git a/examples/wflow_piave_subbasin/wflow_sbm.toml b/examples/wflow_piave_subbasin/wflow_sbm.toml index 73aba1d1..74d658f6 100644 --- a/examples/wflow_piave_subbasin/wflow_sbm.toml +++ b/examples/wflow_piave_subbasin/wflow_sbm.toml @@ -65,6 +65,7 @@ canopystorage = "canopystorage" glacierstore = "glacierstore" [input.vertical] +alpha_h1 = "alpha_h1" altitude = "wflow_dem" c = "c" cf_soil = "cf_soil" diff --git a/examples/wflow_sediment_piave_subbasin/staticmaps.nc b/examples/wflow_sediment_piave_subbasin/staticmaps.nc index f3b9d3b7..4a1cfcb2 100644 Binary files a/examples/wflow_sediment_piave_subbasin/staticmaps.nc and b/examples/wflow_sediment_piave_subbasin/staticmaps.nc differ diff --git a/hydromt_wflow/data/lulc/corine_mapping.csv b/hydromt_wflow/data/lulc/corine_mapping.csv index 0caca5d4..9fa2f10c 100644 --- a/hydromt_wflow/data/lulc/corine_mapping.csv +++ b/hydromt_wflow/data/lulc/corine_mapping.csv @@ -1,46 +1,46 @@ -corine,description,landuse,Kext,N,PathFrac,RootingDepth,Sl,Swood,WaterFrac -111,Continuous urban fabric,111,0.60,0.011,0.90,256.4,0.040,0.00,0.00 -112,Discontinuous urban fabric,112,0.60,0.011,0.75,256.4,0.040,0.01,0.00 -121,Industrial or commercial units and public facilities,121,0.60,0.011,1.00,0.0,0.040,0.00,0.00 -122,Road and rail networks and associated land,122,0.60,0.011,0.50,106.8,0.040,0.01,0.00 -123,Port areas,123,0.60,0.011,0.50,0.0,0.000,0.00,0.00 -124,Airports,124,0.60,0.011,0.50,106.8,0.040,0.01,0.00 -131,Mineral extraction sites,131,0.60,0.011,0.00,0.0,0.000,0.00,0.00 -132,Dump sites,132,0.60,0.011,0.50,0.0,0.000,0.00,0.00 -133,Construction sites,133,0.60,0.011,0.50,0.0,0.040,0.00,0.00 -141,Green urban areas,141,0.60,0.150,0.50,256.4,0.040,0.05,0.00 -142,Sport and leisure facilities,142,0.60,0.150,0.10,106.8,0.040,0.01,0.00 -211,Non-irrigated arable land,211,0.60,0.200,0.00,390.4,0.127,0.00,0.00 -212,Permanently irrigated arable land,212,0.60,0.200,0.00,248.6,0.127,0.00,0.00 -213,Rice fields,213,0.60,0.200,0.00,106.8,0.127,0.00,0.00 -221,Vineyards,221,0.70,0.500,0.00,432.4,0.070,0.20,0.00 -222,Fruit tree and berry plantations,222,0.70,0.500,0.00,429.8,0.070,0.20,0.00 -223,Olive groves,223,0.70,0.500,0.00,432.4,0.070,0.20,0.00 -231,Pastures meadows and other permanent grasslands under agricultural use,231,0.60,0.150,0.00,106.8,0.127,0.01,0.00 -241,Annual crops associated with permanent crops,241,0.60,0.200,0.00,390.4,0.127,0.00,0.00 -242,Complex cultivation patterns,242,0.60,0.200,0.00,390.4,0.127,0.00,0.00 -243,Land principally occupied by agriculture with significant areas of natural vegetation,243,0.60,0.440,0.00,284.3,0.127,0.00,0.00 -244,Agro-forestry areas,244,0.80,0.500,0.00,406.0,0.039,0.50,0.00 -311,Broad-leaved forest,311,0.80,0.600,0.00,429.8,0.036,0.50,0.00 -312,Coniferous forest,312,0.80,0.400,0.00,382.1,0.045,0.50,0.00 -313,Mixed forest,313,0.80,0.500,0.00,406.0,0.039,0.50,0.00 -321,Natural grassland,321,0.60,0.150,0.00,106.8,0.127,0.01,0.00 -322,Moors and heathland,322,0.60,0.240,0.00,178.2,0.090,0.05,0.00 -323,Sclerophyllous vegetation,323,0.70,0.500,0.00,432.4,0.070,0.10,0.00 -324,Transitional woodland/shrub,324,0.70,0.500,0.00,432.4,0.070,0.10,0.00 -331,Beaches dunes and sand plains,331,0.60,0.150,0.00,106.8,0.040,0.00,0.00 -332,Bare rock,332,0.60,0.010,1.00,0.0,0.000,0.00,0.00 -333,Sparsely vegetated areas,333,0.60,0.020,0.00,136.9,0.040,0.04,0.00 -334,Burnt areas,334,0.60,0.020,0.00,0.0,0.040,0.04,0.00 -335,Glaciers and perpetual snow,335,0.60,0.010,0.00,0.0,0.000,0.00,0.00 -411,Inland marshes,411,0.70,0.150,0.00,106.8,0.127,0.01,0.50 -412,Peatbogs,412,0.60,0.150,0.00,136.9,0.127,0.00,0.50 -421,Coastal salt marshes,421,0.70,0.150,0.00,106.8,0.127,0.01,0.50 -422,Salines,422,0.70,0.075,0.00,53.4,0.127,0.01,0.50 -423,Intertidal flats,423,0.70,0.075,0.00,53.4,0.127,0.01,0.50 -511,Water courses,511,0.70,0.010,0.00,0.0,0.000,0.00,1.00 -512,Water bodies,512,0.70,0.010,0.00,0.0,0.000,0.00,1.00 -521,Coastal lagoons,521,0.70,0.150,0.00,106.8,0.127,0.01,0.50 -522,Estuaries,522,0.70,0.150,0.00,106.8,0.000,0.01,0.50 -523,Sea and ocean,523,0.70,0.010,0.00,0.0,0.000,0.00,1.00 -999,No data,999,-999.00,-999.000,-999.00,-999.0,-999.000,-999.00,-999.00 +corine,description,landuse,Kext,N,PathFrac,RootingDepth,Sl,Swood,WaterFrac,alpha_h1 +111,Continuous urban fabric,111,0.6,0.011,0.9,256.4,0.04,0,0,1 +112,Discontinuous urban fabric,112,0.6,0.011,0.75,256.4,0.04,0.01,0,1 +121,Industrial or commercial units and public facilities,121,0.6,0.011,1,0,0.04,0,0,1 +122,Road and rail networks and associated land,122,0.6,0.011,0.5,106.8,0.04,0.01,0,1 +123,Port areas,123,0.6,0.011,0.5,0,0,0,0,1 +124,Airports,124,0.6,0.011,0.5,106.8,0.04,0.01,0,1 +131,Mineral extraction sites,131,0.6,0.011,0,0,0,0,0,1 +132,Dump sites,132,0.6,0.011,0.5,0,0,0,0,1 +133,Construction sites,133,0.6,0.011,0.5,0,0.04,0,0,1 +141,Green urban areas,141,0.6,0.15,0.5,256.4,0.04,0.05,0,1 +142,Sport and leisure facilities,142,0.6,0.15,0.1,106.8,0.04,0.01,0,1 +211,Non-irrigated arable land,211,0.6,0.2,0,390.4,0.127,0,0,0 +212,Permanently irrigated arable land,212,0.6,0.2,0,248.6,0.127,0,0,0 +213,Rice fields,213,0.6,0.2,0,106.8,0.127,0,0,0 +221,Vineyards,221,0.7,0.5,0,432.4,0.07,0.2,0,0 +222,Fruit tree and berry plantations,222,0.7,0.5,0,429.8,0.07,0.2,0,0 +223,Olive groves,223,0.7,0.5,0,432.4,0.07,0.2,0,0 +231,Pastures meadows and other permanent grasslands under agricultural use,231,0.6,0.15,0,106.8,0.127,0.01,0,1 +241,Annual crops associated with permanent crops,241,0.6,0.2,0,390.4,0.127,0,0,0 +242,Complex cultivation patterns,242,0.6,0.2,0,390.4,0.127,0,0,0 +243,Land principally occupied by agriculture with significant areas of natural vegetation,243,0.6,0.44,0,284.3,0.127,0,0,1 +244,Agro-forestry areas,244,0.8,0.5,0,406,0.039,0.5,0,1 +311,Broad-leaved forest,311,0.8,0.6,0,429.8,0.036,0.5,0,1 +312,Coniferous forest,312,0.8,0.4,0,382.1,0.045,0.5,0,1 +313,Mixed forest,313,0.8,0.5,0,406,0.039,0.5,0,1 +321,Natural grassland,321,0.6,0.15,0,106.8,0.127,0.01,0,1 +322,Moors and heathland,322,0.6,0.24,0,178.2,0.09,0.05,0,1 +323,Sclerophyllous vegetation,323,0.7,0.5,0,432.4,0.07,0.1,0,1 +324,Transitional woodland/shrub,324,0.7,0.5,0,432.4,0.07,0.1,0,1 +331,Beaches dunes and sand plains,331,0.6,0.15,0,106.8,0.04,0,0,1 +332,Bare rock,332,0.6,0.01,1,0,0,0,0,1 +333,Sparsely vegetated areas,333,0.6,0.02,0,136.9,0.04,0.04,0,1 +334,Burnt areas,334,0.6,0.02,0,0,0.04,0.04,0,1 +335,Glaciers and perpetual snow,335,0.6,0.01,0,0,0,0,0,1 +411,Inland marshes,411,0.7,0.15,0,106.8,0.127,0.01,0.5,1 +412,Peatbogs,412,0.6,0.15,0,136.9,0.127,0,0.5,1 +421,Coastal salt marshes,421,0.7,0.15,0,106.8,0.127,0.01,0.5,1 +422,Salines,422,0.7,0.075,0,53.4,0.127,0.01,0.5,1 +423,Intertidal flats,423,0.7,0.075,0,53.4,0.127,0.01,0.5,1 +511,Water courses,511,0.7,0.01,0,0,0,0,1,1 +512,Water bodies,512,0.7,0.01,0,0,0,0,1,1 +521,Coastal lagoons,521,0.7,0.15,0,106.8,0.127,0.01,0.5,1 +522,Estuaries,522,0.7,0.15,0,106.8,0,0.01,0.5,1 +523,Sea and ocean,523,0.7,0.01,0,0,0,0,1,1 +999,No data,999,-999,-999,-999,-999,-999,-999,-999,-999 diff --git a/hydromt_wflow/data/lulc/esa_worldcover_mapping.csv b/hydromt_wflow/data/lulc/esa_worldcover_mapping.csv index aecde59b..490a9b07 100644 --- a/hydromt_wflow/data/lulc/esa_worldcover_mapping.csv +++ b/hydromt_wflow/data/lulc/esa_worldcover_mapping.csv @@ -1,13 +1,13 @@ -esa,description,landuse,Kext,N,PathFrac,RootingDepth,Sl,Swood,WaterFrac,USLE_C,Cov_River -10,Tree cover,10,0.8,0.5,0,369,0.0477,0.5,0,0.0069,12.3 -20,Shrubland,20,0.07,0.5,0,410,0.07,0.1,0,0.05,1.97 -30,Grasland,30,0.6,0.15,0,106.8,0.1272,0,0,0.045,1.97 -40,Cropland,40,0.6,0.2,0,390.4,0.1272,0,0,0.3,1.97 -50,Built-up,50,0.7,0.011,0.9,257.4,0.04,0.01,0,0,1 -60,Bare / sparse vegetation,60,0.6,0.02,0,10.7,0.04,0.04,0,0.25,1.97 -70,Snow and Ice,70,0.6,0.01,0,0,0,0,0,0,1 -80,Permanent water bodies,80,0.7,0.01,0,0,0,0,1,0,1 -90,Herbaceous wetland,90,0.6,0.15,0,106.8,0.1272,0,0,0.05,1.97 -95,Mangroves,95,0.8,0.5,0,369,0.0477,0.5,0.5,0.0069,12.3 -100,Moss and lichen,100,0.6,0.085,0,136.9,0.04,0,0,0.04,1.97 -0,No data,0,-999,-999,-999,-999,-999,-999,-999,-999,-999 +esa,description,landuse,Kext,N,PathFrac,RootingDepth,Sl,Swood,WaterFrac,alpha_h1,USLE_C,Cov_River +10,Tree cover,10,0.8,0.5,0,369,0.0477,0.5,0,1,0.0069,12.3 +20,Shrubland,20,0.07,0.5,0,410,0.07,0.1,0,1,0.05,1.97 +30,Grasland,30,0.6,0.15,0,106.8,0.1272,0,0,1,0.045,1.97 +40,Cropland,40,0.6,0.2,0,390.4,0.1272,0,0,0,0.3,1.97 +50,Built-up,50,0.7,0.011,0.9,257.4,0.04,0.01,0,1,0,1 +60,Bare / sparse vegetation,60,0.6,0.02,0,10.7,0.04,0.04,0,1,0.25,1.97 +70,Snow and Ice,70,0.6,0.01,0,0,0,0,0,1,0,1 +80,Permanent water bodies,80,0.7,0.01,0,0,0,0,1,1,0,1 +90,Herbaceous wetland,90,0.6,0.15,0,106.8,0.1272,0,0,1,0.05,1.97 +95,Mangroves,95,0.8,0.5,0,369,0.0477,0.5,0.5,1,0.0069,12.3 +100,Moss and lichen,100,0.6,0.085,0,136.9,0.04,0,0,1,0.04,1.97 +0,No data,0,-999,-999,-999,-999,-999,-999,-999,-999,-999,-999 diff --git a/hydromt_wflow/data/lulc/glcnmo_mapping.csv b/hydromt_wflow/data/lulc/glcnmo_mapping.csv new file mode 100644 index 00000000..2b0359fb --- /dev/null +++ b/hydromt_wflow/data/lulc/glcnmo_mapping.csv @@ -0,0 +1,22 @@ +glcnmo,description,landuse,Kext,N,PathFrac,RootingDepth,Sl,Swood,WaterFrac,alpha_h1,USLE_C,Cov_River +1,Broadleaf Evergreen Forest,1,0.8,0.6,0,294.1,0.036,0.5,0,1,0.0065,19.2 +2,Broadleaf Deciduous Forest,2,0.8,0.6,0,429.8,0.036,0.5,0,1,0.001,19.2 +3,Needleleaf Evergreen Forest,3,0.8,0.4,0,382.2,0.045,0.5,0,1,0.001,19.2 +4,Needleleaf Deciduous Forest,4,0.8,0.4,0,215.3,0.045,0.5,0,1,0.001,19.2 +5,Mixed Forest,5,0.8,0.5,0,406,0.0393,0.5,0,1,0.0065,19.2 +6,Tree open,6,0.8,0.5,0,408,0.0553,0.5,0,1,0.01,5.4 +7,Shrub,7,0.07,0.5,0,410,0.07,0.1,0,1,0.05,1.97 +8,Herbaceous,8,0.6,0.15,0,106.8,0.1272,0,0,1,0.045,1.97 +9,Herbaceous with sparse tree/shrub,9,0.6,0.15,0,106.8,0.1272,0,0,1,0.045,1.97 +10,Sparse vegetation,10,0.6,0.02,0,10.7,0.04,0.04,0,1,0.25,1.97 +11,Cropland,11,0.6,0.2,0,390.4,0.1272,0,0,0,0.3,1.97 +12,Paddy field,12,0.6,0.2,0,106.8,0.127,0,0,0,0.05,1.97 +13,Cropland / Other Vegetation Mosaic,14,0.6,0.44,0,397,0.127,0.01,0,0,0.27,1.97 +14,Mangrove,14,0.8,0.5,0,369,0.0477,0.5,0.5,1,0.0069,12.3 +15,Wetland,15,0.6,0.15,0,106.8,0.1272,0,0,1,0.05,1.97 +16,Bare area consolidated(gravel/rock),16,0.6,0.01,0,0,0.04,0,0,1,0,1 +17,Bare area unconsolidated (sand),17,0.6,0.01,0,0,0.04,0,0,1,0,1 +18,Urban,18,0.6,0.011,0.75,179,0.04,0.01,0,1,0,1 +19,Snow / Ice,19,0.6,0.01,0,0,0,0,0,1,0,1 +20,Water bodies,20,0.7,0.01,0,0,0,0,1,1,0,1 +0,No data,0,-999,-999,-999,-999,-999,-999,-999,-999,-999,-999 diff --git a/hydromt_wflow/data/lulc/globcover_mapping.csv b/hydromt_wflow/data/lulc/globcover_mapping.csv index 71857829..968cc4c2 100644 --- a/hydromt_wflow/data/lulc/globcover_mapping.csv +++ b/hydromt_wflow/data/lulc/globcover_mapping.csv @@ -1,24 +1,24 @@ -globcover,description,landuse,Kext,N,PathFrac,RootingDepth,Sl,Swood,WaterFrac,USLE_C,Cov_River -11,Post-flooding or irrigated croplands (or aquatic),11,0.6,0.2,0.0,390.0,0.127,0.01,0.0,0.2,0.97 -14,Rainfed croplands,14,0.6,0.2,0.0,390.0,0.127,0.0,0.0,0.35,1.97 -20,Mosaic cropland (50-70%) / vegetation (grassland/shrubland/forest) (20-50%),20,0.6,0.44,0.0,397.0,0.127,0.01,0.0,0.27,1.97 -30,"Mosaic vegetation (grassland/shrubland/forest) (50-70%) / cropland (20-50%) ",30,0.6,0.56,0.0,400.0,0.127,0.01,0.0,0.25,1.97 -40,Closed to open (>15%) broadleaved evergreen or semi-deciduous forest (>5m),40,0.6,0.3,0.0,308.0,0.039,0.5,0.0,0.0065,5.40 -50,Closed (>40%) broadleaved deciduous forest (>5m),50,0.8,0.8,0.0,430.0,0.036,0.5,0.0,0.001,19.20 -60,Open (15-40%) broadleaved deciduous forest/woodland (>5m),60,0.8,0.4,0.0,430.0,0.036,0.5,0.0,0.01,5.40 -70,Closed (>40%) needleleaved evergreen forest (>5m),70,0.8,0.1,0.0,382.0,0.045,0.5,0.0,0.001,19.20 -90,Open (15-40%) needleleaved deciduous or evergreen forest (>5m),90,0.8,0.4,0.0,382.0,0.045,0.5,0.0,0.01,5.40 -100,Mosaic forest or shrubland (50-70%) / grassland (20-50%),100,0.8,0.3,0.0,406.0,0.039,0.5,0.0,0.02,5.40 -110,Mosaic forest or shrubland (50-70%) / grassland (20-50%),110,0.6,0.456,0.0,286.0,0.07,0.2,0.0,0.015,5.40 -120,"Mosaic grassland (50-70%) / forest or shrubland (20-50%) ",120,0.6,0.5,0.0,179.0,0.127,0.05,0.0,0.03,1.97 -130,Closed to open (>15%) (broadleaved or needleleaved evergreen or deciduous) shrubland (<5m),130,0.6,0.5,0.0,432.0,0.07,0.1,0.0,0.035,1.97 -140,Closed to open (>15%) herbaceous vegetation (grassland savannas or lichens/mosses),140,0.6,0.24,0.0,457.0,0.09,0.0,0.0,0.05,1.97 -150,Closed to open (>15%) herbaceous vegetation (grassland savannas or lichens/mosses),150,0.6,0.02,0.0,137.0,0.04,0.04,0.0,0.35,1.97 -160,Closed to open (>15%) broadleaved forest regularly flooded (semi-permanently or temporarily) - Fresh or brackish water,160,0.6,0.3,0.0,308.0,0.04,0.1,0.0,0.001,5.40 -170,Closed (>40%) broadleaved forest or shrubland permanently flooded - Saline or brackish water,170,0.8,0.8,0.0,308.0,0.036,0.2,0.0,0.0005,19.20 -180,Closed to open (>15%) grassland or woody vegetation on regularly flooded or waterlogged soil - Fresh brackish or saline water,180,0.6,0.15,0.0,107.0,0.127,0.01,0.0,0.04,1.97 -190,Artificial surfaces and associated areas (Urban areas >50%),190,0.6,0.011,0.75,179.0,0.04,0.01,0.0,0.0,1.0 -200,Bare areas,200,0.6,0.01,0.0,0.0,0.04,0.0,0.0,0.0,1.0 -210,Water bodies,210,0.7,0.08,0.0,0.0,0.04,0.0,1.0,0.0,1.0 -220,Permanent snow and ice,220,0.6,0.01,0.0,0.0,0.04,0.0,0.0,0.0,1.0 -230,No Data,230,-999.0,-999.0,-999.0,-999.0,-999.0,-999.0,-999.0,-999.0,-999.0 +globcover,description,landuse,Kext,N,PathFrac,RootingDepth,Sl,Swood,WaterFrac,alpha_h1,USLE_C,Cov_River +11,Post-flooding or irrigated croplands (or aquatic),11,0.6,0.2,0,390,0.127,0.01,0,0,0.2,0.97 +14,Rainfed croplands,14,0.6,0.2,0,390,0.127,0,0,0,0.35,1.97 +20,Mosaic cropland (50-70%) / vegetation (grassland/shrubland/forest) (20-50%),20,0.6,0.44,0,397,0.127,0.01,0,0,0.27,1.97 +30,Mosaic vegetation (grassland/shrubland/forest) (50-70%) / cropland (20-50%) ,30,0.6,0.56,0,400,0.127,0.01,0,1,0.25,1.97 +40,Closed to open (>15%) broadleaved evergreen or semi-deciduous forest (>5m),40,0.6,0.3,0,308,0.039,0.5,0,1,0.0065,5.4 +50,Closed (>40%) broadleaved deciduous forest (>5m),50,0.8,0.8,0,430,0.036,0.5,0,1,0.001,19.2 +60,Open (15-40%) broadleaved deciduous forest/woodland (>5m),60,0.8,0.4,0,430,0.036,0.5,0,1,0.01,5.4 +70,Closed (>40%) needleleaved evergreen forest (>5m),70,0.8,0.1,0,382,0.045,0.5,0,1,0.001,19.2 +90,Open (15-40%) needleleaved deciduous or evergreen forest (>5m),90,0.8,0.4,0,382,0.045,0.5,0,1,0.01,5.4 +100,Mosaic forest or shrubland (50-70%) / grassland (20-50%),100,0.8,0.3,0,406,0.039,0.5,0,1,0.02,5.4 +110,Mosaic forest or shrubland (50-70%) / grassland (20-50%),110,0.6,0.456,0,286,0.07,0.2,0,1,0.015,5.4 +120,Mosaic grassland (50-70%) / forest or shrubland (20-50%) ,120,0.6,0.5,0,179,0.127,0.05,0,1,0.03,1.97 +130,Closed to open (>15%) (broadleaved or needleleaved evergreen or deciduous) shrubland (<5m),130,0.6,0.5,0,432,0.07,0.1,0,1,0.035,1.97 +140,Closed to open (>15%) herbaceous vegetation (grassland savannas or lichens/mosses),140,0.6,0.24,0,457,0.09,0,0,1,0.05,1.97 +150,Closed to open (>15%) herbaceous vegetation (grassland savannas or lichens/mosses),150,0.6,0.02,0,137,0.04,0.04,0,1,0.35,1.97 +160,Closed to open (>15%) broadleaved forest regularly flooded (semi-permanently or temporarily) - Fresh or brackish water,160,0.6,0.3,0,308,0.04,0.1,0,1,0.001,5.4 +170,Closed (>40%) broadleaved forest or shrubland permanently flooded - Saline or brackish water,170,0.8,0.8,0,308,0.036,0.2,0,1,0.0005,19.2 +180,Closed to open (>15%) grassland or woody vegetation on regularly flooded or waterlogged soil - Fresh brackish or saline water,180,0.6,0.15,0,107,0.127,0.01,0,1,0.04,1.97 +190,Artificial surfaces and associated areas (Urban areas >50%),190,0.6,0.011,0.75,179,0.04,0.01,0,1,0,1 +200,Bare areas,200,0.6,0.01,0,0,0.04,0,0,1,0,1 +210,Water bodies,210,0.7,0.08,0,0,0.04,0,1,1,0,1 +220,Permanent snow and ice,220,0.6,0.01,0,0,0.04,0,0,1,0,1 +230,No Data,230,-999,-999,-999,-999,-999,-999,-999,-999,-999,-999 diff --git a/hydromt_wflow/data/lulc/vito_mapping.csv b/hydromt_wflow/data/lulc/vito_mapping.csv index b2edf877..3e00c0cd 100644 --- a/hydromt_wflow/data/lulc/vito_mapping.csv +++ b/hydromt_wflow/data/lulc/vito_mapping.csv @@ -1,24 +1,24 @@ -vito,description,landuse,Kext,N,PathFrac,RootingDepth,Sl,Swood,WaterFrac,USLE_C,Cov_River -20,Shrubs,20,0.07,0.5,0.0,410,0.07,0.1,0.0,0.05,1.97 -30,Herbaceous vegetation,30,0.6,0.15,0.0,106.8,0.1272,0.0,0.0,0.045,1.97 -40,Cultivated and managed vegetation/agriculture (cropland),40,0.6,0.2,0.0,390.4,0.1272,0.0,0.0,0.3,1.97 -50,Urban / built up,50,0.7,0.011,0.9,257.4,0.04,0.01,0.0,0.0,1 -60,Bare / sparse vegetation,60,0.6,0.02,0.0,10.7,0.04,0.04,0.0,0.25,1.97 -70,Snow and Ice,70,0.6,0.01,0.0,0.0,0.0,0.0,0.0,0.0,1 -80,Permanent water bodies,80,0.7,0.01,0.0,0.0,0.0,0.0,1.0,0.0,1 -90,Herbaceous wetland,90,0.6,0.15,0.0,106.8,0.1272,0.0,0.0,0.05,1.97 -100,Moss and lichen,100,0.6,0.085,0.0,136.9,0.04,0.0,0.0,0.04,1.97 -111,Closed forest evergreen needle leaf,111,0.8,0.4,0.0,382.2,0.045,0.5,0.0,0.001,19.2 -112,Closed forest evergreen broad leaf,112,0.8,0.6,0.0,294.1,0.036,0.5,0.0,0.0065,19.2 -113,Closed forest deciduous needle leaf,113,0.8,0.4,0.0,215.3,0.045,0.5,0.0,0.001,19.2 -114,Closed forest deciduous broad leaf,114,0.8,0.6,0.0,429.8,0.036,0.5,0.0,0.001,19.2 -115,Closed forest mixed,115,0.8,0.5,0.0,406,0.0393,0.5,0.0,0.0065,19.2 -116,Closed forest unknown,116,0.8,0.5,0.0,406,0.0393,0.5,0.0,0.0065,19.2 -121,Open forest evergreen needle leaf,121,0.8,0.45,0.0,396.1,0.0575,0.5,0.0,0.01,5.4 -122,Open forest evergreen broad leaf,122,0.8,0.55,0.0,352,0.053,0.5,0.0,0.01,5.4 -123,Open forest deciduous needle leaf,123,0.8,0.45,0.0,312.6,0.0575,0.5,0.0,0.01,5.4 -124,Open forest deciduous broad leaf,124,0.8,0.55,0.0,419.9,0.053,0.5,0.0,0.01,5.4 -125,Open forest mixed,125,0.8,0.5,0.0,408,0.0553,0.5,0.0,0.01,5.4 -126,Open forest unknown,126,0.8,0.5,0.0,408,0.0553,0.5,0.0,0.01,5.4 -200,Open sea,200,0.7,0.01,0.0,0.0,0.0,0.0,1.0,0.0,1 -0,No data,0.0,-999.0,-999.0,-999.0,-999.0,-999.0,-999.0,-999.0,-999.0,-999.0 +vito,description,landuse,Kext,N,PathFrac,RootingDepth,Sl,Swood,WaterFrac,alpha_h1,USLE_C,Cov_River +20,Shrubs,20,0.07,0.5,0,410,0.07,0.1,0,1,0.05,1.97 +30,Herbaceous vegetation,30,0.6,0.15,0,106.8,0.1272,0,0,1,0.045,1.97 +40,Cultivated and managed vegetation/agriculture (cropland),40,0.6,0.2,0,390.4,0.1272,0,0,0,0.3,1.97 +50,Urban / built up,50,0.7,0.011,0.9,257.4,0.04,0.01,0,1,0,1 +60,Bare / sparse vegetation,60,0.6,0.02,0,10.7,0.04,0.04,0,1,0.25,1.97 +70,Snow and Ice,70,0.6,0.01,0,0,0,0,0,1,0,1 +80,Permanent water bodies,80,0.7,0.01,0,0,0,0,1,1,0,1 +90,Herbaceous wetland,90,0.6,0.15,0,106.8,0.1272,0,0,1,0.05,1.97 +100,Moss and lichen,100,0.6,0.085,0,136.9,0.04,0,0,1,0.04,1.97 +111,Closed forest evergreen needle leaf,111,0.8,0.4,0,382.2,0.045,0.5,0,1,0.001,19.2 +112,Closed forest evergreen broad leaf,112,0.8,0.6,0,294.1,0.036,0.5,0,1,0.0065,19.2 +113,Closed forest deciduous needle leaf,113,0.8,0.4,0,215.3,0.045,0.5,0,1,0.001,19.2 +114,Closed forest deciduous broad leaf,114,0.8,0.6,0,429.8,0.036,0.5,0,1,0.001,19.2 +115,Closed forest mixed,115,0.8,0.5,0,406,0.0393,0.5,0,1,0.0065,19.2 +116,Closed forest unknown,116,0.8,0.5,0,406,0.0393,0.5,0,1,0.0065,19.2 +121,Open forest evergreen needle leaf,121,0.8,0.45,0,396.1,0.0575,0.5,0,1,0.01,5.4 +122,Open forest evergreen broad leaf,122,0.8,0.55,0,352,0.053,0.5,0,1,0.01,5.4 +123,Open forest deciduous needle leaf,123,0.8,0.45,0,312.6,0.0575,0.5,0,1,0.01,5.4 +124,Open forest deciduous broad leaf,124,0.8,0.55,0,419.9,0.053,0.5,0,1,0.01,5.4 +125,Open forest mixed,125,0.8,0.5,0,408,0.0553,0.5,0,1,0.01,5.4 +126,Open forest unknown,126,0.8,0.5,0,408,0.0553,0.5,0,1,0.01,5.4 +200,Open sea,200,0.7,0.01,0,0,0,0,1,1,0,1 +0,No data,0,-999,-999,-999,-999,-999,-999,-999,-999,-999,-999 diff --git a/hydromt_wflow/data/parameters_data.yml b/hydromt_wflow/data/parameters_data.yml index 99231a74..53004431 100644 --- a/hydromt_wflow/data/parameters_data.yml +++ b/hydromt_wflow/data/parameters_data.yml @@ -1,7 +1,7 @@ corine_mapping_default: data_type: DataFrame driver: csv - kwargs: + driver_kwargs: index_col: 0 dtype: landuse: int16 @@ -12,6 +12,7 @@ corine_mapping_default: Sl: float32 Swood: float32 WaterFrac: float32 + alpha_h1: int16 USLE_C: float32 Cov_River: float32 meta: @@ -23,7 +24,7 @@ corine_mapping_default: esa_worldcover_mapping_default: data_type: DataFrame driver: csv - kwargs: + driver_kwargs: index_col: 0 dtype: landuse: int16 @@ -34,6 +35,7 @@ esa_worldcover_mapping_default: Sl: float32 Swood: float32 WaterFrac: float32 + alpha_h1: int16 USLE_C: float32 Cov_River: float32 meta: @@ -45,7 +47,7 @@ esa_worldcover_mapping_default: globcover_mapping_default: data_type: DataFrame driver: csv - kwargs: + driver_kwargs: index_col: 0 dtype: landuse: int16 @@ -56,6 +58,7 @@ globcover_mapping_default: Sl: float32 Swood: float32 WaterFrac: float32 + alpha_h1: int16 USLE_C: float32 Cov_River: float32 meta: @@ -67,7 +70,7 @@ globcover_mapping_default: vito_mapping_default: data_type: DataFrame driver: csv - kwargs: + driver_kwargs: index_col: 0 dtype: landuse: int16 @@ -78,6 +81,7 @@ vito_mapping_default: Sl: float32 Swood: float32 WaterFrac: float32 + alpha_h1: int16 USLE_C: float32 Cov_River: float32 meta: @@ -86,10 +90,33 @@ vito_mapping_default: source_version: 1.0 path: lulc/vito_mapping.csv +glcnmo_mapping_default: + data_type: DataFrame + driver: csv + driver_kwargs: + index_col: 0 + dtype: + landuse: int16 + Kext: float32 + N: float32 + PathFrac: float32 + RootingDepth: float32 + Sl: float32 + Swood: float32 + WaterFrac: float32 + alpha_h1: int16 + USLE_C: float32 + Cov_River: float32 + meta: + category: landuse + source_info: landuse parameters based on corine classification (https://land.copernicus.eu/pan-european/corine-land-cover/clc2018) + source_version: 1.0 + path: lulc/glcnmo_mapping.csv + koppen_geiger_mapping_default: data_type: DataFrame driver: csv - kwargs: + driver_kwargs: index_col: class meta: category: landuse @@ -100,7 +127,7 @@ koppen_geiger_mapping_default: regr_chelsa_mapping_default: data_type: DataFrame driver: csv - kwargs: + driver_kwargs: index_col: source meta: category: hydrography @@ -111,7 +138,7 @@ regr_chelsa_mapping_default: roughness_river_mapping_default: data_type: DataFrame driver: csv - kwargs: + driver_kwargs: index_col: 0 dtype: N_River: float32 @@ -124,7 +151,7 @@ roughness_river_mapping_default: riverbedsed_mapping_default: data_type: DataFrame driver: csv - kwargs: + driver_kwargs: index_col: 0 dtype: D50_River: float32 diff --git a/hydromt_wflow/wflow.py b/hydromt_wflow/wflow.py index 903d9575..e0d2b99e 100644 --- a/hydromt_wflow/wflow.py +++ b/hydromt_wflow/wflow.py @@ -867,27 +867,28 @@ def setup_lulcmaps( self, lulc_fn: Union[str, xr.DataArray], lulc_mapping_fn: Union[str, Path, pd.DataFrame] = None, - lulc_vars: List = [ - "landuse", - "Kext", - "N", - "PathFrac", - "RootingDepth", - "Sl", - "Swood", - "WaterFrac", - ], + lulc_vars: Dict = { + "landuse": None, + "Kext": "input.vertical.kext", + "N": "input.lateral.land.n", + "PathFrac": "input.vertical.pathfrac", + "RootingDepth": "input.vertical.rootingdepth", + "Sl": "input.vertical.specific_leaf", + "Swood": "input.vertical.storage_wood", + "WaterFrac": "input.vertical.waterfrac", + "alpha_h1": "input.vertical.alpha_h1", + }, ): """ Derive several wflow maps based on landuse-landcover (LULC) data. - Lookup table `lulc_mapping_fn` columns are converted to lulc classes - model parameters based on literature. The data is remapped at its original - resolution and then resampled to the model resolution using the average - value, unless noted differently. + Lookup table `lulc_mapping_fn` columns are converted to lulc classes model + parameters based on literature. The data is remapped at its original resolution + and then resampled to the model resolution using the average value, unless noted + differently. Currently, if `lulc_fn` is set to the "vito", "globcover", "esa_worldcover" - or "corine", default lookup tables are available and will be used if + "corine" or "glmnco", default lookup tables are available and will be used if `lulc_mapping_fn` is not provided. Adds model layers: @@ -900,20 +901,27 @@ def setup_lulcmaps( * **PathFrac** map: The fraction of compacted or urban area per grid cell [-] * **WaterFrac** map: The fraction of open water per grid cell [-] * **N** map: Manning Roughness [-] + * **alpha_h1** map: Root water uptake reduction at soil water pressure head h1 + (0 or 1) [-] Parameters ---------- lulc_fn : str, xarray.DataArray Name of RasterDataset source in data_sources.yml file. lulc_mapping_fn : str, Path, pd.DataFrame - Path to a mapping csv file from landuse in source name to - parameter values in lulc_vars. If lulc_fn is one of {"globcover", "vito", - "corine", "esa_worldcover"}, a default mapping is used and this argument + Path to a mapping csv file from landuse in source name to parameter values + in lulc_vars. If lulc_fn is one of {"globcover", "vito", "corine", + "esa_worldcover", "glmnco"}, a default mapping is used and this argument becomes optional. - lulc_vars : list - List of landuse parameters to keep. - By default \ -["landuse","Kext","N","PathFrac","RootingDepth","Sl","Swood","WaterFrac"] + lulc_vars : dict + Dictionary of landuse parameters in ``lulc_mapping_fn`` columns to prepare + and their internal wflow name (or None to skip adding to the toml). By + default \ +{"landuse": None, "Kext": "input.vertical.kext", "N": "input.lateral.land.n", + "PathFrac": "input.vertical.pathfrac", "RootingDepth": + "input.vertical.rootingdepth", "Sl": "input.vertical.specific_leaf", "Swood": + "input.vertical.storage_wood", "WaterFrac": "input.vertical.waterfrac", + "alpha_h1": "input.vertical.alpha_h1"} """ self.logger.info("Preparing LULC parameter maps.") if lulc_mapping_fn is None: @@ -934,12 +942,17 @@ def setup_lulcmaps( da=da, ds_like=self.grid, df=df_map, - params=lulc_vars, + params=list(lulc_vars.keys()), logger=self.logger, ) rmdict = {k: v for k, v in self._MAPS.items() if k in ds_lulc_maps.data_vars} self.set_grid(ds_lulc_maps.rename(rmdict)) + # Add entries to the config + for name, wflow_param in lulc_vars.items(): + if wflow_param is not None: + self.set_config(wflow_param, name) + def setup_laimaps(self, lai_fn: Union[str, xr.DataArray]): """ Set leaf area index (LAI) climatology maps per month [1,2,3,...,12]. diff --git a/hydromt_wflow/wflow_sediment.py b/hydromt_wflow/wflow_sediment.py index 0a643978..747a75e3 100644 --- a/hydromt_wflow/wflow_sediment.py +++ b/hydromt_wflow/wflow_sediment.py @@ -2,7 +2,7 @@ import logging from pathlib import Path -from typing import List, Optional, Union +from typing import Dict, List, Optional, Union import geopandas as gpd import numpy as np @@ -309,47 +309,41 @@ def setup_lulcmaps( lulc_fn: Union[str, Path, xr.DataArray], lulc_mapping_fn: Union[str, Path, pd.DataFrame] = None, planted_forest_fn: Union[str, Path, gpd.GeoDataFrame] = None, - lulc_vars: List[str] = [ - "landuse", - "Cov_River", - "Kext", - "N", - "PathFrac", - "Sl", - "Swood", - "USLE_C", - "WaterFrac", - ], + lulc_vars: Dict = { + "landuse": None, + "Kext": "input.vertical.kext", + "PathFrac": "input.vertical.pathfrac", + "Sl": "input.vertical.specific_leaf", + "Swood": "input.vertical.storage_wood", + "USLE_C": "input.vertical.usleC", + }, planted_forest_c: float = 0.0881, orchard_name: str = "Orchard", orchard_c: float = 0.2188, ): """Derive several wflow maps based on landuse-landcover (LULC) data. - Currently, ``lulc_fn`` can be set to the "vito", "globcover" - or "corine", fo which lookup tables are constructed to convert lulc classses to + Currently, ``lulc_fn`` can be set to the "vito", "globcover", "corine" or + "glmnco", of which lookup tables are constructed to convert lulc classses to model parameters based on literature. The data is remapped at its original - resolution and then resampled to the model resolution using the average - value, unless noted differently. + resolution and then resampled to the model resolution using the average value, + unless noted differently. The USLE C factor map can be refined for planted forests using the planted forest data source. The planted forest data source is a polygon layer with planted forest polygons and optionnally a column with the forest type to - identify orchards. The default value for orchards is 0.2188, the default - value for other planted forests is 0.0881. + identify orchards. The default value for orchards is 0.2188, the default value + for other planted forests is 0.0881. Adds model layers: * **landuse** map: Landuse class [-] Original source dependent LULC class, resampled using nearest neighbour. - * **Cov_river** map: vegetation coefficent reducing stream bank erosion [-]. * **Kext** map: Extinction coefficient in the canopy gap fraction equation [-] * **Sl** map: Specific leaf storage [mm] * **Swood** map: Fraction of wood in the vegetation/plant [-] * **USLE_C** map: Cover management factor from the USLE equation [-] * **PathFrac** map: The fraction of compacted or urban area per grid cell [-] - * **WaterFrac** map: The fraction of open water per grid cell [-] - * **N** map: Manning Roughness [-] Parameters ---------- @@ -363,10 +357,13 @@ def setup_lulcmaps( * Optional variable: ["forest_type"] - lulc_vars : list - List of landuse parameters to keep. - By default: \ -["landuse","Cov_river","Kext","N","PathFrac","USLE_C","Sl","Swood","WaterFrac"] + lulc_vars : dict + Dictionary of landuse parameters in ``lulc_mapping_fn`` columns to prepare + and their internal wflow name (or None to skip adding to the toml). By + default: \ +{"landuse": None, "Kext": "input.vertical.kext", "PathFrac": "input.vertical.pathfrac", + "Sl": "input.vertical.specific_leaf", "Swood": "input.vertical.storage_wood", + "USLE_C": "input.vertical.usleC"} planted_forest_c : float, optional Value of USLE C factor for planted forest, by default 0.0881. orchard_name : str, optional @@ -381,7 +378,7 @@ def setup_lulcmaps( ) # If available, improve USLE C map with planted forest data - if "USLE_C" in lulc_vars and planted_forest_fn is not None: + if "USLE_C" in list(lulc_vars.keys()) and planted_forest_fn is not None: # Add a USLE_C column with default value self.logger.info( "Correcting USLE_C with planted forest and orchards" diff --git a/hydromt_wflow/workflows/landuse.py b/hydromt_wflow/workflows/landuse.py index 70acc00b..3cbaf905 100644 --- a/hydromt_wflow/workflows/landuse.py +++ b/hydromt_wflow/workflows/landuse.py @@ -11,8 +11,8 @@ __all__ = ["landuse", "lai"] -RESAMPLING = {"landuse": "nearest", "lai": "average"} -DTYPES = {"landuse": np.int16} +RESAMPLING = {"landuse": "nearest", "lai": "average", "alpha_h1": "mode"} +DTYPES = {"landuse": np.int16, "alpha_h1": np.int16} # def landuse(da, ds_like, data_catalog, fn_map, logger=logger, params=None): diff --git a/tests/conftest.py b/tests/conftest.py index 0158c0ef..5001735b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -25,7 +25,12 @@ def example_wflow_model(): logger = logging.getLogger(__name__) root = join(EXAMPLEDIR, "wflow_piave_subbasin") - mod = WflowModel(root=root, mode="r", data_libs="artifact_data", logger=logger) + mod = WflowModel( + root=root, + mode="r", + data_libs=["artifact_data"], + logger=logger, + ) return mod @@ -34,7 +39,10 @@ def example_sediment_model(): logger = logging.getLogger(__name__) root = join(EXAMPLEDIR, "wflow_sediment_piave_subbasin") mod = WflowSedimentModel( - root=root, mode="r", data_libs="artifact_data", logger=logger + root=root, + mode="r", + data_libs=["artifact_data"], + logger=logger, ) return mod @@ -76,7 +84,11 @@ def example_wflow_results(): @pytest.fixture() def clipped_wflow_model(): root = join(EXAMPLEDIR, "wflow_piave_clip") - mod = WflowModel(root=root, mode="r", data_libs="artifact_data") + mod = WflowModel( + root=root, + mode="r", + data_libs=["artifact_data"], + ) return mod diff --git a/tests/test_model_methods.py b/tests/test_model_methods.py index af3f77e7..72fedbd1 100644 --- a/tests/test_model_methods.py +++ b/tests/test_model_methods.py @@ -775,7 +775,7 @@ def test_setup_lulc_sed(example_sediment_model, planted_forest_testdata): example_sediment_model.setup_lulcmaps( lulc_fn="globcover", planted_forest_fn=planted_forest_testdata, - lulc_vars=["USLE_C"], + lulc_vars={"USLE_C": "input.vertical.usleC"}, planted_forest_c=0.0881, orchard_name="Orchard", orchard_c=0.2188,