Presentation is loading. Please wait.

Presentation is loading. Please wait.

© Imperial College LondonPage 1 I/O API utilities Andrea Fraser PhD student Supervised byProf. H ApSimon Prof. R Derwent.

Similar presentations


Presentation on theme: "© Imperial College LondonPage 1 I/O API utilities Andrea Fraser PhD student Supervised byProf. H ApSimon Prof. R Derwent."— Presentation transcript:

1 © Imperial College LondonPage 1 I/O API utilities Andrea Fraser PhD student Supervised byProf. H ApSimon Prof. R Derwent

2 © Imperial College LondonPage 2 Outline Where to find I/O API utilities Demonstrate m3stat Create subsets of data m3xtract, m3wndw and m3tproc Write simple script Use ncdump and transfer data to spreadsheet and produce a plot

3 © Imperial College LondonPage 3 I/O API Documentation Depending on the build I/O API tools may be included or may need to be built seperately I/O API documentation www.baronams.com/products/ioapi/AA.html Related programs and examples: gives a list and brief description of available tools www.baronams.com/products/ioapi/AA.html#tools

4 © Imperial College LondonPage 4 m3stat tcsh setenv infile ~/demo-cmaq/data/cctm/CCTM_sof.CONC.D4.2003196.ncf m3stat answer the questions no report file do not want default analysis stats on Ozone with 1 threshold of.025 This produced statistics over the whole grid we are only interested in layer 1

5 © Imperial College LondonPage 5 Subsets of data There are 3 tools in I/O API to subset data m3xtractsubsets for layer, time and variable m3wndwsubsets for grid and time m3tprocsums time

6 © Imperial College LondonPage 6 Subset the data for layer 1 only Set variables setenv infile ~/demo-cmaq/data/cctm/CCTM_sof.CONC.D4.2003196.ncf setenv file1 ~/demo-cmaq/data/conc_L1.ncf m3xtract extract all variables for a sub-range of layers LAYER 1 for all time steps Run m3stat on file1 stats are now just for layer 1 select thresholds of 0.02 0.025 0.03 and 0.035

7 © Imperial College LondonPage 7 Create a file with only data for North Kensington (row 28 column 14) layer 1 file1 has only one layer and can by used as the infile Set other variables setenv file2 /home/andrea/demo-cmaq/data/conc_NK_L1.ncf m3wndw extract all variables for a sub-grid of 1 cell: row 28 column 14 all time steps

8 © Imperial College LondonPage 8 Create a file with only data for North Kensington (row 28 col 14) all layers, 1 time step 14:00 to 15:00 Subset the data as in the previous step but use the original infile with all layers Set other variables setenv file3 /home/andrea/demo-cmaq/data/conc_NK_Lall.ncf m3wndw extract all variables for a sub-grid of 1 cell: row 28 col 14 time steps 14:00 for 1 hour

9 © Imperial College LondonPage 9 Summary We now have 4 files ~/data/cctm/CCTM_sof.CONC.D4.2003196.ncf the original full CCTM CONC file ~/home/andrea/demo-cmaq/data/conc_L1.ncf layer 1 of CCTM CONC file ~/home/andrea/demo-cmaq/data/conc_NK_L1.ncf N. Kensington layer 1 CONC file ~/home/andrea/demo-cmaq/data/conc_NK_Lall.ncf N. Kensington 1 time step for all layers CONC file

10 © Imperial College LondonPage 10 Why ? The output files from CMAQ are large in order to extract data into a spreadsheet to produce a graph you need to reduce the amount of data. Particularly when studying a specific location

11 © Imperial College LondonPage 11 Writing I/O API scripts Read documentation for the utility Run through the utility on-line, noting the response to all questions Write a script including the answers: m3wndw FILEa FILEb <<EOF 2003196, 10000, 240000,, 14, 28, EOF

12 © Imperial College LondonPage 12 I/O API can be used in scripts Change directory to ~/cmaq-demo/tools/ioapi-scripts File sof_cell.script – contains a script to create a series of files that can then be used for further analysis. The script is set for N. Kensington row 28, column 14 It takes the CONC file and creates a subset of 1 cell It takes the IRR and PA files, and uses m3wndw and m3xtract to create files containing 1.Cell 28,14 24 hrs all layers 2.Cell 28,1424 hrslayer 1 3.Cell 28,1412:00-13:00all layers

13 © Imperial College LondonPage 13 Convert to text files On order to use the files in a spreadsheet they need to be converted to text files The last part of the script creates the text files using ncdump These can be read into a spreadsheet as csv/txt files defining the separators as, = ; and } produces a tidy spreadsheet If OpenOffice is available read in ~/demo-cmaq/data/2814_PA_L1_D4

14 © Imperial College LondonPage 14 Integrated Process Rates

15 © Imperial College LondonPage 15 I/O API: m3pair This produces a text file of two values in pairs and was used to produce O 3 /NO x - NO x sensitivity 15/07/2003 14:00 Scenario 1 Basecase + 15 % VOC or NO x emissions Scenario 2 Basecase - 15 % VOC or NO x emissions

16 © Imperial College LondonPage 16 m3pair setenv infile ~demo-cmaq/data/cctm/CCTM_sof.CONC.D4.2003196.ncf setenv outfile ~demo-cmaq/data/pair_no2_o3.txt m3pair use infile for both variables select NO2 then O3 select required Grid select time 12:00 for 1 time step select required layers This produces a ASCII file of paired values


Download ppt "© Imperial College LondonPage 1 I/O API utilities Andrea Fraser PhD student Supervised byProf. H ApSimon Prof. R Derwent."

Similar presentations


Ads by Google