Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mekong usecase #14

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
0b30cb4
mekong usecase
casadoj Dec 15, 2022
f9554b9
Update README.md
casadoj Dec 15, 2022
89dc3cb
Update README.md
casadoj Dec 15, 2022
799d313
Update README.md
casadoj Dec 15, 2022
64dd2c1
Edit README Mekong use case
casadoj Jun 30, 2024
c23afc5
Revision notebook 0 General setup
casadoj Jun 30, 2024
7de7258
Update config file of the book
casadoj Jun 30, 2024
0dae436
Add results of the initialization run
casadoj Jun 30, 2024
39c40a2
Revision notebook 1 Initialization run
casadoj Jun 30, 2024
9c7c363
Revision notebook 2 Warmup Run
casadoj Jun 30, 2024
e028ddb
Results warmup run
casadoj Jun 30, 2024
494016e
Add link in notebook 1 Initializaiton
casadoj Jun 30, 2024
1d6693d
Revision of chapter 3 Run
casadoj Jul 2, 2024
651ea08
Revision chapter 4 Following Steps
casadoj Jul 2, 2024
2c1813e
Upadte the README of the Mekong usecase
casadoj Jul 2, 2024
9ac07a7
Update README.md
casadoj Jul 2, 2024
15856cb
Add chapter 5 with other use cases
casadoj Jul 2, 2024
d5eead8
Update .gitignore
casadoj Jul 2, 2024
936b94e
Update Table of Contents of the book
casadoj Jul 2, 2024
d9c5599
Add updated Mekong model
casadoj Jul 2, 2024
d0a79cb
Update notebooks to the new model
casadoj Jul 2, 2024
563633e
Add NetCDF files of water indices
casadoj Jul 3, 2024
30f8a75
Update MD files of the book
casadoj Jul 3, 2024
55c9a08
Update the settings file of the Po use case to run on the latest LISF…
casadoj Jul 4, 2024
f30ff4e
Create "docs" folder to publish the GitHub pages
casadoj Jul 18, 2024
75b55aa
Reorganize docs
casadoj Jul 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@

# User-specific stuff
.idea/

# ignore checkpoints
*checkpoint.md
*checkpoint.yml
*checkpoint.ipynb
*checkpoint.py
81 changes: 48 additions & 33 deletions LF_ETRS89_UseCase/settings_ETRS89-PreRun.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,22 +126,22 @@ The option "numberParallelThreadsKinematicWave" may take the following values:
- "2", "3", ... : manual setting of the number of parallel threads.
(if exceeding the number of CPUs, the option is set to "0") -->
<textvar name="numCPUs_parallelKinematicWave" value="0"/>

<comment>
**************************************************************
PARALLELISATION WITH NUMBA (USED IN SOILLOOP)
**************************************************************
</comment>

