Output

SPECIFICATION OF RESULT FOLDER

  • RESULT_FOLDER: result folder name, e.g., RESULT_FOLDER = /Users/tmp/

SPECIFICATION OF OUTPUT VARIABLES

  • NumberStations: number of station for output. If NumberStations \(> 0\), need input i,j in STATIONS_FILE

  • OUTPUT_RES: integer parameter for output data resolution. e.g. 2 for print every 2 points

  • DEPTH_OUT: logical parameter for output depth. T or F.

  • U: logical parameter for output u. T or F.

  • V: logical parameter for output v. T or F.

  • ETA: logical parameter for output \(\eta\). T or F.

  • MASK: logical parameter for output wetting-drying MASK. T or F.

  • MASK9: logical parameter for output MASK9 (switch for Boussinesq/NSWE). T or F.

  • SourceX: logical parameter for output source terms in x direction. T or F.

  • SourceY: logical parameter for output source terms in y direction. T or F.

  • P: logical parameter for output of momentum flux in x direction. T or F.

  • Q: logical parameter for output of momentum flux in y direction. T or F.

  • Fx: logical parameter for output of numerical flux F in x direction. T or F.

  • Fy: logical parameter for output of numerical flux F in y direction. T or F.

  • Gx: logical parameter for output of numerical flux G in x direction. T or F.

  • Gy: logical parameter for output of numerical flux G in y direction. T or F.

  • AGE: logical parameter for output of breaking age. T or F.

  • HMAX: logical parameter for output of recorded maximum surface elevation . T or F.

  • HMIN: logical parameter for output of recorded minimum surface elevation . T or F.

  • UMAX: logical parameter for output of recorded maximum velocity . T or F.

  • VORMAX: logical parameter for output of recorded maximum vorticity . T or F.

  • MFMAX: logical parameter for output of recorded maximum momentum flux . T or F.

  • OUT_Time: logical parameter for output of recorded tsunami arrival time . T or F.

  • WaveHeight: logical parameter for output of wave height, Hsig, Hrms, Havg. T or F.

  • OUT_METEO: logical parameter for output of pressure field. T or F.

  • ROLLER: logical parameter for output of roller-induced flux. T or F.

  • UNDERTOW: logical parameter for output of undertow. T or F.

  • OUT_NU: logical parameter for output of breaking location. T or F.

OUTPUT FILES

The output files are saved in the result directory defined by RESULT_FOLDER in “input.txt”. Output file names are a combination of variable name and an output series number such as eta_00001, eta_00002, ..... The format and read/write algorithm are consistent with a depth file.

  • CENTRAL module

  • eta_xxxxx: surface elevation

  • u_xxxxx: velocity in the x direction

  • v_xxxxx: velocity in the y direction

  • mask_xxxxx: masks for wetting (1) and drying (0)

  • mask9_xxxxx: masks for wetting (1) and drying (0) defined in 9 points

  • hmax_xxxxx: maximum surface elevation

  • hmin_xxxxx: minimum surface elevation

  • umax_xxxxx: maximum velocity

  • MFmax_xxxxx: maximum momentum flux

  • VORmax_xxxxx: maximum vertical vorticiy

  • time_xxxxx: tsunami arrival time

  • p_xxxxx: volume flux in the x direction

  • q_xxxxx: volume flux in the y direction

  • nubrk_xxxxx: breaking induced eddy viscosity (when viscosity breaker is on)

  • etat_xxxxx: \(\eta_t\)

  • age_xxxxx: breaking age (in seconds)

  • roller_xxxxx: roller-induced mass flux

  • U_undertow_xxxxx: roller-induced extra undertow flux in the x direction

  • V_undertow_xxxxx: roller-induced extra undertow flux in the y direction

  • METEO module

  • Pstorm_xxxxx: air pressure

  • Ustorm_xxxxx: wind velocity in the x direction

  • Vstorm_xxxxx: wind velocity in the y direction

  • VESSEL module

  • Fves_xxxxx: gradient of mass flux induced by vessel (panel source)

  • Pves_xxxxx: pressure specified for the pressure source

  • SEDIMENT module

  • C_xxxxx: sediment concentration (g/l)

  • Pick_xxxxx: pickup rate

  • Depo_xxxxx: deposition rate

  • DchgS_xxxxx: depth change in suspended load

  • DchgB_xxxxx: depth change in bed load

  • BedFx_xxxxx: bedload flux in the x direction

  • BedFy_xxxxx: bedload flux in the y direction

  • dep_xxxxx: depth

