Skip to content

Data Format B-25 – Time and Spatial Varying Fields (TVF)

Data Format B-25 Time and Spatial Varying Fields (TVF)

ASCII File Format for TVF

The ASCII File Format of TVF data contains two parts, firstly the file header and then the actual data. Example of an ASCII File Format:

* TIME VARIABLE FORCING FIELD DATA - Version: XX

* Project Title: XXX

*

* INPT: Input format = 0: ((VALUES(T,N,L,K), K=1,KC), L=2,LA), N=1,NC)

* = 1: L,I,J, (((VALUES(T,N,L,K), K=1,KC), L=1,NL), N=1,NC)

* NT: Number of time steps

* NC: Number of components (e.g., 1 for pressure, 2 for wind-X, wind-Y)

* NL: Number of cells (Should = LA - 1 OR LC - 2)

* NK: Number of layers (Default = 1)

* ITRP: Interpolation between time steps (0 = No interp., 1 = Linear interp.)

* IUPD: Flag to direct how to update the current cell value with the field value

* 0: Cell value will be replaced by the field value

* 1: Cell value will be added with the field value

* 2: Cell value will be the min. of the current value and the field value

* 3: Cell value will be the max. of the current value and the field value

* IDST: Data operation after interpolation

* 0: Cell value = field value

* 1: Cell value = field value multiplies cell area

* NODAT: No data. No update for cells with this field value

* TSCL: Time conversion factor to seconds (should > 0, default 86400)

* TSHF: Time shift (the same units as times, default 0)

* VSCL: Value conversion factor to model units (should > 0, default 1)

* VSHF: Value shift (the same units as values, default 0)

* YY MM DD: Base date

*

* INPT NT NC NL NK ITRP IUPD IDST NODAT TSCL TSHF VSCL VSHF YY MM DD

0 721 1 3372 1 1 0 0 -999 86400 0 1 0 2005 01 01

234.875000 3372

1.00969e+3 1.00969e+3 1.00969e+3 1.00969e+3 1.00969e+3 1.00969e+3 1.00968e+3 1.00968e+3 1.00968e+3 1.00968e+3

1.00968e+3 1.00968e+3 1.00968e+3 1.00967e+3 1.00967e+3 1.00967e+3 1.00967e+3 1.00967e+3 1.00967e+3 1.00967e+3

1.00966e+3 1.00966e+3 1.00966e+3 1.00966e+3 1.00966e+3 1.00966e+3 1.00966e+3 1.00966e+3 1.00965e+3 1.00965e+3

…

a) ASCII File Header for TVF

The file header may start with comment lines which begin with an asterisk for descriptive information. The file header ends with one data line contains information on the TVF data as follows:

Explanation of the header fields:

Table 1: Description of the data field in TVF file header

INPT

Input format:

INPT = 0: The number of values and its order for each component the field in each time step is the same as grid cells.

INPT = 1: The number of values each component the field in each time step can be less than the number of the grid cells but the data lines should have cell indices (NL, IC, JC) in front of data values.

NT Number of time steps.
NC

Number of components.

NC=1 for bathymetry, bottom roughness, barometric pressure, etc.

NC=2 for wind fields (X and Y components of wind speed).

NL Number of grid cells. This is for QC to ensure the data matches the model grid.
NK number of vertical layers (NK = 1 for this version).
ITRP

Interpolation option:

ITRP = 0: no interpolation, direct field applied at each time step.

ITRP = 1: linear interpolation between time steps.

IUPD

Flag to direct EFDC on how to update the current cell value with the reading value.

IUPD = 0: The cell value will be replaced by the reading value.

IUPD = 1: The cell value will be added with the reading value.

IUPD = 2: The cell value will be the min. of the current cell value and the reading value.

IUPD = 3: The cell value will be the max. of the current cell value and the reading value.

IDST

Specific option for data operation after interpolation

IDST = 0: Cell value = field value

IDST = 1: Cell value = field value multiplies cell area

TSCL Conversion factor to convert time values to seconds (default 86400)
TSHF Time offset having the same unit as time values (default 0)
VSCL Conversion factor to convert the field values to the same units as in EFDC (default 1)
VSHF Value offset having the same unit as the field values (default 0)
NODAT No data value. Cells having this value will not change/not be updated by reading values.
YY The year of the base date
MM The month of the base date
DD The day of the base date

b) ASCII File Data Blocks for TVF

Each data block for one time step begins with the time value (in Julian days from the base date) and a number of grid cells to which the data will be applied (should be the same as NL for INPT = 0).

For INPT = 0, the number of the data values in each block should be NC × NL × NK values and the FORTRAN command to read the data is as follows

READ(UNIT) TIMES(T), NL

READ(UNIT) (((VALUES(T,N,L,K), K=1,NK), L=2,LA), N=1,NC)

For INPT = 1, the number of the data values in each block can vary and the FORTRAN command to read the data is as follows

READ(UNIT) TIMES(T), NLA

READ(UNIT) L,I,J,(((VALUES(T,N,L,K), K=1, NK), LL=1, NLA), N=1,NC)

Binary File Format for TVF

The values and their orders in the binary file format are the same as the ASCII file format except it has no comments but a specific signature for this file format.

a) Binary File Header

The file header has a length of 80 bytes with the data fields are as the table bellows:

Description of the data field in a binary TVF file header

Byte Offset Length (bytes) Data type Description
0 4 Integer SIGNATURE (integer value 826559558 or hexadecimal value 0x31444C46 or characters "FLD1")
4 4 Integer INPT
8 4 Integer NT
12 4 Integer NC
16 4 Integer NL
20 4 Integer NK
24 4 Integer ITRP
28 4 Integer IUPD
32 4 Integer IDST
36 4 Float NODAT
40 4 Float TSCL
44 4 Float TSHF
48 4 Float VSCL
52 4 Float VSHF
56 4 Integer YY
60 4 Integer MM
64 4 Integer DD
68 4 Integer Reserved
72 4 Integer Reserved
76 4 Integer Reserved

b) Binary Data Blocks for TVF

The data blocks of the binary format contain values the same as the ASCII file format.

For INPT = 0, the number of the data values in each block should be NC × LC × NK values and the FORTRAN command to read the data is as follows

Byte Offset Length (bytes) Data type Description
0 8 Double Time
8 4 Integer Number of grid cells (NL)
12 4*NK*NL*NC Single Values

For INPT = 1, the number of the data values in each block can vary and the FORTRAN command to read the data is as follows

Byte Offset Length (bytes) Data type Description
0 8 Double Time
8 4 Integer Number of grid cells having data in the block (NLA)
12 4 Integer Cell index L
16 4 Integer Cell index I
20 4 Integer Cell index J
24 4*NK*NLA*NC Single Values

Data series from an individual cell prior to EE generating field file.

C #time steps, series ID,

C time step, value.

74496 L001
0.00000000000 4.785
0.01041666666 4.785
0.02083333334 4.785
0.03125000000 4.785
0.04166666666 4.785
0.05208333334 4.785
0.06250000000 4.785

This is the ASCII *FLD.INP files that EE generates from this data.

* ITYPE NT NC LC NK ITOPT IUPDATE IFLAG NODATA
0 2413 1 2121 1 0 0 0 -999
237.000000
1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992
1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992
1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992
1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992
1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992
1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992
1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992
1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992
1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992
1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992
1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992
1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992
1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992 1009.992