C---- SUB. TRANSLATIONAL_FORCE SUBROUTINE TRANSLATIONAL_FORCE & (TIME,UPAR,NPAR,JFLAG,IFLAG,RESULT) C---- TO EXPORT * SUBROUTINE !DEC$ ATTRIBUTES DLLEXPORT,C::TRANSLATIONAL_FORCE
C---- INCLUDE SYSTEM CALL INCLUDE 'SYSCAL.F'
C---- DEFINE VARIABLES C Parameter Information C TIME : Simulation time of RD/Solver. (Input) C UPAR : Parameters defined by user. (Input) C NPAR : Number of user parameters. (Input) C JFLAG : When RD/Solver evaluates a Jacobian, the flag is true. (Input) C IFLAG : When RD/Solver initializes arrays, the flag is true. (Input) C RESULT : Returned value. (Output)
DOUBLE PRECISION TIME, UPAR(*) INTEGER NPAR LOGICAL JFLAG, IFLAG DOUBLE PRECISION RESULT[REFERENCE](3)
C---- USER STATEMENT C---- LOCAL VARIABLE DEFINITIONS INTEGER I INTEGER MINUS(3) DOUBLE PRECISION VALUE(3)
C---- ASSIGN IMPACT PARAMETERS MINUS(1) = UPAR(1) MINUS(2) = UPAR(2) MINUS(3) = UPAR(3)
DO I=1, 3 IF(I .EQ. 0) THEN VALUE(I) = 8; ELSE IF(I .EQ. 1) THEN VALUE(I) = 24*TIME; ELSE VALUE(I) = 48*(TIME**2); ENDIF
IF(MINUS(I) .NE. 0) THEN VALUE(I) = -VALUE(I); ENDIF ENDDO
C---- ASSIGN THE RETURNED VALUE RESULT(1) = VALUE(1) RESULT(2) = VALUE(2) RESULT(3) = VALUE(3)
RETURN END |