FORTRAN example for SYSARY

 

C---- SUB. REQUEST

      SUBROUTINE REQUEST_USUB

     &          (TIME,UPAR,NPAR,IFLAG,RESULT)

C---- TO EXPORT * SUBROUTINE

      !DEC$ ATTRIBUTES DLLEXPORT,C::REQUEST_USUB

 

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     IFLAG  : When RD/Solver initializes arrays, the flag is true. (Input)

C     RESULT : Returned values. (Output, Size : 8)

 

      DOUBLE PRECISION TIME, UPAR(*)

      INTEGER NPAR

      LOGICAL IFLAG

      DOUBLE PRECISION RESULT[REFERENCE](8)

 

C---- USER STATEMENT

C---- Local Variable Definition

      DOUBLE PRECISION VALUE(9)

      INTEGER MKID(3)

      LOGICAL ERRFLG

 

C---- Assing Impact Parameter

      MKID(1) =INT(UPAR(1))

      MKID(2) =INT(UPAR(2))

      MKID(3) =INT(UPAR(3))

     

C---- Call SYSARY to collect Information for Calculation

      CALL SYSARY('FORCE',MKID,3,VALUE,6,ERRGLG)

 

C---- Assign the returned value to User Subroutine Request

      RESULT(2) = VALUE(1)

      RESULT(3) = VALUE(2)

      RESULT(4) = VALUE(3)

      RESULT(6) = VALUE(4)

      RESULT(7) = VALUE(5)

      RESULT(8) = VALUE(6)

     

      RETURN

      END