source:
utils/CI/sette/sette_fetch_inputs.sh
@
15769
Last change on this file since 15769 was 14981, checked in by acc, 3 years ago | |
---|---|
|
|
File size: 1.6 KB |
Rev | Line | |
---|---|---|
[14888] | 1 | #!/bin/bash -f |
2 | # set -vx | |
3 | # SETTE input file importer | |
4 | # | |
5 | # This version should be run in the SETTE directory. | |
6 | # The location of the FORCING_DIR will be retrieved from the param.cfg file | |
7 | # | |
8 | ######################################################################################### | |
9 | # | |
10 | # LOAD param variable ( only FORCING_DIR required) | |
11 | . ./param.cfg | |
12 | get_lite=0 | |
13 | if [ $# -gt 0 ]; then | |
14 | while getopts l option ; do | |
15 | case $option in | |
16 | l) get_lite=1;; | |
17 | h | *) echo '' | |
18 | echo 'sette_fetch_inputs.sh : ' | |
19 | echo ' Fetch 4.2_RC input files from remote store' | |
20 | echo ' -l ' | |
21 | echo ' Fetch the alternative, 4.2_RC_LITE input files from remote store' | |
22 | exit 42;; | |
23 | esac | |
24 | done | |
25 | shift $((OPTIND - 1)) | |
26 | fi | |
27 | # | |
28 | if [ ! -d $FORCING_DIR ] ; then | |
29 | while true; do | |
30 | read -p "$FORCING_DIR does not exist. Do you wish to create it? " yn | |
31 | case $yn in | |
32 | [Yy]* ) mkdir -p $FORCING_DIR ; break;; | |
33 | [Nn]* ) echo "Ok, exiting instead"; exit;; | |
34 | * ) echo "Please answer yes or no.";; | |
35 | esac | |
36 | done | |
37 | fi | |
38 | # | |
39 | orgdir=`pwd` | |
40 | cd ${FORCING_DIR} | |
41 | # | |
42 | if [ $get_lite == 0 ] ; then | |
43 | suff="4.2_RC" | |
44 | else | |
45 | suff="4.2_RC_LITE" | |
46 | fi | |
47 | # | |
48 | for file in AGRIF_DEMO AMM12 ICE_AGRIF ISOMIP+ ORCA2_ICE ORCA2_OFF SAS WED025 ORCA2_ABL | |
49 | do | |
50 | full_file=${file}_v${suff}.tar.gz | |
51 | if [ ! -f $full_file ] ; then | |
52 | wget "https://gws-access.jasmin.ac.uk/public/nemo/sette_inputs/r${suff}/$full_file" | |
53 | else | |
54 | echo $full_file "already exist. Delete and re-run to fetch a fresh copy" | |
55 | fi | |
56 | done | |
57 | cd $orgdir | |
58 | # | |
59 | exit |
Note: See TracBrowser
for help on using the repository browser.