Morocco has a coast by the Atlantic Ocean that reaches past the Strait of Gibraltar into the Mediterranean Sea. It is bordered by Spain to the north (a water border through the Strait and land borders with three small Spanish-controlled exclaves, Ceuta, Melilla, and Peñón de Vélez de la Gomera), Algeria to the east, and Western Sahara to the south. Since Morocco controls most of Western Sahara, its de facto southern boundary is with Mauritania.
The internationally recognised borders of the country lie between latitudes 27° and 36°N, and longitudes 1° and 14°W. Adding Western Sahara, Morocco lies mostly between 21° and 36°N, and 1° and 17°W (the Ras Nouadhibou peninsula is slightly south of 21° and west of 17°).
The geography of Morocco spans from the Atlantic Ocean, to mountainous areas, to the Sahara desert. Morocco is a Northern African country, bordering the North Atlantic Ocean and the Mediterranean Sea, between Algeria and the annexed Western Sahara. It is one of only three nations (along with Spain and France) to have both Atlantic and Mediterranean coastlines.
A large part of Morocco is mountainous. The Atlas Mountains are located mainly in the centre and the south of the country. The Rif Mountains are located in the north of the country. Both ranges are mainly inhabited by the Berber people. At 446,550 km2 (172,414 sq mi), Morocco is the fifty-seventh largest country in the world. Algeria borders Morocco to the east and southeast, though the border between the two countries has been closed since 1994.
Spanish territory in North Africa neighbouring Morocco comprises five enclaves on the Mediterranean coast: Ceuta, Melilla, Peñón de Vélez de la Gomera, Peñón de Alhucemas, the Chafarinas islands, and the disputed islet Perejil. Off the Atlantic coast the Canary Islands belong to Spain, whereas Madeira to the north is Portuguese. To the north, Morocco is bordered by the Strait of Gibraltar, where international shipping has unimpeded transit passage between the Atlantic and Mediterranean.
The Rif mountains stretch over the region bordering the Mediterranean from the north-west to the north-east. The Atlas Mountains run down the backbone of the country, from the northeast to the south west. Most of the southeast portion of the country is in the Sahara Desert and as such is generally sparsely populated and unproductive economically. Most of the population lives to the north of these mountains, while to the south lies the Western Sahara, a former Spanish colony that was annexed by Morocco in 1975 (see Green March). Morocco claims that the Western Sahara is part of its territory and refers to that as its Southern Provinces.
Morocco's capital city is Rabat; its largest city is its main port, Casablanca. Other cities recording a population over 500,000 in the 2014 Moroccan census are Fes, Marrakesh, Meknes, Salé and Tangier.
Morocco is represented in the ISO 3166-1 alpha-2 geographical encoding standard by the symbol MA. This code was used as the basis for Morocco's internet domain, .ma.
The country's Mediterranean climate is similar to that of southern California, with lush forests in the northern and central mountain ranges of the country, giving way to drier conditions and inland deserts further southeast. The Moroccan coastal plains experience remarkably moderate temperatures even in summer, owing to the effect of the cold Canary Current off its Atlantic coast.
In the Rif, Middle and High Atlas Mountains, there exist several different types of climates: Mediterranean along the coastal lowlands, giving way to a humid temperate climate at higher elevations with sufficient moisture to allow for the growth of different species of oaks, moss carpets, junipers, and Atlantic fir which is a royal conifer tree endemic to Morocco. In the valleys, fertile soils and high precipitation allow for the growth of thick and lush forests. Cloud forests can be found in the west of the Rif Mountains and Middle Atlas Mountains. At higher elevations, the climate becomes alpine in character, and can sustain ski resorts.
Southeast of the Atlas mountains, near the Algerian borders, the climate becomes very dry, with long and hot summers. Extreme heat and low moisture levels are especially pronounced in the lowland regions east of the Atlas range due to the rain shadow effect of the mountain system. The southeastern-most portions of Morocco are very hot, and include portions of the Sahara Desert, where vast swathes of sand dunes and rocky plains are dotted with lush oases.
In contrast to the Sahara region in the south, coastal plains are fertile in the central and northern regions of the country, and comprise the backbone of the country's agriculture, in which 95% of the population live. The direct exposure to the North Atlantic Ocean, the proximity to mainland Europe and the long stretched Rif and Atlas mountains are the factors of the rather European-like climate in the northern half of the country. That makes from Morocco a country of contrasts. Forested areas cover about 12% of the country while arable land accounts for 18%. Approximately 5% of Moroccan land is irrigated for agricultural use.
In general, apart from the southeast regions (pre-Saharan and desert areas), Morocco's climate and geography are very similar to the Iberian peninsula. Thus we have the following climate zones:
- Mediterranean: It dominates the coastal Mediterranean regions of the country, along the (500 km strip), and some parts of the Atlantic coast. Summers are hot to moderately hot and dry, average highs are between 29 °C (84.2 °F) and 32 °C (89.6 °F). Winters are generally mild and wet, daily average temperatures hover around 9 °C (48.2 °F) to 11 °C (51.8 °F), and average low are around 5 °C (41.0 °F) to 8 °C (46.4 °F), typical to the coastal areas of the west Mediterranean. Annual Precipitation in this area vary from 600–800 mm in the west to 350–500 mm in the east. Notable cities that fall into this zone are Tangier, Tetouan, Al Hoceima, Nador and Safi.
- Sub-Mediterranean: It influences cities that show Mediterranean characteristics, but remain fairly influenced by other climates owing to their either relative elevation, or direct exposure to the North Atlantic Ocean. We thus have two main influencing climates:
- Oceanic: Determined by the cooler summers, where highs are around 27 °C (80.6 °F) and in terms of the Essaouira region, are almost always around 21 °C (69.8 °F). The medium daily temperatures can get as low as 19 °C (66.2 °F), while winters are chilly to mild and wet. Annual precipitation varies from 400 to 700 mm. Notable cities that fall into this zone are Rabat, Casablanca, Kénitra, Salé and Essaouira.
- Continental: Determined by the bigger gap between highs and lows, that results in hotter summers and colder winters, than found in typical Mediterranean zones. In summer, daily highs can get as high as 40 °C (104.0 °F) during heat waves, but usually are between 32 °C (89.6 °F) and 36 °C (96.8 °F). However, temperatures drop as the sun sets. Night temperatures usually fall below 20 °C (68.0 °F), and sometimes as low as 10 °C (50.0 °F) in mid-summer. Winters are cooler, and can get below the freezing point multiple times between December and February. Also, snow can fall occasionally. Fès for example registered −8 °C (17.6 °F) in winter 2005. Annual precipitation varies between 500 and 900 mm. Notable cities are Fès, Meknès, Chefchaouen, Beni-Mellal and Taza.
- Continental: This type of climate dominates the mountainous regions of the north and central parts of the country, where summers are hot to very hot, with highs between 32 °C (89.6 °F) and 36 °C (96.8 °F). Winters on the other hand are cold, and lows usually go beyond the freezing point. And when cold damp air comes to Morocco from the northwest, for a few days, temperatures sometimes get below −5 °C (23.0 °F). It often snows abundantly in this part of the country. Precipitation varies between 400 and 800 mm. Notable cities are Khenifra, Imilchil, Midelt and Azilal.
- Alpine: This type of climate is found in some parts of the Middle Atlas Mountain range and the eastern part of the High Atlas Mountain range. Summers are very warm to moderately hot, and winters are longer, cold and snowy. Precipitation varies between 400 and 1200 mm. In summer highs barely go above 30 °C (86.0 °F), and lows are cool and average below 15 °C (59.0 °F). In winters, highs average around 8 °C (46.4 °F), and lows go well below the freezing point. In this part of country, there are many ski resorts, such as Oukaimeden and Mischliefen. Notable cities are Ifrane, Azrou and Boulmane.
- Semi-arid: This type of climate is found in the south of the country and some parts of the east of the country, where rainfall is lower and annual precipitations are between 200 and 350 mm. However, One usually finds Mediterranean characteristics in those regions, such as the precipitation pattern and thermal attributes. Notable cities are Agadir, Marrakesh and Oujda.
South of Agadir and east of Jerada near the Algerian borders, arid and desert climate starts to prevail.
Note: Due to Morocco's proximity to the Sahara desert and the North Sea of the Atlantic Ocean, two phenomena occur to influence the regional seasonal temperatures, either by raising temperatures by 7–8 degrees Celsius when sirocco blows from the east creating heatwaves, or by lowering temperatures by 7–8 degrees Celsius when cold damp air blows from the northwest, creating a coldwave or cold spell. However, these phenomena don't last for more than 2 to 5 days on average.
Countries or regions that share the same climatic characteristics with Morocco are California (USA), Portugal, Spain and Algeria.
Annual rainfall in Morocco is different according to regions. The northwestern parts of the country receive between 500 mm and 1200 mm, while the northeastern parts receive between 350 and 600 mm. North Central Morocco receives between 700 mm and up to 3500 mm. The area from Casablanca to Essaouira, on the Atlantic coast, receives between 300 mm and 500 mm. The regions from Essaouira to Agadir receive between 250 mm and 400 mm. Marrakesh region in the central south receives only 250 mm a year. The southeastern regions, basically the driest areas, receive between 100 mm and 200 mm only, and consist basically of arid and desert lands.
Botanically speaking, Morocco enjoys a great variety of vegetation, from lush large forests of conifer and oak trees typical of the western Mediterranean countries (Morocco, Algeria, Italy, Spain, France and Portugal), to shrubs and acacias further south. This is due to the diversity of climate and the precipitation patterns in the country.
Morocco's weather is one of the most pristine in terms of the four-season experience. Most regions have distinct seasons where summer is usually not spoiled by rain and winter turns wet, snowy and humid with mild, cool to cold temperatures, while spring and fall see warm to mild weather characterised by flowers blooming in spring and falling leaves in autumn. This type of weather has affected the Moroccan culture and behaviour and played a part in the social interaction of the population, like many other countries that fall into this type of climate zone.
Morocco has a wide range of biodiversity. It is part of the Mediterranean basin, an area with exceptional concentrations of endemic species undergoing rapid rates of habitat loss, and is therefore considered to be a hotspot for conservation priority. Avifauna are notably variant. The avifauna of Morocco includes a total of 454 species, five of which have been introduced by humans, and 156 are rarely or accidentally seen.
The Barbary lion, hunted to extinction in the wild, was a subspecies native to Morocco and is a national emblem. The last Barbary lion in the wild was shot in the Atlas Mountains in 1922. The other two primary predators of northern Africa, the Atlas bear and Barbary leopard, are now extinct and critically endangered, respectively. Relict populations of the West African crocodile persisted in the Draa river until the 20th century.
The Barbary macaque, a primate endemic to Morocco and Algeria, is also facing extinction due to offtake for trade human interruption, urbanisation, wood and real estate expansion that diminish forested area – the macaque's habitat.
Trade of animals and plants for food, pets, medicinal purposes, souvenirs and photo props is common across Morocco, despite laws making much of it illegal. This trade is unregulated and causing unknown reductions of wild populations of native Moroccan wildlife. Because of the proximity of northern Morocco to Europe, species such as cacti, tortoises, mammal skins, and high-value birds (falcons and bustards) are harvested in various parts of the country and exported in appreciable quantities, with especially large volumes of eel harvested – 60 tons exported to the Far East in the period 2009‒2011.