This repository provides a streamlined pipeline for driving the CaMa-Flood (v4.2.0+) hydrodynamic model using global runoff data from the VIC model.
- CaMa-Flood: Compiled and installed (e.g.,
MAIN_cmfexecutable is ready). - Python 3: With
xarray,pandas,numpy, andnetCDF4installed. - VIC Runoff Data: NetCDF files (e.g., 0.25° resolution) covering the simulation period.
CaMa-Flood requires daily runoff forcing in plain binary (float32) format. The convert_nc_to_bin.py script reorders the longitude from [0, 360] to [-180, 180] and extracts daily layers.
Batch process all files:
# Run this in the directory containing your VIC .nc files
for f in *.nc; do
python3 convert_nc_to_bin.py -d . -n "$f"
doneNote: This creates a runoff/ subdirectory with files named Roff____YYYYMMDD.one.
The shell script VIC_global_sim_0p25_1960-2024.sh automates the multi-year simulation.
- Update Paths: Open the script and modify the following variables:
CURRDIR: Path to your script directory.BASE: Path to your CaMa-Flood installation root.CROFDIR: Path to the converted binary runoff files.FMAP: Path to your CaMa-Flood river map (e.g.,glb_noAntarctica_15min).
- Set Time Range: Adjust
YSTA(1960) andYEND(2024) if necessary. - Run:
bash VIC_global_sim_0p25_1960-2024.sh
- Runoff Units:
- VIC runoff in NetCDF is often stored as
mm/day(ormm/step), but metadata might sometimes saym/day. - The pipeline currently assumes input is
mm/dayand usesDROFUNIT = 86400000to convert tom/s. - Verification: If your results are off by a factor of 1000, check if your input is actually
m/day. If so, setDROFUNIT = 86400.
- VIC runoff in NetCDF is often stored as
- Longitude Order: The conversion script automatically rolls the longitude to center at 0° (Greenwich), matching CaMa-Flood's standard map orientation.
- VIC Runoff Metadata: See
dim_info_of_VIC_runoff_nc.txtfor the expected NetCDF structure.
Some comparisons between the simulations and the GRDC observations in Southeast Asia are made. The results can be found @results_visualization/.