zzzJohnnaInfanti-GradsResults


 * Click Here for Grade Argument, Question 4**
 * Click Here for Grade Argument, Grads Code for Assignment**
 * Click Here for Grade Argument, Grads Code for Simple Averages Questions**

= = =** Basic parts: **=

**1. Download and read...**
.nc files are opened and read in grads using the sdfopen command. Code is done from scratch + some help from Angela (thank you!) My grads code can be found at the bottom of this page.

===**2. Calculate zonally averaged P and v over longitude, and plot the resulting latitude-time series.** ===


 * Here is the latitude-time sections of P in the zonal mean, and at 90W**

We do not live at a "typical" longitude, as proof from the difference in winds and precipitation found at 90W. At 90W, we see more precipitation than the global mean, reaching a maximum right along the equator. The global mean shows a southerly shift in the winter months and a northerly shift in the summer months, which is not seen in the 90W map where the majority of the precipitation falls right along the equator.

The meridional wind shows differences from the global mean as well, and the strength of the winds is much stronger, but they are still similar in that the areas of minimum and maximum wind occur at similar locations. The wind strength in the 90W plot is due to the ITCZ for the max below the equator, and the polar winds for the max near 90S. Also of note is the maximum in the global average is during the summer months, and this max occurs a little later in the season at 90W.
 * Here is the latitude-time sections of v in the zonal mean, and at 90W:****

===**3. Average air temperature over both lat and lon, to make a 12-month time series. Which season has the warmest global mean surface temperature? Can you understand why?** ===

Global mean surface temperature has a mild annual cycle: Northern hemisphere summer marks the warmest months of the global mean surface temperature, due to the larger amount of land mass in the northern hemisphere vs. the southern hemisphere, and though the temperature change is only about 3degreesC, this change in temperature is still reflective of the amount of land mass in the northern hemisphere than the southern. The heat capacity of land is less than the ocean, and the northern hemisphere gets the most solar insolation in the summer months, leading to the peak in the graph.

===** 4. Make a map of the temporal (i.e. seasonal) standard deviation of precipitation, expressed as a percentage of the annual mean precipitation. This might be one definition of a "monsoonal" climate.** === For fun, I highlighted the areas with high amounts of precip: ( Are these areas of high precip or areas of high monsoonal / seasonal precip? -- Teddy -
 * Here is a map expressing the seasonality of precipitation:**

Not sure if this answers your question, but the 2nd one is the seasonal std dev of precip, so its the same thing as the first, just removed all the background colors so it was a little easier to see the areas. Probably should have been clearer in my wording? ) Places with intensely seasonal rainfall tend to be ...(latitude belts, land/sea, ...): Southern Africa, tropical Eastern Pacific/Atlantic, monsoon regions (including Australia, India, Africa, Western Mexico/North America).

===**5. What is the space-time standard deviation of 'air' (temperature)?** === The total space-time standard deviation of temperature is 15.23 degrees C. The challenge of computing this is that we would need to weight the latitude average to account for the fact that the earth is a spehere.

=**Extra credit / extensions of the basic assignment:** =

*GRADS CODE HW 1*
Before we start, lets talk about some of the code I'm using to make the majority of the images. I also have to thank Angela for putting up her code first, any need to compare my images and any questions were easily answered!

