Skip to main content
ARS Home » Northeast Area » Beltsville, Maryland (BARC) » Beltsville Agricultural Research Center » Animal Genomics and Improvement Laboratory » AGIL_Software » MTDFREML » Obtaining_MTDFREML

Obtaining_MTDFREML
headline bar

Obtaining the MTDFREML Programs

The MTDFREML programs and supporting files can be downloaded here.
MTDFREML is written in standard Fortran 77. The distribution file includes three files mtdfnrm.for, mtdfprep.for, and mtdfrun.for that will become executable files when compiled and linked with various subroutines. The files containing subroutines include mstime.for, mtdfsub.for, mtdflik.for, spars4.for, and spars4a.for. The spars4.for code uses a number of non-standard syntax that, depending on the Fortran compiler used, may trigger warning messages. These warnings can usually be ignored.
The file PARAM.DAT is a special file that is included in the mtdflik.for, mtdfprep.for, and mtdfrun.for when those programs are compiled. The contents of the PARAM.DAT file define parameters and variables that set maximums for number of traits, fixed factors, animals in pedigree, number of random factors, and vector lengths, etc. It can be changed to match a data set and memory available on your computer.  If PARAM.DAT is changed, then mtdflik.for, mtdfprep.for, and mtdfrun.for must be recompiled.
The mstime.for file contains system and compiler dependent timing routines. They are currently configured using the Gnu Fortran compiler (G95) routines. The G95 compiler seems to work well with the MTDFREML code. This compiler can be obtained at https://www.g95.org/downloads.shtml
Finally, two batch (.bat) files are included. The setup.bat file will recompile all of the programs. The compile.bat file recompiles all of the programs dependent on settings in PARAM.DAT. Note that settings for the number of animals may need to be set in mtdfnrm.for in addition to in PARAM.DAT.
To make the programs accessible to as many users as possible, windows executables are available here