overConvert Version 2.0h

Author: Shishir Pandya

Description:

overConvert is a front-end to the FFIO Library for converting You can convert between
It auto-detects the file type. Possible file types are:
    PLOT3D grid,
    PLOT3D solution,
    PLOT3D function,
    OVERFLOW-1 solution,
    OVERFLOW-2 solution,
    OVERFLOW-2 solution with 2nd order restart,
    X-rays,
    INTOUT,
    XINTOUT,
    CART3D tri, and
    CART3D triq files

It also auto-detects the appropriate attributes. The exhaustive list of attributes is:
  Ascii (all file types), Unformatted (all file types), or Binary (plot3d grid only)
      Note: If Ascii, the file is assumed to be single-precision and
            the user must specify if it is an x, Q, tri or triq file
  If Unformatted, it figures out the rest:
        Machine Endian: little or Big
        File Endian: little or Big
        Precision: single or double
        Grid: Single or Multiple-grid
        Iblanks: With or Without
        2D or 3D
        number of grids or X-rays
  If Binary, it figures out the same attributes as Unformatted except it assumes the grid is always in Multiple-grid format.
 
It gives you the option of writing the file out in Ascii, little-endian, big-endian, or the machine's native endian
                                                in single or double precision.
By default, it preserves the endian and precision of the input file.

Details of it's implementation are given in the overConvert.pdf file.

The FFIO Library
===================
The library is a set of routines that can be called from Fortran or C to perform various IO functions.
These IO functions can be used to


The IO Library Consists of 6 modules:
   FileEndian
   FileType
   FileRead
   FileWrite
   ReadRec
   WriteRec

The callable routines in the library are listed below for each module.

FileEndian
----------
  This includes routines for
   -chkBigEndian: Checking the machine endian
   -file_endian:  Checking the file endian
   -read_int:     reading a single integer in either endian
   -write_int:    writing a single integer in either endian
   -swap_bytes:   swapping a number from one endian to another
   -cmp_rec_markers: Comparing record markers in an unformatted file

FileType
--------
  This includes routines to get file type and attributes
   -isAscii: Is the file Ascii or unformatted?
   -fileType: inputs: file pointer, verbose flag
              outputs:rbs (byteswap flag),
                      type (an array of file attributes)
                         type[0] : 0=Unformatted, 1=ASCII
                         type[1] : 0=Single grid, 1=mg
                         type[2] : 0=2D, 1=3D
                         type[3] : 0=No iBlanks, 1=iBlanks
                         type[4] : Number of grids in file (xrays for xray files)
                         type[5] : 4=Single precision, 8=Double precision
                         type[6] : 0=Little endian, 1=Big endian, 801=error
                         type[7] : File endian: 0=Little, 1=Big, 801=error
                         type[8] : Q is: 0=plot3d, 1=Overflow, 2=Overflow2, 3=Overflow2+2nd order restart, -1=plot3d function
                         type[9] : File type = 0 for a grid file
                                               1 for a plot3d q file
                                               1 for a plot3d function file
                                               1 for an Overflow1 q file
                                               2 for an Overflow2 q file (has an additional trailing record)
                                               3 for an Overflow q file with 2nd order restart info
                                               4 for an xray file
	                                       5 for an INTOUT file
	                                       6 for an XINOTOUT file
	                                       7 for a tri file
	                                       8 for a triq file
	                                    or 9 for undetermined
   -countRecords: count the number of records in a file
   -skip_rec: skip the next record in a file
              (You must be at the beginning of a record to do this)

FileRead
--------
  This is a set of reading routines that depend on the data types defined by the IOLib.
   -readX_ascii:     Read an Ascii grid file
   -readX_unf:       Read an unformatted single-precision grid file
   -readX_ieee:      Read an unformatted double-precision grid file
   -readQ_ascii:     Read an Ascii Q file (There is no such thing as an Ascii Overflow Q file)
   -readQ_unf:       Read an unformatted Q file (single and double-precision)
   -readF_unf:       Read an unformatted PLOT3D function file (single and double-precision)
   -readXray_unf:    Read an unformatted Xray file
   -readIntout_unf:  Read an unformatted INTOUT file
   -readXIntout_unf: Read an unformatted XINTOUT file
   -readTriASCII:    Read an ASCII tri/triq file
   -readTri:         Read a unformatted tri file
   -readTriQ:        Read a unformatted triq file

