Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ if [ $? -eq 0 ] ; then
fi

wrf_dir="none"
standard_wrf_dirs="WRF WRF-4.0.3 WRF-4.0.2 WRF-4.0.1 WRF-4.0 WRFV3"

if [ ${nowrf} -eq 0 ]; then
#
Expand All @@ -201,14 +200,25 @@ if [ ${nowrf} -eq 0 ]; then
# the WRF I/O library from the code in $WRF_DIR
#
if [ -z "$WRF_DIR" ]; then
# for d in WRF WRF-4.0.3 WRF-4.0.2 WRF-4.0.1 WRF-4.0 WRFV3; do
for d in ${standard_wrf_dirs}; do
if [ -e ../${d}/external/io_netcdf/libwrfio_nf.a ]; then
echo "Found what looks like a valid WRF I/O library in ../${d}"
wrf_dir="../${d}"
# find WRF dir
if [ -e "../WRF/external/io_netcdf/libwrfio_nf.a" ]; then
echo "Found what looks like a valid WRF I/O library in ../WRF"
WRF_DIR="../WRF"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, as well as on lines 212 and 219, I think WRF_DIR should be wrf_dir; otherwise, the check on line 235 will fail.

else
# If the WRF directory does not exist or libwrfio_nf.a is not found, search for directories starting with WRF-4 in descending order of version number
for dir in $(ls .. | grep '^WRF-4' | sort -rV); do
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following the discussion on this PR, I'd suggest we change sort -rV to sort -t. -k 1.5,1nr -k 2,2nr -k 3,3nr.

if [ -e "../$dir/external/io_netcdf/libwrfio_nf.a" ]; then
echo "Found what looks like a valid WRF I/O library in ../$dir"
WRF_DIR="../$dir"
break
fi
done
fi
done
# If still not found, finally try to search for the WRFV3 directory
if [ -z "$WRF_DIR" ] && [ -e "../WRFV3/external/io_netcdf/libwrfio_nf.a" ]; then
echo "Found what looks like a valid WRF I/O library in ../WRFV3"
WRF_DIR="../WRFV3"
fi
fi
else
if [ ! -e ${WRF_DIR}/external/io_netcdf/libwrfio_nf.a ]; then
echo ""
Expand Down