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

  1.         SUBROUTINE      STTUP(NSET )
  2. C////////////////////////////////////////////////////////////////
  3. C/                                                              /
  4. C/      Program-id.     STTUP                                   /
  5. C/      Date-written.   Jan. 21st 1984                          /
  6. C/      File-name.      STTUP.FOR                               /
  7. C/      Remarks.        Subroutine STTUP.FOR page 139           /
  8. C/                      Subroutine STTUP for Reinitializing     /
  9. C/                      values for multiple runs.               /
  10. C/            User subroutine for Example-3        /
  11. C/                                                              /
  12. C////////////////////////////////////////////////////////////////
  13. C
  14. C    * Default size of INTEGER = 2 bytes
  15. C       
  16.         INTEGER*4       NSET(6,1)
  17. C
  18.       COMMON /C1/ ID,IM,INIT,JEVNT,JMNIT,MFA,MSTOP,MX,MXC,NCLCT,NHIST,
  19.      1            NOQ,NORPT,NOT,NPRMS,NRUN,NRUNS,NSTAT,OUT,SCALE,ISEED,
  20.      2            TNOW,TBEG,TFIN,MXX,NPRNT,NCRDR,NEP,VNQ(4)
  21. C
  22.       COMMON /C2/ ATRIB(4),ENQ(4),INN(4),JCELS(5,22),KRANK(4),MAXNQ(4),
  23.      1            MFE(4),MLC(4),MLE(4),NCELS(5),NQ(4),PARAM(20,4),
  24.      2            QTIME(4),SSUMA(10,5),SUMA(10,5),NAME(6),NPROJ,MON,
  25.      3          NDAY,NYR,JCLR
  26. C
  27. C       
  28. C
  29.     COMMON /C3/ XISYS,BUS
  30. C       
  31. C       --- Comment cards for starter subroutine
  32. C           Initialize statiscal storage areas for each fiule used
  33. C           in the simulation. This is required since the files are
  34. C           not initilized by subroutine SET
  35. C
  36.       DO 17 K=1,NOQ
  37.         ENQ(K ) = 0.0
  38.         VNQ(K ) = 0.0
  39.         MAXNQ(K ) = NQ(K )
  40.         QTIME(K ) = TNOW
  41.    17 CONTINUE
  42. C
  43. C       --- Test to see if the event file is empty. If event file is 
  44. C           empty start up events are to be used. If event file is not
  45. C           empty read in the number in the system and the status
  46. C           of the server.
  47. C
  48.         IF(NQ(1) ) 19,19,25
  49.    25   READ(NCRDR,91 ) XISYS,BUS
  50.    91     FORMAT(2F5.0 )
  51.         WRITE(1,291 ) XISYS,BUS
  52.   291     FORMAT(1H ,2F5.0 )
  53.     8   RETURN
  54. C
  55. C       --- If start events is to be used the number in the system is 
  56. C           equal to the number of starter events minus the end of 
  57. C           simulation event and the arrival event.
  58. C           If monitor events are used these must also be subtracted
  59. C
  60.    19   XISYS = NQ(3) - 2
  61. C
  62. C       --- If number in system is greater than zero the server
  63. C           status should be set to busy. Let nine equal the 
  64. C           number of initial entries.
  65. C
  66.         BUS = 1.0
  67.         IF(XISYS ) 18,18,7
  68.    18   BUS = 0.0
  69.     7   NINE = NQ(3)
  70.         NC = 1
  71.    11   CALL    RMOVE(MFE(3),3,NSET )
  72.         J = 1
  73.         IF(ATRIB(2) - 0.1 ) 20,20,21
  74.    20   J = 2
  75.    21   CALL    FILEM(J,NSET )
  76.         CALL    FILEM(3,NSET )
  77.         IF(NC - NINE ) 9,8,8
  78.     9   NC = NC + 1
  79.                         GO TO 11
  80.         END
  81.