Note: | Use mixed case names for the Adams subroutine names when using the C style interface. For the default subroutine name capitalize the first letter and have the remaining letters lower case; Mfosub for example. Doing this ensures that Adams Solver correctly distinguishes a C style subroutine from Fortran and calls with the appropriate interface. |

id | An integer variable that provides the identifier of the MFORCE statement that is requesting information from the MFOSUB. |
time | A double-precision variable through which Adams Solver conveys the current simulation time. |
par | A double-precision array of constants taken in order from the USER parenthetical list of the MFORCE statement. |
npar | An integer variable that indicates the number of constants specified in the USER parenthetical list. The primary purpose of npar is to enable MFOSUB to correctly dimension the par array. |
dflag | A logical variable that Adams Solver sets to true when calling MFOSUB to evaluate the partial derivatives of the specified functions. Otherwise, Adams Solver sets dflag to false. |
iflag | An integer variable that Adams Solver sets to indicate why the routine is being called: ![]() Adams Solver sets iflag to 3 when it needs the functional dependency of the user-defined variable. The functional dependencies are set with the same calls to the SYSARY and SYSFNC utility subroutines that are made to compute the value of the user-defined variable. If iflag is 0, Adams Solver computes the value of the user-written variable. When your user-defined subroutine has static data that needs to be saved and restored to support the Adams Solver commands Save and Reload, then call the serialization functions for your data when iflag is set to 7, and the un-serialization functions when iflag is set to 9. Note: In simple subroutines where serializing data is not needed, you can declare iflag as a logical variable. In this case you declare your dependencies when Adams Solver sets iflag to true, and compute the subroutine's value when Adams Solver sets iflag to false. |
modloads | A double-precision array containing the values of the modal load cases that are defined for the FLEX_BODY and that the MFORCE is acting on. The modload array has the dimensions modload (6+nmodes, ncases). |
nmodes | An integer variable that indicates the number of modes in the associated FLEX_BODY. The value of nmodes provides MFOSUB with a way to correctly dimension the modloads and loadvec arrays. |
ncases | An integer variable that indicates the number of load cases available in the associated FLEX_BODY. The value of ncases provides MFOSUB with a means to correctly dimension the modloads array. If ncases=0, then the contents of modloads are undefined because no user-defined load cases are available for the FLEX_BODY. |
scale | A double-precision array of dimension scale(ncases + 1). A double-precision single variable is also applicable. If MFOSUB is called with the FUNCTION form: If case > 0, then this output argument contains the scale factor that is to be applied to the modal load vector. The value of scale can depend on the values Adams Solver calls from SYSFNC and SYSARY (see SYSARY and SYSFNC). If case = -1, then the output arguments contain the series of scale factors, scale(n + 1) to be applied to nth modal load vector and they can depend on time only, where n is 1 to ncases. scale(1) contains the global scale factor that can depend on the values Adams Solver calls from SYSFNC and SYSARY. If MFOSUB is called with the FORCE form: Adams Solver ignores this output argument. |
case | An integer, in the range -1 to ncases. If MFOSUB is called with the FUNCTION form: This output argument denotes a user-defined modal load case that is multiplied by the scale output argument to produce the modal load on the FLEX_BODY. If case = 0, then Adams Solver looks for a modal load case in the loadvec array. If case = -1, then multiple scale factors for each modal load vector can be defined by the scale output arguments. If MFOSUB is called with the FORCE form: This output argument must be set to zero and Adams Solver extracts the modal load directly from the loadvec array. |
loadvec | A double-precision array of dimension loadvec(6+nmodes) that MFOSUB generates itself or generates based on the load cases it receives from the modloads array. If MFOSUB is called with the FUNCTION form: If the output variable case is zero, Adams Solver computes the modal force by multiplying the output array loadvec by the output variable scale. The values of loadvec can be a function of time, but not a function of the model response. For example, they must not depend on values obtained by calling SYSFNC and SYSARY. If case>0, then Adams Solver ignores the contents of loadvec. If MFOSUB is called with the FORCE form: Adams Solver applies the contents of the loadvec array directly to the FLEX_BODY without scaling it. Each component of loadvec can depend on time and model response. That is, you can use the values obtained from SYSFNC and SYSARY to compute entries in the loadvec array. |