#!/bin/bash # Wait for the wide-domain download+convert to finish, then build the per-fold # EOF PCs and re-submit the REAL EHD run WITH the PC features (--pcs). Fully # self-contained (nohup): survives session exit. Idempotent. set -e cd /home/tanpv/Progs/claude/HW_EC_10 PY=/home/tanpv/.conda/envs/ehd/bin/python TARGET=2080 # 104 inits x 20 years per wide group echo "==== PC watcher started $(date '+%F %T') ====" while true; do wp=$(find data/nc/wide_plev -name '*.nc' 2>/dev/null | wc -l) wo=$(find data/nc/wide_olr -name '*.nc' 2>/dev/null | wc -l) echo " $(date '+%F %T') wide_plev=$wp/$TARGET wide_olr=$wo/$TARGET" if [ "$wp" -ge "$TARGET" ] && [ "$wo" -ge "$TARGET" ]; then echo " wide data complete"; break fi sleep 600 done echo "==== [1/2] build per-fold wide EOF PCs $(date '+%F %T') ====" $PY -u src/build_wide_pcs.py --jobs 10 --out outputs/real/wide_pcs.npz echo "==== [2/2] submit REAL EHD + PCs $(date '+%F %T') ====" bash src/launch_ehd_full.sh \ --pred outputs/real/ec15_predictors.nc \ --txds outputs/downscale_real/pred/pred_bcsd.npy \ --pcs outputs/real/wide_pcs.npz \ --out outputs/downscale/ehd_full_real_pcs.json \ --part-dir outputs/downscale/fold_parts_real_pcs echo "==== PC pipeline dispatched $(date '+%F %T') ===="