Construction of Friant Dam, the main dam on the San Joaquin River, began in 1937 and was completed in 1942. The dam serves for irrigation and flood control storage, but its main purpose is to divert water into the Madera Canal, which runs northwest along the San Joaquin Valley to the Chowchilla River, and the Friant-Kern Canal, which carries San Joaquin water all the way south into the Tulare Basin, terminating at the Kern River. Both are irrigation and municipal supply canals serving primarily agricultural interests. Water from the Friant Dam supplies almost of farmland in Fresno, Kern, Madera, and Tulare counties. The diversion of water off the San Joaquin at Friant Dam leaves little more than a trickle below the dam in most years, except for releases serving farms in the immediate area downstream of Friant.