Skip to content

Commit 8482593

Browse files
committed
Polishing
- Cleaned up header (no login shell, portable, abort on error) - Keeps error codes and messages from the actual command, which is more clear in this case - Mentions Apache Subversion (SVN) dependency; directly available on probably all HPC systems, but may need to be installed on laptop
1 parent 996f152 commit 8482593

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ There are two possible ways to download the grids
151151
wget --no-check-certificate -i clm_mappingfiles.txt
152152
```
153153

154-
2. Run `download_grids.sh` after adapting inputs (in particular the
155-
path `myraw`).
154+
2. Run `download_grids.sh` after adapting inputs (in particular the path `myraw`).
155+
You need Subversion (`svn`) for this.
156156
```
157157
./download_grids.sh
158158
```

mkmapdata/download_grids.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
#!/bin/bash -l
1+
#!/usr/bin/env bash
2+
set -e
23

34
### URL base for the grids
45
SVNBASE="https://svn-ccsm-inputdata.cgd.ucar.edu/trunk/inputdata/lnd/clm2/mappingdata/grids"
56

6-
### Local directory
7+
### Local directory
78
myraw="$PWD/download_grids"
89
mkdir -p "$myraw"
910

@@ -34,8 +35,7 @@ for file in "${files[@]}"; do
3435
url="${SVNBASE}/${file}"
3536
if [ ! -f "$localf" ]; then
3637
echo "Downloading $file ..."
37-
# wget -O "$localf" "$url" || { echo "ERROR downloading $url"; exit 1; }
38-
svn export "$url" "$localf" || { echo "ERROR exporting $url"; exit 1; }
38+
svn export "$url" "$localf"
3939
else
4040
echo "File $file already exists — skipping download."
4141
fi

0 commit comments

Comments
 (0)