Remove unused comments.
Use heredocs where possible. Extract repeated COMMON_VARS. Add KAGRA where possible. Clean log file names. Format scripts. Add check for if spiir_src_dir is using spiir_branch. Replace git log with git rev-parse. Update bankdir. Update partitions for iflive==0 ndet==2. Update channels for iflive==0 ndet==3.