!-- Parallelisation of using Numba runtime compiled library .
The option "numCPUs_parallelNumba" may take the following values:
- "0" : set to NUMBA_NUM_THREADS Environment Variable
- "0" : set to NUMBA_NUM_THREADS Environment Variable
(if NUMBA_NUM_THREADS is not set, will take the number of CPU cores determined by python's multiprocessing.cpu_count())
- "1" : serial execution (not parallel)
- "2", "3", ... : manual setting of the number of parallel threads.
(if exceeding NUMBA_NUM_THREADS, the value is set to NUMBA_NUM_THREADS) -->
<textvar name="numCPUs_parallelNumba" value="0"/>

<comment>
**************************************************************
AREA AND OUTLETS
Expand Down Expand Up @@ -651,7 +651,7 @@ The option "numberParallelThreadsKinematicWave" may take the following values:
-9999 sets initial value to steady-state level
</comment>
</textvar>

<textvar name="LakePrevInflowValue" value="-9999">
<comment>
Lake inflow at previous routing sub-step (ChanQ(t-1)) [m3/s]
Expand Down Expand Up @@ -1039,18 +1039,18 @@ The option "numberParallelThreadsKinematicWave" may take the following values:
More than the transpiration is added e.g to prevent salinisation
</comment>
</textvar>
<textvar name="IrrigationWaterReUseM3" value="0.0">
<comment>
Annual amount (m3) of treated wastewater reused for irrigation
</comment>

<textvar name="IrrigationWaterReUseM3" value="0.0">
<comment>
Annual amount (m3) of treated wastewater reused for irrigation
</comment>
</textvar>
<textvar name="IrrigationWaterReUseNumDays" value="143">
<comment>
Number of days over which the annual amount of treated wastewater for irrigation is used
</comment>
</textvar>

<textvar name="IrrigationWaterReUseNumDays" value="143">
<comment>
Number of days over which the annual amount of treated wastewater for irrigation is used
</comment>
</textvar>

<textvar name="LivestockConsumptiveUseFraction" value="0.15">
<comment>
Expand Down Expand Up @@ -1528,7 +1528,7 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT
Clone map
</comment>
</textvar>

<textvar name="NetCDFTimeChunks" value="auto">
<comment>
Chunking in time dimension used when reading NetCDF forcings (or other NetCDF temporal inputs).
Expand All @@ -1537,13 +1537,28 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT
"-1": load the whole time series in memory (fastest option but memory consuming)
</comment>
</textvar>

<textvar name="MapsCaching" value="False">
<comment>
Option designed for the calibration. All the static maps and forcings will be stored in a cache so that they don't have to be loaded by each lisflood instance.
Option designed for the calibration. All the static maps and forcings will be stored in a cache so that they don't have to be loaded by each lisflood instance.
This option sets the value of NetCDFTimeChunks to -1, meaning that the whole time series in the NetCDF inputs is loaded into memory.
</comment>
</textvar>
</comment>
</textvar>

<textvar name="OutputMapsChunks" value="1">
<comment>
The option "OutputMapsChunks" may take the following values:
- "[positive integer number]" : Dump outputs to disk every X steps (default 1)
</comment>
</textvar>

<textvar name="OutputMapsDataType" value="float64">
<comment>
The option "OutputMapsDataType" sets the output data type and may take the following values:
- "float64"
- "float32"
</comment>
</textvar>

<textvar name="netCDFtemplate" value="$(netCDFtemplate)">
<comment>
Expand Down Expand Up @@ -2489,18 +2504,18 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT
More than the transpiration is added e.g to prevent salinisation
</comment>
</textvar>
<textvar name="IrrigationWaterReUseM3" value="$(IrrigationWaterReUseM3)">
<comment>
Annual amount (m3) of treated wastewater reused for irrigation
</comment>

<textvar name="IrrigationWaterReUseM3" value="$(IrrigationWaterReUseM3)">
<comment>
Annual amount (m3) of treated wastewater reused for irrigation
</comment>
</textvar>
<textvar name="IrrigationWaterReUseNumDays" value="$(IrrigationWaterReUseNumDays)">

<textvar name="IrrigationWaterReUseNumDays" value="$(IrrigationWaterReUseNumDays)">
<comment>
Number of days over which the annual amount of treated wastewater for irrigation is used
</comment>
</textvar>
Number of days over which the annual amount of treated wastewater for irrigation is used
</comment>
</textvar>

<textvar name="MapIrrigationCropCoef" value="$(MapIrrigationCropCoef)">
<comment>
Expand Down Expand Up @@ -3686,12 +3701,12 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT
Soil moisture lower layer [cu mm / cu mm]
</comment>
</textvar>

<textvar name="Theta3TS" value="$(PathOut)/th2.tss">
<comment>
Soil moisture lower layer [cu mm / cu mm]
</comment>
</textvar>
</textvar>

<textvar name="UZTS" value="$(PathOut)/uz.tss">
<comment>
Expand Down
95 changes: 55 additions & 40 deletions LF_ETRS89_UseCase/settings_ETRS89-Run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,22 +127,22 @@ The option "numberParallelThreadsKinematicWave" may take the following values:
- "2", "3", ... : manual setting of the number of parallel threads.
(if exceeding the number of CPUs, the option is set to "0") -->
<textvar name="numCPUs_parallelKinematicWave" value="0"/>

<comment>
**************************************************************
PARALLELISATION WITH NUMBA (USED IN SOILLOOP)
**************************************************************
</comment>

!-- Parallelisation of using Numba runtime compiled library .
The option "numCPUs_parallelNumba" may take the following values:
- "0" : set to NUMBA_NUM_THREADS Environment Variable
- "0" : set to NUMBA_NUM_THREADS Environment Variable
(if NUMBA_NUM_THREADS is not set, will take the number of CPU cores determined by python's multiprocessing.cpu_count())
- "1" : serial execution (not parallel)
- "2", "3", ... : manual setting of the number of parallel threads.
(if exceeding NUMBA_NUM_THREADS, the value is set to NUMBA_NUM_THREADS) -->
<textvar name="numCPUs_parallelNumba" value="0"/>

<comment>
**************************************************************
AREA AND OUTLETS
Expand Down Expand Up @@ -206,7 +206,7 @@ The option "numberParallelThreadsKinematicWave" may take the following values:
<textvar name="proj4_params" value="+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +units=m +no_defs">
</textvar>


<comment>
**************************************************************
TIME-RELATED CONSTANTS
Expand Down Expand Up @@ -682,7 +682,7 @@ The option "numberParallelThreadsKinematicWave" may take the following values:
-9999 sets initial value to steady-state level
</comment>
</textvar>

<textvar name="LakePrevInflowValue" value="-9999">
<comment>
Lake inflow at previous routing sub-step (ChanQ(t-1)) [m3/s]
Expand Down Expand Up @@ -1074,17 +1074,17 @@ The option "numberParallelThreadsKinematicWave" may take the following values:
</comment>
</textvar>

<textvar name="IrrigationWaterReUseM3" value="0.0">
<comment>
Annual amount (m3) of treated wastewater reused for irrigation
</comment>
<textvar name="IrrigationWaterReUseM3" value="0.0">
<comment>
Annual amount (m3) of treated wastewater reused for irrigation
</comment>
</textvar>

<textvar name="IrrigationWaterReUseNumDays" value="143">
<comment>
Number of days over which the annual amount of treated wastewater for irrigation is used
</comment>
</textvar>
<textvar name="IrrigationWaterReUseNumDays" value="143">
<comment>
Number of days over which the annual amount of treated wastewater for irrigation is used
</comment>
</textvar>

<textvar name="LivestockConsumptiveUseFraction" value="0.15">
<comment>
Expand Down Expand Up @@ -1562,7 +1562,7 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT
Clone map
</comment>
</textvar>

<textvar name="NetCDFTimeChunks" value="auto">
<comment>
Chunking in time dimension used when reading NetCDF forcings (or other NetCDF temporal inputs).
Expand All @@ -1571,14 +1571,29 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT
"-1": load the whole time series in memory (fastest option but memory consuming)
</comment>
</textvar>

<textvar name="MapsCaching" value="False">
<comment>
Option designed for the calibration. All the static maps and forcings will be stored in a cache so that they don't have to be loaded by each lisflood instance.
Option designed for the calibration. All the static maps and forcings will be stored in a cache so that they don't have to be loaded by each lisflood instance.
This option sets the value of NetCDFTimeChunks to -1, meaning that the whole time series in the NetCDF inputs is loaded into memory.
</comment>
</textvar>

</comment>
</textvar>

<textvar name="OutputMapsChunks" value="1">
<comment>
The option "OutputMapsChunks" may take the following values:
- "[positive integer number]" : Dump outputs to disk every X steps (default 1)
</comment>
</textvar>

<textvar name="OutputMapsDataType" value="float64">
<comment>
The option "OutputMapsDataType" sets the output data type and may take the following values:
- "float64"
- "float32"
</comment>
</textvar>

<textvar name="netCDFtemplate" value="$(netCDFtemplate)">
<comment>
netcdf template used to copy metadata information for writing netcdf
Expand Down Expand Up @@ -2501,30 +2516,30 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT
More than the transpiration is added e.g to prevent salinisation
</comment>
</textvar>
<textvar name="IrrigationWaterReUseM3" value="$(IrrigationWaterReUseM3)">
<comment>
Annual amount (m3) of treated wastewater reused for irrigation
</comment>

<textvar name="IrrigationWaterReUseM3" value="$(IrrigationWaterReUseM3)">
<comment>
Annual amount (m3) of treated wastewater reused for irrigation
</comment>
</textvar>
<textvar name="IrrigationWaterReUseNumDays" value="$(IrrigationWaterReUseNumDays)">

<textvar name="IrrigationWaterReUseNumDays" value="$(IrrigationWaterReUseNumDays)">
<comment>
Number of days over which the annual amount of treated wastewater for irrigation is used
</comment>
</textvar>
Number of days over which the annual amount of treated wastewater for irrigation is used
</comment>
</textvar>

<textvar name="IrrigationWaterReUseM3" value="$(IrrigationWaterReUseM3)">
<comment>
Annual amount (m3) of treated wastewater reused for irrigation
</comment>
<textvar name="IrrigationWaterReUseM3" value="$(IrrigationWaterReUseM3)">
<comment>
Annual amount (m3) of treated wastewater reused for irrigation
</comment>
</textvar>

<textvar name="IrrigationWaterReUseNumDays" value="$(IrrigationWaterReUseNumDays)">
<textvar name="IrrigationWaterReUseNumDays" value="$(IrrigationWaterReUseNumDays)">
<comment>
Number of days over which the annual amount of treated wastewater for irrigation is used
</comment>
</textvar>
Number of days over which the annual amount of treated wastewater for irrigation is used
</comment>
</textvar>

<textvar name="MapIrrigationCropCoef" value="$(MapIrrigationCropCoef)">
<comment>
Expand Down Expand Up @@ -5503,7 +5518,7 @@ LFBINDING: MORE LOW-LEVEL CONTROL OVER MODEL IN- AND OUTPUT
<textvar name="AreatotalIrrigationUseM3" value="$(PathOut)/ATIrgUse">
<comment>
AreatotalIrrigationUseM3
</comment>
</comment>
</textvar>

<textvar name="FractionAbstractedFromChannels" value="$(PathOut)/FrChan">
Expand Down
3 changes: 3 additions & 0 deletions LF_mekong_usecase/.ipynb_checkpoints/README-checkpoint.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Use case 3: the Nam Ngum river, Laos

As a third use case we will simulate the Nam Ngum river basin, a tributary of the Mekong River, for a period of 30 years. We provide both the basic data to run the model (input data, settings files, etc.) and a detailed explanation of how to build the model. This explanation is both in the shape of a Jupyter Book, or in the shape of Jupyter Notebooks, if you want to interact with the data on your own.
19 changes: 19 additions & 0 deletions LF_mekong_usecase/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Use case 3: the Nam Ngum river, Laos

As a third use case we will simulate the Nam Ngum river basin, a tributary of the Mekong River, for a period of 30 years. We provide both the basic data to run the model (input data, settings files, etc.) and a detailed explanation of how to build the model.

## Model

In this folder you can find all the necessary data you need to run the LISFLOOD model of this catchment, i.e., the static maps, the meteorological forcings and the settings files.

> **Important**. You need to unzip the [meteorological forcings](https://github.com/ec-jrc/lisflood-usecases/tree/mekong_usecase/LF_mekong_usecase/model/meteo) and the [population maps](https://github.com/ec-jrc/lisflood-usecases/tree/mekong_usecase/LF_mekong_usecase/model/maps/water_use/pop_daily.zip)

To run the model you need to have LISFLOOD installed in a Conda environment on **Linux** (support is not provided for Windows or macOS users). Follow this [instructions to install LISFLOOD](https://github.com/ec-jrc/lisflood-code).


## Tutorial

We provide a detailed explanation of how to build the model, we explained the necessary input data, how to change the settings file and we visualize and comment on the results. You can follow this tutorial in two flavours:

* A Jupyter [Book](https://ec-jrc.github.io/lisflood-usecases/), which is a simple and clean way of reading the tutorial.
* [Jupyter Notebooks](https://github.com/ec-jrc/lisflood-usecases/tree/mekong_usecase/LF_mekong_usecase/docs/notebooks) that allow you to interact with the tutorial, explore the inputs and outputs, edit, etc.
Loading