###################################################################################################################################
# Registry for Waves in the FAST Modularization Framework
# This Registry file is used to create MODULE Waves_Types  which contains all of the user-defined types needed in Waves.
# 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

# ..... 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     Waves/Waves       InitInputType     CHARACTER(1024)      InputFile         -        -        -        "Name of the input file"   -
typedef     ^                 ^                 CHARACTER(1024)      DirRoot           -        -        -        "The name of the root file including the full path.  This may be useful if you want this routine to write a permanent record of what it does to be stored with the simulation results: the results should be stored in a file whose name (including path) is generated by appending any suitable extension to DirRoot." -
typedef     ^                 ^                 CHARACTER(1024)      WvKinFile          -        -        -       "The root name of user input wave kinematics files" -
typedef     ^                 ^                 LOGICAL              WriteWvKin        -        -        -        "Flag indicating whether we are going to write out kinematics files.  [Must be FALSE if WaveMod = 5 or 6, if TRUE then WvKinFile must have a string value and this is the rootname for all the output files]" -
typedef     ^                 ^                 INTEGER              UnSum             -        -        -        "The unit number for the HydroDyn summary file" -
typedef     ^                 ^                 ReKi                 Gravity           -        -        -        "Gravitational acceleration"  (m/s^2)
typedef     ^                 ^                 ReKi                 MSL2SWL           -        -        -        "Offset between still-water level and mean sea level  [positive upward; must be zero if using WAMIT]" (meters)
typedef     ^                 ^                 SiKi                 WvLowCOff         -        -        -        "Low cut-off frequency or lower frequency limit of the wave spectrum beyond which the wave spectrum is zeroed.  [used only when WaveMod=2,3,4]"   (rad/s)
typedef     ^                 ^                 SiKi                 WvHiCOff          -        -        -        "High cut-off frequency or upper frequency limit of the wave spectrum beyond which the wave spectrum is zeroed.  [used only when WaveMod=2,3,4]"   (rad/s)
typedef     ^                 ^                 SiKi                 WaveDir           -        -        -        "Mean incident wave propagation heading direction"   (degrees)
typedef     ^                 ^                 INTEGER              WaveNDir          -        -        -        "Number of wave directions [only used if WaveDirMod = 1] [Must be an odd number -- will be adjusted within the waves module]"     (-)
typedef     ^                 ^                 LOGICAL              WaveMultiDir      -        -        -        "Indicates the waves are multidirectional -- set by HydroDyn_Input"  -
typedef     ^                 ^                 INTEGER              WaveDirMod        -        -        -        "Directional wave spreading function {0: none, 1: COS2S} [only used if WaveMod=6]"   -
typedef     ^                 ^                 SiKi                 WaveDirSpread     -        -        -        "Spreading coefficient [WaveMod=2,3,4 and WaveDirMod=1]"   -
typedef     ^                 ^                 SiKi                 WaveDirRange      -        -        -        "Range of wave directions (full range: WaveDir +/- WaveDirRange/2) [only used if WaveMod=6]"   (degrees)
typedef     ^                 ^                 DbKi                 WaveDT            -        -        -        "Time step for incident wave calculations"   (sec)
typedef     ^                 ^                 SiKi                 WaveHs            -        -        -        "Significant wave height of incident waves"  (meters)
typedef     ^                 ^                 INTEGER              WaveMod           -        -        -        "Incident wave kinematics model {0: none=still water, 1: plane progressive (regular), 2: JONSWAP/Pierson-Moskowitz spectrum (irregular), 3: white-noise spectrum, 4: user-defind spectrum from routine UserWaveSpctrm (irregular), 5: GH BLADED }" -
typedef     ^                 ^                 CHARACTER(80)        WaveModChr        -        -        -        "String to temporarially hold the value of the wave kinematics input line"
typedef     ^                 ^                 LOGICAL              WaveNDAmp         -        -        -        "Flag for normally-distributed amplitudes in incident waves spectrum [flag]"  -
typedef     ^                 ^                 SiKi                 WavePhase         -        -        -        "Specified phase for regular waves"    (radians)
typedef     ^                 ^                 SiKi                 WavePkShp         -        -        -        "Peak shape parameter of incident wave spectrum [1.0 for Pierson-Moskowitz]"  -
typedef     ^                 ^                 CHARACTER(80)        WavePkShpChr      -        -        -        "String to temporarially hold value of peak shape parameter input line" -
typedef     ^                 ^                 INTEGER              WaveSeed          {2}      -        -        "Random seeds of incident waves [-2147483648 to 2147483647]"   -
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     ^                 ^                 DbKi                 WaveTMax          -        -        -        "Analysis time for incident wave calculations; the actual analysis time may be larger than this value in order for the maintain an effecient FFT"  (sec)
typedef     ^                 ^                 SiKi                 WaveTp            -        -        -        "Peak spectral period of incident waves"  (sec)
typedef     ^                 ^                 SiKi                 WtrDens           -        -        -        "Water density"   (kg/m^3)
typedef     ^                 ^                 SiKi                 WtrDpth           -        -        -        "Water depth"  (meters)
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     ^                 ^                 SiKi                 CurrVxi           {:}      -        -        "xi-component of the current velocity at elevation i" (m/s)
typedef     ^                 ^                 SiKi                 CurrVyi           {:}      -        -        "yi-component of the current velocity at elevation i" (m/s)
typedef     ^                 ^                 SiKi                 PCurrVxiPz0       -        -        -        "xi-component of the partial derivative of the current velocity at elevation near mean sea level"  (m/s)
typedef     ^                 ^                 SiKi                 PCurrVyiPz0       -        -        -        "yi-component of the partial derivative of the current velocity at elevation near mean sea level"  (m/s)
typedef     ^                 ^                NWTC_RandomNumber_ParameterType RNG               -        -        -        "Parameters for the pseudo random number generator"  -


