Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support .t3d and .cmp legacy file formats #731

Open
arthurvd opened this issue Jan 21, 2025 · 0 comments
Open

Support .t3d and .cmp legacy file formats #731

arthurvd opened this issue Jan 21, 2025 · 0 comments
Labels
domain: io type: compatibility Changes needed to be compatible with the computational core type: feature Brand new functionality

Comments

@arthurvd
Copy link
Member

Is your feature request related to a problem? Please describe.
For the external forcings converter (#621) we need to be able to parse/load legacy file formats with extensions .t3d, .cmp

Describe the solution you'd like

.cmp format

'SA'
'SSA'
'MSM'
'MM'
'MSF'
'MS0'
'MF'
'KO0'
'MK0'
'SNU'
'SN'
'MSTM'
'MFM'
'2SM'
'MSQM'
'MQM'
'2SMN'
'2OK1'
'2Q1'
'NJ1'
'SIGMA1'
'MUK1'
'NUJ1'
'Q1'
'NK1'
'RO1'
'NUK1'
'O1'
'TAU1'
'MP1'
'M1B'
'M1C'
'M1A'
'M1'
'NO1'
'CHI1'
'LP1'
'PI1'
'TK1'
'P1'
'SK1'
'S1'
'K1'
'MO1'
'SP1'
'PSI1'
'RP1'
'FI1'
'KP1'
'THETA1'
'LABDAO1'
'J1'
'MQ1'
'2PO1'
'SO1'
'OO1'
'2KO1'
'UPSILON1'
'KQ1'
'2MN2S2'
'3MKS2'
'2NS2'
'3MS2'
'OQ2'
'MNK2'
'EPSILON2'
'MNS2'
'2ML2S2'
'MNUS2'
'MNK2S2'
'2MS2K2'
'O2'
'NLK2'
'2MK2'
'2N2'
'MU2'
'2MS2'
'SNK2'
'NA2'
'N2'
'KQ2'
'NB2'
'NU2'
'3MSN2'
'2KN2S2'
'OP2'
'MSK2'
'GAMMA2'
'ALFA2'
'MPS2'
'MA2'
'M2'
'KO2'
'MSP2'
'MB2'
'DELTA2'
'MKS2'
'M2(KS)2'
'2SN(MK)2'
'LABDA2'
'SNM2'
'2MN2'
'L2'
'L2A'
'L2B'
'2SK2'
'T2'
'S2'
'KP2'
'R2'
'K2'
'MSNU2'
'MSN2'
'ZETA2'
'ETA2'
'KJ2'
'MKN2'
'2KM(SN)2'
'2SM2'
'SKM2'
'2MS2N2'
'2SNU2'
'2SN2'
'SKN2'
'MQ3'
'NO3'
'MO3'
'2MK3'
'2MP3'
'M3'
'NK3'
'SO3'
'MP3'
'MK3'
'SP3'
'2MQ3'
'SK3'
'2SO3'
'K3'
'4MS4'
'2MNS4'
'3MK4'
'MNLK4'
'3MS4'
'MSNK4'
'MN4'
'MNU4'
'2MLS4'
'2MSK4'
'M4'
'2MKS4'
'SN4'
'3MN4'
'2SMK4'
'MS4'
'MK4'
'2SNM4'
'2MSN4'
'SL4'
'S4'
'SK4'
'2SMN4'
'3SM4'
'2SKM4'
'MNO5'
'3MK5'
'3MP5'
'M5'
'MNK5'
'2MP5'
'MSO5'
'3MO5'
'MSK5'
'3KM5'
'2(MN)S6'
'3MNS6'
'4MK6'
'2NM6'
'4MS6'
'2MSNK6'
'2MN6'
'2MNU6'
'3MSK6'
'M6'
'MSN6'
'MNK6'
'4MN6'
'MKNU6'
'2(MS)K6'
'2MS6'
'2MK6'
'2SN6'
'3MSN6'
'MKL6'
'2SM6'
'MSK6'
'S6'
'2MNO7'
'2NMK7'
'M7'
'2MSO7'
'MSKO7'
'2(MN)8'
'3MN8'
'3MNKS8'
'M8'
'2MSN8'
'2MNK8'
'3MS8'
'3MK8'
'2SNM8'
'MSNK8'
'2(MS)8'
'2MSK8'
'3SM8'
'2SMK8'
'S8'
'2(MN)K9'
'3MNK9'
'4MK9'
'3MSK9'
'4MN10'
'M10'
'3MSN10'
'4MS10'
'2(MS)N10'
'2MNSK10'
'3M2S10'
'4MSK11'
'M12'
'4MSN12'
'5MS12'
'3MNKS12'
'4M2S12

.t3D legacy file format

.t3D files contain timeseries with multiple data columns to provide boundary values for multiple vertical layers on a boundary.

  • Example file:
LAYER_TYPE=SIGMA
LAYERS=0.0 0.5 0.55 0.75 1
TIME = 0 seconds since 2006-01-01 00:00:00 +00:00
41 36.45455 36 34 31
TIME = 180 seconds since 2006-01-01 00:00:00 +00:00
41.00002 36.45456 36.00002 34.00002 31.00002
[..]
  • all keywords are case-insensitive.
  • Note: this is the legacy file format. It needs a Pydantic class of its own. It contains the same data, but is not to be confused with class T3D, which is a subpart of .bc files (the new preferred format).

Header:

  • valid values for LAYER_TYPE:
    • SIGMA
    • Z
  • LAYERS: list of whitespace-separated floats, the number of layers is determined after parsing and string splitting.
  • optionally after the LAYERS line can be a line:
    VECTORMAX = <n>
    with n a positive integer, defining the number of vector components. Default (when absent) value is 1 (scalar timeseries for each later). Sometimes a velocity vector is specified using VECTORMAX = 2.
    This ends the header.

Data/body:
Now the data part of the file starts. Each record consists of two lines:

  • TIME = [..] where time format is <float> <time unit> since <reference date time>
    • <time unit> is one of: 'seconds', 'minutes', 'hours', 'days'
    • <reference date time> is of ISO 8601 format:
      • YYYY-MM-DD,
      • followed by optional time hh:mm:ss (prefixed by either 'T' or ' '), default '00:00:00'
      • followed by optional time zone hh:mm (prefixed by either 'Z' or '+' or '-')
@arthurvd arthurvd added domain: io type: compatibility Changes needed to be compatible with the computational core type: feature Brand new functionality labels Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: io type: compatibility Changes needed to be compatible with the computational core type: feature Brand new functionality
Projects
Status: To do
Development

No branches or pull requests

1 participant