-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget_input_files.sh
More file actions
executable file
·114 lines (89 loc) · 3.17 KB
/
Copy pathget_input_files.sh
File metadata and controls
executable file
·114 lines (89 loc) · 3.17 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#!/bin/bash
# (Selection of shell)
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# get_input_files.sh
#
# Description:
# Downloading the input files for SICOPOLIS,
# copying them to the corresponding directories.
#
# Author: Ralf Greve
# Date: 2025-01-09
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#-------- Settings (to be customized) --------
ANT_FLAG=1 # Antarctica:
# 1 - get files, 0 - don't get files
GRL_FLAG=1 # Greenland:
# 1 - get files, 0 - don't get files
NHEM_FLAG=1 # Entire northern hemisphere:
# 1 - get files, 0 - don't get files
SCAND_FLAG=1 # Fennoscandian and Eurasian ice sheets:
# 1 - get files, 0 - don't get files
TIBET_FLAG=1 # Tibetan ice sheet:
# 1 - get files, 0 - don't get files
ASF_FLAG=1 # Austfonna:
# 1 - get files, 0 - don't get files
MOCHO_FLAG=1 # Mocho-Choshuenco ice cap:
# 1 - get files, 0 - don't get files
EISMINT_FLAG=1 # EISMINT:
# 1 - get files, 0 - don't get files
HEINO_FLAG=1 # ISMIP HEINO:
# 1 - get files, 0 - don't get files
NMARS_FLAG=1 # North polar cap of Mars:
# 1 - get files, 0 - don't get files
SMARS_FLAG=1 # South polar cap of Mars:
# 1 - get files, 0 - don't get files
#-------- Initialization --------
# Zenodo repo:
REPO_URL=https://zenodo.org/record/14619062/files
# Backup repo (no versioning, latest version only):
# REPO_URL=https://www2.lowtem.hokudai.ac.jp/gisg/repo/sicopolis/sico_in
SICOPOLIS_HOME=$PWD
domains=
if [[ $ANT_FLAG -eq 1 ]]; then
domains="`echo $domains` ant"; fi
if [[ $GRL_FLAG -eq 1 ]]; then
domains="`echo $domains` grl"; fi
if [[ $NHEM_FLAG -eq 1 ]]; then
domains="`echo $domains` nhem"; fi
if [[ $SCAND_FLAG -eq 1 ]]; then
domains="`echo $domains` scand"; fi
if [[ $TIBET_FLAG -eq 1 ]]; then
domains="`echo $domains` tibet"; fi
if [[ $ASF_FLAG -eq 1 ]]; then
domains="`echo $domains` asf"; fi
if [[ $MOCHO_FLAG -eq 1 ]]; then
domains="`echo $domains` mocho"; fi
if [[ $EISMINT_FLAG -eq 1 ]]; then
domains="`echo $domains` eismint"; fi
if [[ $HEINO_FLAG -eq 1 ]]; then
domains="`echo $domains` heino"; fi
if [[ $NMARS_FLAG -eq 1 ]]; then
domains="`echo $domains` nmars"; fi
if [[ $SMARS_FLAG -eq 1 ]]; then
domains="`echo $domains` smars"; fi
TMP_DIR="tmp_`date --iso-8601='seconds'`"
mkdir $TMP_DIR
#-------- Downloading and unpacking files --------
cd $TMP_DIR
echo; echo "Downloading and unpacking files:"
for domain in ${domains}; do
echo; echo " ${domain} ..."
wget ${REPO_URL}/${domain}.tgz
tar -x -v -z -f ${domain}.tgz
done
#-------- Copying files --------
MV=/bin/mv
SICOPOLIS_INPUT=sico_in
echo; echo "Copying files:"
for domain in ${domains}; do
echo; echo " ${domain} ..."
$MV -f ${domain}/* "${SICOPOLIS_HOME}/${SICOPOLIS_INPUT}/${domain}/"
done
#-------- Clean-up --------
RM=/bin/rm
cd $OLDPWD
$RM -rf $TMP_DIR
echo; echo "... done!"; echo
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#