annotate save_restart.sh @ 0:7a7ba86e95a4 draft default tip

"planemo upload for repository https://github.com/ESCOMP/CESM commit 5c969e494841237de0b2301520d9321672cc9f5b"
author climate
date Tue, 15 Jun 2021 09:39:23 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
7a7ba86e95a4 "planemo upload for repository https://github.com/ESCOMP/CESM commit 5c969e494841237de0b2301520d9321672cc9f5b"
climate
parents:
diff changeset
1 #!/usr/bin/env bash
7a7ba86e95a4 "planemo upload for repository https://github.com/ESCOMP/CESM commit 5c969e494841237de0b2301520d9321672cc9f5b"
climate
parents:
diff changeset
2
7a7ba86e95a4 "planemo upload for repository https://github.com/ESCOMP/CESM commit 5c969e494841237de0b2301520d9321672cc9f5b"
climate
parents:
diff changeset
3 WORKDIR=$1
7a7ba86e95a4 "planemo upload for repository https://github.com/ESCOMP/CESM commit 5c969e494841237de0b2301520d9321672cc9f5b"
climate
parents:
diff changeset
4 CASENAME=$2
7a7ba86e95a4 "planemo upload for repository https://github.com/ESCOMP/CESM commit 5c969e494841237de0b2301520d9321672cc9f5b"
climate
parents:
diff changeset
5 RESDIR=$3
7a7ba86e95a4 "planemo upload for repository https://github.com/ESCOMP/CESM commit 5c969e494841237de0b2301520d9321672cc9f5b"
climate
parents:
diff changeset
6 INFO_FILE=$4
7a7ba86e95a4 "planemo upload for repository https://github.com/ESCOMP/CESM commit 5c969e494841237de0b2301520d9321672cc9f5b"
climate
parents:
diff changeset
7
7a7ba86e95a4 "planemo upload for repository https://github.com/ESCOMP/CESM commit 5c969e494841237de0b2301520d9321672cc9f5b"
climate
parents:
diff changeset
8 echo "===================================================================="
7a7ba86e95a4 "planemo upload for repository https://github.com/ESCOMP/CESM commit 5c969e494841237de0b2301520d9321672cc9f5b"
climate
parents:
diff changeset
9 echo " Save restarts for CESM run "
7a7ba86e95a4 "planemo upload for repository https://github.com/ESCOMP/CESM commit 5c969e494841237de0b2301520d9321672cc9f5b"
climate
parents:
diff changeset
10 echo "===================================================================="
7a7ba86e95a4 "planemo upload for repository https://github.com/ESCOMP/CESM commit 5c969e494841237de0b2301520d9321672cc9f5b"
climate
parents:
diff changeset
11
7a7ba86e95a4 "planemo upload for repository https://github.com/ESCOMP/CESM commit 5c969e494841237de0b2301520d9321672cc9f5b"
climate
parents:
diff changeset
12 nb_nc=$(find $WORKDIR -type f -name "${CASENAME}.*.r*.*.nc" | wc -l)
7a7ba86e95a4 "planemo upload for repository https://github.com/ESCOMP/CESM commit 5c969e494841237de0b2301520d9321672cc9f5b"
climate
parents:
diff changeset
13 nb_bin=$(find $WORKDIR -type f -name "${CASENAME}.*.r*.*.bin" | wc -l)
7a7ba86e95a4 "planemo upload for repository https://github.com/ESCOMP/CESM commit 5c969e494841237de0b2301520d9321672cc9f5b"
climate
parents:
diff changeset
14 nb_i=$(find $WORKDIR -type f -name "${CASENAME}.*.i*.*.nc" | wc -l)
7a7ba86e95a4 "planemo upload for repository https://github.com/ESCOMP/CESM commit 5c969e494841237de0b2301520d9321672cc9f5b"
climate
parents:
diff changeset
15 nb_rp=$(find $WORKDIR -type f -name "rpointer.*" | wc -l)
7a7ba86e95a4 "planemo upload for repository https://github.com/ESCOMP/CESM commit 5c969e494841237de0b2301520d9321672cc9f5b"
climate
parents:
diff changeset
16
7a7ba86e95a4 "planemo upload for repository https://github.com/ESCOMP/CESM commit 5c969e494841237de0b2301520d9321672cc9f5b"
climate
parents:
diff changeset
17 if [[ $nb_nc -gt 0 ]]; then
7a7ba86e95a4 "planemo upload for repository https://github.com/ESCOMP/CESM commit 5c969e494841237de0b2301520d9321672cc9f5b"
climate
parents:
diff changeset
18 cp $WORKDIR/${CASENAME}.*.r*.*.nc $RESDIR/ 2>>$INFO_FILE
7a7ba86e95a4 "planemo upload for repository https://github.com/ESCOMP/CESM commit 5c969e494841237de0b2301520d9321672cc9f5b"
climate
parents:
diff changeset
19 fi
7a7ba86e95a4 "planemo upload for repository https://github.com/ESCOMP/CESM commit 5c969e494841237de0b2301520d9321672cc9f5b"
climate
parents:
diff changeset
20 if [[ $nb_bin -gt 0 ]]; then
7a7ba86e95a4 "planemo upload for repository https://github.com/ESCOMP/CESM commit 5c969e494841237de0b2301520d9321672cc9f5b"
climate
parents:
diff changeset
21 cp $WORKDIR/${CASENAME}.*.r*.*.bin $RESDIR/ 2>>$INFO_FILE
7a7ba86e95a4 "planemo upload for repository https://github.com/ESCOMP/CESM commit 5c969e494841237de0b2301520d9321672cc9f5b"
climate
parents:
diff changeset
22 fi
7a7ba86e95a4 "planemo upload for repository https://github.com/ESCOMP/CESM commit 5c969e494841237de0b2301520d9321672cc9f5b"
climate
parents:
diff changeset
23 if [[ $nb_i -gt 0 ]]; then
7a7ba86e95a4 "planemo upload for repository https://github.com/ESCOMP/CESM commit 5c969e494841237de0b2301520d9321672cc9f5b"
climate
parents:
diff changeset
24 cp $WORKDIR/${CASENAME}.*.i*.*.nc $RESDIR/ 2>>$INFO_FILE
7a7ba86e95a4 "planemo upload for repository https://github.com/ESCOMP/CESM commit 5c969e494841237de0b2301520d9321672cc9f5b"
climate
parents:
diff changeset
25 fi
7a7ba86e95a4 "planemo upload for repository https://github.com/ESCOMP/CESM commit 5c969e494841237de0b2301520d9321672cc9f5b"
climate
parents:
diff changeset
26 if [[ $nb_rp -gt 0 ]]; then
7a7ba86e95a4 "planemo upload for repository https://github.com/ESCOMP/CESM commit 5c969e494841237de0b2301520d9321672cc9f5b"
climate
parents:
diff changeset
27 cp $WORKDIR/rpointer.* $RESDIR/ 2>>$INFO_FILE
7a7ba86e95a4 "planemo upload for repository https://github.com/ESCOMP/CESM commit 5c969e494841237de0b2301520d9321672cc9f5b"
climate
parents:
diff changeset
28 fi
7a7ba86e95a4 "planemo upload for repository https://github.com/ESCOMP/CESM commit 5c969e494841237de0b2301520d9321672cc9f5b"
climate
parents:
diff changeset
29 echo "Restart saved."