###################################################################################################################################
# Registry for Waves2 in the FAST Modularization Framework
# This Registry file is used to create MODULE Waves2_Types  which contains all of the user-defined types needed in Waves2.
# It also contains copy, destroy, pack,  and unpack routines associated with each defined data types.
# See NWTC Programmer's Handbook for further information on the format/contents of this file.
#
# Entries are of the form
# <keyword> <ModuleName/ModName> <TypeName>  <FieldType> <FieldName> <Dims>   <IO>  <DNAME>  <DESCRIP>   <UNITS>
#
# Use ^ as a shortcut for the value in the same column from the previous line.
###################################################################################################################################

# ...... Include files (definitions from NWTC Library) ............................................................................
# make sure that the file name does not have any trailing white spaces!
include  Registry_NWTC_Library.txt

param       Waves2/Waves2     unused            INTEGER              MaxWaves2Outputs  -        9       -        ""    -
# ..... Initialization data .......................................................................................................
# Define inputs that the initialization routine may need here:
#   e.g.,  the name of the input file,  the file root name,etc.
#
typedef     Waves2/Waves2     InitInputType     INTEGER              UnSum             -        -        -        "The unit number for the HydroDyn summary file" -

typedef     ^                 ^                 ReKi                 Gravity           -        -        -        "Gravitational acceleration"  (m/s^2)
typedef     ^                 ^                 ReKi                 WtrDens           -        -        -        "Water density"   (kg/m^3)
typedef     ^                 ^                 SiKi                 WtrDpth           -        -        -        "Water depth"  (meters)

typedef     ^                 ^                 INTEGER              NStepWave         -        -        -        "Total number of frequency components = total number of time steps in the incident wave"    -
typedef     ^                 ^                 INTEGER              NStepWave2        -        -        -        "NStepWave / 2"                                       -
typedef     ^                 ^                 SiKi                 WaveDOmega        -        -        -        "Frequency step for incident wave calculations"       (rad/s)

typedef     ^                 ^                 INTEGER              WaveStMod         -        -        -        "Model for stretching incident wave kinematics to instantaneous free surface {0: none=no stretching, 1: vertical stretching, 2: extrapolation stretching, 3: Wheeler stretching}"   -

typedef     ^                 ^                 LOGICAL              WaveMultiDir      -        -        -        "Indicates the waves are multidirectional -- set by HydroDyn_Input"  -
typedef     ^                 ^                 SiKi                 WaveDirArr        {:}      -        -        "Wave direction array.  Each frequency has a unique direction of WaveNDir > 1" (degrees)
typedef     ^                 ^                 SiKi                 WaveElevC0        {:}{:}   -        -        "Discrete Fourier transform of the instantaneous elevation of incident waves at the platform reference point.  First column is real part, second column is imaginary part"   (meters)
typedef     ^                 ^                 SiKi                 WaveTime          {:}      -        -        "Simulation times at which the instantaneous second order loads associated with the incident waves are determined"   sec

typedef     ^                 ^                 INTEGER              NWaveElev         -        -        -        "Number of points where the incident wave elevations can be output"  -
typedef     ^                 ^                 SiKi                 WaveElevxi        {:}      -        -        "xi-coordinates for points where the incident wave elevations can be output"  (meters)
typedef     ^                 ^                 SiKi                 WaveElevyi        {:}      -        -        "yi-coordinates for points where the incident wave elevations can be output"  (meters)
typedef     ^                 ^                 SiKi                 WaveElevXY        {:}{:}   -        -        "Supplied by Driver:  X-Y locations for WaveElevation output (for visualization).  Index 1 corresponds to X or Y coordinate.  Index 2 corresponds to point number."    -

typedef     ^                 ^                 INTEGER              NWaveKin          -        -        -        "Number of points where the incident wave kinematics will be computed"  -
typedef     ^                 ^                 SiKi                 WaveKinxi         {:}      -        -        "xi-coordinates for points where the incident wave kinematics will be computed; these are relative to the mean sea level"  (meters)
typedef     ^                 ^                 SiKi                 WaveKinyi         {:}      -        -        "yi-coordinates for points where the incident wave kinematics will be computed; these are relative to the mean sea level"  (meters)
typedef     ^                 ^                 SiKi                 WaveKinzi         {:}      -        -        "zi-coordinates for points where the incident wave kinematics will be computed; these are relative to the mean sea level"  (meters)

typedef     ^                 ^                 LOGICAL              WvDiffQTFF        -        -        -        "Full difference QTF second order forces flag" (-)
typedef     ^                 ^                 LOGICAL              WvSumQTFF         -        -        -        "Full sum QTF second order forces flag" (-)

typedef     ^                 ^                 SiKi                 WvLowCOffD        -        -        -        "Minimum frequency used in the difference methods [Ignored if all difference methods = 0]"   (rad/s)
typedef     ^                 ^                 SiKi                 WvHiCOffD         -        -        -        "Maximum frequency used in the difference methods [Ignored if all difference methods = 0]"   (rad/s)
typedef     ^                 ^                 SiKi                 WvLowCOffS        -        -        -        "Minimum frequency used in the sum-QTF method     [Ignored if SumQTF = 0]"                   (rad/s)
typedef     ^                 ^                 SiKi                 WvHiCOffS         -        -        -        "Maximum frequency used in the sum-QTF method     [Ignored if SumQTF = 0]"                   (rad/s)

