Jump to navigation Jump to search
Wiki Links Help Downloads
TUFLOW FV Wiki Main Page Products Support/Contact TUFLOW FV Downloads
TUFLOW FV Tutorials Requesting a Licence Tutorial Module Data
TUFLOW Classic/HPC Wiki TUFLOW FV Glossary Manuals


The RES_to_RES.exe is a utility available on the the TUFLOW website (Download TUFLOW FV utilities).

This utility performs a variety of operations on the TUFLOW FV 2D dat outputs. This page is split into two section, utility operations (e.g. maximum, difference etc.) and general options. The general options can be used regardless of operation being performed.


The section below contains a list of the operations that the utility can perform. One of these operations must be specified or the utility will generate an error.


Input Switch: -max
This can be used to extract the maximum from a number of input datasets. Any number of input files can be specified. The maximum value is written to the timestamp 111111.0

  • res_to_res.exe -2dm test.2dm -max results_1_h.dat
  • Extracts the maximum water level from all timesteps from a single dat file. Note manual specification of 2dm filename.

  • res_to_res.exe -max results_1_h.dat results_2_h.dat results_3_h.dat
  • Extracts the maximum water level from the three .dat files.


    Input Switch: -dif
    This can be used to compare two datasets. If a third file is specified, the third file is used as the output file. The output filename can also be specified with the -out option. The output is the first results minus the second result file.
    A special wet/dry algorithm is used. If water level results are not specified (_h.dat or -typeH), the algorithm opens these files, as well as opens the .2dm file associated with the results files, and uses the water levels and ZH Zpt values (for 2D cells) and elevations at the WLL triangle corners to determine whether a node (corner of an mesh element) is wet or dry. This allows two special values to be output in the event that a node is dry in one results file and wet in the other or vice versa. A value of -99 is used to indicate that a node is dry in the first results file, but is flooded in the second results file, while +99 indicates that the node was wet in the first results file but is dry in the second results file. Specifying -nowetdry does not carry out a wet/dry check using the water level results.
    The -t option can be used to carry out the difference at a particular time (rather than all times).

  • res_to_res.exe -dif results_developed_h.dat results_existing_h.dat
  • Extracts the difference in water level, the output is results_developed_h - results_existing_h for all timesteps.

  • res_to_res.exe -dif -typeH -nowetdry -t2 results_developed.dat results_existing.dat
  • Extracts the difference in water level for the maximum water level and suppresses the wet/dry check described above at time = 2 hours.


    Input Switch: -dur<cut of value>
    Determines the duration in hours that the the results exceed the cut of value.

  • res_to_res.exe -dur0.1 -typeD results.dat
  • Extracts the duration in flooding above 0.1m deep.


    Input Switch: -k<output time>
    Can be used to extract a single timestep from a results file. To keep a range of output times see the -range option below.

  • res_to_res.exe -k2 results_h.dat
  • Creates a new results file containing just the results for t = 2 hours.


    Input Switch: -rangeA<start time> -rangeB<end time>
    Extracts all timestep between start time and end time (inclusive) into a separate results file.

  • res_to_res.exe -rangeA1 -rangeB2.5 results_q.dat
  • Creates a new results file containing the outputs between 1.0 and 2.5 hours. Both 1 and 2.5 hour outputs are included.


    Input Switch: -r<output time>
    Creates a new output file and removes the output time from this.

  • res_to_res.exe -r3 results_d.dat
  • Creates a new output file which does not include the output at 3.

    Trim Values

    Input Switch: -trim<value>
    Creates a new output file which has any values above <value> set to <value>. If the input is a vector data, the vector magnitude is used to trim the value (direction is unchanged).

  • res_to_res.exe -trim5 -typeV results.xmdf
  • Creates a new output of velocity with any outputs greater than 5.0 set to 5.0.


    Input Switch: -times
    Creates a text file which contains the output times in the .dat. If no output filename is specified with the -out option the output file will be called "times.txt".

  • res_to_res.exe -times results_h.dat
  • Creates an an output file "times.txt" which contains all timesteps that are contained in the results file.

    Vector Angle

    Input Switch: -va
    Outputs the vector direction in degrees relative to north (North = 0°, East = 90°, South = 180°/-180°, West = -90°).

  • res_to_res.exe -va results_v.dat
  • Outputs the velocity direction for all timesteps in the results_V.dat file.


    Input Switch: -con
    Concatenates (joins) two or more results files into one. Each results file must be from the same 2dm mesh.

  • res_to_res.exe -con results1_h.dat results2_h.dat results3_h.dat
  • Joins the three files into a single .dat file.


    Input Switch: -conv
    Converts between .dat and .xmdf format results. Not to be confused with -con (concatenate option described above)!

  • res_to_res.exe -conv -typeH -t99999 results1.xmdf
  • Converts the maximum water level results in the xmdf file into .dat file format.

  • res_to_res.exe -conv results1.xmdf
  • Converts all datasets and times in the .xmdf file into .dat file format. This will output a number of .dat files.

  • res_to_res.exe -conv results1_h.dat
  • Converts all times in the .dat file into xmdf file format.

    General Options

    Batch Mode

    Input Switch: -b
    Batch mode suppresses prompt to press Enter at end of processing. Used in .bat files where two or more files are to be processed in succession.

    2dm Filename

    Input Switch: -2dm "2dm_filename"
    Explicitly specifies a .2dm file. By default RES_to_RES assumes the .2dm file has the same name as the .dat file. This command allows the user to manually specify the 2dm filename. Note: There must be a single space between -2dm and “<2dm_file>”.

    Time Search Tolerance

    Input Switch: -dttol<value>
    Manual specification of the timestamp search tolerance (hours).

    Output Filename

    Input Switch: -out "output_filename"
    Sets the output filename. This is not available for all outputs, particularly where multiple output files are required!