MoorDyn subroutine, "MD_Input_ExtrapInterp", in "TimeStep" Subroutine

Hi, all and @Matthew.Hall

I have a question regarding the MoorDyn subroutine, “MD_Input_ExtrapInterp”, in the “TimeStep” subroutine.

I assume this routine interpolates inputs at the desired time-step.
Debugging it, however, I find that it does not change any variables, but only copies them from u to u_interp.

Would you check?


Hi Hakun,
Are you saying it never changes (e.g. interpolates) any values?
MD_Input_ExtrapInterp is an autogenerated function so I would have assumed it works properly. How it works would depend on how many sets of inputs are available. I haven’t looked at this part of the code in a while. I haven’t seen evidence of problems, though it is always possible I have a bug.
If you can be more specific about what scenario you are seeing the problem occur in, and also what version of the code you are looking at, I could see about investigating.


Thanks for the reply. @Matthew.Hall

I assume that, since MoorDyn uses the different time steps of OpenFAST, MoorDyn inputs of fairlead points are intended to be interpolated at the desired physical time. This is my guess.

As you mentioned, MD_Input_ExtrapInterp depends on the number of inputs. But, the size of MoorDyn Input of MD%Input is 1. Rather than interpolating variables, this routine just copies them.


The ExtrapInterp routines will copy the values if the size of the array of inputs is 1 (which is how you interpolate when you know only 1 data point). It looks like this is always the case when the TimeStep routine is called at initialization. However that routine is also called at each time step in the UpdateStates routine.

When called from OpenFAST, the UpdateStates call should contain an array of 2 or 3 inputs, depending on how this value is set in the OpenFAST input file:
2 InterpOrder - Interpolation order for input/output time history (-) {1=linear, 2=quadratic}

I haven’t looked at how the MoorDyn driver is set up, but it’s possible that contains an array of size 1.

Thanks for the confirmation, @Bonnie.Jonkman.
Since the default value of “InterpOrder” in the MoorDyn driver, I got confused.

After initialization, Input is interpolated.


1 Like