To set the background color as white: 'set display color white', you can also turn off the default grid lines using 'set grid off', and turn off the grads logo using 'set grads off' (but this needs to be done every time!

In order to shade the contours, I am using 'set gxout shaded', this will create a shaded contour map where grads will assign the default colors. These can easily be changed, and I will address this later.

Instead of using a colorbar in some of the plots, I elected to use labelled contour lines on top of the shaded contour map. This is done using 'set gxout contour', and grads will choose the default contour line values/colors. These can be changed as well.

The default of a contour plot is to have white boxes around the contour line values, I get rid of these using 'set clab masked'

In order to swap the default axis on a map or graph, use the code 'set xyrev on'

To create title and axis labels, use 'draw title title of graph', 'draw xlab axis name', 'draw ylab axis name'

To save an image after it has been displayed, use 'printim imagename.jpg'

Also note that I typed these directly into the command line (and you can cut and paste these directly in), but you can easily write a script – Angela has instructions on the grads code page.

***BASIC PARTS***

// *1) Download and read // *Open the files as needed for the questions, set up the background color/any other visual settings

sdf open filename.nc set display color white set grid off c

// *2) Calculate zonally averaged P and V over longitude, and plot the results //

sdfopen precip.mon.ltm.nc

*Remember the time is only set to t=1, so we need to reset the time from 1 to 12

set t 1 12

*Now we are averaging over longitude, note that you can either type 'define varname=etc' or just *'varname=etc' to define a variable

define plon=ave(precip,lon=0,lon=360)

*Now that we have defined the variable, we can start plotting. You have to set the longitude to *a value to plot it, but since this is averaged over longitude we can pick whatever we want.

set lon -90 set grads off set gxout shaded set xyrev on d plon

*So now we have a shaded contour plot with the default colors set, next layer a contour plot ontop

set gxout contour set clab masked d plon

*Looks good! Just have to print a title and axis labels and save the image:

draw title Zonally Averaged Precip (mm/day) draw xlab Month draw ylab Latitude printim ZonalPrecip.jpg c

*While the file is open, lets display the precip at 90W, and this value is already set

set xyrev on set grads off set gxout shaded d precip set gxout contour set clab masked d precip draw xlab Month draw ylab Latitude draw title Precip at 90W (mm/day) printim 90WPrecip.jpg c

*Close the file, and open the next file

close 1 sdfopen vwnd.mon.ltm.nc

*Repeat the above steps for vwnd

set t 1 12 define vwndlon=ave(vwnd,lon=0,lon=360) set grads off set xyrev on set lon -90 set gxout shaded d vwndlon set gxout contour set clab masked d vwndlon draw title Zonally Averaged Meridional Wind (m/s) draw xlab Month draw ylab Latitude printim vwndzonal.jpg c

set grads off set xyrev on set gxout shaded d vwnd set gxout contour set clab masked d vwnd draw title Meridional Wind at 90W (m/s) draw xlab Month draw ylab Latitude printim vwnd90W.jpg c close 1

*Note that in this problem I kept the colors and contour levels as their defaults.

// *3) Average air temperature over lat and lon to make a time series //

sdfopen air.mon.ltm.nc set t 1 12

*This time we are doing an area average, use 'aave' instead of 'ave'

define aair=aave(air,lon=0,lon=360,lat=-90,lat=90)

*Again have to specify lat/lon to plot

set lat 10 set lon 10 set grads off d aair draw title Mean Air Temperature (Degrees C) draw ylab Degrees C draw xlab Month printim aair.jpg c close 1

// *4) Map the temporal standard deviation of precipitation //

sdfopen precip.mon.ltm.nc

*Need a time average first

define pave=ave(precip,t=1,t=12)

*Now calculate variance, sum(x-xbar)^2 / n, where xbar=time average precip, n=12 months

define pvar=(sum((precip-pave)*(precip-pave),t=1,t=12))/12

*????? Does anyone know if the following would be correct for squaring/higher powers? I think it is: *'pow(varname,2)'

*Since standard deviation is the square root of the variance, take the square root of variance

define psd=sqrt(pvar)

*Divide by time average precipitation and display the results (note that cbarn gives a colorbar)

define pannual=psd/pave set grads off set gxout shaded d pannual cbarn draw title Standard Deviation of Precipitation printim StdDevPrecip.jpg c

*Thats cool, but lets highlight the “bulls-eyes” of precipitation. Here I'm creating some RGB values, *but you can easily use the pre-assigned color values of grads to do the same thing. There is a *beginning tutorial here: http://www.iges.org/grads/gadoc/colorcontrol.html, which is where I got *the RGB values from. I kept this pretty much the same as the format in the tutorial, but used different *shades of blue.

*Lets make the bulls-eyes blue for precip, and we'll start contouring at 1.2 and above.

*Heres the shades of blue we will use, creating using the set rgb command

Set rgb 22 0 0 128 Set rgb 21 0 0 160 Set rgb 20 0 0 255 Set rgb 19 55 55 255 Set rgb 18 110 110 255 Set rgb 17 165 165 255 Set rgb 16 220 220 255

*Now we're plotting it, but this time assigning colors using 'set ccols' and contours using 'set clevs'

set gxout shaded set clevs 0.7 1 1.2 1.4 1.6 1.8 2 set ccols 0 16 17 18 19 20 21 22 d pannual cbarn draw title Standard Deviation of Precipitation printim stddevprecip1.jpg c close 1

*That looks a little more interesting!

// *4) What is the standard deviation of 'air' ? //

sdfopen air.mon.ltm.nc

*We need time average and global area average

define airave=ave(air,t=1,t=12) define aair=aave(airave,lon=0,lon=360,lat=-90,lat=90)

*Now time average and global average of air^2

define airave2=ave(air*air,t=1,t=12) define aair2=aave(airave2,lon=0,lon=360,lat=-90,lat=90)

*Now variance and standard deviation

define airvar=aair2-(aair*aair) define airsd=sqrt(airvar) d airsd

*This will print a value into the command window *And we're done with HW1!

Averaging over months and plotting results R(lat,lon)
T_timemean=ave(var,t=1,t=n) d T_timemean To display any of these variables type d defined variable name

Averaging over longitude and plotting result R(lat,t)
T_lonmean=ave(var,lon=0,lon=360)

Averaging over latitude and plotting result R(lon,t)
T_latmean=ave(var,lat=-90,lat=90) Grads will weight by grid cell area automatically, for non latitude weighted average use T_latmean2=mean(var,lat=-90,lat=90)

Averaging over latitude and longitude R(t)
T_globalmean=aave(var,lon=0,lon=360,lat=-90,lat=90) This is latitude weighted already, you can also do this non latitude weighted if you wanted by using T_globalmean2=amean(var,lon=0,lon=360,lat=-90,lat=90)

Averaging Squared Value
T_globalmean2=aave(var*var,lon=0,lon=360,lat=-90,lat=90) meansquare=ave(T_globalmean2,t=1,t=n)'

Variance (meansquare-mean^2)
mean=ave(T-globalmean,t=1,t=n) variance=meansquare-(mean*mean)

Standard Deviation (square root of variance)
stdev=sqrt(variance)