This repository contains a coupled ParFlow–Pywr model integrated with a multi-objective evolutionary algorithm (MOEA). It was developed as part of the DRAWIT project, which investigates how land use decisions—particularly the type and spatial distribution of land use—affect multiple performance criteria in catchment systems.
The scientific findings are published in the Journal of Hydrology:
📄 Multicriteria land cover design in multi-sector systems via coupled distributed land and water management models
Tomasz Janus, James Tomlinson, Daniela Anghileri, Justin Sheffield, Stefan Kollet, and Julien Harou.
Explore the results interactively via this Dash Application.
For development:
pip install -r requirements.txt -e .
To build and install the package:
pip install build .
Or:
python3 -m build --sdist --wheel .
-
ParFlow input is located in:
input_files/parflow/profile1/
It uses meteorological forcing fromnarr_1hr.wet.txt
, representing a semi-arid environment (provided by Prof. Stefan Kollet). -
Pywr model is stored in:
input_files/pywr/pywr-1-reservoir-model_profile1.json
Run from the project root:
. ./init_env_drawit.sh
⚠️ The script is currently configured for use on the developer's laptop only.
parflow-pywr run [input-json] -bo [output-h5-path] -to [output-csv-path]
Example:
parflow-pywr run pywr-1-reservoir-model_profile1.json -bo outputs1/test.h5 -to outputs1/test.csv
parflow-pywr plot -i [output-h5-path]
Example:
parflow-pywr plot -i outputs1/test.h5
parflow-pywr run pywr-1-reservoir-model_profile1.json -bo outputs_batch/test.h5 -to outputs_batch/test.csv
ℹ️ These commands rely on default CLI parameters—refer to the source code for customization.
parflow-pywr search [search-name] \
-h file://[mongo-directory] \
-d [json-output-dir] \
-w [parflow-work-dir] \
-ne [evaluations] \
-p [parallel-jobs] \
-ps [population-size] \
-i [input-json]
Example:
parflow-pywr search optim_1 \
-h file://optim_results \
-d optim_1 \
-w parflow_tmp_1 \
-ne 50000 -p 16 -ps 40 \
-i pywr-1-reservoir-model_profile1.json
parflow-pywr search [search-name] \
-h file://[mongo-directory] \
-d [json-output-dir] \
-w [parflow-work-dir] \
-a NSGAIII \
-ne [evaluations] \
-p [parallel-jobs] \
-i [input-json]
Example:
parflow-pywr search optim_1 \
-h file://optim_results \
-d optim_1 \
-w parflow_tmp_1 \
-a NSGAIII -ne 50000 -p 16 \
-i pywr-1-reservoir-model_profile1.json
Use mpirun
and add the --mpi
flag:
Example (on local machine):
mpirun -n 3 --oversubscribe parflow-pywr search optim_1 \
-h file://optim_results \
-d optim_1 \
-w parflow_tmp_1 \
--mpi -a NSGAII -ne 6 -p 3 -ps 2 \
-i pywr-1-reservoir-model_profile1.json
Copy the model files (profile
folders, .json
files, and .sh
scripts) to your ~/scratch
directory.
qrsh -l short -V -cwd ./job_interactive.sh
qsub job1.sh
parflow-pywr run-parflow-batch [config-json] [nondominated-csv]
Example:
parflow-pywr run-parflow-batch config_file_parflow_hydro.json parflow_metrics.csv
parflow-pywr read-parflow-results ./parflow_batch_jobs/ \
config_file_parflow_hydro.json -s 365 -f 730
parflow-pywr read-parflow-results ./parflow_batch_jobs/ \
config_file_parflow_hydro_2.json -s 365 -f 730 -r results_json2
- All commands assume the working directory is the project root.
- For best performance on clusters, ensure that input/output folders are on fast storage (
scratch
, RAM disk). - The ParFlow model may require MPI configuration depending on your platform.