Skip to content
Snippets Groups Projects
Verified Commit 39174c99 authored by Adam Caprez's avatar Adam Caprez
Browse files

Add page for building WRF.

parent 559fd266
Branches
No related tags found
1 merge request!333Add page for building WRF.
+++
title = "Building WRF"
description = "How to build WRF (Weather Research & Forecasting) on HCC resources."
+++
The [WRF](https://www.mmm.ucar.edu/models/wrf) (Weather Research & Forecasting) Model is a state
of the art mesoscale numerical weather prediction system designed for both atmospheric research
and operational forecasting applications. It features two dynamical cores, a data assimilation
system, and a software architecture supporting parallel computation and system extensibility.
The model serves a wide range of meteorological applications across scales from tens of meters to
thousands of kilometers. The effort to develop WRF began in the latter 1990's and was a
collaborative partnership of the National Center for Atmospheric Research (NCAR),
the National Oceanic and Atmospheric Administration (represented by the National Centers for
Environmental Prediction (NCEP) and the Earth System Research Laboratory), the U.S. Air Force,
the Naval Research Laboratory, the University of Oklahoma, and the Federal Aviation Administration (FAA).
For researchers, WRF can produce simulations based on actual atmospheric conditions
(i.e., from observations and analyses) or idealized conditions. WRF offers operational forecasting
a flexible and computationally-efficient platform, while reflecting recent advances in physics,
numerics, and data assimilation contributed by developers from the expansive research community.
WRF is currently in operational use at NCEP and other national meteorological centers as well as
in real-time forecasting configurations at laboratories, universities, and companies. [1](https://www.mmm.ucar.edu/models/wrf)
- [Building WRF](#building-wrf)
- [Building WRF version 3.x](#building-wrf-version-3x)
- [Building WRF version 4.x](#building-wrf-version-4x)
- [Building WPS](#building-wps)
- [Building WPS version 3.x](#building-wps-version-3x)
- [Building WPS version 4.x](#building-wps-version-4x)
- [Running WRF](#running-wrf)
{{% notice tip %}}
The WRF/WPS compile process requires a signficant amount of resources. Builds **_must_** be
run as [Interactive Jobs]({{<relref "creating_an_interactive_job">}}) to avoid errors.
To start an interactive job suitable for building WRF/WPS, run
`srun --nodes=1 --ntasks-per-node=4 --mem=8g --time=3:00:00 --qos=short --pty $SHELL`.
{{% /notice %}}
## Building WRF
Due to the way WRF operates, users are expected to compile it themselves on HCC resources.
To simplify this process as much as possible, HCC provides an `WRF` module which loads all of
the needed dependency packages and sets up the build environment. Example outputs showing the
correct choices for the `configure` scripts are also provided.
{{% notice warning %}}
The `WRF` module sets the various environment variables to their proper values. Users should
not set these variables themselves, nor modify their `~/.profile` files.
{{% /notice %}}
The following sections assume you have downloaded one of the WRF/WPS [releases](https://www2.mmm.ucar.edu/wrf/users/download/get_source.html)
and unpacked it somewhere with sufficient space to work. For simplicity, the extraced WRF and WPS
directories should be placed side-by-side in a new empty folder and renamed to `WPS` and
either `WRFV3` for WRF versions 3.x, or `WRF` for WRF versions 4.x.
All commands in each section are run starting relative to the top-level directory, denoted here as `<WRF root`>
or `<WPS root>`.
### Building WRF version 3.x
#### Apply patch
In order to build WRF 3.x successfully , the configure source file requires patching. For convenience,
these are contained in a single patch file which can be applied. Note that _applying the patch
should only be done **once** after unpacking the source code._ Subsequent builds (even after
running `clean -a`) do **not** require rerunning the patch command. Starting in the top level of
the WRF source code directory, the patch may be applied by running
{{% panel theme="info" header="Apply patch for WRFv3" %}}
{{< highlight code >}}
[demo01@c0604.crane WRF]$ wget {{< absurl "/attachments/wrfv3_rpc_types.patch" >}}
[demo01@c0604.crane WRF]$ patch -b -p0 -i wrfv3_rpc_types.patch
{{< /highlight >}}
{{% /panel %}}
#### Build WRF
{{% notice tip %}}
The build process for WRFv3 must be run in **serial only** (i.e. omitting the `-j` option to `./compile`).
Attempting to build WRFv3 with more than the default number of build tasks will result in errors.
{{% /notice %}}
The following example commands show how to compile WRF v3.x.
{{% panel theme="info" header="Building WRFv3" %}}
{{< highlight code >}}
[demo01@c0604.crane WRFV3]$ ls
arch compile dyn_em external inc phys README.hybrid_vert_coord README.NMM README_test_cases run tools
chem configure dyn_exp frame main README README.hydro README.rsl_output README.windturbine share var
clean configure.wrf.backup dyn_nmm hydro Makefile README.DA README.io_config README.SSIB Registry test
[demo01@c0604.crane WRF]$ module purge
[demo01@c0604.crane WRF]$ module load compiler/pgi/20 openmpi/4.0 WRF/v3
[demo01@c0604.crane WRFV3]$ ./configure
checking for perl5... no
checking for perl... found /util/opt/anaconda/deployed-conda-envs/packages/perl/envs/perl-5.26.2/bin/perl (perl)
Will use NETCDF in dir: /util/opt/netcdf/4.7/pgi/20
Will use HDF5 in dir: /util/opt/hdf5/1.12/pgi/20
PHDF5 not set in environment. Will configure WRF for use without.
Will use 'time' to report timing information
If you REALLY want Grib2 output from WRF, modify the arch/Config_new.pl script.
Right now you are not getting the Jasper lib, from the environment, compiled into WRF.
------------------------------------------------------------------------
Please select from among the following Linux x86_64 options:
1. (serial) 2. (smpar) 3. (dmpar) 4. (dm+sm) PGI (pgf90/gcc)
5. (serial) 6. (smpar) 7. (dmpar) 8. (dm+sm) PGI (pgf90/pgcc): SGI MPT
9. (serial) 10. (smpar) 11. (dmpar) 12. (dm+sm) PGI (pgf90/gcc): PGI accelerator
13. (serial) 14. (smpar) 15. (dmpar) 16. (dm+sm) INTEL (ifort/icc)
17. (dm+sm) INTEL (ifort/icc): Xeon Phi (MIC architecture)
18. (serial) 19. (smpar) 20. (dmpar) 21. (dm+sm) INTEL (ifort/icc): Xeon (SNB with AVX mods)
22. (serial) 23. (smpar) 24. (dmpar) 25. (dm+sm) INTEL (ifort/icc): SGI MPT
26. (serial) 27. (smpar) 28. (dmpar) 29. (dm+sm) INTEL (ifort/icc): IBM POE
30. (serial) 31. (dmpar) PATHSCALE (pathf90/pathcc)
32. (serial) 33. (smpar) 34. (dmpar) 35. (dm+sm) GNU (gfortran/gcc)
36. (serial) 37. (smpar) 38. (dmpar) 39. (dm+sm) IBM (xlf90_r/cc_r)
40. (serial) 41. (smpar) 42. (dmpar) 43. (dm+sm) PGI (ftn/gcc): Cray XC CLE
44. (serial) 45. (smpar) 46. (dmpar) 47. (dm+sm) CRAY CCE (ftn $(NOOMP)/cc): Cray XE and XC
48. (serial) 49. (smpar) 50. (dmpar) 51. (dm+sm) INTEL (ftn/icc): Cray XC
52. (serial) 53. (smpar) 54. (dmpar) 55. (dm+sm) PGI (pgf90/pgcc)
56. (serial) 57. (smpar) 58. (dmpar) 59. (dm+sm) PGI (pgf90/gcc): -f90=pgf90
60. (serial) 61. (smpar) 62. (dmpar) 63. (dm+sm) PGI (pgf90/pgcc): -f90=pgf90
64. (serial) 65. (smpar) 66. (dmpar) 67. (dm+sm) INTEL (ifort/icc): HSW/BDW
68. (serial) 69. (smpar) 70. (dmpar) 71. (dm+sm) INTEL (ifort/icc): KNL MIC
72. (serial) 73. (smpar) 74. (dmpar) 75. (dm+sm) FUJITSU (frtpx/fccpx): FX10/FX100 SPARC64 IXfx/Xlfx
Enter selection [1-75] : 54
------------------------------------------------------------------------
Compile for nesting? (1=basic, 2=preset moves, 3=vortex following) [default 1]: 1
Configuration successful!
------------------------------------------------------------------------
testing for MPI_Comm_f2c and MPI_Comm_c2f
MPI_Comm_f2c and MPI_Comm_c2f are supported
testing for fseeko and fseeko64
fseeko64 is supported
------------------------------------------------------------------------
# Settings for Linux x86_64 ppc64le i486 i586 i686, PGI compiler with pgcc (dmpar)
#
DESCRIPTION = PGI ($SFC/$SCC)
DMPARALLEL = 1
OMPCPP = # -D_OPENMP
OMP = # -mp -Minfo=mp -Mrecursive
OMPCC = # -mp
SFC = pgf90
SCC = pgcc
CCOMP = pgcc
DM_FC = mpif90
DM_CC = mpicc -DMPI2_SUPPORT
FC = time $(DM_FC)
CC = $(DM_CC) -DFSEEKO64_OK
LD = $(FC)
RWORDSIZE = $(NATIVE_RWORDSIZE)
PROMOTION = -r$(RWORDSIZE) -i4
ARCH_LOCAL = -DNONSTANDARD_SYSTEM_SUBR -DWRF_USE_CLM
CFLAGS_LOCAL = -w -O3
LDFLAGS_LOCAL =
CPLUSPLUSLIB =
ESMF_LDFLAG = $(CPLUSPLUSLIB)
FCOPTIM = -O3 #-fastsse -Mvect=noaltcode -Msmartalloc -Mprefetch=distance:8 -Mfprelaxed # -Minfo=all =Mneginfo=all
FCREDUCEDOPT = $(FCOPTIM)
FCNOOPT = -O0
FCDEBUG = # -g $(FCNOOPT) # -C -Ktrap=fp -traceback
FORMAT_FIXED = -Mfixed
FORMAT_FREE = -Mfree
FCSUFFIX =
BYTESWAPIO = -byteswapio
FCBASEOPTS_NO_G = -w $(FORMAT_FREE) $(BYTESWAPIO) $(OMP)
FCBASEOPTS = $(FCBASEOPTS_NO_G) $(FCDEBUG)
MODULE_SRCH_FLAG = -module $(WRF_SRC_ROOT_DIR)/main
TRADFLAG = -traditional-cpp
CPP = /lib/cpp -P -nostdinc
AR = ar
ARFLAGS = ru
M4 = m4 -B 14000
RANLIB = ranlib
RLFLAGS =
CC_TOOLS = $(SCC)
###########################################################
######################
# POSTAMBLE
FGREP = fgrep -iq
ARCHFLAGS = $(COREDEFS) -DIWORDSIZE=$(IWORDSIZE) -DDWORDSIZE=$(DWORDSIZE) -DRWORDSIZE=$(RWORDSIZE) -DLWORDSIZE=$(LWORDSIZE) \
$(ARCH_LOCAL) \
$(DA_ARCHFLAGS) \
-DDM_PARALLEL \
\
-DNETCDF \
\
\
\
\
\
-DHDF5 \
\
\
\
\
-DUSE_ALLOCATABLES \
-DGRIB1 \
-DINTIO \
-DKEEP_INT_AROUND \
-DLIMIT_ARGS \
-DCONFIG_BUF_LEN=$(CONFIG_BUF_LEN) \
-DMAX_DOMAINS_F=$(MAX_DOMAINS) \
-DMAX_HISTORY=$(MAX_HISTORY) \
-DNMM_NEST=$(WRF_NMM_NEST)
CFLAGS = $(CFLAGS_LOCAL) -DDM_PARALLEL \
-DMAX_HISTORY=$(MAX_HISTORY) -DNMM_CORE=$(WRF_NMM_CORE)
FCFLAGS = $(FCOPTIM) $(FCBASEOPTS)
ESMF_LIB_FLAGS =
# ESMF 5 -- these are defined in esmf.mk, included above
ESMF_IO_LIB = -L$(WRF_SRC_ROOT_DIR)/external/esmf_time_f90 -lesmf_time
ESMF_IO_LIB_EXT = -L$(WRF_SRC_ROOT_DIR)/external/esmf_time_f90 -lesmf_time
INCLUDE_MODULES = $(MODULE_SRCH_FLAG) \
$(ESMF_MOD_INC) $(ESMF_LIB_FLAGS) \
-I$(WRF_SRC_ROOT_DIR)/main \
-I$(WRF_SRC_ROOT_DIR)/external/io_netcdf \
-I$(WRF_SRC_ROOT_DIR)/external/io_int \
-I$(WRF_SRC_ROOT_DIR)/frame \
-I$(WRF_SRC_ROOT_DIR)/share \
-I$(WRF_SRC_ROOT_DIR)/phys \
-I$(WRF_SRC_ROOT_DIR)/chem -I$(WRF_SRC_ROOT_DIR)/inc \
-I$(NETCDFPATH)/include \
REGISTRY = Registry
CC_TOOLS_CFLAGS = -DNMM_CORE=$(WRF_NMM_CORE)
LIB_BUNDLED = \
$(WRF_SRC_ROOT_DIR)/external/fftpack/fftpack5/libfftpack.a \
$(WRF_SRC_ROOT_DIR)/external/io_grib1/libio_grib1.a \
$(WRF_SRC_ROOT_DIR)/external/io_grib_share/libio_grib_share.a \
$(WRF_SRC_ROOT_DIR)/external/io_int/libwrfio_int.a \
$(ESMF_IO_LIB) \
$(WRF_SRC_ROOT_DIR)/external/RSL_LITE/librsl_lite.a \
$(WRF_SRC_ROOT_DIR)/frame/module_internal_header_util.o \
$(WRF_SRC_ROOT_DIR)/frame/pack_utils.o
LIB_EXTERNAL = \
-L$(WRF_SRC_ROOT_DIR)/external/io_netcdf -lwrfio_nf -L/util/opt/netcdf/4.7/pgi/20/lib -lnetcdff -lnetcdf -L/util/opt/hdf5/1.12/pgi/20/lib -lhdf5_fortran -lhdf5 -lm -lz
LIB = $(LIB_BUNDLED) $(LIB_EXTERNAL) $(LIB_LOCAL) $(LIB_WRF_HYDRO)
LDFLAGS = $(OMP) $(FCFLAGS) $(LDFLAGS_LOCAL)
ENVCOMPDEFS =
WRF_CHEM = 0
CPPFLAGS = $(ARCHFLAGS) $(ENVCOMPDEFS) -I$(LIBINCLUDE) $(TRADFLAG)
NETCDFPATH = /util/opt/netcdf/4.7/pgi/20
HDF5PATH = /util/opt/hdf5/1.12/pgi/20
WRFPLUSPATH =
RTTOVPATH =
PNETCDFPATH =
bundled: io_only
external: io_only $(WRF_SRC_ROOT_DIR)/external/RSL_LITE/librsl_lite.a gen_comms_rsllite module_dm_rsllite $(ESMF_TARGET)
io_only: esmf_time wrfio_nf \
wrf_ioapi_includes wrfio_grib_share wrfio_grib1 wrfio_int fftpack
######################
------------------------------------------------------------------------
Settings listed above are written to configure.wrf.
If you wish to change settings, please edit that file.
If you wish to change the default options, edit the file:
arch/configure_new.defaults
NetCDF users note:
This installation of NetCDF supports large file support. To DISABLE large file
support in NetCDF, set the environment variable WRFIO_NCD_NO_LARGE_FILE_SUPPORT
to 1 and run configure again. Set to any other value to avoid this message.
Testing for NetCDF, C and Fortran compiler
This installation of NetCDF is 64-bit
C compiler is 64-bit
Fortran compiler is 64-bit
It will build in 64-bit
[demo01@c0604.crane WRFV3]$ ./compile em_real
None of WRF_EM_CORE, WRF_NMM_CORE,
specified in shell environment....
copying Registry/Registry.EM to Registry/Registry
==============================================================================================
V3.9
Compiling: WRF_EM_CORE
WRFIO_NCD_LARGE_FILE_SUPPORT=1
Linux c0604.crane.hcc.unl.edu 4.18.0-372.19.1.el8_6.x86_64 #1 SMP Tue Aug 2 13:42:59 EDT 2022 x86_64 x86_64 x86_64 GNU/Linux
... <intermediate output omitted for clarity>
==========================================================================
build started: Fri Sep 30 16:49:21 CDT 2022
build completed: Fri Sep 30 16:49:48 CDT 2022
---> Executables successfully built <---
-rwxr-xr-x 1 demo01 demo 40362432 Sep 30 16:49 main/ndown.exe
-rwxr-xr-x 1 demo01 demo 40173184 Sep 30 16:49 main/real.exe
-rwxr-xr-x 1 demo01 demo 39843768 Sep 30 16:49 main/tc.exe
-rwxr-xr-x 1 demo01 demo 43847392 Sep 30 16:49 main/wrf.exe
==========================================================================
[demo01@c0604.crane WRF]$ ls main/*.exe
main/ndown.exe main/real.exe main/tc.exe main/wrf.exe
{{< /highlight >}}
{{% /panel %}}
If the build finishes successfully a message will be printed, and the four executables
(`ndown.exe`, `real.exe`, `tc.exe`, `wrf.exe`) will be present in the `main` directory.
### Building WRF version 4.x
The following example commands show how to compile WRF v4.x.
{{% panel theme="info" header="Building WRFv4" %}}
{{< highlight code >}}
[demo01@c0604.crane WRF]$ ls
arch clean configure doc external hydro LICENSE.txt Makefile README Registry share tools wrftladj
chem compile configure.wrf dyn_em frame inc main phys README.md run test var
[demo01@c0604.crane WRF]$ module purge
[demo01@c0604.crane WRF]$ module load compiler/pgi/20 openmpi/4.0 WRF/v4
[demo01@c0604.crane WRF]$ ./configure
checking for perl5... no
checking for perl... found /util/opt/anaconda/deployed-conda-envs/packages/perl/envs/perl-5.26.2/bin/perl (perl)
Will use NETCDF in dir: /util/opt/netcdf/4.7/pgi/20
Will use HDF5 in dir: /util/opt/hdf5/1.12/pgi/20
PHDF5 not set in environment. Will configure WRF for use without.
Will use 'time' to report timing information
If you REALLY want Grib2 output from WRF, modify the arch/Config.pl script.
Right now you are not getting the Jasper lib, from the environment, compiled into WRF.
------------------------------------------------------------------------
Please select from among the following Linux x86_64 options:
1. (serial) 2. (smpar) 3. (dmpar) 4. (dm+sm) PGI (pgf90/gcc)
5. (serial) 6. (smpar) 7. (dmpar) 8. (dm+sm) PGI (pgf90/pgcc): SGI MPT
9. (serial) 10. (smpar) 11. (dmpar) 12. (dm+sm) PGI (pgf90/gcc): PGI accelerator
13. (serial) 14. (smpar) 15. (dmpar) 16. (dm+sm) INTEL (ifort/icc)
17. (dm+sm) INTEL (ifort/icc): Xeon Phi (MIC architecture)
18. (serial) 19. (smpar) 20. (dmpar) 21. (dm+sm) INTEL (ifort/icc): Xeon (SNB with AVX mods)
22. (serial) 23. (smpar) 24. (dmpar) 25. (dm+sm) INTEL (ifort/icc): SGI MPT
26. (serial) 27. (smpar) 28. (dmpar) 29. (dm+sm) INTEL (ifort/icc): IBM POE
30. (serial) 31. (dmpar) PATHSCALE (pathf90/pathcc)
32. (serial) 33. (smpar) 34. (dmpar) 35. (dm+sm) GNU (gfortran/gcc)
36. (serial) 37. (smpar) 38. (dmpar) 39. (dm+sm) IBM (xlf90_r/cc_r)
40. (serial) 41. (smpar) 42. (dmpar) 43. (dm+sm) PGI (ftn/gcc): Cray XC CLE
44. (serial) 45. (smpar) 46. (dmpar) 47. (dm+sm) CRAY CCE (ftn $(NOOMP)/cc): Cray XE and XC
48. (serial) 49. (smpar) 50. (dmpar) 51. (dm+sm) INTEL (ftn/icc): Cray XC
52. (serial) 53. (smpar) 54. (dmpar) 55. (dm+sm) PGI (pgf90/pgcc)
56. (serial) 57. (smpar) 58. (dmpar) 59. (dm+sm) PGI (pgf90/gcc): -f90=pgf90
60. (serial) 61. (smpar) 62. (dmpar) 63. (dm+sm) PGI (pgf90/pgcc): -f90=pgf90
64. (serial) 65. (smpar) 66. (dmpar) 67. (dm+sm) INTEL (ifort/icc): HSW/BDW
68. (serial) 69. (smpar) 70. (dmpar) 71. (dm+sm) INTEL (ifort/icc): KNL MIC
72. (serial) 73. (smpar) 74. (dmpar) 75. (dm+sm) FUJITSU (frtpx/fccpx): FX10/FX100 SPARC64 IXfx/Xlfx
Enter selection [1-75] : 54
------------------------------------------------------------------------
Compile for nesting? (1=basic, 2=preset moves, 3=vortex following) [default 1]: 1
Configuration successful!
------------------------------------------------------------------------
testing for fseeko and fseeko64
fseeko64 is supported
------------------------------------------------------------------------
# Settings for Linux x86_64 ppc64le i486 i586 i686, PGI compiler with pgcc (dmpar)
#
DESCRIPTION = PGI ($SFC/$SCC)
DMPARALLEL = 1
OMPCPP = # -D_OPENMP
OMP = # -mp -Minfo=mp -Mrecursive
OMPCC = # -mp
SFC = pgf90
SCC = pgcc
CCOMP = pgcc
DM_FC = mpif90
DM_CC = mpicc
FC = time $(DM_FC)
CC = $(DM_CC) -DFSEEKO64_OK
LD = $(FC)
RWORDSIZE = $(NATIVE_RWORDSIZE)
PROMOTION = -r$(RWORDSIZE) -i4
ARCH_LOCAL = -DNONSTANDARD_SYSTEM_SUBR -DWRF_USE_CLM $(NETCDF4_IO_OPTS)
CFLAGS_LOCAL = -w -O3 # -DRSL0_ONLY
LDFLAGS_LOCAL =
CPLUSPLUSLIB =
ESMF_LDFLAG = $(CPLUSPLUSLIB)
FCOPTIM = -O3 #-fastsse -Mvect=noaltcode -Msmartalloc -Mprefetch=distance:8 -Mfprelaxed # -Minfo=all =Mneginfo=all
FCREDUCEDOPT = $(FCOPTIM)
FCNOOPT = -O0
FCDEBUG = # -g $(FCNOOPT) # -C -Ktrap=fp -traceback
FORMAT_FIXED = -Mfixed
FORMAT_FREE = -Mfree
FCSUFFIX =
BYTESWAPIO = -byteswapio
FCBASEOPTS_NO_G = -w $(FORMAT_FREE) $(BYTESWAPIO) $(OMP)
FCBASEOPTS = $(FCBASEOPTS_NO_G) $(FCDEBUG)
MODULE_SRCH_FLAG = -module $(WRF_SRC_ROOT_DIR)/main
TRADFLAG = -traditional-cpp $(NETCDF4_IO_OPTS)
CPP = /lib/cpp -P -nostdinc
AR = ar
ARFLAGS = ru
M4 = m4 -B 14000
RANLIB = ranlib
RLFLAGS =
CC_TOOLS = $(SCC)
NETCDFPAR_BUILD = echo SKIPPING
###########################################################
######################
# POSTAMBLE
FGREP = fgrep -iq
ARCHFLAGS = $(COREDEFS) -DIWORDSIZE=$(IWORDSIZE) -DDWORDSIZE=$(DWORDSIZE) -DRWORDSIZE=$(RWORDSIZE) -DLWORDSIZE=$(LWORDSIZE) \
$(ARCH_LOCAL) \
$(DA_ARCHFLAGS) \
-DDM_PARALLEL \
\
-DNETCDF \
\
\
\
\
\
\
-DHDF5 \
\
\
-DLANDREAD_STUB=1 \
\
\
-DUSE_ALLOCATABLES \
-Dwrfmodel \
-DGRIB1 \
-DINTIO \
-DKEEP_INT_AROUND \
-DLIMIT_ARGS \
-DBUILD_RRTMG_FAST=0 \
-DBUILD_RRTMK=0 \
-DBUILD_SBM_FAST=1 \
-DSHOW_ALL_VARS_USED=0 \
-DCONFIG_BUF_LEN=$(CONFIG_BUF_LEN) \
-DMAX_DOMAINS_F=$(MAX_DOMAINS) \
-DMAX_HISTORY=$(MAX_HISTORY) \
-DNMM_NEST=$(WRF_NMM_NEST)
CFLAGS = $(CFLAGS_LOCAL) -DDM_PARALLEL \
-DLANDREAD_STUB=1 \
-DMAX_HISTORY=$(MAX_HISTORY) -DNMM_CORE=$(WRF_NMM_CORE)
FCFLAGS = $(FCOPTIM) $(FCBASEOPTS)
ESMF_LIB_FLAGS =
# ESMF 5 -- these are defined in esmf.mk, included above
ESMF_IO_LIB = -L$(WRF_SRC_ROOT_DIR)/external/esmf_time_f90 -lesmf_time
ESMF_IO_LIB_EXT = -L$(WRF_SRC_ROOT_DIR)/external/esmf_time_f90 -lesmf_time
INCLUDE_MODULES = $(MODULE_SRCH_FLAG) \
$(ESMF_MOD_INC) $(ESMF_LIB_FLAGS) \
-I$(WRF_SRC_ROOT_DIR)/main \
-I$(WRF_SRC_ROOT_DIR)/external/io_netcdf \
-I$(WRF_SRC_ROOT_DIR)/external/io_int \
-I$(WRF_SRC_ROOT_DIR)/frame \
-I$(WRF_SRC_ROOT_DIR)/share \
-I$(WRF_SRC_ROOT_DIR)/phys \
-I$(WRF_SRC_ROOT_DIR)/wrftladj \
-I$(WRF_SRC_ROOT_DIR)/chem -I$(WRF_SRC_ROOT_DIR)/inc \
-I$(NETCDFPATH)/include \
REGISTRY = Registry
CC_TOOLS_CFLAGS = -DNMM_CORE=$(WRF_NMM_CORE)
LIB = $(LIB_BUNDLED) $(LIB_EXTERNAL) $(LIB_LOCAL) $(LIB_WRF_HYDRO) $(NETCDF4_DEP_LIB)
LDFLAGS = $(OMP) $(FCFLAGS) $(LDFLAGS_LOCAL)
ENVCOMPDEFS =
WRF_CHEM = 0
CPPFLAGS = $(ARCHFLAGS) $(ENVCOMPDEFS) -I$(LIBINCLUDE) $(TRADFLAG)
NETCDFPATH = /util/opt/netcdf/4.7/pgi/20.4
HDF5PATH = /util/opt/hdf5/1.12/pgi/20
WRFPLUSPATH =
RTTOVPATH =
PNETCDFPATH =
bundled: io_only
external: io_only $(WRF_SRC_ROOT_DIR)/external/RSL_LITE/librsl_lite.a gen_comms_rsllite module_dm_rsllite $(ESMF_TARGET)
io_only: esmf_time wrfio_nf \
wrf_ioapi_includes wrfio_grib_share wrfio_grib1 wrfio_int fftpack
######################
------------------------------------------------------------------------
Settings listed above are written to configure.wrf.
If you wish to change settings, please edit that file.
If you wish to change the default options, edit the file:
arch/configure.defaults
NetCDF users note:
This installation of NetCDF supports large file support. To DISABLE large file
support in NetCDF, set the environment variable WRFIO_NCD_NO_LARGE_FILE_SUPPORT
to 1 and run configure again. Set to any other value to avoid this message.
Testing for NetCDF, C and Fortran compiler
This installation of NetCDF is 64-bit
C compiler is 64-bit
Fortran compiler is 64-bit
It will build in 64-bit
NetCDF version: 4.7.4
Enabled NetCDF-4/HDF-5: yes
NetCDF built with PnetCDF: no
*****************************************************************************
This build of WRF will use NETCDF4 with HDF5 compression
*****************************************************************************
[demo01@c0604.crane WRF]$ ./compile -j 4 em_real
Neither WRF_EM_CORE nor WRF_PLUS_CORE
are explicitly specified in shell environment....
copying Registry/Registry.EM to Registry/Registry
==============================================================================================
V4.4.1
No git found or not a git repository, git commit version not available.
Compiling: WRF_EM_CORE
WRFIO_NCD_LARGE_FILE_SUPPORT=1
Linux c0604.crane.hcc.unl.edu 4.18.0-372.19.1.el8_6.x86_64 #1 SMP Tue Aug 2 13:42:59 EDT 2022 x86_64 x86_64 x86_64 GNU/Linux
... <intermediate output omitted for clarity>
==========================================================================
build started: Wed Sep 28 22:11:46 CDT 2022
build completed: Wed Sep 28 22:46:42 CDT 2022
---> Executables successfully built <---
-rwxr-xr-x 1 demo01 demo 52380016 Sep 28 22:46 main/ndown.exe
-rwxr-xr-x 1 demo01 demo 52481680 Sep 28 22:46 main/real.exe
-rwxr-xr-x 1 demo01 demo 51706624 Sep 28 22:46 main/tc.exe
-rwxr-xr-x 1 demo01 demo 59986096 Sep 28 22:45 main/wrf.exe
==========================================================================
[demo01@c0604.crane WRF]$ ls main/*.exe
main/ndown.exe main/real.exe main/tc.exe main/wrf.exe
{{< /highlight >}}
{{% /panel %}}
If the build finishes successfully a message will be printed, and the four executables
(`ndown.exe`, `real.exe`, `tc.exe`, `wrf.exe`) will be present in the `main` directory.
## Building WPS
### Building WPS version 3.x
#### Apply patch
In order to build WPS 3.x successfully , the configure source file requires patching. For convenience,
these are contained in a single patch file which can be applied. Note that _applying the patch
should only be done **once** after unpacking the source code._ Subsequent builds (even after
running `clean -a`) do **not** require rerunning the patch command. Starting in the top level of
the WRF source code directory, the patch may be applied by running
{{% panel theme="info" header="Apply patch for WPSv3" %}}
{{< highlight code >}}
[demo01@c0604.crane WRF]$ wget {{< absurl "/attachments/wps3_configure.patch" >}}
[demo01@c0604.crane WRF]$ patch -b -p0 -i wps3_configure.patch
{{< /highlight >}}
{{% /panel %}}
#### Build WPSv3
{{% panel theme="info" header="Building WPSv3" %}}
{{< highlight code >}}
[demo01@c0604.crane WRF]$ module purge
[demo01@c0604.crane WRF]$ module load compiler/pgi/20 openmpi/4.0 WRF/v3
[acaprez@login.crane WPS]$ ls
arch compile external link_grib.csh namelist.wps namelist.wps.fire README util
clean configure geogrid metgrid namelist.wps.all_options namelist.wps.global ungrib wps4_configure.patch
[acaprez@login.crane WPS]$ ./configure
Will use NETCDF in dir: /util/opt/netcdf/4.7/pgi/20
Found what looks like a valid WRF I/O library in ../WRF
Found Jasper environment variables for GRIB2 support...
$JASPERLIB = /util/opt/jasper/2.0/pgi/20/lib
$JASPERINC = /util/opt/jasper/2.0/pgi/20/include
------------------------------------------------------------------------
Please select from among the following supported platforms.
1. Linux x86_64, gfortran (serial)
2. Linux x86_64, gfortran (serial_NO_GRIB2)
3. Linux x86_64, gfortran (dmpar)
4. Linux x86_64, gfortran (dmpar_NO_GRIB2)
5. Linux x86_64, PGI compiler (serial)
6. Linux x86_64, PGI compiler (serial_NO_GRIB2)
7. Linux x86_64, PGI compiler (dmpar)
8. Linux x86_64, PGI compiler (dmpar_NO_GRIB2)
9. Linux x86_64, PGI compiler, SGI MPT (serial)
10. Linux x86_64, PGI compiler, SGI MPT (serial_NO_GRIB2)
11. Linux x86_64, PGI compiler, SGI MPT (dmpar)
12. Linux x86_64, PGI compiler, SGI MPT (dmpar_NO_GRIB2)
13. Linux x86_64, IA64 and Opteron (serial)
14. Linux x86_64, IA64 and Opteron (serial_NO_GRIB2)
15. Linux x86_64, IA64 and Opteron (dmpar)
16. Linux x86_64, IA64 and Opteron (dmpar_NO_GRIB2)
17. Linux x86_64, Intel compiler (serial)
18. Linux x86_64, Intel compiler (serial_NO_GRIB2)
19. Linux x86_64, Intel compiler (dmpar)
20. Linux x86_64, Intel compiler (dmpar_NO_GRIB2)
21. Linux x86_64, Intel compiler, SGI MPT (serial)
22. Linux x86_64, Intel compiler, SGI MPT (serial_NO_GRIB2)
23. Linux x86_64, Intel compiler, SGI MPT (dmpar)
24. Linux x86_64, Intel compiler, SGI MPT (dmpar_NO_GRIB2)
25. Linux x86_64, Intel compiler, IBM POE (serial)
26. Linux x86_64, Intel compiler, IBM POE (serial_NO_GRIB2)
27. Linux x86_64, Intel compiler, IBM POE (dmpar)
28. Linux x86_64, Intel compiler, IBM POE (dmpar_NO_GRIB2)
29. Linux x86_64 g95 compiler (serial)
30. Linux x86_64 g95 compiler (serial_NO_GRIB2)
31. Linux x86_64 g95 compiler (dmpar)
32. Linux x86_64 g95 compiler (dmpar_NO_GRIB2)
33. Cray XE/XC CLE/Linux x86_64, Cray compiler (serial)
34. Cray XE/XC CLE/Linux x86_64, Cray compiler (serial_NO_GRIB2)
35. Cray XE/XC CLE/Linux x86_64, Cray compiler (dmpar)
36. Cray XE/XC CLE/Linux x86_64, Cray compiler (dmpar_NO_GRIB2)
37. Cray XC CLE/Linux x86_64, Intel compiler (serial)
38. Cray XC CLE/Linux x86_64, Intel compiler (serial_NO_GRIB2)
39. Cray XC CLE/Linux x86_64, Intel compiler (dmpar)
40. Cray XC CLE/Linux x86_64, Intel compiler (dmpar_NO_GRIB2)
Enter selection [1-40] : 5
------------------------------------------------------------------------
Configuration successful. To build the WPS, type: compile
------------------------------------------------------------------------
Testing for NetCDF, C and Fortran compiler
This installation NetCDF is 64-bit
C compiler is 64-bit
Fortran compiler is 64-bit
[acaprez@login.crane WPS]$ ./compile
==============================================================================================
Version 4.4
Linux login.crane.hcc.unl.edu 4.18.0-372.19.1.el8_6.x86_64 #1 SMP Tue Aug 2 13:42:59 EDT 2022 x86_64 x86_64 x86_64 GNU/Linux
pgf90 20.4-0 LLVM 64-bit target on x86-64 Linux -tp sandybridge
PGI Compilers and Tools
Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
==============================================================================================
**** Compiling WPS and all utilities ****
... <intermediate output omitted for clarity>
if [ -h int2nc.exe ] ; then \
/bin/rm -f int2nc.exe ; \
fi ; \
if [ -h ../int2nc.exe ] ; then \
/bin/rm -f ../int2nc.exe ; \
fi ; \
if [ -e src/int2nc.exe ] ; then \
ln -sf src/int2nc.exe . ; \
fi
[acaprez@login.crane WPS]$ ls
arch compile configure.wps geogrid link_grib.csh metgrid.exe namelist.wps.all_options namelist.wps.global ungrib wps4_configure.patch
clean configure external geogrid.exe metgrid namelist.wps namelist.wps.fire README util
[acaprez@login.crane WPS]$ ls util/
avg_tsfc.exe gfs.ncl int2nc.exe plotfmt.ncl plotgrids.ncl rd_intermediate.exe vertical_grid_50_20m_63km.txt
calc_ecmwf_p.exe gfs_old.ncl Makefile plotfmt_nc.ncl plotgrids_new.ncl src vertical_grid_70_20m_80km.txt
g1print.exe height_ukmo.exe mod_levs.exe plotgrids.exe plotgrids_old.ncl vertical_grid_38_20m_G3.txt
{{< /highlight >}}
{{% /panel %}}
WPS does not print an explicit "Successful Build" message, but if the build finishes successfully
no error messages should be present and several programs will exist in the `util` folder.
### Building WPS version 4.x
#### Apply patch
In order to build WPS 3.x successfully , the configure source file requires patching. For convenience,
these are contained in a single patch file which can be applied. Note that _applying the patch
should only be done **once** after unpacking the source code._ Subsequent builds (even after
running `clean -a`) do **not** require rerunning the patch command. Starting in the top level of
the WRF source code directory, the patch may be applied by running
{{% panel theme="info" header="Apply patch for WPSv4" %}}
{{< highlight code >}}
[demo01@c0604.crane WRF]$ wget {{< absurl "/attachments/wps4_configure.patch" >}}
[demo01@c0604.crane WRF]$ patch -b -p0 -i wps4_configure.patch
{{< /highlight >}}
{{% /panel %}}
#### Build WPSv4
{{% panel theme="info" header="Building WPSv4" %}}
{{< highlight code >}}
[demo01@login.crane WPS]$ ls
arch compile external link_grib.csh namelist.wps namelist.wps.fire README util
clean configure geogrid metgrid namelist.wps.all_options namelist.wps.global ungrib
[demo01@login.crane WPS]$ ./configure
Will use NETCDF in dir: /util/opt/netcdf/4.7/pgi/20
Found what looks like a valid WRF I/O library in ../WRF
Found Jasper environment variables for GRIB2 support...
$JASPERLIB = /util/opt/jasper/2.0/pgi/20/lib
$JASPERINC = /util/opt/jasper/2.0/pgi/20/include
------------------------------------------------------------------------
Please select from among the following supported platforms.
1. Linux x86_64, gfortran (serial)
2. Linux x86_64, gfortran (serial_NO_GRIB2)
3. Linux x86_64, gfortran (dmpar)
4. Linux x86_64, gfortran (dmpar_NO_GRIB2)
5. Linux x86_64, PGI compiler (serial)
6. Linux x86_64, PGI compiler (serial_NO_GRIB2)
7. Linux x86_64, PGI compiler (dmpar)
8. Linux x86_64, PGI compiler (dmpar_NO_GRIB2)
9. Linux x86_64, PGI compiler, SGI MPT (serial)
10. Linux x86_64, PGI compiler, SGI MPT (serial_NO_GRIB2)
11. Linux x86_64, PGI compiler, SGI MPT (dmpar)
12. Linux x86_64, PGI compiler, SGI MPT (dmpar_NO_GRIB2)
13. Linux x86_64, IA64 and Opteron (serial)
14. Linux x86_64, IA64 and Opteron (serial_NO_GRIB2)
15. Linux x86_64, IA64 and Opteron (dmpar)
16. Linux x86_64, IA64 and Opteron (dmpar_NO_GRIB2)
17. Linux x86_64, Intel compiler (serial)
18. Linux x86_64, Intel compiler (serial_NO_GRIB2)
19. Linux x86_64, Intel compiler (dmpar)
20. Linux x86_64, Intel compiler (dmpar_NO_GRIB2)
21. Linux x86_64, Intel compiler, SGI MPT (serial)
22. Linux x86_64, Intel compiler, SGI MPT (serial_NO_GRIB2)
23. Linux x86_64, Intel compiler, SGI MPT (dmpar)
24. Linux x86_64, Intel compiler, SGI MPT (dmpar_NO_GRIB2)
25. Linux x86_64, Intel compiler, IBM POE (serial)
26. Linux x86_64, Intel compiler, IBM POE (serial_NO_GRIB2)
27. Linux x86_64, Intel compiler, IBM POE (dmpar)
28. Linux x86_64, Intel compiler, IBM POE (dmpar_NO_GRIB2)
29. Linux x86_64 g95 compiler (serial)
30. Linux x86_64 g95 compiler (serial_NO_GRIB2)
31. Linux x86_64 g95 compiler (dmpar)
32. Linux x86_64 g95 compiler (dmpar_NO_GRIB2)
33. Cray XE/XC CLE/Linux x86_64, Cray compiler (serial)
34. Cray XE/XC CLE/Linux x86_64, Cray compiler (serial_NO_GRIB2)
35. Cray XE/XC CLE/Linux x86_64, Cray compiler (dmpar)
36. Cray XE/XC CLE/Linux x86_64, Cray compiler (dmpar_NO_GRIB2)
37. Cray XC CLE/Linux x86_64, Intel compiler (serial)
38. Cray XC CLE/Linux x86_64, Intel compiler (serial_NO_GRIB2)
39. Cray XC CLE/Linux x86_64, Intel compiler (dmpar)
40. Cray XC CLE/Linux x86_64, Intel compiler (dmpar_NO_GRIB2)
Enter selection [1-40] : 5
------------------------------------------------------------------------
Configuration successful. To build the WPS, type: compile
------------------------------------------------------------------------
Testing for NetCDF, C and Fortran compiler
This installation NetCDF is 64-bit
C compiler is 64-bit
Fortran compiler is 64-bit
[acaprez@login.crane WPS]$ ./compile
==============================================================================================
Version 4.4
Linux login.crane.hcc.unl.edu 4.18.0-372.19.1.el8_6.x86_64 #1 SMP Tue Aug 2 13:42:59 EDT 2022 x86_64 x86_64 x86_64 GNU/Linux
pgf90 20.4-0 LLVM 64-bit target on x86-64 Linux -tp sandybridge
PGI Compilers and Tools
Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
==============================================================================================
**** Compiling WPS and all utilities ****
... <intermediate output omitted for clarity>
if [ -h int2nc.exe ] ; then \
/bin/rm -f int2nc.exe ; \
fi ; \
if [ -h ../int2nc.exe ] ; then \
/bin/rm -f ../int2nc.exe ; \
fi ; \
if [ -e src/int2nc.exe ] ; then \
ln -sf src/int2nc.exe . ; \
fi
[acaprez@login.crane WPS]$ ls
arch compile configure.wps external geogrid.exe metgrid namelist.wps namelist.wps.fire README util
clean configure configure.wps.backup geogrid link_grib.csh metgrid.exe namelist.wps.all_options namelist.wps.global ungrib wps4_configure.patch
[acaprez@login.crane WPS]$ ls util/
avg_tsfc.exe gfs.ncl int2nc.exe plotfmt.ncl plotgrids_new.ncl src vertical_grid_70_20m_80km.txt
calc_ecmwf_p.exe gfs_old.ncl Makefile plotfmt_nc.ncl plotgrids_old.ncl vertical_grid_38_20m_G3.txt
g1print.exe height_ukmo.exe mod_levs.exe plotgrids.ncl rd_intermediate.exe vertical_grid_50_20m_63km.txt
{{< /highlight >}}
{{% /panel %}}
WPS does not print an explicit "Successful Build" message, but if the build finishes successfully
no error messages should be present and several programs will exist in the `util` folder.
## Running WRF
Example scripts for running WRF are provided [here](https://github.com/unlhcc/job-examples/tree/master/WRF).
{{ absURL (.Get 0) | chomp }}
--- arch/configure.defaults.org 2022-09-30 17:01:23.000000000 -0500
+++ arch/configure.defaults 2022-09-30 17:44:26.000000000 -0500
@@ -33,8 +33,7 @@
COMPRESSION_LIBS = CONFIGURE_COMP_L
COMPRESSION_INC = CONFIGURE_COMP_I
FDEFS = CONFIGURE_FDEFS
-NCARG_LIBS2 = -L${PGI}/linux86/6.1/lib -lpgftnrtl -lpgc \
- -L/usr/lib/gcc-lib/i386-redhat-linux/3.2.3 -lg2c
+NCARG_LIBS2 = -lpgftnrtl -lpgc
SFC = pgf90
SCC = pgcc
DM_FC = mpif90
@@ -153,8 +152,8 @@
COMPRESSION_LIBS = CONFIGURE_COMP_L
COMPRESSION_INC = CONFIGURE_COMP_I
FDEFS = CONFIGURE_FDEFS
-NCARG_LIBS2 = -L${PGI}/linux86-64/5.2/lib -lpgftnrtl -lpgc \
- -L/usr/lib64 -lg2c
+NCARG_LIBS2 = -lpgftnrtl -lpgc \
+ -L/usr/lib64
SFC = pgf90
SCC = pgcc
DM_FC = mpif90
--- arch/configure.defaults.org 2022-09-30 17:36:29.000000000 -0500
+++ arch/configure.defaults 2022-09-30 17:55:16.000000000 -0500
@@ -76,8 +76,8 @@
COMPRESSION_LIBS = CONFIGURE_COMP_L
COMPRESSION_INC = CONFIGURE_COMP_I
FDEFS = CONFIGURE_FDEFS
-NCARG_LIBS2 = -L${PGI}/linux86/6.1/lib -lpgftnrtl -lpgc \
- -L/usr/lib/gcc-lib/i386-redhat-linux/3.2.3 -lg2c
+NCARG_LIBS2 = -lpgftnrtl -lpgc \
+ -L${EXPAT}/lib -L${LIBXEXT}/lib -L${LIBPNG}/lib -L${BZIP2}/lib -L${ZLIB}/lib -L${CAIRO}/lib -L${FREETYPE}/lib
SFC = pgf90
SCC = pgcc
DM_FC = mpif90
@@ -198,8 +198,8 @@
COMPRESSION_LIBS = CONFIGURE_COMP_L
COMPRESSION_INC = CONFIGURE_COMP_I
FDEFS = CONFIGURE_FDEFS
-NCARG_LIBS2 = -L${PGI}/linux86-64/5.2/lib -lpgftnrtl -lpgc \
- -L/usr/lib64 -lg2c
+NCARG_LIBS2 = -lpgftnrtl -lpgc \
+ -L${EXPAT}/lib -L${LIBXEXT}/lib -L${LIBPNG}/lib -L${BZIP2}/lib -L${ZLIB}/lib -L${CAIRO}/lib -L${FREETYPE}/lib
SFC = pgf90
SCC = pgcc
DM_FC = mpif90
--- arch/configure_new.defaults.org 2022-09-30 15:28:56.000000000 -0500
+++ arch/configure_new.defaults 2022-09-30 16:08:20.000000000 -0500
@@ -1529,7 +1529,8 @@
RWORDSIZE = CONFIGURE_RWORDSIZE
PROMOTION = -r$(RWORDSIZE) -i4
ARCH_LOCAL = -DNONSTANDARD_SYSTEM_SUBR -DWRF_USE_CLM
-CFLAGS_LOCAL = -w -O3
+CFLAGS_LOCAL = -w -O3 -I/usr/include/tirpc
+LIB_LOCAL = -ltirpc
LDFLAGS_LOCAL =
CPLUSPLUSLIB =
ESMF_LDFLAG = $(CPLUSPLUSLIB)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment