forked from nicojourdain/BUILD_CONFIG_NEMO
-
Notifications
You must be signed in to change notification settings - Fork 2
/
concatenate_yearly_BDY.sh
executable file
·38 lines (30 loc) · 1.19 KB
/
concatenate_yearly_BDY.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
#!/bin/bash
CONFIG="WED025"
CONFIG="WED12"
BDY_DIR="$SHAREDELMER/input/nemo_WED12/BDY"
BDY_DIR="/fs2/n02/n02/chbull/nemo/bld_configs/input_WED12/BDY"
BDY_DIR="/fs2/n02/n02/chbull/nemo/bld_configs/input_WED025/BDY_CP"
BDY_DIR="/fs2/n02/n02/chbull/nemo/bld_configs/input_WED025_2/BDY_CAT"
BDY_DIR="/fs2/n02/n02/chbull/nemo/bld_configs/input_WED025_JRA/BDY"
BDY_DIR="/fs2/n02/n02/chbull/nemo/bld_configs/input_WED025_JRA_2/BDY"
BDY_DIR="/nerc/n02/n02/chbull/nemo/bld_configs/input_WED025_3/BDY"
BDY_DIR="/nerc/n02/n02/chbull/nemo/bld_configs/input_WED12_CORE/BDY_CAT"
YEARi=1976
YEARf=2005
#for BDY in bdyT_tra bdyU_u3d bdyU_u2d bdyV_u3d bdyV_u2d bdyT_ssh
#for BDY in bdyT_ice
#for BDY in bdyT_ice
for BDY in bdyT_tra bdyU_u3d bdyU_u2d bdyV_u3d bdyV_u2d bdyT_ice bdyT_ssh
do
for YEAR in $(seq $YEARi $YEARf)
do
ncrcat ${BDY_DIR}/${BDY}_${YEAR}_??_??_${CONFIG}.nc ${BDY_DIR}/${BDY}_y${YEAR}_${CONFIG}.nc
if [ -f ${BDY_DIR}/${BDY}_y${YEAR}_${CONFIG}.nc ]; then
rm -f ${BDY_DIR}/${BDY}_${YEAR}_??_??_${CONFIG}.nc
echo "${BDY_DIR}/${BDY}_y${YEAR}_${CONFIG}.nc [oK]"
else
echo "~!@#%^&* ERROR: ${BDY_DIR}/${BDY}_y${YEAR}_${CONFIG}.nc HAS NOT BEEN CREATED >>>>> STOP !!"
exit
fi
done
done