FORTRAN example for RD_SYSTEM

 

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

      DOUBLE PRECISION VY

      INTEGER ID(2),REPFLG

      LOGICAL ERRFLG

     

      ID(1) = INT(UPAR(1))

      ID(2) = INT(UPAR(2))

     

      CALL SYSFNC('VY',ID,2,VY,ERRFLG)

     

      CALL RE_SYSTEM(REPFLG)

     

      WRITE(10000,*) '*TIME=',TIME

      IF(REPFLG .EQ. 1) WRITE(10000,*) '*VY=',VY

     

      DO I= 1, 8

         RESULT(I) = 0.0D0

      ENDDO

      RESULT(1) = VY

     

      RETURN

      END