-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patharchive_data.sh
52 lines (41 loc) · 1.27 KB
/
archive_data.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#****************************************************************
#
# Filename: archive_data.sh
#
# Author: Yi Qin - [email protected]
# Description: run case.st_archive to archive data to archive directory
# Input:
# Output:
# Create: 2022-01-19 12:21:41
# Last Modified: 2022-01-19 12:21:41
#****************************************************************
run_id1=$1 #cori-haswell.20190513.F2010C5-CMIP6-LR.ne30_oECv3
run_id2=$2 #cori-haswell.20190513.F2010C5-CMIP6-LR.plus4K.ne30_oECv3
datadir_in1=$3
datadir_in2=$4
echo ${run_id1}
echo ${run_id2}
echo ${datadir_in1}
echo ${datadir_in2}
run_id=(${run_id1} ${run_id2})
echo ${run_id}
ncase=2 # two cases: one is control simulation, the other is plus4K simulation
echo $ncase
for ii in `seq 0 $[ncase-1]`
do
if [ "${run_id[ii]}" == "20200428.DECKv1b_amip1-CFMIP.ne30_oEC.cori-knl-L" ] ; then
datadir=${datadir_in1}/${run_id[ii]}/${datadir_in2}
else
datadir=${datadir_in1}/${run_id[ii]}/${datadir_in2}
fi
echo $datadir
cd $datadir
if [ ! -d "${datadir_in1}/${run_id[ii]}/archive" ] ; then
echo ">>>>>> Start archiving."
./case.st_archive
else
echo ">>>>>> Already archived."
fi
done
echo "Archiving data is successfully."
echo "Well Done!"