ASC 5010 Physical Meteology I Lab Lab 2 numerical integration; height/pressure relationships à Begin with IDEAL GAS Law: PV = mr Pα = R note : 1 = thus : α P = R his is true f a mixture of gases, f ry air the mixing ratios of consitituent gases is relativelyconstant : the P = R = R P à F a gas in hyrostatic balance, the fce exerte ownwar ue to gravity is exactly equal an opposite to the fce exerte ue to the pressure graient (f a given volume of gas the pressure below the volume is greater than the pressure above the volume, this exerts a fce on the volume in the upwar irection). his can be expresse: p = gz p = gz assuming an atmosphere evoi of water vap : p = gz From the ieal gas law, substitute f ry - air ensity : gz = R p p integrate both sies : gz = R p p if we integrate from someinitial height z 0 to some height z we have :
z gz = R p z 0 P( z) P z0 p over the altitues of the troposphere, the variation in gravity is quite small. hus, we replace g with the constant g 0 thus: z z 0 = R g 0 p( z) p z0 p p At this point, Let's consier two moels- (A) the isothermal moel (temperature is contsant) with height over the epth of the atmosphere, in this case can be replace by 0, move outsie of the integral an the solution is simple: z = z 0 + R # 0 ln p z 0 g % 0 $ p z & ( ' (B) the explicit moel (temperature varies with height) here, we nee a measure of temperature (from an atmospheric souning) an we can then integrate over each level in the atmosphere (numerically) to calculate the height of that level. We will use the mean temperature between two iscrete levels as the temperature of that level. If we let z 1 enote the height of our first level, then the height of our next level up, z 2 is given by: # Z 2 = Z 1 + R 1 % 12 p 1 p 2 $ g 0 P 12 & ( ' à We will use pressure an temperature ata from a souning. Knowing the iginal height, we will compute the height of each measurement using both moels. We will compare our compute heights with each other an the actual (measure) height from the souning.
Lab 3 Exercise: all computations shoul be ouble precision! LABEL YOUR PLO AES Souning ata: pressure in millibars temperature in Celsius height in meters Computations require appropriate units: temperature in Kelvin, pressure in Pascal. You will also be using two files that are available f ownloa from the class website: the il function file rea_souning.pro the text file souning_lab2.txt Your program shoul also be generic in sizing, that is, it shoul not epen on the number of measurements that are containe in the souning. 1. Create a proceure atsc5010_yourname_lab2.pro. 2. In the first line of your proceure, run your proceure phycon (this sets values of constants as environmental variables). hrough the remainer of your proceure use these environmental variables rather than harwiring values of constants. 3. Call rea_souning from within your proceure an extract pressure, temperature, an height ata. rea_souning is a function, the usage is on the next page. 4. Assuming an isothermal atmosphere, in which the temperature at all levels is equal to the temperature at the lowest level ( = 0 ), calculate the height at each pressure level. 5. Assuming the explicit moel, using temperature an pressure at all levels, calculate the height at each pressure level. Note that there are 100 levels. he eight of the first level is given, so you shoul compute 99 thicknesses (ie 99 height levels). 6. Make a first plot, Plot the measure pressure (in millibars) on the -axis from 1000 to 0 an calculate height from the isothermal moel (in kilometers) on the Y-axis, use a soli re line 7. On your plot in (6), overplot the measure pressure an calculate height from the explicit moel, using a ashe blue line 8. Make a secon plot that shows compute height (isothermal moel) as a function of actual (measure) height, soli re line. Plot the heights in kilometers. Overplot the compute height (explicit moel) as a function of actual height, ashe blue line, thickness=2. 9. Make a thir plot that shows the ifference between the compute an actual height (in meters, compute minus actual) as a function of actual height (in kilometers). Use a soli re line f the isothermal moel an a ashe blue line f the explicit moel. Questions 1. Comparing the two moels, at the top of the souning (lowest pressure), which has the greatest calculate height? 2. Consier the assumptions use in the two moels an the actual temperature as a function of altitue, explain the ifference in calculate height between the two moels. Why oes temperature matter? 3. Does the ifference between the two moels increase, ecrease, stay about the same as altitue increases? Why?
Functions & Proceures to use: Supplie by the lab instruct rea_souning : USAGE: result = rea_souning([temperature=temperature], [height=height]) Upon calling, rea_souning prompts the user to select a souning.txt file to rea Result: name variable that returns the one-imensional array of pressure measurements in millibars Keyws: emperature is name variable that upon exit contains the one imensional array of temperature measurements (in celcius) Height is name variable that upon exit contains the one imensional array of height measurements (in meters) Built in IDL proceures & functions DBLARR f creating an array of Doubles N_ELEMENS f etermining how many elements are in an array SHIF to shift all elements of a one-imensional array one irection another OAL (with keyw CUMULAIVE) to etermine the total values of all elements in an array, in a cumulative sense PLO (as we ve use in earlier labs ) Some hints f programming: npts = N_ELEMENS(arr1) arr2 = DBLARR(npts) arr2 is then an array of oubles an has the same number of elements as arr1 IF Array1 = [4, 6, 9, 3, 2] an Array2 = SHIF(Array1, 1) = [2, 4, 6, 9, 3] Array1 an Array2 look the same, but the elements are shifte by 1 then Array3 = Array1 Array2 = [4-2, 6-4, 9-6, 3-9, 2-3] Note if we ispose of the zeroth element then Array3[1] = array1[1]-array1[0] Array3[2] = array1[2]-array1[1] Array3[3] = array1[3]-array1[2] etc..
his is similar to the statement FOR i=0,3 DO array3[i] = array1[i+1]-array[i] (but the above oes not use a FOR loop an is much faster in IDL (an easier to rea an ebug) IF = [1,2,3,2,3,5] then OAL(x) = 16 (the total) an OAL(x, /cumulative) = [1,3,6,8,11,16] (the cumulative summation)