Skip to main content
ARS Home » Northeast Area » Beltsville, Maryland (BARC) » Beltsville Agricultural Research Center » Animal Genomics and Improvement Laboratory » AIP » Software » FACTORS

newfactors.f90 Apply new factors for age, parity, season, and previous days open to compare cows more fairly within herds

DOWNLOAD Programs, example files, and executable (this program is combined with bestpred and can be downloaded from BESTPRED)

INPUT ageparityfactors1 from Jana Hutchison's ageparityfactors.sas as input for aiplage2.c
SeasonFactors2023.txt from Paul VanRaden's agefactor.sas as input for aiplage2.c
PrevDOfactorsHO from Paul VanRaden's maindcr.f90 as input for aiplage2.c
ClimateRegions defined by Asha Miles as input for aiplage2.c
aiplage.h arrays used by the old aiplage.c (1994)
examples.yld.oldME mature equivalent milk, fat, and protein examples using the 1994 factors
The above input files should be in the same directory where newfactors.f90 will be run.

FORMAT of examples.yld.oldME (input), examples.yld.actual (output), and examples.yld.newadj (output):
Animalkey State Age Freshyear Parity Breed Freshmonth Milk Fat Protein
  89606611 93 1 2020 1 5 11 18685. 1047. 731.
  89998174 93 1 2020 1 5 10 19745.   849. 732.
  92150366 93 2 2020 1 5 12 20338.   949. 687.
  15653856 11 3 1990 1 4 12 17780.   630. 554.
    5412866 11 2 1990 1 3   8   9120.   385. 304.
    5412865 11 1 1990 2 3   6 15049.   601. 490.
  33550309 11 1 1990 3 5 12 13793.   662. 473.

OUTPUT outputs from newfactors.f90 examples.yld.actual
examples.yld.newadj

MAKEFILE AND PROGRAM DOWNLOADS makefile makefile - is used to compile aiplage2.c, aiplage.c, and newfactors.f90. Put makefile, aiplage2.c, aiplage.c, aiplage.h, and newfactors.f90 into the same directory. Type 'make' and hit return.
make <return>
The compile generates aiplage2.o, aiplage.o, and a newfactors executable.
New C function - 2023 aiplage2.c - Obtain age, season, previous days open adjustments agebase = 0 adjusts to mature equivalent. agebase = 36 adjusts to 36 month equivalent. Factors differ by breed, region, and time period. Removes age, season, and regional climate biases. Reads four input files instead of using arrays from aiplage.h like aiplage.c does. Standardizes 305-day yields by multiplying milk, fat, and protein by updated milk, fat, and protein age factors. Adjusting for the nongenetic advantages and disadvantages for each cow or bull improves the genetic selection process for the best dairy animals.
Old C function - 1994 aiplage.c - Obtain age, season, previous days open adjustments agebase = 0 adjusts to mature equivalent. agebase = 36 adjusts to 36 month equivalent. Factors differ by breed, region, and time period. Standardizes 305-day yields by multiplying milk, fat, and protein by milk, fat, and protein age factors.
Fortran calling program newfactors.f90 - Season de-adjust using aiplage.c. Then season new adjust using aiplage2.c. Milk, fat, and protein are divided by the old milk, fat, and protein age factors from aiplage.c. Next, they are multiplied by the new milk, fat, and protein age factors from aiplage2.c.
  Program newfactors.f90 converts previous ME milk, fat, and protein to actual yields by dividing by the previous 1994 age factors:
ActualMilk_4F = Milk_4F / agefactor(1)
ActualFat_4F = Fat_4F / agefactor(2)
ActualPro_4F = Pro_4F / agefactor(3)
  Program newfactors.f90 also outputs 36-month equivalent milk, fat, and protein
after dividing by the previous age factors and multiplying by the new age factors:
Milk_4F = (Milk_4F / agefactor(1)) * agefac(1)
Fat_4F = (Fat_4F / agefactor(2)) * agefac(2)
Pro_4F = (Pro_4F / agefactor(3)) * agefac(3)
  Output file examples.yld.actual has actual milk, fat, and protein.
Output file examples.yld.newadj has 36-month equivalent milk, fat, and protein.
Both files have records for all breeds and regions but fresh years of either 2020 or 1990.
Records from before 1990 were converted from ME to 36-month equivalent were re-adjusted simply by multiplying by the ratio of 36-month to ME yield for each breed from the 1990 factors.
  To run the newfactors.f90 executable, type 'newfactors' and hit return:
newfactors <return>

REFERENCES (Original projects - 1994 and 1995) Mike Schutz - post doctoral genetic scientist (1994) https://www.researchgate.net/publication/265195434_Age-Season_Standardization
Duane Norman et al. (1995) Age and seasonal effects on Holstein yield for four regions of the United States over time. https://doi.org/10.3168/jds.S0022-0302(95)76810-2
George Wiggans (1994) wrote the original aiplage.c subroutine.

LICENSE This software is public domain and was developed with U.S. taxpayer funding. Accurate results are not guaranteed. Please report any bugs to gary.fok@usda.gov. You may modify, improve, use, and redistribute the code to anyone for any purpose. Or, you can ask Gary to make changes that could benefit U.S. evaluations and other users.

Project team members- 2023
Paul VanRaden (Research Geneticist)
Asha Miles (Research Geneticist)
Jana Hutchison (Animal Scientist)
Gary Fok (Programmer)