typedef     ^                 ^                 CHARACTER(ChanLen)   OutList           {18}     -        -        "This should really be dimensioned with MaxOutPts"    -
typedef     ^                 ^                 LOGICAL              OutAll            -        -        -        ""    -
typedef     ^                 ^                 INTEGER              NumOuts           -        -        -        ""    -
typedef     ^                 ^                 INTEGER              NumOutAll         -        -        -        ""    -


# Define outputs from the initialization routine here:
#
typedef     ^                 InitOutputType    CHARACTER(ChanLen)   WriteOutputHdr    {:}      -        -        ""    -
typedef     ^                 ^                 CHARACTER(ChanLen)   WriteOutputUnt    {:}      -        -        ""    -
typedef     ^                 ^                 SiKi                 WaveElevSeries2   {:}{:}   -        -        "" (m)
#                                                                                                                 "Instantaneous elevation time-series at each of the points given by WaveElevXY.  Used for making movies of the waves. First index is the timestep. Second index is XY point number corresponding to second index of WaveElevXY." (m)
typedef     ^                 ^                 SiKi                 WaveAcc2D         {:}{:}{:} -       -        "" (m/s^2)
#                                                                                                                 "Instantaneous 2nd-order difference frequency correction for the acceleration     of incident waves in the xi- (1), yi- (2), and zi- (3) directions, respectively, at each of the NWaveKin points where the incident wave kinematics will be computed" (m/s^2)
typedef     ^                 ^                 SiKi                 WaveDynP2D        {:}{:}   -        -        "" (N/m^2)
#                                                                                                                 "Instantaneous 2nd-order difference frequency correction for the dynamic pressure of incident waves                                                              , at each of the NWaveKin points where the incident wave kinematics will be computed" (N/m^2)
typedef     ^                 ^                 SiKi                 WaveAcc2S         {:}{:}{:} -       -        "" (m/s^2)
#                                                                                                                 "Instantaneous 2nd-order sum        frequency correction for the acceleration     of incident waves in the xi- (1), yi- (2), and zi- (3) directions, respectively, at each of the NWaveKin points where the incident wave kinematics will be computed" (m/s^2)
typedef     ^                 ^                 SiKi                 WaveDynP2S        {:}{:}   -        -        "" (N/m^2)
#                                                                                                                 "Instantaneous 2nd-order sum        frequency correction for the dynamic pressure of incident waves                                                              , at each of the NWaveKin points where the incident wave kinematics will be computed" (N/m^2)
typedef     ^                 ^                 SiKi                 WaveVel2D         {:}{:}{:} -       -        "" (m/s)
#                                                                                                                 "Instantaneous 2nd-order difference frequency correction for the velocity         of incident waves in the xi- (1), yi- (2), and zi- (3) directions, respectively, at each of the NWaveKin points where the incident wave kinematics will be computed (The values include both the velocity of incident waves and the velocity of current.)" (m/s)
typedef     ^                 ^                 SiKi                 WaveVel2S         {:}{:}{:} -       -        "" (m/s)                                                                          
#                                                                                                                 "Instantaneous 2nd-order sum        frequency correction for the velocity         of incident waves in the xi- (1), yi- (2), and zi- (3) directions, respectively, at each of the NWaveKin points where the incident wave kinematics will be computed (The values include both the velocity of incident waves and the velocity of current.)" (m/s)
typedef     ^                 ^                 SiKi                 WaveAcc2D0        {:}{:}{:} -       -        "" (m/s^2)
#                                                                                                                 "Instantaneous 2nd-order difference frequency correction for the acceleration     of incident waves in the xi- (1), yi- (2), and zi- (3) directions, respectively, at the location (xi,yi,0), for each of the NWaveKin points where the incident wave kinematics will be computed" (m/s^2)
typedef     ^                 ^                 SiKi                 WaveDynP2D0       {:}{:}   -        -        "" (N/m^2)
#                                                                                                                 "Instantaneous 2nd-order difference frequency correction for the dynamic pressure of incident waves                                                              , at the location (xi,yi,0), for each of the NWaveKin points where the incident wave kinematics will be computed" (N/m^2)
typedef     ^                 ^                 SiKi                 WaveAcc2S0        {:}{:}{:} -       -        "" (m/s^2)
#                                                                                                                 "Instantaneous 2nd-order sum        frequency correction for the acceleration     of incident waves in the xi- (1), yi- (2), and zi- (3) directions, respectively, at the location (xi,yi,0), for each of the NWaveKin points where the incident wave kinematics will be computed" (m/s^2)
typedef     ^                 ^                 SiKi                 WaveDynP2S0       {:}{:}   -        -        "" (N/m^2)
#                                                                                                                 "Instantaneous 2nd-order sum        frequency correction for the dynamic pressure of incident waves                                                              , at the location (xi,yi,0), for each of the NWaveKin points where the incident wave kinematics will be computed" (N/m^2)
typedef     ^                 ^                 SiKi                 WaveVel2D0        {:}{:}{:} -       -        "" (m/s)
#                                                                                                                 "Instantaneous 2nd-order difference frequency correction for the velocity         of incident waves in the xi- (1), yi- (2), and zi- (3) directions, respectively, at the location (xi,yi,0), for each of the NWaveKin points where the incident wave kinematics will be computed (The values include both the velocity of incident waves and the velocity of current.)" (m/s)
typedef     ^                 ^                 SiKi                 WaveVel2S0        {:}{:}{:} -       -        "" (m/s)                                                                          
#                                                                                                                 "Instantaneous 2nd-order sum        frequency correction for the velocity         of incident waves in the xi- (1), yi- (2), and zi- (3) directions, respectively, at the location (xi,yi,0), for each of the NWaveKin points where the incident wave kinematics will be computed (The values include both the velocity of incident waves and the velocity of current.)" (m/s)




