Skip to content

Latest commit

 

History

History
160 lines (112 loc) · 4.96 KB

File metadata and controls

160 lines (112 loc) · 4.96 KB

Run order

All commands below use WSL paths.

1. Put raw data in place

Follow data_raw/README.md exactly. In particular, the complete river shapefile sidecar set must remain together and landcover/esri_sentinel2_lulc_mapping.csv must be present. BWDB station locations must be defined in observations/discharge_stations.csv; SW273 is the main outlet and all other rows are treated as internal gauges.

2. Prepare forcing

conda activate hydromt
python /mnt/e/wflow/sylhet_model/prepare_forcing.py

Expected files:

  • /mnt/e/wflow/sylhet_model/data_processed/forcing/sylhet_precip.nc
  • /mnt/e/wflow/sylhet_model/data_processed/forcing/sylhet_tmean.nc
  • /mnt/e/wflow/sylhet_model/data_processed/forcing/sylhet_pet.nc

3. Prepare hydrography

Place all eight Google Earth Engine exports of MERIT/Hydro/v1_0_1 in:

/mnt/e/wflow/sylhet_model/data_raw/hydrography/merit_hydro_3sec/

Required names are sylhet_3sec_elv.tif, sylhet_3sec_dir.tif, sylhet_3sec_wth.tif, sylhet_3sec_wat.tif, sylhet_3sec_upa.tif, sylhet_3sec_upg.tif, sylhet_3sec_hnd.tif and sylhet_3sec_viswth.tif.

python /mnt/e/wflow/sylhet_model/prepare_hydrography.py

Expected file:

  • /mnt/e/wflow/sylhet_model/data_processed/hydrography/hydrography_3sec.nc

The script uses the MERIT flow direction directly and preserves all eight source bands with provenance and units. It uses the finite elevation footprint to correct GEE's ambiguous integer zeros outside the basin. It does not use or process meghna_dem_90m.tif and does not create a replacement flow direction from a DEM.

NetCDF source-band mapping and NoData values:

NetCDF variable MERIT band Units NoData Use
elevtn elv m -9999 HydroMT elevation
flwdir dir 1 247 HydroMT D8 direction
rivwth wth m -9999 Channel-centerline width
water_mask wat 1 255 Land/permanent-water diagnostic
uparea upa km2 -9999 HydroMT upstream area
upstream_pixel_count upg pixel -1 Flow-accumulation diagnostic
hand hnd m -9999 Height above nearest drainage
visualization_width viswth m -9999 Display only

basins, strord, and lndslp are derived helper variables. River slope is not invented here; HydroMT derives it from elevation and flow paths in setup_rivers.

4. Prepare static datasets

If the global depth-to-bedrock file is available:

python /mnt/e/wflow/sylhet_model/prepare_sylhet_static_data.py all

If it is still downloading, prepare everything else first:

python /mnt/e/wflow/sylhet_model/prepare_sylhet_static_data.py boundary gauges river landcover mapping lai

Then, after the depth-to-bedrock raster is present:

python /mnt/e/wflow/sylhet_model/prepare_sylhet_static_data.py soil_thickness soil

Soil thickness is required by setup_soilmaps; it is not skipped in the final model.

The land-cover step preserves the Esri 1--11 class values. It fails if cloud class 10 occurs within the basin, and the mapping step copies the matching Esri-to-Wflow lookup table.

The gauge task creates:

  • /mnt/e/wflow/sylhet_model/data_processed/observations/discharge_gauges.gpkg
  • /mnt/e/wflow/sylhet_model/data_processed/observations/discharge_gauge_mapping.csv

5. Validate all processed inputs

python /mnt/e/wflow/sylhet_model/validate_sylhet_inputs.py processed

Continue only when the last line says VALIDATION PASSED.

6. Build a clean model

First build:

python /mnt/e/wflow/sylhet_model/build_sylhet_model.py

Rebuild after changing data or configuration:

python /mnt/e/wflow/sylhet_model/build_sylhet_model.py --overwrite

The overwrite option archives the previous model under /mnt/e/wflow/sylhet_model/backup.

The build delineates the upstream basin from BWDB SW273 at Bhairab Bazar and will fail unless the generated static maps contain exactly one outlet near the station, all processed gauges snap to unique river cells, SW273 coincides with the outlet, and no required Wflow parameter values are missing.

7. Run the 2020--2024 verification

cd /mnt/e/wflow/sylhet_model/model
julia -t 4 -e 'using Wflow; Wflow.run()' /mnt/e/wflow/sylhet_model/model/wflow_sbm.toml

Check:

  • /mnt/e/wflow/sylhet_model/model/run_default/log.txt
  • /mnt/e/wflow/sylhet_model/model/run_default/output/output.nc
  • /mnt/e/wflow/sylhet_model/model/run_default/output/discharge_gauges.csv
  • /mnt/e/wflow/sylhet_model/model/gauge_output_mapping.csv

The discharge CSV contains time followed by 29 station-named columns. The first discharge column is SW273_Bhairab_Bazar; the remaining 28 columns are internal gauges.

8. Run 2000–2024

After the 2020--2024 verification succeeds, edit /mnt/e/wflow/sylhet_model/wflow_build_sylhet.yml:

time.starttime: "2000-01-01T00:00:00"

Then rebuild with --overwrite and rerun Julia. Expect a much larger forcing.nc and longer preparation/run time.