Open Collections

UBC Theses and Dissertations

UBC Theses Logo

UBC Theses and Dissertations

A dairy cattle breeding and management computer simulation program for teaching and research 1986

You don't seem to have a PDF reader installed, try download the pdf

Item Metadata

Download

Media
UBC_1986_A6_7 S57.pdf [ 11.56MB ]
UBC_1986_A6_7 S57.pdf
Metadata
JSON: 1.0096813.json
JSON-LD: 1.0096813+ld.json
RDF/XML (Pretty): 1.0096813.xml
RDF/JSON: 1.0096813+rdf.json
Turtle: 1.0096813+rdf-turtle.txt
N-Triples: 1.0096813+rdf-ntriples.txt
Citation
1.0096813.ris

Full Text

c A DAIRY CATTLE BREEDING AND MANAGEMENT COMPUTER SIMULATION PROGRAM FOR TEACHING AND RESEARCH by John Skinner B . S c , The U n i v e r s i t y of B r i t i s h Columbia, 1978 A THESIS SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER OF SCIENCE in THE FACULTY OF GRADUATE STUDIES (Department of Animal Science, F a c u l t y of A g r i c u l t u r a l Science We accept t h i s t h e s i s as conforming to the r e q u i r e d standard THE UNIVERSITY OF BRITISH COLUMBIA A p r i l 1986 @ J o h n D. M. Skinner, 1986 a In p r e s e n t i n g t h i s t h e s i s i n p a r t i a l f u l f i l m e n t of the requirements f o r an advanved degree at the U n i v e r s i t y of B r i t i s h Columbia, I agree that the L i b r a r y s h a l l make i t f r e e l y a v a i l a b l e f o r r e f e r e n c e and study. I f u r t h e r agree that permission f o r e x t e n s i v e copying of t h i s t h e s i s fo r s c h o l a r l y purposes may be granted by the head of my department or by h i s or her r e p r e s e n t i t i v e s . I t i s understood that copying or p u b l i c a t i o n of t h i s t h e s i s f o r f i n a n c i a l gain s h a l l not be allowed without my w r i t t e n p e r m i s s i o n . Department of pyt^mfl - i~ . ^ q E i ^ c g The U n i v e r s i t y of B r i t i s h Columbia 2075 Westbrook Place Vancouver, Canada V6T 1W5 1 1 ABSTRACT The i n c r e a s e d power and a v a i l a b i l i t y of computers has r e s u l t e d i n an i n c r e a s e i n the value of s i m u l a t i o n as a means of f u r t h e r i n g our understanding of systems. Reducing the components and i n t e r a c t i o n s of a system to mathematical models enables s i m u l a t i o n to p r o v i d e a c l e a r b a s i s of the system and t h i s can be u s e f u l f o r t e a c h i n g and r e s e a r c h . S i m u l a t i o n i s e s p e c i a l l y s u i t e d f o r s t u d y i n g g e n e t i c gain i n d a i r y c a t t l e because there are a l r e a d y r e l i a b l e mathematical models a v a i l a b l e . A n a l y z i n g g e n e t i c gain in p r a c t i c e i s d i f f i c u l t due to the numerous and d i v e r s e f a c t o r s that a f f e c t i t . T h i s p r o j e c t has p r o v i d e d a computer program that s i m u l a t e s the i n h e r i t a n c e of the economically important t r a i t s i n d a i r y c a t t l e and i n c l u d e s i n t e r a c t i o n s with the b i o l o g i c a l , management and economic f a c t o r s which can a f f e c t g e n e t i c g a i n . I t was designed p r i m a r i l y as a t e a c h i n g t o o l f o r s e n i o r undergraduate students i n animal g e n e t i c s or d a i r y s c i e n c e , to heighten students i n t e r e s t and encourage them to think more deeply about the s u b j e c t . Features were a l s o i n c l u d e d to make the s i m u l a t i o n u s e f u l i n r e s e a r c h f o r s t i m u l a t i n g and r e f i n i n g r e s e a r c h o b j e c t i v e s and f o r a n a l y z i n g q u e s t i o n s not e a s i l y t e s t e d i n the f i e l d . The program models the system at the cow l e v e l with c r i t i c a l management d e c i s i o n s made on a continuous b a s i s and summaries and other management d e c i s i o n s on a calendar year b a s i s . Mature e q u i v a l e n t milk p r o d u c t i o n i s given i n Breed ABSTRACT i i i C l a s s Averages and the quota system of l i m i t i n g milk p r o d u c t i o n i s used so that any small Canadian d a i r y p o p u l a t i o n can be simulated. Parameters are pr o v i d e d and documented f o r s i m u l a t i n g a F r a s e r V a l l e y p o p u l a t i o n . Since a d a i r y p o p u l a t i o n i s an extremely complex system improvements and expansions to t h i s s i m u l a t i o n can be made. While some expansions and improvements are p o s s i b l e with e x i s t i n g i n f o r m a t i o n many would r e q u i r e more r e s e a r c h to pro v i d e parameters and bases f o r models. Use and t e s t i n g should r e v e a l the changes that are the most b e n e f i c i a l and f e a s i b l e . The program has been w r i t t e n i n a modularized form to more e a s i l y f a c i l i t a t e changes and a d d i t i o n s . F u l l i n s t r u c t i o n s , sample runs and documentation have been i n c l u d e d to encourage knowledgeable use and expansion of the program. i v TABLE OF CONTENTS ABSTRACT i i LIST OF TABLES v i i i LIST OF FIGURES ix ACKNOWLEDGEMENTS x INTRODUCTION .1 Chapter 1. 1 : OBJECTIVES 5 1.2: SYSTEM SIMULATED 5 1.2.1: General D e s c r i p t i o n 5 1.2.2: Major I n t e r a c t i o n s 7 1.2.2.1: Maximizing Returns 9 1.2.2.1.1: Management Systems 9 1.2.2.1.2: Breeding Programs 10 1.2.2.1.2.1: Breeding S t r a t e g i e s 12 1.2.2.1.2.2: A c t u a l Improvement 14 1.3: TEACHING 15 1.3.1: Teaching Genetics 16 1.3.1.1: Animal Genetics Course 17 1.3.1.1.1: Why Dai r y C a t t l e ? 18 1.3.1.1.2: Use of Si m u l a t i o n 19 1.3.1.1.3: O b j e c t i v e s of the Si m u l a t i o n 21 1.3.1.1.3.1: Intended course s t r u c t u r e 23 1.4: RESEARCH 24 1.4.2.1: The Simu l a t i o n 24 Chapter 2. 2: PHILOSOPHY AND DETAILS 26 2.1: The s i m u l a t i o n 27 2.1.1: Framework 28 2.1.2: General d e s c r i p t i o n 28 2.2: Simulated events 31 2.2.1 : L a c t a t i o n 31 2.2.1.1: 305-day mature e q u i v a l e n t p r o d u c t i o n 31 2.2.1.2: Adjustments 34 2.2.1.3: A c t u a l p r o d u c t i o n . . 35 2.2.2: Reproduction 37 2.2.2.1: E s t r u s d e t e c t i o n 39 2.2.2.2: Conception 39 2.2.2.3: B i r t h of a c a l f 40 TABLE OF CONTENTS v 2.2.3: Feed consumption 41 2.2.3.1: Replacement h e i f e r s 42 2.2.4: H e a l t h and death 42 2.2.5: Management 43 2.2.5.1: BCA' s 44 2.2.5.2: EPA's 44 2.2.5.3: ETA's 4 5 2.2.5.4: Simulated s i r e p r o o f s 46 2.2.5.5: Herd options 47 2.2.5.5.1: Management l e v e l 47 2.2.5.5.2: Minimum d a i l y p r o d u c t i o n 48 2.2.5.5.3: Ranking c r i t e r i a 48 2.2.5.5.3.1: C u l l i n g f o r rank 48 2.2.5.5.4: C u l l i n g f o r f e r t i l i t y 49 2.2.5.5.5: Matings 49 2.2.6: Economic f a c t o r s 50 2.2.6.1: Semen p r i c e 51 Chapter 3. 3: PARAMETERS USED 52 3.1: L a c t a t i o n 52 3.1.1: St a n d a r d i z e d 305 day p r o d u c t i o n 52 3.1.2: Adjustments 53 3.1.3: A c t u a l p r o d u c t i o n 54 3.2.1: Reproduction . . . . 58 3.2.1.1: V i s i b i l i t y of e s t r u s 58 3.2.1.2: Conception 59 3.2.2: Death and h e a l t h \ . . . 59 3.3: Economic 60 3.3.1: F i x e d c o s t s . . . . . 61 3.3.2: Feed and maintenace c o s t s 62 3.3.3: M i l k p r i c e 62 3.3.4: P r i c e f o r s o l d animals 63 3.4: Management 64 3.4.1: L a c t a t i o n records 63 3.4.1.1: P r o j e c t i o n of l a c t a t i o n records 63 3.4.1.2: Adjustment f o r BCA u n i t s 63 3.4.1.3: R e p e a t a b i l i t i e s 64 3.4.1.4: H e r i t a b i l i t i e s 64 3.4.2: P o p u l a t i o n d e c i s i o n s 64 3.4.2.1: Minimum days post p a r t u r i t i o n to breed . . . . 64 3.4.2.2: Minimum dry p e r i o d 64 3.5: Setup 66 3.5.1: D e c i s i o n o p t i o n s 67 3.5.1.1: I n i t i a l year 67 3.5.1.2: Operating mode 67 3.5.1.3: Management l e v e l 67 3.5.1.4: S e l e c t i o n c r i t e r i a 68 3.5.1.5: S e l e c t i o n index 68 3.5.1.6: Minimum d a i l y p r o d u c t i o n 68 TABLE OF CONTENTS v i 3.5.1.7: C u l l i n g f o r f e r t i l i t y 68 3.5.1.8: Breeding scheme 69 3.5.2: Quota 69 3.6: A.I. u n i t 69 3.6.1: B u l l f e r t i l i t y 69 3.6.2: Ages 70 3.6.3: Number of cows 70 3.6.3: Semen cost 70 Chapter 4. 4: POTENTIAL IMPROVEMENTS 71 4.1: 305-day pr o d u c t i o n & type score 71 4.2: Adjustments 72 4.3: L a c t a t i o n curve 73 4.4: Reproduction 74 4.5: Feeding 76 4.6: Economics 77 4.7: Management 77 4.8: P r a c t i c a l 78 SUMMARY . 80 BIBLIOGRAPHY. . 82 APPENDIXES A: FULL INSTRUCTIONS 88 A.1: I n i t i a l i z e and compile 89 A.2: Set up herds and AI u n i t s 89 A.3: Simulate a year 90 A.4: Update AI and switch f i l e s 92 A. 5: Compile data base 93 A.6: A n a l y s i s 94 B1: SAMPLE INTERACTIVE RUN 98 B1 . 1 : SETUP 98 B1.2.1: SIM.YEAR - FULL OUTPUT MODE 99 B 1.2.1: SIM.YEAR - SEMI AUTOMATED 104 B1.2.3: SIM.YEAR - AUTOMATED 106 B1 .3: AIUPD 1 07 B1 .4: AIVIEW 1 07 B1.5: CRDBASE 108 B1.6: STAT. ANAL 109 TABLE OF CONTENTS v i i B2: SAMPLE PRINTED OUTPUTS B2. 1 : SIM.YEAR 112 B2.2: STAT. ANAL 119 C: PROGRAM FLOW CHARTS 124 D: PROGRAM LISTINGS 131 v i i i LIST OF TABLES Table I Means and standard d e v i a t i o n s f o r the four i n h e r i t e d t r a i t s 54 Table II C o r r e l a t i o n s between the four i n h e r i t e d t r a i t s . 55 Table III Adjustment f a c t o r s f o r the four i n h e r i t e d t r a i t s 56 Table IV L a c t a t i o n curve and other b i o l o g i c a l parameters 57 Table V Economic parameters 60 Table VI Management in f o r m a t i o n parameters 63 Table VII S i m u l a t i o n set up parameters 66 Table VIII C a l v i n g i n t e r v a l s from a t e s t run 75 Table IX L i s t of v a r i a b l e s that are accumulated i n the data base 96 ix LIST OF FIGURES F i g u r e 1.1 Major components and i n t e r a c t i o n s i n a d a i r y c a t t l e p o p u l a t i o n 7 F i g u r e 2.1 Flow c h a r t of events simulated f o r a cow 30 F i g u r e A.1 Flow c h a r t of the steps i n running the . . . s i m u l a t i o n program 88 F i g u r e C.1 Flow ch a r t of the main s i m u l a t i o n program 124 X ACKNOWLEDGEMENTS I am g r a t e f u l to Dr. R.G. Peterson f o r p r o v i d i n g the i n s p i r a t i o n and guidance that made t h i s p r o j e c t p o s s i b l e . I would l i k e to thank the members of my committee Drs. J.A. S h e l f o r d , K.M. Cheng, L . J . F i s h e r , R. B l a i r and C.C. Short f o r t h e i r c r i t i c i s m s and su g g e s t i o n s . I would a l s o l i k e to thank f r i e n d s and f a m i l y who pro v i d e d encouragement and a s s i s t a n c e , e s p e c i a l l y my wife f o r her h e l p i n p r e p a r i n g the f i n a l d r a f t and her t o l e r a n c e throughout. 1 INTRODUCTION S i m u l a t i o n can be d e f i n e d as a p p l i e d systems a n a l y s i s , with a system being d e f i n e d i n gen e r a l terms as a set of ob j e c t s together with the r e l a t i o n s h i p s between the o b j e c t s and t h e i r a t t r i b u t e s ( H a l l & Fagan, 1956). The aim of most s c i e n t i f i c endeavor has been a n a l y t i c a l , using deductive reasoning to understand complex s i t u a t i o n s by reducing them i n t o smaller components (Joandet, 1975). With the concomitant r a d i c a l i n c r e a s e i n the volume of knowledge, i n t u i t i v e t h i n k i n g alone i s o f t e n no longer a b l e to take i n t o account a l l of the r e l a t i o n s h i p s and i n t e r a c t i o n s between the components. Systems a n a l y s i s p r o v i d e s a s t r u c t u r e d approach to studying a system the r e s u l t s of which i n c l u d e : (1) r e v e a l i n g gaps and weaknesses in our knowledge of the system; (2) p r o v i d i n g the b a s i c s t r u c t u r e of the system f o r teaching and a p p l i c a t i o n ; (3) p r o v i d i n g a c l e a r p e r s p e c t i v e f o r pl a n n i n g f u r t h e r r e s e a r c h ; and (4) a l l o w i n g p r e l i m i n a r y t e s t i n g of ideas and h y p o t h e s i s . The value of t h i s approach has been g r e a t l y enhanced by the i n c r e a s i n g a v a i l a b i l i t y and c a p a b i l i t i e s of computer f a c i l i t i e s . S i m u l a t i o n using mathematical mod e l l i n g techniques and computer programming p r o v i d e s a powerful t o o l f o r a n a l y z i n g complex systems with the only l i m i t a t i o n being the adequacy of the mathematical models i n d e s c r i b i n g our knowledge. INTRODUCTION 2 Simu l a t i o n has proven e s p e c i a l l y u s e f u l in Animal Science where experiments with l a r g e animals are expensive and can take many years. The growing a v a i l a b i l i t y of computers i n Animal Science has r e s u l t e d i n a p a r a l l e l i n c r e a s e i n the use of computer s i m u l a t i o n i n t e a c h i n g and r e s e a r c h . Experiments f o r p r e l i m i n a r y r e s e a r c h and to a i d i n teaching can be performed on simulated p o p u l a t i o n s cheaply and q u i c k l y . Most s i m u l a t i o n s to date, however, have had poor documentation or no documentation at a l l (Hocking, et a l . , 1983). T h i s has undoubtedly r e s u l t e d i n much d u p l i c a t i o n of e f f o r t . I t has been suggested (Hocking, 1983) that the documentation i n c l u d e : (1) a d e s c r i p t i o n of the program; (2) the o b j e c t i v e s and procedures; (3) mathematical models used; (4) f u l l i n s t r u c t i o n s f o r use; and (5) examples of input and output. The l i s t c o u l d be extended. (1) I n c l u s i o n of a d i s c u s s i o n of the models and the parameters used should r e v e a l gaps and weaknesses i n our knowledge of the system and h o p e f u l l y s t i m u l a t e r e s e a r c h . (2) I n c l u s i o n of flow c h a r t s and program documentation w i l l g r e a t l y a i d i n modifying the program to keep pace with our advances i n knowledge. These f e a t u r e s would allow programs to be f u l l y u t i l i z e d i n a knowledgeable way by more people. INTRODUCTION 3 The aim of the c u r r e n t p r o j e c t was t h r e e f o l d . ( 1 ) Design and b u i l d a comprehensive d a i r y c a t t l e computer s i m u l a t i o n program s u i t a b l e f o r teaching and re s e a r c h , with s p e c i a l emphasis on the i n t e r a c t i o n s between breeding, management and economics i n a d a i r y e n t e r p r i s e . ( 2 ) P r o v i d e f u l l documentation and e x p l a n a t i o n of the program so t h a t i t can be of maximum b e n e f i t as a t e a c h i n g t o o l f o r d a i r y c a t t l e breeding and management courses and as a t o o l f o r i n v e s t i g a t i n g the complex r e l a t i o n s h i p s between breeding programs, management systems and economic r e t u r n s to a d a i r y e n t e r p r i s e . (3) I d e n t i f y areas where the s i m u l a t i o n can be improved by adding to the program, by c o l l e c t i n g more data f o r b e t t e r parameter e s t i m a t i o n and by f u r t h e r r e s e a r c h suggesting b e t t e r models. Due to the nature of t h i s p r o j e c t i t cannot be w r i t t e n up in a t r a d i t i o n a l format f o r a Masters T h e s i s . I t has been organized i n t o four c h a p t e r s and ex t e n s i v e appendices. Chapter one o u t l i n e s the system to be simulated, the aspects of the system that are of most importance f o r t e a c h i n g and re s e a r c h , and the p r a c t i c a l requirements of the program o p e r a t i o n . Chapter two cover s the philosophy of the mo d e l l i n g process and the d e t a i l s of the models used. Chapter three p r o v i d e s parameters f o r the models to simulate a F r a s e r V a l l e y herd and d i s c u s s e s t h e i r adequacy. The f o u r t h i s a c o n c l u d i n g chapter that b r i n g s together p o t e n t i a l improvements i n the s i m u l a t i o n that are suggested i n Chapters two and t h r e e . The INTRODUCTION 4 appendices provide d e t a i l e d i n s t r u c t i o n s f o r using the program, annotated program input and output and the d e t a i l s of the program i t s e l f . 5 Chapter 1. OBJECTIVES T h i s chapter e l a b o r a t e s on the three main o b j e c t i v e s of the s i m u l a t i o n program. ( 1 ) To make the program capable of s i m u l a t i n g a p o p u l a t i o n of Canadian d a i r y herds as comprehensively and r e a l i s t i c a l l y as i s f e a s i b l e . (2) To t a i l o r the program to be e s p e c i a l l y u s e f u l as a t e a c h i n g a i d f o r a s e n i o r undergraduate course i n animal genet i c s . (3) To maximize the programs u s e f u l n e s s to r e s e a r c h e r s i n d a i r y breeding and management. 1.2: System Simulated The system to be simulated i s any Canadian d a i r y p o p u l a t i o n . The s i z e l i m i t s are given i n sec. 2 . 1 . 1 . 1 . F u r t h e r l i m i t a t i o n s n e c e s s i t a t e d by c o n f l i c t i n g g o als and l i m i t a t i o n s of a v a i l a b l e models are d i s c u s s e d throughout chapter two. The major components and i n t e r a c t i o n s w i t h i n t h i s system are d i s c u s s e d i n t h i s s e c t i o n . 1.2.1: General D e s c r i p t i o n A Canadian d a i r y c a t t l e p o p u l a t i o n i s composed p r i m a r i l y of herds between 30 and 200 cows each. Each herd i s managed by an independent dairyman who depends on the o p e r a t i o n as h i s s o l e or p a r t i a l source of income. The p r i c e s of goods and OBJECTIVES 6 s e r v i c e s s u p p l i e d by and r e q u i r e d by a d a i r y o p e r a t i o n are determined by f r e e market f o r c e s with the e x c e p t i o n of milk p r i c e . M i l k i n Canada i s s o l d under c o n t r o l of a two p r i c e marketing s t r u c t u r e where the P r o v i n c i a l Government s e t s the p r i c e f o r f l u i d milk and the F e d e r a l Government e f f e c t i v e l y s e t s the p r i c e f o r manufacturing milk by means of support programs. The u n i t p r i c e p a i d by both governments i s dependent on whether the f a t content of the milk i s above or below 3.6 kg per h e c t o l i t r e . The q u a n t i t y of milk produced i s r e g u l a t e d by a l l o c a t i n g to d a i r y producers the r i g h t s to s e l l a s p e c i f i c amount of milk f o r f l u i d use and a separate q u a n t i t y of milk f o r manufacturing purposes. In B r i t i s h Columbia approximately 35% of the t o t a l i s a l l o c a t e d f o r manufacturing. M i l k produced above the a l l o t t e d amounts i s su b j e c t to a p e n a l t y . Many d a i r y o p e r a t o r s a l s o p a r t i c i p a t e i n a r e g i o n a l or n a t i o n a l milk r e c o r d i n g and breed improvement program. These programs c o l l e c t cows p r o d u c t i o n records and type c l a s s i f i c a t i o n s . P roduction records are p r o j e c t e d to 305 days, a d j u s t e d f o r age and expressed i n a s t a n d a r d i z e d form which i s known as the Breed C l a s s Averages (BCA) i n Canada. The BCA are then used to estimate producing a b i l i t i e s , breeding values of cows and to c a l c u l a t e s i r e p r o o f s . Most animals are bred using a r t i f i c i a l i nsemination (A.I.) with semen from b u l l s i n the r e g i o n a l or n a t i o n a l A.I. u n i t s . These AI s i r e p r o v i n g programs which i n v o l v e t e s t i n g l a r g e numbers of daughters, account f o r most of the g e n e t i c gain i n the p o p u l a t i o n f o r milk p r o d u c t i o n . OBJECTIVES 7 1.2.2: Major I n t e r a c t i o n s L i k e any b i o l o g i c a l l y based system a d a i r y c a t t l e p o p u l a t i o n i n v o l v e s m u l t i - l e v e l and complex i n t e r a c t i o n s . F i g . 1.1 attempts to summarize the major i n t e r a c t i o n s at a macro l e v e l . f igure 1.1 $ RETURN OBJECTIVES 8 The r e t u r n s per year are determined by the o p e r a t i n g c o s t s , the income from milk and the income from animals s o l d . For t h i s s i m u l a t i o n i t i s assumed t h a t , the d r i v i n g f o r c e behind the d a i r y i n d u s t r y i s the d e s i r e of milk producers to maximize t h e i r d o l l a r r e t u r n per year. Operating c o s t s can be sub d i v i d e d i n t o two major components: ( 1 ) f i x e d c o s t s such as a m o r t i z a t i o n of land, b u i l d i n g s , quota, animals and equipment; and ( 2 ) v a r i a b l e c o s t s such as feed, labour, v e t e r i n a r y s e r v i c e s , m edication, semen and t r a n s p o r t a t i o n of mi l k . Income from animal s a l e s i n commercial herds i s d e r i v e d from animals s o l d f o r d a i r y purposes and the salvage value of c u l l e d animals. Cows c u l l e d f o r poor type, low milk y i e l d or fo r f e r t i l i t y problems are u s u a l l y s o l d f o r beef. Those removed f o r h e a l t h reasons u s u a l l y have some c a r c a s s v a l u e . Carcasses of cows which d i e may have a nominal value f o r dog food. B u l l c a l v e s are s o l d at one week o l d to be r a i s e d f o r v e a l and can be a . s i g n i f i c a n t source of income i f a reasonable p r i c e i s r e c e i v e d . S u b s t a n t i a l l y more can be r e c e i v e d f o r b u l l c a l v e s from top cows and b u l l s i f they are deemed good enough to enter a young s i r e program i n an A.I. u n i t . A s u b s t a n t i a l income can a l s o be d e r i v e d from s e l l i n g animals f o r d a i r y purposes although t h i s p r a c t i c e tends to decrease the p r o d u c t i v i t y of the herd. Both the q u a n t i t y and q u a l i t y of the milk produced can a f f e c t income. The q u a n t i t y of milk produced i s a product of the number of cows i n the herd, the r o l l i n g herd average p r o d u c t i o n and the c a l v i n g i n t e r v a l . The l i m i t i n g f a c t o r i s OBJECTIVES 9 e i t h e r the s i z e of the f a c i l i t i e s , which l i m i t s the number of cows, or a quota r e s t r i c t i o n , which l i m i t s the amount of milk which can be s o l d . The q u a l i t y or c o n s t i t u e n t s of the milk can i n f l u e n c e the u n i t p r i c e r e c e i v e d . U s u a l l y a higher p r i c e i s p a i d f o r e x t r a percentages of f a t . 1.2.2.1: Maximizing Returns The major improvements i n the d o l l a r r e t u r n w i t h i n a given market s t r u c t u r e are to be made by o p t i m i z i n g p r o d u c t i o n per cow and o p t i m i z i n g c a l v i n g i n t e r v a l through good management systems and breeding programs. 1.2.2.1.1: Management Systems Management systems i n v o l v e the d e c i s i o n s made to improve the animal's environment to take f u l l e r advantage of t h e i r b i o l o g i c a l p o t e n t i a l . The major gains are to be made by o p t i m i z a t i o n of the feed i n g regime, the i n t e n s i t y of management and the c u l l i n g p o l i c y . The most energy e f f i c i e n t feeding regime f o r a cow i n v o l v e s f e e d i n g to maximize pr o d u c t i o n so that a smal l e r p r o p o r t i o n of the energy i s used f o r maintenance of the cow and more i s used t o produce mi l k . However, f e e d i n g to maximize the energy e f f i c i e n c y of the cow may r e s u l t i n the use of higher p r i c e d feeds and/or i n i n c r e a s e s i n labour and/or overhead c o s t s . E x t e n s i v e r e s e a r c h has been done to f i n d optimum feeding regimes and methods f o r v a r i o u s environments and market s t r u c t u r e s . While labour c o s t s can be minimized, lowering the l e v e l OBJECTIVES of management u s u a l l y r e s u l t s i n a d e c l i n e i n milk p r o d u c t i o n per cow, a d e c l i n e i n the ra t e of heat d e t e c t i o n r e s u l t i n g i n a longer c a l v i n g i n t e r v a l and an inc r e a s e i n the frequency of h e a l t h problems. A l l of these f a c t o r s i n c r e a s e c o s t s and must be weighed a g a i n s t the co s t of i n c r e a s e d management i n t e n s i t y . C u l l i n g p r a c t i c e s have a major e f f e c t on the c a l v i n g i n t e r v a l . Long c a l v i n g i n t e r v a l s reduce the e f f i c i e n c y of the cow and t h i s must be c o n s i d e r e d r e l a t i v e to the co s t of replacement, expected p r o d u c t i o n a b i l i t y and the value of o f f s p r i n g . 1 . 2 . 2 . 1 . 2 : B r e e d i n g Programs Breeding programs are designed to in c r e a s e the average b i o l o g i c a l p o t e n t i a l of the cows i n the herd through s e l e c t i o n . Much r e s e a r c h e f f o r t has been d i r e c t e d towards e x p l a i n i n g the d i f f e r e n c e s between i n d i v i d u a l s and developing e f f i c i e n t breeding s t r a t e g i e s . Since g e n e t i c s has not progressed to the p o i n t where the s p e c i f i c e f f e c t s of most genes i n l a r g e mammals i s understood, d e s c r i p t i v e s t a t i s t i c s have been employed to d e s c r i b e the animal's b i o l o g i c a l p o t e n t i a l and the environmental e f f e c t s . The phenotype (P) i s made up of the gen e t i c p o t e n t i a l , (G) and the environmental e f f e c t s (E) such that P = G + E. The ge n e t i c p o t e n t i a l can be f u r t h e r s u b d i v i d e d based on how i t i s i n h e r i t e d . One p o r t i o n behaves as though i t i s made up of genes which simply have a p o s i t i v e or negative ( a d d i t i v e ) e f f e c t on a p a r t i c u l a r t r a i t , while the e f f e c t s of the genes of the other p o r t i o n seem to depend at l e a s t p a r t i a l l y on what OBJECTIVES other genes are present e i t h e r at the same locu s (dominance or overdominance) or at other l o c i ( e p i s t a s i s ) . For p r o d u c t i o n and type t r a i t s i n d a i r y c a t t l e most of the genes appear to have a d d i t i v e e f f e c t s ( L a s l e y , 1972) and the breeding schemes are designed to take advantage of t h i s . The model of i n t e r e s t then becomes: P = A + E Where A i s the a d d i t i v e e f f e c t and E i s the environmental, dominance and e p i s t a t i c g e n e t i c e f f e c t s . T h i s model becomes u s e f u l when i t i s a p p l i e d to a p o p u l a t i o n to d e s c r i b e the observed v a r i a b i l i t y . The p r o p o r t i o n of the v a r i a b i l i t y that i s due to a d d i t i v e g e n e t i c e f f e c t s , the h e r i t a b i l i t y , can then be c a l c u l a t e d as a r a t i o of the v a r i a n c e s , that due to a d d i t i v e g e n e t i c e f f e c t s V^ d i v i d e d by the t o t a l phenotypic v a r i a n c e V . P h 2 = V / V g p The h e r i t a b i l i t y i s thus a measure of the p o t e n t i a l to change a t r a i t through s e l e c t i o n . I t can be measured by the r e g r e s s i o n of parent's phenotype on t h e i r o f f s p r i n g s or by c o r r e l a t i o n s among s i b s . I t a l s o p r o v i d e s a means of e s t i m a t i n g the breeding value of an i n d i v i d u a l from i t s 2 phenotype; BV = h x (P - P). The estimate can be improved by i n c l u d i n g the phenotypes of c l o s e r e l a t i v e s . The estimated d i f f e r e n c e of an animal's o f f s p r i n g from the mean of the p o p u l a t i o n i s c a l l e d the estimated t r a n s m i t t i n g a b i l i t y (ETA) and i s one h a l f of the estimated breeding value (EBV). OBJECTIVES 1 2 1 . 2 . 2 . 1 . 2 . 1 : Breeding S t r a t e g i e s A breeding s t r a t e g y seeks to maximize f u t u r e income by maximizing g e n e t i c progress towards some d e f i n e d g o a l s . The expected progress per year (G) can be s t a t e d as a f u n c t i o n of the h e r i t a b i l i t y as ( L a s l e y , 1972): G = [ h 2 x SD x i ] / GI P where i i s a measure of the s e l e c t i o n i n t e n s i t y SDp i s the phenotypic standard d e v i a t i o n of the t r a i t GI i s the g e n e r a t i o n i n t e r v a l . Thus the e f f e c t i v e n e s s of a breeding program depends on the t r a i t s s e l e c t e d f o r , the s e l e c t i o n i n t e n s i t y and the g e n e r a t i o n i n t e r v a l . The g o a l s of the program should depend on the measurable t r a i t s that have economic importance and g e n e t i c p o t e n t i a l to change. If more than one t r a i t i s s e l e c t e d f o r they should be weighted in a s e l e c t i o n index t a k i n g i n t o c o n s i d e r a t i o n the economic value , the g e n e t i c v a r i a b i l i t y and the phenotypic and g e n e t i c c o r r e l a t i o n s . Under the c u r r e n t p r i c e s t r u c t u r e the t r a i t of most importance i s milk p r o d u c t i o n . As mentioned i n s e c t i o n 1.2.2.1: above i n c r e a s i n g the p r o d u c t i o n of milk per cow a l l o w s the quota to be f i l l e d with fewer cows, thus lowering p r o p o r t i o n a l l y the maintenance c o s t s . M i l k y i e l d i s a l s o h i g h l y v a r i a b l e and moderately h e r i t a b l e ( L a s l e y , 1972), thus there i s c o n s i d e r a b l e p o t e n t i a l f o r improvement. The p r i c e p a i d f o r the milk i s a f f e c t e d by the percentage of f a t (sec. 1.2.1.), so i n c r e a s e d milk f a t p r o d u c t i o n a l s o OBJECTIVES 13 r e s u l t s i n higher r e t u r n s which are p a r t i a l l y o f f s e t by higher feed c o s t s . Fat and p r o t e i n are both moderately h e r i t a b l e (Wilcox et a l . , 1978) and have adequate v a r i a t i o n f o r s e l e c t i o n to be e f f e c t i v e . Under the c u r r e n t market s t r u c t u r e i n c r e a s e s i n the percentage of p r o t e i n do not a f f e c t r e t u r n s but do i n c r e a s e feed c o s t s and thus i n a s e l e c t i o n index f a t should be weighted p o s i t i v e l y and p r o t e i n n e g a t i v e l y . T h i s i s true d e s p i t e the f a c t that f a t and p r o t e i n are p o s i t i v e l y c o r r e l a t e d g e n e t i c a l l y and e n v i r o n m e n t a l l y . Type t r a i t s are a l s o moderately h e r i t a b l e and i n c r e a s e s in type score do i n c r e a s e the r e s a l e (Pearson and M i l l e r , 1981) value of the breeding stock. Thus the importance of type score i n a s e l e c t i o n index i s dependent on the p r o p o r t i o n of a herd owners income that i s d e r i v e d from s e l l i n g breeding stock. F e r t i l i t y and conception t r a i t s have low h e r i t a b i l i t i e s and s e l e c t i o n f o r these t r a i t s would give l i t t l e improvement ( L a s l e y , 1972). The s e l e c t i o n i n t e n s i t y on cows i s low because most h e i f e r s are r e q u i r e d to r e p l a c e c u l l e d cows. With the e x t e n s i v e use of A.I., b u l l s are u s u a l l y capable of i n s e m i n a t i n g 50,000 or more cows per year and the s e l e c t i o n i n t e n s i t y on b u l l s can be very h i g h ( L a s l e y , 1972) . The g e n e r a t i o n i n t e r v a l f o r d a i r y c a t t l e i s a minimum of three y e a r s . For b u l l s the g e n e r a t i o n i n t e r v a l i s a minimum of s i x years because the t r a i t s of i n t e r e s t are sex l i m i t e d and in order to i d e n t i f y the s u p e r i o r animals progeny t e s t i n g must be used. The a d d i t i o n a l three years are r e q u i r e d u n t i l t h e i r OBJECTIVES 14 daughters have completed one l a c t a t i o n . 1.2.2.1.2.2: A c t u a l Genetic Improvement The genetic model has been v a l i d a t e d by Freeman (1976) and others who have shown that estimated t r a n s m i t t i n g a b i l i t i e s are good p r e d i c t o r s of daughter performance in small experimental p o p u l a t i o n s . However, many f a c t o r s c o n t r i b u t e to reducing a c t u a l g e n e t i c progress from that p r e d i c t e d by the model (Van Vleck, 1977). The f a c t that many d a i r y o p e r a t i o n s do not p a r t i c i p a t e i n milk r e c o r d i n g reduces the e f f e c t i v e p o p u l a t i o n s i z e . The r e l u c t a n c e of many to use s i r e s i n an organized young s i r e program reduces the number of b u l l s that can be t e s t e d , e f f e c t i v e l y reducing the s e l e c t i o n i n t e n s i t y . I n a p p r o p r i a t e s e l e c t i o n indexes, f o r example the over- weighting of type t r a i t s a l s o reduces the s e l e c t i o n i n t e n s i t y f o r t r a i t s which maximize d o l l a r r e t u r n s . Breeding programs which aim at maximizing f u t u r e income o f t e n c o n f l i c t with management, s t r a t e g i e s which t r y to maximize c u r r e n t income. For example methods f o r d i s c o u n t i n g f u t u r e gains to a r r i v e at an a p p r o p r i a t e compromise between breeding and management s t r a t e g i e s have been i n v e s t i g a t e d (Pearson and M i l l e r , 1981; L i n and A l l a i r e , 1977; G i l l and A l l a i r e , 1976; Andrus and M c G i l l i a r d , 1975). Taking i n t o account a l l the f a c t o r s that can a f f e c t g e n e t i c gain and e s t i m a t i n g a c t u a l gain i s much more d i f f i c u l t than e s t i m a t i n g p o t e n t i a l g a i n . However, with the recent use of the best l i n e a r unbiased p r e d i c t o r (BLUP) method of e s t i m a t i n g t r a n s m i t t i n g a b i l i t i e s proposed by Henderson (1966) OBJECTIVES 15 i t i s p o s s i b l e to compare the average g e n e t i c value of s i r e s over the past few years and measure g e n e t i c t r e n d s . These estimates c o n f i r m that the progress being made i s c o n s i d e r a b l y l e s s than what i s p o s s i b l e (Van Vl e c k , 1977). 1.3: T e a c h i n g D e s p i t e the f a c t t h a t one of the primary uses of computer s i m u l a t i o n has been as a te a c h i n g a i d the b e n e f i t s are not c l e a r l y d e f i n e d i n the l i t e r a t u r e . Perhaps t h i s i s because te a c h i n g methodology i n gen e r a l i s d i f f i c u l t to d e f i n e (Taylor and Kauffman, 1983). Since s i m u l a t i o n i s based on a system a n a l y s i s (presumably of the system being taught) i t ensures that the s t r u c t u r e of the system i s c e n t r a l to the course. Bruner (i960) has e f f e c t i v e l y argued the value of emphasizing the s t r u c t u r e of the subj e c t i n educ a t i o n . I t makes the su b j e c t more comprehensible and more e a s i l y remembered and pr o v i d e s a base to which new l e a r n i n g can be added or r e l a t e d t o . S i m u l a t i o n can provide an o p p o r t u n i t y f o r "hands on" or a problem s o l v i n g type of l e a r n i n g which i n many s u b j e c t s i s otherwise not p r a c t i c a l or f e a s i b l e . In sur v e y i n g the l i t e r a t u r e on l e a r n i n g methods, Singer & Pease (1976) concluded that where subsequent r e c a l l and a p p l i c a t i o n are important, these l e a r n i n g methods are g e n e r a l l y s u p e r i o r to guided i n s t r u c t i o n a f t e r the b a s i c s of the su b j e c t have been mastered. "Hands on" or problem s o l v i n g type of l e a r n i n g w i l l a l s o encourage the students to a c q u i r e an i n q u i r i n g mind (Smythe & L o v a t t , 1979), i n c r e a s e students m o t i v a t i o n and OBJECTIVES 16 improve t h e i r a t t i t u d e towards the course (Hocking et a l . , 1983). The r e s u l t s of a survey of American and Canadian A g r i c u l t u r e Schools ( T a y l o r and Kauffman, 1983) i n d i c a t e there i s p o t e n t i a l f o r f u r t h e r growth i n the use of s i m u l a t i o n . The three most commonly mentioned weaknesses of the t e a c h i n g programs were: (1) the need f o r more "hands-on" type courses; (2) the need f o r more exposure to computers; and (3) the need f o r more o r i g i n a l t h i n k i n g e x p e r i e n c e s . Well s t r u c t u r e d computer s i m u l a t i o n s can address a l l of these concerns p r o v i d e d they a r e : (1) user f r i e n d l y ; (2) based on the system or p r i n c i p l e s being taught; (3) i n t e r a c t i v e and problem s o l v i n g i n nature; and (4) not too s i m p l i s t i c and i n some way c h a l l e n g e the user to t h i n k more deeply. 1.3.1: T e a c h i n g G e n e t i c s Computer s i m u l a t i o n has been used in t e a c h i n g animal g e n e t i c s at l e a s t s i n c e 1961 when Heidhues and Henderson (1961) r e p o r t e d using computer generated herd records in teaching s e l e c t i o n p r i n c i p l e s . The usages expanded g r e a t l y i n the 1970's and 80's with the i n c r e a s i n g a v a i l a b i l i t y of computers. Many programs are c u r r e n t l y being used throughout Europe to teach v a r i o u s aspects of animal g e n e t i c s (Hocking et a l . , 1983). A beef g e n e t i c s i m u l a t i o n program (Willham, 1970) used i n t e a c h i n g over 2000 students at Iowa S t a t e U n i v e r s i t y s i n c e 1969, now used at many other c o l l e g e s and u n i v e r s i t i e s and even used with experienced c a t t l e breeders has met with f a v o r a b l e responses from i n s t r u c t o r s and students OBJECTIVES ( B r a c k e l s b e r g , 1978). A d a i r y c a t t l e computer breeding s i m u l a t i o n program was designed f o r teaching purposes by M c G i l l i a r d and Edlund (1979) and has been used at v a r i o u s i n s t i t u t i o n s with a g e n e r a l l y f a v o r a b l e response. Computer s i m u l a t i o n programs have been e s p e c i a l l y u s e f u l i n t e a c h i n g animal g e n e t i c s . (1) They can be used to c a r r y out experiments that would be too time consuming and c o s t l y with r e a l herds. (2) Simulated data can be generated that behaves a c c o r d i n g to the p r i n c i p l e s being taught but without a d d i t i o n a l unwanted v a r i a b i l i t y that i s o f t e n present i n r e a l data, obsc u r i n g the p r i n c i p l e s being s t u d i e d . (3) The true genetic p o t e n t i a l of simulated animals can be known, making r e s u l t s c l e a r e r and e a s i e r to analyze than a c t u a l data. 1.3.1.1: A n i m a l G e n e t i c s C o u r s e The s e n i o r undergraduate animal g e n e t i c s course at U.B.C, taught by Dr. R.G. Peterson has used computer s i m u l a t i o n as a te a c h i n g t o o l f o r four y e a r s . P r e r e q u i s i t e s are i n t r o d u c t o r y courses i n q u a n t i t a t i v e g e n e t i c s and s t a t i s t i c s . The c h i e f aim of the course i s to give the students a thorough understanding of s e l e c t i o n programs and p o t e n t i a l g e n e t i c gain from v a r i o u s programs, with emphasis on the economics of the program and i m p l i c a t i o n s on the t o t a l herd management. F i v e general areas are covered. (1) S e l e c t i o n index theory and c a l c u l a t i o n of s e l e c t i o n indexes. OBJECTIVES 18 (2) Designing breeding programs w i t h i n given g e n e t i c , economic and management c o n s t r a i n t s . (3) Methods of e s t i m a t i n g p o t e n t i a l g e n e t i c gain as o u t l i n e d by Van Vleck (1978), by p a r t i t i o n i n g i n t o the four sources suggested by Robinson and Rendal (1950): cows to produce cows; cows to produce young s i r e s ; b u l l s to produce cows and b u l l s to produce young s i r e s . (4) P r a c t i c a l problems i n e s t i m a t i n g g e n e t i c gain and e v a l u a t i n g b i o l o g i c a l , economic and management f a c t o r s which can a f f e c t i t . (5) E s t i m a t i n g the h e r i t a b i l i t y of the index from the response to s e l e c t i o n and measuring the genetic and phenotypic c o r r e l a t i o n s between index and milk, f a t , p r o t e i n and type. 1.3.1.1.1: Why D a i r y C a t t l e ? D a i r y c a t t l e were chosen as the system on which the course was to be based f o r numerous reasons. (1) They are the most ec o n o m i c a l l y important farm animals i n B r i t i s h Columbia and many students w i l l have had or are l i k e l y to have f i r s t hand experience with them. (2) They i n v o l v e a complex system with some i n t e r e s t i n g f e a t u r e s , n o t a b l y that the t r a i t s of i n t e r e s t are sex l i m i t e d and breeding i s done almost e x c l u s i v e l y with A.I.. (3) E x t e n s i v e q u a n t i t a t i v e i n f o r m a t i o n i s a v a i l a b l e from milk r e c o r d i n g and breed improvement programs. (4) S e l e c t i o n has been based on more than one s p e c i f i c t r a i t . OBJECTIVES 19 (5) The market s t r u c t u r e i s q u i t e s t a t i c , d e c r e a s i n g the need fo r t a k i n g d i v e r s e p o t e n t i a l g e n e t i c goals i n t o account. (6) The market s t r u c t u r e i s unique and poses i n t e r e s t i n g q u e s t i o n s . (7) Many of the p r i n c i p l e s apply to other s p e c i e s . 1.3.1.1.2: Use of S i m u l a t i o n In order to achieve the o b j e c t i v e s of the course and give a deeper understanding of the s u b j e c t s covered, a d a i r y c a t t l e breeding s i m u l a t i o n program i s used i n the f o l l o w i n g way. The students are asked to design and run a s e l e c t i o n experiment with a p a i r of simulated d a i r y herds. Students f i r s t develop a hypothesis d e a l i n g with s e l e c t i o n g o a l s , breeding s t r a t e g i e s , management p r a c t i c e s and farm income. Then c a l c u l a t e an a p p r o p r i a t e s e l e c t i o n index and run a s i m u l a t i o n of h i s / her model along with f e l l o w students f o r a simulated f i f t e e n y e a r s . In p a r a l l e l , d u p l i c a t e s of a l l student herds are run as " c o n t r o l s " to p r o v i d e a bases f o r comparison. At the end of the s i m u l a t i o n the student i s expected to do a f u l l a n a l y s i s of g e n e t i c g a i n . (1) Test h i s / her hypothesis u s i n g t h e i r own herds, the " c o n t r o l s " and herds of other classmates who had s i m i l a r or c o n t r a s t i n g h y p o t h e s i s . (2) Estimate sources of the response to s e l e c t i o n . (3) Estimate h e r i t a b i l i t i e s and c o r r e l a t i o n s . The D a i r y C a t t l e Breeding S i m u l a t i o n Program of M c G i l l i a r d and Edlund (1979) and a m o d i f i e d v e r s i o n were used in a s i m i l a r way f o r two y e a r s . I t generated cow herds and an OBJECTIVES 20 A.I. u n i t and f o r each simulated year i t generated 305-day l a c t a t i o n r e c o r d s , d o l l a r values f o r milk and f i n a l type scores and c a l c u l a t e d estimated breeding v a l u e s f o r each cow. Estimated t r a n s m i t t i n g a b i l i t i e s were c a l c u l a t e d f o r A.I. b u l l s and c a l v e s were generated each year from s p e c i f i e d matings. The student response to the program was p o s i t i v e , however there were two general c r i t i c i s m s . (1) Running the program r e q u i r e d a f a i r amount of "busy work" which was of l i t t l e e d u c a t i o n a l b e n e f i t . (2) Many asp e c t s of the program were too s i m p l i s t i c f o r a s e n i o r undergraduate course. From the i n s t r u c t o r ' s p o i n t of view there were many s h o r t - comings (Peterson, 1980). (1) S e l e c t i o n indexes were not c a l c u l a t e d . (2) Each l a c t a t i o n was 305-days in l e n g t h and was s t a r t e d and completed i n the same year with the cow e i t h e r completing a l a c t a t i o n or being open f o r a year. Thus n e i t h e r r e p r o d u c t i o n nor economic parameters c o u l d be simulated adequately enough to e v a l u a t e the r e l a t i o n s h i p s between them and the response to s e l e c t i o n . (3) The c o n t r o l herds r e q u i r e d an e x c e s s i v e amount of time to run. ( 4 ) A c o n s i d e r a b l e amount of computer programing was r e q u i r e d to get f i n a l summaries i n a form that allowed students access to data f o r a n a l y s i s . OBJECTIVES 21 1.3.1.1.3: O b j e c t i v e s of the S i m u l a t i o n The new d a i r y c a t t l e breeding s i m u l a t i o n program was w r i t t e n p r i m a r i l y to b e t t e r meet the needs of t h i s course. (1) The program giv e s students an o p p o r t u n i t y to customize t h e i r own s e l e c t i o n index and breeding s t r a t e g y . For example b u l l s can be s e l e c t e d based on whether they are young or proven, on t h e i r pedigree or proof, on t h e i r semen p r i c e and on t h e i r conception r a t e . (2) Management op t i o n s can be s e l e c t e d (sec. 2.2.3.5.1.) f o r d e c i s i o n s which have an economic e f f e c t and a l t e r p o t e n t i a l g e n e t i c g a i n . (3) The s i m u l a t i o n can be as r e a l i s t i c as i s f e a s i b l e . P r o d u c t i o n i s simulated on a continuous b a s i s a l l o w i n g economic retu r n s and r e p r o d u c t i o n to be i n c l u d e d i n the s i m u l a t i o n (sec. 2.2.2.1. and 2.2.4.). At the end of each year i t g i v e s a d e t a i l e d d e s c r i p t i o n of the performance and p r o d u c t i o n of each cow as w e l l as herd summaries (appendix B). H o p e f u l l y being exposed to the d e t a i l s , v a r i a b i l i t y and complexity of the system w i l l g ive the students i n s i g h t s i n t o the problems and c o n f l i c t s that e x i s t . (4) Unnecessary work i s minimized because i t i s "user f r i e n d l y " and p r o v i d e s a v a i l a b l e automated d e c i s i o n o p t i o n s . The program i s i n t e r a c t i v e and leads the user through with q u e s t i o n s , prompts and menus (appendix A1). I t a l s o d e t e c t s unreasonable d e c i s i o n s entered and asks f o r p l a u s i b l e ones. Tedious d e c i s i o n making that i s not e s s e n t i a l to the management or breeding program can be OBJECTIVES 22 avoided by using automated o p t i o n s based on p r e d e f i n e d management p r a c t i c e s . For example, i n s t e a d of having to s p e c i f y the b u l l to use on each cow, a number of b u l l s can be s e l e c t e d to be mated at random to the cows (sec. 2.2.3.5.5.). H o p e f u l l y the time spent l e a r n i n g course m a t e r i a l w i l l be maximized and student f r u s t r a t i o n minimized. (5) Groups of herds to be used as " c o n t r o l s " can be run q u i c k l y and at minimum c o s t . These herds are set up with management and breeding programs i n the f i r s t s imulated year and a f t e r t h i s can be run a u t o m a t i c a l l y (appendix A). No p r i n t e d output i s generated but t h e i r summaries are accumulated to be used f o r the f i n a l a n a l y s i s . (6) Output from the s i m u l a t i o n p r o v i d e s a comprehensive data base of g e n e t i c , p r o d u c t i o n and economic summaries f o r a l l herds f o r a l l years and a s t a t i s t i c a l package to s i m p l i f y the data manipulation (appendix B1). A l l herd summaries are s t o r e d and true breeding values are known so that the gen e t i c gain and i t ' s i n t e r a c t i o n with economic and management f a c t o r s can be measured p r e c i s e l y . The s t a t i s t i c a l r o u t i n e s of the program are designed to d e t e c t d i f f e r e n c e s i n the rate of change over time or mean d i f f e r e n c e s between herds or groups of herds. Output i s both s t a t i s t i c a l and g r a p h i c a l f o r any of over a hundred summary v a r i a b l e s ( t a b l e I X ) . H o p e f u l l y t h i s w i l l encourage c r e a t i v e a n a l y s i s of breeding programs. (7) Computing c o s t s of a s i m u l a t i o n i n v o l v i n g l e s s than 100 herds and 20 years should not be e x c e s s i v e . In f a c t an OBJECTIVES 23 e f f o r t was made to keep down the c o s t s of running the program and as a r e s u l t some aspects of the s i m u l a t i o n are somewhat s i m p l i s t i c . However, the program i s w r i t t e n i n a modular form to f a c i l i t a t e e a s i e r f u t u r e expansion (appendices C & D). Most d i f f e r e n t simulated events are performed i n a separate subroutine making i t e a s i e r to add new events to expand the use of the program to i n c l u d e such t h i n g s as embryo t r a n s p l a n t s or f e e d i n g regimes. 1.3.1.1.3.1: Intended Course Structure The program c o u l d be u s e f u l f o r v a r i o u s courses. I t would be compatible with a one term s e n i o r animal g e n e t i c s course. (1) Two or more weeks would be r e q u i r e d f o r i n s t r u c t i o n and d i s c u s s i o n on s e l e c t i o n methods, management systems and f o r m u l a t i o n of hypotheses and c a l c u l a t i o n of s e l e c t i o n indexes. (2) F i v e or more weeks f o r the students to run the s i m u l a t i o n program. (3) At l e a s t three weeks would be needed f o r the students to adequately analyze trends and d i f f e r e n c e s between herds. T h i s r e q u i r e s access to a data base with g e n e t i c , p r o d u c t i o n and economic summaries f o r a l l herds and years, and a t a i l o r made s t a t i s t i c a l package f o r a n a l y s i s . An o b j e c t i v e type midterm examination should be h e l d e a r l y i n the course to ensure that students know how to c a l c u l a t e a s e l e c t i o n index, understand the breeding and management op t i o n s a v a i l a b l e and have a worth-while and OBJECTIVES 24 t e s t a b l e h y p o t h e s i s . A major p o r t i o n of the students grade f o r the course should be on the a n a l y s i s and e x p l a n a t i o n of t h e i r r e s u l t s . 1.4: Research S i m u l a t i o n has proved u s e f u l at a l l l e v e l s of animal r e s e a r c h , at the metabolic pathway l e v e l to study energy e f f i c i e n c i e s (Canolty and Koong, 1976), at the organ l e v e l to study rumen metabolism and d i g e s t i v e f u n c t i o n (Baldwin et a l . , 1970), at the cow l e v e l to model animal growth (Brown et a l . , 1976), at the herd l e v e l to study r e p r o d u c t i o n and breeding management ( R o u n s a v i l l e , 1979; B a i l i e , 1982), at the p o p u l a t i o n l e v e l to optimize s i r e sampling and progeny t e s t i n g to maximize g e n e t i c gain (Hunt, 1974; Lane, 1973; Oltenacu, 1974). Many other s t u d i e s are r e p o r t e d i n the l i t e r a t u r e . Koong & Baldwin (1978) in a summary of the l i t e r a t u r e have l i s t e d p o t e n t i a l b e n e f i t s of s i m u l a t i o n i n r e s e a r c h . They i n c l u d e : (1) u n i f i c a t i o n and summarization of data and concepts l e a d i n g to i n c r e a s e d understanding of a p a r t i c u l a r system; (2) i n c r e a s e d e f f e c t i v e n e s s i n u t i l i z a t i o n of e x i s t i n g i n f o r m a t i o n i n the s e l e c t i o n of experimental approaches; (3) r e d u c t i o n of conceptual d i f f i c u l t i e s encountered i n a n a l y s e s of systems too complex f o r i n t u i t i v e r e s o l u t i o n ; and (4) f o r m u l a t i o n and t e s t i n g of a l t e r n a t i v e hypotheses. 1.4.2: Si m u l a t i o n T h i s s i m u l a t i o n has four f e a t u r e s which should enhance i t s value f o r r e s e a r c h . OBJECTIVES 25 (1) The s i m u l a t i o n covers a broad range with the events simulated at the cow l e v e l , the user inputs at the herd l e v e l and the e f f e c t s measured at the herd and p o p u l a t i o n l e v e l (sec. 2.1.1.). I t i n t e g r a t e s the d i s c i p l i n e s of d a i r y c a t t l e management, r e p r o d u c t i o n , economics and breeding. H o p e f u l l y the program w i l l a i d r e s e a r c h e r s i n understanding some of the complex i n t e r a c t i o n s i n the system. (2) The,option to run automated groups of herds (appendix A & B1) makes i t f e a s i b l e f o r r e s e a r c h e r s to ask q u e s t i o n s about i n t e r a c t i o n s between v a r i o u s herd management d e c i s i o n s and e f f e c t s on the herd and p o p u l a t i o n . (3) The modularized design should f a c i l i t a t e c u s t o m i z i n g of the program for s p e c i f i c r e s e a r c h purposes (appendix C & D) . (4) The program allows p r e l i m i n a r y experiments to be c a r r i e d out and f u l l y analyzed w i t h i n a few hours and at l i t t l e c o s t (appendix A). Some p o t e n t i a l q u e s t i o n s that the program c o u l d be used to r e s e a r c h i n c l u d e : (1) The e f f e c t s of breeding and management d e c i s i o n s on the s i r e p r o v i n g program and c o n v e r s e l y the value of proven s i r e s i n economic terms to the herd owner; (2) The e f f e c t s of quota r e s t r i c t i o n s on g e n e t i c g a i n ; (3) The economic merit of a t r a i t under the quota system; and (4) The optimum use of young and proven s i r e s i n economic terms f o r the herd owner and i n terms of g e n e t i c gain f o r the p o p u l a t i o n . 2 6 C h a p t e r 2. PHILOSOPHY AND DETAILS S i m u l a t i o n r e q u i r e s e v a l u a t i n g the o b j e c t i v e s and the i n f o r m a t i o n a v a i l a b l e to decide on the best l e v e l at which to model the system, to d e f i n e the framework of the s i m u l a t i o n and then to analyze the a c t i o n s and i n t e r a c t i o n s of the components in order to reduce these r e l a t i o n s h i p s to mathematical equations. B i o l o g i c a l based systems d i f f e r from most other systems i n that they have a much g r e a t e r degree of v a r i a b i l i t y inherent in them because of the m u l t i p l e l e v e l s i n v o l v e d . A t y p i c a l h i e r a r c h y of p o s s i b l e l e v e l s might be: Populat ion Herd An imal Organ T i ssue C e l l M e t a b o l i c pathways In general "as the l e v e l of d e s c r i p t i o n of a system i s r e f i n e d , p r e c i s i o n i s gained, but r e s t r a i n t s due to l a c k of knowledge become more s e r i o u s . As the l e v e l becomes higher, the r e l a t i o n s h i p s used between the v a r i a b l e s become more e m p i r i c a l , and there i s no b i o l o g i c a l e x p l a n a t i o n of the f u n c t i o n s used to r e l a t e them" (Joandet 1975). The r e l a t i o n s h i p s can have e i t h e r a t h e o r e t i c a l , PHILOSOPHY AND DETAILS 2 7 e m p i r i c a l or i n t u i t i v e b a s i s as d e f i n e d by Riggs (1963). A t h e o r e t i c a l equation i s b i o l o g i c a l l y based and can u s u a l l y give good p r e d i c t i o n s over a wide range. An e m p i r i c a l equation i s one which i s d e r i v e d from f i t t i n g experimental data to d e s c r i b e a r e l a t i o n s h i p between two or more v a r i a b l e s . I t d e s c r i b e s the r e l a t i o n s h i p over the range of the experimental data but cannot s a f e l y be a p p l i e d beyond that range and does not e x p l a i n the reasons f o r the r e l a t i o n s h i p . Often, however, b i o l o g i c a l parameters can be found to e x p l a i n an e m p i r i c a l r e l a t i o n s h i p a l l o w i n g the model to have broader a p p l i c a t i o n . An equation based on i n t u i t i o n can be employed to complete a s i m u l a t i o n i f no known b i o l o g i c a l or e m p i r i c a l r e l a t i o n s h i p s e x i s t . T h i s may l i m i t but does not i n v a l i d a t e the model, as w e l l the approximations can be improved with time by t e s t i n g s i m u l a t i o n r e s u l t s (Joandet 1975). 2.1: The S i m u l a t i o n T h i s d a i r y c a t t l e s i m u l a t i o n had to model the system d e s c r i b e d i n s e c t i o n 1.1 and to conform to the requirements f o r t e a c h i n g (sec. 1.3.) and r e s e a r c h (sec. 1.4.). I t had to be able to model the i n h e r i t a n c e of the economically important t r a i t s and to extend t h i s to i n c l u d e as many as p o s s i b l e of the f a c t o r s that d i r e c t l y or i n d i r e c t l y a f f e c t g e n e t i c g a i n . For m o d e l l i n g t h i s system from a r e f i n e d l e v e l such as the c e l l , there are good t h e o r e t i c a l models f o r some b i o l o g i c a l f u n c t i o n s but other f u n c t i o n s are not w e l l understood and there are no r e l i a b l e e m p i r i c a l models. As w e l l the complexity and co s t of the s i m u l a t i o n would be PHILOSOPHY AND DETAILS 28 p r o h i b i t i v e given our c u r r e n t knowledge and computing f a c i l i t i e s . At the cow l e v e l there are e x t e n s i v e q u a n t i t a t i v e data which have given r i s e to good e m p i r i c a l models and some p l a u s i b l e b i o l o g i c a l e x p l a n a t i o n s . These e m p i r i c a l models are r e l i a b l e p r e d i c t o r s over the measured ranges. Since the s i m u l a t i o n was only intended to be used in those ranges the models do not impose s e r i o u s r e s t r i c t i o n s . 2.1.1: Framework In order to keep the co s t of running the program reasonable c e r t a i n r e s t r i c t i o n s on the s i m u l a t i o n of a p o p u l a t i o n were made. (1) A maximum of 150 cows per herd. (2) A maximum of 500 herds i n a p o p u l a t i o n . (3) Only one A.I. u n i t with up to 500 b u l l s f o r a p o p u l a t i o n . (4) Only four g e n e t i c a l l y i n h e r i t e d t r a i t s , m i l k , f a t and p r o t e i n p r o d u c t i o n , and o v e r a l l type s c o r e . (5) No p r o v i s i o n i s made f o r buying cows or quota. (6) P r i c e s of a l l s e r v i c e s and commodities remain f i x e d f o r a given s i m u l a t i o n . (7) A l l herds are assumed to p a r t i c i p a t e i n a milk r e c o r d i n g and breed improvement program. Other r e s t r i c t i o n s due to l i m i t a t i o n s of s p e c i f i c models are d i s c u s s e d i n s e c t i o n 2.2. 2.1.2: General D e s c r i p t i o n The program generates herds and an A.I. u n i t . Operation PHILOSOPHY AND DETAILS 29 of the herd i s then simulated one calendar year at a time with v a r i o u s o p t i o n s f o r the degree of management i n t e r a c t i o n . B u l l s used can be s e l e c t e d and mated i n d i v i d u a l l y or a u t o m a t i c a l l y based on t h e i r estimated t r a n s m i t t i n g a b i l i t y f o r the four t r a i t s , f e r t i l i t y , semen p r i c e and whether they are young or proven s i r e s . Each herd can have a d i f f e r e n t s e l e c t i o n index by which s i r e s are chosen and cows are ranked f o r breeding and c u l l i n g , a d i f f e r e n t l e v e l of management i n t e n s i t y and a d i f f e r e n t c r i t e r i o n f o r c u l l i n g cows. Each year cows can be removed from the herd f o r any of three reasons. h e a l t h reasons - i n v o l u n t a r i l y f e r t i l i t y problems - manager sets c r i t e r i a poor p r o d u c t i o n or type - manager sets c r i t e r i a and/or s p e c i f i c animals U n t i l a cow i s removed from the herd a continuous c y c l e of p a r t u r i t i o n , open p e r i o d and conception i s simulated along with a l t e r n a t i n g between l a c t a t i o n and dry p e r i o d , as flow c h a r t e d i n f i g u r e 2.1. Each year p r o d u c t i o n from completed and p a r t i a l l a c t a t i o n s , feed c o s t s and estimates of producing and t r a n s m i t t i n g a b i l i t y are summarized f o r each cow along with herd averages, income and e x p e n d i t u r e s . PHILOSOPHY AND DETAILS 30 f i g u r e 2 . 1 f i n d cows s t a t u s & l o c a t i o n i n c y c l e no no open l a c t a t ion breed dry p e r i o d p a r t u r i t i o n year end ? no . c u l l "/ f e r t i l i t y ? no conception ? yes yes yes V no no s t o r e s t a t u s & l o c a t i o n i n c y c l e summary f o r year ad j u s t records PHILOSOPHY AND DETAILS 31 The A.I. b u l l s are updated at the end of each year. The semen use, daughter records and good b u l l c a l v e s are i n p u t t e d and semen p r i c e s , updated p r o o f s and new young s i r e s are outputted, ready f o r the next year. D e t a i l e d records i n c l u d i n g the true breeding values of a l l animals i n the herd and herd summaries are s t o r e d f o r a n a l y s i s at the end of a s i m u l a t i o n . Complete i n s t r u c t i o n s f o r using the program and sample runs are given i n a p p e n d i c i e s A & B. 2.2: Simulated Events The core of the s i m u l a t i o n i s the model f o r 305 day l a c t a t i o n records and y e a r l y type s c o r e s . T h i s has been expanded to simulate a c t u a l p r o d u c t i o n on a continuous b a s i s which al l o w s models f o r other b i o l o g i c a l f u n c t i o n s , economic f a c t o r s and management to f i t i n . 2.2.1.1: 305-Day Mature Equivalent Production The s i m u l a t i o n uses a l i n e a r model ( M c G i l l i a r d and Edlund, 1979) to generate phenotypic values f o r the four t r a i t s , as f o l l o w s : P = u + G + E + E, , c c t h ht PHILOSOPHY AND DETAILS 32 phenotypic value f o r a t r a i t f o r that l a c t a t i o n or year the p o p u l a t i o n mean f o r the t r a i t the true a d d i t i v e genotypic e f f e c t (or d e v i a t i o n ) permanent cow environmental e f f e c t temporary cow environmental e f f e c t permanent herd environmental e f f e c t temporary herd environmental e f f e c t In order to have the a p p r o p r i a t e c o r r e l a t i o n s between the t r a i t s , v alues f o r a l l four t r a i t s are generated together from the a p p r o p r i a t e standard d e v i a t i o n s and c o r r e l a t i o n s . The environmental and genetic e f f e c t s f o r p r o d u c t i o n t r a i t s are generated in kilograms of mature e q u i v a l e n t milk p r o d u c t i o n . With the exception of permanent herd e f f e c t s they are generated from a "normal" d i s t r i b u t i o n with a mean of z e r o . It i s assumed that the v a r i a b i l i t y i s normally d i s t r i b u t e d s i n c e each e f f e c t i s dependent on a l a r g e number of random f a c t o r s . Type scores are generated i n type u n i t s and s i n c e cows i n p r a c t i c e are only r e s c o r e d i f there i s an improvement, i f a phenotypic value f o r type score i s generated that i s lower than the pr e v i o u s score the type score i s l e f t unchanged. The temporary herd e f f e c t s are set at the beginning of where: P E c E c t - E h - E h t - PHILOSOPHY AND DETAILS 33 e a c h h e r d - y e a r , t h e permanent cow and g e n e t i c e f f e c t s a t b i r t h and t h e t e m p o r a r y cow e f f e c t s a t t h e b e g i n n i n g o f e a c h l a c t a t i o n . The s t o c h a s t i c component of t h e permanent h e r d e f f e c t s i s not i n c l u d e d s i n c e one o b j e c t i v e o f t h e s i m u l a t i o n i s t o compare d i f f e r e n c e s between h e r d s . P r o v i s i o n s a r e made t o a l l o w t h e permanent h e r d e f f e c t s t o v a r y w i t h t h e management i n t e n s i t y of t h e h e r d ( s e c . 2.2.3.5.1.) by means o f f o u r p r e d e f i n e d management l e v e l s . I n t u i t i v e b i o l o g i c a l e x p l a n a t i o n s c an a c c o u n t f o r some o f t h e v a r i a b i l i t y of e a c h o f t h e e f f e c t s , but l i t t l e p r o g r e s s has been made i n l i n k i n g t h e e f f e c t s q u a n t i t a t i v e l y t o t h e o b s e r v e d v a r i a b i l i t y . - Temporary h e r d e f f e c t s a r e t h e d i f f e r e n c e s i n h e r d s from one y e a r t o t h e n e x t due t o s h o r t t e r m d i f f e r e n c e s i n management s u c h as a new m i l k e r . - Permanent h e r d e f f e c t s a r e d i f f e r e n c e s between h e r d s t h a t r e m a i n t h r o u g h o u t t h e s i m u l a t i o n . They a r e due t o d i f f e r e n c e s i n h e r d management. - Temporary cow e f f e c t s a r e d i f f e r e n c e s between r e c o r d s of t h e same cow due t o t h e d i f f e r e n c e s i n t r e a t m e n t o r c h a n c e , s u c h a s s i c k n e s s o r a c c i d e n t . - Permanent cow e f f e c t s a r e d i f f e r e n c e s between cows i n a h e r d due t o a n y t h i n g f r o m d o m i n a n t o r e p i s t a t i c g e n e t i c e f f e c t s t o f e t a l e n v i r o n m e n t o r s i c k n e s s w h i c h o c c u r a t an e a r l y age and have a l i f e l o n g e f f e c t . The g e n e t i c c o r r e l a t i o n s between t h e d i f f e r e n t t r a i t s a r e due t o p l e i o t r o p h i c gene a c t i o n where genes have an e f f e c t on more t h a n one t r a i t . E n v i r o n m e n t a l c o r r e l a t i o n s a r i s e f r o m PHILOSOPHY AND DETAILS 34 non g e n e t i c f a c t o r s that a f f e c t more than one t r a i t . 2 . 2 . 1 . 2 : Adjustments Two f a c t o r s which are known to be c o r r e l a t e d with p r o d u c t i o n are the age of a cow and the degree to which she i s i n b r e d . A cow while s t i l l growing does not u s u a l l y produce as much milk as she w i l l once she reaches mature s i z e . In order to estimate breeding values c o r r e c t i o n f a c t o r s must be used to p r e d i c t how much milk she w i l l produce fo r a 305 day l a c t a t i o n as a mature animal ( L a s l e y , 1972). In terms of the model used (sec. 2.2.1.1) the mean f o r the temporary cow environmental e f f e c t s should be negative f o r young cows. The s i m u l a t i o n a d j u s t s the mature e q u i v a l e n t p r o d u c t i o n to a c t u a l p r o d u c t i o n by using the i n v e r s e of the c o r r e c t i o n . I t a l l o w s f o r c o r r e c t i o n f a c t o r s of the three p r o d u c t i o n t r a i t s f o r 2, 3 and 4 year o l d s . Inbred cows on average have lower p o t e n t i a l p r o d u c t i o n and g e n e t i c v a r i a b i l i t y and a higher chance of death or f e r t i l i t y and h e a l t h problems ( M c G i l l i a r d and Edlund, 1979; D i c k e r s o n , 1974). However, e x t e n s i v e checking f o r i n b r e e d i n g would have s u b s t a n t i a l l y i n c r e a s e d the computing c o s t s of running the program, t h e r e f o r e i t was t r e a t e d q u i t e s u p e r f i c i a l l y . For t h i s s i m u l a t i o n i n the automated mode s i r e daughter matings are avoided and f o r s p e c i f i e d matings c l o s e i n b r e e d i n g i s d i s c o u r a g e d . If s i r e daughter matings o c c u r r e d the o f f s p r i n g are given reduced permanent cow environmental e f f e c t s which in t h i s model i n c l u d e dominant and over-dominant PHILOSOPHY AND DETAILS 35 gene e f f e c t s (sec. 2.2.1.). Other d e t r i m e n t a l e f f e c t s c o u l d be i n c l u d e d (sec. 4.2.) i f the i n t e n t was to study inbreeding and i t s i n t e r a c t i o n with economic r e t u r n s . 2.2.1.3: Actual Production Since the s i m u l a t i o n i s on a continuous b a s i s f o r p r o d u c t i o n and herd s t a t u s i s outputted once a year, i t i s necessary to be able to estimate a cow's p r o d u c t i o n between any two p o i n t s i n her l a c t a t i o n . In order to decide when to dry a cow o f f i t i s a l s o necessary to estimate her d a i l y p r o d u c t i o n on any given day. In b i o l o g i c a l terms a l a c t a t i o n y i e l d i s the sum of the d a i l y p r o d u c t i o n which i n turn i s determined by the phenotypic c h a r a c t e r i s t i c s of the animal i n t e r a c t i n g with the d a i l y environment. However, s i n c e the s i m u l a t i o n i s based on a calender year and cow l e v e l i t would have added l i t t l e to i t s value to i n c l u d e d a i l y f l u c t u a t i o n s and indeed would have been d i f f i c u l t , given the l i t t l e i n f o r m a t i o n a v a i l a b l e i n the l i t e r a t u r e . T h e r e f o r e an e m p i r i c a l r e l a t i o n s h i p at the l a c t a t i o n l e v e l that best f i t s most l a c t a t i o n s i s s u i t a b l e . A r a p i d r i s e to a peak fo l l o w e d by a gradual d e c l i n e i s t y p i c a l of a l a c t a t i o n curve and i s best d e s c r i b e d as a gamma type curve. The f u n c t i o n given by Wood (1967) to d e s c r i b e the curve appears to give the best f i t of equations developed to date (Rowlands et a l 1982). I t r e l a t e s average d a i l y y i e l d (Y) at week "n" to "a" a s c a l e constant and "b" and "c" shape c o n s t a n t s . PHILOSOPHY AND DETAILS 36 b -cri Yn = an e The peak y i e l d occurs at b/c weeks and i s equal to a(b/c)^e *\ The p e r s i s t e n c y of the l a c t a t i o n can be given by c (Wood 1967), or more a c c u r a t e l y by the second d e r i v a t i v e of the o r i g i n a l f u n c t i o n and s u b s t i t u t i n g "n" as 25 (Rowlands et a l 1982). In order to u t i l i z e t h i s f u n c t i o n i n the s i m u l a t i o n i t i s necessary to be able to estimate the constants f o r each l a c t a t i o n such that i f an animal l a c t a t e s f o r 305 days she produces a p r e v i o u s l y determined amount of milk and c o n s t i t u e n t s . Data provided by Keown (1984) which r e l a t e s peak p r o d u c t i o n to 305 day pr o d u c t i o n showed c l o s e to a l i n e a r r e l a t i o n s h i p s w i t h i n age groups, but cows tend to have higher peak y i e l d and lower p e r s i s t e n c y as they go from the f i r s t to t h i r d l a c t a t i o n s . Wood (1968 & 1970) observed s i g n i f i c a n t d i f f e r e n c e s i n the shape of the l a c t a t i o n curves due to p a r i t y . T herefore to sol v e f o r the l a c t a t i o n curve constants "a", "b", and "c" the s i m u l a t i o n made the f o l l o w i n g assumptions: (1) The 305 day p r o d u c t i o n i s l i n e a r l y r e l a t e d to the peak p r o d u c t i o n . (2) That the slope and i n t e r c e p t of the r e g r e s s i o n i n (1) v a r i e s only with p a r i t y and only u n t i l the t h i r d l a c t a t i o n . PHILOSOPHY AND DETAILS 37 (3) T h a t t h e week of t h e peak i n p r o d u c t i o n v a r i e s o n l y w i t h p a r i t y and o n l y t o t h e t h i r d l a c t a t i o n . Thus t h e l a c t a t i o n c u r v e c o n s t a n t s f o r a g i v e n cow can be s o l v e d f o r u s i n g t h e week of peak p r o d u c t i o n a s a c o n s t a n t f o r a g i v e n age and t h e 305-day p r o d u c t i o n g e n e r a t e d a s d e s c r i b e d i n s e c t i o n 2.1. The p r o d u c t i o n between any two p o i n t s i n t h e l a c t a t i o n c a n be c a l c u l a t e d by i n t e g r a t i o n o f Woods e q u a t i o n and u s i n g t e c h n i q u e s o f C h i - L e u n g Lau (1980) and P i k e & H i l l (1966) f o r e v a l u a t i n g t h e i n c o m p l e t e gamma i n t e g r a l ( a p p e n d i x D ) . 2 . 2 . 2 : Reproduction R e p r o d u c t i o n i n v o l v e s g e n e r a t i n g newly s i m u l a t e d a n i m a l s and m o d e l l i n g t h e r e p r o d u c t i v e p r o c e s s . The s i m u l a t i o n of t h e r e p r o d u c t i v e p r o c e s s was i n t e n d e d p r i m a r i l y t o t r y t o i n c l u d e t h e major f a c t o r s and i n t e r a c t i o n s a f f e c t i n g c a l v i n g i n t e r v a l . I t c o u l d be modeled much more t h o r o u g h l y t h a n was done h e r e ( s e c . 4.4.) i f i n t e r a c t i o n s between r e p r o d u c t i o n and g e n e t i c g a i n was t o be s t u d i e d i n d e t a i l . R o u n s a v i l l e (1978) and more r e c e n t l y M o rant (1985) and D i j k h u i z e n (1985) have s i m u l a t e d r e p r o d u c t i o n i n more d e t a i l . Numerous o t h e r p a p e r s have a p p e a r e d on r e l a t i o n s h i p s between, r e p r o d u c t i o n , m i l k y i e l d and management ( S e y k o r a , 1983; R e i m e r s e t a l . , 1985; Hansen e t a l . , 1983) making p o s s i b l e e v e n more c o m p r e h e n s i v e m o d e l s . T h i s s i m u l a t i o n modeled t h e f o l l o w i n g f a c t o r s w i t h o u t v a r i a b i l i t y . The g e s t a t i o n l e n g t h i s assumed t o be c o n s t a n t and i s s e t f o r a g i v e n p o p u l a t i o n . A l t h o u g h i n p r a c t i c e t h e r e i s PHILOSOPHY AND DETAILS 38 v a r i a b i l i t y a s s o c i a t e d with g e s t a t i o n l e n g t h i t ' s e f f e c t on c a l v i n g i n t e r v a l i s small r e l a t i v e to the v a r i a b i l i t y i n e s t r u s d e t e c t i o n and conception r a t e s ( F i s h e r et a l . , 1978; Smith, 1982). The l e n g t h of the e s t r o u s c y c l e a l s o has some v a r i a b i l i t y but f o r t h i s s i m u l a t i o n i t i s assumed to be constant f o r a p o p u l a t i o n and abnormal c y c l e s are not modeled. The number of days post partum to f i r s t breed a cow i s normally a management o p t i o n . However, matings at l e s s than 50 days i n c r e a s e the chance of an abnormal c y c l e (Ax, 1982). In the s i m u l a t i o n the e f f e c t s of days postpartum bred on r e p r o d u c t i o n are not modeled so the minimum days postpartum that a cow can be bred i s set as a g l o b a l parameter (sec. 3.4.2.). S i m i l a r l y a short dry p e r i o d can have an a f f e c t on p r o d u c t i o n and r e p r o d u c t i o n (Goodwill et a l . , 1984; Dias et a l . , 1982; Schneider et a l . , 1981). T h i s a l s o i s not modeled so a g l o b a l r e s t r i c t i o n i s p l a c e d on the number of days p r i o r to f r e s h e n i n g when a cow must be d r i e d o f f . The. r e p r o d u c t i v e s i m u l a t i o n models heat d e t e c t i o n , conception and the b i r t h of a c a l f . I t begins at the f i r s t day a cow i s e l i g i b l e to be bred at which time the day of the e s t r o u s c y c l e that she i s i n i s generated at random. When she reaches e s t r u s the chance of her c o n c e i v i n g i s a product of a p r o b a b i l i t y of heat d e t e c t i o n and a p r o b a b i l i t y of conception ( f i g . 2.1). T h i s model assumes that the'two p r o b a b i l i t i e s are independent (sec. 4.4). PHILOSOPHY AND DETAILS 39 2 . 2 . 2 . 1 : E s t r u s D e t e c t i o n The model used to determine the p r o b a b i l i t y of heat d e t e c t i o n f o r a cow was: P = M [C + Y (E + G )] e m m where: C e - cows f a c t o r (sec. 2.2.2.1.1) M - f a c t o r depending on the management e f f i c i e n c y (sec. 2.2.3.5.1.) Y - f a c t o r which r e l a t e s p o t e n t i a l milk y i e l d to e s t r u s d e t e c t i o n r a t e E m - permanent cow d e v i a t i o n f o r milk y i e l d G m - g e n e t i c d e v i a t i o n f o r milk y i e l d The l a r g e s t improvements i n reducing the c a l v i n g i n t e r v a l can u s u a l l y be made by improving e s t r u s d e t e c t i o n (Ax, 1982; Wilcox, 1978). The r a t e of e s t r u s d e t e c t i o n i s l a r g e l y due to the methods and e f f i c i e n c y of the management (Esslemont 1976 and Smith 1982). T h i s s i m u l a t i o n allowed f o r v a r i a t i o n i n heat d e t e c t i o n r a t e with d i f f e r e n t management l e v e l s . I t a l s o a l l o w s the p r o b a b i l i t y of e s t r u s d e t e c t i o n to vary l i n e a r l y with p o t e n t i a l milk p r o d u c t i o n as Ax (1982) has re p o r t e d that high producing cows have a higher p r o p o r t i o n of s i l e n t heats, e s p e c i a l l y between 60 and 100 days. 2 . 2 . 2 . 2 : Conception The conception r a t e i s determined by the f e r t i l i t y of the PHILOSOPHY AND DETAILS 40 cow, the semen of the b u l l and perhaps some i n t e r a c t i o n . Since the nature of any i n t e r a c t i o n has not been w e l l s t u d i e d the s i m u l a t i o n determines the p r o b a b i l i t y of co n c e p t i o n (C) simply as a product of a f e r t i l i t y f a c t o r a s s o c i a t e d with the cow (F) and one a s s o c i a t e d with the b u l l ( B f ) . C = F x Bf The model used f o r the cow's f e r t i l i t y f a c t o r i s : F = C f + (R x N) where: R - f a c t o r to a d j u s t f o r number of l a c t a t i o n s N - number l a c t a t i o n s f o r cow - f e r t i l i t y f a c t o r generated at b i r t h (sec. 2.2.2.1.1.) The s i m u l a t i o n allows the cows f e r t i l i t y to change with age as Whitmore (1974) has r e p o r t e d the cow f e r t i l i t y f a c t o r decreases f o r s u c c e s s i v e l a c t a t i o n s . The b u l l s f e r t i l i t y f a c t o r i n the s i m u l a t i o n i s based only on a mean (u) and a random f a c t o r (e) from a gamma d i s t r i b u t i o n . Bf = u + e Genetic c o n t r i b u t i o n s to f e r t i l i t y are presumed to be small and were not i n c l u d e d i n the model. 2.2.2.3: B i r t h o f a C a l f The b i r t h of a new c a l f i s the b i o l o g i c a l event which makes g e n e t i c gain p o s s i b l e . I t i n v o l v e s m o d e l l i n g of a PHILOSOPHY AND DETAILS 41 number of d i f f e r e n t f a c t o r s that are c r i t i c a l to the s i m u l a t i o n . (1) The sex of the animal i s generated at random assuming an equal p r o b a b i l i t y of male and female. (2) True breeding values are generated from the mean breeding values of t h e i r parents and a random f a c t o r to account f o r sampling. (3) I f a female f u r t h e r f a c t o r s are generated. (a) A permanent environmental f a c t o r s are generated (see l a c t a t i o n model, sec. 2.2.1.1.). (b) F e r t i l i t y and heat d e t e c t i o n f a c t o r s (C) are generated from a p o p u l a t i o n mean (u) and a random f a c t o r (e) from a gamma d i s t r i b u t i o n . C = u + e It i s assumed that there i s a permanent cow v a r i a b i l i t y and that a gamma d i s t r i b u t i o n approximates i t . 2.2.3: Feed Consumption The model f o r feed consumption does not take i n t o account a l l the s t o c h a s t i c v a r i a b i l i t y . I t i s r a t h e r a d e t e r m i n i s t i c model, i n c l u d i n g only the v a r i a b i l i t y that i s due to changes i n p r o d u c t i o n or the r e p r o d u c t i v e s t a t u s of the cow. It assumes that y e a r l y c o s t s f o r a cow vary l i n e a r l y with only f i v e f a c t o r s . FC = (DAYS DRY x MD) + (DAYS LACTATING X ML) + (kg CAR. x AC) + (kg FAT x AF) + (kg PROT. x AP) where: PHILOSOPHY AND DETAILS 4 2 FC = feed c o s t s f o r a year MD = d a i l y c o s t of m a i n t a i n i n g a dry cow ML = d a i l y c o s t of m a i n t a i n i n g a l a c t a t i n g cow CAR. = c a r r i e r (water + minerals + l a c t o s e ) AC = a d d i t i o n a l c o s t per kg of c a r r i e r (assumes milk i s 5% l a c t o s e and no cost a s s o c i a t e d with p r o d u c t i o n of water and minerals ( H i l l e r , 1979)) AF = a d d i t i o n a l c o s t per kg of f a t AP = a d d i t i o n a l c o s t per kg of p r o t e i n A d d i t i o n a l c o s t s f o r a high producing cow over a low producing cow are p r i m a r i l y feed c o s t s to supply the- energy to produce the e x t r a milk c o n s t i t u e n t s and h e a l t h c o s t s . The model al l o w s f o r any c o s t s that vary l i n e a r l y with the p r o d u c t i o n of milk or milk c o n s t i t u e n t s , days l a c t a t i n g or days dry to be i n c l u d e d . 2.2.3.1: R e p l a c e m e n t H e i f e r s The c o s t of r a i s i n g replacement h e i f e r s was modeled as f o l l o w s : HC = CF + CY where: HC = t o t a l c o s t s i n a calendar year CF = (days year < 1 year old) x ( d a i l y c o s t f o r c a l v e s ) CY = (days year > 1 year o l d ) x ( d a i l y c o s t f o r y e a r l i n g s ) 2.2.4: H e a l t h and D e a t h In the s i m u l a t i o n i t i s assumed that the p r o b a b i l i t y of PHILOSOPHY AND DETAILS 43 having to c u l l a cow f o r h e a l t h reasons (P^) i - s c o r r e l a t e d only with age, producing a b i l i t y and type s c o r e . P h = A (N) + Y (Gm + Em) + T (Gt + Et) where: A = f a c t o r r e l a t i n g h e a l t h to age N = number of records Y = f a c t o r r e l a t i n g h e a l t h to milk producing a b i l i t y Gm = genetic d e v i a t i o n f o r milk Em = environmental permanent cow d e v i a t i o n T = f a c t o r r e l a t i n g h e a l t h to type score Gt = "genetic d e v i a t i o n f o r type Et = permanent cow environmental d e v i a t i o n f o r type Deaths are a l s o assumed to occur at random with the p r o b a b i l i t y (P^) v a r y i n g only with age and producing a b i l i t y . P d = A (N) + Y (Gm + Em) where: A = f a c t o r r e l a t i n g p r o b a b i l i t y of death to age N = number of records Y = f a c t o r r e l a t i n g death to milk producing a b i l i t y Gm = genetic d e v i a t i o n f o r milk Em = environmental permanent cow d e v i a t i o n 2.2.5: Management In order f o r the s i m u l a t i o n to be r e a l i s t i c i t must pr o v i d e management options s i m i l a r to those a v a i l a b l e to herd o p e r a t o r s . PHILOSOPHY AND DETAILS 44 I t must a l s o p r o v i d e the same s o r t of i n f o r m a t i o n that a herd operator uses to base h i s d e c i s i o n s on. As w e l l as the past performance and c u r r e n t s t a t u s of the herd t h i s i n f o r m a t i o n i n c l u d e s the p r o j e c t i o n of u n f i n i s h e d l a c t a t i o n s , adjustments of l a c t a t i o n s f o r age, e s t i m a t i o n of a cows producing a b i l i t y (EPA) and t r a n s m i t t i n g a b i l i t y (ETA) and ETA's f o r A.I. s i r e s . 2 .2 .5 .1 : BCA's The breed c l a s s averages (BCA) being given, a d j u s t l a c t a t i o n s f o r age. They are c a l c u l a t e d as a percentage of the p o p u l a t i o n mean 305-day mature e q u i v a l e n t p r o d u c t i o n (305- ME) plus a constant to s c a l e the mean to a l e v e l comparable to a c t u a l p o p u l a t i o n s . BCA = (M / M u * 100. ) + K where: M Cows 305-ME c M u P o p u l a t i o n average 305-ME K S c a l i n g constant f o r milk, f a t , or p r o t e i n 2.2 .5 .2: EPA's Estimated producing a b i l i t y (EPA) i s an estimate of the cow's producing a b i l i t y r e l a t i v e to herd-mates and was c a l c u l a t e d u s i n g the method given by M c G i l l i a r d (1979). nr EPA = [Avg. - Herd Avg.] 1 + (n-1)r Where n = number of records averaged PHILOSOPHY AND DETAILS 45 r = r e p e a t a b i l i t y of the t r a i t 2.2.5.3: ETA's The estimated t r a n s m i t t i n g a b i l i t y (ETA) of the cows or h a l f the estimated breeding value (EBV) c o u l d be c a l c u l a t e d using BLUP techniques but at a c o n s i d e r a b l e i n c r e a s e i n the c o s t of running the s i m u l a t i o n . Conversely they c o u l d be simulated by adding a random e r r o r to the true breeding v a l u e . However, t r a d i t i o n a l methods of e s t i m a t i n g t r a n s m i t t i n g a b i l i t i e s are c o m p u t a t i o n a l l y easy and w i l l a llow students the o p p o r t u n i t y to v e r i f y v a l u e s by hand. The s i m u l a t i o n c a l c u l a t e s ETA's of cows and young animals using the method o u t l i n e d by (Burnside, 1978) . ETA = 1/2 [EBV] kN EBV = W [ S i r e ' s ETA] + W [Dam's ETA] + [Cow's Ave.] N + A Dev. (1 - k) N + A Where W = N + A (1 - r) A = r - (1 - p ) h 2 P h 2 k = r - (1 - p ) h 2 N = number of records on the cow p = 1/2 i f s i r e and dam i n f o r m a t i o n a v a i l a b l e = 3/4 i f only s i r e or dam i n f o r m a t i o n known = 1 i f n e i t h e r s i r e nor dam known 2 . . . h = h e r i t a b i l i t y of t r a i t r = r e p e a t a b i l i t y of t r a i t PHILOSOPHY AND DETAILS 46 2.2.5.4: S i m u l a t e d S i r e P r o o f s Since genetic trends are expected i n the simulated p o p u l a t i o n s the s i r e e v a l u a t i o n s r e q u i r e use of a " d i r e c t s i r e comparison" method of e s t i m a t i n g t r a n s m i t t i n g a b i l i t y . A BLUP a n a l y s i s i s expensive i n terms of computer time, so the program uses a " d i r e c t s i r e comparison" based on the true breeding values and s i m u l a t i n g the e r r o r of e s t i m a t i o n . Daughter records are outputted i n a format s u i t a b l e f o r use by many BLUP programs i f t h i s method i s d e s i r e d . In the s i m u l a t i o n the e r r o r term to be added to the true breeding v a l u e s depends on the environmental and g e n e t i c v a r i a n c e s , the number of daughters and the number of herd- years with daughters. ETA = b(Se + 1/2 BV) where: BV = true breeding value Se = simulated e r r o r i s a random number from a normal d i s t r i b u t i o n with a mean of zero and a standard d e v i a t i o n of "D". b = f a c t o r which takes i n t o account the h e r i t a b i l i t y , the 1/4 of the g e n e t i c v a r i a b i l i t y from the s i r e and the number of daughters. I t r e g r e s s e s the estimate a c c o r d i n g l y . PHILOSOPHY AND DETAILS 47 n b = n + where: h e r i t a b i l i t y n = number of daughters D 2 = 1/4 V ( 1 - b) + 1/n ( 1/2. V + V. g g Ep + VEt> + l / k ( V E h ) k = number of herds with daughters Vg = g e n e t i c v a r i a n c e V = permanent cow environmental v a r i a n c e t-p V E t = temporary cow environmental v a r i a n c e = temporary herd environmental v a r i a n c e The ETA's are c a l c u l a t e d each year i n which a s i r e has f i r s t l a c t a t i o n daughter r e c o r d s . A s i r e s new ETA i s the" weighted (by number of daughter records) average of the new and o l d est i m a t e s . As the number of daughters and herds get l a r g e the standard e r r o r approaches zero and the ETA approaches the true breeding v a l u e . 2.2.5.5: Herd Options The herd o p t i o n s i n c l u d e g e n e r a l management d e c i s i o n s and d e t a i l e d o p t i o n s f o r ranking c u l l i n g and mating animals. 2.2.5.5.1: Management Level Four l e v e l s of management are o f f e r e d as user o p t i o n s . PHILOSOPHY AND DETAILS 48 These can be set (sec. 3.1.1., 3.2.1.1. and 3.3.1.) to a f f e c t any or a l l of the f o l l o w i n g herd parameters; the f i x e d c o s t s , the r a t e of e s t r u s d e t e c t i o n and/or the permanent herd environmental e f f e c t s . More i n t e n s i v e l y managed o p e r a t i o n s g e n e r a l l y have higher o p e r a t i n g c o s t s but a l s o higher herd p r o d u c t i o n and more c o n s i s t e n t e s t r u s d e t e c t i o n . 2.2.5.5.2: Minimum Daily Production Two l e v e l s of minimum d a i l y p r o d u c t i o n are to be s e t , one fo r cows that are to be kept i n the herd and another f o r cows to be c u l l e d . A pregnant cow w i l l be dryed o f f e a r l i e r than these l e v e l s i f i t i s necessary to ensure she has the minimum dry p e r i o d (sec. 2.2.2.1.2). 2.2.5.5.3: Ranking C r i t e r i a The ranking of cows i s used to determine t h e i r c u l l i n g order f o r low p r o d u c t i o n , to determine how long an open cow i s kept and to s e l e c t top cows f o r s p e c i a l matings i f matings are automated. The rankings are based on a s e l e c t i o n index f o r which the weighting of each t r a i t i s chosen. The animal's value f o r each t r a i t can be based on the c u r r e n t l a c t a t i o n , the estimated producing a b i l i t y or the estimated t r a n s m i t t i n g a b i l i t y . 2.2.5.5.3.1: C u l l i n g for Rank to Meet Quota Low ranked cows are c u l l e d each year u n t i l p r o d u c t i o n i s w i t h i n a set y e a r l y quota. If the herd does not use automated d e c i s i o n s an PHILOSOPHY AND DETAILS 49 o p p o r t u n i t y i s given d u r i n g the running of the program (appendix B1) to change these c u l l i n g d e c i s i o n s . As w e l l i n d i v i d u a l young animals can be s e l e c t e d f o r s e l l i n g at the beginning of a simulated year. 2.2.5.5.4: C u l l i n g f o r F e r t i l i t y Herd p o l i c y with regards to how long to t r y and breed a cow must be set to one of three o p t i o n s . (1) Set a maximum number of, days open and s e r v i c e s f o r a l l animals. (2) Same as above but with a set number of e x t r a days and s e r v i c e s f o r a group of top ranked animals. (3) Same as (2) but with the e x t r a days and s e r v i c e s d e f i n e d by a f u n c t i o n of rank. 2.2.5.5.5: M a t i n g s The o p t i o n s f o r mating schemes were set such that users c o u l d use r e a l i s t i c but gen e r a l mating schemes or i n d i v i d u a l matings i f d e s i r e d and time p e r m i t t e d . The herd owner can use young s i r e s , proven s i r e s or both. Three o p t i o n s f o r s e l e c t i n g matings are o f f e r e d f o r both young and proven s i r e s . (1) I n d i v i d u a l matings are s e l e c t e d where the user must input a l i s t of b u l l s and s p e c i f y which b u l l to use on each cow. T h i s method can be used to breed the whole herd but would be t e d i o u s . I t i s p r i m a r i l y intended to be used to make matings f o r p o t e n t i a l A.I. s i r e s . PHILOSOPHY AND DETAILS 50 (2) A l i s t of b u l l s to use are entered along with the p r o p o r t i o n to use each. These are then mated randomly i n the p r o p o r t i o n s s p e c i f i e d to a l l cows not mated i n d i v i d u a l l y . S i r e daughter matings are avoided. (3) B u l l s are s e l e c t e d a u t o m a t i c a l l y . The user s e t s the minimum f e r t i l i t y , the maximum semen p r i c e and the method of s e l e c t i o n . S e l e c t i o n s can be made randomly or based on the top b u l l s as ranked by the herds s e l e c t i o n index. S p e c i a l matings to produce A.I. s i r e p r o s pects can a l s o be automated to breed a s p e c i f i e d number of top ranked cows to a s p e c i f i e d number of top ranked b u l l s . 2.2.6: Economic F a c t o r s For t h i s s i m u l a t i o n a l l commodity p r i c e s are set at the beginning of a s i m u l a t i o n and are constant throughout. (For a s p e c i a l use the p r i c e s c o u l d be changed between years but i t would i n v o l v e r e c o m p i l i n g the program.) ( 1) F i x e d c o s t s which were assumed to i n c l u d e a l l c o s t s not otherwise accounted f o r , can be set to give r e a l i s t i c net ear n i n g s . Four management l e v e l s with four d i f f e r e n t f i x e d cost l e v e l s are i n c l u d e d a s s o c i a t e d with d i f f e r e n t heat d e t e c t i o n r a t e s and pr o d u c t i o n l e v e l s . (2) Feed c o s t s which i n c l u d e a cost per kg f o r c a r r i e r , f a t , and p r o t e i n and a p r i c e per day f o r l a c t a t i n g cows, dry cows, y e a r l i n g s and c a l v e s . (3) Other c o s t s which i n c l u d e a base p r i c e f o r semen and the cos t of t r a n s p o r t i n g m i l k . PHILOSOPHY AND DETAILS 51 (4) M i l k p r i c e which i n c l u d e s a base p r i c e f o r quota milk and excess milk, f a t and p r o t e i n d i f f e r e n t i a l s and the c r i t i c a l l e v e l of f a t and p r o t e i n f o r those d i f f e r e n t i a l s . (5) P r i c e s f o r c u l l e d cows based on the reason f o r removal, e i t h e r production or type, f e r t i l i t y , h e a l t h or death. (6) P r i c e s f o r other animals removed i n c l u d i n g new young s i r e s , other b u l l c a l v e s , h e i f e r c a l v e s , year o l d h e i f e r s and two year o l d h e i f e r s . 2 . 2 . 6 . 1 : Semen P r i c e Semen p r i c e can e f f e c t management breeding d e c i s i o n s . The s i m u l a t i o n assumed that the p r i c e depends p r i m a r i l y on supply and demand, the amount of semen a b u l l produces and how much i s used and that the p r i c e i n c r e a s e s e x p o n e n t i a l l y as the a v a i l a b l e semen approaches zero. The model used i s : Ps = B + (U 2 / K) where: Ps - p r i c e of semen B - base p r i c e U - v i a l s of semen used i n a year K - constant dependent on the average semen pr o d u c t i o n and the p o p u l a t i o n s i z e In order t o prevent l a r g e f l u c t u a t i o n s i n p r i c e , the p r i c e i s averaged with the p r e v i o u s year. 5 2 Chapter 3. PARAMETERS USED AND EVALUATION OF THEIR ADEQUACY In order to model a p o p u l a t i o n the program must be i n i t i a l i z e d with parameters fo r the modeled events. The s i m u l a t i o n program assumes that the i n s t r u c t o r or researcher i n i t i a l i z i n g the program to simulate a s p e c i f i c p o p u l a t i o n has an understanding of d a i r y c a t t l e breeding and management and understands the parameters r e q u i r e d . I n i t i a l i z e d values that are u n r e a l i s t i c may cause u n r e a l i s t i c r e s u l t s or the program to f a i l ( i n c o n t r a s t with u n r e a l i s t i c d e c i s i o n o p t i o n s made while running the program, sec. 1.3.1.1.3.(4)). I d e a l l y a l l parameters should be taken from accurate data on the p o p u l a t i o n to be simulated and should be supported i n the l i t e r a t u r e by values w i t h i n which the estimated values f a l l . However, where data are l a c k i n g , values from the l i t e r a t u r e must be used and i n cases where l i t e r a t u r e v a l u e s are v a r i a b l e or nonexistent i n t u i t i o n must be employed. T h i s chapter p r o v i d e s i n i t i a l i z a t i o n v alues f o r s i m u l a t i n g a F r a s e r V a l l e y d a i r y c a t t l e p o p u l a t i o n , e x p l a i n s how they were a r r i v e d at and d i s c u s s e s t h e i r adequacy. 3.1.1: Mature E q u i v i l a n t 305 Day Production and Type The p o p u l a t i o n means and the g e n e t i c and environmental standard d e v i a t i o n s ( t a b l e I) and c o v a r i a n c e s ( t a b l e II) f o r 305-day p r o d u c t i o n of milk, f a t and p r o t e i n are taken from PARAMETERS 53 B r i t i s h Columbia Dairy Herd Improvement (BCDHI) data compiled in 1980 on 27,000 f i r s t l a c t a t i o n records (Peterson, 1980). The p o p u l a t i o n means and the h e r i t a b i 1 i t i e s ( t a b l e IV) c a l c u l a t e d from the v a r i a n c e s a l l are w i t h i n the ranges found in the l i t e r a t u r e (Wilcox et a l . , 1978). The BCDHI data d i d not i n c l u d e type scores so the mean and standard d e v i a t i o n s f o r type score were taken from the program of M c G i l l i a r d and Edlund (1979). The values f o r the four s e t s of permanent herd environmental e f f e c t s c orresponding to the four management l e v e l s were set so that higher l e v e l s r e s u l t e d i n s l i g h t l y higher p r o d u c t i o n ( t a b l e I I I ) . The management c h o i c e s f o r t h i s p o p u l a t i o n are assumed to p r i m a r i l y a f f e c t the hours of d a i l y labour f o r the purposes of heat d e t e c t i o n (sec 3.5.2.2). Since the e f f e c t these changes have on milk p r o d u c t i o n are not w e l l d e f i n e d a small a d d i t i o n a l cost was assumed to r e s u l t i n a s l i g h t i n c r e a s e i n herd p r o d u c t i o n ( t a b l e I I I ) . 3.1.2: A d j u s t m e n t s To c a l c u l a t e a c t u a l 305 day p r o d u c t i o n from mature e q u i v a l e n t p r o d u c t i o n f o r younger animals the i n v e r s e of age c o r r e c t i o n f a c t o r s used by the BCDHI in c a l c u l a t i n g BCA's ( t a b l e I I I ) was used. Estimates in the l i t e r a t u r e of the e f f e c t s of i n b r e e d i n g on p r o d u c t i o n are q u i t e v a r i a b l e (Dickerson, 1974). M c G i l l i a r d and Edlund (1978) suggest a value s l i g h t l y l e s s than one standard d e v i a t i o n of the permanent cow e f f e c t s ( t a b l e I I I ) . PARAMETERS 54 t a b l e I GENERAL DESCRIPTION PROGRAM VARIABLE NAME INITIALIZED VALUE P o p u l a t i o n averages AVG 305-day y i e l d - milk 7200.0 kg - f a t 260.0 kg - p r o t e i n 230.0 kg type score 80.0 Standard D e v i a t i o n s - g e n e t i c milk f a t p r o t e i n type GSD 413.0 18.2 12.8 1 .66 permanent cow PCESD temporary cow - temporary herd milk f a t p r o t e i n type milk f a t p r o t e i n type milk f a t p r o t e i n type TCESD THESD 393.0 12.6 11.9 1 .64 510.0 18.6 15.4 1 .56 255.0 11.2 7.7 1.13 3.1.3: A c t u a l P r o d u c t i o n The l a c t a t i o n curve parameters ( t a b l e IV) have not been estimated i n the F r a s e r V a l l e y p o p u l a t i o n . Although there are some estimates i n the l i t e r a t u r e these parameters c o u l d be s i g n i f i c a n t l y v a r i a b l e between p o p u l a t i o n s . However, f o r the c u r r e n t s i m u l a t i o n the p r e c i s e shape of the l a c t a t i o n curve i s PARAMETERS 55 not c r i t i c a l (sec. 4.3.). The parameters to d e f i n e the r e l a t i o n s h i p between peak and 305 day y i e l d are c a l c u l a t e d from data by Koong (1984). t a b l e II PROGRAM INITIALIZED . GENERAL DESCRIPTION VARIABLE NAME VALUE C o r r e l a t i o n s between t r a i t s environmental ESIGMA milk - milk 1.0 milk - f a t 0.83 f a t - f a t 1.0 milk - p r o t e i n 0.96 fa t - p r o t e i n 0.78 p r o t e i n - p r o t e i n 1.0 milk - type 0.2 f a t - type 0.2 p r o t e i n - type 0.2 type - type 1 .0 genetic GSIGMA milk - milk 1.0 milk - f a t - 0.54 fa t - f a t 1 .0 milk - p r o t e i n 0.70 fa t - p r o t e i n 0.81 p r o t e i n - p r o t e i n 1.0 milk - type 0.0 f a t - type -0.15 p r o t e i n - type 0.0 type - type 1 .0 PARAMETERS 56 t a b l e III GENERAL DESCRIPTION PROGRAM VARIABLE NAME INITIALIZED VALUE Permanent herd e f f e c t s f o r management l e v e l s l e v e l 1 milk f a t p r o t e i n type l e v e l 2 milk f a t p r o t e i n type l e v e l 3 milk f a t p r o t e i n type l e v e l 4 milk f a t p r o t e i n type HELVL 1 50.0 6.6 4.5 0.6 50.0 2.2 1 .5 0.2 -50.0 -2.2 -1.5 -0.2 -150.0 -6.6 -4.5 -0.6 Age adjustments ( f r a c t i o n of mature e q u i v a l e n t ) AGEAJM < 2 years - milk 0.7195 < 2 years - f a t 0.7154 < 2 years - p r o t e i n 0.7195 2 - 3 years - milk 0.8368 2 - 3 years - f a t 0.8380 2 - 3 years - p r o t e i n 0.8368 3 - 4 years - milk 0.9197 3 - 4 years - f a t 0.9243 3 - 4 years - p r o t e i n 0.9197 > 4 years - milk 1 .0 > 4 years - f a t 1.0 > 4 years - p r o t e i n 1 .0 Penalty f o r s i r e daughter matings PINB milk 103.0 f a t 4.26 p r o t e i n 3.2 type 0.41 PARAMETERS 57 t a b l e IV GENERAL DESCRIPTION PROGRAM VARIABLE NAME INITIALIZED VALUE L a c t a t i o n curve peak - 305 day y i e l d s l o p e s l a c t a t i o n 1 l a c t a t i o n 2 l a c t a t i o n 3 i n t e r c e p t s l a c t a t i o n 1 l a c t a t i o n 2 l a c t a t i o n 3 weeks to peak l a c t a t i o n 1 l a c t a t i o n 2 l a c t a t i o n 3 Other b i o l o g i c a l parameters g e s t a t i o n l e n g t h (days) es t r o u s c y c l e (days) e s t r u s d e t e c t i o n r a t e mean p o t e n t i a l standard d e v i a t i o n e f f e c t milk management e f f i c i e n c y l e v e l 1 l e v e l 2 l e v e l 3 l e v e l 4 BSLP ACMT WKPK GEST DCYC HDCM HDCSD HDMLK HRDET 4.6395 E-3 4.8904 E-3 4.9499 E-3 -2.83 -2.28 -2.7 10.0 7.5 7.5 283.0 21.0 0.75 0.01 •2.0 E-5 1 .00 0.85 0.65 0.45 f e r t i l i t y cows mean standard d e v i a t i o n e f f e c t records FERTM FERSD FEREC 0.75 0.01 0.015 death r a t e s cows b a s i c e f f e c t milk e f f e c t records y e a r l i n g s c a l v e s unborn c a l v e s h e a l t h c u l l i n g r a t e b a s i c e f f e c t milk e f f e c t records e f f e c t type DTRATE DTMLR DTREC DTYLG DTCF DTUB HTL HTMLK HTREC HTYP 9.0 E-3 2.0 E-6 1 .2 E-2 2.0 E-2 4.0 E-2 1 .0 E-2 1.9 E-2 2.0 E-6 2.9 E-2 •2.0 E-3 PARAMETERS 58 The number of weeks u n t i l peak p r o d u c t i o n f o r the d i f f e r e n t p a r i t i e s are estimates based on i n f o r m a t i o n i n the l i t e r a t u r e . Rowlands and Lucey (1983) r e p o r t e d f o r a p o p u l a t i o n of B r i t i s h F r i e s i a n s where mature cows averaged 6300 kg 305-day milk that the number of weeks u n t i l peak p r o d u c t i o n averaged 9.8, 6.8 and 7.1 weeks f o r f i r s t , second and t h i r d or greater l a c t a t i o n s r e s p e c t i v e l y . E a r l i e r data (Wood, 1970) had lower values but the number of weeks u n t i l peak pr o d u c t i o n decreased from the second to t h i r d l a c t a t i o n s . Wood (1980) a l s o showed that higher producing animals g e n e r a l l y have l a t e r peaks. Ther e f o r e s i n c e the average p r o d u c t i o n i n the F r a s e r V a l l e y i s 7200 kilograms, values s l i g h t l y higher than those r e p o r t e d have been used ( t a b l e I V ) . 3. 2 . 1 : R e p r o d u c t i o n The l e n g t h of g e s t a t i o n and of the e s t r o u s c y c l e - ( t a b l e IV) are average values f o r H o l s t e i n s i n the l i t e r a t u r e . These are adequate f o r the c u r r e n t s i m u l a t i o n (sec. 2.2.1.2.). 3 . 2 . 1 . 1 : V i s i b i l i t y o f E s t r u s The values f o r e s t r u s d e t e c t i o n are mostly based on papers by Esslemont (1976) and Williamson et a l (1972). They suggest that e s t r u s d e t e c t i o n r a t e s range from 35 percent to 75 percent with the average about 55 p e r c e n t . The parameters given i n t a b l e IV f o r the model (sec. 2.2.2.1.2.1.) r e s u l t i n e s t r u s d e t e c t i o n r a t e s that span the suggested range. Due to l a c k of in f o r m a t i o n a v a i l a b l e the values f o r the s t o c h a s t i c v a r i a b i l i t y (HDCSD) and the r e l a t i o n to milk y i e l d (HDMLK) are PARAMETERS 59 based only on i n t u i t i o n . 3.2.1.2: C o n c e p t i o n The conception r a t e i s the product of the cows f e r t i l i t y f a c t o r ( t a b l e IV) and the b u l l s f e r t i l i t y f a c t o r ( t a b l e V I I ) . Smith (1982) suggest that c o n c e p t i o n r a t e f o r a herd can vary from 41 to 61 percent, while the mean conception r a t e i s about 50 percent ( R o u n d s a v i l l e , 1978). For t h i s simulated p o p u l a t i o n the conception r a t e was 52.5 percent f o r h e i f e r s and decreased 2 percent a f t e r each l a c t a t i o n . 3.2.2: H e a l t h and D e a t h Death r a t e s ( t a b l e VI) used Canadian r e c o r d of performance (R.O.P.) data i n 1975 summarized by W e s t e l l (1980) as no other data was found. He r e p o r t e d that the percent of cows being removed from the herd f o r death, s i c k n e s s , b l o a t and poison were 0.98, 2.36, 3.71 f o r cows i n t h e i r f i r s t , second and t h i r d or g r e a t e r l a c t a t i o n s r e s p e c t i v e l y . Removals f o r h e a l t h reasons ( t a b l e VI) f o r t h i s simulated p o p u l a t i o n were assumed to i n c l u d e those removed f o r udder breakdown, i n j u r y , m a s t i t i s , f e e t and l e g s , temperament, slow m i l k i n g and other undefined reasons. In W e s t e l l ' s data the percent of removals f o r these reasons.were 1.85, 4.77 and 7.90 fo r f i r s t , second and t h i r d or g r e a t e r l a c t a t i o n s . No other comparable data was found. PARAMETERS 60 3 . 3 : E c o n o m i c t a b l e V GENERAL DESCRIPTION PROGRAM VARIABLE NAME INITIALIZED VALUE Economic parameters base semen p r i c e f i x e d c o s t s l e v e l 1 l e v e l 2 l e v e l 3 l e v e l 4 MPSEM CFIX 1 5 39935. 36015. 32825. 30000. feed c o s t s per: kg c a r r i e r FDCAR kg f a t FDFAT kg p r o t e i n FDPRO day l a c t a t i n g FDAY day dry FDRY day - y e a r l i n g FDYLG day - c a l f FDCF cost t r a n s p o r t i n g milk CTRNP p r i c e quota milk PQMLK p r i c e excess milk PEXMLK f a t d i f f e r e n t i a l PFAT c r i t i c a l f a t / h i . CRFAT p r o t e i n d i f f e r e n t i a l PPROT c r i t i c a l p r o t e i n / h i . CRPROT 2.80 E-2 1.2906 0.6730 1.2823 1.6880 1.0434 0.8211 1.34 / h i 52.34 38. 18 80 .60 0 ,0 p r i c e f o r cow product ion f e r t i l i t y h e a l t h death c u l l e d f o r PCOWP PCOWF PCOWH PCOWD 520. 520. 300. 0.0 p r i c e f o r : young s i r e PYSP b u l l c a l f PCFB h e i f e r c a l f PCFH year o l d h e i f e r PCFO two year o l d h e i f e r PYLG 1000. 50. 100. 300. 500. PARAMETERS 61 3.3.1: F i x e d C o s t s F i x e d c o s t s ( t a b l e V) were set to give r e a l i s t i c net incomes f o r herds and to give a p p r o p r i a t e d i f f e r e n c e s i n labour c o s t s . The d i f f e r e n c e s i n labour suggested by R o u n s a v i l l e (1978) were used as a g u i d e l i n e . L e v e l 4 assumes no time spent s p e c i f i c a l l y f o r heat d e t e c t i o n . The other l e v e l s 3 to 1 assume 1, 2 or 3 h a l f hour or more p e r i o d s i n the day spent observing f o r e s t r u s behavior. Presumably the p e r i o d s are chosen from most to l e a s t convenient so c o s t s per day of each p e r i o d were assumed to be $5.00, $6.00 and $8.00. These c o s t s were converted to a y e a r l y b a s i s . An a d d i t i o n a l $1000 a s s o c i a t e d with i n c r e a s i n g p r o d u c t i o n ( sec. 3.3.1.) i s added f o r each i n c r e a s e i n l e v e l . 3.3.2: F e e d and M a i n t e n a n c e C o s t s Feed c o s t s f o r maintenance and p r o d u c t i o n ( t a b l e V).are based on energy requirements and the p r i c e of feeds. The m e t a b o l i z a b l e energy (ME) r e q u i r e d to produce milk c o n s t i t u e n t s have been estimated ( H i l l e r s et a l . , 1979) to be 16.3, 8.5, 6.6 and 0.0 megacalories (Meal) f o r f a t , p r o t e i n , l a c t o s e and minerals and water r e s p e c t i v e l y . C a r r i e r i s assumed to be m i n e r a l s , water and 5 percent l a c t o s e . The ME requirements f o r maintenance were taken from N a t i o n a l Research ' C o u n c i l t a b l e s (NRC, 1978). The r a t i o n was assumed to be 60 % a l f a l f a hay and 40 % c o n c e n t r a t e , with the e x c e p t i o n of dry cows being fed only a l f a l f a . Given the Meal per kg ( S h e l f o r d , 1982) and the c u r r e n t p r i c e s of a l f a l f a hay and d a i r y c o n c e n t r a t e and assuming 10% feed wastage, a c o s t per PARAMETERS 62 Meal was c a l c u l a t e d . a l f a l f a hay 2.20 Meal ME/kg $16.12/100 kg $0.07327/Mcal ME d a i r y 2.95 Meal ME/kg $20.75/100 kg $0.07037/Mcal ME c o n c e n t r a t e r a t i o n x 1.1 (10% waste) $0.07931/Meal ME T h i s was used i n c a l c u l a t i n g the c o s t s of the energy r e q u i r e d f o r maintenance and p r o d u c t i o n . 3 . 3 . 2 . 1 : Y e a r l i n g s and Calves The model fo r the c o s t s of r e a r i n g h e i f e r s ( t a b l e V) i s a s i m p l i s t i c one c o n s i s t i n g only of an average d a i l y c o s t f o r c a l v e s and y e a r l i n g s . These va l u e s are c a l c u l a t e d from ME requirements (NRC 1978) and the c o s t per Meal of ME f o r the r a t i o n above. 3 . 3 . 3 : M i l k P r i c e The p r i c e s f o r quota milk, excess milk and f a t d i f f e r e n t i a l ( t a b l e V) are the p r i c e s i n the F r a s e r V a l l e y as of November 1985. No d i f f e r e n t i a l i s p a i d f o r p r o t e i n . T r a n s p o r t a t i o n c o s t s are the c u r r e n t c o s t s of s h i p p i n g milk i n d o l l a r s per h e c t o l i t e r 3 . 3 . 4 : P r i c e f o r Sold Animals P r i c e s f o r animals s o l d approximate c u r r e n t beef p r i c e s i n the F r a s e r V a l l e y . PARAMETERS 63 3.4: Additional Management Information t a b l e VI PROGRAM INITIALIZED . GENERAL DESCRIPTION VARIABLE NAME VALUE Management a i d parameters h e r i t a b i l i t i e s HERT milk 0.26 f a t 0.34 p r o t e i n 0.27 type 0.30 r e p e a t a b i l i t i e s REP milk 0.50 f a t 0.51 p r o t e i n 0.51 type 0.59 minimum days: to f i r s t mating; BRDMIN 50.0 dry; DRYMIN 50.0 to p r o j e c t l a c t a t i o n ; DPROJ 90.0 breed h e i f e r s (+730). DFBRD -120.0 d e v i a t i o n of base BCA's IAJBCA milk 37 f a t 36 p r o t e i n 35 type 0 3.4.1.1: Projection of Lactation Record L a c t a t i o n s that are i n progress more than 90 days ( t a b l e VI) are p r o j e c t e d to 305 days as i s c u r r e n t l y done f o r Fra s e r V a l l e y herds which p a r t i c i p a t e i n the BCDHI program. In the s i m u l a t i o n the a c t u a l 305 day p r o d u c t i o n records generated p r e v i o u s l y (sec. 2.2.1.1) are p r i n t e d out f o r herds with p r i n t e d output. 3.4.1.2: Adjustment for BCA Units The adjustment to g i v e r e a l i s t i c BCA u n i t s ( t a b l e VI) are taken from the BCDHI data (1980). PARAMETERS 64 3.4.1.3: Repeatabilities The r e p e a t a b i l i t i e s ( t a b l e VI) used are supported i n the l i t e r a t u r e (Wilcox et a l . , 1978). They are used i n c a l c u l a t i n g EPA's. 3.4.1.4: H e r i t a b i l i t i e s The h e r i t a b i l i t i e s are used i n c a l c u l a t i n g ETA's and were taken from the BCDHI data (1980) and are i n agreement with values i n the l i t e r a t u r e (Wilcox et a l . , 1978). 3.4.2: Population Decisions Some management parameters are he l d constant f o r the p o p u l a t i o n because of l i m i t a t i o n s i n the s i m u l a t i o n models (sec . 4 . 4 ) . 3.4.2.1: Minimum Days Post Partum to Breed The f i r s t day post partum that an animal was e l i g i b l e to breed ( t a b l e VI) was based on recommendations i n the l i t e r a t u r e . T r a d i t i o n a l l y t h i s has been 60 days, however, c u r r e n t recommendations are between 45 and 55 days (Smith, 1982). Smith (1982) a l s o r e p o r t s that s t u d i e s using progesterone a n a l y s i s or t e l e v i s i o n cameras have demonstrated that 85 to 90 percent of cows are c y c l i n g normally by 50 days post partum. 3.4.2.2: Minimum Dry Period The minimum dry p e r i o d ( t a b l e VI) i s set at a l e v e l that does not s e r i o u s l y a f f e c t p r o d u c t i o n i n the next l a c t a t i o n as t h i s e f f e c t was not si m u l a t e d . The optimum dry p e r i o d depends PARAMETERS 65 on the c o n d i t i o n of the animal and can range from 23 to 76 days (Dias and A l l a i r e , 1982). Recommendations fo r herd p o l i c y have been as low as 40 days (Ax, 1982), however, 50 days i s more widely accepted. PARAMETERS 66 3 . 5 : Setup The program to generate the herds and A . I . u n i t (SETUP Appendix D.1) r e q u i r e s that the i n i t i a l herd d e c i s i o n o p t i o n s be s p e c i f i e d . t a b l e VII PROGRAM INITIALIZED . GENERAL DESCRIPTION VARIABLE NAME VALUE Herd setup parameters management d e c i s i o n o p t i o n s PARM herd number (set to zero) 0.0 code (set to zero) 0.0 i n i t i a l year -2.0 o p e r a t i n g mode, seed 2.2 s e l e c t c r i t e r i a , management l e v e l 2.2 index weights milk 0.5 f a t 0.5 p r o t e i n 0.0 type 0.0 c u l l f e r t i l i t y days open 200.0 s e r v i c e s 5.0 # cows to get e x t r a 0.0 exponent rank ' 0.0 e x t r a days 0.0 e x t r a s e r v i c e s 0.0 d a i l y p r o d u c t i o n to dry o f f 7.0 d a i l y p r o d u c t i o n t o c u l l 12.0 # proven s i r e s . method s e l e c t i o n 10.2 max semen p r i c e . min f e r t i l i t y 100.2 # young s i r e s . method s e l e c t i o n 3.3 % young s i r e s . # bull s - y o u n g b u l l s 30.02 # cows-bulls . method s e l e c t i o n 10.2 Quota 1500. Excess 500. number herds (always set to 1) 1.0 AI program s p e c i f i c parameters b u l l f e r t i l i t y f a c t o r mean BFM 0.7 standard d e v i a t i o n BFSD 0.1 years before used UYR 1.0 age removed DYR 15.0 cows i n the p o p u l a t i o n TCOW 750.0 PARAMETERS 67 3.5.1: D e c i s i o n Options 3.5.1.1: I n i t i a l Year The number of years that are to be run before summaries are saved f o r a n a l y s i s i s s p e c i f i e d by s t a r t i n g the s i m u l a t i o n at a negative year. Summaries are not s t o r e d u n t i l year one. 3.5.1.2: Operating Mode Two o p e r a t i n g modes are p r o v i d e d . (1) F u l l output mode al l o w s more s p e c i f i c user o p t i o n s and p r i n t s a hard copy of the herds year end s t a t u s . (2) Automated mode g i v e s no p r i n t e d output. The automated mode i s p r i m a r i l y f o r running " c o n t r o l " herds or f o r u s ing the program f o r r e s e a r c h . However, when generating the i n i t i a l p o p u l a t i o n a l l herds should be set to automated mode and run f o r two years to allow b u l l s to get p r o o f s . The seed to i n i t i a l i z e the random number generators can be: (1) user s p e c i f i e d ; or (2) a u t o m a t i c a l l y selected, from the time of day c l o c k . The user s p e c i f i e d seed i s used only to d u p l i c a t e a run i f problems a r i s e . 3.5.1.3: Management L e v e l The management l e v e l can be set at l e v e l s 1 to 4 f o r e x c e l l e n t to poor management r e s p e c t i v e l y . More i n t e n s i v e l y managed o p e r a t i o n s u s u a l l y have higher o p e r a t i n g c o s t s (sec. 3.3.1.) but a l s o higher p r o d u c t i o n (sec. 3.1.1.) and more c o n s i s t e n t e s t r u s d e t e c t i o n (sec. 3.2.2.1.). G e n e r a l l y the herds should be set up with a moderate l e v e l of management. PARAMETERS 6 8 3.5.1.4: S e l e c t i o n C r i t e r i a S e l e c t i o n and c u l l i n g of animals may be based on one of three c r i t e r i a : (1) the c u r r e n t l a c t a t i o n ; (2) the EPA; or (3) the ETA. 3.5.1.5: S e l e c t i o n Index The weightings on each t r a i t f o r the s e l e c t i o n index should be set to sum to 1. (During the running of the program values entered are a u t o m a t i c a l l y a d j u s t e d to sum to 1) 3.5.1.6: Minimum D a i l y P r o d u c t i o n At a c e r t a i n l e v e l of p r o d u c t i o n i t i s no longer economical to continue m i l k i n g a cow. T h i s l e v e l of d a i l y p r o d u c t i o n i s set independently f o r cows that are pregnant and cows that are to be c u l l e d . 3.5.1.7: C u l l i n g f o r F e r t i l i t y Three o p t i o n s are pro v i d e d f o r determining the maximum days or s e r v i c e s a cow i s allowed to be open before she i s c u l l e d . (1) Set con s t a n t s f o r a l l animals. (2) Set two l e v e l s one f o r a s p e c i f i e d number of top cows and another f o r the r e s t . (3) Allow the maximums to be determined as a f u n c t i o n of the cows rank. Cows are not ranked when the herds are set up and so the days and s e r v i c e s should be set to c o n s t a n t s i n i t i a l l y . They PARAMETERS 6 9 should not be set too low i n order f o r herd s i z e s to be maintained. 3.5.1.8: Breeding Scheme The breeding scheme i n v o l v e s s e t t i n g the number of proven b u l l s , t h e i r maximum semen p r i c e and minimum f e r t i l i t y , the number of young s i r e s and the p r o p o r t i o n to use them and the number of top cows to mate t o a number of top b u l l s to produce p o t e n t i a l young s i r e s . Three methods are p r o v i d e d f o r s e l e c t i n g the animals i n each group. (1) I n d i v i d u a l s e l e c t i o n (not in automated h e r d ) . (2) S e l e c t i o n by index rank. (3) Randomly s e l e c t i o n . When the herds are set up a l l s e l e c t i o n s should be made randomly to ensure that a l l b u l l s get p r o o f s . 3.5.2: Quota The quota f o r a l l herds i n the s i m u l a t i o n must a l s o be set when the herds are generated. I t i s a s s i g n e d based on the approximate s i z e and average p r o d u c t i o n of the herds to be simulated. For t e s t i n g only about 30 cow herds were d e s i r e d . 3.6: A.I. U n i t To update AI b u l l s a few more parameters need to be d e f i n e d ( t a b l e V I I ) . PARAMETERS 70 3 . 6 . 1 : B u l l F e r t i l i t y The r e l a t i v e c o n t r i b u t i o n of the b u l l and the cow to conception i s unknown. The important c r i t e r i a i s the product of the two f e r t i l i t y f a c t o r s , the conception r a t e (sec 3.2.1.2.) . 3 . 6 . 2 : Ages The age at which a b u l l can f i r s t be used as a young s i r e i s u s u a l l y one year. He i s then not used u n t i l he o b t a i n s a pr o o f . In order to l i m i t the s i z e of an AI u n i t the b u l l s can be removed at a c e r t a i n age. 3 . 6 . 3 : Number of Cows T h i s i s a rough estimate of the number of cows i n the p o p u l a t i o n which i n t h i s case i s 24 herds times about 30 cows per herd. I t i s used to weight the b u l l s r e l a t i v e semen use fo r c a l c u l a t i n g the p r i c e (2.2.4.1.). 3 . 6 . 4 : Semen Cost The base semen p r i c e i s the minimum c o s t i n the F r a s e r V a l l e y . The weighting f a c t o r depends on the approximate s i z e of the p o p u l a t i o n to be s i m u l a t e d . 71 Chapter 4. POTENTIAL IMPROVEMENTS Any s i m u l a t i o n of a b i o l o g i c a l system i s never complete because the models used can always be r e f i n e d to a more complex l e v e l . However refinements may not n e c e s s a r i l y be b e t t e r at the present time. Three c o n s i d e r a t i o n s should be made. (1) Are the refinements b e n e f i c i a l to the g o a l s of the simulat ion? (2) Are the a v a i l a b l e computing f a c i l i t i e s capable of han d l i n g the i n c r e a s e d complexity? (3) Is there s u f f i c i e n t i n f o r m a t i o n to model the system at a more r e f i n e d l e v e l ? T e s t i n g and use of t h i s s i m u l a t i o n should r e v e a l many d e s i r a b l e improvements. More resea r c h and r e c o r d i n g of in f o r m a t i o n i n the f i e l d w i l l make a v a i l a b l e more acc u r a t e parameters and give a b a s i s f o r more d e t a i l e d and r e l i a b l e models. T h i s chapter d i s c u s s e s some p o t e n t i a l improvements that have been suggested d u r i n g the development w r i t e up and p r e l i m i n a r y t e s t i n g ( t a b l e VIII and Appendix B1) of the program. 4.1: 305-Day Production and Type Score The model used f o r gen e r a t i n g 305-day l a c t a t i o n records and type scores (sec. 2.2.1.1.) i s an e m p i r i c a l one, the b a s i s POTENTIAL IMPROVEMENTS 72 of which has been v a l i d a t e d by Freeman (1976). In i t s c u r r e n t form most of the components of the model are s t o c h a s t i c parameters which model a c c u r a t e l y but do not e x p l a i n the v a r i a b i l i t y . The e x c e p t i o n i s the model proposed f o r the permanent herd e f f e c t s , which allows the permanent herd e f f e c t s to be r e l a t e d to up to four s p e c i f i c changes i n management. T h i s model i s an i n t u i t i v e one but i t attempts to e x p l a i n some of the v a r i a b i l i t y between herds. I t c o u l d f o r example be used to compare d i f f e r e n t types of housing, f e e d i n g p r a c t i c e s or c l i m a t i c c o n d i t i o n s provided t h e i r e f f e c t s on p r o d u c t i o n and type scores have been measured. Further r e s e a r c h i s needed to i d e n t i f y i n a q u a n t i t a t i v e f a s h i o n the e f f e c t s of a l l management p r a c t i c e s on e c o n o m i c a l l y important t r a i t s . T h i s should a l s o p r o v i d e the b a s i s f o r more complex and accurate models. F u r t h e r r e s e a r c h i s a l s o needed to f i n d q u a n t i t a t i v e r e l a t i o n s h i p s between other management or b i o l o g i c a l f a c t o r s (sec. 2.2.2.) and a l l of the s t o c h a s t i c parameters i n the model to allow a more comprehensive s i m u l a t i o n . e.g. He a l t h problems and the temporary cow environmental e f f e c t s . The model used f o r 305-day l a c t a t i o n r e c o r d and type c o u l d be expanded to i n c l u d e other t r a i t s such as d i f f e r e n t type scores i f i t was d e s i r e d and e s t i m a t i o n s of the v a r i a b i l i t y and c o r r e l a t i o n s were a v a i l a b l e . POTENTIAL IMPROVEMENTS 73 4.2: Ad j us tmen t s C o r r e c t i o n s f o r age c o u l d be more acc u r a t e i f a l i n e a r f u n c t i o n that best f i t s the observed values was used r a t h e r than the d e f i n e d f a c t o r f o r each age (sec 2.2.1.2). The model f o r c o r r e c t i n g p r o d u c t i o n and type f o r i n b r e e d i n g (sec. 2.2.1.2) c o u l d be extended to i n c l u d e known e f f e c t s of i n b r e e d i n g d e p r e s s i o n such as i n c r e a s e d p r o b a b i l i t i e s of h e a l t h problems and death. I t c o u l d a l s o be extended to i n c l u d e a l l l e v e l s of i n b r e e d i n g . However, ext e n s i v e checking f o r i n b r e e d i n g would r e s u l t i n the program r e q u i r i n g c o n s i d e r a b l y more computer memory and a longer execution time. 4.3: L a c t a t i o n Curve The reasons f o r i n c l u d i n g the l a c t a t i o n curve i n the s i m u l a t i o n was to give an estimate of p r o d u c t i o n f o r l a c t a t i o n s that are not 305 days i n l e n g t h and f o r a p o r t i o n of a l a c t a t i o n i n t e r r u p t e d by a year end. For the c u r r e n t purposes of the s i m u l a t i o n the parameters and model used are adequate, improvements would have a small e f f e c t on the r e s u l t s (sec. 2.2.1.3). However, i f the s i m u l a t i o n was expanded to i n c l u d e season e f f e c t s or to model management or f e e d i n g i n more d e t a i l the l a c t a t i o n curve should be estimated more p r e c i s e l y . (1) Parameters r e l a t i n g age and 305 day p r o d u c t i o n to the week of peak p r o d u c t i o n and a c t u a l peak p r o d u c t i o n need to be estimated f o r the s p e c i f i c p o p u l a t i o n being s i m u l a t e d . POTENTIAL IMPROVEMENTS 74 (2) Wood (1977) has demonstrated that h i s equation can a l s o be used to give the p r o d u c t i o n between two p o i n t s f o r f a t and p r o t e i n . T h i s would r e q u i r e that the r e l a t i o n s h i p s i n (1) above be estimated independently f o r f a t and p r o t e i n . (3) Many other f a c t o r s have been shown to a f f e c t the shape of the l a c t a t i o n curve such as pregnancy (Bar-Anan, 1981), le n g t h of dry p e r i o d , s i c k n e s s or i n j u r y and f e e d i n g . I f these f a c t o r s were to be taken i n t o account they would e x p l a i n p a r t of the temporary cow v a r i a b i l i t y (sec. 2.2.1.) and the a p p r o p r i a t e r e d u c t i o n i n the s t o c h a s t i c v a r i a b i l i t y would have to be estimated or adjustments made to the l a c t a t i o n curve. 4 . 4 : Reproduc t ion , The r e p r o d u c t i v e process was i n c l u d e d i n the s i m u l a t i o n - p r i m a r i l y to model the c a l v i n g i n t e r v a l and i t s i n t e r a c t i o n with management and with the l e v e l of p r o d u c t i o n . The adequacy of the model (sec. 2.2.2.1.2) can be measured by comparing c a l v i n g i n t e r v a l s with values r e p o r t e d i n the l i t e r a t u r e . Smith (1982) provided data showing that improving heat d e t e c t i o n r a t e s from 35 to 75 percent shortens the c a l v i n g i n t e r v a l by 19 days on average. These r a t e s of heat d e t e c t i o n are comparable to management l e v e l s 1 and 4 of the s i m u l a t i o n with the parameters s u p p l i e d ( t a b l e I V ) . A p r e l i m i n a r y t e s t run of the s i m u l a t i o n ( t a b l e V I I I ) gave average d i f f e r e n c e s i n c a l v i n g i n t e r v a l s between l e v e l s 1 and 4 of 26 days. POTENTIAL IMPROVEMENTS 75 The f i r s t three c u l l i n g p o l i c i e s i n the t e s t run ( t a b l e V I I I ) are the same as those used by R o u n s a v i l l e (1978) i n a r e p r o d u c t i v e s i m u l a t i o n i n which he obtained comparable c a l v i n g i n t e r v a l s . C u l l i n g p o l i c i e s 4 to 6 i n d i c a t e t hat with i n t e n s i v e c u l l i n g 365 day c a l v i n g i n t e r v a l s should be p o s s i b l e . F u r t h e r use and f i n e t u n i n g of the f e r t i l i t y and e s t r u s d e t e c t i o n parameters used should r e v e a l more f u l l y the adequacy of the models used. t a b l e VIII TEST RUN MEANS C a l v i n g i n t e r v a l - a l l herds - management l e v e l - c u l l i n g p o l i c i e s 1 2 3 4 1 2 3 4 5 6 376.986 days 365.244 days 371 .018 days 379.749 days 391.936 days 389.450 days 386.805 days 382.549 days 363.459 days 369.574 days 370.082 days R e s u l t s are from the t e s t run (appendix B1) with 24 herds of 30 cows each, simulated f o r 7 years using parameters from Chapter t h r e e . (Conception r a t e averaged 0.505 and a l l four management l e v e l s were used.) Improvements c o u l d be made with the c u r r e n t model i f more estimates of s t o c h a s t i c parameters l i n k i n g a d d i t i o n a l herd management c o s t s to improvements i n e s t r u s d e t e c t i o n and f e r t i l i t y were a v a i l a b l e . A more d e t a i l e d m o d e l l i n g of the r e p r o d u c t i v e process POTENTIAL IMPROVEMENTS 7 6 c o u l d a l s o improve the s i m u l a t i o n . (1) Embryonic l o s s e s c o u l d be i n c l u d e d . (2) Abnormal c y c l e s together with t h e i r p r o b a b i l i t y c o u l d be modeled. (3) The v a r i a b i l i t y of f e r t i l i t y and e s t r u s d e t e c t i o n r a t e w i t h i n l a c t a t i o n s have s i g n i f i c a n t e f f e c t s and should be modeled i f more d e t a i l e d herd management i s i n c l u d e d i n the s i m u l a t i o n . ( 4 ) Breeding by embryo t r a n s p l a n t i s a p o s s i b l e a d d i t i o n to the r e p r o d u c t i v e s i m u l a t i o n that would be u s e f u l f o r teac hing and r e s e a r c h . 4.5: Feeding Feed consumption was i n c l u d e d p r i m a r i l y as a b a s i s f o r c a l c u l a t i n g a s e l e c t i o n index and to give an estimate of c o s t s . For these purposes the models used (sec. 2.2.2.2) are adequate, however, some simple improvements c o u l d be made. (1) A r a t i o n which has a roughage to c o n c e n t r a t e r a t i o that v a r i e s with the l e v e l of p r o d u c t i o n as higher producing cows are normally fed a higher p r o p o r t i o n of more expensive c o n c e n t r a t e s i n order to meet t h e i r energy requirements. (2) The energy r e q u i r e d f o r growth of young cows in t h e i r dry p e r i o d should be i n c l u d e d . (3) The d a i l y c o s t s of young animals c o u l d be modeled more a c c u r a t e l y as a f u n c t i o n of age r a t h e r than the a r b i t r a r y d i s t i n c t i o n between 1 and 2 year o l d s . Expansion of the s i m u l a t i o n to allow i t to be used in t e a c h i n g POTENTIAL IMPROVEMENTS 77 or r e s e a r c h of n u t r i t i o n or feed i n g management i s p o s s i b l e . (1) An a d d i t i o n a l subroutine c o u l d be added to the s i m u l a t i o n to allow l e a s t c o s t r a t i o n f o r m u l a t i o n p r i o r to s i m u l a t i n g the year. T h i s would be u s e f u l f o r studying the c o s t e f f e c t i v e n e s s of l e a s t cost r a t i o n f o r m u l a t i o n . (2) A more comprehensive s i m u l a t i o n c o u l d i n v o l v e modelling the e f f e c t s of the r a t i o n content and feed i n g p r a c t i c e s on the l a c t a t i o n curve and milk y i e l d i f a p p r o p r i a t e models are a v a i l a b l e . (3) The v a r i a b i l i t y i n body weight c o u l d be modeled as i t has a s i g n i f i c a n t r e l a t i o n s h i p with feed consumption (Wilcox et a l . , 1978). T h i s would allow feed c o s t s to be t i e d to body weight. 4.6: He a l t h and Death An omission that would be simple to add i s to allow f o r i n t e r a c t i o n s between management l e v e l and the r a t e of h e a l t h problems and deaths. A f u r t h e r expansion of the s i m u l a t i o n would be to model the i n t e r a c t i o n s between h e a l t h problems and the shape of the l a c t a t i o n curve. 4.6: Economics A l l p r i c e s except semen are modeled as f i x e d p r i c e s (sec. 2.2.4) which i s adequate s i n c e other market f a c t o r s a f f e c t these p r i c e s more than d a i r y o p e r a t o r s d e c i s i o n s . The model f o r semen p r i c e s i s only an i n t u i t i v e one and probably should be improved. L o g i c a l expansions of the s i m u l a t i o n would be to allo w the buying and s e l l i n g of cows f o r d a i r y purposes and POTENTIAL IMPROVEMENTS 7 8 the buying and s e l l i n g of quota. These f a c t o r s would r e q u i r e a model f o r the i n t e r a c t i o n of p r i c e s with supply and demand and perhaps other f a c t o r s . 4 . 7 : M a n a g e m e n t The major short coming of the program from a management po i n t of view i s the d e c i s i o n of when to c u l l a cow f o r f e r t i l i t y . R e a l i s t i c a l l y i t should be p a r t i a l l y based on whether the herd i s over or under quota. The c u r r e n t model (sec. 2.2.3.5.4) all o w s the d e c i s i o n to vary only with the rank of the cow i n the herd. T h i s causes severe problems when using low l e v e l s of heat d e t e c t i o n and i n t e n s i v e c u l l i n g f o r f e r t i l i t y (appendix B). I t can r e s u l t in the herd s i z e becoming s e v e r e l y reduced and quota not being met. One s o l u t i o n i s to p l a c e l i m i t s on the f e r t i l i t y c u l l i n g s p e c i f i c a t i o n s allowed. A much more s a t i s f a c t o r y s o l u t i o n would be to postpone f i n a l c u l l i n g d e c i s i o n s on open cows i n the s i m u l a t i o n u n t i l herd p r o d u c t i o n i s estimated (appendix C), which i s when other v o l u n t a r y c u l l i n g d e c i s i o n s are made. T h i s would allow the days open to be used i n combination with the cows index score i n making a c u l l i n g d e c i s i o n . For optimum management the days to f i r s t breeding and minimum days dry (sec. 2.2.3.5 & 3.4.2) should be set as a f u n c t i o n of a cows pro d u c t i o n and perhaps other f a c t o r s r a t h e r than as a f i x e d value f o r a l l animals. If these d e c i s i o n s were to be i n c l u d e d as management o p t i o n s the e f f e c t s of pregnancy and the l e n g t h of the dry p e r i o d on p r o d u c t i o n and the l a c t a t i o n curve would have to be modeled. POTENTIAL IMPROVEMENTS 79 Other management d e c i s i o n o p t i o n s that c o u l d be added have been covered p r e v i o u s l y . (1) Breeding v i a embryo t r a n s p l a n t s (sec. 4.4). (2) Least cost r a t i o n f o r m u l a t i o n (sec. 4.5). (3) Buy and s e l l cows (4.7). (4) Buy and s e l l quota (4.7). 4 . 8 : P r a c t i c a l P r a c t i c a l c o n s i d e r a t i o n s that would make the program e a s i e r to use, more f l e x i b l e or f a s t e r to run w i l l become apparent as i t i s used. Two f a c t o r s have a l r e a d y a r i s e n . (1) The c a l c u l a t i o n of l a c t a t i o n f a c t o r s c o u l d more e f f i c i e n t l y be done with breed c l a s s averages i n i n t e g e r s rather than the c u r r e n t c a l c u l a t i o n s i n mature e q u i v a l e n t s and r e a l numbers. (2) If the program c o u l d be adapted to run i n a reasonable time on a microcomputer the c o s t of running the program would be g r e a t l y reduced. T h i s would f a c i l i t a t e more ex t e n s i v e use of and allow f o r more expansion of the program. 80 SUMMARY A computer program has been developed that i s capable of s i m u l a t i n g a p o p u l a t i o n of herds of d a i r y c a t t l e . I t can simulate any small p o p u l a t i o n of d a i r y c a t t l e i n Canada with respect to production and type score, r e p r o d u c t i o n , management d e c i s i o n s and o v e r a l l economics with summaries at the cow and herd l e v e l s on a calendar year b a s i s . I t should be u s e f u l as a t e a c h i ng t o o l f o r s e n i o r undergraduate students i n d a i r y s c i e n c e or animal g e n e t i c s and as an a i d i n r e s e a r c h i n g the complex i n t e r a c t i o n s between breeding programs, management systems, b i o l o g i c a l f a c t o r s and economics. The program i s "user f r i e n d l y " and allows breeding and management d e c i s i o n s to be automated to reduce unnecessary tedious work. I t a l s o i s w r i t t e n in a modular form to f a c i l i t a t e m o d i f i c a t i o n and expansion. The primary model f o r the i n h e r i t a n c e of the four t r a i t s , m i l k , f a t and p r o t e i n p r o d u c t i o n and o v e r a l l type score i s an e m p i r i c a l one that has been v a l i d a t e d i n commercial and r e s e a r c h herds over c u r r e n t b i o l o g i c a l ranges. Accepted t h e o r e t i c a l models were used f o r other components of the system. Due to a lack of documented mathematical models f o r many of the i n t e r a c t i o n s some models based p a r t l y on i n t u i t i o n had to be used to complete the system. Parameters used are recorded data from the p o p u l a t i o n being simulated or v a l u e s from the l i t e r a t u r e where they are SUMMARY 81 a v a i l a b l e . Improvements to the s i m u l a t i o n can be made by acc u r a t e measurements in the f i e l d to give a p p r o p r i a t e parameters and more d e t a i l e d e m p i r i c a l models. Other improvements c o u l d be made by expanding the s i m u l a t i o n to i n c l u d e other aspects of d a i r y herd management. 82 BIBLIOGRAPHY 1: Andrus, D.F. and M c G i l l i a r d , L.D. 1975. S e l e c t i o n of d a i r y c a t t l e f o r o v e r a l l e x c e l l e n c e . J . D a i r y S c i . 58: 1876- 1879. 2: Ax, R.L. 1982. Shortening the c a l v i n g i n t e r v a l . D a i r y Herd Management. 19(3): 58-60. 3: B a i l i e , J.H. 1982. The i n f l u e n c e of breeding management e f f i c i e n c y on d a i r y herd performance. Anim. Prod. 34: 315- 323. 4: Baldwin, R.L. and Smith N.E. 1971. Intermediary aspects and t i s s u e i n t e r a c t i o n s of ruminant f a t metabolism. J . D a i r y S c i . 54: 583-589. 5: Brown, J.E., F i t z h u g h , H.A. J r . and C a r t w r i g h t , T.C. 1976. A comparison of n o n l i n e a r models f o r d e s c r i b i n g weight age r e l a t i o n s h i p s i n c a t t l e . J . Anim. S c i . 42: 810-816. 6: Bar-Anan, R. and G e n i z i , A. 1981. The e f f e c t s of l a c t a i o n , pregnancy and calendar month on milk r e c o r d s . Anim. Prod. 33: 281-290. 7: Black, J.R. and Fox, D.G. 1978. Computer a p p l i c a t i o n s i n extension e d u c a t i o n . Symposium on the use of the computer i n animal s c i e n c e t e a c h i n g , r e s e a r c h and e x t e n t i o n . 1976. A.S.A.S. I l l i n o i s , pp. 20-37. 8: Boulding, K.E. 1956. General systems theory. The s k e l e t o n of s c i e n c e . Management S c i . 2: 197-203. 9: B r a c k e l s b e r g , P.O. 1978. The computer in animal s c i e n c e teaching experiences with a beef g e n e t i c s i m u l a t i o n . Symposium on the use of the computer in animal s c i e n c e t e a c h i n g , r e s e a r c h and e x t e n t i o n . A.S.A.S. I l l i n o i s , pp. 2-8. 10: B r o s t e r , W.H., B r o s t e r , V.J., Clements, A.J., Smith, T. 1981. The r e l a t i o n s h i p between y i e l d of milk s o l i d s of d a i r y cows and response to change in plane of n u t r i t i o n s . J . a g r i c . S c i . , Camb. 97: 643-647. 11: Bruner, J.S. 1960. The Process of E d u c a t i o n , Harvard U n i v e r s i t y Press, pp. 37-40. 12: Canolty, N.J. and Koong, L . J . 1976. U t i l i z a t i o n of energy f o r maintenance and f o r f a t and lean gains by mice s e l e c t e d f o r r a p i d post weaning growth r a t e . J . Nutr. 106: 1202. 13: Chi-Leung Lau. 1980. A l g o r i t h i m AS 147. A simple s e r i e s f o r the incomplete gamma i n t e g r a l . A p p l i e d S t a t i s t i c s 29, 113-114. BIBLIOGRAPHY 83 14: Dhanoa, M.S. 1981. A note on an a l t e r n a t i v e form of the l a c t a t i o n model of Wood. Anim. Prod. 32, 349-351. 15: Dhanoa, M.S. and Le Du, Y.L.P. 1982. A p a r t i a l adjustment model to d e s c r i b e the l a c t a t i o n curve of a d a i r y cow. Anim. Prod. 34: 243-247. 16: Dias, F.M., A l l a i r e , F.R. 1982. Dry p e r i o d to maximize milk p r o d u c t i o n over two c o n s e c u t i v e l a c t a t i o n s . J . Da i r y S c i . 65: 136-145. 17: Dickerson, G.E. 1974. Inbreeding and h e t e r o s i s i n animals. Proceedings of the Animal Breeding and Gen e t i c s Symposium i n Honor of J.L. Lush. ASAS and ADSA. Champaign, III . 18: D i j k h u i z e n , A.A., Hibma, S j . , Renkema, J.A. 1985. A s t o c h a s t i c model f o r the s i m u l a t i o n of mangement d e c i s i o n s i n d a i r y herds, with s p e c i a l r e f e r e n c e to r e p r o d u c t i v e performance. Netherlands J o u r n a l of A g r i c u l t u r a l Science, 33: 59-61. 19: Ducker, M.J., and Morant, S.V. 1984. Observations on the r e l a t i o n s h i p s between the n u t r i t i o n , milk y i e l d , l i v e weight and r e p r o d u c t i o n performance of d a i r y cows. Anim. Prod., 38: 9-14. 20: Esslemont, R.J. 1976. Oestrus behaviour i n a herd of d a i r y cows. Vet. Rec. 99: 472. 21: F i s h e r , L . J . and W i l l i a m s , C.J. 1978. E f f e c t s of Environmental f a c t o r s and f e t a l and maternal genotypes on g e s t a t i o n length and b i r t h weight of H o l s t e i n C a l v e s . J . Dai r y S c i . 61: 1462-1467. 22: F o r r e s t e r , J.W. 1968. P r i n c i p l e s of Systems. W r i g h t - A l l e n Press Inc., Cambridge, Mass. pp. 2-24. 23: France, J . and Dhanoa, M.S. 1984. Short Note on e s t i m a t i n g l a c t a t i o n y i e l d . J . a g r i c . S c i . , Camb. 103, 245- 247. 24: Freeman, A.E., Gaunt, S.N., Damon R.A. and Bean B.H. 1976. H e r i t a b i l i t y and r e p e a t a b i l i t y of f e r t i l i t y of d a i r y s i r e s . J . Da i r y S c i . 59: 1502. 25: G o o d w i l l , R.E., Berger, P.J. and Freeman, A.E. 1984. E f f e c t s of previous days open, pr e v i o u s days dry and present days open on milk p r o d u c t i o n i n H o l s t e i n s . J . Anim. S c i . 59: 68. 26: G i l l , G.S. and A l l a i r e , F.R. 1976. Genetic and phenotypic parameters f o r a p r o f i t f u n c t i o n and s e l e c t i o n method f o r o p t i m i z i n g p r o f i t i n d a i r y c a t t l e . J . D a i r y S c i . 59: 132.5- 1333. BIBLIOGRAPHY 84 27: Goeke, C.L. and M c G i l l i a r d , L.D. 1978. Simulated d a i r y breeding breeding programs. Mimeo. Michigan State U n i v e r s i t y , East Lansing. 28: Golden, H.J., 1977. Mathamatical Modeling of B i o l o g i c a l Systems, John Wiley, New York. 29: Grossman, M. and Walter D. 1978. Teaching with i n t e r a c t i v e compute c a p a b i l i t i e s ( p l a t o : Computer based education f o r animal b r e e d i n g ) . J . D a i r y S c i . 61: 1308- 1311. 30: H a l l , A.D., and Fagen, R.E. 1956. D e f i n i t i o n of systems. General Systems 1: 18. 31: Hansen, L.B., Freeman, A.E. and Berger, P.J. 1983. Y i e l d and f e r t i l i t y r e l a t i o n s h i p s i n d a i r y c a t t l e . J . D a i r y S c i . 66: 293-305. 32: Harvey, W.R. 1969. Procedures used i n the g e n e r a t i o n of swine p o p u l a t i o n s on a computer f o r t e a c h i n g s e l e c t i o n p r i n c i p l e s . Mimeo. Ohio State U n i v e r s i t y , Columbus. 33: Henderson, C R . 1966. A s i r e e v a l u a t i o n method which accounts f o r unknown ge n e t i c and environmental t r e n d s , herd d i f f e r e n c e s , season, age e f f e c t s , and d i f f e r e n t i a l c u l l i n g . Proc. of Symp. on E s t i m a t i n g Breeding Values of D a i r y S i r e s and Cows. Washington, D.C 34: Heidhues, T. and Henderson, C R . 1961. Teaching s e l e c t i o n p r i n c i p l e s with herd records generated by an e l e c t o n i c computer. J . Anim. S c i . 20: 659-667. 35: H i l l e r s , J.K., Young, J.W., Freeman, A.E., and Dommerholt, J . 1979. E f f e c t s of milk composition and p r o d u c t i o n on the feed c o s t s of producing m i l k . J . D a i r y S c i . 62: 1662-1664. 36: Hocking, P.M., F o u l l e y , J.L., Petersen, P.H. , S c h u l t e , C. and Z a r n e c k i , A. 1983. Computer programs f o r teaching animal breeding and g e n e t i c s . L i v e s . Prod. S c i . 10: 589-599. 37: Hunt, M.S., Burnside, E.B., Freeman, M.G. and W i l t o n , J.W. 1974. Genetic gain from s i r e - s a m p l i n g and p r o v i n g programs vary i n d i f f e r e n t A.I. p o p u l a t i o n s i z e s . J . D a i r y S c i . , 57: 251-260. 38: Joandet, G.E. and T.C. C a r t w r i g h t . 1975. Modeling beef P r o d u c t i o n systems. J . Anim. S c i . ' 4 1 : 1238-1246. 39: Kennedy, B.W. 1984. S e l e c t i o n l i m i t s : Have they been reached with the d a i r y cow? Can. J . Anim. S c i . , 64: 207-215. 40: Keown, J.F., 1984. Peak milk i s key to e n t i r e l a c t a t i o n y i e l d . Hoards Dairyman, September 10, v. 129(17): 1041. BIBLIOGRAPHY 85 41: Koong, L . J . , Baldwin, R.L., and U l y a t t , M.J. 1978. The a p p l i c a t i o n of systems a n a l y s i s of mathematical modeling techniques to animal s c i e n c e r e s e a r c h . Symposium on the use of the computer i n animal s c i e n c e t e a c h i n g , r e s e a r c h and e x t e n t i o n . A.S.A.S. I l l i n o i s . pp. 9-19. 42: L a s l e y , J.F., 1972. Ge n e t i c s of L i v e s t o c k Improvement. P r e n t i c e - H a l l , Inc. Englewood C l i f f s , N.J. pp. 380-410. 43: Lane, W.G., Burnside, E.B., Freeman, M.G., Wi l t o n , J.W. and D r i v e r , H.C. 1973. Economics of progeny t e s t i n g programs f o r d a i r y c a t t l e . J . D a i r y S c i . , 56: 675-682. 44: L i n , C Y . and A l l a i r e , R.F. 1977. R e l a t i v e e f f i c i e n c y of s e l e c t i o n methods f o r p r o f i t i n d a i r y cows. J . Dai r y S c i . 60: 1970-1978. 45: Mao, I.L. 1978. Teaching methods i n amimal breeding: Teaching with s e l f - i n s t r u c t i o n a l modules. J . Dai r y S c i . 61: 1298-1302. 46: Matsoukas, J . and F a i r c h i l d , T.P. 1975. E f f e c t s of v a r i o u s f a c t o r s on r e p r o d u c t i v e e f f i c i e n c y . J . Dai r y S c i . 58: 540-547. 47: M c G i l l i a r d , M.L. and Edlund, D. 1979. D a i r y c a t t l e breeding s i m u l a t i o n program. Mimeograph. V i r g i n i a P o l y t e c h n i c and State U n i v e r s i t y , Blacksburg, V i r g i n i a , 24061, U.S.A. 4* 48: Morant, S.V. 1985. A s t o c h a s t i c model of the r e p r o d u c t i v e performance of d a i r y herds. J . a g r i c . S c i . , Camb. 104: 505- 512. - 49: N a t i o n a l Research C o u n c i l . 1978. N u t r i e n t requirements of d a i r y c a t t l e . 5th rev. ed. Nat. Res. C o u n c i l , Washington D.C. 50: Oltenacu, P.A. and Young, C.W. 1974. Genetic and f i n a n c i a l c o n s i d e r a t i o n s of progeny t e s t i n g programs i n an A.I. d a i r y c a t t l e p o p u l a t i o n . J . D a i r y S c i . , 57: 1245. 51: Pearson, R.E., and M i l l e r , R.H. 1981. Our Industry Today: Economic d e f i n i t i o n of t o t a l performance, breeding g o a l s , and breeding v a l u e s f o r d a i r y c a t t l e . J . D a i r y S c i . 64: 857-869. 52: Peterson, R.G. 1980. B r i t i s h Columbia D a i r y Herd Improvement data. Personal communication. 53: Pike, M.C. and H i l l , I.D. 1966. A l g o r i t h m 291. Logarithm of gamma f u n c t i o n . Comunications of the a s s o c i a t i o n f o r Computing machinery. 9: 684. 54: P i r c h n e r , F. 1978. Teaching-animal breeding i n Europe. Symposium: Teaching animal breeding. J . D a i r y S c i . 61: 1292- 1297. BIBLIOGRAPHY 86 55: Reimers, T.J., Smith, R.D., Newman, S.R. 1985. Management f a c t o r s a f f e c t i n g r e p r o d u c t i v e performance of d a i r y cows in the Northeastern United S t a t e s . J . D a i r y S c i . 68: 963-972. 56: Rounsavile, T.R., Oltenacu, P.A., M i l l i g a n , R.A., and Foote, R.H. 1979. E f f e c t s of heat d e t e c t i o n , conception r a t e , and c u l l i n g p o l i c y on r e p r o d u c t i v e performance i n d a i r y herds. J . D a i r y S c i . 62: 1435-1442. 57: Robertson, A. and Rendal, J.M. 1950. The use of progeny t e s t i n g with a r t i f i c i a l i n semination in d a i r y c a t t l e . J . G e n e t i c s 50: 21-30. 58: Rowlands, G.J., Lucey S. and R u s s e l l A.M. 1982. A comparison of d i f f e r e n t models of the l a c t a t i o n curve in d a i r y c a t t l e . Anim. Prod. 35: 135-144. 59: Schneider, F., S h e l f o r d , J.A., Peterson, R.G. and F i s h e r , L . J . 1981. E f f e c t s of e a r l y and l a t e breeding of d a i r y cows on r e p r o d u c t i o n and p r o d u c t i o n in c u r r e n t and subsequent l a c t a t i o n . J . D a i r y S c i . 64: 1996-2002. 60: Seykora, A.J., and McDaniel, B.T. 1983. H e r i t a b i 1 i t i e s and c o r r e l a t i o n s of l a c t a t i o n y i e l d s and f e r t i l i t y f o r h o l s t e i n s . J . D a i r y S c i . , 66: 1486-1493. 61: S h e l f o r d , J.A. 1982. Energy content of l o c a l f e e d s t u f f s . Personal communication. 62: S inger, R.N. and Pease, D. 1976. A comparison of d i s c o v e r y l e a r n i n g and guided i n s t r u c t i o n a l s t r a t e g i e s on motor s k i l l l e a r n i n g , r e t e n t i o n and t r a n s f e r e , Research Q u a r t e r l y . 47: 788-796. 63: Smith, R.D. 1982. C a t c h i n g the c y c l i n g cow. D a i r y Herd Management. 19(3): 8-11. 64: Smythe, R. and L o v a t t , K.F. 1979. A p p l i c a t i o n of the computer i n b i o l o g y t e a c h i n g : computer a s s i s t e d and computer managed l e a r n i n g . J . of B i o l . Educ., 13: 207-220. 65: T a y l o r , R.E., and Kauffman, R.G. 1983. Teaching animal s c i e n c e : Changes and c h a l l e n g e s . J . Anim. S c i . , Suppl. 2, 57: 171-196. 66: Thomas, R. and W i l l i a m , R.L. 1976. The e f f e c t s of model f i d e l i t y and c o mpetition i n an animal s e l e c t i o n s i m u l a t i o n on p r o f e s s i o n a l breeder's a t t i t u d e toward the s i m u l a t i o n . Iowa Sta t e J . of Res., 50: 363-370. 67: Van V l e c k , L.D. 1977. T h e o r e t i c a l and a c t u a l g e n e t i c progress i n d a i r y c a t t l e . Proc. I n t . Conf. Quant. Genet. 16-21 Aug. 1976. Iowa St a t e U n i v e r s i t y , Ames, Iowa. pp. 543- 567. BIBLIOGRAPHY 87 68: V e s l e y , J.A., M c a l l i s t e r , A.J., Lee, A.J., Bat r a , T.R., D a r i s s e , J.F.P., Roy, G.L., and Winter, K.A. 1983. E v a l u a t i o n of cow r e p r o d u c t i o n i n the p u r e l i n e foundation phase of the Canadian N a t i o n a l D a i r y C a t t l e Breeding P r o j e c t . J . Dairy S c i . , 66: 867-873. 69: W e s t e l l , R. 1980. Dai r y herd d i s p o s a l reasons. MSc. t h e s i s , U n i v e r s i t y of Guelph. 70: White, J.M., M c G i l l i a r d , M.L. and Vinson, W.E. 1978. Teaching with computer simulated herds. J . D a i r y S c i . 61: 1314-1317. 71: Whitmore, J.L., T y l e r , W.J., C a s s i d a , L.E. 1974. E f f e c t s of e a r l y postpartum breeding i n d a i r y c a t t l e . J . Anim. S c i . 38: 2. 72: Wilcox, C.J., Van Horn, H.H., H a r r i s , B., J r . , Head, H.H., M a r s h a l l , S.P., Thatcher, W.W., Webb and D.W., Wing, J.M. 1978. Large D a i r y Herd Management. U n i v e r s i t y Presses of F l o r i d a , G a i n e s v i l l e , pp. 13-51. 73: Willham, R.L. 1970. Beef Genetic S i m u l a t i o n Program. Copyright Iowa State U n i v e r s i t y , Ames. 74: Williamson, N.B., M o r r i s , R.S., Blood, D.C. and Cannon, CM. 1972. A study of oe s t r u s behavior and oe s t r u s d e t e c t i o n methods i n a l a r g e commercial d a i r y herd. R1. The r e l a t i v e e f f i c i e n c y of oe s t r u s d e t e c t i o n . Vet. Rec. 91: 50. 75: Wood, P.D.P. 1967. A l g a b r a i c model of the l a c t a t i o n curve i n C a t t l e . Nature, London. 216: 164-165. 76: Wood, P.D.P. 1968. F a c t o r s a f f e c t i n g p e r c i s t e n c y of l a c t a t i o n i n c a t t l e . Nature, London. 218: 894. 77: Wood, P.D.P. 1969. F a c t o r s a f f e c t i n g the shape of the l a c t a t i o n curve i n c a t t l e . Anim. Prod. 11: 307-316. 78: Wood, P.D.P. 1970. A note on r e p e a t a b i l i t y of parameters of the l a c t a t i o n curve i n c a t t l e . Anim. Prod. 12: 535-538. 79: Wood, P.D.P. 1976. A l g e b r a i c models of the l a c t a t i o n curves f o r milk, f a t , and p r o t e i n p r o d u c t i o n with estimates of seasonal v a r i a t i o n . Anim. Prod. 22: 35-40. 80: Wood, P.D.P. 1977. The biometry of l a c t a t i o n . J . a g r i c . S c i . Camb. 88: 333-339. 81: Wood, P.D.P. 1980. A note on the l a c t a t i o n curves of some h i g h - y i e l d i n g B r i t i s h F r i e s i a n cows. Anim. Prod. 30: 299-302. 8 8 Appendix A. FULL INSTRUCTIONS T h i s appendix gi v e s complete i n s t r u c t i o n s f o r running a s i m u l a t i o n f o r teaching or r e s e a r c h . The b a s i c steps are o u t l i n e d in f i g u r e 5.1 below. F i g u r e 5.1 SIMULATE ANOTHER YEAR yes MORE YEARS ? INITIALIZE & COMPILE PROGRAMS SET UP HERDS & AI UNIT SET MANAGEMENT DECISIONS & SIMULATE YEAR -1 4 UPDATE AI RECORDS & SWITCH FILES YEAR 0 yes no SET BREEDING DECISIONS & SIMULATE YEAR 0 no ^COMPILE DATA BASE STATISTICAL AND GRAPHICAL ANALYSIS INSTRUCTIONS 89 A l l the programs i n t h i s package are designed to be run from a t e r m i n a l by e n t e r i n g "RUN PROGRAM NAME". The user i s prompted f o r a l l input d e c i s i o n s i n one of three formats. (1) A l i s t of numbered op t i o n s f o l l o w e d by "OPTION ?" where the user i s to input the number of the op t i o n d e s i r e d . ( 2 ) A s i n g l e value asked f o r by "?" where the user i s to input one valu e . ( 3 ) A number of value s are asked f o r by "ENTER" where the user i s to input more than one value i n a l i n e . NOTE : The programs accept input i n "semi-free format" so that each value entered MUST be fol l o w e d by a comma. For complete sample input and output see appendix B1. 1: INITIALIZE AND COMPILE ALL PROGRAMS The s i m u l a t i o n package i n c l u d e s s i x programs. SETUP SIM.YEAR AI.UPD AIVIEW CR.DBASE STAT.ANAL (see Appendix C f o r flow c h a r t s and Appendix D f o r f u l l l i s t i n g s ) 1.1: I n i t i a l i z e a l l programs Parameters that d e s c r i b e the p o p u l a t i o n to be simulated (chapter 3 ) should be used to i n i t i a l i z e a l l programs. The v a r i a b l e names ( t a b l e s I - VII) can be found i n the REAL or INSTRUCTIONS 90 INTEGER statements i n the beginning of each program (Appendix D). The a p p r o p r i a t e values should be entered between the sla s h e s a f t e r the v a r i a b l e name. 1.2: Compile a l l programs The programs should be compiled'using the F o r t r a n compiler with the hig h e s t o p t i m i z a t i o n l e v e l . 2: SET UP HERDS AND AI UNIT 2.1: Create f i l e s A.I.S - f o r updated AI b u l l records A.I.P - f o r year o l d AI records DREC - f i r s t l a c t a t i o n records BUSE - b u l l use and conception records YSIRE - p o t e n t i a l young s i r e s SUMS - to s t o r e y e a r l y summaries CODES - to s t o r e herd codes CHECK.RUN - to check i f herds have been run G*.SAV G*.IN G*.OUT - automated groups of herds s t a t u s * = 100, 200, 300, or 400 H*.SAV H*.IN H*.OUT - student herds * = 1 - 100 * .SAV - past year s t a t u s * .IN - c u r r e n t year s t a t u s * .OUT - end of year s t a t u s H*-* - Batch f i l e f o r p r i n t i n g students f u l l outputs 2.2: Run SETUP T h i s program prompts the user f o r the herd s i z e , AI u n i t s i z e , number of herds and the number of students (Appendix INSTRUCTIONS 91 B1). I t generates a l l cows and AI b u l l s and f i l l s the f i l e s A.I.S, G*.IN, H*.IN and CODES. 3: SIMULATE A YEAR T h i s only i n v o l v e s running the program SIM.YEAR (appendix B1) The program reads the herd s t a t u s from the herd .IN f i l e and the AI b u l l s from A.I.S . I t outputs f i r s t l a c t a t i o n r ecords to DREC, b u l l use and conceptions to BUSE, s e l e c t e d b u l l c a l v e s to YSIRE, year end summaries to SUMS and herd s t a t u s to the herd .OUT f i l e . If d e s i r e d i t a l s o p r i n t s a d e t a i l e d year end summary f o r the herd and f u l l year performance f o r a l l cows (appendix B2). 3.1: I n i t i a l y e a r s , For two p r e p a r a t o r y years and "0" (can set more, t a b l e VII) both student and group herds are run i n a semi- automated ( o p t i o n 1 - NO p r i n t e d copy) mode to allow b a s i c ' breeding and management o p t i o n s to be set and to allow students to become f a m i l i a r with the program. (1) The user i s prompted f o r a herd number and code which ensures a g a i n s t a c c i d e n t a l running of the wrong herd. Student herds are numbered 1-100 and group herds 101, 201, 301 and 401. Codes can be found i n the f i l e CODES. (2) The main o p t i o n menu i s d i s p l a y e d . For year only o p t i o n s 2-5 should be changed. When o p t i o n 7 (CONTINUE) i s entered the program executes with no f u r t h e r menus or prompts. INSTRUCTIONS 92 (3 ) B e f o r e r u n n i n g y e a r " 0 " management and b r e e d i n g p o l i c i e s s h o u l d be d e c i d e d upon and major d e c i s i o n o p t i o n s s e t . S t u d e n t h e r d s s h o u l d s e t o p t i o n 1 t o " o u t p u t p r i n t e d c o p y " . 3.2: L a t e r y e a r s Summaries of a l l h e r d s f o r y e a r s 1 and on a r e s a v e d f o r t h e f i n a l a n a l y s i s . (1) C o n t r o l h e r d s s h o u l d be run i n t h e f u l l y a u t o m a t e d mode. When prompted f o r h e r d and c o d e , t h e h e r d and code a r e e n t e r e d f o l l o w e d by a "T". A l l menus a r e t h e n b y p a s s e d and no p r i n t e d o u t p u t i s g e n e r a t e d . (2) S t u d e n t h e r d s s h o u l d be run w i t h t h e f u l l o u t p u t o p t i o n (s e e a p p e n d i x B1 f o r a sample r u n ) . (a) The main menu i s d i s p l a y e d t o a l l o w o p t i o n s t o be c h a n g e d o r f i n e t u n e d . (b) A sub-menu i s d i s p l a y e d t o a l l o w c u l l i n g or m a t i n g o f s p e c i f i c a n i m a l s . (c) Cows t o be c u l l e d f o r low i n d e x s c o r e a r e l i s t e d on t h e s c r e e n t o a l l o w c h a n g e s t o be made b e f o r e t h e y e a r e n d s . (d) H e r d summaries f o r t h e y e a r a r e i m m e d i a t e l y l i s t e d on t h e s'creen f o r i n s p e c t i o n . (e) The d e t a i l s of t h e h e r d s p e r f o r m a n c e f o r t h e y e a r and t h e h e r d summaries a r e o u t p u t t e d t o t h e H*-* b a t c h f i l e f o r p r i n t i n g ( a p p e n d i x B 2 ) . 4: U P D A T E A I AND SWITCH F I L E S A f t e r a l l h e r d s have c o m p l e t e d a y e a r t h e AI f i l e must INSTRUCTIONS 9 3 be updated with the i n f o r m a t i o n on the b u l l use and h i s dauaghters f i r s t l a c t a t i o n records and the new young b u l l s . The updated AI b u l l s can then be looked at using the program AIVIEW. Herd f i l e s must a l s o be switched before running the next year. 4 . 1 : AI UPDATE (1) F i l e s DREC and BUSE must be s o r t e d by b u l l number and the c u r r e n t AI f i l e (A.I.S) must be c o p i e d to the o l d AI f i l e (A.I.P). These o p e r a t i o n s can be s i m p l i f i e d by using a batch f i l e . (2) Run the program AI.UPD . T h i s program prompts the user fo r the number of new young s i r e s to s e l e c t and an index by which to choose them (appendix B1). The program a u t o m a t i c a l l y reads i n the p o t e n t i a l young s i r e s from a l l herds (YSIRE), the new f i r s t l a c t a t i o n records (DREC), the number of v i a l s of semen used and the number of conceptions f o r each b u l l (BUSE). I t then c a l c u l a t e s new estimates of t r a n s m i t t i n g a b i l i t y and f e r t i l i t y and a new semen p r i c e f o r each b u l l and adds new young b u l l s . The updated AI b u l l s are then w r i t t e n to the A.I.S f i l e f o r the next year. 4 . 2 : AIVIEW Students can look at the b u l l s a v a i l a b l e to prepare f o r the s i m u l a t i o n of the next year by running the program AIVIEW. T h i s program prompts the user f o r t h e i r own s e l e c t i o n index (appendix B1). I t then c a l c u l a t e s the index INSTRUCTIONS 9 4 score for a l l si r e s and l i s t s them on the screen in order of index score. It also includes th e i r ETA's for the four t r a i t s and the number of daughters on which i t i s based, their s i r e and maternal grandsire, their estimated conception rate and their semen price. 4 . 3 : SWITCH FILES The herd f i l e s must be switched before simulating the next year. A "BATCH" f i l e can be set up to copy **.IN f i l e s to temporary save f i l e s (**.SAV) and **.OUT f i l e s to **.IN f i l e s and then to empty **.OUT f i l e s . The f i l e s YSIRE, DREC and BUSE should also be emptied. 5: COMPILE DATA BASE The program CR.DBASE copies the herd-year summaries in SUMS and the l i s t of the information stored to new f i l e s which can be accessed quickly for analysis. (1 ) Before compiling the program check that the program variable TSUM i s dimensioned with the number of years and number of herds in the simulation run. (2) Create f i l e s SUMMARIES and VARIABLES to receive the new information and run CR.DBASE . 6: ANALYSIS Run the program STAT.ANAL . This interactive program does the f i n a l data summary and s t a t i s t i c a l a nalysis. It is designed to allow the user to group INSTRUCTIONS 95 herds as treatment groups and t e s t f o r d i f f e r e n c e s i n the means or the changes over time (slopes) f o r the summary v a r i a b l e s ( t a b l e IX). I t does an a n a l y s i s of c o v a r i a n c e with years as the c o v a r i a t e , t e s t s f o r d i f f e r e n c e s i n means or s l o p e s w i t h i n groups ( t e s t i f herds should be grouped together) and between groups and does a Student Knewman Keuls t e s t (SNK) where s i g n i f i c a n t d i f f e r e n c e s in s l o p e s or means are found. The program a l s o allows l i m i t e d a r i t h m e t i c o p e r a t i o n s to be performed on the on the summary v a r i a b l e s ( t a b l e IV) f o r more e x t e n s i v e a n a l y s i s . The program reads v a r i a b l e names and numbers from the f i l e VARIABLES and data from SUMMARIES. T i t l e s and s p e c i f i c a t i o n s are entered i n t e r a c t i v e l y . The s t a t i s t i c a l a n a l y s i s i s w r i t t e n to a s p e c i f i e d herds f i l e and a l l data used i s w r i t t e n to a f i l e -DAT. Fu r t h e r a n a l y s i s can be done using the data i n -DAT with other s t a t i s t i c a l or g r a p h i c s programs. These a n a l y s i s can be done more economically by f i r s t down l o a d i n g -DAT to a microcomputer. Table IX 1. NO CMPLT. LACT. BEF. CULL 2. BC HERD AVG. MILK (KG) 3. BC HERD AVG. FAT (KG) 4. BC HERD AVG. PROTEIN (KG) 5. BC AVG. BCA MILK 6. BC AVG. BCA FAT 7. BC AVG. BCA PROTEIN 8. BC AVG. TYPE SCORE 9. BC AVG. AGE 10. BC AVG. DAYS MILKED 11 . BC AVG. % FAT 12. BC AVG. % PROTEIN 13. NO CMPLT. LACT. AFTER CULL 14. AC HERD AVG. MILK(KG) 15. AC HERD AVG. FAT (KG) 1G. AC HERD AVG. PROTEIN (KG) 17. AC AVG. BCA MILK 18. AC AVG. BCA FAT 19. AC AVG. BCA PR0TIEN 20. AC AVG. BCA TYPE SCORE 21. AC AVG. AGE 22. AC AVG. DAYS MILKED 23. AC AVG. % FAT 24. AC AVG. % PROTEIN 25. CALVING INTERVAL 26. CONCEPTION RATE 27. TOTAL HECTOLITRES MILK 28. FAT TEST 29. PROTEIN TEST 30. TOTAL QUOTA MILK (HL) 31. PRICE QUOTA MILK ($/HL) 32. PAID QUOTA MILK ($) 33. TOTAL EXCESS MILK (HL) 34. PRICE EXCESS MILK ($/HL) 35. PAID EXCESS MILK ($) 36. TOTAL SURPLUS MILK (HL) 37. FIXED COSTS 38. FEED COST FOR COWS 39. FEED COST FOR YEARLINGS 40. FEED COST FOR CALVES 55. NO. LIVE COWS 56. LIVE COWS B.V MILK 57. LIVE COWS B.V. FAT 58. LIVE COWS B.V. PROTEIN 59. LIVE COWS B.V. TYPE 60. NO. BRED HEIFERS 61. BRED HEIF. B.V. MILK 62. BRED HEIF. B.V. FAT 63. BRED HEIF. B.V. PROTEIN 64. BRED HEIF. B.V. TYPE 65. NO. FERTILITY CULLS 66. FERT. CULL B.V. MILK 67. FERT. CULL B.V. FAT 68. FERT. CULL B.V. PROTEIN 69. FERT. CULL B.V. TYPE 70. NO. CULLED BY LAST LACT. 71. LACT. CULL B.V. MILK 72. LACT. CULL B.V. FAT 73. LACT. CULL B.V. PROTEIN 74. LACT. CULL B.V. TYPE 75. NO. CULLED BY EPA 76. EPA CULL B.V. MILK 77. EPA CULL B.V. FAT 78. EPA CULL B.V. PROTEIN 79. EPA CULL B.V. TYPE 80. NO. CULLED BY ETA 81. ETA CULL B.V. MILK 82. ETA CULL B.V. FAT 83. ETA CULL B.V. PROTEIN 84. ETA CULL B.V. TYPE 85. NO. CULLED FOR HEALTH 86. HTH. CULL B.V. MILK 87. HTH. CULL B.V. FAT 88. HTH. CULL B.V. PROTEIN 89. HTH. CULL B.V. TYPE 90. NO. DEAD COWS 91. DEAD COWS B.V. MILK 92. DEAD COWS B.V. FAT 93. DEAD COWS B.V. PROTEIN 94. DEAD COWS B.V. TYPE 109. DEAD YLGS. B.V. TYPE 110. NO. LIVE HEIFER CALVES 111. LIVE CALVES B.V. MILK 112. LIVE CALVES B.V. FAT 113. LIVE CALVES B.V. PROTEIN 114. LIVE CALVES B.V. TYPE 115. NO. SOLD HEIFER CALVES 116. SOLD H. CF. B.V. MILK 117. SOLD H. CF. B.V. FAT 118. SOLD H. CF. B.V. PROTEIN 119. SOLD H. CF. B.V. TYPE 120. NO. SOLD BULL CALVES 121. SOLD B. CF. B.V. MILK 122. SOLD B. CF. B.V. FAT 123. SOLD B. CF. B.V. PROTEIN 124. SOLD B. CF. B.V. TYPE 125. NO. DEAD CALVES 126. DEAD CALVES B.V. MILK 127. DEAD CALVES B.V. FAT 128. DEAD CALVES B.V. PROTEIN 129. DEAD CALVES B.V. TYPE 130. NO. A.I. PROSPECTS 131. PROSP. A.I. B.V. MILK 132. PROSP. A.I. B.V. FAT 133. PROSP. A.I. B.V. PROTEIN 134. PROSP. A.I. B.V. TYPE 135. PROVEN SIRES B.V. MILK 136. PROVEN SIRES B.V. FAT 137. PROVEN SIRES B.V. PROTEIN 138. PROVEN SIRES B.V. TYPE 139. PROVEN SIRES NO. VIALS USED 140. PROVEN SIRES NO. CONCEPTIONS 141. PROVEN SIRES FERTILITY 142. PROVEN SIRES SEMEN PRICE 143. UNPROVEN SIRES B.V. MILK 144. UNPROVEN SIRES B.V. FAT 145. UNPROVEN SIRES B.V. PROTEIN 146. UNPROVEN SIRES B.V. TYPE 147. UNPROVEN SIRES NO. VIALS 148. UNPROVEN SIRES NO. CONCEPT. Table IX continued 41. SEMEN COSTS 42. COST SHIPPING MILK 43. TOTAL EXPENSES 44. SOLD - PRODUCTION ($) 45. SOLD - FERTILITY ($) 46. SOLD - HEALTH ($) 47. SOLD - DEAD COWS ($) 48. SOLD - YEARLINGS ($) 49. SOLD - 1 YEAR CALVES ($) 50. SOLD - HEIFER CALVES ($) 51. SOLD - BULL CALVES ($) 52. SOLD - A.I. STUD ($) 53. TOTAL INCOME 54. NET INCOME 95. NO. LIVE YEARLINGS 149. UNPROVEN SIRES FERTILITY 96. LIVE YLGS. 8.V. MILK 150. UNPROVEN SIRES SEMEN PRICE 97. LIVE YLGS. B.V. FAT 151 . YOUNG SIRES B.V. MILK 98. LIVE YLGS. B.V. PROTEIN 152. YOUNG SIRES B.V. FAT 99. LIVE YLGS. B.V. TYPE 153. YOUNG SIRES B.V. PROTEIN 100. NO. SOLD YEARLINGS 154. YOUNG SIRES B.V. TYPE 101. SOLD YLGS. B.V. MILK 155. YOUNG SIRES NO. VIALS 102. SOLD YLGS. B.V. FAT 156. YOUNG SIRES NO. CONCEPTIONS 103. SOLD YLGS. B.V. PROTEIN 157. YOUNG SIRES FERTILITY 104. SOLD YLGS. B.V. TYPE 158. YOUNG SIRES SEMEN PRICE 105. NO. DEAD YEARLINGS 159. SELECTION INDEX WT. MILK 106. DEAD YLGS. B.V. MILK 160. SELECTION INDEX WT. FAT 107. DEAD YLGS. B.V. FAT 161 . SELECTION INDEX WT. PROTEIN 108. DEAD YLGS. B.V. PROTEIN 162. SELECTION INDEX WT. TYPE 98 Appendix Bl SAMPLE RUN This appendix gives the input and output to the screen for sample interactive runs for a l l programs. Program output - CAPITAL LETTERS User input - BOLDFACE Annotations - i t a l i c s I: PROGRAM "SETUP" #RUN SETUP #Execution begins ENTER THE NUMBER OF STUDENTS AND THE NUMBER OF HERDS EACH (MAXIMUM 100 STUDENT HERDS) THE NUMBER OF CONTROL GROUPS (MAXIMUM 4), THE NUMBER OF COWS PER HERD (MAXIMUM 150) THE NUMBER OF YOUNG BULLS TO ADD EACH ¥EAR (AND AN INTEGER SEED - OPTIONAL) 12,1,1,30,3, ENTER THE NUMBER OF COWS -OF EACH AGE 2-7 9 7 5 4 3 2 12'sTUDENTS 1 HERDS/STUDENT 30 COWS/HERD 1 REPLICATE GROUPS 3 BULLS 929 SEED AGE DISTRIBUTION 2 3 4 5 6 7 9 7 5 4 3 2 ENTER "T" IF ERROR OR RETURN IF OK RETURN #Execution terminated The herds and AI unit are now setup ready to run the simulation SAMPLE RUN 99 2: PROGRAM "SIM. YEAR" FULL OUTPUT MODE #RUN SIM.YEAR #Execution begins DAIRY CATTLE BREEDING SIMULATION YOU WILL BE PROMPTED FOR DECISIONS - ENTER ALL VALUES ON ONE LINE (EXCEPT WHEN ENTERING ANIMALS) - WHEN ENTERING ANIMALS START A NEW LINE FOR EACH ANIMAL - EACH VALUE ENTERED MUST BE FOLLOWED BY A COMMA ! ! HERD NUMBER AND CODE ? 11,500, HERD 11 SIMULATION OF YEAR 9 MANAGEMENT DECISIONS SELECTED MAIN MENU 1 OUTPUT PRINTED COPY OF HERDS ? NO 2 MANAGEMENT LEVEL OF 1 RANKING AND CULLING BASED ON: ETA 3 WEIGHTINGS FOR THE SELECTION INDEX : MILK 0.50 FAT 0.50 PROTEIN 0.0 TYPE 0.0 4 NUMBER OF DAYS OPEN OR SERVICES : 130. DAYS OR 4. SERVICES WITH EXTRA FOR THE TOP 12. COWS BASED ON AN EXPONENT 1.000 AN ADJUSTMENT FOR DAYS 10.00 AND AN ADJUSTMENT FOR SERVICES 0.300 5 MINIMUM DAILY MILK PRODUCTION: AT 7.0 KG/DAY A COW IS DRIED OFF AT 12.0 KG/DAY A CULL COW IS SOLD 6 MATINGS- 70% TO 5 PROVEN SIRES SELECTED BY RANK 30% TO 3 YOUNG SIRES SELECTED RANDOMLY SPECIAL MATE 10 COWS SELECTED BY RANK MAXIMUM SEMEN PRICE $ 500/VIAL MINIMUM CONCEPTION 20% 7 CONTINUE OPTION ? ENTERING 1-6 PRODUCES SUB-MENUS TO ALLOW OPTIONS TO BE CHANGED 1, option I sub-menu THE OUTPUT TO BE 1 FULL PRINTED OUTPUT 2 ONLY SUMMARIES STORED OPTION ? 1, THE RANDOM NUMBER GENERATORS TO BE INITIALIZED WITH 1 A NUMBER TO BE SPECIFIED 2 A RANDOM NUMBER OPTION ? 1, 2, opt i on 2 sub-menu MANAGEMENT LEVEL ? 1, SAMPLE RUN 1 0 0 CULLING DECISIONS TO BE BASED ON 1 CURRENT LACTATION 2 ESTIMATED PRODUCING A B I L I T Y 3 ESTIMATED TRANSMITTING A B I L I T Y OPTION ? 3, 3, option 3 sub-menu ENTER THE SELECTION INDEX WEIGHTS FOR MILK , F A T , PROTEIN, AND TYPE 5,5,0,0 4, opt i on 4 sub-menu ENTER THE MINIMUM NUMBER OF DAYS AND SERVICES AND THE NUMBER OF TOP COWS TO KEEP LONGER 130,4,12, 130 days, 4 services, 12 cows PRESS RETURN FOR TWO L E V E L S OR ENTER THE EXPONENT FOR AN EXPONENTIAL RELATIONSHIP 1, gives linear relationship ADJUSTMENT FOR DAYS ? 10, e-g. 10 extra for 11th ranked and 110 extra for top cow ADJUSTMENT FOR SERVICES ? 0.3, 1 extra service for top 8 cows, 2 for top 5 and 3 for top 2 5, opt i on 5 sub-menu DAILY MILK PRODUCTION AT WHICH TO DRY OFF A COW ? 7 . , DAILY MILK PRODUCTION AT WHICH TO S E L L A COW SELECTED FOR CULLING ? 12., 6, option 6 sub-menu NUMBER OF PROVEN SIRES ? 5, ENTER THE METHOD OF SELECTION 1 INDIVIDUALLY 2 BY RANK 3 RANDOMLY OPTION ? 2, MAXIMUM SEMEN PRICE ? 500, dollars MINIMUM CONCEPTION RATE ? 20, percent PERCENT OF MATINGS TO YOUNG SIRES ? 30, NUMBER OF YOUNG BULLS ? 3, ENTER THE METHOD OF SELECTION (for young bulls) 1 BY RANK 2 RANDOMLY OPTION ? 2, SAMPLE RUN 10 NUMBER OF S P E C I A L MATINGS ? for potential young sires 10, ENTER THE METHOD OF SELECTION 1 INDIVIDUALLY 2 BY RANK OPTION ? 2, NUMBER OF TOP BULLS TO USE FOR S P E C I A L MATINGS ? 2, 7, option 7 CONTINUE PROGRAM CONTINUES INTEGER SEED ? prompts for seed if selected in option 1 875, special selections menu for full output herds OTHER OPTIONS FOR S P E C I F I C ANIMALS 1 MAKE S P E C I F I C MATINGS 2 S E L L WEEK OLD CALVES 3 S E L L YEAR OLD CALVES 4 S E L L YEARLINGS 5 CONTINUE OPTION ? options 1-4 give sub-menus and prompts 1, opt i on I BULLS A V A I L A B L E bulls selected to be used 9039 9036 9002 9006 9023 9049 9049 9049 NUMBER OF INDIVIDUAL MATINGS ? 2, ENTER 2 COWS EACH FOLLOWED BY A BULL START A NEW L I N E FOR EACH ANIMAL ! 1,9039, 2,9006, 1 9039 check if enl ri es correct 2 9006 PRESS RETURN I F OK. ENTER " T " TO RE-ENTER RETURN 2, opti on 2 BULLS A V A I L A B L E 9039 9036 9002 9006 9023 9049 9049 9049 NUMBER OF NEW CALVES TO BE CULLED ? 1, ENTER 1 COWS START A NEW L I N E FOR EACH ANIMAL ! 3, 3 PRESS RETURN I F OK. ENTER "T" TO RE-ENTER RETURN ENTER A CHEAP BULL TO USE ON THESE COWS 9049, SAMPLE RUN 1 Q 3 , opt i on 3 NUMBER OF OLD CALVES TO BE CULLED ? 2, ENTER 2 YEAR OLD CALVES START A NEW L I N E FOR EACH ANIMAL ! 101, 102, 101 1 02 PRESS RETURN I F OK. ENTER "T" TO RE-ENTER RETURN 4 , option 4 NUMBER OF YEARLINGS TO BE CULLED ? 1, ENTER 1 YEARLINGS START A NEW L I N E FOR EACH ANIMAL ! 201, 201 PRESS RETURN I F OK. ENTER "T" TO RE-ENTER RETURN 5 , CONTINUE 2. 1. 1. CulIing cows In full out put mode t he cows queued t o be culIed are Iis I and an opport unit y t o c hange t hem is gi ven COWS TO BE CULLED CULL INDEX SCORES MAX ACT LOC COW DAY LACT EPA ETA PROD . PROD STATUS 1 . 1112 . 7 9 . - 1 9 . - 1 1 . - 4 . 6 1 7 9 . B 9 5 . ETA 2. 1213. 137 . - 1 9 . - 8 . - 3 . 6 9 7 9 . 1884. ETA 3 . 1313 . 142 . 3 . - 3 . - 2 . 7 1 7 7 . 2 1 7 6 . ETA 4 . 1513 . 161 . - 7 . - 7 . - 2 . 541 1 . 3 1 7 8 . ETA 5 . 1608 . 5 9 . -21 . - 9 . - 2 . 6 5 0 0 . 9 2 6 . ETA 6 . 1412 . 0 . -21 . - 8 . - 2 . 6 1 6 2 . 6 1 6 2 . KEEP 7 . 1206 . 0 . - 7 . - 3 . - 2 . 6 6 0 7 . 6 6 0 7 . KEEP 8 . 1510 . 0 . - 1 3 . - 9 . - 2 . 6 9 1 4 . 6 9 1 4 . KEEP 9 . 1312 . 190 . - 7 . - 6 . - 2 . 3 1 1 0 . 31 10 . FERT 10 . 1615 . 0 . 0 . 0 . -1 . 5 1 7 6 . 5 1 7 6 . KEEP 1 1 . 1607 . 0 . - 2 0 . - 9 . -1 . 6 0 0 3 . 6 0 0 3 . KEEP 12 . 1707 . 0 . 0 . 0 . -1 . 3 . 3 . KEEP WHERE: LOC - cows location number in cull list COW - cows I.D. number CULL DAY - if positive it is the day of the year culled if zero the cow is not to be culled if negative it is the day in the next year that the cows production will have declined to the specified daily production to allow culIi ng LACT - deviation from the populat i on average for the index score calculated from the BCA' s and type score in t he Iasl I act at i on EPA - the index score calculated from the cows EPA' s ETA - the index score calculated from the cows ETA's SAMPLE RUN i Q 3 for production MAX PROD - years production for a cow if not culled ACT PROD STATUS - - years i n s l at us KEEP FERT HLTH DEAD BCA EPA ETA production if no changes are made st at us of a cow at year end cow kept in the herd cow culled for fertility (can't keep) cow culled for health (can't keep) cow is dead culled for low rank " LACT" culled for low rank " E P A " culled for low rank " E T A " YOUR F L U I D QUOTA IS 1500 . HL PLUS EXCESS OF 500 . THIS YEARS PRODUCTION WILL BE 1 9 6 7 . 8 HECTOLITRES ENTER OPTION\? 1 TO PRINT A LONGER L I S T 2 TO CULL MORE COWS 3 TO RESTORE S E L E C T I V E L Y CULLED COWS 4 TO CONTINUE 1, " \ option I HOW MANY MORE COWS DO YOU WANT PRINTED ? 1, outputs list with 1 more cow 2, option 2 NUMBER OF COWS TO CHANGE ? 2, COW LOCATION NUMBER ? 13, COW 6, LOCATION NUMBER t he two cows are culled if possible cow 1412 at location 6 is now culled cow 1613 at location 13 has too high daily production until the 4th day of the next year COWS TO BE CULLED CULL INDEX SCORES MAX ACT LOC COW DAY LACT EPA ETA PROD PROD STATUS 1 . 1112. 7 9 . - 1 9 . - 1 1 . - 4 . 6 1 7 9 . 8 9 5 . ETA 6 . 1412 . 171 . -21 . - 8 . - 2 . 6 1 6 2 . 3 3 8 7 . ETA 1 3 . 1613 . - 4 . 0 . 0 . -1 . 4 6 8 9 . 4 6 8 9 . KEEP YOUR F L U I D QUOTA IS 1500 . HL PLUS EXCESS OF 5 0 0 . THIS YEARS PRODUCTION WILL BE 1 9 4 0 . 9 HECTOLITRES ENTER - OPTION ? TO TO TO TO 3, PRINT A LONGER L I S T CULL MORE COWS RESTORE S E L E C T I V E L Y CULLED COWS CONTINUE option 3 NUMBER OF COWS TO CHANGE ? 1. COW LOCATION NUMBER ? 6, SAMPLE RUN 1 04 cow number 1412 is now reinstated and the l i s t is out put led again 4, opt i on 4 the simulation now continues by outputling the end of year herd summary on the screen and all herd information to a f i l e for printing (appendix B2) 2. 2: SEMI-AUTOMATED MODE R S I M . T E A R # E x e c u t i o n b e g i n s DAIRY CATTLE BREEDING SIMULATION YOU WILL BE PROMPTED FOR DECISIONS - ENTER A L L VALUES ON ONE L I N E (EXCEPT WHEN ENTERING ANIMALS) - WHEN ENTERING ANIMALS START A NEW L I N E FOR EACH ANIMAL - EACH VALUE ENTERED MUST BE FOLLOWED BY A COMMA ! ! HERD NUMBER AND CODE ? 11,500, HERD 11 SIMULATION OF YEAR 9 MAIN MENU SELECTIONS MANAGEMENT DECISIONS SELECTED 1 OUTPUT PRINTED COPY OF HERDS ? YES 2 MANAGEMENT L E V E L OF 1 RANKING AND CULLING BASED ON: ETA 3 WEIGHTINGS FOR THE SELECTION INDEX : MILK "0.50 FAT 0 . 5 0 PROTEIN O'.O TYPE 0 . 0 4 NUMBER OF DAYS OPEN OR SERVICES : 130. DAYS OR 4 . SERVICES WITH EXTRA FOR THE TOP 12. COWS BASED ON AN EXPONENT 1.000 AN ADJUSTMENT FOR DAYS 10 .00 AND AN ADJUSTMENT FOR SERVICES 0 . 3 0 0 5 MINIMUM DAILY MILK PRODUCTION: AT 7 . 0 KG/DAY A COW IS DRIED OFF AT 1 2 . 0 KG/DAY A CULL COW IS SOLD 6 MATINGS- 70% TO 5 PROVEN SIRES SELECTED BY RANK 30% TO 3 YOUNG SIRES SELECTED RANDOMLY S P E C I A L MATE 10 COWS SELECTED BY RANK MAXIMUM SEMEN PRICE $ 500/VIAL MINIMUM CONCEPTION 20% 7 CONTINUE OPTION ? SEMI-AUTOMATED MODE IS SET BY ENSURING OPTION 1 IS SET TO "ONLY SUMMARIES STORED" 1, option 1 sub-menu THE OUTPUT TO BE 1 F U L L PRINTED OUTPUT 2 ONLY SUMMARIES STORED OPTION ? 2, allows all other menus to be bypassed SAMPLE RUN 105 THE RANDOM NUMBER GENERATORS TO BE I N I T I A L I Z E D WITH 1 A NUMBER TO BE S P E C I F I E D 2 A RANDOM NUMBER OPTION ? 2, WHEN OPTION 7 IS ENTERED THE PROGRAM COMPLETES EXECUTION OPTION ? 7, CONTINUE HERD 11 YEAR 7 THE SEED WAS 182 NO. LAC CF INT CONC SV/CF NLCW NBHF HL MLK NPRCUL NFCUL 37 3 6 3 . 9 0 . 4 9 5 1 .545 33 6 2 1 0 8 . 15 5 # E x e c u t i o n t e r m i n a t e d 2.3: FULLY AUTOMATED MODE #R SIM.YEAR # E x e c u t i o n b e g i n s DAIRY C A T T L E BREEDING SIMULATION YOU WILL BE PROMPTED FOR DECISIONS - ENTER A L L VALUES ON ONE L I N E (EXCEPT WHEN ENTERING ANIMALS) - WHEN ENTERING ANIMALS START A NEW L I N E FOR EACH ANIMAL - EACH VALUE ENTERED MUST BE FOLLOWED BY A COMMA ! ! HERD NUMBER AND CODE ? ENTERING A "T"AFTER THE CODE ALLOWS ALL MENUS TO BE BYPASSED 11,500,T HERD 11 YEAR 7 THE SEED WAS 182 NO. LAC CF INT CONC SV/CF NLCW NBHF HL MLK NPRCUL NFCUL 37 3 6 3 . 9 0 . 4 9 5 1 .545 33 6 2 1 0 8 . 15 5 # E x e c u t i o n t e r m i n a t e d 3 : YEAR END UPDATE #ED CHECK.RUN To check if all student herds have been run year herd P / F 0.001 7 1 0 . 0 0 2 7 2 7 7 0 . 0 1 2 7 12 STOP SAMPLE RUN 106 RUN BATCH FILE TO SWITCH HERD AND AI FILES AND TO SORT DREC and BUSE #R BATCH SCARDS BUPD # E x e c u t i o n b e g i n s =The b a t c h s i g n o n r e c o r d i s : =$SIG KINN 'SORT FOR AIUPD' DELIVERY=FOR. = E n t e r p a s s w o r d f o r K I N N . =*BATCH* a s s i g n e d j o b number 19771B =*BATCH* RM197718 r e l e a s e d COMMENT="SORT FOR AIUPD" DELIVERY=FOR. -KINN:RM197718 i s e x e c u t i n g . # E x e c u t i o n t e r m i n a t e d #C CHECK.RUN(1,1) >FILES READY TO RUN "AIUPD" 3 . 2 : PROGRAM "AIUPD" #RUN AIUPD # E x e c u t i o n b e g i n s ENTER THE CURRENT YEAR (NEXT) 8 , ENTER THE NUMBER OF BULLS TO ADD, THE MINIMUM INDEX, THE MINIMUM ETA FOR TYPE AND THE DAMS MINIMUM ETA FOR TYPE 3, three bulls and minimum index and type of "0" ENTER SELECTION INDEX WEIGHTINGS FOR MILK, F A T , PROTEIN AND TYPE 5 , 5 , # E x e c u t i o n t e r m i n a t e d 3 . 2 : PROGRAM "AIVIEW" #RUN AIVIEW # E x e c u t i o n b e g i n s ENTER INDEX WEIGHTINGS FOR MILK, F A T , PROTEIN AND TYPE THEY MUST NOT SUM TO " 0 " 5 , 5 , ENTER: "Y" FOR YOUNG SIRES OR "P" FOR PROVEN SIRES OR RETURN TO STOP P HOW MANY SIRES DO YOU WANT L I S T E D ? MAXIMUM 39 39, ETA BULL SIRE MGS MILK FAT PROT 9 0 3 9 . 9 0 0 2 . 0 . 5.1 9 . 9 3.1 9036 . 9 0 0 2 . 0 . 5 .7 6 . 3 1.7 9 0 0 2 . 0 . 0 . 3 . 9 7 . 0 3 . 9 9 0 3 2 . 9 0 2 0 . 0 . - 3 . 5 - 4 . 4 - 2 . 1 9 0 2 0 . 0 . 0 . - 3 . 8 - 4 . 8 - 1 . 3 CONCEP- NO. NO. SEMEN TYPE INDEX TION DAU. HERDS PRICE - 0 . 6 7 . 5 0 . 5 6 2 0 . 13 . 23 .51 - 0 . 4 6 . 0 0 . 4 8 2 0 . 14. 2 3 4 . 7 8 - 1 . 7 5 . 5 0 . 5 4 3 2 6 . 109 . 1 0 5 . 5 5 0.1 - 3 . 9 0 . 5 0 3 3 . 19 . 16 .34 1.2 - 4 . 3 0 . 5 3 1 15. 41 . 1 5 . 6 9 SAMPLE RUN 107 ENTER: "Y" FOR YOUNG SIRES OR "P" FOR PROVEN SIRES OR RETURN TO STOP Y ETA CONCEP- NO. NO. SEMEN BULL S I R E MGS MILK FAT PROT TYPE INDEX TION DAU. HERDS PRICE 9 0 4 0 . 9006 0 . 5.1 5 .2 2 .4 0 . 3 5.1 15 .00 9041 . 9002 0 . 2.4 4 .2 2. 1 0.1 3 .3 15 .00 9 0 4 2 . 9019 0 . 2 .0 4 .4 2 .6 0 . 3 3 .2 1 5 .00 9051 . 9006 0 . 4 . 7 5 .0 2 .2 0 . 2 4 .8 15 .00 ENTER: it y it FOR YOUNG SIRES OR "P" : FOR PROVEN SIRES OR RETURN TO STOP # E x e c u t i o n t e r m i n a t e d 3 . 4 : EMPTY FILES FOR NEXT RUN #EMPTY Y S I R E OK F i l e " Y S I R E " has been e m p t i e d . #EMPTY DREC OK F i l e "DREC" has been e m p t i e d . #EMPTY BUSE OK AFTER THE NUMBER OF DESIRED YEARS ARE SIMULATED 4: FINAL SIMULATION SUMMARIES #RUN CRDBASE # E x e c u t i o n b e g i n s ENTER NUMBER O F : YEARS; HERDS/GROUP; GROUPS; AND 1 IF NO STUDENT HERDS 7,12,2, # E x e c u t i o n t e r m i n a t e d THE SUMMARIES ARE NOV READY TO RUN THE STATISTICAL ANALYSIS PROGRAM SAMPLE RUN 108 4.2: Tr eat me nt s for this Simulation This sample run had 12 single herds and a duplicate group of 12 herds. The simulation was run for 7 years with the following opt i ons selected: OPTIONS HERDS Manageme nt level I 1, 3, 5, 7, 9, 11 Manageme nt level 2 101, 103, 105, 107, 109, 111 Manageme nt level 3 102, 104, 106, 108, 110, 112 Manageme nt level 4 2, 4, 6, 8, 10, 12 Cut 1 f e r t i l i t y - 5 services or 305 days 1, 2, 101, 102 Cul1 f e r t i l i t y - 4 services or 305 days 3, 4, 103, 104 CulI f e r t i l i t y - 3 s er vices or 305 days 5, 6, 105, 106 Cul I fertility - 3 s er vices or 120 days 7, 8, 107, 108 lop 10 c ows - 5 s er v /' ces or 150 days Cull ferti lily - 3 s e r v ices o r 140 days 9. 10, 109, 110 top 10 cows - 5 s er vices or 200 days Cull ferti lily - 3 s er vi ces or 130 days 11, 12, 111, 112 lop 12 cows kept I , onger as a fundi on of rank days = 130 + 10 x (12 - ran k) services = 3 + 0 . 3 x (12 - r an k) Bred lo lop 5 bulls with 1 - 1 2 semen price of less than 500. Bred to lop 10 bulls with semen price of less than 100. 101 - 112 6: PROGRAM "STAT.ANAL" R S T A T . A N A L E x e c u t i o n b e g i n s ENTER YOUR HERD NUMBER 11 , Used only to direct output lo student file ENTER THE NUMBER OF GROUPS 4, Up lo 10 groups of herds ENTER THE FIRST YEAR AND LAST YEAR 1,7, consecut i ve years only ENTER THE TITLE FOR THIS RUN ( LABEL WILL BE TRUNCATED TO 75 CHARACTERS ) MANAGEMENT L E V E L S SAMPLE RUN 109 ENTER GROUP 1 L A B E L GROUP N O . , HERDS AND TREATMENT ( LABEL H I L L BE TRUNCATED TO 52 CHARACTERS ) L E V E L 1 ENTER THE NUMBER OF HERDS IN THIS GROUP 6, Up to 30 herds per group ENTER THE 6 HERDS 1 , 3 , 5 , 7 , 9 , 1 1 , ENTER GROUP 2 LABEL GROUP N O . , HERDS AND TREATMENT < LABEL WILL BE TRUNCATED TO 52 CHARACTERS ) L E V E L 2 ENTER THE NUMBER OF HERDS IN THIS GROUP 6, ENTER THE 6 HERDS 1 0 1 , 1 0 3 , 105, 1 0 7 , 1 0 9 , 111 , ENTER GROUP 3 LABEL GROUP N O . , HERDS AND TREATMENT ( LABEL WILL BE TRUNCATED TO 52 CHARACTERS ) L E V E L 3 ENTER THE NUMBER OF HERDS IN THIS GROUP 6, ENTER THE 6 HERDS 1 0 2 , 1 0 4 , 1 0 6 , 1 0 8 , 1 1 0 , 1 1 2 , ENTER GROUP 4 L A B E L GROUP N O . , HERDS AND TREATMENT ( LABEL WILL BE TRUNCATED TO 52 CHARACTERS ) L E V E L 4 ENTER THE NUMBER OF HERDS IN THIS GROUP 6, ENTER THE 6 HERDS 2 , 4 , 6 , 8 , 1 0 , 1 2 , V A R I A B L E # 1 1 SIMPLE V A R I A B L E 2 COMBINE BREEDING VALUES 3 OTHER CALCULATIONS 1, A simple variable from table XI ENTER A VARIABLE NUMBER OR PRESS RETURN FOR NO MORE VARIABLES 2 5 , THE V A R I A B L E I S : CALVING INTERVAL variable 25 PRESS RETURN I F O K . . . OR ENTER " T " TO RETRY. RETURN PRESS RETURN FOR ANOTHER V A R I A B L E OR ENTER " T " TO STOP <RETURN> SAMPLE RUN VARIABLE # 2 1 SIMPLE V A R I A B L E 2 COMBINE BREEDING VALUES 3 OTHER CALCULATIONS 2, Allows weighted averages of breeding values for a trait lo be combi ned as a new variable ENTER THE T R A I T OF INTREST 1 MILK BCA 2 FAT BCA 3 PROTEIN BCA 4 TYPE SCORE 5 INDEX SCORE 5, ENTER THE SELECTION INDEX WEIGHTS OR PRESS RETURN TO USE VARIABLES 159 - 162 Index used in the herd 9 . 3 , 6 . 2 , - 1 , 0 , ENTER THE NUMBER OF ANIMAL GROUPS TO COMBINE 1 , FOR THE ANIMAL GROUP NUMBER 1 ENTER THE VARIABLE FOR NUMBER OF ANIMALS OR CONCEPTIONS IN THE GROUP 55, Use only variable numbers ending in 0 or 5 between 55-130 or 140, 148 or 156. THE V A R I A B L E I S : NO. L I V E COWS PRESS RETURN I F O K . . . OR ENTER "T" TO RETRY. RETURN ENTER THE VARIABLE NAME ( LABEL WILL BE TRUNCATED TO 28 CHARACTERS ) BV L I V E COWS ECON. INDEX PRESS RETURN FOR ANOTHER VARIABLE OR ENTER " T " TO STOP RETURN VARIABLE 3 1 SIMPLE VARIABLE 2 COMBINE BREEDING VALUES 3 OTHER CALCULATIONS 3, Allows other calculations to create new variables from those i n t a b l e XI ENTER A VARIABLE NUMBER OR PRESS RETURN FOR NO MORE VARIABLES 54, THE VARIABLE IS: NET INCOME PRESS RETURN IF O K . . . OR ENTER "T" TO RETRY. <RETURN> WEIGHT FOR NET INCOME Multiply 54 by another variable or number PRESS RETURN FOR NO WEIGHT OR ENTER A V A R I A B L E NUMBER OR ENTER A WEIGHT FOLLOWED BY A "T" RETURN ENTER A VARIABLE NUMBER OR PRESS RETURN FOR NO MORE VARIABLES 44, Variable to be added to 54 SAMPLE RUN THE V A R I A B L E I S : SOLD - PRODUCTION ($) PRESS RETURN I F O K . . . OR ENTER "T" TO RETRY . RETURN WEIGHT FOR SOLD - PRODUCTION ( ) PRESS RETURN FOR NO WEIGHT OR ENTER A V A R I A B L E NUMBER OR ENTER A WEIGHT FOLLOWED BY A "T" - 1 , T Multiply by -1 gives subtraction ENTER A V A R I A B L E NUMBER OR PRESS RETURN FOR NO MORE VARIABLES RETURN Numerator complete ENTER " T " I F CALCULATIONS COMPLETE OR PRESS RETURN I F DENOMINATOR REQUIRED T No denomi nat or ENTER THE VARIABLE NAME ( LABEL WILL BE TRUNCATED TO 28 CHARACTERS ) NET I N C . - INC . PROD. CULLS PRESS RETURN FOR ANOTHER VARIABLE OR ENTER "T" TO STOP T # E x e c u t i o n t e r m i n a t e d O u t p u t i s d i r e c t e d t o f i l e s a s f o l l o w s : ( s e e a p p e n d i x B) H ? - ? A n a l y s i s o f c o v a r i a n c e , mean and s l o p e t e s t s b o t h w i t h i n a n d between g r o u p s ( ? ' s a r e c o n s e c u t i v e numbers one o f w h i c h i s e n t e r e d f o r t h e h e r d n u m b e r . ) * -DAT D a t a u s e d f o r a n a l y s i s Appendix B21 ANNOTATATED SAMPLE HERD OUTPUT FROM A "SIM.YEAR" RUN WITH THE FULL HERD OUTPUT OPTION COMPUTER OUTPUT IS ILLUSTRATED IN BOLD FACE CHARACTERS ANNOTATIONS ARE LIGHTER ITALICS • HERD 11 YEAR THE SEED WAS 875 to repeat a herd year TYPE 0.0 MANAGEMENT LEVEL OF 1 RANKING AND CULLING BASED ON: ETA WEIGHTINGS FOR THE SELECTION INDEX : MILK 0.50 FAT 0.50 PROTEIN 0.0 NUMBER OF DAYS OPEN OR SERVICES : 130. DAYS OR 4. SERVICES WITH EXTRA FOR THE TOP 12. COWS BASED ON AN EXPONENT 1.000 AN ADJUSTMENT FOR DAYS 10.00 AND AN ADJUSTMENT FOR SERVICES 0.300 MINIMUM DAILY MILK PRODUCTION: AT 7.0 KG/DAY A COW IS DRIED OFF AT 12.0 KG/DAY A CULL COW IS SOLD MATINGS- 70 TO 5 PROVEN SIRES SELECTED BY RANK 30 TO 3 YOUNG SIRES SELECTED RANDOMLY SPECIAL MATE 10 COWS SELECTED BY RANK MAXIMUM SEMEN PRICE 500/VIAL MINIMUM CONCEPTION 20 BULLS USED, THEIR PROPORTION OF USE AND THEIR INDEX (*) PRELIMINARY PROOF ONLY («*) PEDIGREE ESTIMATE ONLY If) > s M O a a ••3 > final se!ections made 9039 9036 15 15 7.5 6.0 9002 15 9006 15 5.5 4.1 9023 15 4.1 9049 10 * * 4.9 9049 9049 10 10 ** *« 4.9 4.9 but 1 number r e l a t i v e use r e l i a b i l i t y of estimate index scores CURRENT PRODUCTION MEAN BCA EPA ETA F E E D T Y p NO COW SIRE DAM AGE STAT DAY FRESH DAYS MILK FAT PROT COST SC RC MLK FAT PRO MILK FAT PROT TYPE IND MILK FAT PROT TYPE IND i d e n t i t y numbers reproductive 455 9003 J i status 0 15 BRED 227 Sred,Open or cu!led cu]led for: FERT-ferti 1ity BCA-last l a c t a t i o n EPA's or ETA's years feed cost 1168. 86 completed l a c t a t i o n s EPA's 9 146 147 145 11.1 12.7 10.9 i ndex J i -v-3.6 11. ETA'S 2.0 2.7 2.2 0.8 own i ndex 2.4 LACTATION # 9 T p a r i t y number LACTATION #10 82/ 8 32 290. 10.1 9.5 t days producing in current year 123/ 9 242 6784. 244.5 212.7 708 9008 COMPLETE RECORD 315 DAYS MILKED total days in production for t h i s complete l a c t a t i o n PROJECTED TO 305 DAY 7221. 252.6 235.4 7500. 270.3 235.1 0 12 BRED 307 t age •f day cu11ed or serviced day and year of p a r t u r i t i on ' rot. 136 132 136 BCA values for t h i s l a c t a t i o n 141 140 137 1260. 85 9 T type score a I product i on and BCA's if l a c t a t i o n continues to 305-days 146 148 143 11.7 13.9 9.2 0.9 12.8 2.2 3.2 1.8 0.2 2.7 average BCA's al I l a c t a t i o n s LACTATION # 9 143/ 8 96 1154 I 41.5 37.4 __/v /\ COMPLETE RECORD 318 DAYS MILKED production in current year mi Ik, f a t . p r o t e i n 1 7784. 279.7 252.0 1 total l a c t a t i o n y i e l d mi Ik. fat. protein 144 142 143 in > TJ tr1 n O C -3 a -3 LACTATION #10 146/ 9 219 6958. 257 4 221 0 PROJECTED TO 305 DAY 8104 299.8 257 4 150 151 147 804 9013 0 11 BRED 248 1255. 84 8 143 145 143 8.5 11.2 9.0 2.0 9 9 1 4 2.3 1.7 0 4 1 8 LACTATION H 8 144/ 8 92 1095. 40 0 35 2 COMPLETE RECORD 313 DAYS MILKED 7517 274.3 241 3 140 141 139 LACTATION H 9 142/ 9 223 6881. 259 0 221 8 PROJECTED TO 305 DAY 7930 298.5 255 6 147 151 146 1112 9022 813 8 ETA 79 181. 81 6 124 118 120 -8.4-12.7- 11.0 -0.9-10 6 --2 4 -4.9 -3.1 -0 5 -3 7 LACTATION # 6 156/ 8 79 895. 28 9 '28 6 COMPLETE RECORD 288 DAYS MILKED 5993 193.8 191 5 118 109 116 1206 9030 577 7 BRED 267 1115. 82 5 129 129 130 -3.2 -2.9 -2.1 -0.7 -3 0 --1 6 -2.1 -0.8 0 0 -1 8 LACTATION # 5 205/ 8 147 2035. 71 7 68 0 COMPLETE RECORD 307 DAYS MILKED 6559 231.0 219 0 128 125 130 LACTATION tt 6 200/ 9 165 4572. 161 8 156 9 PROJECTED TO 305 DAY 6467 228.9 221 8 127 124 131 1213 9029 901 7 ETA 137 343. 79 5 126 122 119 -5.9 -9.1- 11.2 -3.1 -7 5 --2 4 -4.6 -3.5 0 0 -3 5 LACTATION # 5 211/ 8 137 1884. 61 2 57 3 COMPLETE RECORD 291 DAYS MILKED 6002 194.9 182 5 119 110 113 1302 9006 573 6 BRED 345 1380. 83 4 152 160 151 14.9 22.1 14.9 -1.2 18 5 2 1 5.8 3.2 0 0 3 9 LACTATION H 4 257/ 8 175 4085. 160 0 134 9 COMPLETE RECORD 283 DAYS MILKED 8635 338.1 285 1 154 162 156 LACTATION # 5 225/ 9 140 4981. 191 5 166 1 PROJECTED TO 305 DAY 7941 305.3 264 8 147 153 150 1312 9018 1010 6 FERT 190 529. 77 4 127 125 122 -4.8 -6.4 -8.8 -3.8 -5 6 --1 3 -2.0 -1.7 0 0 -1 6 LACTATION H 4 247/ 8 190 3110. 107 4 97 2 COMPLETE RECORD 308 DAYS MILKED 6631 229.0 207 2 129 124 125 CURRENT PRODUCTION MEAN BCA EPA ETA FEED TYP NO COW SIRE DAM AGE STAT DAY FRESH DAYS MILK FAT PROT COST SC RC MLK FAT PRO MILK FAT PROT TYPE IND MILK FAT PROT TYPE IND 1313 9002 1012 6 ETA 142 386. 82 4 130 128 129 -2.5 -4.1 -3.2 0.5 -3 3 -1 9 -2.7 -1.6 0 .0 -2 .3 LACTATION tf 4 204/ 8 142 2176. 77 5 69 9 COMPLETE RECORD 303 DAYS MILKED 7247 258.2 232 8 137 135 136 1411 9018 1005 5 OPEN 320 1378. 77 3 137 138 131 2.9 4.2 -1.4 -4.1 3 5 1 2 1.8 0.1 -1 0 1 5 LACTATION tt 3 177/ 8 120 1498. 53 9 45 6 COMPLETE RECORD 308 DAYS MILKED 6625 238.6 201 6 137 135 130 LACTATION tt 4 176/ 9 189 7682. 306 9 225 4 PROJECTED TO 305 DAY 9733 388.8 285 6 172 186 159 1412 9035 1007 5 BRED 310 1078. 86 3 124 120 127 -6.9 -9.6 -4.6 • -0.5 -8 2 -1 4 -2.6 -0.8 0 0 -2 0 LACTATION tt 3 263/ 8 185 2763. 92 0 93 6 COMPLETE RECORD 287 DAYS MILKED 5349 178.2 181 2 116 108 118 LACTATION H 4 256/ 9 109 3399. 122 7 119 9 PROJECTED TO 305 DAY 6836 246.7 241 1 132 131 140 1414 9035 1010 5 DEAD 73 268. 85 3 136 134 134 1.7 1.2 0.7 0.2 1 4 0 2 0.4 0.5 0 0 0 3 LACTATION tt 3 246/ 8 73 1825. 66 8 60 0 COMPLETE RECORD 192 DAYS MILKED 7287 266.6 239 4 124 124 124 1416 9035 1104 5 BRED 360 1084. 81 3 144 144 142 8.4 9.1 7.0 • -0.9 8 8 1 2 2.2 1.4 0 0 1 7 LACTATION If 3 238/ 8 183 2939. 105 1 94 3 COMPLETE RECORD 310 DAYS MILKED 6812 243.5 218 7 139 137 138 LACTATION tt 4 269/ 9 96 3251. 116 7 104 2 PROJECTED TO 305 DAY 7374 264.8 236 4 139 138 138 1423 9037 1208 5 OPEN 298 1229. 81 2 140 143 140 4.6 7.2 5.0 • -1.3 5 9 0 3 1.2 0.5 0 0 0 8 LACTATION tt 2 162/ 8 95 1068. 39 6 34 6 COMPLETE RECORD 298 DAYS MILKED 6037 224.0 195 5 136 138 136 LACTATION tt 3 178/ 9 187 6284. 250 8 204 7 PROJECTED TO 305 DAY 8062 321.7 262 6 159 170 159 1501 9006 455 4 BRED 339 1205. 85 2 141 144 142 5.2 7.8 6.3 2.6 6 5 0 8 2.8 2.4 0 0 1 8 LACTATION If 2 229/ 8 170 2584. 95 5 84 2 COMPLETE RECORD 306 DAYS MILKED 6550 242.1 213 4 146 147 146 LACTATION tf 3 227/ 9 138 4781. 183 2 157 1 PROJECTED TO 305 DAY 7724 296.0 253 7 154 159 155 1510 9002 1007 4 BRED 209 1150. 78 2 121 119 120 -8.5 -9.6 -8.8 • -2.5 -9 0 -1 4 -2.2 -1.5 -0 4 -1 8 LACTATION tt 2 182/ 8 100 1127. 39 3 36 1 COMPLETE RECORD 283 DAYS MILKED 5260 183.6 168 7 122 118 120 LACTATION tt 3 152/ 9 213 5787. 219 0 183.3 PROJECTED TO 305 DAY 6877 260.3 217 8 141 144 138 1511 9023 1010 4 BRED 283 1074. 80 2 129 127 126 -3.3 -3.8 -4.6 --1.0 -3 5 - 0 7 -0.7 -0.5 0 0 -0 7 LACTATION H 2 224/ 8 144 1897. 64 3 61 5 COMPLETE RECORD 285 DAYS MILKED 5335 180.8 172 9 123 117 122 LACTATION tf 3 208/ 9 157 4333. 154 7 138 0 PROJECTED TO 305 DAY 6383 227.9 203 2 133 131 131 1513 9023 1205 4 ETA 161 506. 82 2 124 122 124 -6.6 -7.6 -5.9 --1.4 -7 1 --1 7 -2.8 -1.5 -0 0 -2 2 LACTATION * 2 246/ 8 161 3178. 112 5 105 2 COMPLETE RECORD 280 DAYS MILKED 5576 197.4 184 6 151 148 153 1514 9017 1207 4 BRED 302 1143. 79 2 144 150 141 7.7 12.5 6.0 • -1.6 10 1 2 4 4.6 2.0 -0 5 3 5 LACTATION H 2 206/ 8 157 2298. 89 1 72 2 COMPLETE RECORD 316 DAYS MILKED 7239 280.7 227 3 156 163 152 LACTATION tt 3 244/ 9 121 4259. 166 0 134 7 PROJECTED TO 305 DAY 7718 300.8 244 2 154 161 150 1516 9002 1213 4 BRED 89 1281. 84 2 158 167 158 16.8 23.8 17.9 0.6 20 3 2 6 5.0 2.5 0 1 3 8 LACTATION tt 2 24/ 9 298 7466. 296 0 246 7 COMPLETE RECORD 298 DAYS MILKED 7532 298.6 248 9 161 172 163 1518 9017 1215 4 BRED 109 1180. 86 2 148 152 151 10.2 13.4 12.9 2.2 11 8 2 1 3.7 3.2 0 8 2 9 LACTATION ft 2 43/ 9 299 6881. 262 6 232 2 COMPLETE RECORD 299 DAYS MILKED 6934 264.7 234 0 151 157 156 1520 9006 1305 4 BRED 257 1099. 83 1 130 131 129 -1.9 -1.1 -2.1 0.5 -1 5 - 0 7 0.7 0.6 0 0 0 0 LACTATION tt 1 203/ 8 128 1880. 69 1 60 9 COMPLETE RECORD 290 DAYS MILKED 5744 211.1 185 9 128 130 128 LACTATION ft 2 178/ 9 187 4604. 164 4 148 0 PROJECTED TO 305 DAY 5971 213.2 192 0 136 134 135 1601 9017 804 3 OPEN 0 1047. 82 1 124 125 125 -5.1 -4.3 -4.4 0.2 -4 7 - 0 6 -0.5 -0.3 0 2 -0 6 LACTATION H 1 4/ 9 283 5140. 188 9 170 6 COMPLETE RECORD 283 DAYS MILKED 5340 196.3 177 3 121 122 123 LACTATION tt 2 337/ 9 28 673. 25 5 21 6 1602 9041 905 3 BRED 327 1195. 79 1 131 134 130 -1.1 0.8 -1.7 - 1.4 -0 2 - 0 7 -0.2 -0.7 0 0 -0 4 LACTATION tt 1 308/ 8 227 4511. 169 6 144 5 COMPLETE RECORD 284 DAYS MILKED 5902 221.8 189 1 130 134 128 LACTATION ft 2 277/ 9 88 2817. 108 1 89 5 1604 9002 1010 3 BRED 351 1093. 82 1 138 138 139 2.3 3.2 3.6 0.3 2 8 0 6 1.6 1.5 0 0 1 1 LACTATION tt 1 244/ 8 191 2745. 100 6 91 5 COMPLETE RECORD 312 DAYS MILKED 5274 193.2 175 7 138 139 140 LACTATION tt 2 241/ 9 124 3531. 133 4 114 9 PROJECTED TO 305 DAY 6343 239.7 206 4 142 146 142 to > 3 tr1 o a TJ a -3 CURRENT PRODUCTION MEAN BCA EPA ETA FEED TYP NO COW SIRE DAM AGE STAT DAY FRESH DAYS MILK FAT PROT COST SC RC MLK FAT PRO MILK FAT PROT TYPE IND MILK FAT PROT TYPE IND 1605 9023 1112 3 BRED 132 1003. 82 1 139 139 141 3 .0 3 .7 4.6 0.3 3 .4 -0 4 -0.8 -0.2 -0 .1 -0 6 LACTATION tf 1 43/ 9 317 5394. 196 5 180 0 COMPLETE RECORD 317 DAYS MILKED 5394 . 196 .5 180 .0 139 140 142 1607 9041 1207 3 BRED 293 1047. 81 1 118 116 115 -8 3 -9 .3- 10.0 -1.9 -8 8 -0 8 -1.0 -1.3 -0 .5 -0 9 LACTATION tf 1 264/ 8 182 2744. 96 4 85 6 COMPLETE RECORD 283 DAYS MILKED 4877 171 3 152 1 114 112 111 LACTATION tf 2 232/ 9 133 3258. 115 1 105 9 PROJECTED TO 305 DAY 5530 195 3 179 8 129 126 128 1608 9019 1304 3 ETA 59 161. 83 1 118 113 118 -8 3- 10 .7 -7.9 0.4 -9 5 -1 4 -2.6 -1.3 0 .1 -2 0 LACTATION tt 1 215/ 8 59 926. 31 3 30 6 COMPLETE RECORD 209 DAYS MILKED 4806 162 5 158 9 93 89 93 1610 9023 1311 3 BRED 274 1182. 81 1 126 126 125 -3 8 -3 .5 -4.5 -0.6 -3 7 -0 5 -0.3 -0.3 0 0 -0 4 LACTATION ft 1 241/ 8 161 2567. 93 1 82 1 COMPLETE RECORD 285 DAYS MILKED 5512 200 0 176 4 124 124 122 LACTATION tf 2 211/ 9 154 4680. 177 5 148 9 PROJECTED TO 305 DAY 6952 263 6 221 2 152 157 150 1611 9002 1209 3 HLTH 21 35. 80 0 0 0 0 0 3 0 3 0.2 -0.2 0 3 0 5 1.0 0.8 0 3 0 7 1613 9044 1403 3 BRED 212 970. 78 0 0 0 0 0 3 0 3 0.2 -0.2 0 3 -0 8 -0.6 -0.0 0 0 -0 7 LACTATION tt 1 136/ 9 229 4689. 174 5 147 6 PROJECTED TO 305 DAY 5532 205 8 174 2 144 147 140 1615 9006 1412 3 OPEN 230 995. 79 0 0 0 0 0 3 0 3 0.2 -0.2 0 3 --1 5 -0.6 0.4 0 0 -1 1 LACTATION tt 1 104/ 9 261 5176. 187 8 160 0 PROJECTED TO 305 DAY 5623 204 0 173 8 146 146 140 1616 9023 1416 3 BRED 105 1007. 78 1 140 141 137 3 4 4 4 2.5 -1.6 3 9 1 1 1.9 1.0 -0 3 1 5 LACTATION tt 1 53/ 9 285 5338. 195 8 169 6 COMPLETE RECORD 285 DAYS MILKED 5523 202 6 175 4 140 141 137 1617 9044 1419 3 BRED 278 888. 78 0 0 0 0 0 3 0 3 0.2 -0.2 0 3 0 0 0.1 -0.1 -0 3 0 1 LACTATION ft 1 171/ 9 194 3818. 133 5 116 0 PROJECTED TO 305 DAY 5111 178 7 155 2 136 132 129 1618 9019 1420 3 BRED 184 999. 79 1 141 140 138 3 8 4 0 2.9 -1.2 3 9 --0 0 -0.3 0.0 -0 3 -0 2 LACTATION tf 1 59/ 9 306 5392. 194 3 171 3 RECORD TO 306 DAYS 5392 194. 171. 141 140 138 1701 9044 697 2 OPEN 0 LACTATION D 1 307/ 9 58 1165. 44 1 37 7 705. 81 0 0 0 0 0 3 0 3 0.2 • -0.2 0 3 0 2 0.3 -0.0 -0 1 0 3 1702 9006 708 2 BRED 347 734. 78 0 0 0 0 0 3 0 3 0.2 • 0.2 0 3 0 2 2.2 1.7 0 0 1 2 LACTATION tt 1 278/ 9 87 1630. 58 6 51.6 1703 9006 804 2 OPEN 0 LACTATION tf 1 326/ 9 39 669. 25 1 21 4 664. 78 0 0 0 0 0 3 0 3 0.2 - 0.2 0 3 --0 2 1.7 1.6 0 0 0 8 1704 9002 905 2 FERT 96 162. 0 0 0 0 0 0 0 0 0 0.0 0.0 0 0 --b 5 -0.4 -0.3 0 3 0 0 1705 9002 1010 2 BRED 273 891. 77 0 0 0 0 0 3 0 3 0.2 - 0.2 0 3 0 3 1.2 0.9 0 0 0 7 LACTATION ft 1 205/ 9 160 3587. 133 1 110 1 PROJECTED TO 305 DAY 5616 208 5 172 4 145 148 139 1706 9002 1201 2 FERT -50 -86. 0 0 0 0 0 0 0 0 0 0.0 0.0 0 0 0 2 0.8 1.1 0 0 0 0 1707 9019 1206 2 OPEN 0 LACTATION tt 1 364/ 9 1 3. 0 1 0 1 616. 84 0 0 0 0 0 3 0 3 0.2 --0.2 0 3 --0 8 -1.0 -0.4 0 0 -0 9 1708 9028 1411 2 BRED 112 616. 0 0 0 0 0 0 0 0 0 0.0 0.0 0 0 0 6 0.9 0.0 -0 5 0 0 1709 9023 1414 2 BRED 110 616. 0 0 0 0 0 0 0 0 0 0.0 0.0 0 0 0 1 0.2 0.2 0 0 0 0 1710 9028 1416 2 BRED 152 616. 0 0 0 0 0 0 0 0 0 0.0 0.0 0 0 0 6 1.1 0.7 0 0 0 0 1711 9043 1421 2 OPEN 0 LACTATION tf 1 323/ 9 42 839. 32 9 26 2 681. 77 0 0 0 0 0 3 0 3 0.2 --0.2 0 3 0 2 0.6 0.6 0 0 0 4 1712 9002 1424 2 BRED 358 LACTATION tt 1 292/ 9 73 1614. 60 2 50 3 740. 80 0 0 0 0 0 3 0 3 0.2 • 0.2 0 3 --0 8 -0.5 -0.2 0 0 -0 7 1713 9044 1426 2 BRED 348 LACTATION tf 1 286/ 9 79 1487. 52 9 48 0 724. 79 0 0 0 0 0 3 0 3 0.2 --0.2 0 3 0 1 0.2 0.3 0 2 0 1 1714 9036 1201 2 BRED 284 616. 0 0 0 0 0 0 0 0 0 0.0 0.0 0 0 --1 9 -0.2 1.2 0 0 0 0 1715 9047 1503 2 BRED 248 616. 0 0 0 0 0 0 0 0 0 0.0 0.0 0 0 --0 1 0.4 0.6 0 0 0 0 1716 9002 1507 2 BRED 139 616. 0 0 0 0 0 0 0 0 0 0.0 0.0 0 0 0 3 1.3 1.1 0 0 0 0 1717 9023 1509 2 BRED 236 616. 0 0 0 0 0 0 0 0 0 0.0 0.0 0 0 --1 0 -1.4 -0.9 0 0 0 0 1719 9006 1511 2 BRED 152 616. 0 0 0 0 0 0 0 0 0 0.0 0.0 0 0 --1 2 0.3 0.6 0 0 0 0 t/5 > 3 M O a G cn YEARLINGS I.D. numbers ETA FEED HEIFER SIRE DAM DATE day 1st bi rthday MILK FAT PROT TYPE INDEX COSTS STAT dead ? 1801. 9036. 708. 143. -1 .1 0 .5 1 .0 0 .0 -0 .3 348 .94 1802. 9036. 905. 177. -2 .6 -1 .4 -0 .2 0 .0 -2 .0 341 .42 1803. 9002. 1209. 14. 0 .5 1 .0 0 .8 0 .3 0 .8 377 .59 1804. 9036. 1312. 247. -2 .8 -2 .0 -0 .8 0 .0 -2 .4 325 .79 1805. 9018. 1313. 204. -1 .0 -1 .3 -0 .8 0 .0 -1, .2 335 .39 1806. 9036. 1411. 177. -1 .6 -0 .1 0 .1 0 .0 -0 .9 341 .42 1807. 9048. 1412. 263. -0 .7 -1 .3 -0 .4 0 .0 -1 .0 322 .34 1808. 9048. 1414. 246. 0 .1 0 .2 0 .2 0 .0 0 .1 326 .01 1809. 9023. 1423. 162. 0 .1 0 .6 0 .2 0 .0 0 .4 344 .75 1810. 9048. 1501. 229. 0 .4 1 ,4 1. .2 0 .0 0. .9 329 .88 1811. 9002. 1511. 224. -0 .3 -0 .3 -0. ,3 0 .0 -0. .3 330 .90 1812. 9018. 1513. 246. -0 .9 -1 .4 -0 .8 -0 .0 -1. .1 326 .11 1813. 9023. 1514. 206. 1 2 2 .3 1. .0 -0 .2 1. .8 334 .98 1814. 9023. 1516. 26. 1. .3 2 .5 1. .3 0 .1 1. .9 374 93 1815. 9047. 1518. 35. 1 .1 1 9 1 6 0 .4 1. 5 372, 84 1816. 9048. 1519. 114. 0 .1 0. .4 0. 5 0. .0 0. .3 355, 40 1817. 9048. 1520. 203. 0. .0 0. .0 0. 0 0. ,0 0. 0 158. 72 1818. 9018. 1522. 57. -0. .1 -0. ,1 -0. 1 0. .0 -0. 1 368. 01 1819. 9049. 1604. 244. 0. .3 0. 8 0. ,7 0 0 0. 6 326. 46 1820. 9036. 1610. 241. -2. .4 -1. 2 -0. 1 0. ,0 -1. 8 327. 22 DEAD tn > S TJ tr" w O G ^ TJ G -3 CALVES ETA FEED .D. numbers b i r t h CALF SIRE DAM DATE MILK FAT PROT TYPE INDEX COSTS SEX STATUS 1901. 9036. 455. 123. -1 .2 0 .3 1 .2 0 .0 -0.4 198 .71 HEIF 1. 9039. 708. 146. 1 .1 1 .6 0 .9 0 .1 1.3 0 .0 BULL S AI 1902. 9039. 804. 142. 0 .7 1 .1 0 .9 0 .2 0.9 183 .32 HEIF 1903. 9006. 1206. 200. -1, .7 -0 .4 0 .4 0 .0 -1.0 135 .48 HEIF 2. 9036. 1302. 225. -1 .1 1 .8 1 .7 0 .0 0.4 0 .0 BULL S AI 0. 9006. 1411. 176. -0 .3 1 .6 0 .8 0 .0 0.0 0 .0 BULL SOLD 1904. 9036. 1412. 256. -2 .9 -2 .3 -0 .3 0 .0 -2.6 89 .50 HEIF 1905. 9036. 1416. 269. -1, .6 0 .0 0 .8 0 .0 -0.8 78 .83 HEIF 0. 9039. 1423. 178. 0 . 1 0 .6 0 .2 0 .0 0.0 0 .0 BULL SOLD 1906. 9036. 1501. 227. -1. 8 0, ,4 1, .3 0 ,0 -0.7 113 .31 HEIF 1907. 9049. 1510. 152. -0. ,7 -1 ,1 -0 .8 -0. .2 -0.9 174, .89 HEIF 0. 9002. 1511. 208. -0. ,3 -o, ,3 -0, .3 0. ,0 0.0 0, .0 BULL SOLD 1908. 9039. 1514. 244. 1, 2 2. 3 1 .0 -0. .2 1.8 99. .35 HEIF 0. 9049. 1516. 24. 1 ,3 2. .5 1 .3 0. 1 0.0 0, .0 BULL SOLD 1909. 9036. 1518. 43. -1. , 1 0. .8 1, .7 0. 0 -0.2 264. .08 HEIF sold as potential A.l. bull CALVES ETA FEED CALF SIRE DAM DATE MILK FAT PROT TYPE INDEX COSTS SEX STATUS 1910. 9049. 1520. 178. -0. 3 0. ,3 0 .3 0 .0 0.0 153 .55 HEIF 0. 9002. 1601. 4. -0. ,3 -0. ,3 -0 2 0 .1 0.0 0 .0 BULL SOLD 1911. 9050. 1604. 241. 0. 3 0 8 0 .7 0 .0 0.6 101 .47 HEIF 0. 9006. 1605. 43. -1. 1 0. 3 0 .7 0 .0 0.0 0 .0 BULL SOLD 1912. 9049. 1607. 232. -0. 4 -0. 5 -0. 6 -0 .3 -0.5 109 .21 HEIF 1913. 9006. 1610. 211. -1 ,1 0. 5 0. .7 0 .0 -0.3 126 .45 HEIF 1914. 9049. 1613. 136. -o. .4 -0 .3 -0 .0 0 .0 -0.4 188 .03 HEIF 1915. 9039. 1615. 104. -0. .7 -0. .3 0 .2 0 .0 -0.5 214 .31 HEIF 1916. 9049. 1616. 53. 0 6 1. .0 0 .5 -0 .2 0.8 256 .18 HEIF 0. 9002. 1617. 171. 0. 0 0 .0 -0 .0 -0 .2 0.0 0 .0 BULL SOLD 0. 9036. 1618. 59. -2. 2 -1 2 0 .1 0 .0 0.0 0 .0 BULL SOLD 0. 9039. 1601. 337. -0 3 -0 .3 -0 .2 0 .1 0.0 0 .0 BULL SOLD 0. 9006. 1602. 277. -1. 2 0. 6 0 .5 0 0 0.0 0 .0 BULL SOLD 0. 9049. 1701. 307. 0. .1 0. 2 -0. .0 -0 .1 0.0 0 .0 BULL SOLD 0. 9002. 1702. 278. 0. 1 1. 1 0 8 0 .0 0.0 0 .0 BULL SOLD 0. 9049. 1703. 326. -0. .1 0 9 0 .8 0 .0 0.0 0 .0 BULL SOLD 0. 9023. 1705. 205. 0. .1 0 .6 0 .5 0 .0 0.0 0 .0 BULL SOLD 1917. 9023. 1707. 364. -0. .4 -0 .5 -0 .2 0 .0 -0.4 0 .82 HEIF 1918. 9049. 1711. 323. 0 . 1 0 .3 0 .3 0 .0 0.2 34 .49 HEIF 1919. 9039. 1712. 292. -0 .4 -0 .3 -0 . 1 0 .0 -0.3 59 .94 HEIF 1920. 9002. 1713. 286. 0. .0 0 . 1 0 .2 0 .1 0.1 64 .55 HEIF CO > TJ tr" M O G -9 TJ G -9 ROLLING HERD AVERAGES Average production in 305 days or less ( f o r cows dried off before 305 days) of all l a c t a t i o n s completed or reaching 305-days in the current year BEFORE CULLING records as they would have been if no cows were culled for loiv production or type NO. REC. 31 MILK 5955. FAT 215.0 average average AGE DAYS MILKetf at p a r t u r i t i o n 4.6 292.3 PROTEIN 192.7 percent FAT PROTEIN 3.61 mi Ik 133. BCA fat protein 133. 133. 3.24 TYPE score 82. AFTER CULLING some records are usually shorter a few can be missed NO. REC. 31 MILK 5948. FAT 214.8 PROTEIN 192.5 133. AGE 4.6 BCA 132. DAYS MILK 289.2 132. FAT 3.61 TYPE 82. PROTEIN 3.24 CALVING INTERVAL 364.0 CONCEPTION RATE 0.545 a c t u a l l y days open plus gestation all services to cows conceiving length for couis conceiving in the year or culled in the year LIVE ANIMALS AT YEAR END heifers 35 COWS 8 BRED HEIFERS 19 YEARLINGS 20 CALVES ECONOMIC SUMMARY t o t a l production 1967.78 HECTOLITRES OF MILK 3.82 kilograms / h e c t o l i t r e FAT TEST 3.32 PROTEIN TEST EXPENDITURES FIXED COSTS 39935.00 fixed plus additional manaaement FEED COSTS COWS 31375.47 -YEARLINGS 6669.05 - CALVES 2646.46 SEMEN COSTS 9361.31 MILK SHIPPING COST 2636.83 TOTAL EXPENDITURES 92623.94 INCOME 1500.00 HL QUOTA MILK AT 53.38/HL 467.78 HL EXCESS MILK AT 39.22/HL 0.0 HL SURPLUS MILK AT .OOO/HL SOLD ANIMALS 5 COWS (PRODUCTION) 3 COWS (FERTILITY) 1 COWS (HEALTH) 1 COWS DEAD 0 YEARLINGS 0 OLD CALVES 14 BULL CALVES 0 HEIFER CALVES 0 SELECTED YOUNG SIRES TOTAL INCOME 80073.88 18347.73 0.00 2600.00 1560.00 300.00 0.0 0.0 0.0 800.00 0.0 0.0 103681.56 > 3 TJ H O a -3 TJ G -3 TOTAL PROFIT 11057.63 SAMPLE OUTPUT A p p e n d i x B22 ANNOTATED PRINTED OUTPUT FROM " S T A T . A N A L " (FOR SAME RUN AS IN APPENDIX B1) A n n o t a t i o n s i n i t a l i c s 1: OUTPUT FROM FILE -STAT ANALYSIS OF COVARIANCE AND SLOPE TEST WITH YEARS (1-7) AS THE COVARIATE MANAGEMENT L E V E L S VARIABLE # 1 CALVING INTERVAL GROUP 1 ANALYSIS OF COVARIANCE ( 4 2 OBSERVATIONS) test if significant differences between herds in the treatment group SOURCE DF SUM SQ TOTAL 41 1119 .0 SLOPES 5 2 7 . 6 3 7 - slopes different ? ERROR 1 30 5 7 4 . 0 6 - for testing slopes MEANS 5 5 1 7 . 1 9 - means different ? COMMON SLOPE 1 0 .11841 MEAN SQ 5 .527 19 .14 103 .4 0 . 1 1 8 4 F -VALUE PROB common slope different from 0.0 1 7 . 1 9 0 . 2 8 8 9 0 . 9 1 5 not si gnificant 6 . 0 1 7 0 . 4 0 6 E - 0 3 significant alpha .OS 0 . 6 8 8 8 E - 0 2 0 .934 not significant ERROR 2 35 6 0 1 . 6 9 - for testing means STUDENT NEWMAN KUELS TEST - HERD MEAN 'S ALPHA=0.05 AND 35 DF THERE ARE 2 HOMOGENOUS SUBSETS ( 1 , 3 , ( 5, 9 , 11, 7, SAMPLE OUTPUT 1 2 0 HERD MEAN S . E . SLOPE S . E . INTERCEPT COMMON 3 6 5 . 2 4 4 0 . 8 3 6 0 . 0 2 7 0 . 3 2 0 3 6 5 . 1 3 7 1 370 .251 1 .567 0 . 2 9 3 0 . 8 2 7 3 6 9 . 0 7 8 3 369 .721 1 .567 - 0 . 2 7 3 0 . 8 2 7 3 7 0 . 8 1 2 5 3 6 4 . 6 8 6 1 .567 0 . 2 0 2 0 . 8 2 7 3 6 3 . 8 8 0 7 3 6 1 . 2 2 3 1 .567 - 0 . 3 6 0 0 . 8 2 7 3 6 2 . 6 6 3 9 3 6 2 . 8 4 6 1 .567 0 . 7 0 4 0 . 8 2 7 360 .031 1 1 3 6 2 . 7 3 5 1 .567 - 0 . 4 0 7 0 . 8 2 7 3 6 4 . 3 6 2 GROUP 2 ANALYSIS OF COVARIANCE ( 42 OBSERVATIONS) SOURCE DF SUM SQ MEAN SQ F - V A L U E PROB TOTAL 41' 3536 .0 SLOPES 5 127. 70 2 5 . 54 1 . 3 2 3 0 281 ERROR 1 30 5 7 8 . 97 19. 30 MEANS 5 2824 .3 564 .9 2 7 . 9 8 0 264E COMMON SLOPE 1 5 .0088 5 . 0 0 9 0 .2481 0 .622 ERROR 2 35 7 0 6 . 67 2 0 . 1 9 STUDENT NEWMAN KUELS TEST - HERD MEAN *S ALPHA=0.05 AND 35 DF THERE ARE 4 HOMOGENOUS SUBSETS ( 101, 103, ( 105, ( 109 , 111 , ( 107, HERD MEAN S . E . SLOPE S . E . INTERCEPT COMMON 371 .018 1 .486 - 0 . 1 7 3 0 . 3 4 7 3 7 1 . 7 0 8 101 3 8 3 . 2 4 5 1 .698 - 1 . 3 3 8 0 . 8 3 0 3 8 8 . 5 9 6 1 03 3 7 9 . 3 8 0 1 .698 0 . 0 3 9 0 . 8 3 0 3 7 9 . 2 2 5 1 05 3 7 1 . 9 1 9 1 .698 - 1 . 3 8 6 0 . 8 3 0 3 7 7 . 4 6 4 107 3 5 9 . 5 7 4 1 .698 0 . 2 7 5 0 . 8 3 0 3 5 8 . 4 7 2 109 3 6 6 . 7 0 2 1 .698 0.621 0 . 8 3 0 3 6 4 . 2 1 9 1 1 1 3 6 5 . 2 8 9 1 .698 0 . 7 5 2 0 . 8 3 0 3 6 2 . 2 8 0 GROUP 3 ANALYSIS OF COVARIANCE ( 42 OBSERVATIONS) SOURCE DF SUM SQ MEAN SQ F - V A L U E PROB TOTAL 41 4838 .0 SLOPES 5 7 0 . 2 0 4 14. 04 0 . 5 6 7 6 0 724 ERROR 1 30 7 4 2 . 16 2 4 . 74 MEANS 5 3973 .2 794 .6 3 4 . 2 4 0 1 56E COMMON SLOPE 1 52 .391 5 2 . 39 2 .257 0 142 ERROR 2 35 8 1 2 . 36 2 3 . 21 SAMPLE OUTPUT 121 STUDENT NEWMAN KUELS TEST HERD MEAN 'S ALPHA=0.05 AND 35 DF THERE ARE 3 HOMOGENOUS SUBSETS ( 102, ( 106, 104, ( 110, 112, 108, HERD MEAN S . E . SLOPE S . E . INTERCEPT COMMON 3 7 9 . 7 4 9 1 .729 0 . 5 5 8 0 . 3 7 2 3 7 7 . 5 1 5 1 02 3 9 4 . 6 3 7 1.821 0.661 0 . 9 4 0 3 9 1 . 9 9 3 1 04 3 8 3 . 3 7 7 1 .821 0.261 0 . 9 4 0 382 .331 1 06 3 8 8 . 3 2 9 1.821 1 .277 0 . 9 4 0 3 8 3 . 2 2 2 108 3 6 7 . 9 2 8 1 .821 1.413 0 . 9 4 0 3 6 2 . 2 7 6 110 3 7 3 . 2 3 4 1.821 - 0 . 4 5 7 0 . 9 4 0 3 7 5 . 0 6 2 1 1 2 3 7 0 . 9 9 2 1 .821 0 . 195 0 . 9 4 0 370.21 0 GROUP 4 ANALYSIS OF COVARIANCE ( 42 OBSERVATIONS) SOURCE DF SUM SQ MEAN SQ F -VALUE PROB TOTAL 41 17545 . SLOPES 5 4 2 1 . 6 0 8 4 . 3 2 1 .478 0 . 226 ERROR 1 30 1 7 1 0 . 9 5 7 . 0 3 MEANS 5 1481 1 . 2 9 6 2 . 4 8 . 6 2 0 . 1 1 0 E -1 3 COMMON SLOPE 1 6 0 1 . 2 2 601 .2 9 . 8 6 7 0 . 3 4 1 E - 02 ERROR 2 35 2 1 3 2 . 5 6 0 . 9 3 STUDENT NEWMAN KUELS TEST - HERD MEAN ' S ALPHA=0.05 AND 35 DF THERE ARE 3 HOMOGENOUS SUBSETS ( 4, 2, 6, ( 12, 10, ( 8 , HERD MEAN S . E . SLOPE S . E . INTERCEPT COMMON 3 9 1 . 9 3 6 3 .254 1 .892 0 . 6 0 2 3 8 4 . 3 6 8 2 4 0 9 . 6 6 7 2 .950 2. 1 65 1 .427 4 0 1 . 0 0 8 4 4 1 4 . 7 4 3 2 .950 0 . 6 3 0 1 .427 4 1 2 . 2 2 4 6 4 0 5 . 2 6 4 2 .950 3 . 9 9 9 1.427 3 8 9 . 2 6 9 8 3 6 5 . 1 1 4 2 .950 0 . 0 8 0 1 .427 3 6 4 . 7 9 4 10 3 7 5 . 5 1 6 2 .950 0 . 5 9 0 1 .427 3 7 3 . 1 5 4 12 381 .312 2 .950 3 . 8 8 6 1 .427 3 6 5 . 7 6 9 SAMPLE OUTPUT 1 22 FINAL - OVERALL lest if significant differences between groups ANALYSIS OF COVARIANCE ( 168 OBSERVATIONS) SOURCE DF SUM SQ MEAN SQ F - V A L U E PROB TOTAL 167 4 4 0 3 2 . SLOPES 3 4 3 5 . 7 8 145 .3 0 .8811 0 .452 ERROR 1 160 2 6 3 7 9 . 164 .9 MEANS 3 16994. 5 6 6 5 . 3 4 . 4 3 0 . 5 8 0 E COMMON SLOPE 1 2 2 2 . 9 5 2 2 2 . 9 1 . 3 5 5 0 .246 ERROR 2 163 2 6 8 1 5 . 164 .5 STUDENT NEWMAN KUELS TEST - GROUP MEAN 'S ALPHA=0.05 AND 163 DF THERE ARE 4, 3, 2, 1 . HOMOGENOUS SUBSETS ( GROUP COMMON 1 2 3 4 MEAN 3 7 6 . 9 8 6 3 6 5 . 2 4 4 3 7 1 . 0 1 8 3 7 9 . 7 4 9 3 9 1 . 9 3 6 VARIABLE # S . E . 1 .261 1 .979 1 . 9 7 9 1 . 9 7 9 1 .979 SLOPE 0 . 5 7 6 0 . 0 2 7 - 0 . 1 7 3 0 .558 1 .892 S . E . 0 . 4 9 5 0.991 0.991 0 . 9 9 1 0 . 9 9 1 NET INCOME INTERCEPT 3 7 4 . 6 8 2 3 6 5 . 1 3 7 3 7 1 . 7 0 8 3 7 7 . 5 1 5 3 8 4 . 3 6 8 SAME ANALYSIS AS VARIABLE #7 ANALYSIS COMPLETE SAMPLE 8 5 81 UJ D a. I ID 0) 0) CO ID 00 < > o <-> *- cs co z CO '—1 > o -ci o Q : • < LT) L U ID ID CO o o o ID CO < FLOW CHARTS F i g u r e C. 1 u' MAIN PROGRAM read AI f i l e f i n d herd read l a s t parameters used output main menu change parameters input new parameters SUMROUTINE MNDG generates sets of four multivatiate normal deviates with given covariances RETURN I ' i n i t i a l i z e random number generators CALL MNDG1 generate temporary herd effects select proven b u l l s i n d i v i d u a l l y yes input b u l l s check a l l - ok select yes young bulls i n d i v i d u a l l y ? input b u l l s check a l l ok I select proven b u l l s by rank ? yes rank by index and select top e l i g i b l e b u l l s select young -> b u l l s ^ by rank ? no yes rank young bu l l s by pedigree index 6 select top select b u l l s — random from AI check e l i g i b l e input matings input animals select b u l l s at ye s young random automated yes more herds STOP individual matings for b u l l calves '. yes output menue individual animal selections ? print management no hardcopy "CALL GENREC <- decisions i n i t i a l i z e subroutines FLOW CHARTS 1 2 5 SUBROUTINE GENREC read cows from f i l e zero arrays fi n d a cow record f- i cow pregnent ? [no yes more cows ? CALL BREED yes - < c u l l ? j " 0 yes no due to freshen { thi s year ? yes CALL LACT i f cow's f i r s t record CALL BLUP eligable to breed before year end ? ye s CALL BREED < c u l l ? yes I r < freshen again before no year end ? CALL LACT I CALL PROD for new la c t a t i o n X CALL PROD for old l a c t a t i dead or culled for health ? I' CALL ADJPROD sum r o l l i n g herd averages CALL RHPROD calculate herd averages for EPA's CALL COWETA I calculate index scores I CALL CULSEL CALL SUMCOW I write cow records to f i l e CALL SUMHRD CALL PBLUP RETURN SUBROUTINE LACT i n i t i a l i z e ENTRY X generate temporary cow effects sum a l l effects for new 305 day record if^type not > last don't change 1 RETURN -> CALL KILCF FLOW CHARTS SUBROUTINE BREED i n i t i a l i z e yes f i n d s e l e c t e d ENTRY MATE a u t o m a t e d d e c i s i o n s ? c u l l c a l f c h e a p b u l l ? RETURN yes s p e c i f i e d m a t i n g ? b u l l , yes no s a v e b u l l c a l f s p e c i f i e d ? s e l e c t t o p b u l l *~ yes s a v e b u l l c a l f a u t o m a t e d ? s e l e c t b u l l a t random w i t h s p e c i f i e d p r o b a b i l i t i e s 1 i n b r e e d i n g ? yes i f s t a r t i n g c y c l e g e n e r a t e d a t e of f i r s t e s t r u s 4- c a l c u l a t e p r o b a b i l i t i e s e s t r u s d e t e c t i o n and c o n c e p t i o n ESTROUS LOOP random number g r e a t e r t h a n p r o b a b i l i t y o f e s t r u s d e t e c t i o n ? ye s ENTRY SUMATE 1 sum b u l l u s e and c o n c e p t i o n w i t h i n c l a s s e s c a l c u l a t e a v e r a g e s c o n c e p t i o n r a t e and c a l v i n g i n t e r v a l w r i t e b u l l use summary t o f i l e 4- RETURN a d d a <- s e r v i c e RETURN T g e n e r a t e t r u e b r e e d i n g v a l u e T s t o r e i n f o , f o r u n b o r n c a l f random number g r e a t e r t h a n p r o b a b i l i t y o f c o n c e p t i o n ? yes 4> a d d a c y c l e FLOW CHARTS SUBROUTINE PROD ENTRY PROD \ a d j u s t m a t u r e e q u i v i l a n t f o r age I t e r a t i v e l o o p s o l v e f o r W o o d 1 s l a c t a t i o n p a r a m e t e r s e s t i m a t e " b " I s o l v e f o r " a " and " c ' e s t i m a t e d p r o d u c t i o n 305 d a y s AREAG e s t i m a t e e q u a l s a c t u a l 3 0 5 - d a y p r o d u c t i o n ? yes r e f i n e e s t i m a t e ' b " ENTRY AJPROD s o l v e " a " and A f i n d d a t e t o d r y o f f DRYOFF e s t i m a t e p r o d u c t i o n i n c u r r e n t y e a r AREAG 4 RETURN i n i t i a l i z e RETURN ENTRY RHPROD l a c t a t i o n > 305 d a y s ? yes FUNCTION DRYOFF e s t i m a t e d a t e r e f i n e e s t i m a t e improvement n e g l i g a b l e ? I RETURN c a l c u l a t e " a " and " c * i e s t i m a t e p r o d u c t i o n c o m p l e t e l a c t a t i o n AREAG i a d j u s t new 3 0 5 - d a y r e c o r d f o r age I RETURN FUNCTION GAMMDS c h e c k p a r a m e t e r s i t e r i t i v e l o o p ( r e ) e s t i m a t e gamma i n t e r v a l e r r o r t o l e r a b l e RETURN FUNCTION AREAG c a l c u l a t e p a r a m e t e r s compute a r e a f r o m gamma i n t e r v a l s GAMMDS 4- RETURN FLOW CHARTS 128 SUBROUTINE ETA i n i t i a l i z e i RETURN ENTRY COWETA a d j u s t cow's d e v i a t i o n s f o r h e r d and p o p u l a t i o n mean c a l c u l a t e E P A ' s i ENTRY CLFETA ENTRY YNGETA f i n d dam^i f a l i v e u p d a t e dams ETA i u p d a t e s i r e ' s ETA c a l c u l a t o r a n i m a l ' s ETA RETURN SUBROUTINE SUMCOW yes SUBROUTINE SUMHRD c a l c u l a t e m i l k p r i c e and income I CALL YNGOUT CALL SUMATE I c a l c u l a t e income f r o m c u l l e d a n i m a l s c a l c u l a t e a v e r a g e B V ' s f o r e a c h c l a s s o f a n i m a l i c a l c u l a t e r o l l i n g h e r d a v e r a g e s 4, w r i t e h e r d and s u m m a r i e s t o f i l e s -̂ , - a u t o m a t e d h e r d ? w r i t e p r o d u c t i o n and e c o n o m i c s u m m a r i e s t o p r i n t e r and s c r e e n 1 -> RETURN a d d t h e a n i m a l ' s t r u e BV t o t h e t o t a l f o r t h e a p p r o p r i a t e a n i m a l c l a s s i f i n d l a c t a t i o n d a t e s i c a l c u l a t e B C A ' s CALL WRTLIN i RETURN SUBROUTINE WRTLIN w r i t e t o p r i n t e r cows p r e f o r m a n c e a n d r e c o r d i n a p p r o p r i a t e f o r m a t FLOW CHARTS 1 2 9 SUBROUTINE SELEC ENTRY CULSEL s o r t h e r d ( l o w e s t - h i g h e s t ) u s i n g d e f i n e d i n d e x I s t a r t a t t o p o f l i s t I n e x t cow I low r a n k e d ^ p r e v i o u s y e a r ? yes yes c u l l a f t e r o l d l a c t a t i o n CALL AJPROD 4. e l i m i n a t e new l a c t a t i o n a d j u s t h e r d p r o d u c t i o n I. s w i t c h ? h e r d p r o d u c t i o n > q u o t a + e x c e s s ? s e t " s w i t c h " o f f s t o r e r a n k cows a u t o m a t e d h e r d ? " ye s CALL RHPROD <-] RETURN p r o d u c t i o n new l a c t a t i o n d r o p s b e f o r e y e a r end ? yes c u l l a f t e r new l a c t a t i o n CALL AJPROD mark a s low r a n k off SUBROUTINE BLUP i n i t i a l i z e RETURN ENTRY BLUP a d d f i r s t l a c t a t i o n r e c o r d t o s i r e ' s h e r d - y e a r - s e a s o n 4 RETURN i c u l l more no x p r i n t s c r e e n 7 l i s t b o t t o m r a n k e d cows ENTRY PBLUP I w r i t e h e r d - y e a r - s e a s o n r e c o r d s f o r s i r e s t o f i l e i RETURN SUBROUTINE K I L C F f i n d c a l v e s due t o be b o r n but c o n c e i v e d a f t e r c u l l d a t e i remove •I RETURN o p t i o n ? l o n g e r l i s t r e s t o r e c u l l e d cow F L O W C H A R T S 1 3 0 SUBROUTINE YOUNG r e a d l a s t y e a r s h e i f e r c a l v e s f r o m f i l e 1 l o o p f o r c a l v e s I n e x t c a l f move t o y e a r l i n g a r r a y 4, c a l c u l a t e f e e d c o s t s CALL YNGETA 4, add B V s 4- t o t o t a l 4 . s t o r e s t a t u s -j, yes more o l d c a l v e s ? I" CALL CALVES w r i t e y e a r l i n g s and c a l v e s t o f i l e 1 a u t o m a t e d h e r d ? yes no w r i t e s t a t u s y e a r l i n g s & c a l v e s t o p r i n t e r 4, RETURN SUBROUTINE F I L E S f i n d s h e r d s and a s s i g n s h e r d f i l e s t o a p p r o p r i a t e d e v i c e s I RETURN SUBROUTINE CALVES r e a d u n b o r n c a l v e s f r o m f i l e new c a l v e s f r o m MATE i s o r t c a l v e s t o be removed i ^ l o o p f o r c a l v e s « n e x t ^ c a l f vl d e a d o r cow c u l l e d ? - yes > 7fv s a v e s t a t u s 1 b o r n i n c u r r e n t no y e a r ? " g e n e r a t e sex 1 m a l e ? no / \£ yes g e n e r a t e p e r m a n e n t cow e f f e c t s CALL CLFETA I d e a d ? s a v e s t a t u s 6 B V s 4. c a l c u l a t e f e e d c o s t s ^ y e s more young c a l v e s ? RETURN PROGRAM LISTINGS 1 3 1 C * * C * P r o g r a m - SETUP * C * * C * S e t s up h e r d s and A . I . u n i t r e a d y t o run y e a r - 1 . * C * * C * P o p u l a t i o n s i z e and age d i s t r i b u t i o n a r e s e t * C * i n t e r a c t i v e l y when t h e p r o g r a m i s r u n . A l l o t h e r p a r a m e t e r s * C * a r e d e t e r m i n e d a t c o m p i l e t i m e , so c h e c k a l l i n i t i a l i z e d * C * p a r a m e t e r s b e f o r e c o m p i l i n g . * C * * Q ******************************************** C * C * C * DIMENSION A I ( 3 0 , 5 0 0 ) , HRDCOW(40 ,150) , H R D Y L G ( 1 8 , 7 5 ) , 1 C A L F ( 1 8 , 7 5 ) , U C A L F ( 8 , 1 5 0 ) , 2 R N E ( 4 ) , R N G ( 4 ) , E W K ( 4 ) , G W K ( 4 ) , I D I S T ( 6 ) , 3 I A G E ( 1 5 0 ) , BAGE(500) C * C * P a r a m e t e r s n e e d e d t o g e n e r a t e g e n e t i c and e n v i r o n m e n t a l * C * e f f e c t s f o r p r o d u c t i o n t r a i t s * C * REAL*4 E S I G M A ( 1 0 ) / I . , . 8 3 , 1 . , . 9 6 , . 7 8 , 1 . , . 2 , . 2 , . 2 , 1 ./ , 1 G S I G M A ( 1 0 ) / 1 . , . 5 4 , 1 . , . 7 , . 8 1 , 1 . , 0 . , - . 1 5 , 0 . , 1 ./ , 2 G S D ( 4 ) / 4 1 3 . , 1 8 . 2 , 1 2 . 8 , 1 .66/ , P C E S D ( 4 ) / 3 9 3 . , 1 2 . 6 , 3 1 1 . 9 , 1 .64/ C * C * O t h e r b i o l o g i c a l p a r a m e t e r s * C * REAL *4 B F S D / 0 . 0 2 / , B F M / 0 . 7 / , H D C S D / 0 . 0 1 / , HDCM/0.75/ , 1 F E R S D / 0 . 0 1 / , F E R T M / 0 . 7 5 / , 2 D A Y R / 3 6 5 . / , U Y R / 1 . 0 / C * C * Management d e c i s i o n o p t i o n s * C * REAL *4 P A R M ( 2 5 ) / 0 . 0 , 0 . 0 , - 2 . , 2 . 2 , 3 . 2 , 0 . 5 , 0 . 5 , 0 . 0 , 0 . 0 , 1 3 0 5 . , 5 . , 0 . 0 , 0 . 0 , 0 . 0 , 0 . 0 , 7 . , 1 2 . , 1 0 . 2 , 1 0 0 . 2 , 3 . 3 , 2' 3 0 . 0 2 , 1 0 . 2 , 1 5 0 0 . , 5 0 0 . , 1 ./ C * LOGICAL*1 TRUE / T / , F A L S E / ? / , CONT / F / , F I N I S H C * C * READ PARAMETERS * C * 10 WRITE ( 6 , 2 8 0 ) READ ( 5 , 2 9 0 , E R R = 1 0 ) NSH, NGSH, NGGH, NCHD, NBULLS , I SEED IF (NBULLS . L E . 0) GO TO 10 IF (NSH . L E . 0) GO TO 10 IF (NCHD . L E . 0) GO TO 10 I = IRAND(0) IF (I SEED . L E . 0) I SEED = IRAND(1000) GO TO 30 20 WRITE ( 6 , 3 4 0 ) NCHD 30 WRITE ( 6 , 3 0 0 ) READ ( 5 , 2 9 0 ) I D I S T NT = 0 DO 40 I = 1 , 6 NT = NT + I D I S T ( I ) 40 CONTINUE IF (NT . N E . NCHD) GO TO 20 WRITE ( 6 , 3 2 0 ) NSH, NGSH, NCHD, NGGH, NBULLS , I SEED , I D I S T READ ( 5 , 3 3 0 ) CONT PROGRAM LISTINGS 132 C C C C C c c c c I F (CONT) GO TO 10 * s e t cow a g e s f o r s e l e c t e d d i s t r i b u t i o n IT = 0 DO 60 I = 1, 6 K = 7 - I N = I D I S T ( K ) I D I S T ( K ) = 0 . IF (N . L E . 0) GO TO 60 DO 50 J = 1 , N IT = IT + 1 I A G E ( I T ) = I * 100 50 CONTINUE 60 CONTINUE I F (NCHD . G T . 150) GO TO 10 NTSH = NSH * NGSH IF (NTSH . G T . 100) GO TO 10 I N I T I A L I Z E RANDOM NUMBER GENERATORS SEED = I SEED I = I RAND(-I SEED) F = RAND(SEED) FN = RANDN(SEED) CALL MNDG(I SEED, ESIGMA, RNE, EWK) CALL MNDG(I SEED , GSIGMA, RNG, GWK) * * S e t numbers and a g e s o f b u l l s 2 * NBULLS 3 * NOAI NUAI + NBULLS NEAI + UYR * NBULLS NPAI + NBULLS -1 * NTAI / NBULLS NOAI = NUAI = NEAI = NPAI = NTAI = IOA = NWY = 0 DO 67 I = 1, NTAI IF (NWY . L T . NBULLS) GO TO 66 NWY = 0 66 IOA = IOA + 1 NWY = NWY + 1 B A G E ( I ) = IOA + 67 CONTINUE CALL I SORT (BAGE, F R A N D ( 0 . 0 ) 1, 500 , 1, N T A I , 1, 3, 0) G e n e r a t e A . I . S i r e s 70 80 DO 100 I = 1, NTAI CALL MNDG1 ( I S E E D , GSIGMA, RNG, GWK) DO 70 J = 1, 4 AI(J+1 ,1 ) A I ( J + 1 0 , I : A I ( J + 1 8 , I : A I ( j + 1 8 , 1 : A I ( J + 2 2 , I A I ( J + 2 6 , I : A l ( J + 1 4 , i : CONTINUE AI ( 1 ,1 ) = 9000 + I FERTB = BFM + 1 - EXP (BFSD * F R A N D N ( 0 . 0 ) ) IF (FERTB . G T . 1.) GO TO 80 = 0 . 0 = 0 . 0 = 0 . 0 = 0 . 0 = 0 . 0 = 0 . 0 = RNG(J) * G S D ( J ) PROGRAM LISTINGS A I ( 6 , 1 ) = FERTB AI (7,1) = 15 . A I ( 8 , 1 ) = B A G E ( I ) A I ( 9 , 1 ) = 0 . A I ( 1 0 , 1 ) = 0 . 0 A I ( 1 1 , 1 ) = 10. A I ( 1 2 , I ) = 10. * FERTB * (FERTM + FRANDN(0 .0) * FERSD / 1 0 . ) 100 CONTINUE CALL FTNCMD( 'ASSIGN 4 = K I N N : A I , U ; ' ) NB = 0 WRITE (4) NB, NB, NUAI , N E A I , N P A I , NTAI CALL WRTMAT(AI, 3 0 , N T A I , 4) 105 CALL FTNCMD( 'ASSIGN 9 = K I N N : C O D E S ; ' ) C C * G e n e r a t e cow and u n b o r n c a l f C NCG = NCHD / 2 NCOW = 2 * NCG VMC = SQRT ( 0 . 5 ) DO 270 L = 1, NTSH, NGSH INC = 0 DO 220 1 = 1 , NCG N = I + INC ASSIGN 148 TO ISWIT 110 M = I AGE(N) / 100 I D I S T ( M ) = IDIST(M) + 1 IBL = I RAND (NOAI) HRDC0W(1,N) = IAGE(N) + I D I S T ( M ) HRDCOW(2,N) = 9000 + IBL HRDCOW(3,N) = 0 . 0 HRDCOW(4,N) = IRAND(365) HRDCOW(5,N) = 1. HRDCOW(6,N) = 0 . 0 HRDCOW(7,N) = 1 . 0 HRDCOW(8,N) = 0 . 0 HRDCOW(9,N) = HRDCOW(4,N) + DAYR HRDCOW(10,N) = 1 . 0 120 HRDCOW(39,N) = HDCM + 1 - EXP (HDCSD * F R A N D N ( 0 . 0 ) ) I F (HRDCOW(39,N) . G T . 1.) GO TO 120 130 HRDCOW(40,N) = FERTM + 1 - EXP (FERSD * F R A N D N ( 0 . 0 ) ) IF (HRDCOW(40,N) . G T . 1 . ) GO TO 130 CALL MNDG1(ISEED, GSIGMA, RNG, GWK) CALL MNDG1 (I SEED, ESIGMA, RNE, EWK) DO 140 J = 1, 4 HRDCOW(J + 10 ,N) = R N E ( J ) * P C E S D ( J ) HRDCOW(J + 14,N) = RNG(J) * G S D ( J ) * VMC + 0 . 2 5 * 1 A I ( J + 1 4 , I B L ) HRDCOW(j + 18,N) = 0 . 0 HRDCOW(J + 2 2 , N ) = 0 . 0 HRDCOW(j + 2 6 , N ) = 0 . 0 HRDCOW(J + 3 0 , N ) = 0 . 0 HRDCOW(j + 3 4 , N ) = 0 . 0 140 CONTINUE 1ST = 2 BYA = F R A N D ( 0 . 0 ) I F (BYA . L T . 0 . 3 ) 1ST = 1 U C A L F ( 1 , N ) = 1ST I B L = I RAND (NBULLS) + 5 * NBULLS U C A L F ( 2 , N ) = 9000 + I B L U C A L F ( 3 , N ) = HRDC0W(1,N) U C A L F ( 4 , N ) = HRDCOW(9,N) C A L L MNDG1(I SEED , GSIGMA, RNG, GWK) PROGRAM LISTINGS 134 1 1 45 148 C * C * C * 150 1 60 1 70 1 180 C * C * C * 190 200 210 220 DO 145 J = 1, 4 U C A L F ( J + 4 , N ) = RNG(J) * G S D ( J ) * VMC + 0. (HRDC0W(J+14,N) + A I ( J + 1 4 , I B L ) ) CONTINUE GO TO ISWIT, ( 1 5 0 , 148) ASSIGN 150 TO ISWIT INC = INC + 1 N = N + 1 IF (N . G T . NCOW) GO TO 150 GO TO 110 GENERATE YEARLING H R D Y L G ( 1 , 1 ) IBL = I RAND H R D Y L G ( 2 , 1 ) H R D Y L G ( 3 , 1 ) H R D Y L G ( 4 , 1 ) H R D Y L G ( 5 , 1 ) IF (HRDYLG(5 ,1) . G T . H R D Y L G ( 6 , 1 ) = FERTM NOAI I B L = 700 (NOAI) = 9000 = 0 . 0 = FRAND(O.O) = HDCM + 1 - 1 . ) 1 IF (HRDYLG(6 ,1) . G T . 1.) CALL MNDG1 (I SEED, GSIGMA CALL MNDG1(I SEED, ESIGMA DO 180 J = 1 , 4 HRDYLG(J + 6 , 1 ) = R N E ( J ) • HRDYLG(J + 1 0 , 1 ) = RNG(J) A I ( J + 1 4 , I B L ) HRDYLG(J + 1 4 , 1 ) = 0 . 0 CONTINUE * 3 6 5 . EXP (HDCSD * F R A N D N ( 0 . 0 ) ) GO TO 160 EXP (FERSD * F R A N D N ( 0 . 0 ) ) GO TO 170 RNG, GWK) RNE, EWK) * P C E S D ( J ) * G S D ( J ) * VMC + 0 . 2 5 * GENERATE CALF C A L F ( 1 , 1 ) = IBL = IRAND C A L F ( 2 , 1 ) = C A L F ( 3 , I ) = C A L F ( 4 , 1 ) C A L F ( 5 , 1 ) 800 + I (NBULLS) 9000 + IBL 0 . 0 FRAND(O.O) HDCM + 1 - + 4 * NBULLS * 3 6 5 . EXP (HDCSD * IF ( C A L F ( 5 , I ) . G T . 1.) GO TO 190 + 1 - EXP (FERSD ' GSIGMA, RNG, GWK) ESIGMA, RNE, EWK) F R A N D N ( 0 . 0 ) ) F R A N D N ( 0 . 0 ) ) P C E S D ( J ) * G S D ( J ) * VMC + 0 . 2 5 * C A L F ( 6 , I ) = FERTM CALL MNDG1(I SEED , CALL MNDG1(I SEED , DO 210 J = 1 , 4 C A L F ( J + 6 , 1 ) = R N E ( J ) ' C A L F ( J + 1 0 , 1 ) = RNG(J) A I ( J + 1 4 , I B L ) C A L F ( J + 1 4 , 1 ) = 0 . 0 CONTINUE CONTINUE I F (NGSH . L T . 1) GO TO 240 WRITE THE STUDENTS HERDS UNFORMATTED IN THE APPROPRIATE F I L E S DO 230 1 = 1 , NGSH N = I - 1 IHRD = L + N P A R M O ) = IHRD PARM(2) = 500 PARM(25) = 1. WRITE ( 9 ' I H R D , 3 1 0 ) IHRD, PARM(2) CALL F I L E ( I H R D ) PROGRAM LISTINGS 230 240 C * C * C * C * WRITE (12) PARM WRITE (12) NCOW CALL WRTMAT(HRDCOW, WRITE (12) NCG CALL WRTMAT(HRDYLG, WRITE (12) NCG, NCOW CALL WRTMAT(CALF, 18 CALL WRTMAT(UCALF, 8 CONTINUE IF (NGGH . L T . 1) GO TO 4 0 , NCOW, 12) 18, NCG, 12) NCG, 12) NCOW, 12) 270 250 260 270 280 WRITE THE CONTROL HERDS UNFORMATTED IN THE APPROPRIATE GROUP F I L E DO 260 1 = 1 , NGGH IHRD = 1 * 100 + L CALL F I L E D ( I H R D ) PARM(1) = IHRD PARM(2) = 500 WRITE ( 9 , 3 1 0 ) IHRD, PARM(25) = NSH WRITE (12) PARM WRITE (12) NCOW CALL WRTMAT(HRDCOW, WRITE (12) NCG CALL WRTMAT(HRDYLG, WRITE (12) NCG, NCOW CALL WRTMAT(CALF, 18, CALL WRTMAT(UCALF, 8, CONTINUE CONTINUE PARM (2 ) 4 0 , NCOW, 1 2 ) 1 8 , NCG, 1 2 ) NCG, 1 2 ) NCOW, 1 2 ) FORMAT (' ENTER THE NUMBER OF STUDENTS AND THE NUMBER', 1 ' OF HERDS E A C H ' , /, * '• (MAXIMUM 100 STUDENT H E R D S ) ' , /, 2 ' THE NUMBER OF CONTROL GROUPS (MAXIMUM 4 ) , ' , / , 3 'THE NUMBER OF COWS PER HERD (MAXIMUM 1 5 0 ) ' , / , 4 ' THE NUMBER OF YOUNG BULLS TO ADD EACH YEAR (AND AN' 5 ' INTEGER SEED - O P T I O N A L ) ' ) 290 300 310 320 FORMAT FORMAT FORMAT FORMAT E   (10110) ( ' ENTER THE NUMBER OF COWS OF EACH AGE 2 - 7 ' ) ( 1 1 0 , F 1 0 . 0 ) ( 1 1 0 , ' S T U D E N T S ' , 1 6 , ' HERDS/STUDENT' , / , 1 1 0 , ' R E P L I C A T E GROUPS ' , 1 6 , ' BULLS 330 340 FORMAT FORMAT STOP END //, ' AGE D I S T R I B U T I O N ' , /, 7X, ' 2 ' , * 5 ' , 7X , ' 6 * , 7X, ' 7 ' , //, 618 , /, 'ENTER "T" I F ERROR OR RETURN IF OK' (LI ) ('ERROR - COWS SHOULD ADD T O ' , 15) 7X, 16, ' , n o ' 3 ' , COWS/HERD', ' S E E D ' , ' 4 ' , 7X, 7X SUBROUTINE WRTMAT(RMAT, I COL , IROW, INP) Q ******************************************* C * T h i s s u b r o u t i n e w r i t e s and r e a d s two d i m e n s i o n a l m a t r i x e s . * Q ******************************************************************** DIMENSION RMAT( lCOL ,IROW) WRITE (INP) RMAT RETURN PROGRAM LISTINGS ENTRY REAMAT (RMAT, I C O L , IROW, INP) READ ( INP) RMAT RETURN END FUNCTION RANDT(ISEED) THIS FUNCTION GENERATES UNIFORM ( 0 , 1 ) RANDOM NUMBERS DOUBLE PRECISION Z, DN1 MOD, DN1 DATA DN1 MOD / 2 1 4 7 4 8 3 6 4 7 . D O / , DN1 / Z 3 9 2 0 0 0 0 0 0 0 0 0 0 0 0 0 / Z = I SEED Z = DMOD(16807.D0*Z,DN1MOD) RANDT = Z * DN1 I SEED = Z RETURN END FUNCTION RN(IX) T h i s f u n c t i o n g e n e r a t e s p a i r s o f n o r m a l ( 0 , 1 ) random d e v i a t e s , u s i n g a m o d i f i c a t i o n of t h e b o x - m u e l l e r m e t h o d . DATA I / I / IF (I . N E . 1) GO TO 30 I = 2 U = 2. * RANDT(IX) - 1. V = 2. * RANDT(IX) - 1. W = U * U + V * V I F (W - 1.) 2 0 , 2 0 , 10 W = SQRT(-2 .*ALOG(W)/W) RN = U * W RETURN I = 1 RETURN END SUBROUTINE DCSIG(SIGMA, U L , A , B) T h i s s u b r o u t i n e d e c o m p o s e s t h e s y m m e t r i c m a t r i x o f v a r i a n c e s - c o v a r i a n c e s i n t o i t s f a c t o r ( s q u a r e r o o t ) . DCSIG i s c a l l e d by MNDG f o r g e n e r a t i n g m u l t i v a r i a t e n o r m a l d e v i a t e s . DIMENSION S I G M A ( 1 ) , U L ( 1 ) DATA ZERO, ONE, FOUR, S I X T N , SIXTH / 0 . 0 , 1 . , 4 . , 1 6 . , . 0 6 2 5 / A = ONE B = ZERO R i N = ONE / (4*SIXTN) IP = 1 DO 90 I = 1, 4 PROGRAM LISTINGS 137 IQ = I P IR = 1 DO 80 J = 1 , I X = S I G M A ( I P ) IF ( J . E Q . 1) GO TO 20 DO 10 L = I Q , IP1 X = X - U L ( L ) * U L ( I R ) IR = IR + 1 10 CONTINUE 20 I F (I . N E . J ) GO TO 60 A = A * X I F (SIGMA(IP) + X*R1N . L E . S I G M A ( I P ) ) GO TO 100 30 IF (ABS(A) . L E . ONE) GO TO 40 A = A * SIXTH B = B + FOUR GO TO 30 40 IF (ABS(A) . G E . SIXTH) GO TO 50 A = A * SIXTN B = B - FOUR GO TO 40 50 U L ( I P ) = ONE / SQRT(X) GO TO 70 60 U L ( I P ) = X * U L ( I R ) 70 IP1 = IP IP = IP + 1 IR = IR + 1 80 CONTINUE 90 CONTINUE GO TO 120 100 WRITE ( 6 , 1 1 0 ) 110 FORMAT ( ' 1 * , ' T R O U B L E ' ) 120 RETURN END SUBROUTINE MNDG(I SEED , SIGMA, RVEC, WKVEC) c C C T h i s s u b r o u t i n e g e n e r a t e s s e t s o f f o u r m u l t i v a r i a t e n o r m a l C d e v i a t e s , d i s t r i b u t e d w i t h z e r o mean and c o v a r i a n c e s m a t r i x C s i g m a . To p r o d u c e g e n e t i c a l l y c o r r e l a t e d n o r m a l d e v i a t e s , C GSIGMA i s e n t e r e d f o r SIGMA, f o r e n v i r o n m e n t a l l y c o r r e l a t e d C n o r m a l d e v i a t e s , ESIGMA i s e n t e r e d . C DIMENSION S I G M A ( I ) , R V E C ( 4 ) , WKVEC(4) CALL DCSIG(SIGMA, SIGMA, A , B) L = 0 DO 10 I = 1 , 4 L = L + I 10 SIGMA(L) = 1.0 / SIGMA(L) GO TO 20 ENTRY MNDG1(ISEED,SIGMA,RVEC,WKVEC) 20 DO 30 I = 1 , 4 30 WKVEC(I) = RN(ISEED) L = 1 DO 50 I I = 1 , 4 R V E C ( I I ) = 0 . 0 DO 40 I = 1, I I R V E C ( I I ) = R V E C ( I I ) + D B L E ( W K V E C ( I ) ) * D B L E ( S I G M A ( L ) ) PROGRAM LISTINGS 40 L = L + 1 50 CONTINUE RETURN END C C C SUBROUTINE F I L E ( I H R D ) T h i s s u b r o u t i n e f i n d s t h e f i l e f o r s t u d e n t h e r d s GO TO ( 1 0 , 2 0 , 3 0 , 4 0 , 5 0 , 6 0 , 7 0 , 8 0 , 9 0 , 100, 110, 120, 130, 1140, 150, 160, 170, 180, 190, 2 0 0 , 2 1 0 , 220 , 2 3 0 , 2 4 0 , 2 5 0 , 2 6 0 , 2 2 7 0 , 2 8 0 , 2 9 0 , 3 0 0 , 3 1 0 , 3 2 0 , 3 3 0 , 3 4 0 , 3 5 0 , 3 6 0 , 3 7 0 , 3 8 0 , 3 9 0 , 3400 , 4 1 0 , 4 2 0 , 4 3 0 , 4 4 0 , 4 5 0 , 4 6 0 , 4 7 0 , 4 8 0 ) , IHRD GO TO 1060 10 CALL FTNCMD( RETURN 20 CALL FTNCMD( RETURN ASSIGN 1 2 = K I N N : H 3 I N ; ' ) 30 CALL FTNCMD( RETURN 40 CALL FTNCMD( RETURN 50 CALL FTNCMD( RETURN 60 CALL FTNCMD( RETURN 70 CALL FTNCMD RETURN 80 CALL FTNCMD RETURN 90 CALL FTNCMD RETURN 100 CALL FTNCMD RETURN 110 CALL FTNCMD RETURN 120 CALL FTNCMD RETURN 130 CALL FTNCMD RETURN 140 CALL FTNCMD RETURN 150 CALL FTNCMD RETURN 1 60 CALL FTNCMD RETURN 170 CALL FTNCMD( RETURN 180 CALL FTNCMD( RETURN 190 CALL FTNCMD( RETURN 200 CALL FTNCMD( RETURN 210 CALL FTNCMD( RETURN 220 CALL FTNCMD( RETURN 230 CALL FTNCMD( RETURN ASSIGN 1 2 = K I N N : H 1 I N ; ' ) ASSIGN 1 2 = K I N N : H 2 I N ; ' ) ASSIGN 1 2 = K I N N : H 4 I N ; ' ) ASSIGN 1 2 = K I N N : H 5 I N ; ' ) ASSIGN 1 2 = K I N N : H 6 I N ; ' ) 'ASSGN 12=KINN:H7IN; ' ) 'ASSIGN 12=KINN:H8IN; ' 'ASSIGN 12=K INN:H9IN; ' 'ASSIGN 12=KINN:H10IN; 'ASSIGN 12 = KINN:H111N; 'ASSIGN 12=KINN:H12IN; 'ASSIGN 12=KINN:H13IN; 'ASSIGN 12=KINN:H14IN; 'ASSIGN 12=KINN:H15IN; 'ASSIGN 12=KINN:H16IN; ASSIGN 12=KINN:H17IN; ' ASSIGN 12=KINN:H18IN; ' ASSIGN 12=KINN:H19IN; ' ASSIGN 12=KINN:H20IN; ' ASSIGN 12=KINN:H21IN; ' ASSIGN 12=KINN:H22IN; ' ASSIGN 12=KINN:H23IN; ' PROGRAM LISTINGS 240 250 260 270 280 290 300 310 320 330 340 350 360 370 380 390 400 410 420 430 440 450 460 470 480 490 500 510 520 530 540 CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN ASSIGN ASSIGN ASSIGN ASSIGN ASSIGN ASSIGN ASSIGN ASSIGN 'ASSIGN ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN •ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN 12=KINN 12=KINN 12=KINN 12=KINN 12=KINN 12=KINN 12=KINN 12=KINN 12=KINN 12=KINN 12=KINN 12=KINN 12=KINN 12=KINN 12=KINN 12=KINN 12=KINN 12=KINN 12=KINN 12=KINN 12=KINN 12=KINN 12=KINN 12=KINN 12=KINN 12=KINN 12=KINN 12=KINN 12=KINN 12=KINN 12=KINN H 2 4 I N ; H 2 5 I N ; H 2 6 I N ; H 2 7 I N ; H 2 8 I N ; H 2 9 I N ; H 3 0 I N ; H 3 1 I N ; H 3 2 I N ; H 3 3 I N ; H 3 4 I N ; H 3 5 I N ; H 3 6 I N ; H 3 7 I N ; H 3 8 I N ; H 3 9 I N ; H 4 0 I N ; H 4 1 I N ; H 4 2 I N ; H 4 3 I N ; H 4 4 I N ; H 4 5 I N ; H 4 6 I N ; H 4 7 I N ; H 4 8 I N ; H 4 9 I N ; H 5 0 I N ; H 5 1 I N ; H 5 2 I N ; H 5 3 I N ; H 5 4 I N ; PROGRAM LISTINGS 550 560 570 580 590 600 610 620 630 640 650 660 670 680 690 700 710 720 730 740 750 760 770 780 790 800 810 820 830 840 850 CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN CALL FTNCMD RETURN 'ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN •ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN •ASSIGN 'ASSIGN •ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN 12=KINN: 12=KINN: 12=KINN: 12=KINN: 12=KINN: 12=KINN: 12=KINN: 12=KINN: 12=KINN: 12=KINN: 12=KINN: 12=KINN: 12=KINN: 12=KINN: 12=KINN: 12=KINN: 12=KINN: 12=KINN: 12=KINN: 12=KINN: 12=KINN: 12=KINN: 12=KINN: 12=KINN: 12=KINN: 12=KINN: 12=KINN: 12=KINN: 12=KINN, 12=RINN 12=KINN H 5 5 I N ; H56IN; H57IN; :H58IN; :H59IN; :H60IN; :H611N; :H62IN; :H63IN; :H64IN; :H65IN; : H 6 6 I N ; : H 6 7 I N ; : H 6 8 I N ; H 6 9 I N ; H 7 0 I N ; H 7 1 I N ; H 7 2 I N ; : H 7 3 I N ; : H 7 4 I N ; : H 7 5 I N ; : H 7 6 I N ; : H 7 7 I N ; : H 7 8 I N ; : H 7 9 I N ; : H 8 0 I N ; : H 8 1 I N ; : H 8 2 I N ; : H 8 3 I N ; : H 8 4 I N ; : H 8 5 I N ; PROGRAM LISTINGS 141 c c c 860 CALL FTNCMD( 'ASSIGN 1 2 = KINN : H 8 6 I N ; ' ) RETURN 870 CALL FTNCMD( 'ASSIGN 12 =KINN : H 8 7 I N ; ' ) RETURN 880 CALL FTNCMD( 'ASSIGN 1 2 =KINN : H 8 8 I N ; ' ) RETURN 890 CALL FTNCMD( 'ASSIGN 12 = KINN : H 8 9 I N ; ' ) RETURN 900 CALL FTNCMD( 'ASSIGN 12 =KINN : H 9 0 I N ; ' ) RETURN 910 CALL FTNCMD( •ASSIGN 1 2 = K I N N : H 9 1 I N ; ' ) RETURN 920 CALL FTNCMD( 'ASSIGN 1 2 = KINN : H 9 2 I N ; ' ) RETURN 930 CALL FTNCMD( 'ASSIGN 12 =KI NN : H 9 3 I N ; ' ) RETURN 940 CALL FTNCMD( 'ASSIGN 1 2 = KINN : H 9 4 I N ; ' ) RETURN 950 CALL FTNCMD( 'ASSIGN 12 =KINN : H 9 5 I N ; ' ) RETURN 960 CALL FTNCMD( 'ASSIGN 1 2 = KI NN : H 9 6 I N ; ' ) RETURN 970 CALL FTNCMD( 'ASSIGN 12 =KINN : H 9 7 I N ; ' ) RETURN 980 CALL FTNCMD( 'ASSIGN 12 =KI NN : H 9 8 I N ; ' ) RETURN 990 C A L L FTNCMD( 'ASSIGN 12 =KINN : H 9 9 I N ; ' ) RETURN 1 000 CALL FTNCMD( 'ASSIGN 12 =KINN : H 1 0 0 I N ; * ) RETURN ENTRY F I L E D ( IHRD) F INDS THE F I L E FOR EACH GROUP OF CONTROL HERDS 1010 I = IHRD / 100 GO TO ( 1 0 2 0 , GO TO 1060 1020 CALL FTNCMD( RETURN 1030 CALL FTNCMD( RETURN 1040 CALL FTNCMD( RETURN 1050 CALL FTNCMD( RETURN 1060 WRITE ( 6 , 1 0 7 0 ) 1070 FORMAT ( ' ERROR EXTRA HERDS') STOP END 1030, 1040, 1 0 5 0 ) , I ' A S S I G N 12=KINN:G100IN(LAST+1) , ' ) ( ' A S S IGN 12=KINN:G200IN(LAST+1) ' ) ' A S S I G N 12=KINN:G300IN(LAST+1) , ' ) ' A S S I G N 12=KINN:G400IN(LAST+1) ' ) PROGRAM LISTINGS 142 Q ********************************************* c * * C * DAIRY CATTLE BREEDING SIMULATION * C * * C * * c * DIMENSION AI ( 3 0 , 5 0 0 ) , P A R M ( 2 5 ) , S I N D E X U ) , OPNMAX(6) , 1 B U L R E C ( 1 3 , 2 0 ) , I B U L L S ( 2 0 ) , I P R O P ( 2 0 ) , L S L A I ( 5 0 0 ) , 2 R N E ( 4 ) , H E N V ( 4 ) , I S P M A T ( I O ) , A S C O R ( 2 , 5 0 0 ) , 3 I S P B U L ( I O ) , M C O W O 0 0 ) , MBUL(100) , M N C C U L ( 5 0 ) , 4 M C F C U L ( 5 0 ) , M Y L C U L ( 5 0 ) , L B U F ( 2 , 1 0 0 ) , I S T A T ( 2 0 ) , 5 R N G ( 4 ) , D U M ( 3 ) , DUMY(4) , I O P ( 2 0 ) COMMON I S E E D , E W K ( 4 ) , GWK(4) LOGICAL* ! A U T ( 3 ) / F , T , T/ , F A L S E / F / , TRUE / T / , AUTFUL / F / , 1 AUTO, CONT, F I N INTEGER I A J B C A ( 4 ) / 3 7 , 3 6 , 35 , 0/ , MPSEM/15/, 1 M A U T ( 2 ) / ' Y E S ' , 'NO '/ , O P T ( 9 ) / ' C U R . ' , ' L A C , ' T . 1 ' EPA ' ' ' , ' ' ' E T A ' ' ' , ' ' / 2 BLK / ' ' ' / , AST1 /' '* '/ , AST2 /' *'* ' / , NHM / 0 / , 3 NCFCUL / 0 / , NOCCUL / 0 / , NYLCUL / 0 / C * C * P a r a m e t e r s t o g e n e r a t e 3 0 5 - d a y l a c t a t i o n r e c o r d s ' C * REAL *4 A V G ( 4 ) / 7 2 0 0 . , 2 6 0 . , 2 3 0 . , 8 0 . / , G S D ( 4 ) / 4 1 3 . , 1 8 . 2 , 1 1 2 . 8 , 1 .66/ , P C E S D ( 4 ) / 3 9 3 . , 1 2 . 6 , 1 1 . 9 , 1 .64/ , T C E S D ( 4 ) 2 / 5 1 0 . , 1 8 . 6 , 1 5 . 4 , 1 .56/ , T H E S D ( 4 ) / 2 5 5 . , 1 1 . 2 , 7 . 7 , 1 . 1 3 / , 3 E S I G M A ( 1 0 ) / 1 . , 0 . 8 3 , 1 . , 0 . 9 6 , 0 . 7 8 , 1 . , 0 . 2 , 0 . 2 , 0 . 2 , 1 ./ , 4 G S I G M A ( 1 0 ) / 1 . , 0 . 5 4 , 1 . , 0 . 7 , 0 . 8 1 , 1 . , 0 . 0 , - 0 . 1 5 , 0 . 0 , 5 1 ./ , H E L V L ( 4 , 4 ) / 1 5 0 . , 6 . 6 , 4 . 5 , 0 . 6 , 5 0 . , 2 . 2 , 1 . 5 , 0 . 2 , 6 - 5 0 . , - 2 . 2 , - 1 . 5 , - . 2 , - 1 5 0 . , - 6 . 6 , - 4 . 5 , - 0 . 6 / , 7 A G E A J M ( 3 , 4 ) / . 7 1 9 5 , . 7 1 5 4 , . 7 1 9 5 , . 8 3 6 8 , . 8 3 8 0 , . 8 3 6 8 , 8 . 9 1 9 7 , . 9 2 4 3 , . 9 1 9 7 , 1 . , 1 . , 1 ./ , P I N B ( 4 ) / 1 0 3 . , 5 4 . 2 6 , 3 . 2 , 0 . 4 1 / C * C * L a c t a t i o n c u r v e p a r a m e t e r s and o t h e r b i o l o g i c a l p a r a m e t e r s * C * REAL *4 A C M T ( 3 ) / - 2 . 8 3 , - 2 . 2 8 , - 2 . 7 / , B S L P ( 3 ) / 4 . 6 3 9 5 E - 3 , 1 4 . 8 9 0 4 E - 3 , 4 . 9 4 9 9 E - 3 / , W K P K ( 3 ) / 1 0 . , 7 . 5 , 7 . 5 / , G E S T / 2 8 3 . / , 2 D C Y C / 2 1 . / , HDCSD / 0 . 0 1 / , HDCM / 0 . 7 5 / , H D M L K / - 2 . E - 5 / , 3 H R D E T ( 4 ) / 1 . 0 , 0 . 8 5 , 0 . 6 5 , 0 . 4 5 / , FERTM / 0 . 7 5 / , 4 FERSD / 0 . 0 1 / , F E R E C / - . 0 2 / , DTRATE / 0 . 0 0 9 / , D T M L K / 2 . E - 6 / , 5 DTREC / 1 . 2 E - 2 / , DTYLG / 0 . 0 2 / , DTCF / 0 . 0 4 / , DTUB / 0 . 0 1 / , 6 HTL / 0 . 0 1 9 / , HTMLK / 2 . E - 6 / , HTREC / 0 . 0 2 9 / , HTYP / - 2 . E - 3 / C * C * E c o n o m i c p a r a m e t e r s ' C * REAL *4 C F I X ( 4 ) / 3 9 9 3 5 . , 3 6 0 1 5 . , 3 2 8 2 5 . , 3 0 0 0 0 . / , CTRNP / 1 . 3 4 / , 1 FDCAR / 2 . 8 0 1 E - 2 / , FDFAT / I . 2 9 0 6 / , FDPRO / . 6 7 3 0 / , 2 F D A Y / 1 . 2 8 2 3 / , FDRY / 1 . 6 8 8 0 / , FDYLG / I . 0 4 3 / , FDCF / . 8 2 1 1 / , 3 CRFAT / 3 . 6 / , CRPROT / 0 . 0 / , PQMLK/52 .34/ , 4 PEXMLK / 3 8 . 1 8 / , PFAT / 4 . 8 0 / , PPROT / 0 . 0 / , 5 PCOWP / 5 2 0 . / , PCOWF / 5 2 0 . / , PCOWH / 3 0 0 . / , PCOWD / 0 . 0 / , PYLG 6 / 5 0 0 . / , PCFO / 3 0 0 . / , PCFH / 1 0 0 . / , PCFB / 5 0 . / , PYSP / 10 0 0 . / C * C * Management p a r a m e t e r s 1 C * REAL *4 H E R T ( 4 ) / . 2 6 , . 3 4 , . 2 7 , . 3 0 / , R E P ( 4 ) / . 5 0 , . 5 1 , . 5 1 , 1 . 5 9 / , D P R O J / 9 0 . / , DRYMIN/50 ./ , D A Y R / 3 6 5 . / , 2 BRDMIN / 5 0 . / , D F B R D / - 1 2 0 . / PROGRAM LISTINGS 143 C C*** C COMPLEX*16 NAUT(3) / ' I N D I V I D U A L L Y 1 'RANDOMLY */ 'BY RANK C * C * C * 1( F i n d h e r d and r e a d p r e v i o u s management d e c i s i o n s and AI WRITE ( 6 , 1 1 9 0 ) READ ( 5 , 1 2 1 0 ) IHRD, CODE, AUTFUL CALL F I L E S ( I H R D ) READ (4) NDAI , NOAI, NUAI , N E A I , N P A I , NTAI IBN = NDAI + 9000 BBNO = IBN NYAI = NEAI - NUAI NHRL = 0 CALL REAMAT(AI , 30 , N T A I , 4) L a s t p a r a m e t e r s u s e d READ (2) PARM IF (CODE . N E . PARM(2)) GO TO 1180 IYR = PARM(3) + 1 PARM(3) = IYR IAUT = PARM(4) ISDA = (PARM(4) IOPT = PARM(5) LEV = (PARM(5) • 12 15 - IAUT) * 10. + 0 . 5 IOPT) * 10 . + 0 . 5 SINDEX(1) SINDEX(2) SINDEX(3) S I N D E X U ) OPNMAX(1) OPNMAX(2) OPNMAX(3) O P N M A X U ) OPNMAX(5) OPNMAX(6) DRYPRD PRDCUL NOBL = IBLA = MSEMP PARM(6) PARM(7) PARM(8) PARM(9) PARM(10) PARM(11) PARM(12) PARM(13) PARM(14) PARM(15) = PARM(16 ) = PARM(17) PARM(18) (PARM(18) • PARM(19 ) NOBL) * 10. + 0 . 5 SEMP CON MCON NYBL IYBA MPYS MPOB NTBS NSPM I SPA QUOTA = MSEMP PARM(19) - = CON * 100. = PARM(20) =(PARM(20) - = PARM(21) = 100 - MPYS = (PARM(21) = PARM(22) = (PARM(22) PARM(23) SEMP + 0 . 5 NYBL) * 10. + 0 . 5 MPYS) NSPM) 100 . 10. 0 . 5 0 . 5 EXCES = PARM(24) NHRD = PARM(25) NBULS = NOBL + NYBL I F (NOBL . L E . NOAI) NEXA = NOBL - NOAI NOBL = NOAI NYBL = NYBL + NEXA I F (NYAI . G T . 0) GO NOBL = NOBL + NYBL NYBL = 0 GO TO 15 TO 18 > PROGRAM LISTINGS 144 18 IF (NYBL . L E . 0) MPYS = 0 I F (NOBL . L E . 0) MPOB = 0 I F (AUTFUL) GO TO 490 20 WRITE ( 6 , 1 2 2 0 ) IHRD, IYR, MAUT(IAUT) NOP = (IOPT - 1) * 3 + 1 LOP = NOP + 2 C * C * M a i n Menu C * WRITE ( 6 , 1 2 3 0 ) L E V , ( O P T ( L ) , L = N O P , L O P ) , SINDEX, OPNMAX, DRYPRD, 1 PRDCUL, MPOB, NOBL, N A U T ( I B L A ) , MPYS, NYBL, N A U T ( I Y B A ) , 2 NSPM, N A U T ( I S P A ) I F ( IBLA . G T . 1) WRITE ( 6 , 1235) MSEMP, MCON WRITE ( 6 , 1 2 4 0 ) C * C*** CHANGE MANAGEMENT DECISIONS ? * C * 30 WRITE ( 6 , 1 2 0 0 ) . READ ( 5 , 1 2 1 0 ) ICH 40 GO TO ( 4 6 0 , 4 3 0 , 4 0 0 , 2 9 0 , 3 8 0 , 6 0 , 5 0 0 ) , ICH GO TO 20 C * C*** I n p u t new b r e e d i n g s t r a t e g y C * 50 WRITE ( 6 , 1 2 5 0 ) MIN, MAX 60 WRITE ( 6 , 1 2 8 0 ) MAX = 20 MIN = 0 READ ( 5 , 1 6 9 0 , E R R = 5 0 ) NOBL I F (NOBL . G T . MAX .OR. NOBL . L T . MIN) GO TO 50 IBLA = 1 IYBA = 3 I F (NOBL . E Q . 0) GO TO 150 GO TO 80 70 WRITE ( 6 , 1 2 5 0 ) MIN, MAX 80 WRITE ( 6 , 1 2 9 0 ) NAUT WRITE ( 6 , 1 2 0 0 ) MIN = 1 MAX = 3 READ ( 5 , 1 6 9 0 , E R R = 7 0 ) IBLA GO TO ( 1 4 0 , 100, 1 0 0 ) , IBLA GO TO 70 90 WRITE ( 6 , 1 2 5 0 ) MIN, MAX 100 WRITE ( 6 , 1 3 2 0 ) MIN = MPSEM MAX = 9999 READ ( 5 , 1 4 1 0 , E R R = 9 0 ) SEMP MSEMP = SEMP I F (MSEMP . G T . MAX .OR. MSEMP . L T . MIN) GO TO 90 GO TO 120 110 WRITE ( 6 , 1 2 5 0 ) MIN, MAX 120 WRITE ( 6 , 1 3 3 0 ) MIN = 10 MAX = 90 READ ( 5 , 1 4 1 0 , E R R = 1 1 0 ) CON MCON = CON + .5 CON = CON / 100 . IF (MCON . G T . MAX .OR. MCON . L T . MIN) GO TO 110 GO TO 140 130 WRITE ( 6 , 1 2 5 0 ) MIN , MAX 140 WRITE ( 6 , 1 3 1 0 ) MIN = 0 PROGRAM LISTINGS MAX = 100 - NOBL READ ( 5 , 1 4 1 0 , E R R = 1 3 0 ) PYS MPYS = PYS + .5 IF (MPYS . G T . MAX .OR. MPYS . L T . MIN) GO TO 130 IF (MPYS . E Q . 0) GO TO 180 GO TO 170 150 MPYS = 100 PYS = 100. GO TO 170 160 WRITE ( 6 , 1 2 5 0 ) MIN, MAX 170 WRITE ( 6 , 1 3 4 0 ) MIN = 1 MAX = 20 - NOBL READ ( 5 , 1 6 9 0 , E R R = 1 6 0 ) NYBL IF (NYBL . G T . MAX .OR. NYBL . L T . MIN) GO TO 160 GO TO 205 200 WRITE ( 6 , 1 2 5 0 ) MIN, MAX 205 GO TO ( 2 1 0 , 212 , 1 9 0 ) , IBLA 210 WRITE ( 6 , 1 2 9 0 ) NAUT WRITE ( 6 , 1 2 0 0 ) MAX = 3 READ ( 5 , 1 6 9 0 , E R R = 2 0 0 ) IYBA IF (IYBA . G T . MAX .OR. IYBA . L T . MIN) GO TO 200 GO TO 190 212 WRITE ( 6 , 1300) N A U T ( 2 ) , NAUT(3) WRITE ( 6 , 1 2 0 0 ) READ ( 5 , 1 6 9 0 , E R R = 2 0 0 ) IYBA IYBA = IYBA + 1 MIN = 2 IF (IYBA . G T . MAX .OR. IYBA . L T . MIN) GO TO 200 GO TO 190 180 NYBL = 0 190 MIN = 1 MAX = 20 NBULS = NOBL + NYBL I F (NBULS . G T . MAX .OR. NBULS . L T . MIN) GO TO 50 GO TO 230 220 WRITE ( 6 , 1 2 5 0 ) MIN, MAX 230 WRITE ( 6 , 1 3 5 0 ) MAX = 10 MIN = 0 READ ( 5 , 1 6 9 0 , E R R = 2 2 0 ) NSPM IF (NSPM . G T . MAX .OR. NSPM . L T . MIN) GO TO 220 IF (NSPM . E Q . 0) GO TO 255 GO TO 250 240 WRITE ( 6 , 1 2 5 0 ) MIN, MAX 250 WRITE ( 6 , 1 3 0 0 ) N A U T ( 1 ) , NAUT(2) WRITE ( 6 , 1 2 0 0 ) MIN = 1 MAX = 2 READ ( 5 , 1 6 9 0 , E R R = 2 4 0 ) I SPA IF ( ISPA . G T . MAX .OR. ISPA . L T . MIN) GO TO 240 255 P A R M U 8 ) = NOBL + IBLA / 10. PARM(1 9 ) = MSEMP + CON PARM(20) = NYBL + IYBA / 10 . PARM(21) = MPYS PARM(22) = NSPM + ISPA / 10 . MPOB = 100 - MPYS I F ( .NOT. A U T ( I S P A ) ) GO TO 12 GO TO 270 260 WRITE ( 6 , 1 2 5 0 ) MIN, MAX 270 WRITE ( 6 , 1 3 6 0 ) PROGRAM LISTINGS 1 4 6 READ ( 5 , 1 2 1 0 , E R R = 5 0 ) NTBS MIN = 1 MAX = NBULS IF (NTBS . G T . MAX .OR. NTBS . L T . PARM(21) = PARM(21) .+ NTBS / 100 GO TO 12 C * C*** C * 280 290 MIN) GO TO 260 I n p u t new d a y s open a n d number o f s e r v i c e s 300 310 320 330 340 350 360 C * C*** C * 370 380 WRITE ( 6 , 1 2 5 0 ) MIN, MAX, IER WRITE ( 6 , 1 3 7 0 ) READ ( 5 , 1 4 1 0 , E R R = 2 9 0 ) OMIN = BRDMIN + DCYC MIN = OMIN MAX = 1000 IER = OPNMAX(1) IF (OPNMAX(1) . L T . MAX = 100 MIN = 1 IER = OPNMAX(2) IF (OPNMAX(2) . G T . IF (OPNMAX(3) . L E . WRITE ( 6 , 1 3 8 0 ) READ ( 5 , 1 4 1 0 , E R R = 3 0 0 ) GO TO 320 ( 6 , 1 2 5 0 ) MIN, MAX ( 6 , 1 3 9 0 ) 1000 0 ( 5 , 1 4 1 0 , E R R = 3 1 0 ) OPNMAX(5) OPNMAX OMIN .OR. OPNMAX(1) . G T . 1 0 0 0 . ) GO TO 280 100, 0 . ) .OR. GO TO OPNMAX(2) 350 . L T . 1.) GO TO 280 OPNMAX(4) WRITE WRITE MAX = MIN = READ IF (OPNMAX(5) . L T . 0 . ) GO TO 310 GO TO 340 WRITE ( 6 , 1 2 5 0 ) MIN, MAX WRITE ( 6 , 1 4 0 0 ) READ ( 5 , 1 4 1 0 , E R R = 3 4 0 ) OPNMAX(6) IF (OPNMAX(6) . L T . 0 . ) GO TO 330 DO 360 J = 1, 6 PARM(J + 9) = OPNMAX(J) GO TO 20 I n p u t new minimum d a i l y p r o d u c t i o n WRITE ( 6 , 1 2 7 0 ) WRITE ( 6 , 1 4 2 0 ) READ ( 5 , 1 4 1 0 , E R R = 3 7 0 ) DRYPRD WRITE ( 6 , 1 4 3 0 ) READ ( 5 , 1 4 1 0 , E R R = 3 7 0 ) PRDCUL IF (DRYPRD . L E . 0 . .OR. PRDCUL PARM(16) = DRYPRD PARM(17) = PRDCUL GO TO 20 . L E . 0 . ) GO TO 370 C * C*** C * 390 400 410 I n p u t new s e l e c t i o n i n d e x WRITE ( 6 , 1 2 6 0 ) WRITE ( 6 , 1 4 4 0 ) READ ( 5 , 1 4 1 0 , E R R = 3 9 0 ) SINDEX SX = A B S ( S I N D E X ( 1 ) + SINDEX(2) I F (SX . E Q . 0 . 0 ) GO TO 390 DO 410 J = 1, 4 S I N D E X ( J ) = S I N D E X ( J ) / SX PARM(J + 5) = S I N D E X ( J ) + SINDEX(3) + S I N D E X ( 4 ) ) PROGRAM LISTINGS GO TO 20 C * C*** New management l e v e l and b a s i s f o r s e l e c t i o n C * 420 WRITE ( 6 , 1 2 5 0 ) MIN, MAX 430 WRITE ( 6 , 1 4 5 0 ) READ ( 5 , 1 6 9 0 , E R R = 4 3 0 ) LEV MAX = 4 MIN = 1 I F (LEV . L T . 1 .OR. LEV . G T . 4) GO TO 420 GO TO 450 440 WRITE ( 6 , 1 2 5 0 ) MIN, MAX 450 WRITE ( 6 , 1 4 6 0 ) WRITE ( 6 , 1 2 0 0 ) READ ( 5 , 1 6 9 0 , E R R = 4 5 0 ) IOPT MAX = 3 IF (IOPT . G T . 3 .OR. IOPT . L T . 1) GO TO 440 PARM(5) = IOPT + LEV / 10. GO TO 20 C * C*** A u t o m a t e d d e c i s i o n s and summary o u t p u t o n l y C * 460 WRITE ( 6 , 1 4 8 0 ) WRITE ( 6 , 1 2 0 0 ) READ ( 5 , 1 2 1 0 , E R R = 4 6 0 ) IAUT IF (IAUT . G T . 2 .OR. IAUT . L T . 1) GO TO 460 470 WRITE ( 6 , 1 4 7 0 ) WRITE ( 6 , 1 2 0 0 ) READ ( 5 , 1 2 1 0 , E R R = 4 7 0 ) ISDA IF (ISDA . G T . 2 .OR. ISDA . L T . 1) GO TO 470 PARM(4) = IAUT + ISDA / 10 . I F ( .NOT . A U T ( I A U T ) ) GO TO 20 480 WRITE ( 6 , 1 4 9 0 ) READ ( 5 , 1 2 1 0 , E R R = 4 8 0 ) NHRD IF (NHRD . L T . 1) GO TO 480 PARM(25) = NHRD GO TO 20 C * C * I N I T I A L I Z E RANDOM NUMBER GENERATORS C * 490 IF ( .NOT. A U T ( I A U T ) ) GO TO 1180 500 IF (NHRL . G T . 0) GO TO 530 IF ( .NOT. A U T ( I S D A ) ) GO TO 510 I N I T = I RAND(0) I N I T = I RAND(1000) GO TO 520 510 WRITE ( 6 , 1 5 0 0 ) READ ( 5 , 1 2 1 0 ) I N I T IF ( I N I T . L E . 0) GO TO 510 520 I = I R A N D ( - I N I T ) I SEED = I N I T S I N I T = I SEED UNIF = RAND(SINIT) SNORM = RANDN(SINIT) CALL MNDG(ISEED, GSIGMA, RNG, GWK) CALL MNDG(ISEED, ESIGMA, RNE, EWK) C * C * S e t t e m p o r a r y h e r d e f f e c t s C * 530 CALL MNDG1(I S E E D , ESIGMA, RNE, EWK) HENV(1) = THESD(1) * RNE(1) HENV(2) = THESD(2) * RNE(2) PROGRAM LISTINGS 148 HENV(3) = THESD(3) * RNE(3) HENV(4) = THESD(4) * RNE(4) C * C * Check i f any o f own b u l l s s e l e c t e d f o r A . I . C * NYSR = 0 HRD = IHRD NFYS = NPAI + 1 I F (NFYS . G T . NTAI) GO TO 545 DO 540 I = NFYS , NTAI IF ( A I ( 5 , I ) . E Q . HRD) NYSR = NYSR + 1 540 CONTINUE 545 I F I N = 1 550 I F (IYBA . E Q . 1) GO TO 560 IF (NOBL . E Q . 0) GO TO 720 IF ( IBLA . G T . 1) GO TO 620 NB = NOBL GO TO 580 560 NB = NBULS GO TO 580 C C*** SELECT BULLS INDIVIDUALLY * C 565 WRITE ( 6 , 1515) GO TO 580 570 WRITE ( 6 , 1 5 1 0 ) I B U L L S ( J ) GO TO 586 580 WRITE ( 6 , 1 5 2 0 ) NB J = 0 585 J = J + 1 586 READ ( 5 , 1690,ERR=570) I B U L L S ( J ) , I P R O P ( J ) , NCS 588 LCBUL = I B U L L S ( J ) - IBN I F (LCBUL . L T . 1 .OR. LCBUL . G T . NEAI) GO TO 570 DO 590 K = 1 , 7 590 B U L R E C ( K , J ) = A I ( K , L C B U L ) B U L R E C ( 8 , J ) = A I ( 1 3 , L C B U L ) DO 600 K = 9 , 12 600 B U L R E C ( K , J ) = A I ( K + 6 , L C B U L ) B U L R E C ( 1 3 , J ) = A I ( 2 7 , L C B U L ) * SINDEX(1) + A I ( 2 8 , L C B U L ) * SINDEX 1 (2) + A I ( 2 9 , L C B U L ) * SINDEX(3) + A I ( 3 0 , L C B U L ) * SINDEX(4) 605 IF ( J . E Q . NB) GO TO 610 IF (NCS . L E . 1) GO TO 585 NCS = NCS - 1 J = J + 1 I B U L L S ( J ) = I B U L L S ( J - I ) + 1 I P R O P ( J ) = I P R O P ( J - I ) GO TO 588 C * C * A l l ok ? C * 610 CALL PRINTL (I B U L L S , NB, 6, 0) CALL PRINTL ( IPROP, NB, 6, 0) WRITE ( 6 , 1 5 3 0 ) READ ( 5 , 1 5 4 0 , E R R = 5 8 0 ) CONT IF (CONT) GO TO 580 IF ( J . L T . 2) GO TO 616 DO 615 I = 2, J 615 1 PROP(I) = I PROP(I) + I PROP(I - 1) 616 IF (NBULS . G T . NB) GO TO 720 IF (IPROP(NB) . L E . 0) GO TO 565 GO TO 860 PROGRAM LISTINGS C * F i n d p r o v e n b u l l s t h a t meet minimum c r i t e r i a C * 620 NSTB = 0 DO 630 1 = 1 , NOAI IF ( A I ( 7 , I ) . G T . SEMP) GO TO 630 I F ( A I ( 1 1 , 1 ) . L E . 0 . 0 ) GO TO 630 FERT = A I ( 1 2 , 1 ) / A I ( 1 1 , 1 ) IF (FERT . L T . CON) GO TO 630 NSTB = NSTB + 1 L S L A I ( N S T B ) = I 630 CONTINUE NFT = 1 NLT = NOBL I F ( IBLA . G T . 2) GO TO 740 IF (NSTB . G E . NOBL) GO TO 640 NYBL = NYBL + NOBL - NSTB NOBL = NSTB NLT = NOBL IF (NOBL . L E . 0) GO TO 720 C * C*** SELECT BU11S BY INDEX RANK C * 640 DO 650 I = NFT , NSTB LAI = L S L A I ( I ) A S C O R ( 2 , l ) = A I ( 2 7 , L A I ) * S I N D E X ( 1 ) + A I ( 2 8 , L A I ) 1 *SINDEX(2) + A I ( 2 9 , L A I ) * S I N D E X ( 3 ) + A I ( 3 0 , L A I ) 2 *SINDEX(4) ASCOR(1,1) = LAI 650 CONTINUE CALL ISORT (ASCOR, 2, 5 0 0 , NFT , NSTB , 2, 3, - 1 ) DO 655 I = NFT , NLT L S L A I ( I ) = ASCOR(1,1) BULREC(1,1) = L S L A I ( I ) B U L R E C ( 1 3 , I ) = A S C O R ( 2 , I ) 655 CONTINUE IF (NBULS . L E . NLT) GO TO 760 C * C * S t o r e l o c a t i o n s of young b u l l s C * 680 IF (NYBL . L E . 0) GO TO 760 720 NSTB = NOBL NFAI = NUAI + 1 DO 730 I = N F A I , NEAI NSTB = NSTB + 1 L S L A I ( N S T B ) = I 7 30 CONTINUE NFT = NOBL + 1 NLT = NBULS I F I N = 2 IF (NSTB . G E . NLT) GO TO 735 NFBS = NSTB + 1 NYAI = NSTB - NOBL DO 732 I = NFBS , NLT NSTB = NSTB + 1 LOC = I RAND (NYAI) + NOBL L S L A I ( N S T B ) = L S L A I ( L O C ) 732 CONTINUE 735 I F (IYBA . E Q . 2) GO TO 640 C*** c *** SELECT BULLS AT RANDOM C*** 740 NOS = NFT - 1 PROGRAM LISTINGS NRNG = NSTB - NOS 745 DO 750 I = NFT , NLT K = I RAND (NRNG) + NOS LAI = L S L A I ( K ) B U L R E C ( 1 , 1 ) = LAI B U L R E C ( 1 3 , I ) = A I ( 2 7 , L A I ) * SINDEX(1) + A I ( 2 8 , L A I ) 1 *SINDEX(2) + A I ( 2 9 , L A I ) * SINDEX(3) + A I ( 3 0 , L A I ) 2 *SINDEX(4) 750 CONTINUE DO 755 I = NFT , NLT L S L A I ( I ) = B U L R E C ( 1 , 1 ) 755 CONTINUE IF (NLT . L T . NBULS) GO TO 720 C * C * F i l l i n b u l l s i n f o r m a t i o n and p r o p o r t i o n s t o use C * 760 IF (NOBL . L E . 0) GO TO 790 IF ( IBLA . L E . 1) GO TO 780 IPOB = MPOB / NOBL + 1 KPOB = 0 DO 770 1 = 1 , NOBL KPOB = KPOB + IPOB LOC = L S L A I ( I ) I P R O P ( I ) = KPOB DO 763 J = 1, 7 B U L R E C ( J , I ) = A I ( J , L O C ) 763 CONTINUE B U L R E C ( 8 , I ) = A I ( 1 3 , L O C ) DO 765 J = 9 , 12 B U L R E C ( J , I ) = A l ( J + 6 , L O C ) 765 CONTINUE I B U L L S ( I ) = B U L R E C ( 1 , 1 ) 770 CONTINUE 78*0 I F (NYBL . L E . 0) GO TO 860 NM = NOBL + 1 KPOB = I PROP(NOBL) IPOB = (MPYS * KPOB / MPOB) / NYBL GO TO 800 790 IPOB = MPYS / NYBL + 1 KPOB = 0 NM = 1 800 DO 830 I = NM, NBULS KPOB = KPOB + IPOB I P R O P ( I ) = KPOB LOC = L S L A I ( I ) DO 810 J = 1, 7 B U L R E C ( J , I ) = A I ( J , L O C ) 810 CONTINUE B U L R E C ( 8 , 1 ) = A I ( 1 3 , L O C ) DO 820 J = 9 , 12 B U L R E C ( J , I ) = A I ( J + 6 , L 0 C ) 820 CONTINUE I B U L L S ( I ) = B U L R E C ( 1 , 1 ) 830 CONTINUE 860 IF ( A U T ( I A U T ) ) GO TO 1060 I F ( A U T ( I S P A ) .OR. NSPM . L E . 0) GO TO 920 C C*** S e l e c t i n d i v i d u a l m a t i n g s f o r b u l l c a l v e s C I F ( .NOT . A U T ( I B L A ) ) GO TO 880 870 WRITE ( 6 , 1 5 7 0 ) CALL P R I N T L ( I B U L L S , NBULS, 6, 10) PROGRAM LISTINGS 1 5 1 880 WRITE ( 6 , 1 5 6 0 ) NSPM WRITE ( 6 , 1 5 5 0 ) CALL REARY2(NSPM, ISPMAT, I S P B U L , L B U F , CONT) DO 910 J = 1, NSPM 890 DO 900 K = 1, NBULS I F ( I S P B U L ( J ) . E Q . I B U L L S ( K ) ) GO TO 910 900 CONTINUE WRITE ( 6 , 1 5 8 0 ) I S P B U L ( J ) , I S P M A T ( J ) READ ( 5 , 1 5 9 0 ) I S P B U L ( J ) GO TO 890 910 I S P B U L ( J ) = K IF (CONT) GO TO 870 WRITE ( 6 , 1 5 3 0 ) READ ( 5 , 1 5 4 0 , E R R = 8 7 0 ) CONT I F (CONT) GO TO 870 920 WRITE ( 6 , 1 6 0 0 ) C C*** OTHER OPTIONAL S P E C I F I E D MATINGS AND CULLS C READ ( 5 , 1 2 1 0 , E R R = 9 2 0 ) ICOPT 930 GO TO ( 9 4 0 , 9 9 0 , 1040, 1050, 1 0 7 0 ) , ICOPT 940 IF ( .NOT . A U T ( I B L A ) ) GO TO 950 WRITE ( 6 , 1 5 7 0 ) CALL P R I N T L ( I B U L L S , NBULS, 6, 10) 950 WRITE ( 6 , 1 6 1 0 ) READ ( 5 , 1 2 1 0 , E R R = 9 5 0 ) NHM I F (NHM . L E . 0) GO TO 920 IF (NHM . G T . 100) GO TO 950 WRITE ( 6 , 1 5 6 0 ) NHM WRITE ( 6 , 1 5 5 0 ) CALL REARY2(NHM, MCOW, MBUL, L B U F , CONT) IF (CONT) GO TO 950 DO 980 J = 1, NHM 960 DO 970 K = 1, NBULS I F (MBUL(J) . E Q . I B U L L S ( K ) ) GO TO 980 970 CONTINUE WRITE ( 6 , 1 5 7 0 ) CALL P R I N T L ( I B U L L S , NBULS, 6, 10) WRITE ( 6 , 1 5 8 0 ) M B U L ( J ) , MCOW(J) READ ( 5 , 1 5 9 0 ) MBUL(J) GO TO 960 980 MBUL(J) = K WRITE ( 6 , 1 5 3 0 ) READ ( 5 , 1 5 4 0 , E R R = 9 5 0 ) CONT IF (CONT) GO TO 950 GO TO 920 990 IF ( .NOT. A U T ( I B L A ) ) GO TO 1000 WRITE ( 6 , 1 5 7 0 ) CALL P R I N T L ( I B U L L S , NBULS, 6, 10) 1000 WRITE ( 6 , 1620) READ ( 5 , 1 2 1 0 , E R R = 1 0 0 0 ) NCFCUL I F (NCFCUL . L E . 0) GO TO 1000 WRITE ( 6 , 1 6 3 0 ) NCFCUL WRITE ( 6 , 1 5 5 0 ) CALL REARRY(NCFCUL, MNCCUL, CONT) IF (CONT) GO TO 1000 WRITE ( 6 , 1 5 3 0 ) READ ( 5 , 1 5 4 0 , E R R = 1 0 0 0 ) CONT IF (CONT) GO TO 1000 1010 WRITE ( 6 , 1 6 4 0 ) READ ( 5 , 1 2 1 0 , E R R = 1 0 1 0 ) ICHPB DO 1020 J = 1, NBULS PROGRAM LISTINGS IF ( I B U L L S ( J ) . E Q . ICHPB) GO TO 1030 1020 CONTINUE WRITE ( 6 , 1 5 8 0 ) ICHPB GO TO 1010 1030 ICHPB = J GO TO 920 1040 WRITE ( 6 , 1 6 5 0 ) READ ( 5 , 1 2 1 0 , E R R = 1 0 4 0 ) NOCCUL IF (NOCCUL . L E . 0) GO TO 1040 WRITE ( 6 , 1 6 6 0 ) NOCCUL WRITE ( 6 , 1 5 5 0 ) CALL REARRY(NOCCUL, MCFCUL, CONT) IF (CONT) GO TO 1040 WRITE ( 6 , 1 5 3 0 ) READ ( 5 , 1 5 4 0 , E R R = 1 0 4 0 ) CONT I F (CONT) GO TO 1040 GO TO 920 1050 WRITE ( 6 , 1 6 7 0 ) READ ( 5 , 1 2 1 0 , E R R = 1 0 5 0 ) NYLCUL I F (NYLCUL . L E . 0) GO TO 1050 WRITE ( 6 , 1 6 8 0 ) NYLCUL WRITE ( 6 , 1 5 5 0 ) CALL REARRY(NYLCUL, MYLCUL, CONT) I F (CONT) GO TO 1050 WRITE ( 6 , 1 5 3 0 ) READ ( 5 , 1 5 4 0 , E R R = 1 0 5 0 ) CONT IF (CONT) GO TO 1050 GO TO 920 1060 WRITE ( 6 , 1 7 0 0 ) IHRD, IYR, I N I T C C I N I T I A L I Z E SUBROUTINES C 1070 CALL BREED(BULREC, I B U L L S , IPROP, ISPMAT, I S P B U L , MCOW, MBUL, 1 MNCCUL, NBULS, NSPM, I S P A , NTBS, NHM, NCFCUL, ICHPB, 2 A U T ( I A U T ) , GSD, GSIGMA, BRDMIN, H R D E T ( L E V ) , DCYC, GEST , 3 DAYR) CALL INLAC ( H E L V L ( 1 , L E V ) , HENV, ESIGMA, TCESD, AVG) CALL INPROD(DRYPRD, DRYMIN, DAYR, DPROJ , AGEAJM, FDCAR, FDFAT , 1 FDPRO, FDAY, ACMT, B S L P , WKPK, DUM, DUM, DUMY, 3, 4) CALL I N E T A ( A I , SINDEX, AVG, I A J B C A , HERT, REP , DAYR, NOAI , BBNO, 1 DPROJ , DUMY, DUMY, DUMY, DUMY, DUMY, DUMY, DUMY, DUMY, DUMY, 2 4) CALL S E L E C ( I O P T , A U T ( I A U T ) , QUOTA, EXCES , DPROJ , DAYR, FDRY, 1 PRDCUL) CALL YOUNG(SINDEX, MCFCUL, NOCCUL, IYR , IHRD, DAYR, DTYLG, DTCF , 1 FDYLG , FDCF , A U T ( I A U T ) ) CALL CALVES(ESIGMA, PCESD, P I N B , SINDEX, FDCF , FERSD, FERTM, 1 HDCSD, HDCM, DTCF , DTUB, IHRD, DAYR, IYR, A U T ( I A U T ) ) CALL SUMOUT(QUOTA, PQMLK, E X C E S , PEXMLK, PFAT , CRFAT , PPROT, 1 CRPROT, PCOWP, PCOWF, PCOWH, PCOWD, PYLG , PCFO , PCFH , P C F B , 2 P Y S P , C F I X ( L E V ) , CTRNP, NYSR, AVG, I A J B C A , A U T ( I A U T ) , AUTFUL) IF ( A U T ( I A U T ) ) GO TO 1170 C C*** O u t p u t h a r d c o p y o f a l l management d e c i s i o n s f o r t h e c u r r e n t y e a r * C WRITE ( 1 0 , 1 7 0 0 ) IHRD, IYR, I N I T WRITE ( 1 0 , 1 2 3 0 ) L E V , ( O P T ( L ) , L = N O P , L O P ) , SINDEX, OPNMAX, DRYPRD, 1 PRDCUL, MPOB, NOBL, N A U T ( I B L A ) , MPYS, NYBL , N A U T ( I Y B A ) , 2 NSPM, NAUT(ISPA) IF ( IBLA . G T . 1) WRITE ( 1 0 , 1235) MSEMP, MCON IP = 0 DO 1110 J = 1, NBULS PROGRAM LISTINGS 1 I O P ( J ) = I P R O P ( J ) - IP IP = I P R O P ( J ) K = B U L R E C ( 8 , J ) / 2 0 . + 1.99 I F (K - 2) 1080, 1090, 1100 1080 I S T A T ( J ) = AST2 GO TO 1110 1090 I S T A T ( J ) = AST1 GO TO 1110 1100 I S T A T ( J ) = BLK 1110 CONTINUE WRITE ( 1 0 , 1 7 1 0 ) CALL P R I N T L ( I B U L L S , NBULS, 10, 10) CALL P R I N T L ( I O P , NBULS, 10, 10) CALL P R I N T L ( I STAT , NBULS, 10, 20) WRITE ( 1 0 , 1 7 2 0 ) ( B U L R E C ( 1 3 , J ) , J = 1 , N B U L S ) L I N E = 33 1120 IF (NSPM . L E . 0 .OR. A U T ( I S P A ) ) GO TO 1130 WRITE ( 1 0 , 1 7 3 0 ) CALL P R INT L ( IS P M A T , NSPM, 10, 10) CALL P R I N T L ( I S P B U L , NSPM, 10, 10) L I N E = L I N E + 3 1130 IF (NHM . L E . 0) GO TO 1140 WRITE ( 1 0 , 1 7 4 0 ) CALL PRINTL(MCOW, NHM, 10, 10) CALL PRINTL(MBUL, NHM, 10, 10) L I N E = L I N E + 3 1140 IF (NCFCUL . L E . 0) GO TO 1150 WRITE ( 1 0 , 1 7 5 0 ) ICHPB CALL PRINTL(MNCCUL, NCFCUL, 10, 10) L I N E = L I N E + 2 1150 IF (NOCCUL . L E . 0) GO TO 1160 WRITE ( 1 0 , 1 7 6 0 ) CALL PRINTL(MCFCUL , NOCCUL, 10, 10) L I N E = L I N E + 2 1160 IF (NYLCUL . L E . 0) GO TO 1170 WRITE ( 1 0 , 1 7 7 0 ) CALL PRINTL(MYLCUL , NYLCUL, 10, 10) L I N E = L I N E + 2 1170 WRITE (12) PARM C * C * S i m u l a t e h e r d y e a r and c h e c k i f more h e r d s C * CALL GENREC(OPNMAX, MYLCUL, SINDEX, DRYPRD, IHRD, IYR, NYLCUL, 1 I O P T , A U T ( I A U T ) , DPROD, DAYR, DTRATE , DTMLK, DTREC, I A J B C A , 2 AVG, H R D E T ( L E V ) , HDMLK, F E R E C , DCYC, DPROJ, BRDMIN, DFBRD, 3 FDRY, G E S T , H T L , HTMLK, HTREC, HTYP, L I N E ) NHRL = NHRL + 1 IHRD = IHRD + 1 WRITE ( 7 ' I H R D , 1690) IYR, IHRD IF (NHRD-NHRL . G T . 0) GO TO 10 GO TO 1790 1180 WRITE ( 6 , 1 7 8 0 ) 1190 FORMAT (20X , 'DAIRY CATTLE BREEDING S I M U L A T I O N ' , / , 20X, 3 2 ( ' - ' ) , 1 ////, 3X, 'YOU WILL BE PROMPTED FOR D E C I S I O N S ' , //, 3X, 2 ' - ENTER ALL VALUES ON ONE L I N E (EXCEPT WHEN E N T E R I N G ' , 3 ' A N I M A L S ) ' , /, 3X, ' - WHEN ENTERING ANIMALS START A NEW ' , 4 ' L I N E FOR EACH A N I M A L ' , /, 3X, ' - EACH VALUE ENTERED M U S T ' , 5 ' BE FOLLOWED BY A COMMA ! ! ' , ///, 'HERD NUMBER AND CODE ?' 6 ) 1200 FORMAT ( 'OPTION ? ' ) 1210 FORMAT ( 1 1 2 , F 1 2 . 0 , L 1 ) 1220 FORMAT (/ , ' H E R D ' , 1 4 , ' SIMULATION OF Y E A R ' , 1 4 , //, 6X, PROGRAM LISTINGS 154 1 2 1230 FORMAT 1 2 3 4 5 6 7 8 9 * 1 2 3 4 5 1235 FORMAT 1 1 1 240 1 250 1260 1 270 1280 1290 FORMAT FORMAT FORMAT FORMAT FORMAT FORMAT 1 1300 FORMAT 1 1310 1 320 1 330 1340 1350 1 360 1 370 1 1390 1400 1410 1420 1430 1 1 450 1 460 1 1490 1500 1510 1515 MANAGEMENT DECISIONS S E L E C T E D ' , //, 1 OUTPUT PRINTED COPY OF HERDS ? ' , A3) 2 MANAGEMENT L E V E L O F ' , 1 3 , /, 9X, RANKING AND CULLING BASED ON: ' , 3A4, /, 3 WEIGHTINGS FOR THE SELECTION INDEX : ' , /, 9X, M I L K ' , F 7 . 2 , ' F A T ' , F 7 . 2 , ' P R O T E I N ' , F 7 . 2 , T Y P E ' , F 7 . 2 , /, 4 NUMBER OF DAYS OPEN OR SERVICES : ' , /, 9X, F 4 . 0 , DAYS O R ' , F 4 . 0 , ' SERVICES WITH E X T R A ' , ' FOR THE T O P ' , 4 . 0 , ' COWS' , /, 9X, 'BASED ON AN ' , ' E X P O N E N T ' , F 7 . 3 , AN ADJUSTMENT FOR D A Y S ' , F 7 . 2 , /, 9X, AND AN ADJUSTMENT FOR S E R V I C E S ' , F 7 . 3 , / , 5 MINIMUM DAILY MILK P R O D U C T I O N : ' , /, 9X, ' A T ' , F 5 . 1 KG/DAY A COW IS DRIED O F F ' , /, 9X, ' A T ' , F 5 . 1 , KG/DAY A CULL COW IS S O L D ' , /, ' 6 M A T I N G S - ' , 15 , % T O ' , 14 , ' PROVEN SIRES SELECTED ' , 2A8 , /, 9X, 1 3 , % T O ' , 14 , ' YOUNG SIRES SELECTED ' , 2A8 , /, 9X, ' S P E C I A L M A T E ' , 1 4 , ' COWS SELECTED ' , 2A8) 9X, 'MAXIMUM SEMEN PRICE $ ' , 1 5 , ' / V I A L ' MINIMUM C O N C E P T I O N ' , 14 , '%') 7 CONTINUE ') ERROR - MINIMUM VALUE I S ' , 14 V A L U E ' , 14 , ' ? ' ) ERROR WEIGHTS SUM TO " 0 " ' ) ERROR PRODUCTION MUST BE GREATER THAN " 0 " ' ) NUMBER OF PROVEN SIRES ? ' ) S E L E C T I O N ' , /, ' , 2A8) S E L E C T I O N ' , /, FORMAT FORMAT FORMAT FORMAT FORMAT FORMAT FORMAT 1 1380 FORMAT FORMAT FORMAT FORMAT FORMAT FORMAT 1 1440 FORMAT FORMAT FORMAT 1 2 3 1470 FORMAT 1 2 1480 FORMAT FORMAT FORMAT FORMAT FORMAT 4X, MAXIMUM I S ' , 15 , OF 3 OF 1 1 2A8, 2A8, ENTER THE METHOD 2 ' , 2A8, /, ' ENTER THE METHOD 2 ' , 2A8) PERCENT OF MATINGS TO YOUNG SIRES ? ' ) MAXIMUM SEMEN PRICE ? ' ) MINIMUM CONCEPTION RATE ? ' ) NUMBER OF YOUNG BULLS ? ' ) NUMBER OF SPECIAL MATINGS ? ' ) NUMBER OF TOP BULLS TO USE FOR S P E C I A L MATINGS ? ' ) ENTER THE MINIMUM NUMBER OF DAYS AND S E R V I C E S ' , / , AND THE NUMBER OF TOP COWS TO KEEP LONGER') PRESS RETURN FOR TWO LEVELS O R ' , / , ENTER THE EXPONENT FOR AN EXPONENTIAL R E L A T I O N S H I P ' ) ADJUSTMENT FOR DAYS ? ' ) ADJUSTMENT FOR SERVICES ? ' ) 6 F 1 0 . 2 ) DAILY MILK PRODUCTION AT WHICH TO DAILY MILK PRODUCTION AT WHICH TO SELECTED FOR CULLING ? ' ) ENTER THE SELECTION INDEX WIEGHTS F O R ' , /, MILK , F A T , PROTEIN, AND T Y P E ' ) MANAGEMENT L E V E L ? ' ) CULLING DECISIONS TO BE BASED ON / , / , DRY OFF A COW S E L L A COW ' , ?' ) /, /, 1 CURRENT L A C T A T I O N ' , /, 2 ESTIMATED PRODUCING A B I L I T Y ' 3 ESTIMATED TRANSMITTING A B I L I T Y ' ) THE RANDOM NUMBER GENERATORS TO BE I N I T I A L I Z E D W I T H ' , 1 A NUMBER TO BE S P E C I F I E D ' , / , ' 2 A RANDOM' NUMBER') THE OUTPUT TO B E ' , / , ' 1 2 ONLY SUMMARIES STORED') 'NUMBER I F HERDS IN THIS GROUP ? ' ) ' INTEGER SEED ? ' ) B U L L ' , 1 5 , ' DOES NOT E X I S T ' ) ' A T LEAST ONE BULL MUST BE BRED TO A PROPORTION > 0 ' ) FULL PRINTED O U T P U T ' , / , PROGRAM LISTINGS 1520 FORMAT ( 1 ' BULL 1530 FORMAT 1540 FORMAT 1550 FORMAT 1560 FORMAT 1570 FORMAT 1580 FORMAT 1 1590 FORMAT 1600 FORMAT 1 2 3 4 1610 FORMAT 1620 FORMAT 1630 FORMAT 1640 FORMAT 1650 FORMAT 1660 FORMAT 1670 FORMAT 1680 FORMAT 1690 FORMAT 1700 FORMAT 1 1710 FORMAT 1 2 1720 FORMAT 17 30 FORMAT 1740 FORMAT 1750 FORMAT 1 1760 FORMAT 1770 FORMAT 1780 1790 END ' E N T E R ' , 14 , ' BULLS EACH ON A SEPARATE L I N E ! ' , /, NUMBER, THE PROPORTION TO USE HIM AND PRESS RETURN') 'PRESS RETURN IF OK. ENTER "T" TO R E - E N T E R ' ) L1 ) 'START A NEW L I N E FOR EACH ANIMAL ! ' ) E N T E R ' , 14 , ' COWS EACH FOLLOWED BY A B U L L ' ) BULLS A V A I L A B L E ' ) B U L L ' , 1 5 , ' NOT A V A I L A B L E ' , /, ' CHOOSE ANOTHER' BULL TO BREED T O ' , 15) 110) 5X, 'OTHER OPTIONS FOR S P E C I F I C ANIMALS' 1 MAKE S P E C I F I C M A T I N G S ' , / , 2 S E L L WEEK OLD C A L V E S ' , /, 3 SELL YEAR OLD C A L V E S ' , /, ' 4 5 C O N T I N U E ' , / , 'OPTION ? ' ) NUMBER OF INDIVIDUAL MATINGS ? ' ) NUMBER OF NEW CALVES TO BE CULLED ? ' ) E N T E R ' , 1 4 , ' COWS') ENTER A CHEAP BULL TO USE ON THESE COWS') NUMBER OF OLD CALVES TO BE CULLED ? ' ) E N T E R ' , 1 4 , ' YEAR OLD C A L V E S ' ) NUMBER OF YEARLINGS TO BE CULLED ? ' ) E N T E R ' , 14 , ' Y E A R L I N G S ' ) 61 10) ' : ' , //, 30X, ' H E R D ' , 1 5 , 6X, ' Y E A R ' , 1 5 , 8X, THE SEED W A S ' , 1 7 , /, ' + ' , 29X, 2 4 ( ' _ ' ) , /) //, ' BULLS USED, THEIR PROPORTION OF USE AND' S E L L YEARLINGS' THEIR I N D E X ' , / , 10X, ' ( * ) PRELIMINARY (**) PEDIGREE ESTIMATE O N L Y ' , /) 3X, 2 0 F 6 . 1 , //) SPECIAL MATINGS ' ) OTHER HAND MATINGS ' ) COWS TO BE BRED T O ' , 1 5 , ' AND TO HAVE' THE CALVES S O L D ' ) ' CALVES TO BE C U L L E D ' ) YEARLINGS TO BE C U L L E D ' ) FORMAT ( ' INCORRECT C O D E ' ) STOP PROOF O N L Y ' , 1 OX, Q ******************************************* C * * C * T h i s s u b r o u t i n e g e n e r a t e s cows r e c o r d s f o r a l l cows and * C * y e a r l i n g s . * Q ******************************************************************** C SUBROUTINE GENREC(OPNMAX, MYLCUL, SINDEX, DRYPRD, IHRD, IYR , 1 NYLCUL, I S E L , AUTO, DPROD, DAYR, DTRATE , DTMLK, DTREC, 2 I A J B C A , AVG, HRDET, HDMLK, F E R E C , DCYC, DPROJ , BRDMIN, 3 DFBRD, DRYFD, G E S T , H T L , HTMLK, HTREC, HTYP, L I N E ) C DIMENSION HRDCOW(40 ,250) , H R D Y L G ( 1 8 , 1 0 0 ) , A G E ( 2 5 0 ) , O L D A T ( 2 5 0 ) , 1 O S T A R T ( 2 5 0 ) , O F I N ( 2 5 0 ) , O S T O P ( 2 5 0 ) , D S T A R T ( 2 5 0 ) , 2 D F I N ( 2 5 0 ) , D S T O P ( 2 5 0 ) , O Y R L A C ( 4 , 2 5 0 ) , O L D L A C ( 4 , 2 5 0 ) , 3 D Y R L A C ( 4 , 2 5 0 ) , E T A ( 4 , 2 5 0 ) , E P A ( 4 , 2 5 0 ) , O A P R D ( 3 , 2 5 0 ) , 4 D A P R D ( 3 , 2 5 0 ) , O U T D A T ( 2 5 0 ) , P B C A ( 4 ) , T A P R D U ) , H B C A ( 4 ) , 5 H P A ( 4 ) , H T A ( 4 ) , S C U R ( 4 ) , D E T A ( 4 ) , OPNMAX(6), . S I N D E X ( 4 ) , 6 TRPRD ( 3 ) , M C F C U L ( 5 0 ) , M Y L C U L ( 5 0 ) , D B C A ( 4 ) , I A J B C A U ) , 7 A V G ( 4 ) , S C O R E ( 3 , 2 5 0 ) , C U R B C A ( 4 , 2 5 0 ) , C O W S ( 2 5 0 ) , 8 T A C P R D ( 3 ) , P A C B C A U ) , O L D R B ( 2 5 0 ) , D U E P K ( 2 5 0 ) , PROGRAM LISTINGS 9 O L D P K ( 2 5 0 ) , R P R D ( 3 ) , DFER{2) C LOGICAL*1 OLCOW, CULL / F / , F A L S E / F / , TRUE / T / , F I N I S H , AUTO 10 CALL I N B L U P ( I A J B C A , AVG) CALL I N K I L ( G E S T ) DO 20 I = 1, 3 T A P R D ( I ) = 0 . 0 P B C A ( I ) = 0 . 0 20 TRPRD(I) = 0 . 0 TAPRD(4) = 0 . 0 PBCA(4) = 0 . 0 TDP = 0 . 0 NCLAC = 0 NPCUL = 0 NFCUL = 0 NHCUL = 0 NDCUL = 0 NYCUL = 0 NYC = 1 NRLAC = 0 TAGE = 0 . 0 F INISH = F A L S E OLCOW = TRUE NOPNEX = OPNMAX(3) + 1. C NHYS = IYR * 500 + IHRD READ (2) NOC IF (NOC . E Q . 0) GO TO 440) C * C * Read i n o l d cows C * CALL REAMAT(HRDCOW, 4 0 , NOC, 2) NCOW = 0 NC = NOC 30 DO 430 I = 1, NC NCOW = NCOW + 1 IF (OLCOW) GO TO 70 C * C * I n i t i a l i z e y e a r l i n g r e c o r d C * 40 DO.50 J = 1, 4 HRDCOW(J,NCOW) = H R D Y L G ( J , I ) HRDCOW(j + 10,NCOW) = HRDYLG(J + 6,1) HRDCOW(J + 14,NCOW) = HRDYLG(J + 10,1) HRDCOW(J + 34,NCOW) = HRDYLG(J + 14,1) HRDCOW(J + 18,NCOW) = 0 . 0 HRDCOW(j + 22,NCOW) = 0 . 0 HRDCOW(J + 26,NCOW) = 0 . 0 HRDCOW(J + 30,NCOW) = 0 . 0 50 CONTINUE HRDCOW(5,NCOW) = 150. BRLAST = 1.0 HRDCOW(39,NCOW) = H R D Y L G ( 5 , I ) HRDCOW(4 0,NCOW) = HRDYLG(6,1) NREC = 0 I STAT = 1 DUEDAT = H R D Y L G ( 4 , I ) - BRDMIN + DFBRD FUTDAT = - 1. DUERB = 0 . 60 I F (NYLCUL . L E . 0) GO TO 80 ICOW = HRDCOW(1,NCOW) IF (ICOW . L T . MYLCUL(NYC)) GO TO 80 PROGRAM LISTINGS 157 NYC = NYC + 1 I F (NYC . G T . NYLCUL) NYLCUL = 0 I F (ICOW . N E . MYLCUL(NYC - 1)) GO TO 60 NYCUL = NYCUL + 1 I STAT = 7 GO TO 80 C * C * F i n d a cows o l d r e c o r d and s e t s t a t u s C * 70 NREC = HRDCOW(6,NCOW) I STAT = HRDCOW(7,NCOW) DUEDAT = HRDCOW(8,NCOW) - DAYR FUTDAT = HRDCOW(9,NCOW) BRLAST = HRDCOW(10,NCOW) DUERB = 10 . * (HRDCOW(6,NCOW) - NREC) + HRDCOW(7,NCOW) - I STAT 80 RANK = HRDCOW(5,NCOW) I RANK = RANK COWS(NCOW) = HRDCOW(1,NCOW) I AGE = IYR + 10 - IFIX(HRDCOW(1 ,NC0W)/100 . ) AGE(NCOW) = F L O A T ( IA G E ) - HRDCOW(4,NCOW) / DAYR + 1. I F (HRDCOW(1,NCOW) . G T . 10000 . .OR. HRDCOW(1,NCOW) . L T . 1.) 1 GO TO 410 OSTART(NCOW) = 0 . 0 DSTART(NCOW) = 0 . 0 OSTOP(NCOW) = 0 . 0 DSTOP(NCOW) = 0 . 0 OFIN(NCOW) = 0 . 0 DFIN(NCOW) = 0 . 0 DO 90 J = 1, 3 OYRLAC(J,NCOW) = 0 . 0 DYRLAC(J,NCOW) = 0 . 0 OAPRD(J,NCOW) = 0 . 0 DAPRD(J,NCOW) = 0 . 0 90 CONTINUE OYRLAC(4,NCOW) = 0 . 0 DYRLAC(4,NCOW) = 0 . 0 DEVMLK = (HRDCOW(11,NCOW) + HRDCOW(15,NCOW)) / AVG(1) D F E R ( 1 ) = HRDCOW(39,NCOW) + HDMLK * DEVMLK D F E R ( 2 ) = HRDCOW(40,NCOW) + FEREC * NREC DOPMAX = OPNMAX(1) ISEMAX = OPNMAX(2) I F (NOPNEX . L E . 1) GO TO 100 EXOP = NOPNEX - RANK I F (EXOP . L E . 0 . 0 ) GO TO 100 OX = EXOP ** OPNMAXU) DOPMAX = DOPMAX + OX * OPNMAX(5) ISEMAX = ISEMAX + (OX * OPNMAX(6) + 0 . 5 ) 100 I F ( I S T A T . G T . 2) GO TO 200 C * C * P r e g n a n t ? C * I F (FUTDAT . G E . 0 . 0 ) GO TO 110 CALL MATE(HRDCOW(15,NCOW), HRDCOW(1,NCOW), IRANK, 1 DFER, DUEDAT, FUTDAT, BRLAST, ISEMAX, DOPMAX, 2 CULL) I F (CULL) GO TO 220 GO TO 120 110 FUTDAT = FUTDAT - DAYR C * C * New l a c t a t i o n ? C * 120 I F (FUTDAT . G T . DAYR .OR. FUTDAT . L T . 0 . 0 ) GO TO 170 P R O G R A M L I S T I N G S CALL L A C T ( O L D L A C ( 1 , N C O W ) , HRDCOW(19,NCOW), HRDCOW(11,NCOW), 1 HRDCOW(15,NCOW), OLDRB(NCOW), DUERB, OLDAT(NCOW), DUEDAT, 2 FUTDAT) IF (I STAT . L T . 2) CALL BLUP(HRDCOW(2,NCOW), IHRD, IYR , 1 HRDCOW(19,NCOW)) 130 FBR = DUEDAT + BRDMIN C * C * B r e e d a g a i n ? C * IF (FBR . G T . DAYR) GO TO 140 CALL MATE(HRDCOW(15,NCOW), HRDCOW(1,NCOW), I RANK, 1 DFER, DUEDAT, FUTDAT, BRLAST, ISEMAX, DOPMAX, 2 CULL) IF (CULL) GO TO 210 C * C * A n o t h e r l a c t a t i o n ? C * IF (FUTDAT . G T . DAYR .OR. FUTDAT . L T . 0 . 0 ) GO TO 140 CALL L A C T ( O L D L A C ( 1 , N C O W ) , HRDCOW(19,NCOW), HRDCOW(11,NCOW), 1 HRDCOW(15,NCOW), OLDRB(NCOW), DUERB, OLDAT(NCOW), DUEDAT, 2 FUTDAT) C C * ACTUAL PRODUCTION C GO TO 150 140 I F ( I S T A T . L T . 2) GO TO 160 OSTART(NCOW) = ABS(OLDAT(NCOW)) 150 CALL PROD(AGE(NCOW), OLDRB(NCOW), OLDPK(NCOW), OLDAT(NCOW), 1 DUEDAT, OSTART(NCOW), OSTOP(NCOW), OFIN(NCOW), 2 OLDLAC(1 ,NCOW) , OYRLAC(1 ,NCOW), OAPRD(1,NCOW), DRYPRD, 3, 3 4) 160 CALL PROD(AGE(NCOW), DUERB, DUEPK(NCOW), DUEDAT, FUTDAT, 1 DSTART(NCOW), DSTOP(NCOW), DFIN(NCOW), HRDCOW(19,NCOW), 2 DYRLAC(1 ,NCOW), DAPRD(1,NCOW), DRYPRD, 3, 4) I S T A T = 2 GO TO 260 C C * Cows w i t h no new l a c t a t i o n C 170 IF ( I S T A T . L T . 2) GO TO 180 DSTART(NCOW) = ABS(DUEDAT) CALL PROD(AGE(NCOW), DUERB, DUEPK(NCOW), DUEDAT, FUTDAT, 1 DSTART(NCOW), DSTOP(NCOW), DFIN(NCOW), HRDCOW(19,NCOW), 2 DYRLAC(1 ,NCOW), DAPRD(1,NCOW), DRYPRD, 3, 4) 180 OLDLAC(1,NCOW) = 0 . 0 OLDLAC(2,NCOW) = 0 . 0 OLDLAC(3,NCOW) = 0 . 0 OLDLAC(4,NCOW) = 0 . 0 OLDAT(NCOW) = 0 .0 GO TO 260 190 DFIN(NCOW) = HRDCOW(4,NCOW) GO TO 180 C * C * D r y o f f f e r t i l i t y c u l l s f r o m l a s t y e a r C * 200 IF ( I S T A T . G T . 3) GO TO 190 I S T A T = 4 NFCUL = NFCUL + 1 OLDAT(NCOW) = 0 . 0 DSTART(NCOW) = ABS(DUEDAT) CALL PROD(AGE(NCOW), DUERB, DUEPK(NCOW), DUEDAT, FUTDAT, 1 DSTART(NCOW), DSTOP(NCOW), DFIN(NCOW), HRDCOW(19,NCOW), OOE Oi 09 i v a a a = (MOON)Niao O'O = (MODN)dOiSO 063 o i oo ( (MODN)ivaao * i 9 ' i v a a a ) ai oi£ Oi 09 ((MODN)Niao * i 9 * i v a a a ) d i 0 2 £ Oi 09 ( i v a a n a * i 9 ' ivaaa) ai Ofr£ Oi 09 ((MODN)NIdd ' i 9 ' iYdSa) d i Of£ Oi 09 C O '3T (MODN' 6 t ) MODO.HH) d i 082 i + mociN = anoaN 6 = i V i S I os£ Oi oo (£ * i 9 * i V i s i "aNY* (MODN)Niaa ' i o * ivaaa) d i HAVG- * c o ) QNYHJ = ivasa 0Q£ Oi 09 (aOHdid '39* NYHiQ) d i C O ) dNYHd = NYHid D3HN * D3Hid + MTWASd » MlWid + aiYHid = BOHdid OLZ 082 Oi 09 I + IflOHN = mDHN 8 = i V i S I OLZ Oi 09 (£ * i 9 * i V i s i *QNY* (MOON)Niaa * i 9 " ivaaa) Al "99£ * ('O)dNYHd = ivaaa OLZ Oi 09 (SOHdiH •39" NYHiH) Al CO) dNYHd = NYHiH 03HN » 03HiH + ((MOON'81)MODdHH I + (MODN' & I )MOOQHH) * dAiH + MTWASd * >HWiH + 1iH = SOHdiH 092 0 S3SS01 HilY3H QNY HiY3d WOdNYH *** 0 0 d '£ ' * o 'andAHa ' (MOON' I )ovinia" ' (MOON' I )aHdva 'ivaana i '(MODN)Mdana 'anana '(MOON)dOisa '(MOON)iHVisa)aoHdrv n v o i v a a n a - (MOONINIJQ = (MODN)dOisa iSY1H8 = (MODN)NIdd 092 Oi 09 ( iSYIHa ' i 9 ' (MODN)NIdd) Al i + anodN = inodN i = i Y l S I 0S2 092 Oi 09 (HAYd "Da* (MODN)NIdd) d i £ = i V i S I (fr '£ ' QHdAHa ' (MOON' I )OHdVa ' (MOON' I ) DY1HACI 2 '(MOON'6DMOOQHH '(MOON)NIdQ '(MOON)dOiSO '(MOON)iHYiSO I 'iYaind ' i vaana '(MOON)Mdana ' a n a n a '(MOON)39V)aoHd n v o otz (ivasnajsav = (MOON)iHVisa 0£2 092 Oi 09 iSYlHH = (MODN)NIdd t + anodN = modN {- = i Y i S I 0 £ 2 Oi 09 (I ' i 9 ' i V i S I ) d l 0*0 = (MODN'fr)DYldlO 0*0 = (MOON'£)OYiaaO O'O = (MODN'2)0Yld1O O'O = (MOON' i )ovacno O'O = (MODN)iYCnO 022 OtZ Oi 09 (fr £ '£ 'OHdAHa '(MODN'L)dHd VO '(MODN'I)DY1HA0 '(MODN'I)DVIOTO 2 '(MOON)NIdO '(MODN)dOiSO '(MODN)iHYiSO 'iYdSOd I '(MODN)iVaiO '(MODN)MddlO '(M0DN)8Hd10 '(M0DN)39V)a0Hd 17YD ( (M0DN)iVa"10)SaV = (MODN)iHViSO 0fr2 Oi 09 (2 '11' i V i S I ) dI 012 * D s x i n o A ^ T - [ i ^ j 3 j «9N * D D 081 Oi 09 (S '£ 'QHdAHQ '(MODN'I)QHdVQ '(MODN'I)OYIHAd Z 6 3 1 SDNLLSn WVHOOHd PROGRAM LISTINGS 160 290 OSTOP(NCOW) = OSTOP(NCOW) - (OFIN(NCOW) - DEDAT) 300 CALL AJPROD(OSTART(NCOW), OSTOP(NCOW), OLDRB(NCOW), OLDPK(NCOW), 1 OLDAT(NCOW), OAPRD(1,NCOW), OYRLAC(1 ,NCOW), DRYPRD, 0 . , 3, 2 4) 310 DSTOP(NCOW) = 0 . 0 DFIN(NCOW) = DEDAT GO TO 330 320 DSTOP(NCOW) = DSTOP(NCOW) - (DFIN(NCOW) - DEDAT) DFIN(NCOW) = DEDAT 330 CALL AJPROD(DSTART(NCOW), DSTOP(NCOW), DUERB, DUEPK(NCOW), 1 DUEDAT, DAPRD(1,NCOW), DYRLAC(1 ,NCOW), DRYPRD, 0 . , 3, 4) CALL KILCF(HRDCOW(1,NCOW), OLDAT(NCOW), DUEDAT, FUTDAT, DEDAT) GO TO 350 340 DFIN(NCOW) = DEDAT I F (FUTDAT . G T . 0 . ) CALL KILCF(HRDCOW(1,NCOW), OLDAT(NCOW), 1 DUEDAT, FUTDAT, DEDAT) C C *** SUMS FOR ROLLING HERD AVERAGES *** C 350 IF (OFIN(NCOW) . L E . 0 . 0 ) GO TO 370 IF (OSTOP(NCOW) . L T . DPROJ) GO TO 370 IF (OSTART(NCOW) . G E . 3 0 5 . ) GO TO 370 NRLAC = NRLAC + 1 NREC = NREC + 1 CALL RHPROD(AGE(NCOW), OLDRB(NCOW), OLDPK(NCOW), OLDAT(NCOW), 1 OSTOP(NCOW), STOP, RPRD, OLDLAC(1 ,NCOW), 3, 4) TDP = TDP + STOP TAGE = TAGE + AGE(NCOW) + OLDAT(NCOW) / DAYR - 1. DO 360 J = 1, 3 P B C A ( J ) = OLDLAC(J ,NCOW) + P B C A ( J ) 360 T R P R D ( J ) = RPRD(J) + TRPRD(J) PBCA(4) = OLDLAC(4,NCOW) + PBCA(4) 370 I F (DFIN(NCOW) . L E . 0 . 0 ) GO TO 390 I F (DSTOP(NCOW) . L T . DPROJ) GO TO 390 I F (DFIN(NCOW) . E Q . DAYR .AND. DSTOP(NCOW) . L T . 3 0 5 . ) 1 GO TO 390 I F (DSTART(NCOW) . G E . 3 0 5 . ) GO TO 390 NRLAC = NRLAC + 1 NREC = NREC + 1 CALL RHPROD(AGE(NCOW), DUERB, DUEPK(NCOW), DUEDAT, DSTOP(NCOW), 1 STOP, RPRD, HRDCOW(19,NCOW), 3 , 4) TDP = TDP + STOP TAGE = TAGE + AGE(NCOW) + DUEDAT / DAYR - 1. DO 380 J = 1, 3 P B C A ( J ) = HRDCOW(j + 18,NCOW) + P B C A ( j ) 380 T R P R D ( J ) = RPRD(J) + TRPRD(J) PBCA(4) = HRDCOW(22,NCOW) + PBCA(4) 390 DO 400 J = 1, 4 400 T A P R D ( J ) = TAPRD(J) + OYRLAC(J ,NCOW) + DYRLAC(J,NCOW) CREC = AINT(DUERB) HRDCOW(5,NCOW) = RANK HRDCOW(6,NCOW) = NREC + CREC / 10. HRDCOW(7,NCOW) = ISTAT + DUERB - CREC HRDCOW(8,NCOW) = DUEDAT HRDCOW(9,NCOW) = FUTDAT HRDCOW(10,NCOW) = BRLAST GO TO 430 410 WRITE ( 6 , 4 2 0 ) 420 FORMAT ( ' PROBLEMS COW L O S T ' ) NCOW = NCOW - 1 430 CONTINUE I F ( F I N I S H ) GO TO 450 PROGRAM LISTINGS 161 c * C * Read i n l a s t y e a r s y e a r l i n g s * C * READ (2) NYLG CALL REAMAT(HRDYLG, 18, NYLG, 2) 440 NC = NYLG F I N I S H = TRUE OLCOW = F A L S E GO TO 30 C * C * END COW LOOP * C * C * H e r d a v e r a g e s * C * 450 NR = NRLAC IF (NRLAC . L E . 0) NR = 1 TR = NR + 0 .00001 DO 460 J = 1, 4 H P A ( J ) = P B C A ( J ) / NR H T A ( J ) = A V G ( J ) + ((TR - 1 . )/(NR + 1)) * ( H P A ( j ) - A V G ( J ) ) P A C B C A ( J ) = P B C A ( J ) 460 CONTINUE TACPRD(1) = TRPRD(1) TACPRD(2) = TRPRD(2) TACPRD(3) = TRPRD(3) ACAGE = TAGE ACTDP = TDP NACLAC = NRLAC CALL ALETA(COWS, HPA, HTA, 0) C * C * U p d a t e cows E P A ' s and E T A ' s and i n d e x s c o r e s * C * DO 480 1 = 1 , NCOW CALL COWETA(ETA, E T A ( 1 , I ) , E P A ( 1 , I ) , C U R B C A ( I . I ) , HRDCOW(35,1), 1 HRDCOW(19,1) , O L D L A C ( 1 , 1 ) , HRDCOW(23,1), HRDCOW(27,1), 2 HRDCOW(31,1) , H R D C O W ( 2 , I ) , H R D C O W ( 3 , I ) , H R D C O W ( 6 , I ) , 3 O S T A R T ( I ) , O S T O P ( I ) , D S T A R T ( I ) , D S T O P ( I ) , O F I N ( I ) , D F I N ( I ) , 4 1 , 4 ) I F (HRDCOW(6, l ) . L E . 0 . 0 ) GO TO 470 SCORE(1,1) = C U R B C A ( 1 , I ) * SINDEX(1) + CURBCA(2,1) * SINDEX(2) + 1 C U R B C A ( 3 , I ) * S I N D E X U ) + CURBCA ( 4 ,1 ) * S I N D E X U ) S C O R E ( 2 , I ) = E P A ( 1 , I ) * S I N D E X d ) + E P A ( 2 , I ) * SINDEX(2) + EPA( 1 3,1) * S INDEX(3) + E P A ( 4 , I ) * S I N D E X U ) S C O R E ( 3 , I ) = E T A ( 1 , I ) * SINDEX(1) + E T A ( 2 , I ) * SINDEX(2) + ETA( 1 3,1) * S I N D E X U ) + E T A ( 4 , I ) * S I N D E X U ) GO TO 480 470 SCORE(1,1) = 0 . 0 S C O R E ( 2 , I ) = 0 . 0 S C O R E ( 3 , l ) = 0 . 0 480 CONTINUE 490 CONTINUE CALL CULSEL(HRDCOW, AGE , OLDAT, OLDRB, SCORE, O F I N , D F I N , OSTART, 1 DSTART, OSTOP, DSTOP, OYRLAC, DYRLAC, OAPRD, DAPRD, OLDLAC, 2 OLDPK, DUEPK, TAPRD, TACPRD, PACBCA, ACAGE, ACTDP, NACLAC, 3 DRYPRD, NPCUL, NCOW) PROGRAM LISTINGS 1 6 2 c * C * O u t p u t cows r e c o r d s C * CALL SUMCOW(HRDCOW, OYRLAC, DYRLAC, OAPRD, DAPRD, OLDLAC, EPA , 1 E T A , SCORE, AVG, I A J B C A , OSTART, DSTART, OSTOP, DSTOP, O F I N , 2 D F I N , OLDAT, AGE, NCOW, IYR, DPROJ, DRYFD, DAYR, G E S T , L I N E , 3 AUTO) WRITE (12) NCOW I F (NCOW . L E . 0) GO TO 500 CALL WRTMAT(HRDCOW, 4 0 , NCOW, 12) 500 CALL SUMHRD(TRPRD, PBCA, T A G E , TDP, NRLAC, TACPRD, PACBCA, ACAGE, 1 ACTDP, NACLAC, TAPRD, SINDEX, NYCUL, NCOW, IHRD, IYR) CALL PBLUP RETURN END SUBROUTINE BREED(BULREC, I B U L L S , I PROP, ISPMAT, I S P B U L , COWMAT, 1 MATBUL, CULCAF , NBULS, NSPM, I S P A , NBS, NHM, NCFCUL, 2 CHEAPB, AUTO, GSD, GSIGMA, BRDMIN, HRDET, F C Y C L , 3 G E S T , DAYR) C ********************************************* C * * C * T h i s s u b r o u t i n e f i n d s a b u l l t o mate t h e cow. I f * C * t h e cow i s t o be s p e c i a l m a t e d , BULL i s g i v e n t h e a p p r o p r i a t e * C * v a l u e i n MATBUL. I f t h e r e s u l t a n t c a l f i s t o be c u l l e d BULL i s * C * a s s i g n e d t h e s p e c i f i e d b u l l i n I B U L L S . O t h e r w i s e t h e BULL i s * C * s e l e c t e d a t random f r o m IBULLS w i t h t h e c h a n c e o f e a c h b e i n g * C * s e l e c t e d e q u a l t o t h e p r o p o r t i o n i n d i c a t e d i n IPROP. I f * C * p o s s i b l e s i r e d a u g h t e r m a t i n g s a r e a v o i d e d . I f t h e cow * C * c o n c e i v e s b e f o e t h e end o f t h e y e a r and b e f o r OPNMAX a new * C * F u t d a t and y oung c a l f a r e g e n e r a t e d . * Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * C I M P L I C I T INTEGER(C) COMMON I SEED, E W K ( 4 ) , GWK(4) /YNG/ Y G C A L F ( 8 , 2 0 0 ) , NYCLF DIMENSION B U L R E C ( 1 3 , 2 0 ) , I S P M A T O O ) , I S P B U L ( l O ) , I B U L L S ( 2 0 ) , 1 I PROP ( 2 0 ) , C O W M A T O 0 0 ) , MATBUL ( 1 0 0 ) , CULCAF ( 2 0 ) , 2 B V ( 4 ) , ETA (4) , G S I G M A U ) , G S D ( 4 ) , S A C ( 2 ) , F E R C ( 2 ) , 3 N B S V ( 2 0 ) , N B S S V ( 2 0 ) , R N G ( 4 ) , I B U S E ( 5 ) REAL *4 B V P S ( 4 ) , P P S ( 4 ) , B V U S ( 4 ) , P U S ( 4 ) , B V Y S ( 4 ) , P Y S ( 4 ) C LOGICAL*1 TRUE / T / , F A L S E / F / , C U L L , INB, SPBR, AUTO C ENTRY REBRD DO 10 I = 1, NBULS N B S V ( I ) = 0 1 0 N B S S V d ) = 0 DO 15 I = 1, 4 B V P S ( I ) = 0 . P P S ( I ) = 0 . B V U S ( I ) = 0 . P U S ( I ) = 0 . B V Y S ( I ) = 0 . P Y S ( I ) = 0 . 15 CONTINUE I CPS = 0 ICUS = 0 ICYS = 0 NYCLF = 0 NSVK = 0 VMC = S Q R T ( 0 . 5 ) TCINT = 0 . 0 PROGRAM LISTINGS 163 NCHB = NCFCUL NHMB = NHM NSPMB = 1 RETURN ENTRY M A T E ( B V , S A C , I R A N K , F E R C , D U E D A T , F U T D A T , B R L A S T , I S E M A X , O P N M A X , 1 CULL) COW = S A C ( 1 ) I SI RE = S A C ( 2 ) CULL = F A L S E CHECK = -2 INB = F A L S E IF (AUTO) GO TO 80 20 IF (NCHB . L E . 0) GO TO 30 C C MATINGS TO A CHEAP BULL C IF (COW . L T . CULCAF(NCHB)) GO TO 30 NCHB = NCHB - 1 IF (COW . N E . CULCAF(NCHB)) GO TO 20 LCBUL = CHEAPB BULL = I BULLS(LCBUL) CLFKEP = 3 GO TO 220 30 IF (NHMB . L E . 0) GO TO 50 C C HAND MATINGS C IF (COW . L T . COWMAT(NHMB)) GO TO 50 I F (COW . E Q . COWMAT(NHMB)) GO TO 40 NHMB = NHMB - 1 GO TO 30 40 CLFKEP = 2 LCBUL = MATBUL(NHMB) BULL = 1 B U L L S ( L C B U L ) NHMB = NHMB - 1 IF (I B U L L S ( L C B U L ) . E Q . I S I R E ) INB = TRUE GO TO 220 50 IF (ISPA . G T . 1) GO TO 80 C C SPECIAL MATINGS C 60 I F (NSPMB . G T . NSPM) GO TO 110 I F (COW . L T . ISPMAT(NSPMB)) GO TO 110 I F (COW . E Q . ISPMAT(NSPMB)) GO TO 70 NSPMB = NSPMB + 1 GO TO 60 70 LCBUL = ISPBUL(NSPMB) CLFKEP = 1 BULL = I B U L L S ( L C B U L ) IF (I B U L L S ( L C B U L ) . E Q . I S I R E ) INB = TRUE NSPMB = NSPMB + 1 GO TO 220 80 I F (IRANK . G T . NSPM) GO TO 110 C C S P E C I A L MATINGS BY RANK C C L F K E P = 1 90 LCBUL = IRAND(NBS) BULL = I B U L L S ( L C B U L ) IF ( I B U L L S ( L C B U L ) . N E . I S I R E ) GO TO 220 DO 100 J = 1, NBS IF ( I B U L L S ( J ) . N E . I S I R E ) GO TO 90 PROGRAM LISTINGS 100 CONTINUE INB = TRUE GO TO 220 C C RANDOM MATINGS C 110 J = (NBULS/2) + 1 C L F K E P = 2 120 NRAN = I RAND(I PROP(NBULS)) I F (NRAN . L E . I P R O P ( J ) ) GO TO 130 K = J + 1 I F (NRAN - I P R O P ( K ) ) 170, 170, 150 130 CONTINUE DO 140 K = 1, J I F (NRAN . L E . I P R O P ( K ) ) GO TO 170 140 CONTINUE 150 J = J + 2 DO 160 K = J , NBULS IF (NRAN . L E . I P R O P ( K ) ) GO TO 170 160 CONTINUE 170 BULL = I B U L L S ( K ) LCBUL = K I F ( I B U L L S ( L C B U L ) . N E . I S I R E ) GO TO 220 C C*** S e l e c t s up t o t h r e e b u l l s a t random C CHECK = CHECK + 1 I F (CHECK) 180, 110, 210 C C CHECK I F INBREEDING AVOIDABLE C 180 I PL = 0 DO 190 I = 1, NBULS IPS = I PROP(I) - I PL IF ( I B U L L S ( I ) . N E . I S I R E .AND. IPS . G T . 0) GO TO 110 I PL = I PROP(I) 190 CONTINUE 200 INB = TRUE GO TO 220 C C ASSIGN TO THE F I R S T BULL THAT IS NOT RELATED C 210 BULL = I B U L L S ( I ) LCBUL = I 220 CONTINUE C C BREEDING C IF (BRLAST . L T . 0 . 0 ) GO TO 230 NSVC = 0 DAYCYC = F R A N D ( 0 . ) * FCYCL OPNDAY = BRDMIN + DAYCYC GO TO 240 230 DLB = A I N T ( B R L A S T ) OPNDAY = DLB + FCYCL - DUEDAT NSVC = (DLB - BRLAST) * 100 . + 0 . 5 BRLAST = 1.0 IF (OPNDAY . G T . OPNMAX) GO TO 270 240 FERB = B U L R E C ( 6 , L C B U L ) I S T P = (OPNMAX - OPNDAY) / FCYCL + 1. OPNDAT = DUEDAT + OPNDAY I F (OPNDAT . G T . DAYR) RETURN PROGRAM LISTINGS 165 MYRST = (DAYR - OPNDAT) / FCYCL + 1. I F (MYRST . L T . ISTP) I S T P = MYRST HDET = HRDET * F E R C ( 1 ) FERT = FERB * F E R C ( 2 ) C*** L o o p f o r e s t r o u s c y c l e , s t o p s i f : c o n c e p t i o n ; c u l l e d ; ** C*** o r end o f y e a r ; ** DO 250 I = 1, ISTP DPROB = F R A N D ( 0 . ) IF (DPROB . G E . HDET) GO TO 250 OPROB = F R A N D ( 0 . ) NSVC = NSVC + 1 NBSV(LCBUL) = NBSV(LCBUL) + 1 I F (OPROB . L T . FERT) GO TO 280 I F (NSVC . G E . ISEMAX) GO TO 270 250 OPNDAY = OPNDAY + FCYCL IF (OPNDAY . G T . OPNMAX) GO TO 270 260 BRLAST = AINT(DUEDAT + OPNDAY - FCYCL - DAYR - 0 . 5 ) - FLOAT(NSVC) 1 / 100. RETURN 270 CULL = TRUE BRLAST = DUEDAT + OPNDAY - FCYCL RETURN C C GENERATE CALF C 280 CI NT = OPNDAY + GEST FUTDAT = DUEDAT + CINT I F (FUTDAT . L T . 0 . ) GO TO 270 NBSSV(LCBUL) = NBSSV(LCBUL) + 1 NSVK = NSVK + NSVC TCINT = TCINT + CINT NYCLF = NYCLF + 1 Y G C A L F ( 2 , N Y C L F ) = BULL Y G C A L F ( 3 , N Y C L F ) = COW Y G C A L F ( 4 , N Y C L F ) = FUTDAT Y G C A L F ( 1 , N Y C L F ) = CLFKEP + I S I R E / 10000 290 CALL MNDG1(I SEED , GSIGMA, RNG, GWK) DO 300 J = 1, 4 300 Y G C A L F ( J + 4 , N Y C L F ) = 0 . 5 * ( B V ( J ) + BULREC(J + 8 , L C B U L ) ) + VMC * 1RNG(J) * G S D ( J ) I F ( .NOT . INB) GO TO 320 Y G C A L F ( 2 , N Y C L F ) = BULL + 0 . 1 320 RETURN ENTRY S U M A T E ( B C O N , S V C F , H C I N T , S E M C , BVPS, PPS , BVUS, PUS, BVYS, 1 P Y S , IHRD, IYR) NSV = 0 NCON = 0 SEMC = 0 . 0 DO 330 I = 1, NBULS NBC = N B S S V d ) NSV = NSV + N B S V ( I ) NCON = NCON + NBC I B U S E ( 1 ) = IHRD I B U S E ( 2 ) = IYR I B U S E ( 3 ) = I B U L L S ( I ) I B U S E U ) = N B S V ( I ) I B U S E ( 5 ) = NBC SEMC = SEMC + I B U S E U ) * BULREC ( 7 , 1 ) WRITE (14) IBUSE I F ( B U L R E C ( I , 8 ) . L T . 2 0 . ) GO TO 323 DO 321 J = 1 , 4 B V P S ( J ) = B V P S ( J ) + B U L R E C ( J + 8 , I ) * NBC PROGRAM LISTINGS 166 321 CONTINUE P P S ( 1 ) = P P S ( 1 ) + N B S V ( I ) I CPS = ICPS + NBC P P S ( 3 ) = P P S ( 3 ) + B U L R E C ( 6 , I ) * NBC P P S U ) = P P S U ) + BULREC ( 7 , 1 ) * NBC GO TO 330 323 I F ( B U L R E C ( I , 8 ) . L T . 1.) GO TO 327 DO 324 J = 1 , 4 B V U S ( J ) = B V U S ( J ) + B U L R E C ( J + 8 , I ) * NBC 324 CONTINUE PUS(1) = PUS(1) + NBSV(1) ICUS = ICUS + NBC PUS(3) = PUS(3) + B U L R E C ( 6 , 1 ) * NBC PUS(4) = PUS(4) + B U L R E C ( 7 , I ) * NBC GO TO 330 327 DO 328 J = 1 , 4 B V Y S ( J ) = B V Y S ( J ) + B U L R E C ( J + 8 , I ) * NBC 328 CONTINUE P Y S ( 1 ) = P Y S ( 1 ) + NBSV(1) ICYS = ICYS + NBC P Y S ( 3 ) = P Y S ( 3 ) + B U L R E C ( 6 , I ) * NBC P Y S ( 4 ) = P Y S ( 4 ) + B U L R E C ( 7 , I ) * NBC 330 CONTINUE I F ( ICPS . L E . 0) GO TO 340 DO 335 J = 1 , 4 335 B V P S ( J ) = B V P S ( J ) / ICPS P P S ( 2 ) = ICPS P P S U ) = P P S U ) / ICPS P P S U ) = P P S U ) / ICPS 340 I F (ICUS . L E . 0) GO TO 360 DO 350 J = 1 , 4 350 B V U S ( J ) = B V U S ( J ) / ICUS PUS(2) = ICUS P U S U ) = PUS (3) / ICUS PUS(4) = P U S U ) / ICUS 360 I F (ICYS . L E . 0) GO TO 380 DO 370 J = 1 , 4 370 B V Y S ( J ) = B V Y S ( J ) / ICYS P Y S ( 2 ) = ICYS P Y S U ) = P Y S U ) / ICYS P Y S U ) = P Y S U ) / ICYS 380 CONTINUE SVCF = 0 . HCINT = 0 BCON = 0 . IF (NYCLF . L E . 0) GO TO 390 TLCF = NYCLF SVCF = FLOAT (NSVK) / TLCF HCINT = TCINT / TLCF 390 BCON = FLOAT (NCON) / (FLOAT (NSV) + 1 . E - 6 ) RETURN END SUBROUTINE INLAC(PHENV, HENV, ESIGMA, T C E S D , AVG) Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * c * * C * T h i s s u b r o u t i n e g e n e r a t e s a new l a c t a t i o n f o r DUELAC and * C * moves t h e c a l v i n g d a t e u p . * Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * PROGRAM LISTINGS 167 COMMON I S E E D , E W K ( 4 ) , GWK(4) DIMENSION D P R O D U ) , O L D L A C U ) , D U E L A C U ) , PECOW(4) , B V ( 4 ) , 1 T C E S D U ) , A V G ( 4 ) , RNE (4) , E S I G M A ( 4 ) , H E N V ( 4 ) , PHENV(4) ENTRY RELAC CINT = 0 .0 NBORN = 0 RETURN ENTRY L A C T ( O L D L A C , D U E L A C , P E C O W , B V , O L D R B , D U E R B , O L D A T , D U E D A T , F U T D A T ) DO 10 1 = 1, 4 O L D L A C ( I ) = D U E L A C ( I ) 10 CONTINUE CALL MNDG1(ISEED, ESIGMA, RNE, EWK) DO 20 I = 1, 3 DPROD(I) = R N E ( I ) * T C E S D ( I ) + H E N V ( I ) + PHENV(I) + PECOW(I) + 1 B V ( I ) 20 D U E L A C ( I ) = A V G ( I ) + DPROD(I) D P R O D U ) = RNE (4) * T C E S D U ) + H E N V U ) + P H E N V U ) + P E C O W U ) + 1 B V U ) D U E L A C U ) = AVG (4) + D P R O D U ) IF ( D U E L A C U ) . L T . O L D L A C U ) ) D U E L A C U ) = OLDLAC (4) D P R O D U ) = D U E L A C U ) - A V G U ) OLDRB = DUERB I F (DUERB . L T . 3 . ) DUERB = DUERB + 1. OLDAT = DUEDAT DUEDAT = FUTDAT FUTDAT = - 1 . 0 IF (OLDLAC(1) . L E . 0 . 0 ) RETURN CINT = CINT + DUEDAT - OLDAT NBORN = NBORN + 1 RETURN ENTRY SUMLAC(CI NT,NBORN) RETURN END SUBROUTINE INPROD(DPMIN, DRYMIN, DAYR, DPROJ, AJUSM, FDCAR, FDFAT , 1 FDPRO, FDAY, ATCP , B S L P , WEKPK, TLPROD, TPROD, PPROD, 2 M, N) Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * C * T h i s s u b r o u t i n e a d j u s t s t h e M. E . 305 l a c t a t i o n f o r age and * C * t h e n c a l c u l a t e s t h e p o r t i o n t h a t i s p r o d u c e d i n t h e c u r r e n t y e a r * Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * REAL*4 A J U S M ( 3 , 4 ) , TLPROD(M) , PPROD(N) , TPROD(M) , A T C P ( 3 ) , 1 B S L P ( 3 ) , WEKPK(3) DPROJ = 9 0 . RETURN ENTRY P R O D ( A G E , R B , P E A K , F R S H , F U T D A T , D S T A R T , D S T O P , D F I N , T L P R O D , P P R O D , 1 TPROD,DPMIN,M,N) C*** Age a d j u s t m e n t .** I PAGE = AGE + FRSH / DAYR - 2. 10 DO 20 I = 1, 3 20 TPROD(I) = T L P R O D ( I ) IF (I PAGE . G T . 3) I PAGE = 4 30 DO 40 I = 1, 3 TPROD(I) = TPROD(I) * A J U S M ( I , I PAGE) 40 CONTINUE IREC = RB PEAK = T P R O D ( l ) * B S L P ( I R E C ) + A T C P ( I R E C ) WKPK = WEKPK(IREC) PROGRAM LISTINGS 168 C*** F i n d v a l u e s f o r W o o d ' s e q u a t i o n by e s t i m a t i n g B and *** C*** s o l v i n g f o r A and C u n t i l w i t h i n a u n i t o f M. E . m i l k . *** C STPMAX = 100000. I F (DSTART . G T . 0 . ) GO TO 80 PB = 0 . PPRD = 3 0 5 . * PEAK WDB = . 9 9 9 DO 60 I = 1, 20 WDA = PEAK * EXP(WDB) / WKPK ** WDB WDC = WDB / WKPK TAR = AREAG (WDA, WDB, WDC, 0 . 0 , 3 0 5 . 0 ) D I F P = TPROD(1) - TAR I F ( A B S ( D I F P ) . L E . 1.) GO TO 70 DPP = PPRD - TAR DPB = PB - WDB DPUB = ABS(DPP/DPB) TPB = WDB WDB = WDB - D I F P / DPUB IF (ABS(WDB - TPB) . G T . ABS(WDB - P B ) ) GO TO 60 PB = TPB PPRD = TAR 60 CONTINUE WRITE ( 6 , 2 4 0 ) 70 RB = IREC + WDB GO TO 90 ENTRY A J P R O D ( D S T A R T , D S T O P , R B , P E A K , F R S H , T P R O D , P P R O D , D P M I N , S T P M A X , M , 1 N) 80 IREC = RB WDB = RB - IREC WDA = PEAK * EXP(WDB) / WKPK ** WDB WDC = WDB / WKfc-K I F (STPMAX . L E . 0 . ) GO TO 110 C C*** C a l c u l a t e p r o d u c t i o n f o r t h e c u r r e n t p o r t i o n o f t h e l a c t a t i o n * * C 90 DSTOP = DRYOFF(DPMIN,WKPK,PEAK,WDA,WDB) * 7. DSTOP = AMAX1(DSTOP,DPROJ) IF (STPMAX . G E . 1 0 0 0 0 0 . ) GO TO 100 IF (DSTOP . G E . STPMAX) RETURN I F (DSTOP . L E . DSTART) GO TO 190 GO TO 110 100 DFIN = DAYR IF (FUTDAT . G E . 0 . ) DFIN = AMIN1(DFIN ,FUTDAT - DRYMIN) DSTOP = AMIN1(DSTOP,DFIN - FRSH) 110 DFIN = DSTOP + FRSH I F (DFIN . L E . 0 . 0 ) GO TO 200 170 P P R O D O ) = AREAG (WDA, WDB, WDC, DSTART, DSTOP) FLAC = PPROD(I) / TPROD(1) PPROD(2) = FLAC * TPROD(2) P P R O D O ) = FLAC * TPROD(3) DPRD = DSTOP - DSTART PPROD(4) = DPRD * FDAY + PPROD(2) * FDFAT + PPROD(3) * FDPRO + ( 1 P P R O D O ) - PPROD(2) - P P R O D O ) ) * FDCAR I F (DSTOP . L T . 3 0 5 . .AND. DFIN . E Q . DAYR) RETURN ART = (PEAK - A T C P ( I R E C ) ) / B S L P ( I R E C ) + AREAG (WDA,WDB,WDC, 1 3 0 5 . 0 , DSTOP) FLAC = ART / TPROD(1) TPROD(1) = ART TPROD(2) = FLAC * TPROD(2) ) TPROD(3) = FLAC * TPROD(3) RETURN PROGRAM LISTINGS 169 190 DFIN = 1.0 DSTOP = DFIN - FRSH 200 DO 210 I = 1, 4 PPROD(I) = 0 . 0 210 CONTINUE RETURN C Q*** P r o d u c t i o n f o r 305 day o r l e s s f o r r o l l i n g h e r d a v e r a g e s C ENTRY RHPROD.C A G E , RB, PEAK, FRSH,DSTOP , STOP,TPROD, TLPROD,M,N) STOP = DSTOP I PAGE = AGE + FRSH / DAYR - 2. I F (I PAGE . G T . 3) I PAGE = 4 TPROD(1) = TLPROD(1) * A J U S M ( 1 , 1 PAGE) TPRODC2) = TLPROD(2) * A J U S M ( 2 ,1 PAGE) TPRODC3) = TLPROD(3) * A J U S M ( 3 ,1 PAGE) I F (STOP . G E . 3 0 5 . ) GO TO 230 IREC = RB WDB = RB - I REC PEAK = TPROD(1) * B S L P ( I R E C ) + A T C P ( I R E C ) WDA = PEAK * EXP(WDB) / WKPK ** WDB WDC = WDB / WKPK RPROD = AREAG (WDA, WDB, WDC, 0 . 0 , DSTOP) 220 FLAC = RPROD / TPROD(1) TPROD(1) = RPROD TPROD(2) = FLAC * TPROD(2) TPROD(3) = FLAC * TPROD(3) T L P R O D ( I ) = TPROD(1) / AJUSM(1,1 PAGE) TLPROD(2) = TPROD(2) / A J U S M ( 2 ,1 PAGE) TLPROD(3) = TPROD(3) / A J U S M ( 3 ,1 PAGE) RETURN 230 STOP = 3 0 5 . 240 FORMAT ( ' PROBLEMS WITH LACTATION C U R V E ' ) RETURN END FUNCTION AREAG ( A , B, C , T F , T L ) T h i s f u n c t i o n c a l c u l a t e s t h e a r e a under W o o d ' s l a c t a t i o n *** c u r v e f r o m TF t o T L u s i n g t h e GAMMDS f u n c t i o n *** *** AREAG = 0 . 0 IF (TF . G E . T L ) RETURN B1 = B + 1 . C1 = C / 7 . A1 = (A / 7 . 0 * * B 1 ) * 7 .0 / C1**B1 T1 = TF * CI T2 = T L * C1 AREAG = A1 * (GAMMDS(T2, B 1 , IC) - GAMMDS(T1, B 1 , I C ) ) RETURN END FUNCTION GAMMDS (Y , P, I F A U L T ) C C CHI-LEUNG LAU 1980 A P P L I E D S T A T I S T I C S V O L . 2 9 , NO. 1 C C INCOMPLETE GAMMA INTERVAL C P R O G R A M L I S T I N G S 170 DATA E / I . O E - 3 / C I FAULT = 1 GAMMDS = 0 . 0 IF (Y . L E . 0 . 0 .OR. P . L E . 0 . 0 ) RETURN I FAULT = 2 C F = E X P ( P * ALOG(Y) - ALGAMA(P+1.0) - Y) IF (F . E Q . 0 . 0 ) RETURN I FAULT = 0 C C = 1 .0 GAMMDS = 1.0 A = P 1 A = A + 1.0 C = C * Y / A GAMMDS = GAMMDS + C IF (C / GAMMDS . G T . E) GO TO 1 GAMMDS = GAMMDS * F RETURN END FUNCTION DRYOFF(PCUL , WKPK, PEAK, A , B) I F (PCUL . G E . PEAK) GO TO 30 XK = WKPK / B * ABS(ALOG(PCUL) - A L O G ( A ) ) T = AMAX1(XK.WKPK) I F (PCUL . G T . A) XK = -XK DO 10 I = 1, 20 DRYOFF = WKPK * ALOG(T) + XK DIF = A B S ( T - DRYOFF) I F (DIF . L T . 0 . 1 ) RETURN T = DRYOFF 10 CONTINUE WRITE ( 6 , 2 0 ) 20 FORMAT ( ' PROBLEMS WITH DAY DRY ' ) 30 DRYOFF = WKPK RETURN END SUBROUTINE I N E T A ( A I , SINDEX, AVG, I A J B C A , HER, REP , DAYR, NOAI , 1 BBNO, DPROJ, DETA, E T A , EPA , SCUR, SUMDEV, SAJDEV , 2 SETDEV, OLDLAC, DUELAC, N) Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * C * c * C * T h i s s u b r o u t i n e c a l c u l a t e s t h e e t a ' s f o r c o w s , u s i n g t h e i r C * C * r e c o r d s , t h e i r dams e a t ' a a n d t h e i r s i r e s e a t ' s . C * C * * Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * DIMENSION R E P ( 4 ) , H E R ( 4 ) , F A ( 4 , 3 ) , F K ( 4 , 3 ) , S E T A ( 4 ) , D E T A ( N ) , 1 E T A ( N ) , S D E V ( 4 ) , A V G ( 4 ) , F D E N ( 3 ) , A D E V ( 4 ) , E P A ( N ) , 2 P D E V ( 4 ) , S C U R ( N ) , I A J B C A U ) , S A J D E V ( N ) , SETDEV(N) , PROGRAM LISTINGS 171 3 A E T A ( 4 , 2 5 0 ) , A I ( 2 7 , 5 0 0 ) , COWS(250) , O L D L A C ( N ) , 4 DUELAC (N) , H P A ( 4 ) , HTA ( 4 ) , S I N D E X U ) , SUMDEV(N) DO 20 J = 1, 4 P = 1 . R = 1. - R E P ( J ) DO 10 K = 1, 3 FDEN(K) = R E P ( J ) - (1 - P) * H E R ( J ) F A ( J , K ) = R / FDEN(K) F K ( J , K ) = P * H E R ( J ) / FDEN(K) 10 P = P - 0 . 2 5 20 CONTINUE ENTRY A L E T A ( C O W S , H P A , H T A , N T ) RETURN ENTRY C O W E T A ( A E T A , E T A , E P A , S C U R , D E T A , D U E L A C , O L D L A C , S U M D E V , S A J D E V , 1 S E T D E V , S I R E , D A M , R E C , O S T A R T , O S T O P , D S T A R T , D S T O P , O F I N , D F I N , 2 NCOW,N) I F (OFIN . L E . 0 . 0 ) GO TO 40 IF (OSTOP . L T . DPROJ) GO TO 40 IF (OSTART . G E . 3 0 5 . ) GO TO 40 DO 30 J = 1, 4 TCUR = O L D L A C ( J ) SUMDEV(J) = SUMDEV(J) + TCUR - A V G ( J ) S A J D E V ( J ) = S A J D E V ( J ) + TCUR - H P A ( J ) 30 S E T D E V ( J ) = S E T D E V ( J ) + TCUR - H T A ( J ) 40 I F (DFIN . L E . 0 . 0 ) GO TO 80 I F (DSTOP . L T . DPROJ) GO TO 80 I F (DFIN . E Q . DAYR .AND. DSTOP . L T . 3 0 5 . ) GO TO 60 I F (DSTART . G E . 3 0 5 . ) GO TO 60 DO 50 J = 1, 4 TCUR = D U E L A C ( J ) S C U R ( J ) = (TCUR - H P A ( J ) ) / A V G ( J ) * 100. SUMDEV(J) = SUMDEV(J) + TCUR - A V G ( J ) S A J D E V ( J ) = S A J D E V ( J ) + TCUR - H P A ( J ) 50 S E T D E V ( J ) = S E T D E V ( J ) + TCUR - H T A ( J ) GO TO 120 60 DO 70 J = 1 , 4 70 SCUR(J) = ( D U E L A C ( J ) - H P A ( J ) ) / A V G ( J ) * 100. 80 I F (OFIN . L E . 0 . 0 ) GO TO 100 DO 90 J = 1, 4 90 S C U R ( J ) = ( O L D L A C ( J ) - H P A ( J ) ) / A V G ( J ) * 100. GO TO 120 100 DO 110 J = 1, 4 E P A ( J ) = 0 . 0 110 SCUR(J) = 0 . 0 120 I F (REC . L E . 0 . 0 ) GO TO 150 DO 130 J = 1, 4 E P A ( J ) = (SUMDEV(J) / REC - H P A ( J ) + A V G ( J ) ) * 100 . / A V G ( J ) 1 * ( R E P ( J ) * REC / (1 + (REC - 1 ) * R E P ( J ) ) ) 130 A D E V ( J ) = S E T D E V ( J ) / REC / A V G ( J ) * 100. INF = 1 GO TO 170 ENTRY C L F E T A ( S I R E , D A M , E T A , D E T A , N ) DO 140 J = 1, 4 140 D E T A ( J ) = 0 . 0 ENTRY YNGETA(SI R E , D A M , E T A , D E T A , N ) 150 INF = 0 DO 160 J = 1, 4 160 A D E V ( J ) = 0 . 0 170 I F (DAM . E Q . 0 . ) GO TO 250 C C*** F i n d t h e dam * : PROGRAM LISTINGS 172 MIN = 1 MAX = NCOW NT = NT + 1 I F (NT . G T . MAX) NT = MIN I F (DAM - COWS(NT)) 2 0 0 , 2 2 0 , 180 180 NT = NT + 1 IF (DAM - COWS(NT)) 2 4 0 , 2 2 0 , 190 190 I F (MIN . G E . MAX) GO TO 240 MIN = NT + 1 GO TO 210 200 I F (MIN . G E . MAX) GO TO 240 MAX = NT - 1 210 NT = MIN + (MAX - MIN) / 2 IF (DAM - COWS(NT)) 2 0 0 , 2 2 0 , 190 220 DO 230 J = 1, 4 230 D E T A ( J ) = A E T A ( J , N T ) 240 IF ( D E T A d ) . E Q . 0 . 0 ) GO TO 270 INF = INF + 1 GO TO 270 250 DO 260 J = 1 , 4 260 D E T A ( J ) = 0 . 0 270 I F ( S I R E . L E . BBNO .OR. SIRE . G T . BBNO + NOAI) GO TO 290 LOCS = SIRE - BBNO IF ( A I ( 9 , L O C S ) . L T . 5 0 . ) GO TO 290 DO 280 J = 1 , 4 280 S E T A ( J ) = A I ( J + 12 ,LOCS) INF = INF + 1 GO TO 320 290 DO 300 J = 1 , 4 300 S E T A ( J ) = 0 . 0 310 I F (INF . E Q . 0) GO TO 340 320 DO 330 J = 1, 4 BKR = F K ( J , I N F ) * REC DEN = F A ( J , I N F ) + REC FNUM = DEN - BKR E T A ( J ) = 0 . 5 * (FNUM*(SETA(J) + D E T A ( J ) ) + B K R * A D E V ( J ) ) / DEN 330 CONTINUE RETURN 340 DO 350 J = 1 , 4 350 E T A ( J ) = 0 . 0 360 CONTINUE RETURN END SUBROUTINE S E L E C ( I S E L , AUTO, QTA, X C E S , DPROJ, DAYR, FDRY, PRDCUL) C ********************************************* C * * C * T h i s s u b r o u t i n e s e l e c t s t h e cows t o be c u l l e d f o r low p r o d u c t i o n * C * o r t y p e s c o r e * C * * Q ******************************************************************** DIMENSION O L D A T ( 2 5 0 ) , S C O R E ( 3 , 2 5 0 ) , O F I N ( 2 5 0 ) , D F I N ( 2 5 0 ) , 1 O S T A R T ( 2 5 0 ) , D S T A R T ( 2 5 0 ) , O S T O P ( 2 5 0 ) , D S T O P ( 2 5 0 ) , 2 O Y R L A C ( 4 , 2 5 0 ) , D Y R L A C ( 4 , 2 5 0 ) , A G E ( 2 5 0 ) , C U L I S T ( 2 3 , 2 5 0 ) , 3 F C U L ( 9 , 2 5 0 ) , HRDCOW(40 ,250) , C I D ( 9 ) , T P R O D ( 4 ) , 4 O A P R D ( 3 , 2 5 0 ) , D A P R D ( 3 , 2 5 0 ) , T R P R D ( 3 ) , P B C A ( 4 ) , 5 O L D R B ( 2 5 0 ) , O L D L A C ( 4 , 2 5 0 ) , D U E P K ( 2 5 0 ) , O L D P K ( 2 5 0 ) , 6 R P R D ( 3 ) , D C U L ( 2 5 0 ) , C N X T ( 2 5 0 ) LOGICAL*1 F A L S E / F / , TRUE / T / , AUTO, SPSEL REAL*4 CID / ' H E I F ' , ' K E E P ' , ' K E E P ' , ' F E R T ' , ' B C A ' , ' E P A ' , PROGRAM LISTINGS 173 1 ' E T A ' , ' H L T H ' , ' D E A D ' / RETURN ENTRY C U L S E L ( H R D C O W , A G E , O L D A T , O L D R B , S C O R E , O F I N , D F I N , O S T A R T , D S T A R T , 1 OSTOP ,DSTOP ,OYRLAC ,DYRLAC ,OAPRD,DAPRD,OLDLAC ,OLDPK ,DUEPK , 2 TPROD,TRPRD,PBCA,TAGE ,TDP ,NRLAC ,DAYDRY,NVC ,NCOW) = TPROD(1) / 103 .2 = QTA + XCES = F A L S E PRODM QUOTA SPSEL NVC = NOC = NMC = NNC = CSEL = DO 20 0 NCOW 0 0 • I S E L 1 = 1, • 4 NOC . L E . 0 . ) GO TO 20 I HRDCOW(1,1) S C O R E ( I S E L , I ) HRDCOW(7,I) D S T A R T ( I ) O F I N ( I ) D F I N ( I ) O S T O P ( I ) D S T O P ( I ) 9,NMC) = O Y R L A C ( J , I ) 13,NMC) = D Y R L A C ( J , I ) 17,NMC) = O A P R D ( j , I ) ,1) NMC, 3, 3, 0) IF (HRDCOW(6, l ) NMC = NMC + 1 CULISTC1,NMC) = C U L I S T ( 2 , N M C ) = C U L I S T ( 3 , N M C ) = C U L I S T ( 4 , N M C ) = CULISTC5,NMC) = C U L I S T ( 6 , N M C ) = CULISTC7,NMC) = C U L I S T ( 8 , N M C ) = C U L I S T ( 9 , N M C ) = DO 10 J = 1, C U L I S T C J + C U L I S T C J + C U L I S T C J + 10 C U L I S T C J + 20,NMC) = DAPRDCJ CULISTC13 ,NMC) = O Y R L A C ( 4 , I ) CULISTC17 ,NMC) = D Y R L A C ( 4 , I ) DCUL(NMC) = 0 . C N X T ( I ) = HRDCOW(5, l ) - AINT (HRDCOW(5,1)) 20 CONTINUE CALL ISORTCCULIST , 2 3 , NMC, 1 IC = 0 IR = NMC + 1 MCP = 0 .8 * NMC + 1 30 IC = IC + 1 I F ( I C . E Q . MCP) GO TO 190 40 IA = C U L I S T C 1 , I C ) NCUL = 10. * C N X T ( I C ) + .5 C N X T ( I ) = 0 . 8 IF (DSTOP(IA) .GT IF (OSTOP(IA) . L E 1 GO TO 45 STOP = OSTOP(I A) CALL A J P R O D ( O S T A R T ( I A ) , STOP, O L D R B ( I A ) , O L D P K ( I A ) 1 0 A P R D ( 1 , I A ) , O Y R L A C ( 1 , I A ) , PRDCUL, O S T O P ( I A ) , I F (STOP . G E . O S T O P ( I A ) .AND. HRDCOW(7,IA) . G E . 4 . I F (STOP . G E . O S T O P ( I A ) ) GO TO 50 O S T O P ( I A ) = STOP O F I N ( I A ) = O S T O P ( I A ) + O L D A T ( I A ) GO TO 50 5) GO TO 70 = CSEL + HRDCOW(7,IA) - A I N T ( H R D C O W ( 7 , I A ) ) 4 TPROD(J) - C U L I S T ( J + 9 , I C ) - D Y R L A C ( J , I A ) DPROJ .AND. O S T A R T ( I A ) NCUL . L T . 5) .OR. O F I N ( I A ) GO TO 70 . L E . 0 . ) , O L D A T ( I A ) , 3, 4) ) GO TO 140 45 50 I F (NCUL . L T HRDCOW(7,IA) DO 60 J = 1, TPROD(J) = 1 J , I A ) 60 D Y R L A C ( J , I A ) IF ( O F I N ( I A ) + OYRLAC( = 0 . 0 . L T . 0 . 0 ) O F I N ( I A ) = 0 . 0 PROGRAM LISTINGS 1 7 4 D F I N ( I A ) = O F I N ( I A ) D S T A R T ( I A ) = 0 .0 D S T O P ( I A ) = 0 . 0 GO TO 120 70 B = HRDCOW(7,IA) - A I N T ( H R D C O W ( 7 , I A ) ) REC = 10 . * (HRDCOW(6,IA) - A I N T ( H R D C O W ( 6 , I A ) ) ) DUERB = REC + B STOP = DSTOP(IA) IF (DSTOP(IA) . L E . D S T A R T ( I A ) .OR. D F I N ( I A ) . L E . 0 . ) 1 GO TO 140 80 CALL A J P R O D ( D S T A R T ( I A ) , STOP, DUERB, D U E P K ( I A ) , HRDCOW(8,1A) , 1 D A P R D ( 1 , I A ) , D Y R L A C ( 1 , 1A ) , PRDCUL, D S T O P ( I A ) , 3 , 4) IF (DSTOP(IA) . L E . STOP) GO TO 150 HRDCOW(7,IA) = CSEL + B 90 D F I N ( I A ) = STOP + HRDCOW(8,IA) 100 D S T O P ( I A ) = STOP DO 110 J = 1, 4 110 TPROD(J) = TPROD(J) - C U L I S T ( J + 1 3 , I C ) + D Y R L A C ( J , I A ) 120 PRODM = TPROD(I) / 10 3 .2 CALL K I L C F ( H R D C O W ( 1 , I A ) , O L D A T ( I A ) , HRDCOW(8 , IA) , HRDCOW(9,1A) , 1 D F I N ( I A ) ) 130 NVC = NVC + 1 140 D C U L ( I C ) = D F I N ( I A ) IF ( D C U L ( I C ) . E Q . 0 . ) D C U L ( I C ) = 1. GO TO 170 150 I F (HRDCOW(7,IA) . G E . 4 . ) GO TO 140 IF ( D F I N ( I A ) . E Q . DAYR) GO TO 160 HRDCOW(7,IA) = CSEL + B GO TO 130 160 NNC = NNC + 1 D C U L ( I C ) = -1 * (STOP + HRDCOW(8,IA) - DAYR) 170 IF ( S P S E L ) GO TO 280 I F (PRODM . G T . QUOTA) GO TO 30 IC = IC + 1 IF ( IC . G E . MCP .OR. NNC . G E . NVC) GO TO 190 MCP = MIN0(MCP , IC + NVC - NNC) DO 180 J = I C , MCP IA = C U L I S T ( 1 , J ) HRDCOW(5,IA) = A I N T ( H R D C O W ( 5 , I A ) ) + .2 180 CONTINUE IC = MCP + 1 190 JMC = NMC + 1 IR = 0 DO 200 J = 1, NMC L = JMC - J IA = C U L I S T ( 1 , L ) I F (HRDCOW(7,IA) . L T . 4 . ) IR = IR + 1 HRDCOW(5,IA) = IR + C N X T ( I A ) 200 CONTINUE 210 IF (AUTO) GO TO 370 NCWL = IC NS = 1 220 DO 230 I = NS , NCWL J F = C U L I S T ( 1 , 1 ) F C U L ( 1 , 1 ) = I F C U L ( 2 , I ) = HRDC0W(1,JF) F C U L ( 3 , 1 ) = D C U L ( I ) F C U L ( 4 , 1 ) = S C O R E ( 1 , J F ) F C U L ( 5 , I ) = S C O R E ( 2 , J F ) F C U L ( 6 , I ) = S C O R E ( 3 , J F ) F C U L ( 7 , I ) = C U L I S T ( 1 0 , I ) + C U L I S T ( 1 4 , I ) F C U L ( 8 , 1 ) = O Y R L A C ( 1 , J F ) + D Y R L A C ( 1 , J F ) PROGRAM LISTINGS 175 I SET = HRDCOW(7,JF) F C U L ( 9 , I ) = C I D ( I S E T ) 230 CONTINUE 240 WRITE ( 6 , 5 1 0 ) NOUT = NCWL - NS + 1 CALL WRCULtFCUL, 9 , NOUT) SPSEL = TRUE WRITE ( 6 , 5 3 0 ) OTA, XCES , PRODM WRITE ( 6 , 5 4 0 ) READ ( 5 , 5 5 0 ) IOPT GO TO ( 2 5 0 , 2 7 0 , 3 2 0 , 3 7 0 ) , IOPT WRITE ( 6 , 5 8 0 ) 250 WRITE ( 6 , 5 9 0 ) READ ( 5 , 5 5 0 ) NEX NW = NCWL + NEX I F (NW . L E . NMC) GO TO 260 WRITE ( 6 , 6 0 0 ) NMC NW = NMC 260 NCWL = NW GO TO 220 270 WRITE ( 6 , 5 6 0 ) READ ( 5 , 5 5 0 ) NCH 280 IF (NCH . L E . 0) GO TO 220 NCH = NCH - 1 GO TO 300 290 WRITE ( 6 , 5 8 0 ) 300 WRITE ( 6 , 5 7 0 ) 310 READ ( 5 , 5 5 0 ) IC I F ( IC . G T . NMC .OR. IC . L T . 1) GO TO 290 IF ( C U L I S T ( 4 , I C ) . G T . 3 . ) GO TO 280 GO TO 40 320 WRITE ( 6 , 5 6 0 ) READ ( 5 , 5 5 0 ) NRC 330 IF (NRC . L E . 0) GO TO 220 NRC = NRC - 1 GO TO 350 340 WRITE ( 6 , 5 8 0 ) 350 WRITE ( 6 , 5 7 0 ) READ ( 5 , 5 5 0 ) NIC IF ( I C . G T . NMC .OR. IC . L T . 1) GO TO 340 IA = C U L I S T ( 1 , N I C ) IF ( A I N T ( H R D C O W ( 7 , I A ) ) . N E . C S E L ) GO TO 330 NVC = NVC - 1 DO 360 J = 1, 3 TPROD(J) = TPROD(J) - D Y R L A C ( J , I A) - O Y R L A C ( J , I A ) + C U L I S T ( J + 1 9 , N I C ) + C U L I S T ( J + 1 3 , N I C ) O Y R L A C ( J , I A ) = C U L I S T ( J + 9 , N I C ) D Y R L A C ( J , I A ) = C U L I S T ( J + 1 3 , N I C ) O A P R D ( J , I A ) = C U L I S T ( J + 1 7 , N I C ) 360 D A P R D ( J , I A ) = C U L I S T ( J + 2 0 , N I C ) TPROD(4) = T P R O D U ) - DYRLAC ( 4 , 1 A ) - O Y R L A C ( 4 , I A ) + CULI ST ( 1 3 , NIC) 1 + C U L I S T ( 1 7 , N I C ) O Y R L A C ( 4 , I A ) = C U L I S T ( 1 3 , N I C ) D Y R L A C ( 4 , I A ) = C U L I S T ( 1 7 , N I C ) HRDCOW(7,IA) = C U L I S T ( 4 , N I C ) CALL R E V C F ( H R D C O W ( 1 , I A ) , O L D A T ( I A ) , HRDCOW(8 , IA) , HRDCOW(9,1A) , 1 D F I N ( I A ) ) D S T A R T ( I A ) = C U L I S T ( 5 , N I C ) O F I N ( I A ) = C U L I S T ( 6 , N I C ) D F I N ( I A ) = C U L I S T ( 7 , N I C ) O S T O P ( I A ) = C U L I S T ( 8 , N I C ) D S T O P ( I A ) = C U L I S T ( 9 , N I C ) P R O G R A M L I S T I N G S 1 7 5 DCUL(NIC) = 0 . PRODM = TPROD(I) / 103 .2 GO TO 330 C C*** A d j u s t r o l l i n g h e r d a v e r a g e s *** C 370 I F (NVC . L E . 0) RETURN IC = 0 DO 490 1 = 1 , NVC 380 IC = IC + 1 IF ( I C . G T . NMC) GO TO 500 IA = C U L I S T ( 1 , I C ) IF ( A I N T ( H R D C O W ( 7 , I A ) ) . N E . CSEL) GO TO 380 I F (OSTOP(IA) . E Q . C U L I S T ( 8 , I C ) .OR. O S T O P ( I A ) . G T . 3 0 5 . ) 1 GO TO 440 CALL R H P R O D ( A G E ( I A ) , O L D R B ( I A ) , O L D P K ( I A ) , O L D A T ( I A ) , 1 C U L I S T ( 8 , I C ) , STOPO, RPRD, O L D L A C ( 1 , I A ) , 3, 4) DO 390 J = 1 , 3 P B C A ( J ) = P B C A ( J ) - O L D L A C ( J , I A ) TRPRD(J) = TRPRD(J) - RPRD(J) 390 CONTINUE CALL R H P R O D ( A G E ( I A ) , O L D R B ( I A ) , O L D P K ( I A ) , O L D A T ( I A ) , O S T O P ( I A ) , 1 STOPN, RPRD, O L D L A C ( 1 , I A ) , 3, 4) DO 400 J = 1 , 3 P B C A ( J ) = P B C A ( J ) + O L D L A C ( J , I A ) TRPRD(J) = TRPRD(J) + RPRD(J) 400 CONTINUE TDP = TDP - STOPO + STOPN 410 IF ( C U L I S T ( 9 , I C ) . L T . 3 0 5 . .AND. C U L I S T ( 7 , I C ) . E Q . DAYR) 1 GO TO 490 I F (HRDCOW(19,IA) . L E . 0 . ) GO TO 490 420 REC = 10. * (HRDCOW(6,IA) - A I N T ( H R D C O W ( 6 , I A ) ) ) DUERB = REC + HRDCOW(7,IA) - A I N T ( H R D C O W ( 7 , I A ) ) CALL R H P R O D ( A G E ( I A ) , DUERB, D U E P K ( I A ) , HRDCOW(8,1A) , 1 C U L I S T ( 9 , I C ) , STOPO, RPRD, H R D C O W ( 1 9 , I A ) , 3, 4) DO 430 J = 1 , 3 P B C A ( J ) = P B C A ( J ) - HRDOOW(J + 1 8 , I A ) TRPRD(J) = TRPRD(J) - RPRD(J) 430 CONTINUE PBCA(4) = PBCA(4) - HRDCOW(22,IA) TDP = TDP - STOPO TAGE = TAGE - A G E ( I A ) - HRDCOW(8,IA) / DAYR + 1. NRLAC = NRLAC - 1 HRDCOW(6,IA) = HRDCOW(6,IA) - 1. GO TO 490 440 IF ( D S T O P ( I A ) . L E . 0 . ) GO TO 410 IF (DSTOP(IA) . G T . 3 0 5 . ) GO TO 490 REC = 10. * (HRDCOW(6,IA) - A I N T ( H R D C O W ( 6 , I A ) ) ) DUERB = REC + HRDCOW(7,IA) - A I N T ( H R D C O W ( 7 , I A ) ) IF ( C U L I S T ( 7 , I C ) . E Q . DAYR .AND. C U L I S T ( 9 , I C ) . L T . 3 0 5 . ) 1 GO TO 470 CALL R H P R O D ( A G E ( I A ) , DUERB, D U E P K ( I A ) , H R D C O W ( 8 , I A ) , 1 C U L I S T ( 9 , I C ) , STOPO, RPRD, HRDCOW(19,1A) , 3 , 4) DO 450 J = 1, 3 P B C A ( J ) = P B C A ( J ) - HRDCOW(j + 1 8 , I A ) TRPRD(J) = TRPRD(J) - RPRD(J) 450 CONTINUE CALL R H P R O D ( A G E ( I A ) , DUERB, D U E P K ( I A ) , H R D C O W ( 8 , I A ) , Q S T O P ( I A ) , 1 STOPN, RPRD, HRDCOW(19 , IA) , 3 , 4) DO 460 J = 1, 3 P B C A ( J ) = P B C A ( J ) + HRDCOW(j + 1 8 , I A ) TRPRD(J) = TRPRD(J) + RPRD(J) PROGRAM LISTINGS 177 460 CONTINUE TDP = TDP - STOPO + STOPN GO TO 490 470 CALL R H P R O D ( A G E ( I A ) , DUERB, D U E P K ( I A ) , HRDCOW (8 , IA) , D S T O P ( I A ) , 1 STOPN, RPRD, H R D C O W ( 1 9 , I A ) , 3, 4) DO 480 J = 1 , 3 P B C A ( J ) = P B C A ( J ) + HRDCOW(J + 1 8 , I A ) TRPRD(J) = TRPRD(J) + RPRD(J) 480 CONTINUE PBCA(4) = PBCA(4) + HRDCOW(22,IA) TDP = TDP + STOPN TAGE = TAGE + A G E ( I A ) + HRDCOW(8,IA) / DAYR - 1. HRDCOW(6,IA) = HRDCOW(6,IA) + 1. NRLAC = NRLAC + 1 490 CONTINUE RETURN 500 WRITE ( 6 , 6 1 0 ) 510 FORMAT 1 2 3 520 FORMAT 530 FORMAT 1 2 540 FORMAT 1 2 3 550 FORMAT 560 FORMAT 570 FORMAT 580 FORMAT 590 FORMAT 600 FORMAT 610 FORMAT RETURN END 4X, 3X, 25X, 'COWS TO BE C U L L E D ' , //, 17X, ' C U L L ' , 6X, INDEX S C O R E S ' , 7X, ' M A X ' , 4X, ' A C T ' , /, 4X, 'LOC COW', 4X, ' D A Y ' , 3X, ' L A C T ' , 4X, ' E P A ' , 4X, ' ETA PROD PROD S T A T U S ' ) 8 F 7 . 0 , 2X, A4) 5X, 'YOUR FLUID QUOTA I S ' , F 7 . 0 , ' HL PLUS EXCESS OF* 7 . 0 , /, 6X, ' T H I S YEARS PRODUCTION WILL B E ' , F 8 . 1 , H E C T O L I T R E S ' ) ENTER - 1 TO PRINT A LONGER L I S T ' / , - 2 TO CULL MORE COWS'/, - 3 TO RESTORE S E L E C T I V E L Y CULLED COWS'/, - 4 TO C O N T I N U E ' , /, 'OPTION ? ' ) 61 1 0) NUMBER OF COWS TO CHANGE ? ' ) COW LOCATION NUMBER ? ' ) INVALID E N T R Y ' ) HOW MANY MORE COWS DO YOU WANT PRINTED ? ' ) THERE ARE O N L Y ' , 14 , ' COWS E L I G A B L E TO C U L L ' ) TROUBLE WITH PRODUCTION C U L L S ' ) SUBROUTINE INBLUP(KBCA, AVG) Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * C * * C * T h i s s u b r o u t i n e s t o r e s f i r s t l a c t a t i o n r e c o r d s f o r s i r e s * C * and o u t p u t s them a t t h e e n d of t h e r u n * C * * Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * DIMENSION I B L U P ( 8 , 2 0 ) , R E C ( 4 ) , K B C A ( 4 ) , AVG(4) NFL = 0 NS = 0 RETURN ENTRY B L U P ( S I R E , IHRD, IYR, REC) NHYS = IHRD * 100 + IYR I S I R E = SIRE NFL = NFL + 1 I F (NS . E Q . 0) GO TO 20 DO 10 J = 1, NS I F ( I B L U P ( 3 , J ) . E Q . I S I R E ) GO TO 40 10 CONTINUE 20 CONTINUE NS = NS + 1 I B L U P ( 1 , N S ) = IHRD PROGRAM LISTINGS I B L U P ( 2 , N S ) = NHYS I B L U P ( 3 , N S ) = SIRE I B L U P ( 4 , N S ) = 1 DO 30 K = 1, 3 30 IBLUP(K + 4 ,NS) = REC(K) / AVG(K) * 100. + KBCA(K) I B L U P ( 8 , N S ) = R E C ( 4 ) GO TO 60 40 DO 50 K = 1, 3 50 I B L U P ( K + 4 , J ) = REC(K) / AVG(K) * 100. + KBCA(K) + IBLUP( 1K + 4 , J ) I B L U P ( 8 , J ) = R E C ( 4 ) + I B L U P ( 8 , J ) I B L U P ( 4 , J ) = I B L U P ( 4 , J ) + 1 60 RETURN ENTRY PBLUP DO 70 I = 1, NS 70 CALL PRTUNF ( I B L U P ( 1 , I ) , 8 , 13) RETURN END SUBROUTINE YOUNG(SINDEX, I S E L Y L , NSYL , IYR, IHRD, DAYR, DTYLG , 1 DTCF , FDYLG , FDCF , AUTO) C ******************************************* c * * C * T h i s s u b r o u t i n e moves t h e o l d c a l v e s t o y e a r l i n g a r r a y * C * * Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * COMMON I SEED , E W K ( 4 ) , GWK(4) /YNG/ Y G C A L F ( 8 , 2 0 0 ) , NYCLF DIMENSION Y R L G ( 1 8 , 1 0 0 ) , Y C A L F ( 8 , 2 0 0 ) , O U T Y G ( 1 2 , 2 0 0 ) , U C A L F ( 8 , 1 5 0 ) , 1 D O C F ( 2 , 2 0 0 ) , D Y C F ( 2 , 2 0 0 ) , C A L F ( 1 8 , 1 5 0 ) , Y S P ( 1 8 , 1 0 ) , 2 RNE (4) , E S I G M A U ) , P C E S D U ) , S I N D E X U ) , A C B V ( 4 ) , 3 B V L Y L ( 4 ) , B V S Y L ( 4 ) , B V D Y L ( 4 ) , I S E L Y L ( 5 0 ) , DUMY(4) REAL*4 SOLD / ' S O L D ' / , DEAD / ' D E A D ' / , BLANK /' ' / C LOGICAL*1 AUTO, F A L S E / F / , TRUE / T / , F I N I S H C RETURN C C UPDATE YEARLINGS AND CALCULATE FEED COSTS C ENTRY Y N G O U T ( N Y L G , N Y L S , N Y L D , B V L Y L , B V S Y L , B V D Y L , T Y F D C ) F I N I S H = F A L S E NYLG = 0 NS = NSYL NYLS = 0 NYLD = 0 NTCF = 0 TYFDC = 0 . 0 DO 10 I = 1, 4 B V L Y L ( I ) = 0 . 0 B V S Y L ( I ) = 0 . 0 B V D Y L ( I ) = 0 . 0 10 CONTINUE READ (2) NYYLG, NOCF I F (NYYLG . L E . 0) GO TO 140 CALL REAMAT(YRLG, 1 8 , NYYLG, 2) DO 120 I = 1, NYYLG BTH = Y R L G ( 4 , 1 ) PROGRAM LISTINGS 1 7 9 20 IF (NSYL . L T . 1) GO TO 30 IYL = YRLG(1,1) IF ( I Y L . G E . I S E L Y L ( N Y L S ) ) GO TO 60 30 DYRLG = DAYR - BTH DTPROB = DTCF * BTH / DAYR + DTYLG * DYRLG / DAYR DTRAN = F R A N D ( 0 . ) IF (DTRAN . L T . DTPROB) GO TO 90 NYLG = NYLG + 1 DO 40 J = 1, 4 Y R L G ( J , N Y L G ) = Y R L G ( J , I ) Y R L G ( J + 6 ,NYLG) = Y R L G ( J + 6,1) Y R L G ( J + 10,NYLG) = Y R L G ( J + 10,1) Y R L G ( J + 14,NYLG) = Y R L G ( J + 14,1) 40 BVLYL( J ) = B V L Y L ( J ) + Y R L G ( J + 9,1) Y R L G ( 5 , N Y L G ) = YRLG(5,1) Y R L G ( 6 , N Y L G ) = Y R L G ( 6 , I ) YYFDC = FDCF * BTH + FDYLG * DYRLG TYFDC = TYFDC + YYFDC OUTYG(10,1) = YYFDC CALL Y N G E T A ( Y R L G ( 2 , N Y L G ) , Y R L G ( 3 , N Y L G ) , O U T Y G ( 5 , 1 ) , 1 Y R L G ( 1 5 , N Y L G ) , 4) IF (AUTO) GO TO 120 OUTYG(9,1) = 0 . 0 DO 50 J = 1 , 4 O U T Y G ( 9 , I ) = O U T Y G ( 9 , I ) + OUTYG(J + 4,1) * S I N D E X ( J ) 50 O U T Y G ( J , I ) = Y R L G ( J , I ) OUTYG(11,1) = BLANK OUTYG(12,1) = BLANK GO TO 120 60 NS = NS - 1 IF (NS . L E . 0) NSYL = 0 I F ( I S E L Y L ( N S Y L - NS) . L T . I Y L ) GO TO 60 IF ( I S E L Y L ( N S Y L - NS) . N E . I Y L ) GO TO 30 NYLS = NYLS + 1 DO 70 J = 1 , 4 B V S Y L ( J ) = B V S Y L ( J ) + Y R L G ( J + 9,1) 70 CONTINUE YYFDC = FDCF * BTH TYFDC = TYFDC + YYFDC IF (AUTO) GO TO 120 DO 80 J = 1, 4 OUTYG(J + 4,1) = 0 . 0 80 O U T Y G ( J , I ) = Y R L G ( J , I ) OUTYG(9,1) = 0 . 0 OUTYG(10,1) = YYFDC OUTYG(11,1) = SOLD OUTYG(12,1) = BLANK GO TO 120 90 DEDAT = F R A N D ( 0 . ) * DAYR I F (DEDAT . L T . BTH) BTH = DEDAT NYLD = NYLD + 1 DO 100 J = 1, 4 B V D Y L ( J ) = B V D Y L ( J ) + Y R L G ( J + 9,1) 100 CONTINUE YYFDC = BTH * FDCF + (DEDAT - BTH) * FDYLG TYFDC = TYFDC + YYFDC I F (AUTO) GO TO 120 DO 110 J = 1, 4 OUTYG(J + 4,1) = 0 . 0 110 O U T Y G ( J , I ) = Y R L G ( J , I ) O U T Y G ( 9 , I ) = 0 . 0 OUTYG(10,1) = YYFDC PROGRAM LISTINGS 180 O U T Y G ( 1 1 , 1 ) = DEAD O U T Y G ( 1 2 , 1 ) = BLANK 120 CONTINUE WRITE (12) NYLG I F (NYLG . L E . 0) GO TO 130 CALL WRTMAT(YRLG, 18, NYLG, 12) 130 I F (AUTO) GO TO 140 CALL T I T L Y G CALL WRTYG(OUTYG, 12, NYYLG) C C CALVES C 140 I F (NOCF . L E . 0) GO TO 150 CALL REAMAT(YCALF , 8 , NOCF, 2) CALL C A L F U P ( Y C A L F , OUTYG, C A L F , U C A L F , YSP , NOCF, N T C F , N L C F , 1 NUCF, NYSP) 150 IF (NYCLF . L E . 0) GO TO 160 N = 1 CALL C A L F U P ( Y G C A L F , OUTYG, C A L F , U C A L F , YSP , N Y C L F , N T C F , NLCF , 1 NUCF, NYSP) 160 WRITE (12) N L C F , NUCF IF (NLCF . L E . 0) GO TO 170 CALL WRTMAT(CALF, 18, N L C F , 12) 170 IF (NUCF . L E . 0) GO TO 180 CALL WRTMAT(UCALF, 8 , NUCF, 12) 180 IF (NYSP . L E . 0) GO TO 200 DO 190 I = 1, NYSP 190 WRITE (11) ( Y S P ( J . I ) , J = 1 , 1 8 ) 200 IF (AUTO) RETURN IF (NTCF . L E . 0) RETURN CALL T I T L C F CALL WRTYG(OUTYG, 12, NTCF) RETURN END C C c SUBROUTINE CALVES(ESIGMA, PCESD, PINB, SINDEX, FDCF , FERSD, FERM, 1 HDSD, HDM, DTCF , DTUB, IHRD, DAYR, IYR, AUTO) Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * C * * C * T h i s s u b r o u t i n e moves n e w - b o r n c a l v e s t o c a l v e s a r r a y * C * * Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * COMMON I SEED, E W K ( 4 ) , GWK(4) / K I L / D O C F ( 2 , 2 0 0 ) , D Y C F ( 2 , 2 0 0 ) , NOD, 1 NYD /CFBV/ B V L C F ( 4 ) , B V Y S P ( 4 ) , B V S H C F U ) , BVSBCF (4) , 2 B V D C F U ) , N L C F , NYSP, NSHCF, NSBCF, NDCF, TCFDC DIMENSION Y C A L F ( 8 , 2 0 0 ) , O U T Y G ( 1 2 , 2 0 0 ) , U C A L F ( 8 , 1 5 0 ) , C A L F ( 1 8 , 1 5 0 ) , 1 Y S P ( 1 8 , 1 0 ) , S I N D E X U ) , P C E S D ( 4 ) , E S I G M A U ) , R N E ( 4 ) , 2 P I N B ( 4 ) , A C B V ( 4 ) , DUMY(4) REAL*4 HEIF / ' H E I F ' / , BULL / ' B U L L ' / , SOLD / ' S O L D ' / , SAI / ' S A I ' / , 1 DEAD / ' D E A D ' / , BLANK /' ' / LOGICAL*1 AUTO, F A L S E / F / , TRUE / T / , F I N I S H , SECRD/T/ RETURN ENTRY C A L F U P ( Y C A L F , O U T Y G , C A L F , U C A L F , Y S P , N C F , N T C F , N L C , N U C F , N Y S ) N = 1 SECRD = .NOT. SECRD I F (SECRD) GO TO 60 NTCF = 0 NSBCF = 0 NSHCF = 0 NLCF = 0 PROGRAM LISTINGS 181 NYSP = 0 NDCF = 0 NUCF = 0 TCFDC = 0 . 0 NYR = (IYR + 10) * 100 IF (NOD . L T . 1) GO TO 10 CALL I SORT(DOCF, 2, NOD, 1, NOD, 1, 3, 0) GO TO 20 10 D O C F ( 1 , 1 ) = 9 0 0 0 . 20 IF (NYD . L T . 1) GO TO 30 CALL I S O R T ( D Y C F , 2, NYD, 1, NYD, 1, 3 , 0) GO TO 40 30 D Y C F ( 1 , 1 ) = 9 0 0 0 . 40 DO 50 I = 1, 4 B V L C F ( I ) = 0 . 0 A C B V ( I ) = 0 . 0 B V Y S P ( I ) = 0 . 0 B V S H C F ( I ) = 0 . 0 B V S B C F ( I ) = 0 . 0 B V D C F ( I ) = 0 . 0 50 CONTINUE 60 DO 300 1 = 1 , NCF BTH = YCALF(4 , 1 ) IF (SECRD) GO TO 80 BTH = BTH - DAYR 70 IF ( Y C A L F ( 3 , I ) . G E . D 0 C F ( 1 , N ) ) GO TO 260 GO TO 90 80 IF ( Y C A L F ( 3 , I ) . G E . D Y C F ( 1 , N ) ) GO TO 270 I F (BTH . G T . DAYR) GO TO 280 90 NTCF = NTCF + 1 SIRE = YCALF(2, 1 ) DAM = YCALF(3 , 1 ) O U T Y G ( 2 , N T C F ) = SIRE O U T Y G ( 3 , N T C F ) = DAM O U T Y G ( 4 , N T C F ) = BTH 100 DTRAN = F R A N D ( 0 . ) IF (DTRAN . L T . DTUB) GO TO 220 ISTAT = YCALF(1 , 1 ) DO 110 J = 1, 4 110 A C B V ( J ) = A C B V ( J ) + Y C A L F ( J + 4,1) DTPROB = DTCF * BTH / DAYR I F (DTRAN . L T . DTPROB) GO TO 210 SEX = F R A N D ( 0 . ) IF (SEX . L E . 0 . 5 ) GO TO 140 IF ( I S T A T . G T . 2) GO TO 160 120 NLCF = NLCF + 1 CALL MNDG1(ISEED, ESIGMA, RNE, EWK) DO 130 J = 1, 4 BV = Y C A L F ( J + 4,1) B V L C F ( J ) = B V L C F ( J ) + BV C A L F ( J + 6 , N L C F ) = R N E ( J ) * P C E S D ( J ) 130 C A L F ( J + 1 0 , N L C F ) = BV BUL = YCALF(2 , 1 ) INB = 10. * (BUL - A I N T ( B U L ) ) I F (INB . N E . 1) GO TO 137 DO 135 J = 1, 4 C A L F ( J + 6 , NLCF) = C A L F ( J + 6 , NLCF) - P I N B ( J ) 135 CONTINUE 137 CALL C L F E T A ( S I R E , DAM, O U T Y G ( 5 , N T C F ) , C A L F ( 1 5 , N L C F ) , 4) C A L F ( 1 , N L C F ) = NYR + NLCF C A L F ( 2 , N L C F ) = Y C A L F ( 2 , I ) C A L F ( 3 , N L C F ) = Y C A L F ( 3 , I ) PROGRAM LISTINGS. 182 C A L F ( 4 , N L C F ) = BTH C A L F ( 5 , N L C F ) = HDM + 1 - (HDSD * F R A N D N ( 0 . 0 ) ) C A L F ( 6 , N L C F ) = FERM + 1 - ( F E R S D * F R A N D N ( 0 . 0 ) ) YCFDC = (DAYR - BTH) * FDCF TCFDC = TCFDC + YCFDC I F (AUTO) GO TO 300 O U T Y G ( 1 , N T C F ) = NYR + NLCF O U T Y G ( 9 , N T C F ) = OUTYG(5 ,NTCF) * SINDEX(1) + O U T Y G ( 6 , N T C F ) * 1 S I N D E X ( 2 ) + OUTYG(7 ,NTCF) * SINDEX(3) + O U T Y G ( 8 , N T C F ) * SINDEX( 2 4) O U T Y G ( 1 0 , N T C F ) = YCFDC O U T Y G ( 1 1 , N T C F ) = HEIF O U T Y G ( 1 2 , N T C F ) = BLANK GO TO 300 140 O U T Y G ( 1 1 , N T C F ) = BULL IF (I STAT . G T . 1) GO TO 180 NYSP = NYSP + 1 DO 150 J = 1 , 4 BV = Y C A L F ( J + 4,1 ) B V Y S P ( J ) = B V Y S P ( J ) + BV 150 Y S P ( J + 6 ,NYSP) = BV Y S P ( 1 , N Y S P ) = IYR Y S P ( 2 , N Y S P ) = Y C A L F ( 2 , I ) Y S P ( 3 , N Y S P ) = Y C A L F ( 3 , I ) Y S P ( 4 , N Y S P ) = BTH Y S P ( 5 , N Y S P ) = IHRD Y S P ( 6 , N Y S P ) = ( Y C A L F ( 1 , I ) - I S T A T ) * 10000. CALL C L F E T A ( S I R E , DAM, Y S P ( 1 1 , N Y S P ) , Y S P ( 1 5 , N Y S P ) , 4) I F (AUTO) GO TO 300 O U T Y G ( 1 , N T C F ) = NYSP O U T Y G ( 5 , N T C F ) = Y S P ( 1 1 , N Y S P ) O U T Y G ( 6 , N T C F ) = Y S P ( 1 2 , N Y S P ) O U T Y G ( 7 , N T C F ) = Y S P ( 1 3 , N Y S P ) O U T Y G ( 8 , N T C F ) = Y S P ( 1 4 , N Y S P ) O U T Y G ( 9 , N T C F ) = OUTYG(5 ,NTCF) * SINDEX(1) + O U T Y G ( 6 , N T C F ) * 1 SINDEX(2) + O U T Y G ( 7 , N T C F ) * SINDEX(3) + O U T Y G ( 8 , N T C F ) * SINDEX( 2 4) O U T Y G ( 1 0 , N T C F ) = 0 . 0 O U T Y G ( 1 2 , N T C F ) = SAI GO TO 300 160 O U T Y G ( 1 1 , N T C F ) = HEIF NSHCF = NSHCF + 1 DO 170 J = 1, 4 B V S H C F ( J ) = B V S H C F ( J ) + Y C A L F ( J + 4 , 1 ) 170 CONTINUE GO TO 200 180 NSBCF = NSBCF + 1 DO 190 J = 1, 4 B V S B C F ( J ) = B V S B C F ( J ) + Y C A L F ( J + 4 , 1 ) 190 CONTINUE 200 I F (AUTO) GO TO 300 CALL C L F E T A ( S I R E , DAM, O U T Y G ( 5 , N T C F ) , DUMY, 4) O U T Y G ( 1 , N T C F ) = 0 . 0 O U T Y G ( 9 , N T C F ) = 0 .0 O U T Y G ( 1 0 , N T C F ) = 0 . 0 O U T Y G ( 1 2 , N T C F ) = SOLD GO TO 300 210 DEDAT = F R A N D ( 0 . ) * (DAYR - BTH) + BTH GO TO 230 220 DEDAT = 0 . 0 230 NDCF = NDCF + 1 DO 240 J = 1 , 4 PROGRAM LISTINGS 1 8 3 B V D C F ( J ) = BVDCF(J) + Y C A L F ( J + 4 , 1 ) 240 CONTINUE YCFDC = (DEDAT - BTH) * FDCF IF (YCFDC . L T . 0 . 0 ) YCFDC = 0 . 0 TCFDC = TCFDC + YCFDC IF (AUTO) GO TO 300 O U T Y G ( 1 0 , N T C F ) = YCFDC O U T Y G ( 1 , N T C F ) = 0 . 0 O U T Y G ( 4 , N T C F ) = BTH DO 250 J = 1, 4 250 OUTYG(J + 4 , N T C F ) = 0 . 0 O U T Y G ( 9 , N T C F ) = 0 .0 O U T Y G ( 1 1 , N T C F ) = BLANK O U T Y G ( 1 2 , N T C F ) = DEAD GO TO 300 260 N = N + 1 IF (N . G T . NOD) D O C F ( l , N ) = 9 0 0 0 . IF ( Y C A L F ( 3 , I ) . G T . D 0 C F ( 1 , N - l ) ) GO TO 70 IF ( D O C F ( 2 , N - 1) . E Q . BTH) GO TO 300 IF ( D 0 C F ( 1 , N ) . N E . Y C A L F ( 3 , I ) .OR. D O C F ( 2 , N ) . N E . BTH) 1 GO TO 70 N = N - 1 GO TO 300 270 N = N + 1 IF (N . G T . NYD) D Y C F ( l , N ) = 9 0 0 0 . IF ( Y C A L F ( 3 , I ) . G T . D Y C F ( 1 , N - 1)) GO TO 80 IF ( D Y C F ( 2 , N - 1) . E Q . BTH) GO TO 300 IF ( D Y C F ( 1 , N ) . N E . Y C A L F ( 3 , I ) .OR. D Y C F ( 2 , N ) . N E . BTH) 1 GO TO 80 N = N - 1 GO TO 300 280 NUCF = NUCF + 1 DO 290 J = 1, 8 290 U C A L F ( J , N U C F ) = Y C A L F ( J , I ) 300 CONTINUE NLC = NLCF NYS = NYSP RETURN END SUBROUTINE I N K I L ( G E S T ) Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * C * T h i s s u b r o u t i n e remove c a l v e s c o n c e i v e d by cows w h i c h * C * d i e o r a r e s o l d b e f o r e p a r t u r i t i o n * Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * COMMON / K I L / D O C F ( 2 , 2 0 0 ) , D Y C F ( 2 , 2 0 0 ) , NOD, NYD NOD = 0 NYD = 0 RETURN ENTRY K I L C F ( C O W , O L D A T , D U E D A T , F U T D A T , F I N ) I F ( F I N . G T . OLDAT) GO TO 10 I F (OLDAT . L T . 0 . 0 ) GO TO 10 NOD = NOD + 1 DOCF(1 ,NOD) = COW DOCF(2 ,NOD) = OLDAT 10 I F ( F I N . G E . DUEDAT) GO TO 30 IF (DUEDAT . G E . GEST) GO TO 20 NOD = NOD + 1 DOCF(1,NOD) = COW DOCF(2,NOD) = DUEDAT PROGRAM LISTINGS 184 GO TO 30 20 NYD = NYD + 1 D Y C F ( 1 , N Y D ) = COW D Y C F ( 2 , N Y D ) = DUEDAT 30 IF (FUTDAT . L T . 0 . 0 ) GO TO 40 NYD = NYD + 1 D Y C F ( 1 , N Y D ) = COW D Y C F ( 2 , N Y D ) = FUTDAT 40 RETURN ENTRY R E V C F ( C O W , O L D A T , D U E D A T , F U T D A T , F I N ) IF ( F I N . L T . OLDAT) GO TO 50 IF ( F I N . G T . DUEDAT) GO TO 90 I F (DUEDAT . G T . GEST) GO TO 100 50 N = NOD 60 I F (COW . E Q . D O C F ( 1 , N ) ) GO TO 70 N = N - 1 GO TO 60 70 D O C F ( 1 , N ) = 0 . 0 I F (N . E Q . 1) GO TO 80 IF (COW . E Q . D O C F ( 1 , N - 1)) D O C F ( 1 , N - 1) = 0 . 0 80 IF (DUEDAT . G T . GEST) GO TO 100 90 IF (FUTDAT . L T . 0 . 0 ) RETURN 100 N = NYD 110 IF (COW . E Q . D Y C F ( 1 , N ) ) GO TO 120 N = N - 1 GO TO 110 120 D Y C F ( 1 , N ) = 0 . 0 I F (N . E Q . 1) RETURN I F (COW . E Q . D Y C F ( 1 , N - 1)) D Y C F ( 1 , N - 1) = 0 . 0 RETURN END SUBROUTINE SUMCOW(HRDCOW, OYRLAC, DYRLAC, OAPRD, DAPRD, OLDLAC, 1 E P A , E T A , SCORE, AVG, I A J B C A , OSTART, DSTART, OSTOP, 2 DSTOP, O F I N , D F I N , OLDAT, A G E , NCOW, IYR , DPROJ , DRYFD, 3 DAYR, G E S T , L I N E , AUTO) C *********************************************** C * T h i s s u b r o u t i n e a c c u m u l a t e s y e a r s s u m m a r i e s f o r cows r e c o r d s * Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * COMMON /COWBV/ T H B V ( 4 ) , T C B V ( 4 ) , F C B V ( 4 ) , C L C B V ( 4 ) , E P C B V U ) , 1 • E T C B V ( 4 ) , H C B V ( 4 ) , D C B V ( 4 ) , NBHF, NLCW, NFCUL , NLCUL , 2 NPCUL, NTCUL, NHCUL, NDCW DIMENSION HRDCOW(40 ,250) , O Y R L A C ( 4 , 2 5 0 ) , D Y R L A C ( 4 , 2 5 0 ) , 1 O A P R D ( 3 , 2 5 0 ) , D A P R D ( 3 , 2 5 0 ) , E P A ( 4 , 2 5 0 ) , E T A ( 4 , 2 5 0 ) , 2 O S T O P ( 2 5 0 ) , D S T O P ( 2 5 0 ) , A G E ( 2 5 0 ) , S C O R E ( 3 , 2 5 0 ) , M B C A ( 3 ) , 3 I B C A ( 3 ) , N B C A ( 3 ) , A V G ( 4 ) , I A J B C A U ) , O S T A R T ( 2 5 0 ) , 4 D S T A R T ( 2 5 0 ) , O F I N ( 2 5 0 ) , D F I N ( 2 5 0 ) , O L D A T ( 2 5 0 ) , 5 O L D L A C ( 4 , 2 5 0 ) REAL*4 POPEN / ' O P E N ' / , PBRED / ' B R E D ' / , PFERT / 1 ' F E R T ' / , PLACT / ' B C A ' / , PEPA / ' E P A ' / , PETA / ' E T A ' / , 2 PPROB / ' H L T H ' / , PDEAD / ' D E A D ' / LOGICAL*1 AUTO NC = 0 NSH = 0 NLCW = 0 P R O G R A M L I S T I N G S NFCUL = 0 NLCUL = 0 NPCUL = 0 NTCUL = 0 NHCUL = 0 NDCW = 0 NBHF = 0 NOCW = NCOW NCOW = 0 DO 10 J = 1, 4 T C B V ( J ) = 0 . T H B V ( J ) = 0 . F C B V ( J ) = 0 . C L C B V ( J ) = 0 . E P C B V ( J ) = 0 . E T C B V ( J ) = 0 . H C B V ( J ) = 0 . D C B V ( J ) = 0 . 10 CONTINUE IF ( .NOT. AUTO) CALL F T I T L E DO 360 1 = 1 , NOCW ISTAT = HRDCOW(7,I) GO TO ( 4 0 , 20 , 2 0 , 8 0 , 100, 120, 140, 160, 1 8 0 ) , ISTAT WRITE ( 6 , 3 7 0 ) H R D C O W ( l , I ) GO TO 360 20 NLCW = NLCW + 1 DO 30 J = 1, 4 30 T C B V ( J ) = T C B V ( J ) + HRDCOW(J + 1 4 , 1 ) GO TO 60 40 NBHF = NBHF + 1 DO 50 J = 1 , 4 THBV(4) = THBV(4) + HRDCOW(j + 14,1) 50 CONTINUE 60 DISPO = POPEN I F (HRDCOW(9,I) . G T . 0 . 0 ) GO TO 70 LDATE = HRDCOW(10,I) - 0 . 5 I F (LDATE . G E . 0) GO TO 200 DISPO = PBRED LDATE = LDATE + DAYR + 1 GO TO 200 70 DISPO = PBRED LDATE = HRDCOW(9,I) - GEST + 0 . 5 GO TO 200 80 DO 90 J = 1 , 4 90 F C B V ( J ) = F C B V ( J ) + HRDCOW(J + 1 4 , 1 ) DISPO = PFERT NFCUL = NFCUL + 1 LDATE = D F I N ( I ) + 0 . 5 GO TO 220 100 DO 110 J = 1, 4 110 C L C B V ( J ) = C L C B V ( J ) + HRDCOW(j + 14,1) DISPO = PLACT NLCUL = NLCUL + 1 LDATE = D F I N ( I ) + 0 . 5 GO TO 220 120 DO 130 J = 1, 4 130 E P C B V ( J ) = E P C B V ( J ) + HRDCOW(j + 14,1) DISPO = PEPA NPCUL = NPCUL + 1 LDATE = D F I N ( I ) + 0 . 5 GO TO 220 PROGRAM LISTINGS 186 140 DO 150 J = 1, 4 150 E T C B V ( J ) = E T C B V ( J ) + HRDCOW(j + 14,1) DISPO = PETA NTCUL = NTCUL + 1 LDATE = D F I N ( I ) + 0 . 5 GO TO 220 160 DO 170 J = 1, 4 170 HCBV(J) = H C B V ( J ) + HRDCOW(J + 1 4 , 1 ) DISPO = PPROB NHCUL = NHCUL + 1 LDATE = D F I N ( I ) + 0 . 5 GO TO 220 180 DO 190 J = 1, 4 190 D C B V ( J ) = D C B V ( J ) + HRDCOW(J + 14,1) DISPO = PDEAD NDCW = NDCW + 1 LDATE = D F I N ( I ) + 0 . 5 GO TO 220 200 NCOW = NCOW + 1 DO 210 J = 1, 10 HRDCOW(J,NCOW) = HRDCOW(J ,I) HRDCOW(j + 10,NCOW) = HRDCOW(J + 10,1) HRDCOW(J + 20,NCOW) = HRDCOW(J + 20,1) 210 HRDCOW(J + 30,NCOW) = HRDCOW(J + 30,1) 220 DAYO = DAYR IF ( I S T A T . G T . 3) DAYO = D F I N ( I ) FDCST = O Y R L A C ( 4 , I ) + D Y R L A C ( 4 , I ) + (DAYO - D S T O P ( I ) + D S T A R T ( I ) 1 - O S T O P ( I ) + O S T A R T ( I ) ) * DRYFD IF (AUTO) GO TO 360 REC = HRDCOW(6,I) IF ( D F I N ( I ) . E Q . DAYR .AND. D S T O P ( l ) . L T . 3 0 5 . ) GO TO 230 IF ( D S T O P ( I ) . L T . DPROJ) GO TO 230 LACO = REC - 1 LACD = REC GO TO 240 2 30 LACO = REC LACD = REC + 1 240 IF (REC . L T . 1.0) GO TO 320 DO 250 J = 1, 3 MBCA(J) = (HRDCOW(j + 2 2 , 1 )/ R E C / A V G ( J ) ) * 100. + I A J B C A ( j ) + 1 1 0 0 . 5 I B C A ( J ) = ( O L D L A C ( J , I ) / A V G ( J ) ) * 100. + I A J B C A ( J ) + 0 . 5 250 N B C A ( J ) = (HRDCOW(J + 1 8 , 1 )/ A V G ( J ) ) * 100. + I A J B C A ( J ) + 0 . 5 260 I F ( O F I N ( I ) . L E . 0 . 0 ) GO TO 290 LSTR = O L D A T ( I ) + 0 . 5 LYR = IYR 270 IF (LSTR . G E . 0) GO TO 280 LSTR = LSTR + DAYR - 1. LYR = LYR - 1 GO TO 270 280 LDAY = O S T O P ( I ) - O S T A R T ( I ) + 0 . 5 290 NSTR = HRDCOW(8,I) + 0 . 5 NYR = IYR 300 I F (NSTR . G E . 0) GO TO 310 NSTR = NSTR + DAYR - 1. NYR = NYR - 1 GO TO 300 310 NDAY = D S T O P ( I ) - D S T A R T ( I ) + 0 . 5 GO TO 350 320 DO 330 J = 1, 3 330 MBCA(J) = 0 . 0 IF ( D F I N ( I ) . L E . 0 . 0 ) GO TO 350 PROGRAM LISTINGS 187 DO 340 J = 1 , 3 N B C A ( J ) = (HRDCOW(J + 1 8 , 1 ) / A V G ( J ) ) * 100. + I A J B C A ( J ) + 0 . 5 340 CONTINUE GO TO 290 350 CALL WRTLIN(HRDCOW(1 , I ) , A G E ( I ) , D I S P O , L D A T E , L S T R , LYR, LDAY, 1 O Y R L A C ( 1 , 1 ) , FDCST , REC , MBCA, E P A ( 1 , 1 ) , S C O R E ( 2 , l ) , 2 E T A ( 1 , I ) , S C O R E ( 3 , I ) , I B C A , O A P R D ( l , I ) , NSTR, NYR, NDAY, 3 D Y R L A C ( 1 , I ) , NBCA, D A P R D ( 1 , I ) , O S T O P ( I ) , D S T O P ( I ) , O F I N ( I ) , 4 D F I N ( I ) , O S T A R T ( I ) , D S T A R T ( I ) , LACO, LACD, HRDCOW(22 , 1 ) , 5 DAYR, DPROJ , L I N E , 3, 4) I F ( L I N E . L T . 58) GO TO 360 CALL T I T L E L I N E = 7 360 CONTINUE 370 FORMAT ('PROBLEMS WITH COW*, F 5 . 0 , ' S T A T U S ' ) RETURN END SUBROUTINE SUMOUT(QUOTA, PQMLK, E X C E S , PEXMLK, PFAT , CRFAT , PPROT, 1 CRPROT, PCOWP, PCOWF, PCOWH, PCOWD, PYLG, PCFO, PCFH , 2 P C F B , PYSR, C F I X , CTRNP, NYSR, AVG, I A J B C A , AUTO, 3 AUTFUL) Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * C * T h i s s u b r o u t i n e a c c u m u l a t e s y e a r s s u m m a r i e s f o r t h e h e r d * C ******************************************************************** COMMON /CFBV/ B V L C F ( 4 ) , B V Y S P ( 4 ) , B V S H C F ( 4 ) , B V S B C F ( 4 ) , B V D C F ( 4 ) , 1 NLCF , NYSP, NSHCF, NSBCF, NDCF, TCFDC /COWBV/ T H B V ( 4 ) , 2 T C B V ( 4 ) , F C B V ( 4 ) , C L C B V ( 4 ) , E P C B V ( 4 ) , E T C B V ( 4 ) , H C B V ( 4 ) , D C B V ( 4 ) , 3 NBHF, NLCW, NFCUL, NLCUL, NPCUL, NTCUL, NHCUL, NDCW DIMENSION T R P R D ( 3 ) , RPRD<3), A R P R D ( 3 ) , P B C A ( 4 ) , B C A ( 4 ) , A B C A ( 4 ) , 1 T A C P R D ( 3 ) , A C R P R D ( 3 ) , A C B C A ( 4 ) , I A J B C A U ) , TAPRD (4) , 2 A V G ( 4 ) , S I N D E X ( 4 ) , BVLYL (4) , B V S Y L U ) , B V D Y L U ) REAL *4 B V P S ( 4 ) , P P S ( 4 ) , B V U S ( 4 ) , P U S ( 4 ) , B V Y S ( 4 ) , P Y S ( 4 ) LOGICAL*1 AUTO, AUTFUL RETURN ENTRY S U M H R D ( T R P R D , P B C A , T A G E , T D P , N R L A C , T A C P R D , A C B C A , A C A G E , A C D P , 1 NACLAC ,TAPRD,SINDEX,NYCUL ,NCOW, IHRD, IYR) HLMLK = TAPRD(1) / 103 .2 IF (HLMLK . L E . 0 . ) RETURN FATT = TAPRD(2) / HLMLK PROTT = TAPRD(3) / HLMLK PEFAT = (FATT - CRFAT) * PFAT PEPROT = (PROTT - CRPROT) * PPROT PRICEQ = PQMLK + PEFAT + PEPROT PRICEX = PEXMLK + PEFAT + PEPROT TEXM = 0 . 0 TSM = 0 . 0 EXINC = 0 . 0 TQM = HLMLK I F (TQM . L E . QUOTA) GO TO 20 TQM = QUOTA TEXM = HLMLK - QUOTA I F (TEXM . L E . EXCES) GO TO 10 TSM = TEXM - EXCES TEXM = EXCES 10 EXINC = PRICEX * TEXM 20 QINC = PRICEQ * TQM NPRCUL = NLCUL + NPCUL + NTCUL PROGRAM LISTINGS 188 CSHIP = CTRNP * HLMLK SYCUL = NYCUL * PYLG SPCUL = NPRCUL * PCOWP SFCUL = NFCUL * PCOWF SHCUL = NHCUL * PCOWH SDCUL = NDCW * PCOWD CALL YNGOUT(NYLG, NOCFS, NYLD, B V L Y L , BVSYL , BVDYL, TYFDC) SOCF = NOCFS * PCFO SBCF = (NSBCF + NYSP) * PCFB SHCF = NSHCF * PCFH SYSR = NYSR * PYSR CALL SUMATE(CONC, S V C F , C I N T , SEMC, BVPS, PPS , BVUS, PUS, BVYS, 1 PYS , IHRD, IYR) 23 T L C F = NLCF + 1 . E - 6 TYSP = NYSP + 1 . E - 6 TSHCF = NSHCF + 1 . E - 6 TSBCF = NSBCF + 1 . E - 6 TDCF = NDCF + 1 . E - 6 T L Y L = NYLG + 1 . E - 6 TSYL = NOCFS + 1.: E-6 TDYL = NYLD + 1 . E - 6 TBHF = NBHF + 1 . E - 6 TLCW = NLCW + 1 . E - 6 TFCUL = NFCUL + 1 • E -6 TLCUL = NLCUL + 1 . E - 6 TPCUL = NPCUL + 1 • E -6 TTCUL = NTCUL + 1 . E - 6 THCUL = NHCUL + 1 • E -6 TDCW = NDCW + 1 . E - 6 DO 23 1 = 1 , 4 B V L C F ( I ) = B V L C F ( I ) / B V Y S P ( I ) = B V Y S P ( I ) / B V S H C F ( I ) = B V S H C F ( I ) B V S B C F ( I ) = B V S B C F ( I ) B V D C F ( I ) B V L Y L ( I ) B V S Y L ( I ) B V D Y L ( I ) T H B V ( I ) T C B V ( I ) F C B V d ) C L C B V ( I ) E P C B V ( I ) E T C B V d ) H C B V d ) D C B V d ) CONTINUE DO 26 I = 1, B V L C F ( I ) = B V Y S P ( I ) = B V S H C F ( I ) BVSBCF(I ) BVDCF(I ) B V L Y L ( I ) B V S Y L ( I ) B V D Y L ( I ) T H B V ( I ) = T C B V ( I ) = F C B V ( I ) = C L C B V d ) E P C B V d ) E T C B V d ) B V D C F ( I ) B V L Y L ( I ) B V S Y L ( I ) B V D Y L ( I ) T H B V ( I ) / T C B V ( I ) / F C B V d ) / C L C B V d ) E P C B V d ) E T C B V d ) H C B V ( I ) / D C B V ( I ) / TLCF TYSP / TSHCF / TSBCF TDCF T L Y L TSYL TDYL TBHF TLCW TFCUL / TLCUL / TPCUL / TTCUL THCUL TDCW B V L C F ( I ) / B V Y S P ( I ) / = B V S H C F ( I ) = B V S B C F ( I ) B V D C F ( I ) B V L Y L ( I ) B V S Y L ( I ) B V D Y L ( I ) T H B V ( I ) / T C B V ( I ) / F C B V ( I ) / C L C B V d ) E P C B V d ) E T C B V d ) A V G ( I ) * A V G ( I ) * / A V G ( I ) / A V G ( I ) A V G ( I ) A V G ( I ) A V G ( I ) A V G ( I ) A V G ( I ) * A V G ( I ) * A V G ( I ) * / A V G ( I ) / A V G ( I ) / A V G ( I ) 100 . + I A J B C A ( I ) 100 . + I A J B C A ( I ) * 100 . + I A J B C A ( I ) * 100 . + I A J B C A ( I ) * 100 . + I A J B C A ( I ) * 100 . + I A J B C A ( I ) * 100 . + I A J B C A ( I ) * 100 . + I A J B C A ( I ) 100. + I A J B C A ( I ) 100. + I A J B C A ( I ) 100. + I A J B C A ( I ) * 100 . + I A J B C A ( I ) * 100 . + I A J B C A ( I ) * 100 . + I A J B C A ( I ) P R O G R A M L I S T I N G S 1 8 9 H C B V ( I ) = H C B V ( I ) / A V G ( I ) * 100. + I A J B C A ( I ) D C B V ( I ) = D C B V ( I ) / A V G ( I ) * 100. + I A J B C A ( I ) B V P S ( I ) = B V P S ( I ) / A V G ( I ) * 100. + I A J B C A ( I ) B V U S ( I ) = B V U S ( I ) / A V G ( I ) * 100. + I A J B C A ( I ) B V Y S ( I ) = B V Y S ( I ) / A V G ( I ) * 100. + I A J B C A ( I ) 26 CONTINUE TEXP = C F I X + T A P R D U ) + TYFDC + TCFDC + SEMC + CSHIP TINC = QINC + EXINC + SPCUL + SFCUL + SHCUL + SDCUL + SYCUL + 1SOCF + SBCF + SHCF + SYSR PROFIT = TINC - TEXP I F (NRLAC . L T . 1 .OR. NACLAC . L T . 1) GO TO 40 DO 30 J = 1, 3 B C A ( J ) = P B C A ( J ) / NRLAC / A V G ( J ) * 100. + I A J B C A ( J ) A B C A ( J ) = A C B C A ( J ) / NACLAC / A V G ( J ) * 100. + I A J B C A ( J ) RPRD(J) = TRPRD(J) / NRLAC 30 ACRPRD(J) = TACPRD(J) / NACLAC BCA(4) = PBCA(4) / NRLAC A B C A ( 4 ) = A C B C A U ) / NACLAC PAFAT = 100. * ACRPRD(2) / A C R P R D ( l ) PAPROT = 100. * ACRPRD(3) / ACRPRD(I) ACVAGE = ACAGE / NACLAC ACADP = ACDP / NACLAC PFAT = 100. * RPRD(2) / RPRD(1) PPROT = 100 . * RPRD(3) / RPRD(1) AAGE = TAGE / NRLAC ADP = TDP / NRLAC GO TO 60 40 NRLAC = 0 NACLAC = 0 AAGE = 0 . ACVAGE = 0 . PFAT = 0 . PPROT = 0 . PAFAT = 0 . PAPROT = 0 . ADP = 0 . ACADP = 0 . DO 50 J = 1, 3 RPRD(J) = 0 . ACRPRD(J) = 0 . B C A ( J ) = 0 . A B C A ( J ) = 0 . 50 CONTINUE BCA(4) = 0 . A B C A ( 4 ) = 0 . 60 I F (AUTFUL) GO TO 80 I F (AUTO) GO TO 80 WRITE ( 1 0 , 1 7 0 ) NRLAC, RPRD, NACLAC, ACRPRD, AAGE, ADP, P F A T , 1PPROT, ACVAGE, ACADP, PAFAT , PAPROT, BCA, ABCA WRITE ( 1 0 , 1 8 0 ) C I N T , CONC, NLCW, NBHF, NYLG, NLCF WRITE ( 1 0 , 1 9 0 ) HLMLK, F A T T , PROTT, C F I X , TQM, PRICEQ, QINC, TEXM, 1PRICEX, E X I N C , T A P R D ( 4 ) , TSM WRITE ( 1 0 , 2 0 0 ) TYFDC , TCFDC , NPRCUL, SPCUL , SEMC, NFCUL , SFCUL , 1CSHIP, NHCUL, SHCUL, NDCW, SDCUL, T E X P , NYCUL, SYCUL , NOCFS, 2SOCF, NSBCF , S B C F , NSHCF, SHCF, NYSR, SYSR, T I N C , PROFIT 70 WRITE ( 6 , 1 0 0 ) WRITE ( 6 , 9 0 ) NRLAC, RPRD, AAGE , ADP, P F A T , PPROT, BCA WRITE ( 6 , 1 1 0 ) WRITE ( 6 , 9 0 ) NACLAC, ACRPRD, ACVAGE, ACADP, PAFAT , PAPROT, ABCA WRITE ( 6 , 1 2 0 ) C I N T , CONC WRITE ( 6 , 1 3 0 ) NLCW, NBHF, NYLG, NLCF WRITE ( 6 , 1 4 0 ) C F I X , T A P R D ( 4 ) , TYFDC , T C F D C , SEMC, C S H I P , TEXP PROGRAM LISTINGS 190 WRITE ( 6 , 1 5 0 ) HLMLK, F A T T , PROTT, TQM, PRICEQ, QINC, TEXM, P R I C E X , 1EXINC, TSM WRITE ( 6 , 1 6 0 ) NPRCUL, SPCUL , NFCUL , SFCUL , NHCUL, SHCUL, NDCW, 1SDCUL, NYCUL, SYCUL, NOCFS, SOCF, NSBCF, S B C F , NSHCF, SHCF, NYSR, 2SYSR, T I N C , PROFIT 80 NHYL = (IHRD - 1) * 100 + IYR WRITE ( 6 , 9 9 ) NACLAC, C I N T , CONC, SVCF , NLCW, NBHF, HLMLK, 1 NPRCUL, NFCUL 99 FORMAT( ' NO. LAC CF INT CONC SV/CF NLCW NBHF 1 'HL MLK NPRCUL N F C U L ' , /, 18, F 8 . 1 , 2 F 8 . 3 , 2 1 8 , F 8 . 0 , 218) WRITE (15*NHYL) IHRD, IYR, NRLAC, RPRD, BCA, A A G E , ADP, PFAT , 1 PPROT, NACLAC, ACRPRD, ABCA, ACVAGE, ACADP, PAFAT , PAPROT, 2 C I N T , CONC, HLMLK, F A T T , PROTT, TQM, PRICEQ, QINC , 3 TEXM, P R I C E X , E X I N C , TSM, C F I X , T A P R D ( 4 ) , T Y F D C , TCFDC , 4 SEMC, C S H I P , T E X P , SPCUL, SFCUL , SHCUL, SDCUL, SYCUL, 5 SOCF, SHCF, S B C F , SYSR, T I N C , PROFIT , NLCW, TCBV, NBHF, 6 THBV, NFCUL, FCBV , NLCUL, CLCBV, NPCUL, EPCBV, NTCUL, 7 ETCBV, NHCUL, HCBV, NDCW, DCBV, NYLG, B V L Y L , NOCFS, 8 BVSYL , NYLD, BVDYL, N L C F , B V L C F , NSHCF, BVSHCF, NSBCF , 9 BVSBCF, NDCF, BVDCF, NYSP, BVYSP, BVPS, P P S , BVUS, * PUS, BVYS, PYS , SINDEX 90 FORMAT (16X, 'ROLLING HERD A V E R A G E S ' , //, 6X, 14, F 1 0 . 0 , 2 F 1 0 . 1 , / 1 / , 12X, 'AGE DAYS MILK % FAT % P R O T E I N ' , //, 6X, 2 2 F 1 0 . 1 , 2 F 1 0 . 2 , //, 20X, ' B C A ' , //, 6X, 4 F 1 0 . 0 ) 100 FORMAT (//, 20X, 'BEFORE C U L L I N G ' ) 110 FORMAT (//, 20X, 'AFTER C U L L I N G ' ) 120 FORMAT (//, 8X, ' CALVING I N T E R V A L ' , F 6 . 1 , / , 8X, 1 'CONCEPTION RATE ' , F 6 . 3 ) 130 FORMAT (//, 12X, ' L I V E ANIMALS AT YEAR E N D ' , //, 3X, 14, ' COWS' , 1 16, ' BRED H E I F E R S ' , 16, ' Y E A R L I N G S ' , 16, ' C A L V E S : ) 140 FORMAT (//, 22X, 'ECONOMIC SUMMARY', //, 25X, ' E X P E N D I T U R E S ' , / , 1 8X, ' F I X E D C O S T S ' , F 1 9 . 2 , /, 8X , ' F E E D C O S T S ' , / , 16X, 2 'COWS' , F 1 8 . 2 , / , 11X, ' Y E A R L I N G S ' , F 1 8 . 2 , / , 14X, 3 ' C A L V E S ' , F 1 8 . 2 , / , 8X, 'SEMEN C O S T S ' , F 1 9 . 2 , / , 6X, 4 'MILK SHIPPING C H A R G E S ' , F 1 1 . 2 , //, 5X, 5 'TOTAL E X P E N D I T U R E S ' , F 1 9 . 2 ) 150 FORMAT (///, 26X, ' I N C O M E ' , //, 2X, F 8 . 2 , ' HECTOLITRES OF M I L K ' , 1 F 8 . 2 , ' FAT T E S T ' , F 8 . 2 , ' PROTEIN T E S T ' , //, 8X, F 8 . 2 , 2 ' HL QUOTA MILK A T ' , F 6 . 2 , ' / H L ' , F 1 8 . 2 , / , 8X, F 8 . 2 , 3 ' HL EXCESS MILK A T ' , F 6 . 2 , ' / H L ' , F 1 8 . 2 , /, 8X, F 8 . 2 , 4 ' HL SURPLUS MILK AT . 0 0 0 / H L ' , 14X, ' 0 . 0 0 ' ) 160 FORMAT (/, 6X, 'SOLD A N I M A L S ' , / , 12X, 14, ' COWS (PRODUCTION) ' , 1 F 2 7 . 2 , / , 12X, 14, ' COWS ( F E R T I L I T Y ) ' , F 2 8 . 2 , / , 12X, 14, 2 ' COWS ( H E A L T H ) ' , F 3 1 . 2 , / , 12X, 14, ' COWS D E A D ' , 3 F 3 3 . 2 , / , 12X, 14, ' Y E A R L I N G S ' , F 3 0 . 2 , / , 12X, 14, 4 ' OLD C A L V E S ' , F 3 1 . 2 , /, 12X, 14, ' BULL C A L V E S ' , 5 F 3 1 . 2 , / , 12X, 14, ' HEIFER C A L V E S ' , F 3 0 . 2 , / , 12X, 14, 6 ' SELECTED YOUNG S I R E S ' , F 2 4 . 2 , / , 10X, ' TOTAL INCOME' , 7 11X, F 3 0 . 2 , / , / , 10X, ' TOTAL P R O F I T ' , 11X, F 3 0 . 2 ) 170 FORMAT ( ' ; ' , //, 50X, 'ROLLING HERD A V E R A G E S ' , / , ' + ' , 49X, 1 2 1 ( ' _ ' ) , //, 30X, 'BEFORE C U L L I N G ' , 40X, 'AFTER C U L L I N G ' , / 2 / , 14X, ' N O . R E C , 3X, ' M I L K ' , 6X, ' F A T ' , 5X, ' P R O T E I N ' , 3 24X, 'NO . R E C , 3X, ' M I L K ' , 6X, ' F A T ' , 5X, ' P R O T E I N ' , / , 4 16X, 14, F 1 0 . 0 , 2 F 1 0 . 1 , 26X, 14, F 1 0 . 0 , 2 F 1 0 . 1 , // , 22X, 5 'AGE DAYS MILK % FAT % P R O T E I N ' , 32X, 6 'AGE DAYS MILK % FAT % P R O T E I N ' , // , 16X, 2 F 1 0 . 1 , 7 2 F 1 0 . 2 , 26X, 2 F 1 0 . 1 , 2 F 1 0 . 2 , // , 35X, ' B C A ' , 1IX , ' T Y P E ' , 8 35X, ' B C A ' , 16X, ' T Y P E ' , //, 16X, 4 F 1 0 . 0 , 16X, 4 F 1 0 . 0 ) 180 FORMAT (// , 18X, 'CALVING I N T E R V A L ' , F 7 . 1 , 20X, 'CONCEPTION R A T E ' , 1 F 7 . 3 , //, 42X , ' L I V E ANIMALS AT ' , 'YEAR END*, // , 20X, 14, 1 2 ' COWS' , 1 1 0 , ' BRED H E I F E R S ' , 110 , ' Y E A R L I N G S ' , 1 1 0 , 3 ' C A L V E S ' ) 190 FORMAT (//, 50X, 'ECONOMIC SUMMARY', /, ' + ' , 49X, 1 6 ( ' _ ' ) , //, 1 30X, F 8 . 2 , ' HECTOLITRES OF M I L K ' , F 8 . 2 , ' FAT T E S T ' , 2 F 8 . 2 , ' PROTEIN T E S T ' , //, 15X, ' E X P E N D I T U R E S ' , 55X, 3 ' I N C O M E ' , //, 8X, ' F I X E D C O S T S ' , F 1 9 . 2 , 25X, F 9 . 2 , 4 ' HL QUOTA MILK A T ' , F 6 . 2 , ' / H L ' , F 1 8 . 2 , / , 8X , 5 ' F E E D C O S T S ' , 46X, F 8 . 2 , ' HL EXCESS MILK A T ' , F 6 . 2 , ' H L ' , 6 F 1 8 . 2 , /, 10X, ' - COWS', F 1 8 . 2 , 25X, F 9 . 2 , 7 'HL SURPLUS MILK AT . 0 0 0 / H L ' , 14X, ' 0 . 0 0 ' ) 200 FORMAT (10X, ' - Y E A R L I N G S ' , F 1 8 . 2 , 28X, 'SOLD A N I M A L S ' , / , 10X, 1 ' - C A L V E S ' , F 1 8 . 2 , 28X, 14, ' COWS ( P R O D U C T I O N ) ' , F 2 7 . 2 , 2 / , 8X , 'SEMEN C O S T S ' , F 1 9 . 2 , 28X, 14, ' COWS ( F E R T I L I T Y ) ' , 3 F 2 8 . 2 , /, 6X, 'MILK SHIPPING C O S T ' , F 1 4 . 2 , 28X, 14, 4 ' COWS ( H E A L T H ) ' , F 3 1 . 2 , /, 66X, 14, ' COWS D E A D ' , 5 F 3 3 . 2 , /, 5X, ' TOTAL E X P E N D I T U R E S ' , F 1 5 . 2 , 28X, 14, 7X, 6 ' Y E A R L I N G S ' , F 3 0 . 2 , /, 66X, 14, ' OLD C A L V E S ' , F 3 1 . 2 , / 7 , 66X, 14, ' BULL C A L V E S ' , F 3 1 . 2 , /, 66X , 14, 8 ' HEIFER C A L V E S ' , F 3 0 . 2 , /, 66X, 14, 9 ' SELECTED YOUNG S I R E S ' , F 2 4 . 2 , /, 64X, ' TOTAL INCOME' , * 10X, F 3 0 . 2 , //, 15X, ' TOTAL P R O F I T ' , F 2 8 . 2 ) RETURN END SUBROUTINE WRTLIN(PED, AGE , D I S P O , LDAT, LSTR , LYR, LDAY, OLAC, 1 FDCST , REC, MBCA, E P A , SEPA , E T A , SETA , I B C A , OAPRD, 2 NSTR, NYR, NDAY, DLAC , NBCA, DAPRD, OSTOP, DSTOP, O F I N , 3 D F I N , OSTART, DSTART, LACO, LACD, T Y P E , DAYR, DPROJ, 4 L I N E , M, N) ****************************************** * T h i s s u b r o u t i n e w r i t e s a cows r e c o r d t o t h e p r i n t e r * ******************************************************************** DIMENSION I P E D ( 3 ) , P E D ( M ) , S T A T ( 2 ) , O L A C ( M ) , M B C A ( 3 ) , E P A ( N ) , 1 E T A ( N ) , I B C A ( 3 ) , OAPRD(M), N B C A ( 3 ) , DAPRD(M) , D L A C ( M ) , 2 P R J 3 0 5 ( 5 ) INTEGER*4 PRJ305 / ' P R O J ' , ' E C T E ' , 'D TO ' 305 ' D A Y ' / I P E D ( 1 ) = PED(1) I P E D ( 2 ) = PED(2) I P E D ( 3 ) = PED(3) IAGE = AGE I T Y P E = TYPE IREC = REC IOST = OSTOP + 0 . 5 IDST = DSTOP + 0 . 5 WRITE ( 1 0 , 5 0 ) I P E D , I A G E , 1 E P A , SEPA, E T A , SETA D I S P O , LDAT, FDCST , I T Y P E , I R E C , MBCA, L I N E = L I N E + I F (OFIN . L E . WRITE ( 1 0 , 6 0 ) L I N E = L I N E + 10 I F (DSTOP . L T , I F (LACD . G T . I F (DFIN . E Q . WRITE ( 1 0 , 6 0 ) L I N E = L I N E + RETURN 20 WRITE ( 1 0 , 7 0 ) 1 0 . 0 ) GO TO 10 LACO, LSTR , LYR, 1 DPROJ) GO TO 40 IREC) GO TO 20 GO TO 30 NSTR, NYR, DAYR) LACD, 1 LDAY, OLAC, IOST , OAPRD, IBCA NDAY, DLAC, I D S T , DAPRD, NBCA LACD, NSTR, NYR, NDAY, DLAC, P R J 3 0 5 , DAPRD, NBCA PROGRAM LISTINGS 192 L I N E = L I N E + 1 RETURN 30 WRITE ( 1 0 , 8 0 ) LACD, NSTR, NYR, NDAY, DLAC, I D S T , DAPRD, NBCA L I N E = L I N E + 1 RETURN 40 IF (DFIN . L E . 0 . 0 .OR. DSTOP . L E . 0 . ) RETURN WRITE ( 1 0 , 7 0 ) LACD, NSTR, NYR, NDAY, DLAC L I N E = L I N E + 1 RETURN 50 FORMAT (1X , 14 , 2 1 5 , 1 3 , 1X, A 4 , 1 4 , 29X, F 6 . 0 , 2 1 3 , IX , 3 1 4 , 1X, 1 5 F 5 . 1 , 1X, 5 F 5 . 1 ) 60 FORMAT (10X , ' LACTATION # ' , 1 3 , 1 7 , ' / ' , 12 , 14 , F 7 . 0 , 2 F 6 . 1 , 1 ' COMPLETE RECORD' , 14 , ' DAYS MILKED ' , F 7 . 0 , 2 F 6 . 1 , 3X, 2 314) 70 FORMAT (10X, ' LACTATION # ' , 1 3 , 1 7 , ' / ' , 12 , 14 , F 7 . 0 , 2 F 6 . 1 , 6X, 1 5A4, 9X, F 7 . 0 , 2 F 6 . 1 , 3X, 314) 80 FORMAT (10X , ' LACTATION # ' , 1 3 , 1 7 , ' / ' , 12 , 1 4 , F 7 . 0 , 2 F 6 . 1 , 9X, 1 'RECORD T O ' , 14 , ' D A Y S ' , 8X, F 7 . 0 , 2 F 6 . 0 , 3X, 314) END SUBROUTINE WRTYG(OUT, I COL, I ROW) Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * C * T h i s s u b r o u t i n e w r i t e s a y e a r l i n g o r c a l f r e c o r d t o t h e p r i n t e r * Q • * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * DIMENSION OUT(ICOL ,IROW) WRITE ( 1 0 , 1 0 ) OUT 10 FORMAT (2X , 4 F 7 . 0 , 5 F 6 . 1 , F 8 . 2 , 3X, A 4 , 3X, A4) RETURN ENTRY WRCUL(OUT,I C O L , I ROW) WRITE ( 6 , 2 0 ) OUT 20 FORMAT (1X , 8 F 7 . 0 , 2X, A4) RETURN END SUBROUTINE P R I N T L ( I N T A R Y , NO, I O T U , IFMT) Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * C * T h i s s u b r o u t i n e w r i t e s b u l l u s e i n f o r m a t i o n t o t h e p r i n t e r * Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * DIMENSION INTARY(NO) IF (IFMT . G T . 10) GO TO 10 WRITE ( I O T U , 2 0 ) INTARY RETURN 10 WRITE ( I O T U , 3 0 ) INTARY RETURN ENTRY PRTUNF (INTARY, NO, IOP) WRITE (IOP) INTARY 20 FORMAT (3X , 2016) 30 FORMAT ( 3 X , 2 0 ( 2 X , A 4 ) ) RETURN END PROGRAM LISTINGS 1 SUBROUTINE WRTMAT(WRMATR, I C O L , I ROW, INP) Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * C * T h i s s u b r o u t i n e w r i t e s two d i m e n s i o n a l m a t r i c i e s . * Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * DIMENSION WRMATR(ICOL,IROW) WRITE (INP) WRMATR RETURN END SUBROUTINE REAMAT(REMATR, I COL , I ROW, INP) Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * C * T h i s s u b r o u t i n e r e a d s two d i m e n s i o n a l m a t r i c i e s . * Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * DIMENSION REMATR( lCOL,IROW) READ (INP) REMATR 10 RETURN END SUBROUTINE REARRY(NUM, L I S T , CONT) Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * C * T h i s s u b r o u t i n e r e a d s and s o r t s an a r r a y . * Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * DIMENSION LI ST(NUM) LOGICAL*1 CONT, ERCHK / T / , F L / F / CONT = FL READ ( 5 , 1 0 , E R R = 3 0 ) L I S T 10 FORMAT (110) CALL I S O R T ( L I S T , 1, NUM, 1, NUM, 1, 1, 0) WRITE ( 6 , 2 0 ) L I S T 20 FORMAT (110) GO TO 40 30 CONT = ERCHK 40 RETURN END SUBROUTINE REARY2(NUM, LI ST 1, L I S T 2 , L I S T , CONT) C * T h i s s u b r o u t i n e r e a d s two a r r a y s , s o r t s t h e f i r s t and * C * p u t s t h e s e c o n d i n t h e same o r d e r . * Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * DIMENSION L I S T I ( N U M ) , L I S T 2 ( N U M ) , L I S T ( 2 , N U M ) , L B U L ( 2 0 ) LOGICAL*1 CONT, ERCHK / T / , F L / F / CONT = F L READ ( 5 , 1 0 , E R R = 6 0 ) L I S T 10 FORMAT (2110) CALL I S O R T ( L I S T , 2, NUM, 1, NUM, 1, 1, 0) DO 20 I = 1, NUM L I S T 1 ( I ) = L I S T ( 1 , 1 ) L I S T 2 ( I ) = L I S T ( 2 , I ) 20 CONTINUE GO TO 40 ENTRY W R A ( N U M , L I S T 1 , L I S T 2 , L I S T ) DO 30 I = 1, NUM PROGRAM LISTINGS L I S T ( 1 , 1 ) = LI ST 1 ( I ) 30 L I S T ( 2 , I ) = L I S T 2 U ) GO TO 40 ENTRY R E A N S R ( N U M , L I S T 1 , L I S T 2 , L I ST ,CONT) CONT = FL READ ( 5 , 1 0 , E R R = 6 0 ) L I S T 40 WRITE ( 6 , 5 0 ) L I S T 50 FORMAT (2110) GO TO 70 60 CONT = ERCHK 70 RETURN END FUNCTION RANDT(I SEED) c C THIS FUNCTION GENERATES UNIFORM ( 0 , 1 ) RANDOM NUMBERS C DOUBLE PRECISION Z, DN1MOD, DN1 DATA DN1 MOD / 2 1 4 7 4 8 3 6 4 7 . D O / , DN1 / Z 3 9 2 0 0 0 0 0 0 0 0 0 0 0 0 0 / Z = ISEED Z = DMOD ( 1 6807 . DO* Z , DN 1 MOD) RANDT = Z * DN1 ISEED = Z RETURN END FUNCTION RN(IX) C C THIS FUNCTION GENERATES PAIRS OF NORMAL ( 0 , 1 ) RANDOM D E V I A T E S , C USING A MODIFICATION OF THE BOX-MUELLER METHOD. C DATA 1 / 1 / IF (I . N E . 1) GO TO 30 1 = 2 10 U = 2. * RANDT(IX) - 1. V = 2. * RANDT(IX) - 1. W = U * U + V * V IF (W - 1.) 2 0 , 2 0 , 10 20 W = SQRT(-2 .*ALOG(W)/W) RN = U * W RETURN 30 I = 1 RETURN END SUBROUTINE DCSIG(SIGMA, U L , A , B) c C C C THIS SUBROUTINE DECOMPOSES THE SYMETRIC MATRIX OF VARIANCES- C COVARIANCES INTO ITS FACTOR (SQUARE ROOT) . DCSIG IS CALLED BY C MNDG FOR GENERATING MULTIVARIATE NORMAL D E V I A T E S . C PROGRAM LISTINGS 195 DIMENSION S I G M A O ) , U L ( 1 ) DATA ZERO, ONE, FOUR, S I X T N , SIXTH / O . O , 1 . , 4 . , 1 6 . , . 0 6 2 5 / A = ONE B = ZERO R1N = ONE / (4*SIXTN) IP = 1 DO 90 I = 1, 4 IQ = IP IR = 1 DO 80 J = 1, I X = SIGMA(IP) IF ( J . E Q . 1) GO TO 20 DO 10 L = I Q , IP1 X = X - U L ( L ) * U L ( I R ) IR = IR + 1 10 CONTINUE 20 IF (I . N E . J ) GO TO 60 A = A * X IF (SIGMA(IP) + X*R1N . L E . S I G M A ( I P ) ) GO TO 100 30 IF (ABS(A) . L E . ONE) GO TO 40 A = A * SIXTH B = B + FOUR GO TO 30 40 IF (ABS(A) . G E . SIXTH) GO TO 50 A = A * SIXTN B = B - FOUR GO TO 40 50 U L ( I P ) = ONE / SQRT(X) GO TO 70 60 U L ( I P ) = X * U L ( I R ) 70 IP1 = IP IP = IP + 1 IR = IR + 1 80 CONTINUE 90 CONTINUE GO TO 120 100 WRITE ( 6 , 1 1 0 ) 110 FORMAT (' TROUBLE ' ) 120 RETURN END SUBROUTINE MNDG(ISEED, SIGMA, RVEC, WKVEC) c C C THIS SUBROUTINE GENERATES SETS OF FOUR MULTIVARIATE NORMAL C D E V I A T E S , DISTRIBUTED WITH ZERO MEAN AND COVARIANCES MATRIX C SIGMA. TO PRODUCE GENETICALLY CORRELATED NORMAL D E V I A T E S , C GSIGMA IS ENTERED FOR SIGMA, FOR ENVIRONMENTALLY CORRELATED C NORMAL D E V I A T E S , ESIGMA IS ENTERED. C DIMENSION S I G M A d ) , R V E C ( 4 ) , WKVEC(4) CALL DCSIG(SIGMA, SIGMA, A , B) L = 0 DO 10 I = 1, 4 L = L + I 10 SIGMA(L) = 1.0 / SIGMA(L) GO TO 20 ENTRY MNDG1(I SEED,SIGMA,RVEC ,WKVEC) 20 DO 30 I = 1 , 4 PROGRAM LISTINGS DIMENSION S I G M A ( 1 ) , U L ( l ) DATA ZERO, ONE, FOUR, S I X T N , SIXTH / O . O , 1 . , 4 . , 1 6 . , . 0 6 2 5 / A = ONE B = ZERO R1N = ONE / ( 4 * S I X T N ) I P = 1 DO 90 I = 1, 4 IQ = IP IR = 1 DO 80 J = 1, I X = S I G M A ( I P ) I F ( J . E Q . 1) GO TO 20 DO 10 L = I Q , IP1 X = X - U L ( L ) * U L ( I R ) IR = IR + 1 10 CONTINUE 20' I F (I . N E . J ) GO TO 60 A = A * X I F ( S I G M A ( I P ) + X*R1N . L E . S I G M A ( I P ) ) GO TO 100 30 I F (ABS(A) . L E . ONE) GO TO 40 A = A * SIXTH B = B + FOUR GO TO 30 40 I F ( A B S ( A ) . G E . SIXTH) GO TO 50 A = A * SIXTN B = B - FOUR GO TO 40 50 U L ( I P ) = ONE / SQRT(X) GO TO 70 60 U L ( I P ) = X * U L ( I R ) 70 IP1 = IP I P = I P + 1 IR = IR + 1 80 CONTINUE 90 CONTINUE GO TO 120 100 WRITE ( 6 , 1 1 0 ) 110 FORMAT ( ' T R O U B L E ' ) 120 RETURN END SUBROUTINE MNDG(ISEED, SIGMA, RVEC , WKVEC) c C C M . L . MCGILLIARD a n d D. EDLUND, 1979 . M i m i o g r a p h . C C THIS SUBROUTINE GENERATES SETS OF FOUR MULTIVARIATE NORMAL C D E V I A T E S , DISTRIBUTED WITH ZERO MEAN AND COVARIANCES MATRIX C SIGMA. TO PRODUCE GENETICALLY CORRELATED NORMAL D E V I A T E S , C GSIGMA IS ENTERED FOR SIGMA, FOR ENVIRONMENTALLY CORRELATED C NORMAL D E V I A T E S , ESIGMA IS ENTERED. C DIMENSION S I G M A ( I ) , R V E C ( 4 ) , WKVEC(4) CALL DCSIG(SIGMA, SIGMA, A , B ) ' L = 0 DO 10 I = 1, 4 L = L + I 10 SIGMA(L) = 1 . 0 / SIGMA(L) GO TO 20 ENTRY MNDG1(I SEED ,SIGMA,RVEC ,WKVEC) 20 DO 30 I = 1 , 4 PROGRAM LISTINGS 196 30 WKVEC(I) = RN(I SEED) L = 1 DO 50 II = 1, 4 RVEC(11) = 0 . 0 DO 40 I = 1, I I R V E C ( I I ) = R V E C ( I I ) + D B L E ( W K V E C ( I ) ) * D B L E ( S I G M A ( L ) ) 40 L = L + 1 50 CONTINUE RETURN END 'MEAN BCA ' ' FEED TYP NO 1 OX, 10( SUBROUTINE T I T L E Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * C * T h i s s u b r o u t i n e t i t l e s t h e p r i n t e r o u t p u t * Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * WRITE ( 1 0 , 1 0 ) ENTRY F T I T L E WRITE ( 1 0 , 2 0 ) 10 FORMAT ( ' ; ' ) 20 FORMAT (/, 32X, 'CURRENT PRODUCTION' , 22X, 1 ' E P A ' , 22X, ' E T A ' , /, 28X, 2 8 ( ' - ' ) , 2 ' - ' ) , 5X, 17( ' - ' ) , 8X , 1 7 C - ' ) , / , 3 ' COW SIRE DAM AGE STAT DAY FRESH DAYS MILK FAT ' 4 ' PROT COST SC RC MLK FAT PRO MILK FAT PROT TYPE 5 '$IND MILK FAT PROT TYPE $ I N D ' , / ) RETURN ENTRY T I T L Y G WRITE ( 1 0 , 3 0 ) 30 FORMAT (// , 35X, ' Y E A R L I N G S ' , /, 45X, ' E T A ' , 14X, 1 ' H E I F E R SIRE DAM DATE MILK F A T ' , 2 ' PROT TYPE $INDEX COSTS S T A T U S ' ) RETURN ENTRY T I T L C F WRITE ( 1 0 , 4 0 ) 40 FORMAT (//, 37X, ' C A L V E S ' , / , 45X, ' E T A ' , 1 ' C A L F SIRE DAM DATE MILK 2 ' PROT TYPE $INDEX COSTS SEX RETURN END ' F E E D ' , /, 3X, 14X, ' F E E D ' , /, 5X, F A T ' , S T A T U S ' ) SUBROUTINE F I L E S ( I H R D ) C Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * C * * C * T h i s s u b r o u t i n e f i n d s t h e h e r d f i l e s * C * * Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * CALL FTNCMD( 'ASSIGN 4 = K I N N : A I . U ; ' ) CALL FTNCMD ( ' A S S I G N 7 = K I N N : C H E C K . R U N ; ' ) CALL FTNCMD( 'ASSIGN 1 3 = K I N N : D R E C ( L A S T + 1 ) ; ' ) CALL FTNCMD( 'ASSIGN 1 1 = K I N N : Y S I R E ( L A S T + 1 ) ; ' ) CALL FTNCMD( 'ASSIGN 1 4 = K I N N : B U S E ( L A S T + 1 ) ; ' ) CALL FTNCMD( 'ASSIGN 15=KINN:SUMS; ' ) I F (IHRD . G T . 100) GO TO 1010 GO TO ( 1 0 , 2 0 , 3 0 , 4 0 , 5 0 , 6 0 , 7 0 , 8 0 , 9 0 , 100, 110, 120, 130, 1140, 150, 160, 170 , 180, 190, 2 0 0 , 2 1 0 , 2 2 0 , 2 3 0 , 2 4 0 , 2 5 0 , 2 6 0 , 2 2 7 0 , 2 8 0 , 2 9 0 , 3 0 0 , 3 1 0 , 3 2 0 , 3 3 0 , 3 4 0 , 350 , 3 6 0 , 3 7 0 , 3 8 0 , 3 9 0 , PROGRAM LISTINGS 197 3 4 0 0 , 4 1 0 , 4 2 0 , 4 3 0 , 4 5 3 0 , 5 4 0 , 5 5 0 , 5 6 0 , 5 6 6 0 , 6 7 0 , 6 8 0 , 6 9 0 , 6 7 9 0 , 8 0 0 , 8 1 0 , 8 2 0 , 7 9 2 0 , 9 3 0 , 9 4 0 , 9 5 0 , GO TO 1060 10 CALL FTNCMD( 'ASSIGN CALL FTNCMD( 'ASSIGN CALL FTNCMD( 'ASSIGN RETURN 20 CALL FTNCMD( 'ASSIGN CALL FTNCMD( 'ASSIGN CALL FTNCMD( 'ASSIGN RETURN 30 CALL FTNCMD( 'ASSIGN CALL FTNCMD( 'ASSIGN CALL FTNCMD( 'ASSIGN RETURN 40 CALL FTNCMD( 'ASSIGN CALL FTNCMD( 'ASSIGN CALL FTNCMD( 'ASSIGN RETURN 50 CALL FTNCMD( 'ASSIGN CALL FTNCMD( 'ASSIGN CALL FTNCMD( 'ASSIGN RETURN 60 CALL FTNCMD( 'ASSIGN CALL FTNCMD( 'ASSIGN CALL FTNCMD( 'ASSIGN RETURN 70 CALL F T N C M D C A S S I G N CALL FTNCMD( 'ASSIGN CALL FTNCMD( 'ASSIGN RETURN 80 CALL FTNCMD( 'ASSIGN CALL FTNCMD( 'ASSIGN CALL FTNCMD( 'ASSIGN RETURN 90 CALL FTNCMD( 'ASSIGN CALL FTNCMD( 'ASSIGN CALL FTNCMD( 'ASSIGN RETURN 100 CALL FTNCMD( 'ASSIGN CALL FTNCMD( 'ASSIGN CALL FTNCMD( 'ASSIGN RETURN 110 CALL FTNCMD( 'ASSIGN CALL FTNCMD( 'ASSIGN CALL FTNCMD( 'ASSIGN RETURN 120 CALL FTNCMD( 'ASSIGN CALL FTNCMD( 'ASSIGN CALL FTNCMD( 'ASSIGN RETURN 130 CALL FTNCMD( 'ASSIGN CALL FTNCMD( 'ASSIGN CALL FTNCMD( 'AS SIGN RETURN 140 CALL FTNCMD( 'ASSIGN CALL FTNCMD( 'ASSIGN CALL FTNCMD( 'ASSIGN RETURN 4 4 0 , 4 5 0 , 4 6 0 , 4 7 0 , 4 8 0 , 4 9 0 , 500 , 5 1 0 , 5 2 0 , 570 , 5 8 0 , 5 9 0 , 6 0 0 , 6 1 0 , 6 2 0 , 6 3 0 , 6 4 0 , 6 5 0 , 7 0 0 , 7 1 0 , 7 2 0 , 7 3 0 , 7 4 0 , 7 5 0 , 7 6 0 , 7 7 0 , 7 8 0 , 8 3 0 , 8 4 0 , 8 5 0 , 8 6 0 , 8 7 0 , 8 8 0 , 8 9 0 , 9 0 0 , 9 1 0 , 9 6 0 , 9 7 0 , 9 8 0 , 9 9 0 , 1 0 0 0 ) , IHRD 2 = K I N N : H 1 I N ; ' ) 12=KINN:H10UT ; ' ) 1 0 = H 1 - 2 ( L A S T + 1 ) ; ' ) 2 = K I N N : H 2 I N ; ' ) 1 2 = K I N N : H 2 0 U T ; ' ) 1 0 = H 1 - 2 ( L A S T + 1 ) ; ' 2 = K I N N : H 3 I N ; ' ) 12=KINN:H30UT ; ' ) 1 0 = H 3 - 4 ( L A S T + 1 ) ; ' 2 = K I N N : H 4 I N ; ' ) 12=KINN:H40UT ; ' ) 1 0 = H 3 - 4 ( L A S T + 1 ) ; ' 2 = K I N N : H 5 I N ; ' ) 12=KINN:H50UT ; ' ) 1 0 = H 5 - 6 ( L A S T + 1 ) ; ' 2 = K I N N : H 6 I N ; ' ) 12=KINN:H60UT; ' ) 1 0 = H 5 - 6 ( L A S T + 1 ) ; ' 2 = K I N N : H 7 I N ; ' ) 1 2 = K I N N : H 7 0 U T ; ' ) 1 0 = H 7 - 8 ( L A S T + 1 ) ; ' 2 = K I N N : H 8 I N ; ' ) 12=KINN:H80UT ; ' ) 1 0 = H 7 - 8 ( L A S T + 1 ) ; ' 2 = K I N N : H 9 I N ; ' ) 12=KINN:H90UT; ' ) 10=H9-10(LAST+1) 2 = K I N N : H 1 O I N ; ' ) 12=KINN:H100UT; ' 10=H9-10(LAST+1) 2 = K I N N : H 1 1 1 N ; ' ) 12=KINN:H110UT; ' 10=H11-12(LAST+1 2 = K I N N : H 1 2 I N ; ' ) 12=KINN:H120UT; ' 10=H11-12(LAST+1 2 = K I N N : H 1 3 I N ; ' ) 12=KINN:H130UT; ' 10=H13-14(LAST+1 2 = K I N N : H 1 4 I N ; ' ) 12=KINN:H140UT; ' 10=H13-14(LAST+1 ' ) ; ' ) ; ' ) ; ' ) ; ' ) PROGRAM LISTINGS 1 9 8 150 CALL FTNCMD' CALL FTNCMD' CALL FTNCMD RETURN 160 CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN 170 CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN 180 CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN 190 CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN 200 CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN 210 CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN 220 CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN 230 CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN 240 CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN 250 CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN 260 CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN 270 CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN 280 CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN 290 CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN 300 CALL FTNCMD CALL FTNCMD 'ASSIGN 2 = K I N N : H 1 5 I N ; ' ) 'ASSIGN 1 2 = K I N N : H 1 5 0 U T ; ' ) 'ASSIGN 1 0 = H 1 5 - 1 6 ( L A S T + 1 ) ; ' ) 'ASSIGN 2 = K I N N : H 1 6 I N ; ' ) 'ASSIGN 1 2 = K I N N : H 1 6 0 U T ; ' ) 'ASSIGN 1 0 = H 1 5 - 1 6 ( L A S T + 1 ) ; ' ) 'ASSIGN 2=KINN:H17IN;*) 'ASSIGN 1 2 = K I N N : H 1 7 0 U T ; ' ) 'ASSIGN 1 0 = H 1 7 - 1 8 C L A S T + 1 ) ; ' ) 'ASSIGN 2 = K I N N : H 1 8 I N ; ' ) •ASSIGN 1 2 = K I N N : H 1 8 0 U T ; ' ) 'ASSIGN 1 0 = H 1 7 - 1 8 ( L A S T + 1 ) ; ' ) 'ASSIGN 2 = K I N N : H 1 9 I N ; ' ) 'ASSIGN 1 2 = K I N N : H 1 9 0 U T ; ' ) 'ASSIGN 1 0 = H 1 9 - 2 0 ( L A S T + 1 ) ; ' ) 'ASSIGN 2 = K I N N : H 2 0 I N ; ' ) 'ASSIGN 12=KINN:H20OUT; ' ) 'ASSIGN 1 0 = H 1 9 - 2 0 ( L A S T + 1 ) ; ' ) 'ASSIGN 2 = K I N N : H 2 1 I N ; ' ) 'ASSIGN 1 2 = K I N N : H 2 1 0 U T ; ' ) 'ASSIGN 1 0 = H 2 1 - 2 2 ( L A S T + 1 ) ; ' ) 'ASSIGN 2 = K I N N : H 2 2 I N ; ' ) 'ASSIGN 1 2 = K I N N : H 2 2 0 U T ; ' ) 'ASSIGN 1 0 = H 2 1 - 2 2 ( L A S T + 1 ) ; ' ) 'ASSIGN 2 = K I N N : H 2 3 I N ; ' ) 'ASSIGN 1 2 = K I N N : H 2 3 0 U T ; ' ) 'ASSIGN 1 0 = H 2 3 - 2 4 ( L A S T + 1 ) ; ' ) 'ASSIGN 2 = K I N N : H 2 4 I N ; ' ) 'ASSIGN 1 2 = K I N N : H 2 4 0 U T ; ' ) 'ASSIGN 1 0 = H 2 3 - 2 4 ( L A S T + 1 ) ; ' ) 'ASSIGN 2 = K I N N : H 2 5 I N ; ' ) 'ASSIGN 1 2 = K I N N : H 2 5 0 U T ; ' ) 'ASSIGN 1 0 = H 2 5 - 2 6 ( L A S T + 1 ) ; ' ) 'ASSIGN 2 = K I N N : H 2 6 I N ; ' ) 'ASSIGN 1 2 = K I N N : H 2 6 0 U T ; ' ) 'ASSIGN 1 0 = H 2 5 - 2 6 ( L A S T + 1 ) ; ' ) 'ASSIGN 2 = K I N N : H 2 7 I N ; ' ) 'ASSIGN 1 2 = K I N N : H 2 7 0 U T ; ' ) 'ASSIGN 1 0 = H 2 7 - 2 8 ( L A S T + 1 ) ; ' ) 'ASSIGN 2 = K I N N : H 2 8 I N ; ' ) 'ASSIGN 1 2 = K I N N : H 2 8 0 U T ; ' ) 'ASSIGN 1 0 = H 2 7 - 2 8 ( L A S T + 1 ) ; ' ) 'ASSIGN 2 = K I N N : H 2 9 I N ; ' ) •ASSIGN 12=KINN:H290UT ; ' ) 'ASSIGN 1 0 = H 2 9 - 3 0 ( L A S T + 1 ) ; ' ) 'ASSIGN 2 = K I N N : H 3 0 I N ; ' ) 'ASSIGN 12=KINN:H30OUT; ' ) PROGRAM LISTINGS 310 320 330 340 350 360 370 380 390 400 410 420 430 440 450 CALL FTNCMD( RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN 'ASSIGN 1 0 = H 2 9 - 3 0 ( L A S T + 1 ) ; ' ) ) ;') 'ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN 'ASSIGN 2=KINN:H311N;*) 12=KINN:H310UT; ' 10=H31-32(LAST+1 2 = K I N N : H 3 2 I N ; ' ) 12=KINN:H320UT; ' 10=H31-32(LAST+1 'ASSIGN 2 = K I N N : H 3 3 I N ; ' ) 'ASSIGN 12=KINN:H330UT; ' 'ASSIGN 10=H33-34(LAST+1 'ASSIGN 2 = K I N N : H 3 4 I N ; ' ) 'ASSIGN 12=KINN:H340UT; ' 'ASSIGN 10=H33-34(LAST+1 'ASSIGN 2 = K I N N : H 3 5 I N ; ' ) 'ASSIGN 12=KINN:H350UT; ' 'ASSIGN 10=H35-36(LAST+1 'ASSIGN 2 = K I N N : H 3 6 I N ; ' ) 'ASSIGN 12=KINN:H360UT; ' 'ASSIGN 10=H35-36(LAST+1 'ASSIGN 2 = K I N N : H 3 7 I N ; ' ) 'ASSIGN 12=KINN:H370UT; ' 'ASSIGN 10=H37-38(LAST+1 'ASSIGN 2 = K I N N : H 3 8 I N ; ' ) 'ASSIGN 12=KINN:H380UT; ' 'ASSIGN 10=H37-38(LAST+1 'ASSIGN 2 = K I N N : H 3 9 I N ; ' ) 'ASSIGN 12=KINN:H390UT; ' 'ASSIGN 10=H39-40(LAST+1 'ASSIGN 2 = K I N N : H 4 0 I N ; ' ) 'ASSIGN 12=KINN:H40OUT; ' 'ASSIGN 10=H39-40(LAST+1 'ASSIGN 2 = K I N N : H 4 1 I N ; ' ) 'ASSIGN 12=KINN:H410UT; ' 'ASSIGN 10=H41-42(LAST+1 'ASSIGN 2 = K I N N : H 4 2 I N ; ' ) 'ASSIGN 12=KINN:H420UT; ' 'ASSIGN 10=H41-42(LAST+1 'ASSIGN 2 = K I N N : H 4 3 I N ; ' ) 'ASSIGN 12=KINN:H430UT; ' •ASSIGN 10=H43-44(LAST+1 'ASSIGN 2 = K I N N : H 4 4 I N ; ' ) 'ASSIGN 12=KINN:H440UT; ' 'ASSIGN 10=H43-44(LAST+1 'ASSIGN 2 = K I N N : H 4 5 I N ; ' ) 'ASSIGN 12=KINN:H450UT; ' •ASSIGN 10=H45-46(LAST+1 ;') ; ' ) ?' ) ; ' ) ; ' ) ;') ) ; ' ) ;') ;') ; ' ) ;') ;•) PROGRAM LISTINGS 200 460 470 480 490 500 510 520 530 540 550 560 570 580 590 600 610 CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD 'ASSIGN 2 = K I N N : H 4 6 I N ; ' ) 'ASSIGN 12=KINN:H460UT; ' 'ASSIGN 1 0 = H 4 5 - 4 6 ( L A S T + 1 ) ; ' ) 'ASSIGN 2 = K I N N : H 4 7 I N ; ' ) 'ASSIGN 12=KINN:H470UT; 'ASSIGN 1 0 = H 4 7 - 4 8 ( L A S T + 1 ) ; ' ) 'ASSIGN 2 = K I N N : H 4 8 I N ; ' ) 'ASSIGN 12=KINN:H480UT; ' 'ASSIGN 10=H47-48(LAST+1 'ASSIGN 2 = K I N N : H 4 9 I N ; ' ) 'ASSIGN 12=KINN:H490UT; ' 'ASSIGN 1 0 = H 4 9 - 5 0 ( L A S T + 1 ) ; ' ) •ASSIGN 2 = K I N N : H 5 0 I N ; ' ) 'ASSIGN 12=KINN:H50OUT; 'ASSIGN 1 0 = H 4 9 - 5 0 ( L A S T + 1 ) ; ' ) 'ASSIGN 2 = K I N N : H 5 1 I N ; ' ) 'ASSIGN 12=KINN:H510UT; 'ASSIGN 1 0 = H 5 1 - 5 2 ( L A S T + 1 ) ; ' ) 'ASSIGN 2 = K I N N : H 5 2 I N ; ' ) •ASSIGN 12=KINN:H520UT; ' •ASSIGN 10=H51-52(LAST+1 'ASSIGN 2 = K I N N : H 5 3 I N ; ' ) 'ASSIGN 12=KINN:H530UT; ' 'ASSIGN 10=H53-54(LAST+1 'ASSIGN 2 = K I N N : H 5 4 I N ; ' ) 'ASSIGN 12=KINN:H540UT; ' 'ASSIGN 1 0 = H 5 3 - 5 4 ( L A S T + 1 ) ; ' ) 'ASSIGN 2 = K I N N : H 5 5 I N ; ' ) 'ASSIGN 12=KINN:H550UT; ' •ASSIGN 10=H55-56(LAST+1 'ASSIGN 2 = K I N N : H 5 6 I N ; ' ) 'ASSIGN 12=KINN:H560UT; ' •ASSIGN 1 0 = H 5 5 - 5 6 ( L A S T + 1 ) ; ' ) 'ASSIGN 2 = K I N N : H 5 7 I N ; ' ) 'ASSIGN 12=KINN:H570UT; ' 'ASSIGN 10=H57-58(LAST+1 'ASSIGN 2 = K I N N : H 5 8 I N ; ' ) •ASSIGN 12=KINN:H580UT; ' •ASSIGN 10=H57-58(LAST+1 'ASSIGN 2 = K I N N : H 5 9 I N ; ' ) 'ASSIGN 12=KINN:H590UT; ' 'ASSIGN 10=H59-60(LAST+1 'ASSIGN 2 = K I N N : H 6 0 I N ; ' ) 'ASSIGN 12=KINN:H60OUT; ' 'ASSIGN 10=H59-60(LAST+1 'ASSIGN 2 = K I N N : H 6 1 1 N ; ' ) 'ASSIGN 1 2 = K I N N : H 6 1 0 U T ; ' ) PROGRAM LISTINGS 20 CALL FTNCMD( RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN 'ASSIGN 10=H61-62(LAST+1) ; 'ASSIGN 2 = K I N N : H 6 2 I N ; ' ) 'ASSIGN 12=KINN:H620UT; ' 'ASSIGN 10=H61-62(LAST+1 'ASSIGN 2 = K I N N : H 6 3 I N ; ' ) • 'ASSIGN 12=KINN:H630UT; ' 'ASSIGN 10=H63-64(LAST+1 'ASSIGN 2 = K I N N : H 6 4 I N ; ' ) 'ASSIGN 12=KINN:H640UT; ' 'ASSIGN 10=H63-64(LAST+1 'ASSIGN 2 = K I N N : H 6 5 I N ; ' ) 'ASSIGN 12=KINN:H650UT; ' 'ASSIGN 10=H65-66(LAST+1 'ASSIGN 2 = K I N N : H 6 6 I N ; ' ) 'ASSIGN 12=KINN:H660UT; ' 'ASSIGN 10=H65-66(LAST+1 'ASSIGN 2 = K I N N : H 6 7 I N ; ' ) 'ASSIGN 12=KINN:H670UT; ' 'ASSIGN 10=H67-68(LAST+1 'ASSIGN 2 = K I N N : H 6 8 I N ; ' ) 'ASSIGN 12=KINN:H680UT; ' 'ASSIGN 10=H67-68(LAST+1 'ASSIGN 2 = K I N N : H 6 9 I N ; ' ) 'ASSIGN 12=KINN:H690UT; ' 'ASSIGN 10=H69-70(LAST+1 •ASSIGN 2 = K I N N : H 7 0 I N ; ' ) 'ASSIGN 12=KINN:H70OUT; ' 'ASSIGN 10=H69-70(LAST+1 'ASSIGN 2=KINN:H711N; ' ) 'ASSIGN 12=KINN:H710UT; ' 'ASSIGN 10=H71-72(LAST+1 'ASSIGN 2 = K I N N : H 7 2 I N ; ' ) 'ASSIGN 12=KINN:H720UT; ' 'ASSIGN 10=H71-72(LAST+1 'ASSIGN 2 = K I N N : H 7 3 I N ; ' ) 'ASSIGN 12=KINN:H730UT; ' •ASSIGN 10=H73-74(LAST+1 'ASSIGN 2 = K I N N : H 7 4 I N ; ' ) 'ASSIGN 12=KINN:H740UT; ' 'ASSIGN 10=H73-74(LAST+1 •ASSIGN 2 = K I N N : H 7 5 I N ; ' ) 'ASSIGN 12=KINN:H750UT; ' 'ASSIGN 10=H75-76(LAST+1 'ASSIGN 2=KINN:H76IN;*) 'ASSIGN 12=KINN:H760UT; ' 'ASSIGN 10=H75-76(LAST+1 PROGRAM LISTINGS 202 770 CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN 780 CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN 790 CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN 800 CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN 810 CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN 820 CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN 830 CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN 840 CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN 850 CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN 860 CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN 870 CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN 880 CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN 890 CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN 900 CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN 910 CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN 920 CALL FTNCMD CALL FTNCMD ASSIGN 2 = K I N N : H 7 7 I N ; ' ) ASSIGN 12=KINN:H770UT; ' ) ASSIGN 1 0 = H 7 7 - 7 8 ( L A S T + 1 ) ; ' ) ASSIGN 2 = K I N N : H 7 8 I N ; ' ) ASSIGN 12=KINN:H780UT; ' ) ASSIGN 1 0 = H 7 7 - 7 8 ( L A S T + 1 ) ; ' ) ASSIGN 2 = K I N N : H 7 9 I N ; ' ) ASSIGN 12=KINN:H790UT; ' ) ASSIGN 1 0 = H 7 9 - 8 0 ( L A S T + 1 ) ; ' ) ASSIGN 2 = K I N N : H 8 0 I N ; ' ) ASSIGN 12=KINN:H800UT; ' ) ASSIGN 1 0 = H 7 9 - 8 0 ( L A S T + 1 ) ; ' ) ASSIGN 2 = K I N N : H 8 1 1 N ; ' ) ASSIGN 12=KINN:H810UT; ' ) ASSIGN 1 0 = H 8 1 - 8 2 ( L A S T + 1 ) ; ' ) ASSIGN 2 = K I N N : H 8 2 I N ; ' ) ASSIGN 12=KINN:H820UT; ' ) ASSIGN 1 0 = H 8 1 - 8 2 ( L A S T + 1 ) ; ' ) ASSIGN 2 = K I N N : H 8 3 I N ; ' ) ASSIGN 12=KINN:H830UT; ' ) ASSIGN 1 0 = H 8 3 - 8 4 ( L A S T + 1 ) ; ' ) ASSIGN 2 = K I N N : H 8 4 I N ; ' ) ASSIGN 12=KINN:H840UT; ' ) ASSIGN 1 0 = H 8 3 - 8 4 ( L A S T + 1 ) ; ' ) ASSIGN 2 = K I N N : H 8 5 I N ; ' ) ASSIGN 1 2=KINN:H850UT;"') ASSIGN 1 0 = H 8 5 - 8 6 ( L A S T + 1 ) ; ' ) ASSIGN 2 = K I N N : H 8 6 I N ; ' ) ASSIGN 12=KINN:H860UT; ' ) ASSIGN 1 0 = H 8 5 - 8 6 ( L A S T + 1 ) ; ' ) ASSIGN 2 = K I N N : H 8 7 I N ; ' ) ASSIGN 12=KINN:H870UT; ' ) ASSIGN 1 0 = H 8 7 - 8 8 ( L A S T + 1 ) ; ' ) ASSIGN 2 = K I N N : H 8 8 I N ; ' ) ASSIGN 12=KINN:H880UT; ' ) ASSIGN 1 0 = H 8 7 - 8 8 ( L A S T + 1 ) ; ' ) ASSIGN 2 = K I N N : H 8 9 I N ; ' ) ASSIGN 12=KINN:H890UT ; ' ) ASSIGN 1 0 = H 8 9 - 9 0 ( L A S T + 1 ) ; ' ) ASSIGN 2 = K I N N : H 9 0 I N ; ' ) ASSIGN 12=KINN:H90OUT; ' ) ASSIGN 1 0 = H 8 9 - 9 0 ( L A S T + 1 ) ; ' ) ASSIGN 2 = K I N N : H 9 1 I N ; ' ) ASSIGN 12=KINN:H910UT ; ' ) ASSIGN 1 0 = H 9 1 - 9 2 ( L A S T + 1 ) ; ' ) ASSIGN 2 = K I N N : H 9 2 I N ; ' ) ASSIGN 12=KINN:H920UT; ' ) PROGRAM LISTINGS 203 930 940 950 960 970 980 990 1 000 1010 1020 1 030 1040 1 050 1060 1070 CALL FTNCMD( RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN I = IHRD / GO TO (1020 GO TO 1060 CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN CALL FTNCMD CALL FTNCMD CALL FTNCMD RETURN WRITE ( 6 , 1 0 7 FORMAT (' STOP END 'ASSIGN 1 0 = H 9 1 - 9 2 ( L A S T + 1 ) 'ASSIGN 2 = K I N N : H 9 3 I N ; ' ) •ASSIGN 12=KINN:H930UT; ' 'ASSIGN 10=H93-94(LAST+1 •ASSIGN 2 = K I N N : H 9 4 I N ; ' ) 'ASSIGN 12=KINN:H940UT; ' 'ASSIGN 10=H93-94(LAST+1 'ASSIGN 2 = K I N N : H 9 5 I N ; ' ) 'ASSIGN 12=KINN:H950UT; ' 'ASSIGN 10=H95-96(LAST+1 'ASSIGN 2 = K I N N : H 9 6 I N ; ' ) 'ASSIGN 12=KINN:H960UT; ' 'ASSIGN 10=H95-96(LAST+1 'ASSIGN 2 = K I N N : H 9 7 I N ; ' ) 'ASSIGN 12=KINN:H970UT; ' 'ASSIGN 10=H97-98(LAST+1 'ASSIGN 2 = K I N N : H 9 8 I N ; ' ) 'ASSIGN 12=KINN:H980UT; ' 'ASSIGN 10=H97-98(LAST+1 'ASSIGN 2 = K I N N : H 9 9 I N ; ' ) 'ASSIGN 12=KINN:H990UT; ' 'ASSIGN 10=H99-100(LAST+ 'ASSIGN 2 = K I N N : H 1 0 0 I N ; ' ) 'ASSIGN 12=KINN:H1000UT; 'ASSIGN 10=H99-100(LAST+1 00 1030, 1040, 1 0 5 0 ) , I 'ASSIGN 2 = K I N N : G 1 0 0 I N ; ' ) 'ASSIGN 12=KINN:G1000UT; 'ASSIGN 10=-CHK(LAST+1) ; •ASSIGN 2 = K I N N : G 2 0 0 I N ; ' ) 'ASSIGN 12=KINN:G200OUT; 'ASSIGN 10=-CHK(LAST+1) ; 'ASSIGN 2 = K I N N : G 3 0 0 I N ; ' ) 'ASSIGN 12=KINN:G300OUT; 'ASSIGN 10=-CHK(LAST+1) ; 'ASSIGN 2 = K I N N : G 4 0 0 I N ; ' ) 'ASSIGN 12=KINN:G400OUT; •ASSIGN 10=-CHK(LAST+1) ; ' ) ' ) ' ) ) ) 0) IHRD H E R D ' , 14 , NOT FOUND') PROGRAM LISTINGS " 204 * C* * C* A . I . UPDATE PROGRAM * C* * C* * C* Reads f i l e s -DREC and -BUSE (DREC and BUSE s o r t e d by b u l l * C* number) and u p d a t e s E T A ' s , d a u g h t e r a v e r a g e s , u s e , c o n c e p t i o n s * C* and semen p r i c e s . * C* Reads f i l e YSIRE and a d d s t h e t o p young b u l l s t o t h e A . I . f i l e C* * C* D a t a : H4H = ( 4 - h e r i t a b i l i t y ) / h e r i t a b i l i t y * C* G4 = 1/4 * g e n e t i c v a r i a n c e * C* VECG2 = e n v i r o n m e n t a l v a r i a n c e between cow + 1/2 g e n e t i c * C* v a r i a n c e . * C* VEH = e n v i r o n m e n t a l v a r i a n c e between h e r d s . * C* SPM fx SPSD = mean and s t a n d a r d d e v i a t i o n o f r e l a t i v e * C* semen p r o d u c t i o n . * C* BFM & BFSD = mean and s t a n d a r d d e v i a t i o n o f f e r t i l i t y . * C* TCOW = number o f cows i n t h e p o p u l a t i o n . * C* BASP = b a s e semen p r i c e * C* DYR = Age a t w h i c h a b u l l i s removed f r o m A . I . * C* ( N o t e : I f more t h a n 33 b u l l s a r e a d d e d e a c h y e a r * C* d e c r e a s e DYR o r i n c r e a s e t h e d i m e n s i o n o f A I ) * C* * Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * REAL *4 A I ( 3 0 , 5 0 0 ) , P E T A ( 4 ) , Y B U L ( 1 8 ) , * P Y S ( 1 5 , 5 0 0 ) , S I N D E X U ) , 1 H 4 H ( 4 ) / 1 4 . 3 8 , 1 0 . 7 6 , 1 3 . 8 1 , 1 2 . 3 3 / , G 4 ( 4 ) / 4 2 6 4 2 . , 8 2 . 8 1 , 2 4 0 . 9 6 , 0 . 6 8 8 9 / , V E C G 2 ( 4 ) / 4 9 9 8 3 3 . , 6 7 0 . 3 4 , 4 6 0 . 6 9 , 6 . 5 0 1 0 / , 3 V E H ( 4 ) / 5 8 0 8 1 . , 1 2 5 . 4 4 , 5 9 . 2 9 , 1 . 2 7 6 9 / , A V G ( 3 ) / 7 2 0 0 . , 2 8 0 . , 4 2 3 0 . / , B F M / . 7 / , B F S D / . 0 2 / , S P M / . 5 / , S P S D / . 3 / , TCOW/750./ , 5 B A S P / 1 5 . / , D Y R / 1 5 . / , U Y R / 1 . / INTEGER *4 I D R E C ( 8 ) , I U S E ( 5 ) , I T B ( 4 ) LOGICAL *1 F A L S E / F / , TRUE/T/ , YYB/T/ , BSWT/T/, USWT/T/, YNG/F/ Q*** *** C*** A s s i g n i n p u t - o u t p u t u n i t s t o f i l e s and i n i t i a l i z e FRAND *** £*** *** CALL FTNCMD( 'ASSIGN 1=DREC; ' ) CALL FTNCMD( 'ASSIGN 2 = B U S E ; ' ) CALL FTNCMD( 'ASSIGN 3 = Y S I R E ; ' ) CALL FTNCMD( 'ASSIGN 4 = A I . T ; ' ) CALL FTNCMD( 'ASSIGN 1 3 = A I O L D ( L A S T + 1 ) ; ' ) CALL FTNCMD( 'ASSIGN 1 4 = A I . U ; ' ) IR = IRAND(0) F = I RAND(1000) F = RANDN(F) Q*** * * * C*** Z e r o T o t a l s *** C*** *** T V I A L = 0 . TCON = 0 . ND = 0 NHYS = 0 £*** *** C*** Read t h e c u r r e n t A . I . f i l e a n d t h e f i r s t r e c o r d f r o m *** C*** f i l e s DREC , BUSE and Y S I R E . *** *** READ (4) NDAI , N A I , N U A I , N E A I , N P A I , NTAI CALL R E A M A T ( A I , 3 0 , N T A I , 4) IF (NAI . L T . 20) TCOW = TCOW * 3 . NND = 0 C*** PROGRAM LISTINGS 205 NSR = 9000 + NDAI C*** Check f o r b u l l s t o be removed *** DO 95 I = 1, NAI IF ( Y R - A I ( 8 , I ) . L T . DYR) GO TO 77 CALL WRTMAT ( A I ( l , l ) , 3 0 , 1, 13) NND = NND + 1 NSR = NSR + 1 95 CONTINUE I F (NEAI . L E . NAI) GO TO 251 I = NAI + 1 77 IN = I J F A I = NSR + 1 20 READ ( 1 , END=30) IDREC IBSR = IDRECC3) I F (IBSR . L T . J F A I ) GO TO 20 GO TO 40 30 IBSR = 0 BSWT = F A L S E NCDAI = 0 40 READ ( 2 , END=50) IUSE IUSR = I U S E ( 3 ) IF (IUSR . L T . J F A I ) GO TO 40 GO TO 60 50 USWT = F A L S E 60 READ ( 3 , END=70) YBUL GO TO 75 70 YYB = F A L S E 75 WRITE ( 6 , 450) READ ( 5 , 4 3 0 , E R R = 7 5 ) IYR YR = IYR C*** *** C*** M a j o r L o o p - U p d a t e s S i r e P r o o f s *** Q*** * * * NRAI = 0 DO 250 I = I N , NEAI NSR = NSR + 1 C*** *** C*** Add f i r s t l a c t a t i o n r e c o r d f r o m l a s t h e r d and r e a d a n o t h e r * * * C*** *** IF ( . N O T . BSWT) GO TO 160 IBSR = IDREC(3) IF (NSR . N E . IBSR) GO TO 78 GO TO 80 78 IF (NSR . G T . IBSR) GO TO 397 GO TO 140 80 NHYS = NHYS + 1 ND = ND + I D R E C U ) DO 90 J = 1 , 4 I T B ( J ) = I T B ( J ) + IDREC(J+4) 90 CONTINUE READ ( 1 , END=100) IDREC I F (NSR . E Q . I D R E C ( 3 ) ) GO TO 80 GO TO 110 100 BSWT = F A L S E NCDAI = NRAI + 1 C*** A d j u s t t h e b u l l ' s r e c o r d f o r d a u g h t e r s , h e r d s , E T A ' s *** C*** and d a u g h t e r ' s a v e r a g e . *** C*** *** 1 1 0 TND = ND TNHY = NHYS PROGRAM LISTINGS 206 1 15 130 C*** C*** C*** 1 40 1 55 1 60 c*** c*** 1 65 TD = TND + A I ( 1 3 , I ) DO 130 J = 1, 4 BD = TND / (TND + H 4 H ( J ) ) SD = S Q R T ( d - B D ) * G 4 ( J ) + V E C G 2 ( J ) / TND + V E H ( J ) /TNHY) SETA = ( A I ( J + 1 4 , I ) * .5 + FRANDN(0 . ) * SD) * BD IF ( J . E Q . 4) GO TO 115 SETA = SETA / A V G ( J ) * 100. A I ( J + 2 2 , I ) = ( I T B ( J ) + A I ( J + 2 2 , I ) * A I ( 1 3 , D ) / TD A I ( J + 2 6 , I ) = (SETA * TND + A I ( J + 2 6 , I ) * A I ( 1 3 , I ) ) / TD CONTINUE A I ( 1 3 , 1 ) = TD A I ( 1 4 , 1 ) = A I ( 1 4 , 1 ) + TNHY Z e r o T o t a l s DO 155 J = 1, 4 I T B ( J ) = 0 . ND = 0 NHYS = 0 IF ( .NOT . USWT) GO TO 200 Add use by l a s t h e r d and r e a d a n o t h e r IUSR = I U S E ( 3 ) I F (NSR . N E . IUSR) GO TO 165 GO TO 170 I F (NSR . G T . IUSR) GO TO 398 GO TO 200 *** *** *** *** *** *** 170 180 C*** C*** C*** C*** c*** 1 90 200 C*** C*** c*** 210 220 250 C*** C*** C*** T V I A L = T V I A L + I U S E ( 4 ) TCON = TCON + I U S E ( 5 ) READ ( 2 , END=180) I USE IF (NSR . E Q . I U S E ( 3 ) ) GO TO 170 GO TO 190 USWT = F A L S E A d j u s t b u l l s r e c o r d f o r v i a l s u s e d and c o n c e p t i o n s and c a l c u l a t e a new semen p r i c e *** *** *** *** *** AI ( 1 1 ,1 ) = A I ( 1 1 ,1) +' T V I A L A I ( 1 2 ,1 ) = A I ( 1 2 ,1 ) + TCON I F ( A I ( 1 0 , I ) . L E . 0 . ) A I ( 1 0 , I ) = PRICE = BASP + T V I A L * * 2 . / TCOW I F ( A I ( 7 , I ) . G T . PRICE) PRICE = , AI (7,1 ) = PRICE T V I A L = 0 . TCON = 0 . GO TO 210 A I ( 7 , 1 ) = . 5 * (BASP + A I ( 7 , 1 ) ) FRANDN(0 . ) * SPSD + SPM 5 * (PRICE + A I ( 7 , 1 ) ) *** *** *** move up l o c a t i o n o f e l i g i b l e b u l l s t o r e p l a c e d e a d NRAI = NRAI + 1 DO 220 J = 1, 30 A I ( J , N R A I ) = A I ( J , I ) CONTINUE CONTINUE I F (BSWT) NCDAI = NEAI *** Check i f y oung b u l l s o l d e n o u g h t o use and move up r e s t b u l l s * * * *** PROGRAM LISTINGS 207 251 NFY = NEAI + 1 NNAI = 0 IF (NFY . G T . NTAI) GO TO 254 DO 256 I = NFY, NTAI NRAI = NRAI + 1 DO 253 J = 1, 30 A I ( J , N R A I ) = A I ( J , I ) 253 CONTINUE IF (YNG) GO TO 256 AGE = YR - A I ( 8 , N R A I ) I F (AGE . L T . UYR) GO TO 252 NNAI = NNAI + 1 GO TO 256 252 YNG = TRUE 256 CONTINUE C*** Young b u l l s e l e c t i o n *** C*** *** 254 NYSS = 0 NFYAI = NRAI + 1 IF ( . N O T . YYB) GO TO 350 WRITE ( 6 , 4 0 0 ) READ ( 5 , 4 3 0 ) NYSS, T I N D , T T Y P , TDTYP IF (NYSS . L E . 0) GO TO 350 255 WRITE ( 6 , 4 1 0 ) R E A D ( 5 , 4 4 0 ) SINDEX ST = A B S ( S I N D E X ( 1 ) + SINDEX(2) + SINDEX(3) + S I N D E X ( 4 ) ) IF (ST . L E . 0 . ) GO TO 255 DO 258 J = 1, 4 S I N D E X ( J ) = S I N D E X ( J ) / ST 258 CONTINUE NPYS = 0 GO TO 270 260 READ ( 3 , END=290) YBUL 270 IF ( Y B UL ( 14) . L T . TTYP .OR. Y B U L ( 1 8 ) . L T . TDTYP) GO TO 260 BIND = Y B U L ( 1 1 ) * SINDEX(1) + YBUL(12) * SINDEX(2) + YBUL(13) 1 * SINDEX(3) + YBUL(14) * S I N D E X U ) IF (BIND . L T . TIND) GO TO 260 NPYS = NPYS + 1 IF (NPYS . G T . 500) GO TO 390 DO 280 J = 1, 14 P Y S ( J , N P Y S ) = Y B U L ( J ) 280 CONTINUE P Y S ( 1 5 , N P Y S ) = BIND GO TO 260 290 CALL ISORT ( P Y S , 1 5 , N P Y S , 1 , N P Y S , 1 5 , 3 , - 1) N = 0 ID = NTAI + NDAI + 9000 I F (NPYS . L T . NYSS) GO TO 395 DO 320 J = 1, NYSS N = N + 1 NRAI = NRAI + 1 A I ( 1 , N R A I ) = ID + N A I ( 2 , N R A I ) = P Y S ( 2 , J ) A I ( 3 , N R A I ) = P Y S ( 3 , J ) A I ( 4 , N R A I ) = P Y S ( 6 , J ) A I ( 5 , N R A I ) = P Y S ( 5 , J ) A I ( 6 , N R A I ) = BFM + 1 - EXP ( BFSD * F R A N D N ( 0 . ) ) A I ( 7 , N R A I ) = BASP A I ( 8 , N R A I ) = P Y S ( 1 , J ) + P Y S ( 4 , J ) / 3 6 5 . A I ( 9 , N R A I ) = 0 . 0 A I ( 1 0 , N R A I ) = FRANDN(0 . ) * SPSD + SPM PROGRAM LISTINGS 2 0 8 DO 300 K = 1, 4 A I ( K + 1 0 , N R A I ) = 0 . A I ( K + 1 4 , N R A I ) = P Y S ( K + 6 , J ) A I ( K + 1 8 , N R A I ) = 0 . A I ( K + 2 2 , N R A I ) = 0 . A I ( K + 2 6 , N R A I ) = P Y S ( K + 1 0 , J ) 300 CONTINUE 320 CONTINUE CALL I S O R T v A I , 3 0 , 5 0 0 , N F Y A I , N R A I , 8 , 3 , 0 ) DO 325 J = N F Y A I , NRAI 325 A I ( 1 , J ) = J + 9000 350 NPAI = NTAI - NND NTAI = NTAI + NYSS - NND NDAI = NDAI + NND NAI = MAX0 (NAI-NND, NCDAI) NUAI = NEAI - NND NEAI = NUAI + NNAI 380 WRITE(14) NDAI , N A I , NUAI , N E A I , N P A I , NTAI CALL WRTMAT(AI, 3 0 , N T A I , 14) STOP 390 WRITE ( 6 , 4 2 0 ) STOP 395 W R I T E ( 6 , 4 2 5 ) NPYS STOP 397 WRITE ( 6 , 460) STOP 398 WRITE ( 6 , 470) 400 FORMAT ( 'ENTER THE NUMBER OF BULLS TO ADD, THE MINIMUM I N D E X , ' , /, • 1 ' THE MINIMUM ETA FOR TYPE AND THE DAMS MINIMUM E T A ' , /, 2 ' FOR T Y P E ' ) 410 FORMAT ( 'ENTER SELECTION INDEX WEIGHTINGS F O R ' , /, 1 ' M I L K , F A T , PROTEIN AND T Y P E ' ) 420 FORMAT ( 'TOO MANY YOUNG BULLS - ' , /, 1 ' INCREASE THE MINIMUMS OR THE DIMENSIONS OF P Y S ' ) 425 FORMAT ( 'ONLY* , 14 , ' YOUNG BULLS E L I G A B L E - ' , /, 1 'DECREASE MINIMUMS OR NUMBER OF BULLS S E L E C T E D ' ) 430 FORMAT ( 1 1 0 , 4 F 1 0 . 2 ) 440 FORMAT ( 5 F 1 0 . 3 ) 4 50 FORMAT ( 'ENTER THE CURRENT YEAR ( N E X T ) ' ) 460 FORMAT ('ERROR : DREC NOT SORTED PROPERLY ' ) 470 FORMAT ('ERROR : BUSE NOT SORTED PROPERLY ' ) STOP END SUBROUTINE WRTMAT(WRMATR, I COL , I ROW, INP) Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * C * T h i s s u b r o u t i n e w r i t e s two d i m e n s i o n a l m a t r i x e s . * Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * DIMENSION WRMATR(lCOL,IROW) WRITE (INP) WRMATR RETURN END PROGRAM LISTINGS 209 SUBROUTINE REAMAT(REMATR, I COL , IROW, INP) Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * C * T h i s s u b r o u t i n e r e a d s two d i m e n s i o n a l m a t r i x e s . * Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * DIMENSION REMATR(ICOL,IROW) READ (INP) REMATR 10 RETURN END PROGRAM LISTINGS 210 C* c* C* C* C* C* C* C* C* c* c* c* c* c* A . I . VIEW PROGRAM **************** * * The u s e r e n t e r s t h e i r i n d e x w e i g h t i n g s and t h e number of t o p p r o v e n b u l l s t h e y want t o s e e . The p r o g r a m r a n k s a l l A . I . b u l l s w i t h d a u g h t e r r e c o r d s by i n d e x s c o r e and l i s t s t h e f o l l o w i n g i n f o r m a t i o n f o r t h e s p e c i f i e d number o f t o p b u l l s : - S I R E , MATERNAL GRAND S I R E , E T A ' S FOR MILK , F A T , PROTEIN, T Y P E , AND INDEX, CONCEPTION RATE , NUMBER DAUGHTER RECORDS, NUMBER OF HERDS AND SEMEN P R I C E . The p r o g r a m a l s o c a n l i s t a l l y o u n g s i r e s e l i g i b l e f o r use 10 20 REAL *4 A I ( 3 0 , 5 0 0 ) , 0 U T ( 1 2 , 4 0 0 ) , YUNG(8 ,100) LOGICAL *1 P V N / ' P ' / , Y N G / ' Y ' / , CHR CALL FTNCMD( 'ASSIGN 4 = K I N N : A I . U ; WRITE ( 6 , 1 1 0 ) READ ( 5 , 1 5 0 ) SINDEX SDT = A B S ( S I N D E X ( 1 ) + S I N D E X U ) I F (SDT . E Q . 0 . ) GO TO 10 DO 20 I = 1, 4 S I N D E X ( I ) = S I N D E X ( I ) / SDT CONTINUE READ (4) NDAI , N A I , NUAI , N E A I , CALL R E A M A T t A I , 3 0 , N E A I , 4) NBP = 0 NYB = 0 DO 40 I = 1, NEAI B u l l s w i t h d a u g h t e r r e c o r d s ND = A I ( 1 3 , 1 ) I F (ND . L E . 0) GO TO 30 NBP = NBP + 1 S I N D E X U ) + S I N D E X U ) + S I N D E X U ) ) N P A I , NTAI C* 30 0 U T ( 1 , N B P ) = O U T ( 2 , N B P ) = O U T ( 3 , N B P ) = O U T ( 4 , N B P ) = O U T ( 5 , N B P ) = O U T ( 6 , N B P ) = O U T ( 7 , N B P ) = O U T ( 8 , N B P ) = O U T ( 6 , N B P ) O U T ( 9 , N B P ) = O U T ( 1 0 , N B P ) = 0 U T ( 1 1 , N B P ) = 0 U T ( 1 2 , N B P ) = GO TO 40 Young b u l l s NYB = NYB + YUNG(1,NYB) = YUNG(2,NYB) = YUNG(3 ,NYB) • YUNG(4,NYB) • YUNG(5 ,NYB) YUNG(6,NYB) YUNG(7,NYB) YUNG(8,NYB) A I ( 1 ,1 ) A I U , I ) A I U , I ) A I ( 2 7 , 1 ) A I ( 2 8 , 1 ) A I ( 2 9 , 1 ) A I ( 3 0 , 1 ) O U T ( 4 , N B P ) * SINDEX(3) A i d 2 , 1 ) / • ND • A I ( 1 4 , 1 ) < A I ( 7 , I ) A I ( 1 ,1 ) A I ( 2 , 1 ) A I ( 4 , 1 ) A I ( 2 7 , I ) A I ( 2 8 , I ) A I ( 2 9 , 1 ) A I ( 3 0 , 1 ) YUNG(4,NYB) * SINDEX(1) + + O U T ( 7 , N B P ) (AI ( 1 1 ,1 ) + 1 OUT(5 ,NBP) * S I N D E X U ) + * S I N D E X U ) E -6) * S I N D E X ( I ) + YUNG( 5 ,NYB) * S I N D E X U ) + YUNG(6,NYB) * S I N D E X U ) + YUNG( 7 ,NYB) * S I N D E X U ) PROGRAM LISTINGS 4 0 C O N T I N U E I F ( N B P . L E . 0 ) G O T O 5 0 CALL I S O R T ( O U T , 1 2 , N B P , 1 , N B P , 8 , 3 , - 1 ) C * L i s t b u l l s on t h e s c r e e n 5 0 W R I T E ( 6 , 1 2 0 ) R E A D ( 5 , 1 6 0 ) C H R C A L L F I N D S T ( P V N , 1 , C H R , 1 , 1 , N X , 1 , £ . 6 0 , & 6 0 ) G O T O 7 0 6 0 C A L L F I N D S T ( Y N G , 1 , C H R , 1 , 1 , N X , 1 , & 9 0 , & 9 0 ) G O T O 8 0 7 0 W R I T E ( 6 , 1 3 0 ) N B P I F ( N B P . L E . 0 ) G O T O 5 0 R E A D ( 5 , 1 7 0 ) N O P B I F ( N O P B . G T . N B P ) N O P B = N B P W R I T E ( 6 , 1 4 0 ) C A L L P N T M A T ( O U T , 1 2 , N O P B ) G O T O 5 0 8 0 W R I T E ( 6 , 1 4 0 ) I F ( N Y B . L E . 0 ) G O T O 5 0 C A L L P N T M A T ( Y U N G , 8 , N Y B ) G O T O 5 0 9 0 S T O P n o F O R M A T C E N T E R I N D E X W E I G H T I N G S F O R M I L K , F A T , P R O T E I N A N D T Y P E ' , 1 / , ' T H E Y M U S T N O T S U M T O " 0 " ' ) 1 2 0 F O R M A T ( ' E N T E R : " Y " F O R Y O U N G S I R E S ' , / , ' O R " P " F O R ' , 1 ' P R O V E N S I R E S ' , / , ' O R R E T U R N T O S T O P ' ) 1 3 0 F O R M A T ( ' H O W M A N Y S I R E S D O Y O U W A N T L I S T E D ? ' , / , 1 ' M A X I M U M ' , 1 4 ) 1 4 0 F O R M A T ( 3 3 X , ' E T A ' , 1 5 X , ' C O N C E P - N O . N O . S E M E N ' , / , 1 ' B U L L S I R E M G S M I L K F A T P R O T T Y P E I N D E X T I O N ' , 2 ' D A U . H E R D S P R I C E ' ) 1 5 0 F O R M A T ( 4 F 1 2 . 3 ) 1 6 0 F O R M A T ( A 1 ) 1 7 0 F O R M A T ( 1 1 0 ) E N D S U B R O U T I N E P N T M A T ( D M A T , N C O L , N R O W ) R E A L D M A T ( N C O L , N R O W ) I F ( N C O L . L T . 1 2 ) G O T O 1 0 W R I T E ( 6 , 2 0 ) D M A T R E T U R N 1 0 W R I T E ( 6 , 3 0 ) D M A T R E T U R N 2 0 F O R M A T ( F 6 . 0 , 1 X , 2 F 6 . 0 , 1 X , 4 F 6 . 1 , 1 X , F 6 . 1 , 1 F 6 . 2 , F 7 . 0 , F 6 . 0 , F 8 . 2 ) 3 0 F O R M A T ( F 6 . 0 , 1 X , 2 F 6 . 0 , 1 X , 4 F 6 . 1 , 1 X , F 6 . 1 , 2 2 X , ' 1 5 . 0 0 ' ) E N D SUBROUTINE REAMAT(REMATR, I C O L , I ROW, INP) Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * C * T h i s s u b r o u t i n e r e a d s two d i m e n s i o n a l m a t r i x e s . * C ******************************************************************** DIMENSION REMATR(ICOL,IROW) READ (INP) REMATR 1 0 RETURN END PROGRAM LISTINGS C C C C C C C C C c c c c c c ******************************************** * * * * * CRDBASE T h i s p r o g r a m r e a d s i n t h e h e r d summar ies f r o m t h e f i l e SUMS ( a f t e r i t has been s o r t e d by h e r d and y e a r ) and t h e v a r i a b l e names f rom VARNAMES f o r m a t e d 4 X , 3 ( 7 X , 7 A 4 ) . I t s t o r e s t h e summar ies a s a t h r e e d i m e n s i o n a l m a t r i x i n t h e f i l e SUMMARIES and t h e names u n f o r m a t e d i n VARIABLES r e a d y f o r a n a l y s i s . t * * * * * * * * * * * * * * * * * * * * * * * * * * * * INTEGER *4 NVAR/162/, V A R N ( 7 , 1 6 2 ) , HDNO(20) REAL *4 T S U M ( 7 , 2 4 , 1 6 2 ) 1 S L C B ( 4 ) , S B H B ( 4 ) , 2 S H C B ( 4 ) , S D C B ( 4 ) , 3 S H F B ( 4 ) , S B F B ( 4 ) , 4 S U B B ( 4 ) , S U B I ( 4 ) , S P ( 3 ) , S B ( 4 ) , S P 2 ( 3 ) , S B 2 ( 4 ) , S F C B ( 4 ) , S B C B ( 4 ) , S P C B ( 4 ) , S T C B ( 4 ) , S L Y B ( 4 ) , S S Y B ( 4 ) , S D Y B ( 4 ) , S L F B ( 4 ) , S D F B ( 4 ) , S Y S B ( 4 ) , S P B B ( 4 ) , S P B I ( 4 ) , S Y B B ( 4 ) , S Y B I ( 4 ) , S IND(4) ASSIGN 2=SUMS; ' ) ASSIGN 3=VARNAMES; ') ASSIGN 7 = V A R I A B L E S ; ' ) ASSIGN 8=SUMMARY;') SET UVCHECK=OFF ; ' ) 0) IG = 100 NH 1 CALL FTNCMD ( CALL FTNCMD ( ' CALL FTNCMD ( CALL FTNCMD ( CALL FTNCMD ( ' WRITE ( 6 , 100) READ ( 5 , 110) NY, NH, NG, IFR ING = 0 IG = 0 NR = 0 LH = 0 IF ( I F R . G T . 10 DO 30 I = 1, LH = LH + IH = I + IG HDNO(LH) = IH IHL = (IH - 1) DO 20 J = 1, NY IHY = IHL + J F I N D ( 2 ' I H Y ) READ (2 ,END=60) L C H , L Y , N l , S P , SB , R 1 , R2 , R3 , R4, N2, S P 2 , 1 SB2 , R 5 , R6 , R7 , R 8 , R9 , R 1 0 , P 1 , P 2 , P 3 , P 4 , P 5 , P 6 , 2 P 7 , P 8 , P 9 , P 1 0 , C l , C 2 , C 3 , C 4 , C 5 , C 6 , C 7 , T l , T 2 , 3 T 3 , T 4 , T 5 , T 6 , T 7 , T 8 , T 9 , T 1 0 , T 1 1 , N 3 , S L C B , N4, 4 SBHB, N 5 , SFCB , N6 , SBCB, N7 , SPCB, N8 , STCB , N9, SHCB, 5 N 1 0 , SDCB, N11 , S L Y B , N12 , SSYB , N13, SDYB, N14 , S L F B , 6 N15 , SHFB, N16 , S B F B , N 1 7 , SDFB, N18 , SYSB , SPBB, S P B I , 7 SUBB, S U B I , SYBB, S Y B I , SIND IF (LCH . N E . IH .OR. LY . N E . J ) GO TO 85 1 00 TSUM(J TSUM(J TSUM(J TSUM(J TSUM(J TSUM(J TSUM(J TSUM(J TSUM(J TSUM(J , L H , 1 ) = , L H , 2 ) = , L H , 3 ) = , L H , 4 ) = , L H , 5 ) = , L H , 6 ) = , L H , 7 ) = , L H , 8 ) = , L H , 9 ) = , L H , 1 0 ) N1 SP(1 ) S P ( 2 ) S P ( 3 ) SB( 1 ) S B ( 2 ) S B ( 3 ) S B ( 4 ) Rl = R2 PROGRAM LISTINGS 213 TSUM J L H , 1 1 ) = R3 TSUM J L H , 12) = R4 TSUM J L H , 13) = N2 TSUM J L H , 14) = S P 2 ( 1 ) TSUM J L H , 15) = SP2(2) TSUM J L H , 16) = S P 2 ( 3 ) TSUM J L H , 17) = SB2(1) TSUM J L H , 18) = SB2(2) TSUM J L H , 19) = SB2(3) TSUM J L H , 20) = SB2(4) TSUM J L H , 21 ) = R5 TSUM J L H , 22) R6 TSUM J L H , 23) = R7 TSUM J L H , 24) = R8 TSUM J L H , 25) = R9 TSUM J L H , 26) = RIO TSUM J L H , 27) = P1 TSUM J L H , 28) = P2 TSUM J L H , 29) = P3 TSUM J L H , 30) = P4 TSUM J L H , 31 ) = P5 TSUM 3 L H , 32) = P6 TSUM 3 L H , 33) = P7 TSUM 3 LH 34) = P8 TSUM 3 L H , 35) = P9 TSUM 3 LH 36) P10 TSUM J L H , 37) = CI TSUM 3 LH 38) = C2 TSUM 3 L H , 39) = C3 TSUM 3 L H , 40) = C4 TSUM 3 L H , 41 ) = C5 TSUM 3 LH 42) = C6 TSUM 3 LH 43) = C7 TSUM 3 L H , 44) = T1 TSUM 3 LH 45) = T2 TSUM J L H , 46) = T3 TSUM J LH 47) = T4 TSUM J L H , 48) = T5 TSUM J LH 49) = T6 TSUM J L H , 50) = T7 TSUM J LH 51 ) = T8 TSUM J LH 52) T9 TSUM J LH 53) = T1 0 TSUM J LH 54) = T1 1 TSUM J LH 55) = N3 TSUM J LH 56) = S L C B ( 1 ) TSUM J LH 57) = S L C B ( 2 ) TSUM J LH 58) = S L C B ( 3 ) TSUM J LH 59) = S L C B U ) TSUM J LH 60) = N4 TSUM J LH 61 ) = SBHB(1 ) TSUM J LH 62) = SBHB(2) TSUM J ,LH 63) = SBHB(3) TSUM J LH 64) = SBHB(4) TSUM J ,LH 65) = N5 TSUM J LH 66) = S F C B ( 1 ) TSUM J , LH 67) = S F C B ( 2 ) TSUM J LH 68) = S F C B ( 3 ) TSUM J LH 69) = S F C B ( 4 ) TSUM J LH 70) = N6 TSUM (J , LH 71 ) = SBCB(1) TSUM J LH 72) = SBCB(2) PROGRAM LISTINGS 214 TSUM J LH 73) = = SBCB(3) TSUM J LH 74) = = SBCB(4) TSUM J LH 75) = = N7 TSUM J L H , 76) = = SPCB(1) TSUM J L H , 77) = = SPCB(2) TSUM J LH 78) = = SPCB(3) TSUM J LH 79) = = S P C B U ) TSUM J LH 80) = = N8 TSUM J LH 81) . = S T C B ( 1 ) TSUM J LH 82) = = STCB(2) TSUM J LH 83) = = S T C B ( 3 ) TSUM J LH 84) = = S T C B ( 4 ) TSUM J LH 85) = = N 9 TSUM J LH 86) = = SHCB(1) TSUM J LH 87) = = SHCB(2) TSUM J LH 8 8 ) = = SHCB(3) TSUM J LH 89) = = SHCB(4) TSUM J LH 90) = = Nl 0 TSUM J LH 91) = = SDCB(1) TSUM J LH 92) = = SDCB(2) TSUM J LH 93) = = SDCB(3) TSUM J LH 94) = = SDCB(4) TSUM J LH 95) = = N1 1 TSUM J LH 96) . = S L Y B ( 1 ) TSUM J LH 97) = = S L Y B ( 2 ) TSUM J LH 98) = = S L Y B ( 3 ) TSUM J LH 9 9 ) = = S L Y B ( 4 ) TSUM J LH 100) = N1 2 TSUM J LH 101 ) = SSYB(1) TSUM J LH 1 0 2 ) = SSYB(2) TSUM J LH 1 03) = SSYB(3) TSUM J LH 1 04) = SSYB(4) TSUM J LH 105) = N1 3 TSUM J LH 1 06) = SDYB(1) TSUM J LH 107) = SDYB(2) TSUM J LH 1 08) = SDYB(3) TSUM J LH 1 09) = SDYB(4) TSUM J LH 110) = N14 • TSUM J LH 111) = S L F B ( 1 ) TSUM J LH 112) = S L F B ( 2 ) TSUM J LH 1 13) = S L F B ( 3 ) TSUM J LH 114) = S L F B ( 4 ) TSUM J LH 1 15) = N1 5 TSUM J LH 1 16) = SHFB(1) TSUM J LH 117) = SHFB(2) TSUM J LH 118) = SHFB(3) TSUM J LH 119) = SHFB(4) TSUM J LH 1 20) = N16 TSUM J LH 121 ) = S B F B ( 1 ) TSUM J LH 122) = S B F B ( 2 ) TSUM J LH 123) = S B F B ( 3 ) TSUM J LH 124) = S B F B ( 4 ) TSUM J LH 125) = N1 7 TSUM J LH 126) = SDFB(1) TSUM J LH 127) = SDFB(2) TSUM J LH 128) = SDFB(3) TSUM J LH 129) = SDFB(4) TSUM J LH 130) = N 1 8 TSUM J LH 131 ) = S Y S B ( 1 ) TSUM J LH 132) = S Y S B ( 2 ) TSUM J LH 133) = SYSB(3) TSUM J LH 134) = SYSB(4) PROGRAM LISTINGS T S U M ( J , L H T S U M ( J , L H T S U M ( J , L H T S U M ( J , L H T S U M ( J , L H T S U M ( J , L H T S U M ( J , L H T S U M ( J , L H T S U M ( J , L H T S U M ( J , L H T S U M ( J , L H T S U M ( J , L H T S U M ( J , L H T S U M ( J , L H T S U M ( J , L H T S U M ( J , L H T S U M ( J , L H T S U M ( J , L H T S U M ( J , L H T S U M ( J , L H T S U M ( J , L H T S U M ( J , L H T S U M ( J , L H T S U M ( J , L H T S U M ( J , L H T S U M ( J , L H T S U M ( J , L H T S U M ( J , L H 20 CONTINUE 30 CONTINUE IF (NR . G E . NG) GO TO 35 NR = NR + 1 IG = IG + 100 GO TO 10 35 IMS = LH * NY DO 40 I = 1, NVAR CALL WRTMAT ( T S U M ( 1 , 1 , 1 ) , IMS, I , 8) 40 CONTINUE 45 DO 50 I = 1, 54 READ ( 3 , 120) ( V A R N ( J , I ) , J = 1 , 7 ) , ( V A R N ( J , I + 5 4 ) , J = 1 , 7 ) , 1 ( V A R N ( J , 1 + 1 0 8 ) , J = 1 , 7 ) 50 CONTINUE CALL INMAT (VARN, 7, 162, 7) CALL INMAT (HDNO, L H , 1, 7) STOP 60 W R I T E ( 6 , 1 3 0 ) I H , J STOP 85 WRITE ( 6 , 90) I H , J , L H , LY 90 FORMAT (/ , ' ERROR NOT PROPERLY SORTED OR MISSING HERD YEAR' 1 /, ' LOOKING FOR H E R D ' , 1 4 , ' Y E A R ' , 1 4 , 2 ' FOUND HERD*, 1 4 , ' Y E A R ' , 14) 100 FORMAT C E N T E R NUMBER O F : YEARS; HERDS; GROUPS; AND 1 IF NO 1 'STUDENT HERDS ' ) 110 FORMAT (6110) 120 FORMAT (4X , 3 ( 7 X , 7 A 4 ) ) 130 FORMAT ( 'CAN NOT FIND H E R D ' , 1 4 , ' Y E A R ' , 13) STOP END 136) = SPBB(2 137) = SPBB(3 138) = SPBB(4 139) = SPBI(1 140) = S P B I ( 2 141) = S P B I ( 3 142) = S P B I ( 4 143) = SUBB(1 144) = SUBB(2 145) = SUBB(3 146) = SUBB(4 147) = SUBI(1 148) = S U B I ( 2 149) = SUBI(3 150) = SUBI(4 151 ) = SYBB(1 152) = SYBB(2 1 53) = SYBB(3 1 54) = SYBB(4 155) = SYBI(1 1 56) = S Y B I ( 2 1 57) = S Y B I ( 3 158) = S Y B I ( 4 159) = SIND(1 160) = SIND(2 161 ) = SIND(3 162) = S I N D U PROGRAM LISTINGS 216 SUBROUTINE WRTMAT(WRMATR, I S I Z , L B L , INP) Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * C * T h i s s u b r o u t i n e w r i t e s two d i m e n s i o n a l m a t r i x e s . * Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * DIMENSION WRMATR(ISIZ) WRITE ( I N P ' L B L ) WRMATR RETURN END SUBROUTINE INMAT ( I M A T , I C O L , I ROW,INP) INTEGER *4 IMAT(I C O L , I ROW) WRITE(INP) IMAT RETURN END PROGRAM LISTINGS 217 * * c c * C * STANL * C * C * T h i s i n t e r a c t i v e p r o g r a m d o e s t h e f i n a l s t a t i s t i c a l a n a l y s i s C * and g r a p h i n g . I t r e a d s v a r i a b l e names and numbers f r o m C * VARIABLES and d a t a f r o m SUMMARIES. T i t l e s and s p e c i f i c a t i o n s * C * a r e e n t e r e d i n t e r a c t i v e l y . I t d o e s an a n a l y s i s o f c o v a r i a n c e C * w i t h y e a r s a s t h e c o v a r i a t e , t e s t s f o r common s l o p e s w i t h i n * C * g r o u p s and between g r o u p s and d o e s a S t u d e n t Knewman K e u l s * C * t e s t (SNK) where s i g n i f i c a n t d i f f e r e n c e s i n s l o p e s o r means * C * a r e f o u n d . A g r a p h f o r e a c h g r o u p p l o t s a l l p o i n t s and t h e * C * common r e g r e s s i o n and and a f i n a l g r a p h has a l l g r o u p * C * r e g r e s s i o n l i n e s and t h e o v e r a l l common r e g r e s s i o n . * C * The s t a t i s t i c a l a n a l y s i s i s w r i t t e n t o t h e f i l e - S T A T and t h e C * t h e d a t a t o -DAT and t h e g r a p h s t o - P L O T . -PLOT s h o u l d be C * c o p i e d t o t h e p r i t e r i f t h e p r o g r a m was run w i t h t h e a p - C * p e n d i x "*PRPLOT" , o t h e r w i s e i t s h o u l d be c o p i e d t o t h e C * p l o t t e r . C * C * CURRENT MAXIMUMS: 50 y e a r s ; 100 h e r d s / g r o u p ; 10 g r o u p s ; C * S N K ' s t e s t i s no t done i f more t h a n 20 C * h e r d s / g r o u p ( t o m o d i f y l o o k a t FINDRG) c ************************************************ C * C * C * INTEGER*4 TNO, HDF, BGDF, T D F , TRDF, GRDF, BDF, MDF, CRDF, GDF, 1 GMDF, I H G N ( 1 0 0 , 1 0 ) , I H H N ( 1 0 0 ) , I G N ( 1 0 ) , Y L A B E L ( 2 0 ) , 2 F S T Y R / 1 / , LSTYR / 1 4 / , G L A B E L ( 1 3 , 1 0 ) , N H ( 1 0 0 ) , V A R B ( 7 ) , 3 V A R N A M ( 7 , 1 6 2 ) , HNO(20) EQUIVALENCE ( Y L A B E L ( 1 4 ) , V A R B ( 1 ) ) REAL*4 C O V ( 5 0 ) , Y I E L D ( 5 0 ) , H M N O O O ) , H B ( 1 0 0 ) , H A O O O ) , G B ( 1 0 ) , 1 G B S E ( 1 0 ) , G M N ( 1 0 ) , G M N S E ( l O ) , G A ( 1 0 ) , MSSQ, MMS, MFT, MP, 2 GBD ( 1 0 ) , G M N D d O ) , H B D ( l O O ) , H B S E ( 1 0 0 ) , E P X ( 2 ) , T E P Y ( 2 ) , 3 T S U M ( 2 0 , 4 0 ) , T E X ( 2 0 , 4 0 ) , HMND(100) LOGICAL*1 F A L S E / F / , TRUE/T/ , F T G P / T / , CONT/F/ , SNG, F T V B / T / , 1 P L T P ( 1 0 ) DATA MAXGP / 1 0 / , MAXYR / 7 / , MIN / 1 / , MAXSNK / 2 0 / , NTH / 9 / , 1 NTY / ! / , N T V / 1 6 2 / , D S X / 1 0 . / , D S Y / 8 . / CALL FTNCMD( 'ASSIGN 1 = S T U D . S I M ; ' ) CALL FTNCMD( 'ASSIGN 2 = V A R I A B L E S ; ' ) CALL FTNCMD( 'ASSIGN 3=SUMMARY;') CALL FTNCMD( 'ASSIGN 7 = - S T A T ; ' ) CALL FTNCMD( 'ASSIGN 8 = - D A T ; ' ) CALL FTNCMD( 'ASSIGN 9 = - P L O T ; ' ) CALL DIMVAR (TSUM, T E X , VARNAM, HNO, NTV, NTY, NTH) GO TO 20 C * I n p u t c h o i c e s and t i t l e s C * 10 WRITE ( 6 , 3 2 0 ) MIN, MAXYR 20 WRITE ( 6 , 2 2 0 ) READ ( 5 , 2 3 0 ) NG IF (NG . L T . 2) GO TO 160 WRITE ( 6 , 2 4 0 ) READ ( 5 , 2 3 0 ) I F Y , LY C * * PROGRAM LISTINGS 21 8 IF (I FY . L T . MIN .OR. LY . G T . MAXYR) GO TO 10 IAY = I FY - 1 NY = LY - I AY XMIN = IAY IDF = NY I PR = DSX / 2. ICT = 0 22 XMAX = I PR IF (IDF . L E . IPR) GO TO 25 ICT = ICT + 1 IPR = DSX * ICT GO TO 22 25 WRITE ( 7 , 1 7 0 ) I F Y , LY WRITE ( 6 , 1 8 0 ) READ ( 5 , 1 9 0 ) ( Y L A B E L ( L ) , L = 1 , 2 0 ) WRITE ( 7 , 2 0 0 ) ( Y L A B E L ( L ) , L = 1 , 1 9 ) CALL A L S I Z E ( D S X , DSY) C * C * F o r y e a r s f i n d minimum and maximum and c a l c u l a t e mean and C * v a r i a n c e C * X = 0 . SX = 0 DO 30 I = I F Y , LY X = X + I SX = SX + I ** 2 C O V ( I ) = I 30 CONTINUE CALL SMAT(COV, NY) XD = SX - X ** 2 / NY TMNX = X / NY E P X ( 1 ) = COV(1) E P X ( 2 ) = COV(NY) C * C * BEGIN LOOP FOR EACH VARIABLE C * NVAR = 0 GO TO 40 35 WRITE ( 6 , 2 0 2 ) IHHN(IH) 40 NVAR = NVAR + 1 GXD = 0 . GXYD = 0 . GYD = 0 . GCMN = 0 . TY = 0 . TSY = 0 . TXY = 0 . TSX = 0 . TX = 0 . TNO = 0 T E P Y ( 1 ) = 1.E10 T E P Y ( 2 ) = - 1.E10 GRSSQ = 0 . WRITE ( 6 , 205) NVAR CALL INIVAR ( I A Y , NY, VARB, SNG) IF (SNG) GO TO 45 WRITE ( 6 , 2 1 0 ) READ ( 5 , 1 9 0 ) VARB 45 WRITE ( 7 , 215) NVAR, VARB DO 100 I = 1, NG HY = 0 . HSY = 0 . PROGRAM LISTINGS 219 HXY = 0 . HSX = 0 . HX = 0 . HYD = 0 . HXYD = 0 . HXD = 0 . HRSSQ = 0 . IF ( .NOT. FTVB) GO TO 50 WRITE ( 6 , 2 5 0 ) I READ ( 5 , 1 9 0 ) ( G L A B E L ( L , I ) , L = 1 , 1 3 ) WRITE ( 6 , 2 6 0 ) P L T P ( I ) = F A L S E READ ( 5 , 2 8 0 ) N H ( I ) , P L T P ( l ) WRITE ( 6 , 2 6 5 ) N H ( I ) CALL I A R A Y ( I H G N ( 1 , 1 ) , HNO, N H ( I ) , NTH) FTGP = F A L S E 50 IF ( .NOT . P L T P ( I ) ) GO TO 65 DO 60 J = 1, 13 Y L A B E L ( J ) = G L A B E L ( J , I ) 60 CONTINUE C A L L A L S C A L (XMIN, XMAX, 0 . 0 , 0 . 0 ) CALL A L A X I S ( ' Y E A R ' , 4, Y L A B E L , 80) C * C * c a l c u l a t e h e r d sum s q . , mean, s l o p e and i n t e r c e p t and a d d C * t o h e r d t o t a l s C * 65 JH = NH ( I) DO 90 IH = 1, JH CALL HRDVAR(YIELD, I H G N ( I H , I ) ) CALL DMAT ( Y I E L D , NVAR) IHHN(IH) = H N 0 ( I H G N ( I H , I ) ) JHSY = IH + 240 Y = 0 . SY = 0 . XY = 0 . C * P l o t p o i n t s IF ( .NOT . P L T P ( I ) ) GO TO 70 CALL ALGRAF(COV, Y I E L D , -NY , - J H S Y ) DO 80 K = 1 , NY Y = Y + Y I E L D ( K ) SY = SY + Y I E L D ( K ) ** 2 XY = XY + Y I E L D ( K ) * COV(K) CONTINUE TNO = TNO + NY HY = HY + Y HSY = HSY + SY HXY = HXY + XY HSX = HSX + SX HX = HX + X YD = SY - Y ** 2 / NY IF (YD . E Q . 0 . ) GO TO 35 XYD = XY -- X * Y / NY HBD(IH) = XD HMND(IH) = = NY HMN(IH) = Y / NY HB(IH) = XYD / XD HA(IH) = HMN(IH) - HB(IH) * TMNX HYD = HYD + YD HXYD = HXYD + XYD HXD = HXD + XD HRSSQ = HRSSQ + YD - H B ( I H ) * XYD 90 CONTINUE PROGRAM LISTINGS 220 C * C * C a l c u l a t e g r o u p sums s q u a r e s , mean, s l o p e and i n t e r c e p t and C * a d d t o g r o u p and o v e r a l l t o t a l s . C * NTG = NY * J H QXD = HSX - HX ** 2 / NTG • QXYD = HXY - HX * HY / NTG QYD = HSY - HY ** 2 / NTG GXD = GXD + QXD GXYD = GXYD + QXYD GYD = GYD + QYD G B ( I ) = QXYD / QXD G B D ( I ) = QXD GMN(I) = HY / NTG GCMN = GCMN + GMN(I) GMND{I) = J H * NY G A ( I ) = GMN(I) - G B ( I ) * TMNX TY = TY + HY TSY = TSY + HSY TXY = TXY + HXY TSX = TSX + HSX TX = TX + HX CRSSQ = QYD - G B ( I ) * QXYD GRSSQ = GRSSQ + CRSSQ CALL S L I N E ( E P X , T E P Y , G B ( I ) , G A ( I ) , - 4 5 , P L T P ( I ) ) CALL ALDONE CRDF = NTG - 2 GMSSQ = HYD - G B ( I ) * HXYD GMDF = NTG - JH - 1 CRMS = CRSSQ / CRDF GMED = SQRT (CRMS / CRDF) GMMS = GMSSQ / GMDF GBED = SQRT (GMMS / HXD) HDF = NY * JH - 2 * JH GDF = JH - 1 I G N ( I ) = I I F (JH . L T . 2) GO TO 100 WRITE ( 7 , 217) I CALL ANCOUT (NTG, QYD, GDF, HDF, HRSSQ, GMDF, GMSSQ, CRSSQ, 1 G M N ( I ) , GMED, G B ( I ) , GBED, G A ( I ) , HB, HBD, HMN, HMND, 2 HA, IHHN, J H , 1) 100 CONTINUE C * C * C a l c u l a t e t o t a l sums of s q u a r e s , mean, s l o p e , i n t e r c e p t a n d C * a l l mean s q u a r e s , F - v a l u e s and p r o b a b i l i t i e s C * TXD = TSX - TX ** 2 / TNO TXYD = TXY - TX * TY / TNO TYD = TSY - T Y - * * 2 / TNO TMN = TY / TNO TB = TXYD / TXD TSSQ = TYD - TB * TXYD TDF = TNO•- 2 TMS = TSSQ / TDF GCB = GXYD / GXD GCMN = GCMN / NG GCA = GCMN - GCB * TMNX CMNSE = SQRT(TMS / TDF) TRSSQ = GYD - GCB * GXYD TRDF = TNO - NG - 1 TRMS = TRSSQ / TRDF CBSE = SQRT(TRMS / GXD) PROGRAM LISTINGS 2 2 1 GRDF = TNO - 2 * NG BDF = NG - 1 MDF = NG - 1 WRITE ( 7 , 219) CALL ANCOUT (TNO, TYD, MDF, GRDF, GRSSQ, TRDF, TRSSQ, TSSQ , 1 GCMN, CMNSE, GCB, C B S E , GCA, GB, GBD, GMN, GMND, GA, IGN, 2 NG, 2) C * C * S e t a x i s s c a l e f o r w e l l p l a c e d g r a p h C * PWY = 1 0 . 112 PWY = PWY / 10 . PWR = ( T E P Y ( 2 ) - T E P Y ( 1 ) ) / PWY IF (PWR . L E . 0 . ) GO TO 112 114 IF (PWR . L T . DSY) GO TO 116 PWY = PWY * 10 . PWR = ( T E P Y ( 2 ) - T E P Y ( 1 ) ) / PWY GO TO 114 116 SPW = PWY / 10. IMIN = T E P Y ( 1 ) / SPW - 1. IMAX = T E P Y ( 2 ) / SPW + 1. IND = DSY 110 IREM = MOD ( I M A X - I M I N , IND) IF (IREM . L E . 1) GO TO 120 ITR = (IND - IREM) / 2 IF ( ITR . L T . 1) ITR = 1 IMAX = IMAX + ITR IMIN = IMIN - ITR GO TO 110 120 I F (IREM . E Q . 1) IMIN = IMIN + 1 YMIN = IMIN * SPW YMAX = IMAX * SPW CALL A L S C A L ( X M I N , XMAX, YMIN, YMAX) " C A L L A L A X I S ( ' Y E A R ' , 4, VARB, 28) C * C * P l o t common and g r o u p r e g r e s s i o n s C * CALL S L I N E ( E P X , TEPY , GCB, GCA, - 4 5 , TRUE) DO 130 I = 1, NG CALL S L I N E ( E P X , T E P Y , GB(I ) , G A ( l ) , I , TRUE) 130 CONTINUE 140 CALL ALDONE IF (NVAR . G E . 10) GO TO 150 FTVB = F A L S E WRITE ( 6 , 3 5 0 ) READ ( 5 , 3 6 0 ) CONT I F ( . N O T . CONT) GO TO 40 150 CALL OMAT(NH, NG) WRITE ( 7 , 3 7 0 ) STOP 160 WRITE ( 6 , 3 3 0 ) STOP 170 FORMAT ( ' ; ' , ///, 2X, 'ANALYSIS OF COVARIANCE AND SLOPE TEST ' , 1 'WITH YEARS ( ' , 1 3 , ' - ' , 1 3 , ' ) AS THE C O V A R I A T E ' , /, ' + ' , 2 IX , 7 5 ( ' _ ' ) ) 180 FORMAT (/ , 'ENTER THE T I T L E FOR THIS R U N ' , /, ' ( LABEL WILL BE ' , 1 'TRUNCATED TO 75 CHARACTERS )*) 190 FORMAT (20A4) 200 FORMAT (// , 2X, 19A4, /, ' + ' , 1X, 7 6 ( ' _ ' ) ) 202 FORMAT ( ' ERROR: A L L VALUES FOR H E R D ' , 1 4 , ' WERE E Q U I V A L E N T ' ) 205 FORMAT (/ , ' V A R I A B L E # ' , 13) 210 FORMAT (/ , 'ENTER THE VARIABLE N A M E ' , /, ' ( LABEL WILL BE ' , PROGRAM LISTINGS 222 1'TRUNCATED TO 28 CHARACTERS ) ' ) 215 FORMAT (/// , 10X, 'VARIABLE # ' , 14, 6X, 7A4 , /, ' + ' , 28X, 1 2 8 ( * _ ' ) , //) 217 FORMAT (//, 20X, ' G R O U P ' , 14) 219 FORMAT (//, 21X , ' F I N A L - O V E R A L L ' , /) 220 FORMAT ( 'ENTER THE NUMBER OF GROUPS') 230 FORMAT (3110) 240 FORMAT (/ , 'ENTER THE FIRST YEAR AND LAST Y E A R ' ) 250 FORMAT (/, 'ENTER GROUP' , 14, ' LABEL ' , /, 'GROUP N O . , HERDS ' 1'AND T R E A T M E N T ' , /, ' ( LABEL WILL BE TRUNCATED TO 52 CHARACTERS' 1 ' ) ' ) 260 FORMAT (/, 'ENTER THE NUMBER OF HERDS IN THIS GROUP' , /, 1 ' (PUT A " T " AT THE END TO PLOT H E R D S ) ' ) 265 FORMAT (/ , 'ENTER T H E ' , 13, ' HERDS ' ) 280 FORMAT ( 1 1 0 , L1) 290 FORMAT (/ , 10X, ' G R O U P ' , 14, ' TEST OF COMMON S L O P E S ' , /, 12X, 1 ' F - V A L U E ' , F 1 2 . 4 , 7X, ' D F ' , 14, ' ,', 14, 7X, ' P R O B . * , 2 F 1 2 . 5 ) 320 FORMAT (/ , 'ERROR ONLY Y E A R S ' , 14, ' T O ' , 14, ' A V A I L A B L E ' ) 330 FORMAT (/, 'ERROR THERE MUST BE AT LEAST 2 GROUPS') 340 FORMAT (/ , 'ERROR MAXIMUM I S ' , 14, ' MINIMUM I S ' , 14) 350 FORMAT (/ , 'PRESS RETURN FOR ANOTHER VARIABLE OR ENTER " T " ' , 1 ' TO S T O P ' ) 360 FORMAT ( L i ) 370 FORMAT (/, 8X, 'ANALYSIS COMPLETE ' ) END SUBROUTINE DIMVAR (VAR,TWT,VARNAM,HNO,NVX,NTY,NTH) Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * c * * C * T h i s s u b r o u t i n e r e t u r n s an a r r a y o f t h e d e s i r e d y i e l d * C * v a r i a b l e f o r t h e g i v e n h e r d o v e r t h e s p e c i f i e d y e a r s . * C * I t c a n be s i m p l e v a r i a b l e s o r t h e w e i g t e d a v e r a g e of a number * C * of v a r i a b l e s . * C * * Q * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * r * REAL*4 H E R D ( 5 0 ) , S W T ( 5 0 ) , S N ( 1 0 0 ) , V A R ( N T Y , N T H ) , TWT(NTY,NTH) INTEGER* 4 L V d O O ) , L W ( 1 0 0 ) , VARNAM ( 7 , NVX) , C V A R ( 7 ) , 1 HNO(NTH) LOGICAL *1 TRUE/T/ , F A L S E / F / , SMP, CHNG READ (2) VARNAM READ (2) HNO KTV = 1 RETURN C * * C * D e f i n e c a l c u l a t i o n s * C ENTRY INIVAR ( I A Y , NY, CVAR, SMP) IF (TRUE) GO TO 3 10 WRITE ( 6 , 1 3 0 ) READ ( 5 , 1 4 0 ) KTV GO TO ( 3 , 11 , 2 0 ) , KTV 2 WRITE ( 6 , 155) 3 WRITE ( 6 , 1 5 0 ) READ ( 5 , 1 4 0 , E R R = 2 ) LVS WRITE ( 6 , 1 6 0 ) ( V A R N A M ( J , L V S ) , J = 1 , 7 ) READ ( 5 , 1 4 5 ) CHNG PROGRAM LISTINGS 223 IF (CHNG) GO TO 3 DO 5 I = 1 , 7 C V A R ( I ) = V A R N A M ( I , L V S ) 5 CONTINUE SMP = TRUE READ ( 3 ' L V S ) VAR RETURN 11 READ ( 5 , 140) KV I F (KV . G T . 20) GO TO 50 DO 14 I = 1, KV 12 WRITE ( 6 , 1 7 0 ) I READ ( 5 , 1 4 0 ) L V ( I ) , S N ( I ) WRITE ( 6 , 1 8 0 ) ( V A R N A M ( J , L V ( I ) ) , J = 1 , 7 ) READ ( 5 , 1 4 0 ) ICK IF (ICK . N E . 0) GO TO 12 14 CONTINUE SMP = FALSE RETURN 20 READ ( 5 , 140) KV I F (KV . G T . 20) GO TO 50 DO 40 I = 1, KV 30 WRITE ( 6 , 1 7 0 ) I READ ( 5 , 1 4 0 ) L V ( I ) , L W ( I ) , S N ( I ) WRITE ( 6 , 1 8 0 ) ( V A R N A M ( J , L V ( I ) ) , J = 1 , 7 ) , ( V A R N A M ( J , L W ( I ) ) , J = 1 , 7 ) READ ( 5 , 1 4 0 ) ICK IF (ICK . N E . 0) GO TO 30 40 CONTINUE WRITE ( 6 , 1 8 0 ) RETURN 50 WRITE ( 6 , 1 9 0 ) GO TO 10 C * C * C * ENTRY HRDVAR(HERD,NH) I F (KTV . G T . 1) GO TO 80 C * S i m p l e v a r i a b l e 60 DO 70 I = 1, NY H E R D ( I ) = V A R ( I + I A Y , N H ) 70 CONTINUE RETURN C * C a l c u l a t e w e i g h t e d a v e r a g e 80 DO 90 I = 1, NY H E R D ( I ) = 0 . 0 SWT(I) = 0 . 0 90 CONTINUE DO 120 K = 1, NV READ ( 3 ' L V ( K ) ) VAR READ ( 3 ' L W ( K ) ) TWT DO 100 I = 1 , NY WT = TWT(I+IAY ,NH) * SN(K) HERD(I) = HERD(I) + VAR(I+1 AY,NH) * WT SWT(I ) = S W T U ) + WT 100 CONTINUE DO 1 1 0 I = 1 , NY HERD(I) = HERD(I) / SWT(I) 110 CONTINUE 120 CONTINUE 130 FORMAT ('HOW MANY SUMMARY VARIABLES ARE TO BE AVERAGED ? ' , /, 1 'PRESS RETURN FOR ONLY O N E . ' ) 140 FORMAT ( 2 1 1 0 , F 1 0 . 2 ) 145 FORMAT ( L I ) P R O G R A M L I S T I N G S 2 2 4 150 FORMAT ( 'ENTER THE VARIABLE LOCATION NUMBER. ' ) 155 FORMAT ( 'ERROR: DID YOU FORGET A COMMA ? ' ) 160 FORMAT (/ , ' THE VARIABLE I S : ' , 4X, 7A4 , /, 'PRESS RETURN IF O K ' , 1 ' . . . OR ENTER "T" TO R E T R Y . ' ) 170 FORMAT ( 'ENTER THE V A R I A B L E ' , 14 , ' LOCATION N U M B E R , ' , /, 1 ' THE WEIGHT VARIABLE LOCATION N U M B E R , ' , /, 2 ' AND A REAL NUMBER WEIGHTING FACTOR ( O P T I O N A L ) . ' ) 180 FORMAT ( ' T H E VARIABLE IS ' , 7A4 , /, ' THE WEIGHT VARIABLE IS ' , 1 7A4 , /, 'PRESS RETURN IF O K . . . O R ENTER 1 TO R E T R Y . ' ) 190 FORMAT ('ERROR THE MAXIMUM IS 2 0 ' , //) RETURN END SUBROUTINE ANCOUT (TOB, T S S Q , MDF, E 1 D F , E1SSQ, E 2 D F , 1 E2SSQ, E3SSQ, CMN, CMNSE, CB , C B S E , CA , B, BED, 2 AM, AMED, A, I L B L , NO, I T ) REAL *4 B ( 1 0 0 ) , B E D O O O ) , A M ( 1 0 0 ) , A M E D ( l O O ) , A ( 1 0 0 ) , 1 A M S E ( I O O ) , BSE(IOO) REAL *8 T A N ( 2 ) / ' HERD ' , 'GROUP '/ INTEGER *4 TOB, E1DF , MDF, E 2 D F , E3DF , TDF , C R D F / 1 / , 1 I L B L O 0 0 ) TDF = TOB - 1 TMS = TSSQ / TDF BSSQ = E2SSQ - E1SSQ BMS = BSSQ / MDF E1 MS = E1SSQ / E1DF BFV = BMS / E1MS BPB = FPROB ( B F V , MDF, E1DF) AMSSQ = E3SSQ - E2SSQ AMMS = AMSSQ / MDF E2MS = E2SSQ / E2DF AMFV = AMMS / E2MS AMPB = FPROB (AMFV, MDF, E2DF) CRSSQ = TSSQ - E3SSQ CRFV = CRSSQ / E2MS CRPB = FPROB ( CRFV, CRDF, E2DF) C * C * O u t p u t ANCOVA t a b l e and t a b l e of means , s l o p e s a n d i n t e r c e p t s C * WRITE ( 7 , 3 0 0 ) TOB, TDF , T S S Q , MDF, BSSQ, BMS, B F V , BPB , E 1 D F , 1 E1SSQ, E1 MS, MDF, AMSSQ, AMMS, AMFV, AMPB, CRDF, CRSSQ, 2 CRSSQ, CRFV, CRPB, E 2 D F , E2SSQ, E2MS CALL S N K ( B , B S E , BED, E1MS, E 1 D F , I L B L , NO, I T , 2, BPB) CALL SNK(AM, AMSE, AMED, E2MS, E 2 D F , I L B L , NO, I T , 1, AMPB) WRITE ( 7 , 3 1 0 ) T A N ( I T ) , CMN, CMNSE, C B , C B S E , C A , ( I L B L ( I ) , A M ( I ) , 1 A M S E ( I ) , B ( I ) , B S E ( I ) , A ( I ) , 1=1,NO) RETURN 300 FORMAT (15X, 'ANALYSIS OF COVARIANCE ( ' , 14, ' OBSERVATIONS) ' 1 , //, 7X, ' S O U R C E ' , 5X, ' D F ' , 6X, 'SUM S Q ' , 5X, 'MEAN S Q ' , 2 5X, ' F - V A L U E ' , 7X, ' P R O B ' , //, 9X, ' T O T A L * , 16, * 2X, G 1 3 . 5 , /, 8X, ' S L O P E S ' , 16, 2X, G 1 3 . 5 , 3 G 1 2.4, G 1 2.4, G i l . 3 , / , 7X , 'ERROR 1 ' , 16, 2X , G 1 3 . 5 , 4 G 1 2 . 4 , /, 9X, ' M E A N S ' , 16, 2X, G 1 3 . 5 , G 1 2.4, G 1 2.4, G 1 1 . 3 , 5 /, 2X, 'COMMON S L O P E ' , 16, 2X, G 1 3 . 5 , G 1 2 . 4 , G12.4, G 1 1 . 3 , P R O G R A M L I S T I N G S 225 6 /, 7X, 'ERROR 2 ' , 1 6 , 2X, G 1 3 . 5 , G 1 2 . 4 ) 310 FORMAT (//, 2X, A 8 , 5X, ' M E A N ' , 6X, ' S . E . ' , 8X, ' S L O P E ' , 1 6X, ' S . E . ' , 5X, ' I N T E R C E P T * , /, 1X, 'COMMON', F 1 2 . 3 , 2 F 1 0 . 3 , F 1 3 . 3 , F 1 0 . 3 , F 1 4 . 3 , 1 0 ( / , 1 X , I 5 , F 1 3 . 3 , F 1 0 . 3 , F 1 3 . 3 , 3 F 1 0 . 3 , F 1 4 . 3 ) ) END SUBROUTINE SNK(AMN, S E , SED, SEMS, NDF, L B L , NS, J S , MS, PR) C C C C C C C C C C ***** * * * * T h i s s u b r o u t i n e c o m p l e t e s t h e c a l c u l a t i o n o f t h e s t a n d a r d e r r o r s , c a n o u t p u t t h e v a l u e s and s t a n d a r d e r r o r s and d o e s a s t u d e n t s kneuman k u e l s t e s t i f s i g n i f i c a n t d i f f e r e n c e s and more t h a n two v a l u e s . * * REAL*4 S E ( N S ) , S E D ( N S ) , AMN(NS) , A M N L B ( 2 , 1 0 0 ) , RNG(100) INTEGER*4 L B L ( N S ) , L S E T ( 1 0 0 ) , N L B L ( l O O ) REAL*8 QUAT(3) /' 1 ' MEAN ' LOGICAL* ! SIG HERD ' , ' GROUP ' SLOPE ' / COMMON ' / , PARM(2) / DO 10 I = 1, NS S E ( I ) = S Q R T ( S E M S / S E D ( I ) ) 10 CONTINUE 20 IF (PR . G T . . 0 5 .OR. NS . L T . 3) RETURN IF (NS . G T . 20) GO TO 130 WRITE ( 7 , 1 7 0 ) Q U A T ( J S ) , PARM(MS) CALL FINDRG(RNG, NS - 1, NDF) DO 30 I = 1, NS AMNLB(1,1) = AMN(I) AMNLB(2,1) = I 30 CONTINUE CALL I SORT(AMNLB, 2, 100, 1, NS, 1, 3, 0) L S E T ( N S ) = NS NI = NS - 1 NSET = 0 L L S = 0 DO 90 I = 1 , NI IC = MAX0 (1+1, L L S ) IRV = IC + NS DO 50 J = I C , NS JC = IRV - J CALL SIGCHK(RNG(JC - I ) , A M N L B ( 1,1), A M N L B ( 1 , J C ) , SEMS, 1 S E D ( I N T ( A M N L B ( 2 , 1 ) ) ) , S E D ( I N T ( A M N L B ( 2 , J C ) ) ) , SIG) IF ( .NOT . SIG) GO TO 60 50 CONTINUE L S E T ( I ) = I L I S = I GO TO 70 60 L S E T ( I ) = JC L I S = JC 70 IF ( L I S . G T . L L S ) NSET = NSET + 1 L L S = L I S 90 CONTINUE IF ( L S E T ( N I ) . L T . NS) NSET = NSET + 1 100 WRITE ( 7 , 1 8 0 ) NSET P R O G R A M L I S T I N G S 2 2 6 L I D = 1 DO 120 I = 1, NS I F ( L S E T ( I ) . L T . L ID) GO TO 120 I L = L S E T ( I ) N = 0 DO 115 J = L I D , I L N = N + 1 NLBL(N) = L B L ( I N T ( A M N L B ( 2 , J ) ) ) 115 CONTINUE L I D = I L + 1 CALL PRTLN (NLBL , N) 120 CONTINUE RETURN 130 WRITE ( 6 , 2 0 0 ) 140 FORMAT (/, 6X, A 8 , 20112) 150 FORMAT (5X, A 8 , 1X, 2 0 F 1 2 . 3 ) 160 FORMAT (6X, ' S . E . ' , 2 0 F 1 2 . 3 ) 170 FORMAT (/, ' STUDENT NEWMAN KUELS TEST - ' , 2A8 , ' ' ' S ' , /) 180 FORMAT (/ , 3X, 'THERE A R E ' , 1 5 , ' HOMOGENOUS S U B S E T S ' , /) 200 FORMAT ('MORE THAN 20 SO NO MULTIPLE RANGE T E S T ' ) RETURN END SUBROUTINE PRTLN (LARR, ND) DIMENSION LARR(ND) WRITE ( 7 , 10) LARR RETURN 10 FORMAT (3X, ' ( ' , 1 6 ( 1 4 , ' , ' ) ) END SUBROUTINE FINDRG(RNG, N, NDF) C * C * f o r N<20 C * REAL*4 RNG(N) , STUD(35) INTEGER *4 M D F ( 6 ) / 2 0 , 2 4 , 3 0 , 4 0 , 6 0 , 1 2 0 / WRITE ( 7 , 4 0 ) NDF IF (NDF . G T . 20 .AND. NDF . L E . 120) GO TO 10 READ ( 1 ' NDF) RNG WRITE ( 7 , 5 0 ) RNG RETURN 10 LN = 1 20 LN = LN + 1 I F (MDF(LN) . L T . NDF) GO TO 20 IHDF = MDF(LN) ILDF = MDF (LN - 1 ) DIF = IHDF - ILDF DIL = NDF - I LDF DFR = D I L / DIF READ ( 1 ' I LDF) RNG READ ( 1 ' I H D F ) STUD DO 30 I = 1, N RNG(I) = RNG(I) - DFR * (RNG(I) - S T U D ( I ) ) 30 CONTINUE WRITE ( 7 , 5 0 ) RNG 40 FORMAT (3X , 'RANGES FOR ALPHA=0.05 A N D ' , 14 , ' D F ' ) 50 FORMAT (1X , 8 F 1 0 . 4 ) RETURN PROGRAM LISTINGS 227 END 10 SUBROUTINE SIGCHK(Q, V L 1 , VL2 , SMS, LOGICAL*1 TRUE / T / , F A L S E / F / , SIG SIG = F A L S E TS = SQRT(SMS) DS = SQRT((DI + CRIT = Q * TS * DIF = VL2 - VL1 I F (DIF . G T . CRIT) SIG = TRUE IF (DIF . L T . 0 . ) WRITE ( 6 , 10) RETURN FORMAT ( END D I , D2 , SIG) D 2 ) / ( 2 * D 1 * D 2 ) ) DS PROBLEMS WITH STUDENT KNEWMAN KEULS T E S T ' ) 1 0 1 5 1 7 20 30 50 60 SUBROUTINE IARAY ( IAR , HNO, I S , INTEGER *4 I A R ( I S ) , HNO(MAX) READ ( 5 , 50) IAR DO 20 I = 1, IS DO 15 J = 1, MAX I F ( I A R ( I ) . E Q . H N O ( J ) ) GO TO CONTINUE GO TO 30 I A R ( I ) = J CONTINUE RETURN WRITE ( 6 , 60) I , I A R ( I ) GO TO 10 FORMAT (1018) FORMAT (/, ' THE MAX) 1 7 1 'RE-ENTER THE L I N E ' ) 1 4 , ' TH H E R D ' , 1 4 , ' DOES NOT E X I S T " , /, END SUBROUTINE S L I N E ( X , T Y , B, A , N, L I N ) Q ********************************************* C * T h i s s u b r o u t i n e p l o t s and l a b e l s a r e g r e s s i o n l i n e and r e t u r n s C * e x t r e m e Y ' s f o r f i n a l g r a p h s c a l e . * DIMENSION X ( 2 ) , Y ( 2 ) , T Y ( 2 ) LOGICAL *1 L I N C C** STATEMENT FUNCTION C YV(XV) = A + XV * B C * Y ( 1 ) = Y V ( X ( 1 ) ) Y ( 2 ) = Y V ( X ( 2 ) ) T Y ( 1 ) = A M I N 1 ( T Y ( 1 ) , Y ( 1 ) , Y ( 2 ) ) T Y ( 2 ) = A M A X 1 ( T Y ( 2 ) , Y ( 2 ) , Y ( 1 ) ) IF ( . N O T . L I N ) RETURN NSG = N + 240 CALL A L G R A F ( X ( 1 ) , Y ( 1 ) , - 1 , -NSG) CALL A L G R A F ( X ( 2 ) , Y ( 2 ) , - 1 , -NSG) RETURN P R O G R A M L I S T I N G S 228 c c c c c c c c c c c c CX = ( X ( 2 ) - X ( 1 ) ) / 5 0 . GX = X ( 2 ) GY = YV(GX) CALL ALGRAF(GX, GY, - 1 , -NSG) IF (NSG . E Q . 195) RETURN GX = GX - 2. * CX GY = YV(GX) CALL ALGRAF(GX, GY, - 1 , - 2 1 5 ) GX = GX - CX GY = YV(GX) CALL ALGRAF(GX, GY, - 1 , - 1 9 9 ) RETURN END SUBROUTINE SMAT(COV, NY) REAL*4 O U T ( 1 0 0 0 , 1 0 ) , C O V ( N Y ) , YLD(50) INTEGER*4 NVC / 0 / , IC NHG(10) NAY = NY - 1 RETURN ENTRY DMAT (YLD, NVR) IF (NVC . N E . NVR) IC = 1 NVC = NVR LC = IC + NAY N = 0 DO 10 I = I C , LC N = N + 1 O U T ( I , N V C ) = YLD(N) 10 CONTINUE IC = LC + 1 RETURN ENTRY OMAT(NHG,NG) IY = 0 DO 40 I = 1, NG NH = NHG(I) DO 30 J = 1 , NH DO 20 K = 1, NY IY = IY + 1 WRITE ( 8 , 5 0 ) I , C O V ( K ) , ( O U T ( I Y , I V ) , I V = 1 , N V C ) 20 CONTINUE 30 CONTINUE 40 CONTINUE 50 FORMAT ( 1 4 , 2 0 F 1 2 . 4 ) C * C * RETURN END

Cite

Citation Scheme:

    

Usage Statistics

Country Views Downloads
China 22 0
United States 6 0
France 4 0
Philippines 4 0
Portugal 3 0
Japan 3 0
Canada 2 0
Peru 2 0
United Kingdom 1 0
Kenya 1 0
City Views Downloads
Beijing 22 0
Unknown 12 3
Tokyo 3 0
Lisbon 3 0
Ashburn 3 0
Halifax 2 0
Lima 2 0
Nairobi 1 0

{[{ mDataHeader[type] }]} {[{ month[type] }]} {[{ tData[type] }]}

Share

Share to:

Comment

Related Items