forked from jmccreight/wrfHydroScripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsourceMe.sh
executable file
·130 lines (105 loc) · 2.63 KB
/
sourceMe.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
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#!/bin/bash
## source this file in your .bashrc for universal access to the scripts via function calls:
## source pathTo/wrfHydroScripts/sourceMe.sh
## where do you keep your scripts? This config file is required to know.
configFile=~/.wrfHydroScripts
if [[ ! -e $configFile ]]
then
echo -e \
"\e[31mPlease create a ~/.wrfHydroScripts file based on the example in the repository.\e[0m"
return 1
fi
whsPath=`grep "wrfHydroScripts" $configFile | cut -d '=' -f2 | tr -d ' '`
function lrl { ## "list readlink"
for i in "$@"
do
echo "$i ->"
ls -lahd `readlink -e $i`
done
}
function plotFrxst {
$whsPath/plotFrxst.sh $@
}
function cleanup {
$whsPath/cleanup.sh $@
}
function cleanRun {
$whsPath/cleanRun.sh $@
}
function linkToTestCase {
$whsPath/linkToTestCase.sh $@
}
function standardizeTestCase {
$whsPath/standardizeTestCase.sh $@
}
function getTestFiles {
$whsPath/getTestFiles.sh $@
}
function testNLast {
$whsPath/testNLast.sh $@
}
function makeCheck {
$whsPath/makeCheck.sh $@
}
function qCleanRun {
$whsPath/qCleanRun.sh $@
}
function bCleanRun {
$whsPath/bCleanRun.sh $@
}
function compileAll {
"$whsPath"/compileAll.sh $@
}
function regTest {
$whsPath/regTest.sh $@
}
function hgrep {
$whsPath/hgrep.sh $@
}
function compileTag {
$whsPath/compileTag.sh $@
}
function geyser {
$whsPath/geyser.sh $@
}
function henv {
printenv | egrep -i "(HYDRO|NUDG|PRECIP|CHAN_CONN|^NETCDF|REALTIME|SOIL|WRFIO)" | egrep -v PWD
}
function setHenv {
local R N D P O S
R=0; N=0; D=0; P=0; O=0; S=0
local OPTIND
while getopts ":RNDPOSL" opt; do
case $opt in
R) R=1;;
N) N=1;;
D) D=1;;
P) P=1;;
O) O=1;;
S) S=1;;
L) L=1;;
\?) echo "Invalid option: -$OPTARG";;
esac
done
shift "$((OPTIND-1))" # Shift off the options and optional
export HYDRO_REALTIME=0
export WRF_HYDRO_NUDGING=0
export HYDRO_D=0
export PRECIP_DOUBLE=0
export OUTPUT_CHAN_CONN=0
export WRF_HYDRO=1
export SPATIAL_SOIL=0
export WRFIO_NCD_LARGE_FILE_SUPPORT=0
if [ $R -eq 1 ]; then export HYDRO_REALTIME=1; fi
if [ $N -eq 1 ]; then export WRF_HYDRO_NUDGING=1; fi
if [ $D -eq 1 ]; then export HYDRO_D=1; fi
if [ $P -eq 1 ]; then export PRECIP_DOUBLE=1; fi
if [ $O -eq 1 ]; then export OUTPUT_CHAN_CONN=1; fi
if [ $S -eq 1 ]; then export SPATIAL_SOIL=1; fi
if [ $L -eq 1 ]; then export WRFIO_NCD_LARGE_FILE_SUPPORT=1; fi
henv
}
function checkAllocations {
$whsPath/checkAllocations.sh $@
}
return 0