Station files

To get time series of surface elevation, u and v at interested locations, you can specify a station file which includes the locations for output. Station input files (e.g., gauges.txt) have size (# of stations) x 2, where column 1 contains Mglob location (unit = grid points) and column 2 contains Nglob location (unit = grid points). In 1D cases, the Nglob location (second column) needs to be set to 1 for all gauges; if set to 0, station files will not be outputted.

  • in “input.txt”, add NumberStations = <integer number of stations>

  • in “input.txt”, STATIONS_FILE = <file name, e.g., gauges.txt>

  • format of STATIONS_FILE: two integers for grid points in x and y, respectively.

Example: refer to Example: station file

Output for stations is a series of numbered files such as sta_0001, sta_0002 .... (NOTE: four digit numbers here vs. five digit numbers for 2D output like eta_00001). The output file for stations contains four columns: time, eta, u, and v.

The version after 3.4 uses a buffer to write out stations to speed up the program on a large scale HPC. The array dimensions for the buffer are (StationOutputBuffer,NumberStations,4), where StationOutputBuffer = 1000 by default. You can also specify StationOutputBuffer in input.txt. An example to set StationOutputBuffer is in /simple_cases/tide_constant/.

TOTAL_TIME = 200.0
PLOT_INTV = 1.0
PLOT_INTV_STATION = 0.5
SCREEN_INTV = 1.0
StationOutputBuffer = 100
  • ASCII format

    The default format is ASCII. The format and read algorithm are consistent with a depth file.

    A station file contains four columns, which are values of time (s), eta (m), u (m/s) and v (m/s), respectively.

  • BINARY format

    When FIELD_IO_TYPE = BINARY is specified in “input.txt”, the 2D output files such as eta_00001, ... are in the binary format. Here’s an example of reading in:

    MATLAB:

    fileID = fopen('eta_00001');
    
    eta = fread(fileID,[Mglob Nglob],'*double');
    
    fclose(fileID);
    
    pcolor(eta),shading flat
    

    PYTHON:

    def readBathyData(outputDir, args):
       """Function that reads in FUNWAVE's bathy data from: dep.out in output directory."""
    
       bathyFileName = os.path.join(outputDir, 'dep.out')
    
       # read in and convert into 2D numpy array if binary fieldiotype
       fieldIOType = args.fieldiotype # 'ascii' or 'binary'
    
       if fieldIOType == 'ascii':
          bathy = np.loadtxt(bathyFileName)
          (Ny, Nx) = bathy.shape # [Nglob,Mglob]
    
       else:
          Ny = args.nglob    # if not included in args, manually set Nx, Ny
          Nx = args.mglob
    
          # option 1
          bathy = np.fromfile(bathyFileName).reshape(Ny,Nx)
    
          # option 2
          with open(bathyFileName, 'rb') as file: # 'rb' is used to read binary in windows, on linux you can use 'r'
          bathy_file = file.read()
          bathy = np.frombuffer(bathy_file, dtype=np.float32)
          bathy = bathy.reshape(Ny, Nx)
    
          # option 3
          fin = open(bathyFileName, mode='rb')
          dataType = np.dtype([('elev', '<f8', Ny*Nx)])
          bathyNotParsed = np.fromfile(fin, dtype=dataType)
          bathy = np.zeros([Ny,Nx])
          for j in range(Nx):
            for i in range(Ny):
              bathy[i,j] = bathyNotParsed[0][0][(j*Ny)+i]
    
       return bathy
    

    Station files do not have Binary format.

  • Other format

    Other formats such as NetCDF and HDF5 are also provided but not distributed in the master Github repository.