# ..... States ....................................................................................................................
# Define continuous (differentiable) states here:
typedef     ^              ContinuousStateType  SiKi                 DummyContState    -        -        -        "Remove this variable if you have continuous states"  -


# Define discrete (nondifferentiable) states here:
typedef     ^              DiscreteStateType    SiKi                 DummyDiscState    -        -        -        "Remove this variable if you have discrete states" -


# Define constraint states here:
typedef     ^              ConstraintStateType  SiKi                 DummyConstrState  -        -        -        "Remove this variable if you have constraint states"  -


# Define any other states, including integer or logical states here:
typedef   ^               OtherStateType      IntKi                  DummyOtherState   -        -        -        "Remove this variable if you have other states" -


# ..... Misc/Optimization variables.................................................................................................
# Define any data that are used only for efficiency purposes (these variables are not associated with time):
#   e.g. indices for searching in an array, large arrays that are local variables in any routine called multiple times, etc.
typedef     ^                MiscVarType       INTEGER              LastIndWave       -        -        -        "Index for last interpolation step of 2nd order forces"   -


# ..... Parameters ................................................................................................................
# Define parameters here:
# Time step for integration of continuous states (if a fixed-step integrator is used) and update of discrete states:
typedef     ^                 ParameterType     DbKi                 DT                -        -        -        "Time step for continuous state integration & discrete state update" seconds
typedef     ^                 ^                 LOGICAL              WvDiffQTFF        -        -        -        "Full difference QTF second order forces flag" (-)
typedef     ^                 ^                 LOGICAL              WvSumQTFF         -        -        -        "Full sum QTF second order forces flag" (-)
typedef     ^                 ^                 INTEGER              NWaveElev         -        -        -        "Number of points where the incident wave elevations can be output"  -
typedef     ^                 ^                 INTEGER              NStepWave         -        -        -        "Total number of frequency components = total number of time steps in the incident wave" -
typedef     ^                 ^                 INTEGER              NStepWave2        -        -        -        "NStepWave / 2" -
typedef     ^                 ^                 SiKi                 WaveTime          {:}      -        -        "Simulation times at which the instantaneous second order loads associated with the incident waves are determined"   sec
typedef     ^                 ^                 SiKi                 WaveElev2         {:}{:}   -        -        "Instantaneous elevation time-series of incident waves at each of the NWaveElev points where the incident wave elevations can be output" (meters)
#typedef     ^                 ^                 SiKi                 WaveElev2D        {:}{:}   -        -        "" (m)
#                                                                                                                 "Instantaneous 2nd-order difference frequency correction for the elevation time-series of incident waves at each of the NWaveElev points where the incident wave elevations can be output" (meters)
#typedef     ^                 ^                 SiKi                 WaveElev2S        {:}{:}   -        -        "" (m)
#                                                                                                                 "Instantaneous 2nd-order sum frequency correction for the elevation time-series of incident waves at each of the NWaveElev points where the incident wave elevations can be output" (meters)
typedef     ^                 ^                 OutParmType          OutParam          {:}      -        -        ""        -
typedef     ^                 ^                 INTEGER              NumOuts           -        -        -        ""        -
typedef     ^                 ^                 INTEGER              NumOutAll         -        -        -        ""    -
typedef     ^                 ^                 CHARACTER(20)        OutFmt            -        -        -        ""        -
typedef     ^                 ^                 CHARACTER(20)        OutSFmt           -        -        -        ""        -
typedef     ^                 ^                 CHARACTER(ChanLen)   Delim             -        -        -        ""        -
typedef     ^                 ^                 INTEGER              UnOutFile         -        -        -        ""        -





# ..... Inputs ....................................................................................................................
# Define inputs that are contained on the mesh here:
typedef     ^                 InputType         SiKi                 DummyInput        -        -        -        "Remove this variable if you have input data"   -


# ..... Outputs ...................................................................................................................
# Define outputs that are contained on the mesh here:
typedef     ^                 OutputType        ReKi                 WriteOutput       {:}      -        -        ""  -
