VFlood
English version
Project Layout

11. Project layout (for extending it)

src/VFlood-RRI/
├── config.py         RRI_Input.txt reader + writer
├── grid.py           DEM/raster I/O, geodesic dx/dy
├── channel.py        river geometry (auto / explicit file / cross-section)
├── indexing.py       active-cell compaction + neighbor tables
├── section.py        rating-curve cross-sections
├── boundary.py       water-level / discharge boundary conditions
├── dam.py            dam/reservoir operation
├── diversion.py      channel diversion
├── rainfall.py       rain.dat reading + grid remapping
├── integrator.py     RKF45 adaptive time-stepping
├── kernels/          the actual physics (slope, river, exchange, infiltration, groundwater, ET)
├── engine.py         ties it all together into the time loop
├── io_output.py      output file writers/readers (.out grids, storage.dat)
├── viz.py            GeoTIFF / PNG / KML export + hillshade/GIF animation
├── geo_import.py     GeoTIFF (GEE/HEC-GeoHMS) -> ascii-grid / rain.dat import
├── dem_terrain.py    local DEM -> flow-direction/accumulation (pysheds), for DEMNAS/BATNAS
├── rain_netcdf_import.py   gridded satellite rainfall NetCDF (CHIRPS/GSMaP/IMERG) -> rain.dat
├── vrain_import.py   VRain's own CSV/manifest output -> Thiessen-weighted rain.dat
├── grid_align.py     resample any georeferenced grid onto a target grid (DEM as anchor)
├── project_scaffold.py   DEM + rainfall (+ land use) -> ready-to-run project, one call
├── gee_codegen.py    generates GEE Code Editor .js scripts
├── basin_atlas.py     Indonesian catchment (DAS) lookup -> buffered bbox, from a sibling
│                       project's (basin-atlas) own static JSON index
├── disaster_events.py  major flood event lookup -> buffered event_start/end, from a
│                       second sibling project's (disasterLab) own compiled BNPB DIBI JSON
├── vfloodprep_gui.py   VFloodPrep: Tkinter GUI over gee_codegen/project_scaffold/
│                       basin_atlas/disaster_events
├── netcdf_export.py  bundles simulation output into one NetCDF file
├── atlas_plot.py     basin-atlas-style NetCDF plotting
├── postprocess.py    zonal stats, Moran's I, point/hydrograph extraction + ACF
├── analyze_plot.py   charts (matplotlib) from vflood-analyze's CSV outputs
├── velocity.py        derived velocity (m/s) + vector field from qu/qv/qr/hr/hs
├── validate.py        pre-run project checks (grid alignment, rain overlap, file existence, ...)
├── gui_common.py       shared Tk widgets (LogPanel, file/dir pickers, the basin-atlas
│                       catchment picker, the disasterLab flood-event picker) for every *_gui.py
├── vcontrol_gui.py     VFloodControl: orchestrates the whole pipeline -- embeds VFloodPrep,
│                       calls validate.py/cli.run_project, launches export/netcdf/analyze
│                       as subprocesses once output is ready
├── cli.py            `vflood-rri` command (run a simulation) + run_project(), the shared
│                      run implementation vcontrol_gui.py's Run button also calls
├── export_cli.py     `vflood-export` command (post-process .out files to GIS formats)
├── import_cli.py     `vflood-import` command
├── gee_cli.py        `vflood-gee` command
├── netcdf_cli.py     `vflood-netcdf` command
└── postprocess_cli.py   `vflood-analyze` command
                     (vfloodprep_gui.py/vcontrol_gui.py's own `vflood-prep`/`vflood-control`
                      entry points are defined inside those modules themselves, not a
                      separate _cli.py each, since neither has argparse flags to speak of --
                      they just open a window)

reference/rri-1.4.2.7-source/ holds the original Fortran source this was ported from — when in doubt about what a formula should do, that's the ground truth to check against, not this manual.