-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMGT.F
114 lines (94 loc) · 3.56 KB
/
MGT.F
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
SUBROUTINE MGT(IN, VEN, EQARR)
COMMON /INIT/ NR, NW, ND, NT7, NT8, NDAT, NS1, NS2, NOWD
COMMON /RAN/ IRN(54), KRANUM, RLIMIT, NRNOPT, ITAPE
COMMON /STAT/ SUM(5, 20), SUM2(5, 10), SUM3(5, 10), SUM4(5, 10)
COMMON /GEN/ ITOT, ISIZE, NOWT, OWY, NDAYS, NRUNS, IATRIB(18), ATRIB(4)
COMMON /HOUSE/ NH(6), N1, N2, N3, N4, N5, N6, NXTFAR, MX1, MX2, MX3, MX4
COMMON /SALES/ MDSELL, WTS, NXTSAL, NSLD(4), WTSLD(4), VSLD(4), PRIH, PRIS
COMMON /BRED/ LBREED, NBREED, IFAR(30), IDB(30), KAGEW, LGTHW, NAGEM
COMMON /BRED2/ ABNORG, GESM, GESS, GMIN, GMAX, ESTM, ESTS, EMIN, EMAX
COMMON /SKIP/ ISTOP4, ISTOP5, ISTOP6, ISTOP7, MAXSKP
COMMON /SURVIV/ PW1, PW23, PSRT, PSFIN, PSOWS, PBORS, PBORS1, MDEAD(8)
COMMON /GAIN/ GW1, GW23, GSRT, GFIN1, GFIN2, GSOWM, GSOWL
COMMON /BIRTH/ BRNM, BRNS, BMIN, BMAX, BWTM, BWTS, BWMIN, BWMAX, NOBRN
COMMON /CLEAN/ NDPREV, NH4CLN, LOSSL
COMMON /KRS/ KRS1, KRS2, KRS3, KRS4, KRS5, KRS6, KRS7, KRPT
COMMON /RPT5/ IAAS, IAAE
COMMON /RPT1/ ISMYP, ISMB, ISMBG, ISMF, ISMW, ISMS, ISMM
COMMON /SCH/ KS(2, 500), IPT, IEVT, KODE, IWE, IWN(44), NKT
COMMON /WRT1/ KW
C GENERAL MANAGEMENT OF THE SIMULATION RUN.
DIMENSION IN(3, 1), VEN(2, 1)
C LET MGT2 BUILD EVENTS FILE INTO ARRAY KS(2,500)
KODE = 1
CALL MGT2(IN, VEN)
C LOOP NDAYS OF SIMULATION, INCREMENTING NOWT AND NOWY.
C ISTOP4-7 SET TO NDAYS HERE, MAY TEMPORARILY LOWER ELSEWHERE.
KRS2 = ISMYP
ISTOP4 = KRS2
ISTOP5 = KRS2
ISTOP6 = KRS2
ISTOP7 = KRS2
NOWT = 0
C INDIVIDUAL DAILY ANIMAL ATTRIBUTE CALL 7777
C MTP: COMMENTED OUT THIS LINE BECAUSE IT WAS BUGGING THE COMPILER DUE TO MISSING ARGS
C CALL OUT(IN, VEN, 7777)
IF(NS2-2) 8888, 788, 8888
788 CALL OUT(IN, VEN, 1, ITOT, 2788.0)
8888 NOWT = NOWT + 1
NOWY = (NOWT - 1) / 365 + 1
NOWD = NOWT - (NOWY - 1) * 365
C MTP: COMMENTING THIS OUT ALLOWS THE PROGRAM TO FINISH
C SO THE ISSUE IS SOMEWHERE IN HERE, STILL NOT SURE WHERE, THOUGH
CALL EVNTS(IN, VEN)
C INDIVIDUAL DAILY ATTRIBUTE REPORT IN SUB. OUT(,,,7777)
IF(IAAS-NOWT) 782, 782, 786
782 IF(IAAE-NOWT) 786, 784, 784
C MTP: COMMENTED OUT THIS LINE BECAUSE IT WAS BUGGING THE COMPILER DUE TO MISSING ARGS
C REPLACED WITH A LINE THAT DOES NOTHING
C784 CALL OUT(IN, VEN, 7777)
784 NOTHING = 0
IF(NS2-2) 786, 785, 786
785 CALL OUT(IN, VEN, 1, ITOT, 28888.7)
C CALL MGT3 EVERY DAY, TEST FOR DAILY INVENTORY REPORT THERE.
C KRS1 SWITCH SENSES CHANGE IN TOTAL INVENTORY
786 IF(ITOT-KRS1) 787, 789, 787
787 KRS1 = 1
789 CALL MGT3(IN, VEN)
KRS1 = ITOT
C PRODUCTION SUMMARY REPORTS CALLED
C KRS2 HOLDS DAY OF NEXT CALL
IF(NOWT-KRS2) 800, 401, 401
401 KRS2 = KRS2 + ISMYP
ISTOP4 = KRS2
ISTOP5 = KRS2
ISTOP6 = KRS2
ISTOP7 = KRS2
IF(ISMB) 5, 5, 404
404 KW = 4
CALL REPT1(IN, VEN)
KW = 0
5 IF(ISMBG) 6, 6, 505
505 KW = 5
CALL REPT1(IN, VEN)
KW = 0
6 IF(ISMF) 7, 7, 606
606 KW = 6
CALL REPT1(IN, VEN)
C PRODUCTION GAINS AND COST SUMMARY REPORTS IN SUB. REPT1,
C SUB. REPT1 CALLS REPT2 FOR COSTS AND RETURNS
7 KW = 7
CALL REPT1(IN, VEN)
KW = 0
800 CONTINUE
CALL SECOND(T)
KT = T
IF(KT-KRS4) 801, 801, 999
999 WRITE(NW,961) KRS4, ITOT, NOWT
961 FORMAT(///' STOP DUE TO TIME EXCEEDING LIMIT OF'I6' SECONDS, TOTAL NO. ANIMALS='I6' AT DAY='I5)
STOP
801 CONTINUE
C MTP: THIS LINE USED TO HAVE LABEL 88 IN FRONT OF IT. NOT SURE THAT LABEL DID ANYTHING
IF(NOWT .LT. NDAYS) GO TO 8888
RETURN
END