Lab 3 - USNA

SO 254
Name_________________________
Spring 2017
SO254 Lab 3
Upper-air observations and analysis
Objectives:
- Become familiar with web sites that provide gridded upper-air observations
- Write MATLAB code to analyze temperature and height at different vertical levels
- Identify important features on the objectively analyzed upper-air map (i.e., troughs,
ridges, low-level fronts)
- Interpret the objective analysis (written paragraphs) describing the country’s weather
Introduction to reanalyses
One of the most important repositories for weather data is the reanalysis. Atmospheric reanalyses
have been produced periodically, with a ground-breaking product developed by NOAA in 1996
that has been cited over 22000 times (per Google Scholar). An analysis is a detailed
representation of the state of the atmosphere based on observations (satellite, radar, upper-air,
surface, buoy, aircraft, etc). Analyses are often gridded in both the horizontal and vertical, with
the spacing between grid points getting better over time (in 1996, 2.5° x 2.5° latitude-longitude
spacing was standard; now it is 0.5° x 0.5°). A reanalysis is similar to an analysis, with two key
differences: first, a reanalysis is not real-time. That means that a radiosonde intended for a 1200
UTC analysis that was launched a few minutes late, and thus wasn’t available for the analysis at
1200 UTC, can be included in the reanalysis after-the-fact. Second, a reanalysis includes output
from a numerical weather prediction model, which allows for a complete grid (e.g., grid points
over the oceans are not left blank because there are no nearby observations).
The major weather prediction centers all now maintain updated atmospheric reanalyses, and each
center’s reanalysis product differs slightly from the other centers: NOAA, the ECMWF, the
Japanese Meteorological Agency, etc. In 2017, one of the best sources for downloading
reanalysis data in near real-time is maintained by NOAA:
https://www.esrl.noaa.gov/psd/data/gridded/data.ncep.reanalysis.html. Using the Internet
Explorer browser (the only one that allows passive FTP; details below), take a few minutes to
read the brief description at that link.
NOAA maintains several reanalyses, each designed with different users in mind. The near realtime product, which is also one of the original products (so its horizontal resolution has not
improved over time), has lots of variables. They tend to be grouped by vertical level (so
“Pressure level” would contain variables like temperature, wind, and geopotential height on
pressure surfaces like 500 mb and 850 mb, while “Surface” would contain many of the same
variables, but for their values at the Earth’s surface). Click on “Pressure level” and explore the
information on that page. We note that the pressure level data are available at different times:
monthly averages (so one value per month), daily averages (so one value per day), and then
synoptic times of 0000, 0600, 1200, and 1800 UTC (so instantaneous values four times per day).
Question 1a: at what horizontal resolution (e.g., grid spacing and grid range) are these data
available?
Question 1b: at what vertical resolution (e.g., pressure levels) are these data available?
-1-
SO 254
Spring 2017
Tasks
The variables available on the different pressure levels include Air Temperature, Geopotential
Height, Relative Humidity, etc. We are interested in two of those: air temperature and
geopotential height, and we are interested in those data at 31 January 2017 at 0000 UTC (which
is the date and time of your hand analyses in Lab 2). Notice there are two options to get the data:
you can download the raw data files, or you can create a plot or subset (from which to then
download a raw data file).
Click the image for “Create plot / subset” for Geopotential Height. Since we want a specific
hour, and not the daily mean, choose “4-times Daily” option.
In the 3 options that are presented, only the first one allows us to access data at 0000 UTC on 31
January 2017. So, select the link for “Make plot or subset” for the first option in the table. Take
some time to look over the web form that shows on the next page. Notice you can choose the
date, time, pressure level, variable, latitude/longitude range, and then some options for how to
control the image.
Go ahead and make a plot of the 500-mb height at 0000 UTC 31 January 2017 [note that you
will have to enter the date/time twice (begin and end)]. If you don’t change any of the plotting
options, you get an image that looks like this one:
Figure 1: geopotential height at 500 mb at 0000 UTC 31 January 2017, from NCEP/NCAR Reanalysis 1.
At 0000 UTC 31 January 2017, a ridge (orange colors) was located over western North America
and Alaska, with a located trough over eastern North America and Canada (Fig. 1). The plot is
fairly crude, and not very eye-pleasing. You could play around with the options on the web page
to improve it. However, the best way to improve the plot is to make it yourself. MATLAB has
graphics options to give you control over the figure you create.
Go back to the web interface and download the data (make a subset without making a plot).
Because of USNA security restrictions, the FTP link to this plot is unavailable in either Chrome
or Firefox. You must use Explorer, then click the wheel-like icon in the far upper-right, then
choose Internet Options, and under the Advanced tab, untick the box for “Use Passive FTP (for
firewall and DSL modem capability)”. Rename the file you save as “hgt500_00z_31jan2017.nc”.
Download the 850 mb height, and 500 mb and 850 mb temperature data, in the same way. You
will have four netCDF files upon completion of your downloads:
hgt500_00z_31jan2017.nc
tmp500_00z_31jan2017.nc
hgt850_00z_31jan2017.nc
tmp850_00z_31jan2017.nc
-2-
SO 254
Spring 2017
The netCDF format seems to be the community standard in 2017 for gridded meteorological data
sets. You can read more about netCDF at http://www.unidata.ucar.edu/software/netcdf/.
Now that you have the four netCDF data files downloaded, we can begin writing a script in
MATLAB to extract the meteorology data from them, then write a series of code segments to
plot the data. Start your script with standard header (see Lab 1). Here are some hints on how to
do that.
Hint 1: look at the variable names, dimensions, structures, and units by using ncinfo.
var_info = ncinfo('hgt500_00z_31jan2017.nc');
Once you run that line of code, you get a variable called var_info. Double-click on var_info,
then double click on “variables” and then double click on the various <1x1 struct> cells that
appear in the five columns. We see that there are 5 variables: hgt, lat, level, lon, and time. There
are 144 longitudes and 73 latitudes, which makes sense if the resolution is 2.5°x2.5° from 0°360° and 90°S-90°N.
Hint 2: Now that you know the names of the longitude and latitude variables, extract them and
look at them in MATLAB.
lat = ncread('hgt500_00z_31jan2017.nc','lat');
lon = ncread('hgt500_00z_31jan2017.nc','lon');
The first variable, lat, is latitude, with the first latitude 90°, and the values then decrease by 2.5°
(southern hemisphere latitudes are negative). The first longitude is 0°, which then increases by
2.5°.
Hint 3: extract the height variable and look at it in MATLAB (double-click hgt500)
hgt500 = ncread('hgt500_00z_31jan2017.nc','hgt');
It appears that the height at 90°N latitude (column 1) and 0° longitude (row 1) is 5129 m (how
did we know the unit is meters? Hint: the output from ncinfo told us!) What if we forgot the level
was 500 mb, or if we wanted to double-check our work? We could look at the level variable:
level = ncread('hgt500_00z_31jan2017.nc','level');
Now, let’s make a contour plot of the 500 mb height data. Hint: the command in MATLAB to
plot contour plots is
figure(1)
clf
contour(hgt500);
The resulting figure window looks like Figure 2.
Figure 2: First plot of 500 mb heights at 0000 UTC 31
January 2017.
-3-
SO 254
Spring 2017
In Figure 2, notice the x and y axes. What do the values represent? What is missing? Well, we
have not told MATLAB anything about the lat and lon values. Remember, the columns increase
from 1 to 73, with column 1 representing the North Pole, and the rows increase from 1 to 144,
with row 1 representing the Prime Meridian. We need to give MATLAB information on the
latitude and longitude coordinates of these data. To do that, we will use the meshgrid command,
then re-plot the data.
[y,x]=meshgrid(lat,lon);
figure(1)
clf
hold on
axis equal
contour(x,y,hgt500);
colorbar
Notice how we have improved the contour command, by passing it information on the x and y
coordinates. You should notice that the meshgrid command gridded the lat and lon values, and
stored the result in two new variables: y and x. Double-click on variables x and y, and look at
them. We also used “hold on”, which is a command to tell MATLAB to stack, or overlay,
figure commands on one another (the default is for MATLAB to erase the figure window each
time something new is plotted. In our code above, axis equal would be erased by
contour(x,y,hgt500) without the hold on command). The resulting figure looks much more
like Figure 3 than Figure 2. It also has a colorbar, which gives context to the colors. The axis
equal command helps account for the map projection of a spherical Earth onto a 2-dimensional
figure.
Figure 3: Second attempt to contour 500 mb heights at 0000 UTC 31 January 2017.
Let’s add a global coastline to this figure. Download the coastline data from
https://www.usna.edu/Users/oceano/barrett/SO335/coastline.mat. Load the coastline.mat into
MATLAB:
load coastline.mat
Look at the resulting variable, coastline, by double-clicking on it once it appears in your
workspace. What data do you expect are in column 1? What about column 2? If we want to draw
a line indicating the coastline, how will these two columns of data be useful? One syntax could
be:
figure(1)
clf
hold on
axis equal
contour(x,y,hgt500);
-4-
SO 254
Spring 2017
colorbar
plot(coastline(:,1),coastline(:,2),'k','linewidth',1.5);
The ‘k’ tells MATLAB to plot a black line, and ‘linewidth’ tells it to plot 1.5 width (1.0 is
default). The contour function is quite powerful. One of the things contour allows is to control
for the values of the isolines being contoured. Remember, for 500 mb, the convention is to plot
the 5400 m line with interval spacing of +/- 60 m. Read online and in the help command for how
to setup plotting in this format. You’ll need to contour starting, at least, at 4800 m, and ending at
6000 m. The help command suggests one way to do that is to give the contour command a vector
of contour intervals. Thus, if you wanted to contour values at 1, 2, 3, 5, and 10, you could use
contour(x,y,hgt500,[1 2 3 5 10]). If you wanted regularly spaced contours, like between -5 and 5
and interval 0.25, the syntax could be contour(x,y,hgt500,-5:0.25:5).
The last task is to zoom the figure to match the latitude and longitude coordinates from your
hand analyses from Lab 2. Use the xlim and ylim commands to set the longitude and latitude
ranges accordingly.
Summary of deliverables for this lab:
Figure with 500-mb heights contoured every 60 m from 4800 m to 6000 m
Figure with 850-mb heights contoured every 30 m from 900 m to 1800 m
Figure with 500-mb temperatures contoured every 5C from -60C to 30C
Figure with 850-mb temperatures contoured every 5C from -60C to 30C
Clean, commented MATLAB code
All figures should be zoomed appropriately (including to match the lat/lon of the figures
from Lab 2), with appropriate titles, axis labels, and colorbar. You should write a detailed lab
report, and guidance on lab report format is given below.
-5-
SO 254
Spring 2017
Format for lab report
Your completed lab report should include:
1) A cover page with text centered and in the following format:
Lab 3: Upper-air observations and analysis
Rank First Name Last Name
SO 254: Intro to Meteorology (Section #)
DD Month YYYY
2) An introduction section. In the introduction, write a few sentences about pressure levels,
upper-air analyses, and the value of such analyses (e.g., what information do you get by
analyzing 500 and 850 mb levels? What weather features can be seen at those levels?)
3) A data section. In the data section, write a few sentences about the NCEP/NCAR Reanalysis
data. What temporal and spatial resolution does it have? Include a web link for downloading
the data.
4) A results section. The results section will largely be a “revised” version of your discussion
submitted with Lab 2, wherein you take into account comments provided by your instructor
on your Lab 2. However, you will also need to reference the four MATLAB generated
charts by figure number as you discuss them. Remember, the proper format to reference a
figure by number is at the end of a sentence. E.g., do not say “Figure 1 shows a trough over
Michigan”. Instead say, “A 500-mb trough, with minimum heights of 5130 m and
temperatures of -15C, was centered over Michigan at 0000 UTC 31 January 2017 (Figure
1).” Place the figures at the end of the writeup, with appropriate captions: e.g., “Figure 1:
Height at 500-mb at 0000 UTC on 31 January 2017, from NCEP/NCAR Reanalysis I.”
While the data for this lab is from the same time and day as in Lab 2, the analysis may
reveal new or different features. Thus, include any new meteorological insights gained from
your MATLAB analysis. This should be 1 to 2 double spaced pages.
5) A conclusion section. Very briefly summarize the main points of the results section. Tie
those main points back to whatever you mention in the introduction (but don’t say “As
mentioned in the introduction …”).
6) A references section. If you cite any references anywhere in the lab, include them here.
7) A page (or pages) containing your clean and commented (explain what each section of code
is doing) MATLAB script.
A sample of the 500-mb figure, with appropriate axis labels and title, is below.
Figure 4: Example 500-mb heights.
-6-