# Define outputs from the initialization routine here:
#
typedef     ^                 InitOutputType    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                 WaveDirArr        {:}      -        -        "Wave direction array.  Each frequency has a unique direction of WaveNDir > 1" (degrees)
typedef     ^                 ^                 SiKi                 WaveDirMin        -        -        -        "Minimum wave direction."  (degrees)
typedef     ^                 ^                 SiKi                 WaveDirMax        -        -        -        "Maximum wave direction."  (degrees)
typedef     ^                 ^                 SiKi                 WaveDir           -        -        -        "Incident wave propagation heading direction" (degrees)
typedef     ^                 ^                 INTEGER              WaveNDir          -        -        -        "Number of wave directions [only used if WaveDirMod = 1] [Must be an odd number -- will be adjusted within the waves module]"     (-)
typedef     ^                 ^                 LOGICAL              WaveMultiDir      -        -        -        "Indicates the waves are multidirectional -- set by HydroDyn_Input"  -
typedef     ^                 ^                 SiKi                 WaveDOmega        -        -        -        "Frequency step for incident wave calculations" (rad/s)
typedef     ^                 ^                 SiKi                 WaveKinzi         {:}      -        -        "zi-coordinates for points where the incident wave kinematics will be computed; these are relative to the mean see level" (meters)
typedef     ^                 ^                 SiKi                 PWaveDynP0         {:}{:}   -        -        "Instantaneous dynamic pressure of incident waves                                                          , at the location (xi,yi,0), at each of the NWaveKin points where the incident wave kinematics will be computed" (N/m^2)
typedef     ^                 ^                 SiKi                 WaveDynP          {:}{:}   -        -        "Instantaneous dynamic pressure of incident waves                                                          , accounting for stretching, at each of the NWaveKin points where the incident wave kinematics will be computed" (N/m^2)
typedef     ^                 ^                 SiKi                 WaveAcc           {:}{:}{:} -       -        "Instantaneous acceleration of incident waves in the xi- (1), yi- (2), and zi- (3) directions, respectively, accounting for stretching, at each of the NWaveKin points where the incident wave kinematics will be computed" (m/s^2)
typedef     ^                 ^                 SiKi                 PWaveAcc0          {:}{:}{:} -       -        "Instantaneous acceleration of incident waves in the xi- (1), yi- (2), and zi- (3) directions, respectively, at the location (xi,yi,0), at each of the NWaveKin points where the incident wave kinematics will be computed" (m/s^2)
typedef     ^                 ^                 SiKi                 WaveVel           {:}{:}{:} -       -        "Instantaneous velocity     of incident waves in the xi- (1), yi- (2), and zi- (3) directions, respectively, accounting for stretching, 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                 PWaveVel0          {:}{:}{:} -       -        "Instantaneous velocity     of incident waves in the xi- (1), yi- (2), and zi- (3) directions, respectively, at the location (xi,yi,0), 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                 WaveElev          {:}{:}   -        -        "Instantaneous elevation time-series of incident waves at each of the NWaveElev points where the incident wave elevations can be output" (meters)
typedef     ^                 ^                 SiKi                 WaveElev0         {:}      -        -        "Instantaneous elevation time-series of incident waves at the platform reference point" (meters)

typedef     ^                 ^                 SiKi                 WaveElevSeries    {:}{:}   -        -        "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                 WaveTime          {:}      -        -        "Simulation times at which the instantaneous elevation of, velocity of, acceleration of, and loads associated with the incident waves are determined" (sec)
typedef     ^                 ^                 DbKi                 WaveTMax          -        -        -        "Analysis time for incident wave calculations; the actual analysis time may be larger than this value in order for the maintain an effecient FFT"  (sec)
typedef     ^                 ^                 INTEGER              nodeInWater       {:}{:}   -        -        "Logical flag indicating if the node at the given time step is in the water, and hence needs to have hydrodynamic forces calculated" -
typedef     ^                 ^                 SiKi                 RhoXg             -        -        -        "= WtrDens*Gravity" -
typedef     ^                 ^                 INTEGER              NStepWave         -        -        -        "Total number of frequency components = total number of time steps in the incident wave" -
typedef     ^                 ^                 INTEGER              NStepWave2        -        -        -        "NStepWave / 2" -


# ..... 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       INTEGER              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              DummyMiscVar     -        -        -        "Remove this variable if you have misc/optimization variables" -


# ..... 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     ^                 ^                 DbKi                 WaveTMax          -        -        -        "Analysis time for incident wave calculations; the actual analysis time may be larger than this value in order for the maintain an effecient FFT"  (sec)
typedef     ^                 ^                 INTEGER              NStepWave         -        -        -        "Total number of frequency components = total number of time steps in the incident wave" -
typedef     ^                 ^                 INTEGER              WaveNDir          -        -        -        "Number of wave directions [only used if WaveDirMod = 1] [Must be an odd number -- will be adjusted within the waves module]"     (-)
typedef     ^                 ^                 LOGICAL              WaveMultiDir      -        -        -        "Indicates the waves are multidirectional -- set by HydroDyn_Input"  -


# ..... Inputs ....................................................................................................................
# Define inputs that are contained on the mesh here:
#typedef    ^                 InputType         MeshType             MeshedInput       -        -        -        "Meshed input data"  -

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


# ..... Outputs ...................................................................................................................
# Define outputs that are not on this mesh here:
typedef     ^                 OutputType        SiKi                 DummyOutput       -        -        -        "Remove this variable if you have output data"  -
