home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / sigm / vol266 / endsm3.for < prev    next >
Encoding:
Text File  |  1986-05-19  |  2.0 KB  |  56 lines

  1.         SUBROUTINE      ENDSM(NSET)
  2. C////////////////////////////////////////////////////////////////
  3. C/                                                              /
  4. C/      Program-id.     ENDSM                                   /
  5. C/    Date-written.    Jan. 23rd 1984                /
  6. C/      File-name.      ENDSM3.FOR                              /
  7. C/    Remaeks.    User defined subroutine, the completion /
  8. C/            of the simulation at a time specified   /
  9. C/            by the programmer.            /
  10. C/            page 128.                /
  11. C/            This is the version for Example 3.    /
  12. C/                                                              /
  13. C////////////////////////////////////////////////////////////////
  14. C
  15. C    * Default size of INTEGER = 2 bytes in F80
  16. C       
  17.         INTEGER*4       NSET(6,1)
  18. C
  19.       COMMON /C1/ID,IM,INIT,JEVNT,JMNIT,MFA,MSTOP,MX,MXC,NCLCT,NHIST,
  20.      1           NOQ,NORPT,NOT,NPRMS,NRUN,NRUNS,NSTAT,OUT,SCALE,ISEED,
  21.      2           TNOW,TBEG,TFIN,MXX,NPRNT,NCRDR,NEP,VNQ(4)
  22. C
  23.       COMMON /C2/ATRIB(4),ENQ(4),INN(4),JCELS(5,22),KRANK(4),MAXNQ(4),
  24.      1           MFE(4),MLC(4),MLE(4),NCELS(5),NQ(4),PARAM(20,4),
  25.      2           QTIME(4),SSUMA(10,5),SUMA(10,5),NAME(6),NPROJ,MON,
  26.      3         NDAY,NYR,JCLR
  27. C
  28.     COMMON /C3/ XISYS,BUS
  29. C
  30.    20    IF (NQ(1)) 7,8,9
  31.     7    CALL    ERROR(3,NSET)
  32. C
  33. C    --- Update statistics on number in system and status of server 
  34. C        to end of simulation time. Set control variable to stop
  35. C        simulation and to yield final report.
  36. C
  37.     8    CALL    TMST(XISYS,TNOW,1,NSET)
  38.     CALL    TMST(BUS,TNOW,2,NSET)
  39.     MSTOP = -1
  40.     NORPT = 0
  41.     RETURN
  42. C
  43. C    --- Remove all events from event file so that all customers
  44. C        arriving before end of simulation time are included in
  45. C        simulation statistics. Only end of service event need be 
  46. C        processed. If items are in the queue of the server they
  47. C        will be removed in the end of service event where another
  48. C        end of service event will be created.
  49. C
  50.     9    CALL    RMOVE(MFE(1),1,NSET)
  51.     TNOW = ATRIB(1)
  52.     IF (ATRIB(2) - 2.0) 20,21,20
  53.    21    CALL    ENDSV(NSET)
  54.                     GO TO 20
  55.     END
  56.