The GMD SD40-2F was a 3,000 horsepower (2,200 kW) C-C diesel locomotive built by General Motors Diesel. It was fundamentally an SD40-2 in a cowl unit full-width body. A total of 25 units were built solely for the Canadian Pacific Railway. They were delivered in 1988 and 1989, after the end of production for the regular SD40-2. The engines were CP's only cowl units, and have been nicknamed "Red Barns" by railfans.
The locomotives are numbered 9000-9024. These were the only new locomotives to be delivered to the CPR in the "Action Red" paint scheme, a variation upon the "Multimark" paint scheme lacking the black-and-white emblem. Two engines, numbers 9000 and 9022, have been repainted in the "Dual Flags" paint scheme. They were delivered without the porthole in the nose door; this was retrofitted to most units in the early 1990s.
On December 13, 2012, CP retired SD40-2F 9000, 9002, 9005, 9010, 9016, 9018, 9019, 9022, and 9024. The 9000 and 9018 (along with the 9001) had been involved in a June 9, 2009 derailment in Oshawa, Ontario, on CP's Belleville Sub.
In mid to late 2016, CP retired all of the remaining units.
In 2015, the Central Maine and Quebec Railway acquired 10 of these engines from CP. The new start up railway purchased the 9004, 9010, 9011, 9014, 9017, 9020, 9021, 9022, 9023, and the 9024. All were repainted within two years into CMQ's silver and light blue livery except for 9017, which was repainted into the black, red, and gray paint scheme of the Bangor & Aroostook Railroad in recognition of the heritage of some of CMQ's trackage in Maine. The Central Maine and Quebec Railway would later acquire these units after the MMA ceased operations.
Unit 9015 slammed into a crude oil truck and was burnt. The unit was rebuilt shortly after.