Introduction. Precipitation, temperature, radiation, and relative humidity vary according to height, this causes the presence of microclimates that affect the productivity of the animals. Objective. Associate the climatic conditions present in the productive systems with dairy production of a pure Jersey herd in two altitudinal floors of the province of Cartago, Costa Rica. Materials and methods. In retrospect, during the year 2016, the productive information of two dairy farms, located at 660 and 1800 m.a.s.l. was evaluated. From the first farm, the records of 61 animals in a twelve-year period (12,083 data) were analyzed; while in the second, the lactations of 387 animals in a five-year period (13,820 records) were analyzed. Observations included: identification of the cow, day of generation of the record, month, year, daily milk production, lactation days, calving number, animal age, temperature, precipitation, solar radiation and average relative humidity. Results. The lactation days, the lactation number (3-5), the age of the animal (3.7 to 5.8 years), and the calving number affected the daily milk production on both farms (p<0.001). At 1800 m, when the precipitation was greater than 5 but less than or equal to 10 mm day-1 and the relative humidity greater than 80 but less than 90 % day-1 (p<0.001), milk production decreased. On the other hand, at 660 m the effect came from relative humidity less than or equal to 70 %. The environmental temperature had a significant effect in both altitudes. Conclusion. The conditions of temperature, humidity, precipitation, and radiation in each ecosystem, generated differences in the productivity of the animals, related to the type of forages and the thermal sensation to which the cattle was exposed, which caused heat or cold stress.

Keywords: Bos taurus, microclimate, heat stress, humidity and temperature index, lactation curve