Program Structure

The file structure of Grid2Grid is shown in the following tree structure. The cmake directory contains CMake definitions. The doc directory contains Grid2Grid documentation files. The example directory contains examples for interfacing Grid2grid with other languages. The src/libGrid2Grid is the source code directory of Grid2Grid and is composed of several modules.

The program structure of Grid2Grid is depicted in Fig. 1. The program is composed of several modules (.f90) with a suffix mod. HOS wave fields are generated by modSurf2Vol from the HOS result file (modes_HOS_SWENSE.dat or modes_HOS_SWENSE.hdf5). Since the results files only contains modes information, the volumic wave fields is reconstructed on the HOS grid by inverse FFTs (denoted as \(H_2\) Operator). The volumic wave field in Grid2Grid at the certain time step is called as a snapshot of wave field. modVol2Vol constructs an interpolation data structure from several snapshots of wave field by using multidimensional spline module (Williams [2015]). modVol2Vol can directly compiled with other fortran program if the same Fortran compiler is used (gfortran>4.9.2). modGrid2Grid generates shared library named as libGrid2Grid.so to communicate with other languages. Standard program language rule ISO_C_BINDING is required to communicate with the library Grid2Grid. The examples are given in directory example. modPostGrid2Grid is a post processing module of Grid2Grid generating the HOS wave fields for the 3D visualization(VTK format) and the wave elevation time series.

Program Structure of ``Grid2Grid``

Fig. 1 Program Structure of Grid2Grid

The main feature of each module is following.

  • modSurf2Vol: HOS-Ocean and NWT classes and reconstructed HOS wave fields

  • modVol2Vol: Interpolate reconstructed HOS wave fields

  • modGrid2Grid: Communication with other language with ISO_C_BINDING

  • modPostGrid2Grid: Post processing of HOS (wave fields and elevation)

  • modFourier_r2c_FFTW: Interface module of FFTW open library

  • modHDF5Interface: Interface module of HDF5 open library

  • modGrid2GridGeneral: Grid2Grid global variables and auxiliary functions