- 积分
- 804
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2024-6-2
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
#!/bin/bash
#ng, April 11, 2018
# This script is used to extract variables from
# the monthly output data of CESM
#从月输出数据中提取需要的变量
# The line with "Change me" may need to be modify
# Search the "Change me" for modidfy
#cases="T31.420.mmcoA.ice1"
module load nco
#cases="L560_aE \
# L560_bE \
# L560_cE"
cases="180ma_b1"
vars="FGR PBOT Q2M RH2M TBOT \
QSOIL QVEGE QVEGT RAIN"
group="180ma"
file_name="clm2.h0"
yr_b=0001
yr_e=0100
dir0="/work/home/Lenovo"
dir_in="${dir0}/${group}"
dir_out="${dir0}/PROCESS/${group}/data_atm_t31/"
a=3 # a = 1 / 3
if [ ${a} -gt 2 ]; then #---------------Change me
for case in ${cases}; do
echo "---------------------------- for ${case}"
cd ${dir_in}/data
ls | wc -l
# ls -lh ${case}.*.nc*tmp
rm -rf ${case}.*.nc*tmp
# for (( yr=${yr_b}; yr<=${yr_e}; yr++ )); do
#============================ extract var
for var in ${vars}; do #===== extract var
echo "--------${var}"
# files1="${case}.${file_name}.${yr}-[0-1][0-9].nc"
files1="${case}.${file_name}.[0][0-1][0-9][0-9]-[0-1][0-9].nc"
ncrcat -v ${var} ${files1} -o ${case}.${var}.nc
mv ${case}.${var}.nc ${dir_out}
done
# done
#============================ for check
ls -lh ${case}.*.nc*tmp
rm -rf ${case}.*.nc*tmp
done
fi
cd ${dir_out}
#ls -lh ${group}*
echo "==========================================end"
exit 6
我利用Piggy_Packages-Cygwin64执行lnd1_extract_var.sh该代码时,总是提示:./lnd1_extract_var.sh:行41: ncrcat: 未找到命令mv: 无法获取'180ma_b1.QSOIL.nc' 的文件状态(stat): No such file or directory--------QVEGE./lnd1_extract_var.sh:行41: ncrcat: 未找到命令mv: 无法获取'180ma_b1.QVEGE.nc' 的文件状态(stat): No such file or directory--------QVEGT./lnd1_extract_var.sh:行41: ncrcat: 未找到命令mv: 无法获取'180ma_b1.QVEGT.nc' 的文件状态(stat): No such file or directory--------RAIN./lnd1_extract_var.sh:行41: ncrcat: 未找到命令。但是我在命令行执行ncrcat指令时可以的,这是为什么呢?
|
|