###################################################################################################################################
# Registry for WAMIT2 in the FAST Modularization Framework
# This Registry file is used to create MODULE WAMIT2  which contains all of the user-defined types needed in WAMIT2.
# 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       WAMIT2/WAMIT2     unused            INTEGER              MaxWAMIT2Outputs  -        6       -        ""    -

#InitInputType -- used for passing stuff into the Init routine.
typedef     WAMIT2/WAMIT2     InitInputType     LOGICAL              HasWAMIT          -        -        -        ".TRUE. if using WAMIT model, .FALSE. otherwise"      -
typedef     ^                 ^                 CHARACTER(1024)      WAMITFile         -        -        -        "Root of the filename for WAMIT2 outputs"             -
typedef     ^                 ^                 INTEGER              UnSum             -        -        -        "The unit number for the HydroDyn summary file" -
typedef     ^                 ^                 INTEGER              NBody             -        -        -        "[>=1; only used when PotMod=1. If NBodyMod=1, the WAMIT data contains a vector of size 6*NBody x 1 and matrices of size 6*NBody x 6*NBody; if NBodyMod>1, there are NBody sets of WAMIT data each with a vector of size 6 x 1 and matrices of size 6 x 6]" -
typedef     ^                 ^                 INTEGER              NBodyMod          -        -        -        "Body coupling model {1: include coupling terms between each body and NBody in HydroDyn equals NBODY in WAMIT, 2: neglect coupling terms between each body and NBODY=1 with XBODY=0 in WAMIT, 3: Neglect coupling terms between each body and NBODY=1 with XBODY=/0 in WAMIT} (switch) [only used when PotMod=1]" -
typedef     ^                 ^                 ReKi                 PtfmRefxt         {:}      -        -        "The xt offset of the body reference point(s) from (0,0,0)  [1 to NBody; only used when PotMod=1; must be 0.0 if NBodyMod=2 ]"  (m)
typedef     ^                 ^                 ReKi                 PtfmRefyt         {:}      -        -        "The yt offset of the body reference point(s) from (0,0,0)  [1 to NBody; only used when PotMod=1; must be 0.0 if NBodyMod=2 ]"  (m)
typedef     ^                 ^                 ReKi                 PtfmRefzt         {:}      -        -        "The zt offset of the body reference point(s) from (0,0,0)  [1 to NBody; only used when PotMod=1; must be 0.0 if NBodyMod=2 ]"  (m)
typedef     ^                 ^                 R8Ki                 PtfmRefztRot      {:}      -        -        "The rotation about zt of the body reference frame(s) from xt/yt" radians

typedef     ^                 ^                 ReKi                 WAMITULEN         -        -        -        "WAMIT unit length scale"    -
typedef     ^                 ^                 ReKi                 RhoXg             -        -        -        "Density * Gravity -- from the Waves module."    -
typedef     ^                 ^                 INTEGER              NStepWave         -        -        -        "Total number of frequency components = total number of time steps in the incident wave"    -
typedef     ^                 ^                 INTEGER              NStepWave2        -        -        -        "NStepWave / 2"                                       -
typedef     ^                 ^                 ReKi                 WaveDOmega        -        -        -        "Frequency step for incident wave calculations"       (rad/s)
typedef     ^                 ^                 ReKi                 WtrDens           -        -        -        "Water density"   (kg/m^3)
typedef     ^                 ^                 ReKi                 Gravity           -        -        -        "Supplied by Driver:  Gravitational acceleration"  (m/s^2)
typedef     ^                 ^                 SiKi                 WtrDpth           -        -        -        "Water depth (positive-valued)"    (m)

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                 WaveDir           -        -        -        "Mean incident wave propagation heading direction"    (degrees)
typedef     ^                 ^                 LOGICAL              WaveMultiDir      -        -        -        "Indicates the waves are multidirectional -- set by HydroDyn_Input"  -
typedef     ^                 ^                 SiKi                 WaveDirArr        {:}      -        -        "Wave direction assigned to each frequency"    (degrees)
typedef     ^                 ^                 SiKi                 WaveDirMin        -        -        -        "Minimum wave direction from Waves module"    -
typedef     ^                 ^                 SiKi                 WaveDirMax        -        -        -        "Maximum wave direction from Waves module"    -
typedef     ^                 ^                 SiKi                 WaveTime          {:}      -        -        "Simulation times at which the instantaneous second order loads associated with the incident waves are determined"   sec

typedef     ^                 ^                 INTEGER              WaveMod           -        -        -        "The wave model to use.  This is for error checking -- ideally this would be done in the main calling routine, not here." -

