This subroutine is used to specify the number of discrete internal states the in the GSE.
When the GSE is initialized Adams Solver (C++) will look for a GSE_SET_ND entry point in the GSE (if it was not explicitly specified using the INTERFACE= attribute). If GSE_SET_ND is found, then during initialization of the GSE this subroutine will be called.
Notes: | ■The value, ND, returned by GSE_SET_ND will override any value of ND 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 discrete states. That is, the number of discrete states in a GSE can be changed without changing the corresponding adams model (.amd).
Calling Sequence and Structure
SUBROUTINE GSE_SET_ND (ID, ND)
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
ND | An integer number giving the number of discrete states that this GSE maintains. |
Example
C
C+=================================================================*
C
SUBROUTINE GSE_SET_ND (ID, ND)
C
C Inputs:
C
INTEGER ID
C
C Outputs:
C
INTEGER ND
C
C This GSE has two discrete internal states.
ND = 2
RETURN
END
C
C+=================================================================*
C