This subroutine is used to enforce the condition that continuous states are or are not allowed to change during a static or quasi-static simulation.
See the definition of the STATIC_HOLD attribute in the documentation for the GSE statement.
When the GSE is initialized Adams Solver (C++) will look for a GSE_SET_STATIC_HOLD entry point in the GSE (if it was not explicitly specified using the INTERFACE= attribute). If GSE_SET_STATIC_HOLD is present, then during initialization of the GSE this subroutine will be called.
Notes: | ■The value returned by GSE_SET_STATIC_HOLD will override any STATIC_HOLD attribute setting that is specified in the GSE statement. ■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. Doing this ensures that Adams Solver correctly distinguishes a C style subroutine from Fortran and calls with the appropriate interface. |
This user-defined subroutine is new for Adams Solver (C++) v2006r1 and gives the GSE the ability to set the STATIC_HOLD attribute itself. That is, the formulation of a GSE can be changed without changing the corresponding Adams model (.amd).
Calling Sequence and Structure
SUBROUTINE GSE_SET_STATIC_HOLD (ID, STATIC_HOLD)
Input Arguments
ID | An integer variable that gives the identifier of the GSE statement requesting information from the GSE subroutine. |
Output Arguments
STATIC_HOLD | An integer specifying whether the GSE formulation has the STATIC_HOLD attribute set. A nonzero (true) value for STATIC_HOLD specifies that that GSE has its STATIC_HOLD attribute set. |
Example
C
C+=================================================================*
C
SUBROUTINE GSE_SET_STATIC_HOLD (ID, STATIC_HOLD)
C
C Inputs:
C
INTEGER ID
C
C Outputs:
C
INTEGER STATIC_HOLD
C
C Continuous variables are held constant during static or
C quasi-static simulations.
C
STATIC_HOLD = 1
RETURN
END
C
C+=================================================================*
C