Skip to content

Commit

Permalink
Merge pull request #73 from mgduda/find_new_WRF_dirs
Browse files Browse the repository at this point in the history
This merge adds additional logic in arch/preamble for finding the WRF source directory.

The make logic in arch/preamble for setting the WRF_DIR variable to the location
of the compiled WRF source code previously looked either for a directory named
../WRF or a directory named ../WRFV3. In anticipation of users downloading
the WRF code as a GitHub archive file, which will unpack to a name like
WRF-4.0.1, we need more sophisticated logic for finding this directory.

Now, we check for the WRF code in ../WRF-4.0.1 and ../WRF-4.0.
In future we will likely need a more general solution (e.g., to handle the
eventual WRF 4.1 release), but as an immediate fix, checking for the WRF
4.0 or 4.0.1 releases should be sufficient.
  • Loading branch information
mgduda authored Oct 2, 2018
2 parents 8632e1d + c701b7e commit 139dd22
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions arch/preamble
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,26 @@ PERL = perl
RANLIB = echo

#
# Set path to compiled WRF code, which is assumed to be ../WRF for v4.x, or ../WRFV3 for v3.x
# Look for compiled WRF code in one of several directories: WRF-4.0.1, WRF-4.0, WRF, and WRFV3.
# The need for complicated logic to do this arises from the various names that the WRF code may take
# on, depending on whether it was obtained through a GitHub archive file, as a clone of the GitHub
# repository, or an older WRF v3.x tar file.
# To override the path to the compiled WRF code, just set the WRF_DIR variable after the "endif" below
#
ifneq ($(wildcard $(DEV_TOP)/../WRF), ) # Check for WRF v4.x directory
WRF_DIR = ../WRF
ifneq ($(wildcard $(DEV_TOP)/../WRF-4.0.1), ) # Check for WRF v4.0.1 directory (probably GitHub archive)
WRF_DIR = ../WRF-4.0.1
else
WRF_DIR = ../WRFV3
ifneq ($(wildcard $(DEV_TOP)/../WRF-4.0), ) # Check for WRF v4.0 directory (probably GitHub archive)
WRF_DIR = ../WRF-4.0
else
ifneq ($(wildcard $(DEV_TOP)/../WRF), ) # Check for clone of the WRF repository
WRF_DIR = ../WRF
else # Check for old WRF v3.x directory
WRF_DIR = ../WRFV3
endif
endif
endif


WRF_INCLUDE = -I$(WRF_DIR)/external/io_netcdf \
-I$(WRF_DIR)/external/io_grib_share \
Expand Down

0 comments on commit 139dd22

Please sign in to comment.