-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEXECUT.F
106 lines (91 loc) · 4.43 KB
/
EXECUT.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
PROGRAM EXECUT
C PROGRAM EXECUT(INPUT, OUTPUT, TAPE2=157, TAPE5=157, TAPE15=115, TAPE50=335, TAPE60, TAPE6=175, TAPE8=175, TAPE13=175, TAPE7=175)
C THE MAIN PROGRAM EXECUT AND ASSOCIATED SUBROUTINES SET UP AND MANAGE THE SIMULATION RUN(S).
C ASSOCIATED SUBROUTINES:
C - MGT: CONTAINS THE MASTER TIME AND REPORTING CONTROL
C - MGT3: CHECKS AND PREPARES REPORTS ON THE SYSTEM
C - EVNTS: CALLS FOR EXECUTION OF THE UPDATING OF ANIMAL ATTRIBUTES
C REPORTS ARE WRITTEN BY THE SUBROUTINES FOR PLACING, REMOVING AND FINDING ANIMALS IN A FILE.
C SUBROUTINES OF THE SUPPORT GROUP INCLUDE:
C - STATISTICAL: ZROSUM, COLLECT, STATS FOR CALCULATION OF MEAN ETC.
C - RANDOM DEVIATES:
C - FUNCTION RANUM FOR RANDOM NUMBERS
C - FUNCTION RNORM(RMEAN, STD, RMIN, RMAX) FOR NORMAL DISTRIBUTION
C - ARRAY STORAGE:
C - IN(R,C), VEN(R,C) ARE THE INVENTORY FILING ARRAYS
C DIMENSION BOTH TO (R,C) HERE, AND TO (R,1) IN SUBROUTINES.
C SEE PRITSKER "SIMULATION WITH GASP II" PP. 23-24.
C LABELED COMMON IS NAME KEYED, SEE SUBROUTINE USAGE.
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), SUM5(5, 10)
COMMON /GEN/ ITOT, ISIZE, NOWT, NOWY, NDAYS, NRUNS, IATRIB(18), ATRIB(4)
COMMON /HOUSE/ NH(6), N1, N2, N3, N4, N5, N6, NXTFAR, MX1, MX2, MX3, MX4, X1, X2, X4
COMMON /SALES/ MDSELL, WTS, NXTSAL, NSLD(4), WTSLD(4), VSLD(4), PRIH, PRIS
COMMON /SALE2/ NSLDP(4), WTSLDP(4), VSLDP(4), DIS
COMMON /BRED/ LBREED, NBREED, IFAR(6, 5), IDB(30), KAGEW, LGTHW, NAGEM
COMMON /SCH/ KS(2, 500), IPT, IEVT, KODE, IWE, IWN(45), NKT
COMMON /CULL/ NGLTS, MXSRV, MXAGS, PCULG, PCULS, PSSR, PRGT, MXBOR, LDP
COMMON /BRED2/ ABNORG, GESM, GESS, GMIN, GMAX, ESTM, ESTS, EMIN, EMAX
COMMON /BRED3/ PTRM1, PTRM2, PTRM16, PCON1, PCON2, ADJ1, ADJ2
COMMON /SKIP/ ISTOP4, ISTOP5, ISTOP6, ISTOP7, MAXSKP
COMMON /SURVIV/ PW1, PW23, PSRT, PSFIN, PSOWS, PBORS, PBORS1, MDEAD(8), PSRT2
COMMON /GAIN/ GW1, GW23, GSRT, GFIN1, GFIN2, GSOWM, GSOWL, SDP, SSOWM, SSOWL
COMMON /BIRTH/ BRNM, BRNS, BMIN, BMAX, BWTM, BWTS, BWMIN, BWMAX, NOBRN
COMMON /CLEAN/ NDPREP, NH4CLN, LOSSL, SWTLP, SSLP, KL4
COMMON /BOAR/ MXSDY, MXSWY, MXSDM, MXSWM, NPUR, IPDAT, KAGE, WTPB, IBS
COMMON /BRED4/ KBRD, KSWGT(4), NONB(4), NONBK(4)
COMMON /MG3/ NHH(6), MDEADH(8), NHP(6), MDP(6), KCALL, KPRET, KNSLD4, KPREP
COMMON /KRS/ KRS1, KRS2, KRS3, KRS4, KRS5, KRS6, KRS7, KRPT
COMMON /RPT1/ ISMYP, ISMB, ISMBG, ISMF, ISMW, ISMS, ISMM
COMMON /RPT2/ ISMYC, ISMCS, ISMCH, ISML, ISMSS, ISMSH, ISMGR
COMMON /RPT3/ MJEV, ISALS, IFARS, IBRDS
COMMON /RPT4/ IDCS, IDCE, IDCN, IDCF, IDCM, IDCB, IDCFS, IDCFP, IOFLW
COMMON /RPT5/ IAAS, IAAE, IAAN, IAAFN, IAAM, IAAB, IAAFR
COMMON /COST/ FCS, FCB, CLAB, TFAR, TNUR, TSOW, TFIN, VAR(3), COST(30)
COMMON /WRT1/ KW
COMMON /GAIN2/ SOP(6), HOP(6), SSLD(6), HSLD(6), SEND(6), HEND(6)
C MTP: /MG3/ KPREB IN MGT3, KPREP HERE
C ARRAYS IN(3, J), VEN(2, J) OVERLOAD PROTECTION. SEE SUBROUTINE FILEM.
DIMENSION IN(3, 1500), VEN(2, 1500)
DIMENSION EQARR(1802)
EQUIVALENCE (NR, EQARR(1))
C SET KRS3 = J, COLUMN SIZE FOR THE ABOVE DIMENSIONED ARRAYS.
C ITOT (TOTAL NUMBER OF ANIMALS) MAY NOT EXCEED KRS3 AT ANY TIME.
KRS3 = 1500
C INITIATE THE PROGRAM IN SUBROUTINE INITN.
C ASSIGN READ-WRITE TAPES AND READ CONTROL PARAMETERS.
CALL INITN(IN, VEN)
C PREPARE OPENING INVENTORY - READ ORIGINAL HERD DATA.
CALL OPEN_NDAT(IN, VEN)
C SET UP INVENTORY REPORTING IN SUBROUTINE MGT3.
CALL MGT3(IN, VEN)
C LET SUBROUTINE MGT MANAGE THIS SIMULATION RUN.
CALL MGT(IN, VEN, EQARR)
STOP
END
C MTP: THIS WAS A THEORETICAL WAY TO GET ALL THE SOURCE FILES IN ONE FILE
C BUT THE COMPILATION SCRIPT WITH THE LINKING STEPS MAKES MORE SENSE, TO ME
C INCLUDE 'BREED.F'
C INCLUDE 'CLEAN4.F'
C INCLUDE 'COLLECT.F'
C INCLUDE 'EVNTS.F'
C INCLUDE 'FAROW.F'
C INCLUDE 'FILEM.F'
C INCLUDE 'FIND.F'
C INCLUDE 'INITN.F'
C INCLUDE 'MGT.F'
C INCLUDE 'MGT2.F'
C INCLUDE 'MGT3.F'
C INCLUDE 'OPEN_NDAT.F'
C INCLUDE 'OUT.F'
C INCLUDE 'RANUM.F'
C INCLUDE 'REMOV.F'
C INCLUDE 'REPT1.F'
C INCLUDE 'REPT2.F'
C INCLUDE 'RNORM.F'
C INCLUDE 'SELECT.F'
C INCLUDE 'SELL.F'
C INCLUDE 'STATS.F'
C INCLUDE 'UPDATE.F'
C INCLUDE 'ZROSUM.F'