This subroutine is used to specify the number of internal states the in the GSE.
When the GSE is initialized Adams Solver (C++) will look for a GSE_SET_NS entry point in the GSE (if it was not explicitly specified using the INTERFACE= attribute). If GSE_SET_NS is found, then during initialization of the GSE this subroutine will be called.
Notes: | ■The value, NS, returned by GSE_SET_NS will override any value of NS 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 define its own number of states. That is, the number of states in a GSE can be changed without changing the corresponding adams model (.amd).
Calling Sequence and Structure
SUBROUTINE GSE_SET_NS (ID, NS)
Input Arguments
ID | An integer variable that gives the identifier of the GSE statement requesting information from the GSE subroutine. From the identifier, Adams Solver automatically recognizes other information (such as the Par argument) that is associated with that GSE statement. |
Output Arguments
NS | An integer number giving the number of states that this GSE maintains. |
Example
C
C+=================================================================*
C
SUBROUTINE GSE_SET_NS (ID, NS)
C
C Inputs:
C
INTEGER ID
C
C Outputs:
C
INTEGER NS
C
C This GSE has two internal states.
NS = 2
RETURN
END
C
C+=================================================================*
C