-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwarm-start.sh
executable file
·54 lines (38 loc) · 1.26 KB
/
warm-start.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
53
54
#!/bin/bash
# Initialise an ACCESS-ESM Payu run from a CSIRO experiment
set -eu
module purge
module use /g/data/hh5/public/modules
module load conda/analysis3
start_year=850
project=p66
user=cm2704
expname=PI-01
source_year=541
csiro_source=/g/data/$project/$user/archive/$expname/restart
payu sweep > /dev/null
payu setup --archive
payu_archive=./archive
payu_restart=${payu_archive}/restart000
if [ $(ls -d ${payu_archive}/restart* | wc -l) -gt 0 ]; then
echo "ERROR: Restart directory already exists"
echo "Consider 'payu sweep --hard' to delete all restarts"
exit 1
fi
mkdir $payu_restart
mkdir $payu_restart/{atmosphere,ocean,ice,coupler}
yearstart="$(printf '%04d' $source_year)0101"
pyearend="$(printf '%04d' $(( source_year - 1 )) )1231"
cp -v $csiro_source/atm/${expname}.astart-${yearstart} $payu_restart/atmosphere/restart_dump.astart
for f in $csiro_source/cpl/*-${pyearend}; do
cp -v $f $payu_restart/coupler/$(basename ${f%-*})
done
for f in $csiro_source/ocn/*-${pyearend}; do
cp -v $f $payu_restart/ocean/$(basename ${f%-*})
done
for f in $csiro_source/ice/*-${pyearend}; do
cp -v $f $payu_restart/ice/$(basename ${f%-*})
done
cp -v $csiro_source/ice/iced.${yearstart} $payu_restart/ice/
scripts/set_restart_year.sh $start_year
payu sweep