Fortran

Guide To Learn

As I said earlier, we’re looking to parse weather data to identify the city with the most pleasant climate (average weather). What is the most pleasant climate? The answer will likely vary depending on who you ask, but for me, that means

  1. Highest average temperature –I prefer to avoid cold winters if possible. Of course, high average temperatures would also come from hot summers, which can be unpleasant for many. However, it’s a trade I’m willing to make.
  2. Lowest average humidity –I like it warm but don’t like to sweat profusely. Warm and dry weather is my favorite for spending time outdoors.
  3. Highest average wind –The more wind on average, the better ventilated the area, which reduces the chance of stagnant and polluted air. Large cities with weaker winds on average are known for higher occurrences of smog (a term coined by blending smoke and fog).
  4. Clear days –The more the better.

To be fair, these are quite crude and arbitrary criteria, but they will do for the sake of this exercise. For each city, we’ll calculate the score for each of the four variables: temperature (the higher the better), humidity (the lower the better), wind speed (the higher the better), and the clear sky frequency (the higher the better). The total score is simply an arithmetic average of the four specific scores. I’ll defer the interpretation of these scores to the end of the exercise later in this chapter. At the end, we’ll end up with a neat little score table like this, showing the results of our final weather averaging program:

City | Temp. | Humidity | Wind  | Clear | Total
Code | Score | Score    | Score | Score | Score
-----+-------+----------+-------+-------+------
EGLL   0.02     0.04     1.00     0.97     0.51
LAX    0.45     0.14     0.72     1.00     0.58
LYBE   0.15     0.13     0.80     0.05     0.28
MIA    1.00     0.00     0.77     0.86     0.66
MMMX   0.41     0.57     0.68     0.47     0.53
NYC    0.10     0.13     0.00     0.41     0.16
OIII   0.55     1.00     0.63     0.41     0.65
SEA    0.00     0.10     0.86     0.58     0.39
SKBO   0.14     0.01     0.50     0.00     0.16
ZGSZ   0.90     0.03     0.80     0.27     0.50

The city code is the unique international code for each weather station. The cities are London, United Kingdom (EGLL); Los Angeles, California (LAX); Belgrade, Serbia (LYBE); Miami, Florida (MIA); Mexico City, Mexico (MMMX); New York City, New York (NYC); Tehran, Iran (OIII); Seattle, Washington (SEA); Bogota, Colombia (SKBO); and Shenzhen, China (ZGSZ). I chose these ten locations for this exercise; however, if you want, you can follow the direction from the previous subsection and download data for your location, or as many other locations as you want.

Objectives

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top