Newer
Older
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
# This script can be used on a machine where a NEMO experiment is set up to automatically update
# this experiment up to the last date with ERA5 data. In practice, it will extend the experiment
# plan with a restart frequency of 1 day, and launch the experiment. It should be used as:
#
# ./update_experiment.bash version configuration name
# technicalities
set -e
script_path=$(realpath $(dirname $0))
climate_toolbox_path=$(realpath $script_path/../../..)
source $climate_toolbox_path/utilities/generic.bash
# prepare logs
current_log_file_path="$script_path/logs/update_experiment_\
${experiment}_${configuration}_${version}_$(get_log_tag)"
exec > "$current_log_file_path" 2>&1
# recover arguments
if [ "$#" -lt 3 ]
then
echo -e "\nError! Three arguments are required to specify the experiment to update:"
echo -e " - version\n - configuration\n - name\n"
exit 1
fi
version=$1
configuration=$2
name=$3
# find the last date with ERA5 data
last_date_with_era5_data=$(date -d "$(get_era5_data_availability_delay) days ago" +"%Y-%m-%d")
# extend and launch the experiment
cd $climate_toolbox_path
python3 -m models.nemo.extend_experiment -v $version -c $configuration -n $name \
-ed $last_date_with_era5_data -rf 1-days -l