|
1 | 1 | #!/bin/sh
|
2 | 2 |
|
3 |
| -arg1=$1 |
| 3 | +# |
| 4 | +# Check for command-line arguments |
| 5 | +# At present, the only supported argument is --nowrf, which disables checks to |
| 6 | +# find the path to the compiled WRF model. |
| 7 | +# |
| 8 | +nowrf=0 |
| 9 | +for arg in $@; do |
| 10 | + if [ "${arg}" = "--nowrf" ]; then |
| 11 | + nowrf=1 |
| 12 | + fi |
| 13 | +done |
| 14 | + |
4 | 15 |
|
5 | 16 | # Look for netcdf
|
6 | 17 | if test -z "$NETCDF" ; then
|
|
153 | 164 | wrf_dir="none"
|
154 | 165 | standard_wrf_dirs="WRF WRF-4.0.3 WRF-4.0.2 WRF-4.0.1 WRF-4.0 WRFV3"
|
155 | 166 |
|
156 |
| -# |
157 |
| -# If no WRF_DIR environment variable is set, try to locate a WRF build in one |
158 |
| -# of the expected directory names one directory level up; otherwise, try to use |
159 |
| -# the WRF I/O library from the code in $WRF_DIR |
160 |
| -# |
161 |
| -if [ -z "$WRF_DIR" ]; then |
162 |
| -# for d in WRF WRF-4.0.3 WRF-4.0.2 WRF-4.0.1 WRF-4.0 WRFV3; do |
163 |
| - for d in ${standard_wrf_dirs}; do |
164 |
| - if [ -e ../${d}/external/io_netcdf/libwrfio_nf.a ]; then |
165 |
| - echo "Found what looks like a valid WRF I/O library in ../${d}" |
166 |
| - wrf_dir="../${d}" |
167 |
| - break |
| 167 | +if [ ${nowrf} -eq 0 ]; then |
| 168 | + # |
| 169 | + # If no WRF_DIR environment variable is set, try to locate a WRF build in one |
| 170 | + # of the expected directory names one directory level up; otherwise, try to use |
| 171 | + # the WRF I/O library from the code in $WRF_DIR |
| 172 | + # |
| 173 | + if [ -z "$WRF_DIR" ]; then |
| 174 | + # for d in WRF WRF-4.0.3 WRF-4.0.2 WRF-4.0.1 WRF-4.0 WRFV3; do |
| 175 | + for d in ${standard_wrf_dirs}; do |
| 176 | + if [ -e ../${d}/external/io_netcdf/libwrfio_nf.a ]; then |
| 177 | + echo "Found what looks like a valid WRF I/O library in ../${d}" |
| 178 | + wrf_dir="../${d}" |
| 179 | + break |
| 180 | + fi |
| 181 | + done |
| 182 | + else |
| 183 | + if [ ! -e ${WRF_DIR}/external/io_netcdf/libwrfio_nf.a ]; then |
| 184 | + echo "" |
| 185 | + echo "Error: The \$WRF_DIR environment variable was set, but the WRF code at" |
| 186 | + echo " ${WRF_DIR} doesn't appear to have been successfully compiled" |
| 187 | + echo "" |
| 188 | + exit |
168 | 189 | fi
|
169 |
| - done |
170 |
| -else |
171 |
| - if [ ! -e ${WRF_DIR}/external/io_netcdf/libwrfio_nf.a ]; then |
| 190 | + |
| 191 | + echo "Using WRF I/O library in WRF build identified by \$WRF_DIR: ${WRF_DIR}" |
| 192 | + wrf_dir=$WRF_DIR |
| 193 | + fi |
| 194 | + |
| 195 | + if [ $wrf_dir = "none" ]; then |
172 | 196 | echo ""
|
173 |
| - echo "Error: The \$WRF_DIR environment variable was set, but the WRF code at" |
174 |
| - echo " ${WRF_DIR} doesn't appear to have been successfully compiled" |
| 197 | + echo "Error: No compiled WRF code found. Please check that the WRF model has been compiled" |
| 198 | + echo " one directory level up (i.e., ../) in a directory named 'WRF', 'WRF-4.0.3', 'WRF-4.0.2', etc.," |
| 199 | + echo " or specify the full path to the compiled WRF model with the environment variable \$WRF_DIR ." |
| 200 | + echo "" |
| 201 | + echo "Alternatively, if only WPS components that do no depend on WRF I/O libraries are needed, re-run" |
| 202 | + echo "the configure script with the --nowrf option." |
175 | 203 | echo ""
|
176 | 204 | exit
|
177 | 205 | fi
|
178 |
| - |
179 |
| - echo "Using WRF I/O library in WRF build identified by \$WRF_DIR: ${WRF_DIR}" |
180 |
| - wrf_dir=$WRF_DIR |
181 |
| -fi |
182 |
| - |
183 |
| -if [ $wrf_dir = "none" ]; then |
184 |
| - echo "" |
185 |
| - echo "Error: No compiled WRF code found. Please check that the WRF model has been compiled" |
186 |
| - echo " one directory level up (i.e., ../) in a directory named 'WRF', 'WRF-4.0.3', 'WRF-4.0.2', etc.," |
187 |
| - echo " or specify the full path to the compiled WRF model with the environment variable \$WRF_DIR ." |
188 |
| - echo "" |
189 |
| - exit |
| 206 | +else |
| 207 | + cat << EOF |
| 208 | +******************************************************************************** |
| 209 | +Configuring the WPS without a compiled WRF model. |
| 210 | +It will not be possible to build the following WPS components, which depend on |
| 211 | +the WRF I/O libraries: |
| 212 | + - geogrid |
| 213 | + - metgrid |
| 214 | + - int2nc |
| 215 | +******************************************************************************** |
| 216 | +EOF |
190 | 217 | fi
|
191 | 218 |
|
192 | 219 | # Found perl, so proceed with configuration
|
|
0 commit comments