Procedure

  1. Download the WRF source from the WRF website and unpack the archive.

  2. Change into the unpacked WRFV3 directory: 

    cd WRFV3/
  3. Set the environment variables HDFDIR and NETCDF to be the location of the HDF5 and NetCDF installation directories:

    export HDFDIR=/path/to/hdf5_install
    export NETCDF=/path/to/netcdf_install

    replacing /path/to/hdf_install and /path/to/netcdf_install with the paths to your HDF5 and NetCDF installations, respectively.

    Reminder: For the purposes of this guide, it is assumed that the Fortran NetCDF interface has been installed in the same location as the C library, thus they share the same lib and include directories.

  4. Add details of the HDF5 and NetCDF libraries to CCPFLAGS and LDFLAGS:

    export CPPFLAGS="-I${HDFDIR}/include -I${NETCDF}/include"
    export LDFLAGS="-L${HDFDIR}/lib -L${NETCDF}/lib -lnetcdf -lhdf5_hl -lhdf5 -lz"
  5. Turn on large file support, and unset Parallel NetCDF:

    export WRFIO_NCD_LARGE_FILE_SUPPORT=1
    unset PNETCDF
  6. Include NetCDF in the LD_LIBRARY_PATH:

    export LD_LIBRARY_PATH=${NETCDF}/lib:$LD_LIBRARY_PATH
  7. Add a stanza for Arm (AArch64) to the default configurations file arch/configure_new.defaults before the entry for Fujitsu FX10/FX100:

    ###########################################################
    #ARCH Linux aarch64, Arm compiler OpenMPI # serial smpar dmpar dm+sm
    #
    DESCRIPTION = Arm ($SFC/$SCC): Aarch64
    DMPARALLEL =
    OMPCPP = -fopenmp
    OMP = -fopenmp
    OMPCC = -fopenmp
    SFC = armflang
    SCC = armclang
    CCOMP = armclang
    DM_FC = mpif90
    DM_CC = mpicc -DMPI2_SUPPORT
    FC = CONFIGURE_FC
    CC = CONFIGURE_CC
    LD = $(FC)
    RWORDSIZE = CONFIGURE_RWORDSIZE
    PROMOTION =
    ARCH_LOCAL =
    CFLAGS_LOCAL = -w -O3 -c
    LDFLAGS_LOCAL = -fopenmp
    FCOPTIM = -O3 -mcpu=thunderx2t99 -fopenmp -funroll-loops -lamath
    FCREDUCEDOPT = $(FCOPTIM)
    FCNOOPT = -O0 -fopenmp -frecursive
    FCDEBUG = -g $(FCNOOPT)
    FORMAT_FIXED = -ffixed-form
    FORMAT_FREE = -ffree-form
    FCSUFFIX =
    BYTESWAPIO = -fconvert=big-endian
    FCBASEOPTS = -w $(FORMAT_FREE) $(BYTESWAPIO)
    MODULE_SRCH_FLAG = -module $(WRF_SRC_ROOT_DIR)/main
    TRADFLAG = -traditional-cpp
    CPP = /lib/cpp CONFIGURE_CPPFLAGS
    AR = ar
    ARFLAGS = ru
    M4 = m4 -B 14000
    RANLIB = ranlib
    CC_TOOLS = $(SCC)

    Note:

    The comment lines are required for the configure script to present the appropriate options at configure time.

  8. Build and configure WRF, using the configure script. The configure script uses the Arm Compiler settings provided in the stanza to build and configure WRF:

    ./configure
  9. The configure script prompts you to choose whether to compile a serial or parallel (with Distributed-Memory Parallelism, 'dmpar') version, and how to compile for nesting. For the purposes of this example build, select the serial build and choose no nesting.

  10. Use the WRF compile script to build the target wrf executable:

     ./compile wrf

    Note:

    Depending on your system configuration, you might need to remove the time command from the configuration generated to avoid the production of a large number of non-critical error reports at compile time. This does not impact the built executable.

    sed -i 's/time \$(DM_FC)/\$(DM_FC)/' ./configure.wrf
Previous Next