Odds and Ends

Build ADCIRC using CMake

Gone are the days of having to use config.guess and sed replcements to customize the cmplrflags.mk for your environement.

Here is the process to build the ADCIRC hydrodynamic model using CMake from the command line on a GNU/Linux host. The CMake infrastructure has only been available in the last few releases of ADCIRC, and this example uses v55.00 from the compressed tar archive of the code. The options specified below enable serial adcirc, distributed parallel padcirc, coupled serial adcswan (ADCIRC+SWAN), and the parallel coupled padcswan model. Standalone parallel SWAN and unstructured SWAN models are also configured, along with the adcprep ADCIRC pre-processor and other utilities.

Historically, linking to NetCDF can be tricky. Care should be taken to point to the desired NetCDF version/location which includes the Fortran libs as well. This configuration enables NetCDF input/output options for ADCIRC using the enabled or default NetCDF accessible on the user’s path.

# Extract model source
tar xvzf adcirc_v55.00.tar.gz

# Create build directory
mkdir -p adcirc_v55.00/build
cd adcirc_v55.00/build

# Configure compilation for host environment
cmake .. \
  -DBUILD_ADCIRC=ON \
  -DBUILD_PADCIRC=ON \
  -DBUILD_ADCSWAN=ON \
  -DBUILD_PADCSWAN=ON \
  -DBUILD_ADCPREP=ON \
  -DBUILD_UTILITIES=ON \
  -DBUILD_ASWIP=ON \
  -DBUILD_SWAN=ON \
  -DBUILD_PUNSWAN=ON \
  -DENABLE_OUTPUT_NETCDF=ON \
  -DNETCDFHOME=$(nc-config --prefix)

# Run make to compile (like normal)
make

CMake is a separate executable that may need to be installed on the system. For an Ubuntu or Debian based system it is as simple as this:

sudo apt install cmake
Tags: wave hpc mpi tacc netcdf metocean ugrid