diff --git a/interfaces/BAGEL-SH/bagel_common.sh b/interfaces/BAGEL-SH/bagel_common.sh index 66f80480..05350687 100644 --- a/interfaces/BAGEL-SH/bagel_common.sh +++ b/interfaces/BAGEL-SH/bagel_common.sh @@ -25,7 +25,8 @@ function bagel_error { local bagel_output="$2" local copy="$3" if [[ -f "$bagel_output" && -n "$copy" ]]; then - cp "$bagel_output" "$copy" + # NOTE: There might be multiple errors per timestep so concatenate + cat "$bagel_output" >> "$copy" fi >&2 echo -e "${errmsg}" >&2 echo "Inspect file $(dirname "$0")/$copy" diff --git a/interfaces/BAGEL-SH/r.bagel-sh b/interfaces/BAGEL-SH/r.bagel-sh index febba2ce..f72c77b0 100755 --- a/interfaces/BAGEL-SH/r.bagel-sh +++ b/interfaces/BAGEL-SH/r.bagel-sh @@ -95,7 +95,7 @@ function converge_casscf { if grep -q "$casscf_error" "$output"; then error=true local savefile=$output.casscf_error.$timestep - cp "$output" "$savefile" + cat "$output" >> "$savefile" >&2 echo "ERROR: CASSCF did not converge, see file $savefile" # Return if we reached the maximum threshold value, # further increase would lead to inaccurate results. @@ -127,7 +127,7 @@ if grep -q "$smith_error" "$input.out"; then maxiter_CASPT2=1000 >&2 echo "ERROR: CASPT2 did not converge, trying again with thresh=$thresh_CASPT2 and maxiter=$maxiter_CASPT2." >&2 echo "See file $savefile" - cp "$input.out" "$savefile" + cat "$input.out" >> "$savefile" generate_input "$input.json" "$method" exec_bagel "$input".json "$input".out "$timestep" returncode=$?