FileWrite
---------
  This is a set of writing routines that depend on the data types defined by the IOLib.
   -writeX_ascii:     Write an Ascii grid file
   -writeX_unf:       Write an unformatted grid file
   -writeQ_ascii:     Write an Ascii Q file
   -writeQ_unf:       Write an unformatted Q file
   -writeF_unf:       Write an unformatted PLOT3D function file
   -writeXray_unf:    Write an unformatted Xray file
   -writeIntout_unf:  Write an unformatted INTOUT file
   -writeXIntout_unf: Write an unformatted XINTOUT file
   -writeTriASCII:    Write an ASCII tri/triq file
   -writeTri:         Write a unformatted tri file
   -writeTriQ:        Write a unformatted triq file

ReadRec
-------
  This is an interface for Overgrid and other external programs (including fortran) to read files
   -readX_ngrid_ASCII:    Read number of grids from an ASCII file
   -readX_dim_ASCII:      Read the grid dimensions from an ASCII file
   -readX_ASCII:          Read XYZs from an ASCII file
   -readX_ngrid:          Read number of grids from a unformatted file
   -readX_dim:            Read the grid dimensions from a unformatted file
   -readX_unf_sp:         Read the single precision XYZs
   -readX_unf_dp:         Read the double precision XYZs
   -readQ_dim:            Read the grid dimensions from a Q file
   -readF_dim:            Read the grid dimensions from a PLOT3D function file
   -readQ_header_sp:      Read the q-header from a single precision Q file
   -readQ_header_sp:      Read the q-header from a double precision Q file
   -readQ_unf_sp:         Read the Q variables froma single precision Q file
   -readQ_unf_dp:         Read the Q variables froma double precision Q file
       Use readX_ngrid to read number of xrays
   -readXray_xbox_sp:     Read the xbox from a single precision Xray file
   -readXray_xbox_dp:     Read the xbox from a double precision Xray file
   -readXray_iptr:        Read Iptr from an Xray file
   -readXray_zpt_sp:      Read zpt from a single precision Xray file
   -readXray_zpt_dp:      Read zpt from a double precision Xray file
   -readINTOUT_dim:       Read INTOUT dimensions
   -readINTOUT_JDJIDJ_sp: Read single precision record containing JB,KB,LB,ID,JI,KI,LI,DJ,DK,DL
   -readINTOUT_JDJIDJ_dp: Read double precision record containing JB,KB,LB,ID,JI,KI,LI,DJ,DK,DL
       Use readXINTOUT_iblank to read iblanks from an INTOUT file
       Use readX_ngrid to read the number of grids from an XINTOUT file
   -readXINTOUT_dim:      Read XINTOUT dimensions
   -readXINTOUT_JIDJ_sp:  Read single precision record containing JI,KI,LI,DJ,DK,DL
   -readXINTOUT_JIDJ_dp:  Read double precision record containing JI,KI,LI,DJ,DK,DL
   -readXINTOUT_JB:       Read record containing JB,KB,LB,IBC
   -readXINTOUT_iblank:   Read iblanks
   -readTriDim_ASCII:     Read dimensions from an ASCII tri/triq file
   -readTriXYZ_ASCII:     Read XYZs from an ASCII tri/triq file
   -readTriCon_ASCII:     Read connectivity info from an ASCII tri/triq file
   -readTriComp_ASCII:    Read components numbers from an ASCII tri/triq file
   -readTriQRec_ASCII:    Read the Q variables from an ASCII triq file
   -readTriDim:           Read dimensions from a unformatted tri file
   -readTriQDim:          Read dimensions from a unformatted triq file
   -readTriXYZ:           Read XYZs from a unformatted tri/triq file
   -readTriCon:           Read connectivity info from a unformatted tri/triq file
   -readTriComp:          Read components numbers from a unformatted tri/triq file
   -readTriQRec:          Read the Q variables from a unformatted triq file

