TLUSTY/RTlusty

60 lines
1.7 KiB
Bash
Executable File
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
# 这是shebang行指定使用bash来执行这个脚本
# 这些是注释说明这个脚本的用途运行tlusty程序
# shell script to run tlusty
#
# print syntax if no parameters specified
#
date
if [ $# -lt 1 ]
# 检查命令行参数数量是否小于1$#表示参数数量)
then
echo Usage:
echo RTlusty model core name [core name of starting model]
# 如果没有参数,显示使用说明并退出
exit
fi
# 检查起始模型是否存在的注释
echo
echo COMPUTING MODEL $1
# 显示正在计算的模型名称($1是第一个命令行参数
if [ $# -eq 2 ]
# 如果有两个参数($#等于2
then
if [ -e $2.7 ] ; then
# 检查第二个参数对应的.7文件是否存在
echo WITH INITIAL MODEL: $2.7;
else
echo FILE $2.7 does not exist, therefore quitting ;
# 如果文件不存在,显示错误信息并退出
exit;
fi
rm -f fort.8
# 删除已存在的fort.8文件
cp $2.7 fort.8
# 将起始模型文件复制为fort.8
fi
# 创建到TLUSTY数据目录的符号链接
ln -s -f "$TLUSTY/data" data
#mkdir -p results
# 运行tlusty程序
MOD=$1
# 将第一个参数保存到MOD变量
( "$TLUSTY/tlusty/tlusty.exe" < $MOD.5 > $MOD.6) >& /dev/null
# 运行tlusty程序使用$MOD.5作为输入,输出到$MOD.6,错误输出重定向到/dev/null
# 保存重要的输出文件
cp fort.7 $MOD.7 # 复制计算结果
cp fort.9 $MOD.9 # 复制收敛信息
cp fort.69 $MOD.69 # 复制其他输出数据
cp fort.14 $MOD.14 # 复制额外的输出数据
# cp fort.12 $MOD.12 # 这行被注释掉了,不会执行
echo "COMPUTED MODEL $MOD FINISHED!" # 显示计算完成信息
date # 显示完成时间