TLUSTY/cno_grid/run_boundary.sh
2026-07-21 22:25:14 +08:00

35 lines
1.3 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# 边界点测试脚本(旧版,使用 logCNO=0。每个点跑完后把收敛情况追加到日志。
# 注:当前推荐使用 run_boundary_corrected.sh修正后的丰度范围
export TLUSTY=/home/dckj/program/tlusty/tl208-s54
cd $TLUSTY/cno_grid
LOG=results/boundary_runs.log
echo "=== 边界测试开始 $(date) ===" > $LOG
# 跑一个边界点,并把结果摘要追加到日志
run_pt() {
local teff=$1 logg=$2 loghe=$3 name=$4
echo ">>> [$name] teff=$teff logg=$logg logHe=$loghe $(date)" >> $LOG
python3 src/run_one.py --teff $teff --logg $logg --loghe $loghe \
--logc 0 --logn 0 --logo 0 >> $LOG 2>&1
# 记录结果
python3 -c "
import json,glob,os
d='t{}_g{:.1f}_he{:.0f}_c0_n0_o0'.format(int($teff),$logg,$loghe)
p=os.path.join('results',d,'conv.json')
try:
j=json.load(open(p))
print(' {} {} {} -> converged={} max_relc={} elapsed={}'.format(
'$name',$teff,$logg,j['converged'],j.get('final_max_relc'),j.get('elapsed_sec')),file=open($LOG,'a'))
except Exception as e: print(' $name ERROR:',e,file=open($LOG,'a'))
" >> $LOG 2>&1
}
# 边界点1已在独立进程跑这里跑2-5
run_pt 80000 6.5 2 "b2_高温He-rich"
run_pt 80000 6.5 -4 "b3_高温He-poor"
run_pt 40000 6.0 0 "b4_中心点高金属参考"
run_pt 20000 6.5 -4 "b5_低温贫He"
echo "=== 全部完成 $(date) ===" >> $LOG