-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathfinalise.sh
executable file
·37 lines (28 loc) · 982 Bytes
/
finalise.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
#!/usr/bin/env sh
# Commit changes and push, then add metadata to note how changes were made
module load nco
module load git
echo "About to commit all changes to git repository and push to remote."
read -p "Proceed? (y/n) " yesno
case $yesno in
[Yy] ) ;;
* ) echo "Cancelled."; exit 0;;
esac
set -x
set -e
git commit -am "update" || true
git push || true
outpath=/g/data/ik11/inputs/access-om2/woa13
dirs=("10" "025" "01")
for d in ${dirs[@]}; do
for f in ${outpath}/${d}/woa13_ts_??_mom${d}.nc; do
ncatted -O -h -a history,global,a,c," | Created on $(date) using https://github.com/COSIMA/initial_conditions_access-om2/tree/$(git rev-parse --short HEAD)" $f
done
done
for f in ${outpath}/monthly/woa13_*.nc; do
ncatted -O -h -a history,global,a,c," | Created on $(date) using https://github.com/COSIMA/initial_conditions_access-om2/tree/$(git rev-parse --short HEAD)" $f
done
set +e
chgrp -R ik11 ${outpath}
chmod -R g+rX ${outpath}
echo "done"