WriteRec
--------
  This is an interface for Overgrid and other external programs (including fortran) to write files
   -writeX_ngrid:          Write number of grids
   -writeX_dim:            Write the grid dimensions
   -writeX_unf_sp:         Write the single precision XYZs
   -writeX_unf_dp:         Write the double precision XYZs
   -writeQ_dim:            write the grid dimensions to a Q file
   -writeF_dim:            write the grid dimensions to a PLOT3D function file
   -writeQ_header_sp:      write the q-header from a single precision Q file
   -writeQ_header_sp:      write the q-header from a double precision Q file
   -writeQ_unf_sp:         write the Q variables froma single precision Q file
   -writeQ_unf_dp:         write the Q variables froma double precision Q file
       Use writeX_ngrid to write number of xrays
   -writeXray_xbox_sp:     Write the xbox from a single precision Xray file
   -writeXray_xbox_dp:     Write the xbox from a double precision Xray file
   -writeXray_iptr:        Write Iptr from an Xray file
   -writeXray_zpt_sp:      Write zpt from a single precision Xray file
   -writeXray_zpt_dp:      Write zpt from a double precision Xray file
   -writeINTOUT_dim:       Write INTOUT dimensions
   -writeINTOUT_JDJIDJ_sp: Write single precision record containing JB,KB,LB,ID,JI,KI,LI,DJ,DK,DL
   -writeINTOUT_JDJIDJ_dp: Write double precision record containing JB,KB,LB,ID,JI,KI,LI,DJ,DK,DL
       Use writeXINTOUT_iblank to write iblanks into an INTOUT file
       Use writeX_ngrid to write the number of grids to an XINTOUT file
   -writeXINTOUT_dim:      Write XINTOUT dimensions
   -writeXINTOUT_JIDJ_sp:  Write single precision record containing JI,KI,LI,DJ,DK,DL
   -writeXINTOUT_JIDJ_dp:  Write double precision record containing JI,KI,LI,DJ,DK,DL
   -writeXINTOUT_JB:       Write record containing JB,KB,LB,IBC
   -writeXINTOUT_iblank:   Write iblanks
   -writeTriDim_ASCII:     Write dimensions to an ASCII tri/triq file
   -writeTriXYZ_ASCII:     Write XYZs to an ASCII tri/triq file
   -writeTriCon_ASCII:     Write connectivity info to an ASCII tri/triq file
   -writeTriComp_ASCII:    Write components numbers to an ASCII tri/triq file
   -writeTriQRec_ASCII:    Write the Q variables to an ASCII triq file
   -writeTriDim:           Write dimensions to a unformatted tri file
   -writeTriQDim:          Write dimensions to a unformatted triq file
   -writeTriXYZ:           Write XYZs to a unformatted tri/triq file
   -writeTriCon:           Write connectivity info to a unformatted tri/triq file
   -writeTriComp:          Write components numbers to a unformatted tri/triq file
   -writeTriQRec:          Write the Q variables to a unformatted triq file

Usage:

overConvert -i input_filename [-o output_filename] [-v] [-l|-b|-n|-a|-f] [-x|-q|-r|-int|-xint|-tri|-triq] [-sp|-dp] [-nobl|-addbl|-resetbl] [-bin|-srec|npmax] [-h|-s]
      -i       Input_filename.
      -o       Output_filename.
               If -o output_filename is omitted, report input file attributes only.
      -v       Activate verbose mode to print input file attributes.
                (Can specify up to 3 times to add verbosity).
      -l       Write little endian output file.
      -b       Write big endian output file.
      -n       Write an unformatted file in the machine's native endian.
      -f       Force conversion to opposite endian (for .tri files).
      -a       Write an ASCII file [default if infile is Ascii].
      -x       Force input filetype to be a grid file.
      -q       Force input filetype to be a Q file.
      -r       Force input filetype to be an X-ray file.
      -int     Force input filetype to be an INTOUT file.
      -xint    Force input filetype to be an XINTOUT file.
      -tri     Force input filetype to be a tri file.
      -triq    Force input filetype to be a triq file.
      -sp      Force output filetype to be single precision.
      -dp      Force output filetype to be double precision.
      -nobl    Write output without iblank information.
      -addbl   Write output with default iblanks.
      -resetbl Overwrite iblanks to replace with default values.
      -bin     Write binary file (stream access without record markers).
               Can use -npmax with this option to split large grids on output.
      -srec    Write unformatted file with sub-record markers for large grids.
               If this option is specified and no large grids exist,
                 a regular unformatted file is written.
               Use this option to convert from binary to regular unformatted file.
               Can use -npmax with this option to split large grids on output.
      -npmax   Specify maximum number of points allowed in a grid. If a grid exceeds
                 this value, the grid will be split in the largest index direction.
               By default, a large grid is not split, and gets written with
                 attributes of the incoming file (binary or sub-records).
               Use -bin or -srec with -npmax to specify file attribute.
      -h       Return output in human readable format.
      -s       Sort output by grid size.
       Default behavior is to auto-detect if input filetype is x or q

Last modified: Mon Apr 13 16:08:16 PDT 2026