#[note: only one of MnDriff / NewmanApp / DiffQTF can be non-zero
typedef     ^                 ^                 INTEGER              MnDrift           -        -        -        "Calculate the mean drift force {0: no mean drift; [7,8,9,10,11, or 12]: WAMIT file to use}"    -
typedef     ^                 ^                 INTEGER              NewmanApp         -        -        -        "Slow drift forces computed with Newman approximation from WAMIT file:{0: No slow drift; [7,8,9,10,11, or 12]: WAMIT file to use}"  -
typedef     ^                 ^                 INTEGER              DiffQTF           -        -        -        "Full Difference-Frequency forces computed with full QTF's from WAMIT file: {0: No diff-QTF; [10,11, or 12]: WAMIT file to use}"  -
typedef     ^                 ^                 INTEGER              SumQTF            -        -        -        "Full Sum-Frequency forces computed with full QTF's from WAMIT file: {0: No sum-QTF; [10,11, or 12]: WAMIT file to use}"  -
typedef     ^                 ^                 LOGICAL              MnDriftF          -        -        -        "Flag indicating mean drift force should be calculated"        -
typedef     ^                 ^                 LOGICAL              NewmanAppF        -        -        -        "Flag indicating Newman approximation should be calculated"    -
typedef     ^                 ^                 LOGICAL              DiffQTFF          -        -        -        "Flag indicating the full difference QTF should be calculated" -
typedef     ^                 ^                 LOGICAL              SumQTFF           -        -        -        "Flag indicating the full    sum     QTF should be calculated" -
typedef     ^                 ^                 ReKi                 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     ^                 ^                 ReKi                 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     ^                 ^                 ReKi                 WvLowCOffD        -        -        -        "Minimum frequency used in the difference methods [Ignored if all difference methods = 0]"   (rad/s)
typedef     ^                 ^                 ReKi                 WvHiCOffD         -        -        -        "Maximum frequency used in the difference methods [Ignored if all difference methods = 0]"   (rad/s)
typedef     ^                 ^                 ReKi                 WvLowCOffS        -        -        -        "Minimum frequency used in the sum-QTF method     [Ignored if SumQTF = 0]"                   (rad/s)
typedef     ^                 ^                 ReKi                 WvHiCOffS         -        -        -        "Maximum frequency used in the sum-QTF method     [Ignored if SumQTF = 0]"                   (rad/s)


# Define outputs from the initialization routine here:
#
typedef     ^                 InitOutputType    ReKi                NULLVAL            -        -        -        ""  -


# ..... 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 data that are 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"   -
typedef     ^                 ^                 ReKi                 F_Waves2          {6}      -        -        "2nd order force from this timestep"   -



# ..... 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     SiKi                 WaveTime          {:}      -        -        "Simulation times at which the instantaneous second order loads associated with the incident waves are determined"   sec
typedef     ^                 ^                 IntKi                NStepWave         -        -        -        "Number of wave time steps"                           -
typedef     ^                 ^                 DbKi                 DT                -        -        -        ""                                                    -
typedef     ^                 ^                 INTEGER              NBody             -        -        -        "[>=1; only used when PotMod=1. If NBodyMod=1, the WAMIT data contains a vector of size 6*NBody x 1 and matrices of size 6*NBody x 6*NBody; if NBodyMod>1, there are NBody sets of WAMIT data each with a vector of size 6 x 1 and matrices of size 6 x 6]" -
typedef     ^                 ^                 INTEGER              NBodyMod          -        -        -        "Body coupling model {1: include coupling terms between each body and NBody in HydroDyn equals NBODY in WAMIT, 2: neglect coupling terms between each body and NBODY=1 with XBODY=0 in WAMIT, 3: Neglect coupling terms between each body and NBODY=1 with XBODY=/0 in WAMIT} (switch) [only used when PotMod=1]" -

#The 2nd order force time series
typedef     ^                 ^                 SiKi                 WaveExctn2        {:}{:}   -        -        "Time series of the resulting 2nd order force (first index is timestep, second index is load component)"    (N)

#Flags set for dimensions to use with each method (MnDrift, NewmanApp, etc). These are stored by method because .8 files that can be used in MnDrift or NewmanApp don't have some of the dimensions.
typedef     ^                 ^                 LOGICAL              MnDriftDims       {6}      -        -        "Flags for which dimensions to calculate in MnDrift   calculations"  -
typedef     ^                 ^                 LOGICAL              NewmanAppDims     {6}      -        -        "Flags for which dimensions to calculate in NewmanApp calculations"  -
typedef     ^                 ^                 LOGICAL              DiffQTFDims       {6}      -        -        "Flags for which dimensions to calculate in DiffQTF   calculations"  -
typedef     ^                 ^                 LOGICAL              SumQTFDims        {6}      -        -        "Flags for which dimensions to calculate in SumQTF    calculations"  -

typedef     ^                 ^                 LOGICAL              MnDriftF          -        -        -        "Flag indicating mean drift force should be calculated"        -
typedef     ^                 ^                 LOGICAL              NewmanAppF        -        -        -        "Flag indicating Newman approximation should be calculated"    -
typedef     ^                 ^                 LOGICAL              DiffQTFF          -        -        -        "Flag indicating the full difference QTF should be calculated" -
typedef     ^                 ^                 LOGICAL              SumQTFF           -        -        -        "Flag indicating the full    sum     QTF should be calculated" -

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         MeshType             Mesh              -        -        -        "Displacements at the platform reference point in the inertial frame" -



# ..... Outputs ...................................................................................................................
# Define outputs that are contained on the mesh here:
typedef     ^                 OutputType        MeshType             Mesh              -        -        -        "Loads at the platform reference point in the inertial frame" -
