-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathWRFv4_setup_env.sh
executable file
·53 lines (48 loc) · 1.41 KB
/
WRFv4_setup_env.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
#!/bin/bash
# WRFv4 setup script
#
# This script automates the setup of the working environment
# to enable the running of WRFv4 on ARC4
#
# Written for Juliane Schwendike's undergraduate WRF course
# C. Dearden (CEMAC), 20/08/18
#
# Adapted by Helen Burns 2019/2023
# Invoke as follows:
# . /nobackup/WRF/Teaching/WRFv4/WRFv4_setup_env.sh
# NB - the '.' is essential to ensure that changes to the
# environment take effect within the current shell session
#
#
#
# Enable CEMAC modules
if [[ $- =~ "i" ]]; then
if [ -r /nobackup/cemac/cemac.sh ] ; then
. /nobackup/cemac/cemac.sh
fi
fi
module load WPS
module load WRF
module load nco
module load ncl
module load ncview
module load python3
module list
# Change directory to local nobackup (/nobackup/$USER) and
# extract the tarball for running the various test cases
export TESTDIR=/nobackup/$USER/WRFv4
# Does $TESTDIR already exist? If not, create it
if [[ ! -e $TESTDIR ]]; then
echo "$TESTDIR does not exist; creating now..."
mkdir -p $TESTDIR
cd $TESTDIR
echo "Extracting test environment for Katrina case study..."
tar -zxvf /nobackup/WRF/Teaching/WRFv4/WRFv4_Katrina_test_env.tar.gz >/dev/null
echo "Done."
echo "Extracting test environment for dummyfc case study..."
tar -zxvf /nobackup/WRF/Teaching/WRFv4/WRFv4_dummyfc_test_env.tar.gz >/dev/null
echo "Done."
else
echo "$TESTDIR already exists, nothing to do"
cd $TESTDIR
fi