@@ -41,38 +41,35 @@ COMMON_FLAGS=(
4141)
4242
4343# ============================================================
44- # Loop: each instance × each weather folder
44+ # Loop: instance[i] paired with weather_folder[i]
4545# ============================================================
46- for instance in " ${INSTANCES[@]} " ; do
47- if [[ -z " $instance " ]]; then
48- echo " Skipping empty instance entry" >&2
46+ for i in " ${! INSTANCES[@]} " ; do
47+ instance=" ${INSTANCES[$i]} "
48+ weather_folder=" ${WEATHER_FOLDERS[$i]} "
49+
50+ if [[ -z " $instance " || -z " $weather_folder " ]]; then
51+ echo " Skipping empty entry at index $i " >&2
4952 continue
5053 fi
51- # Derive a short name from the TIF filename (no path, no extension)
52- instance_name=$( basename " $instance " .tif)
5354
54- for weather_folder in " ${WEATHER_FOLDERS[@]} " ; do
55- if [[ -z " $weather_folder " ]]; then
56- echo " Skipping empty weather folder entry" >&2
57- continue
58- fi
59- weather_name=$( basename " $weather_folder " )
55+ instance_name=$( basename " $instance " .tif)
56+ weather_name=$( basename " $weather_folder " )
6057
61- out_dir=" ${OUT_BASE} /${instance_name} /${weather_name} "
62- mkdir -p " $out_dir "
58+ out_dir=" ${OUT_BASE} /${instance_name} /${weather_name} "
59+ mkdir -p " $out_dir "
6360
64- echo " ============================================================"
65- echo " Instance : $instance_name "
66- echo " Weather : $weather_name "
67- echo " Output : $out_dir "
68- echo " ============================================================"
61+ echo " ============================================================"
62+ echo " Run $(( i+ 1 )) "
63+ echo " Instance : $instance_name "
64+ echo " Weather : $weather_name "
65+ echo " Output : $out_dir "
66+ echo " ============================================================"
6967
70- " $BINARY " \
71- --instance-tif " $instance " \
72- --weather-folder " $weather_folder " \
73- --output-folder " $out_dir " \
74- " ${COMMON_FLAGS[@]} "
68+ " $BINARY " \
69+ --instance-tif " $instance " \
70+ --weather-folder " $weather_folder " \
71+ --output-folder " $out_dir " \
72+ " ${COMMON_FLAGS[@]} "
7573
76- echo " "
77- done
74+ echo " "
7875done
0 commit comments