Hello World: DGSWEM Fortran

This tutorial teaches you how to get to your first test case in DGSWEM, the experimental discontinous galerkin method counterpart for ADCIRC, on TACC systems.

Obtaining DGSWEM

There is a C version of DGSWEM and a Fortran version. We will focus on DGSWEM-Fortran, which can be obtained from a github repo (it’s private so you have to ask around).

Building DGSWEM

DGSWEM comes with its own makefile.

  • make sure you have intel compilers on

  • cd into the /work directory and run “make all”. This will automatically compile and link your program based on your runtime environment.

  • You should get a adcprep, adcpost, dgswem, and dgswem_serial binary

Build a test case

Zach from the water institute has graciously lended us a program to build a test case, which we will adapt for DGSWEM: . This code will generate us a rectangular beach with some incoming waves, with a specified amount of elements. Let’s create a 1000 element case for now.

  • python slopingbeach.py 1000 sb1000

  • output: sb1000 (mesh file), sb1000.15 (control file), sb1000.info (metadata)

Adapting the Test Case

The control file will have two options that are not valid in DGSWEM currently:

  • IM = 511112 Change this to 0.

  • NOUTGE = -3 (DGSWEM does not read NETCDF output yet). Change this to 1.

Prepping the Test Case

Make sure to have the fort.dg file in your directory, which contains some dgswem-specific options for it to read. Run ./adcprep. It will ask for the number of MPI ranks you want to run on, and the names of the input files.

Running the Test Case

Run ./padcirc (it doesn’t have write cores like adcirc). Afterwards run ./adcpost to grab and agglomerate the partitioned output files into one file.

 

Congrats! You have just run your first test case of dgswem!