ASCII Input Files

From CIRPwiki
Jump to navigation Jump to search

If ASCII input files are required for whatever reason, the user can enter a Card into the parameter file, *.cmcards, that will instruct the CMS to write out ASCII representations of the input specified in various XMDF files. The CMS will then go through each input type and take the information and write it back out into separate ASCII files for each boundary type.

CMS-Flow cards used to output SMS ASCII input files.

Card Arguments Description Default value
WRITE_ASCII_INPUT_FILES ON | OFF Outputs all ASCII files OFF

Due to the large number of possible files for a large project, the CMS will create a subdirectory named "ASCII_Input" within the initial project directory location and place the files there.

To ensure that the ASCII file CMS writes out can potentially be read back into the SMS, file formats that are already supported in the SMS were chosen to hold the information for various types of information.

Boundary Conditions

Boundary conditions are specified along an external or internal a string of cells. For each boundary, a folder containing information is written to the file.

There are three presently supported boundary condition types (River flux, Water Level, and Tidal/Harmonic) for ASCII input. Others, such as Nested boundaries and Extracted WSE/Velocity will follow later.

For each boundary condition, there will be one Boundary ID file and one or more Boundary Condition forcing data files.

Boundary ID file

There may be multiple instances of River Flux and WSE boundary conditions for a single project. The cell IDs for all boundaries are written to one Boundary ID file.

  • Filename - <project>*.bid !Example: Phase2.bid

File format for ASCII contents of file

<ns> !# of cellstrings/boundary conditions of each type
<nc> !# of cells in string #1
    <ID(1)>
    ...
    <ID(nc)>
<nc> !# of cells in string #2
    <ID(1)>
    ...
    <ID(nc)>
...
<nc> !# of cells in string #ns
    <ID(1)>
    ...
    <ID(nc)>

Boundary Condition forcing data files

There will be one forcing data file for each Boundary Condition of each type.

Each type of boundary condition is denoted by <BC_type> below. <BC_type> will consist of the following string:

'h' - WSE boundary condition
'q' - River flux boundary condition
'th' - Tidal/Harmonic boundary condition

Each file is designated by a number that corresponds to the boundary number, <BC_#>, given by SMS and is written within the .cmcards parameter file. Each of these files give the specific curve information for each boundary of each type.

  • Filename - <project>*_<BC type>_<BC_#>.xys !Example: Phase2_h_5.xys

File format for ASCII contents of file

XYS 2 <n> "" !<n> is the total number of time records in the file.
<time(0)>     <value(0)> ! Time and forcing value for Time 0
<time(1)>     <value(1)> ! Time and forcing value for Time 1
<time(2)>     <value(2)> ! Time and forcing value for Time 2
<time(3)>     <value(3)> ! Time and forcing value for Time 3
...
<time(n-1)>     <value(n-1)> ! Time and forcing value for Time n-1

Datasets

Dataset Values (scalar and vector)

These dataset values can be any type of data and are specified for every cell in the grid. Certain types of data are common to most project numerical grids, such as: Bottom Friction, Grain Size, Hard Bottom depth. Other types of data are allowed as well, such as: initial 2d salinity concentration, temperature, and fraction of suspended sediment evaluated with the Sediment Mapping feature.

Each dataset in this category is written in almost the exact same way with the only variant being the number of dimensions written. Scalar datasets have one value per cell and Vector datasets have two values per cell. The name of the dataset is shown in the filename with the indicator <dset name> below.

Scalar Datasets

  • Filename - <project>*_datasets_<dset name>.txt
  • File format for ASCII contents of file:

<nc> 1 !<nc> = Number of cells, 1 = Number of dimensions written per cell
<val_1> <val_2> <val_3> <val_4> <val_5> <val_6> <val_7> ... <val_nc>

Vector Datasets

  • Filename - <project>*_datasets_<dset name>.txt
  • File format for ASCII contents of file:

<nc> 2 !<nc> = Number of cells, 2 = Number of dimensions written per cell
<vecx_1> <vecy_1> <vecx_2> <vecy_2> <vecx_3> <vecy_3> <vecx_4> <vecy_4> ... <vecx_nc> <vecy_nc>

Note: There will be many lines in the file. A maximum of 25*<nd> values per line.

Wind Forcing

Wind forcing applied to the entire domain, but can be input either at each cell in the grid or from a field of values at a specified spacing that covers the domain.

Wind Files

There are three values needed for specifying wind input: Time, Wind Speed, Direction. It was decided that the .xys format (same as the BC forcing data files) would be used to represent the wind curves for CMS. Two files are written, each containing the times and the scalar values for either wind speed or direction.

<Wind dataset> will consist of the following string:

'vel' - Wind speeds and times
'dir' - Wind directions and times
  • Filename - <project>*_wind_<Wind dataset>.xys

File format for ASCII contents of file

XYS 2 <n> "" !<n> is the total number of time records in the file.
<time(0)>     <value(0)> ! Time and forcing value for Time 0
<time(1)>     <value(1)> ! Time and forcing value for Time 1
<time(2)>     <value(2)> ! Time and forcing value for Time 2
<time(3)>     <value(3)> ! Time and forcing value for Time 3
...
<time(n-1)>     <value(n-1)> ! Time and forcing value for Time n-1

Sample Files

A link to a zip file containing the appropriate files for 4 river flow boundaries and one offshore water level boundary is given below.

A link to a zip file containing the 3 different scalar datasets is given below.

A link to a zip file containing the 2 different wind files is given below.