comparison 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
comparison
equal deleted inserted replaced
-1:000000000000 0:7a7ba86e95a4
1 #!/usr/bin/env bash
2
3 WORKDIR=$1
4 CASENAME=$2
5 RESDIR=$3
6 INFO_FILE=$4
7
8 echo "===================================================================="
9 echo " Save restarts for CESM run "
10 echo "===================================================================="
11
12 nb_nc=$(find $WORKDIR -type f -name "${CASENAME}.*.r*.*.nc" | wc -l)
13 nb_bin=$(find $WORKDIR -type f -name "${CASENAME}.*.r*.*.bin" | wc -l)
14 nb_i=$(find $WORKDIR -type f -name "${CASENAME}.*.i*.*.nc" | wc -l)
15 nb_rp=$(find $WORKDIR -type f -name "rpointer.*" | wc -l)
16
17 if [[ $nb_nc -gt 0 ]]; then
18 cp $WORKDIR/${CASENAME}.*.r*.*.nc $RESDIR/ 2>>$INFO_FILE
19 fi
20 if [[ $nb_bin -gt 0 ]]; then
21 cp $WORKDIR/${CASENAME}.*.r*.*.bin $RESDIR/ 2>>$INFO_FILE
22 fi
23 if [[ $nb_i -gt 0 ]]; then
24 cp $WORKDIR/${CASENAME}.*.i*.*.nc $RESDIR/ 2>>$INFO_FILE
25 fi
26 if [[ $nb_rp -gt 0 ]]; then
27 cp $WORKDIR/rpointer.* $RESDIR/ 2>>$INFO_FILE
28 fi
29 echo "Restart saved."