build_wps - UK-FVCOM-Usergroup/uk-fvcom GitHub Wiki

#!/usr/bin/env bash

set -eu

# Run this after building the WRF libraries and WRF itself.

# Set up the build environment
module load mpi/mpich-x86_64                      # for parallel runs

# Where are we?
cwd=$(readlink -f $(pwd))

# Environment variables
export CC=gcc
export CXX=g++
export FC=gfortran
export FCFLAGS=-m64
export F77=gfortran
export FFLAGS=-m64

# More environment variables for building WPS
export NETCDF=$cwd/../LIBRARIES/netcdf            # for linking with netCDF libraries.
export PATH=$cwd/../LIBRARIES/netcdf/bin:$PATH    # for netCDF utilities (nc-config).
export JASPERINC=$cwd/../LIBRARIES/grib2/include  # for GRIB support.
export JASPERLIB=$cwd/../LIBRARIES/grib2/lib      # you may need to yum install these.
export WRFIO_NCD_LARGE_FILE_SUPPORT=1             # enable large file support in netCDF.
unset MPI_LIB                                     # to stop errors due to trying for a parallel build

$cwd/clean                                        # start from a clean slate.

if [ ! -f $cwd/configure.wps ]; then
    $cwd/configure                                # pick option 1 (parallel is only for very large domains)
fi

# GO GO GO!
$cwd/compile 2>&1 | tee make.log                  # make the binaries and save output to a log file.