-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathch05_utilities.xml
3239 lines (2549 loc) · 120 KB
/
ch05_utilities.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="UTF-8"?>
<chapter id="ch_utilities">
<title>SMOKE Utility Tools</title>
<section>
<title>Overview</title>
<para>The utility tools are divided into two sections: MOVES Utility Scripts and SMOKE Utility Programs</para>
</section>
<section id="section_moves_utilities">
<title>MOVES Utility Scripts</title>
<section>
<title>Overview</title>
<para>The MOVES utility scripts are designed to assist the user by automating the proper use of using MOVES emission rate calculations for the purpose of estimating mobile-source emissions for air quality modeling. The MOVES default database has over 100 different tables that store lookup/reference information, conversions/adjustment factors, emissions data, and activity data. MOVES uses MySQL databases to store user inputs, intermediate results and final outputs. The MOVES utility scripts consist of 1) MOVES Driver script and 2) MOVES Post-processing scripts. These scripts are run after the meteorological data processor program (<command>Met4moves</command>) which prepares the spatially and temporally averaged temperatures and relative humidity data used as meteorological input conditions for MOVES and SMOKE using the Meteorology-Chemistry Interface Processor (MCIP) output files.</para>
<para>The MOVES Driver script (<command>Runspec_generator.pl</command>) creates data importer files and importer script and the MOVES batch run script which specifies the characteristic of the particular scenario to be modeled.</para>
<para>The MOVES Post-processing script (<command>Moves2smkEF.pl</command>) formats the MOVES emission rate lookup tables for SMOKE. The second MOVES Post-processing script (<command>gen_8digit_scc.pl</command>) generates an SCC mapping file used when importing activity data in <command>Smkinven</command>. After the MOVES utility scripts are completed, the SMOKE postprocessing program (<command>Movesmrg</command>) estimates emissions from mobile sources using the SMOKE formatted MOVES lookup tables (RPD, RPP, RPV, and RPH) output generated by the MOVES utility scripts and meteorology data from <command>Met4moves</command>.</para>
<para><command>Movesmrg</command> creates hourly, gridded, speciated air quality model-ready input files. Information about key concepts related to the MOVES utility scripts including Representative Counties, Fuels Months, and Emissions Processes are covered in <xref linkend="sect_concepts_reference_counties_moves"/> and <xref linkend="sect_concepts_moves_reference_fuel_month"/> and <xref linkend="sect_concepts_moves_emission_processes"/></para>
</section>
<section id="section_moves_driver_script">
<title>MOVES Driver Scripts</title>
<para>The MOVES Runspec script <command>Runspec_generator.pl</command> is written in Perl, generates the scripts and inputs needed to run MOVES for each representative county. The MOVES Model can be run at any of the three domains/scales: national, county or project. The <command>Runspec_generator.pl</command> is only applicable to the county-level because this level of model detail is required by EPA for SIP and conformity analyses. For this scale, MOVES requires a MySQL input database containing local data for a single county. The <command>Runspec_generator.pl</command> is designed to prepare the MOVES importer and MOVES run scripts so that the fewest number of runs will produce all of the necessary emissions factors. In this approach, user can specify one or more groups of pollutants to model in the run control fil.</para>
<para>There are a total of four types of modeling pollutant groups: 1) Ozone precursors, 2) Toxics, 3) Particulate Matters, and 4) GreenHouse Gases (GHG) based on <xref linkend="tbl_concepts_moves_pollutant_groups"/>. The choice of pollutant group(s) determines what pollutants are included in the three emission rate lookup tables (RPD, RPV, and RPP) by MOVES.</para>
<section>
<title>Processing Order</title>
<para><command>Runspec_generator.pl</command> run after <command>Met4moves</command>. It assembles the instructions for MOVES to create MySQL input databases from XML files and creates the importer.csh scripts and assembles run specification XML files to run MOVES for a necessary range of conditions (for each emissions process: rate-per-distance, rate-per-vehicle, and rate-per-profile) based on the <command>Met4moves</command> output temperature list by county-specific runspec.csh.</para>
<para>The <command>Runspec_generator.pl</command> uses following steps:</para>
<orderedlist>
<listitem>
<para>Reads the representative county min/max temperature and 24-hours temperature profiles output file from <command>Met4moves</command> for RPP mode. Find detail information from <xref linkend="sect_intmed_moves_output"/></para>
</listitem>
<listitem>
<para>Reads the representative county specific min/max temperatures and average RH output file from <command>Met4moves</command> for RPD, RPV and RPH modes. Find detail information from <xref linkend="sect_intmed_moves_rh_output"/></para>
</listitem>
<listitem>
<para>Import the name of pollutant group to model from the run control file (<link linkend="sect_input_runctlfile">contorl.in</link>) based on <xref linkend="tbl_concepts_moves_pollutant_groups"/></para>
</listitem>
<listitem>
<para>Reads the run control file (<link linkend="sect_input_runctlfile">control.in</link>) and representative county file (<link linkend="sect_input_refcountyfile">countyrep.in</link>) created by user.</para>
</listitem>
<listitem>
<para>Assembles instructions for MOVES to create MySQL input databases from XML files
(data importer).</para>
</listitem>
<listitem>
<para>Assembles runspec XML files to run MOVES for a wide range of conditions.</para>
</listitem>
<listitem>
<para>Generates the run-specific temperature and humidity comma-separated-values (CSV) format file.</para>
</listitem>
<listitem>
<para> Assembles a batch list of data importer files, runspec files, and also a list of the
MySQL output database names to be postprocessed.</para>
</listitem>
<listitem>
<para>importer.csh and runspec.csh scripts are used to create the on-road operating rateperdistance table (RPD), off-network processes ratepervehicle table (RPV), and vapor venting off-network rateperprofile table (RPP).</para>
</listitem>
<listitem>
<para>Review log file of the MOVES, called runlog_*.txt.</para>
</listitem>
</orderedlist>
</section>
<section>
<title>How-To-Run</title>
<para>Check out the most latest processing scripts and the <quote>How to run</quote> instructions are available from <ulink url="https://github.com/CEMPD/SMOKE-MOVES/">the SMOKE-MOVES Github repository</ulink>.</para>
</section>
<section>
<title>Files and Environment Variables</title>
<section>
<title>Input Files</title>
<table id="tbl_smoke_moves_utility_script">
<title>Input Files</title>
<tgroup cols="3">
<colspec colname="c1" colwidth="25*" />
<colspec colname="c2" colwidth="10*" />
<colspec colname="c3" colwidth="60*" />
<thead>
<row>
<entry>File Name</entry>
<entry>Format</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry><link linkend="sect_input_refcountyfile">countyrep.in</link></entry>
<entry>ASCII</entry>
<entry>Representative county file containing the country/state/county FIPS codes and the full path and file names for the files containing MOVES data for AGE, FUELSUPPLY, FUELFORM(optional), IM, POP, SourceType, HPMSVMT, VMT for each representative county</entry>
</row>
<row>
<entry><link linkend="sect_input_runctlfile">control.in</link></entry>
<entry>ASCII</entry>
<entry>Run control file that user specifies fields for the Database Host, Project Name, Model year, day type (weekday or weekend), pollutant and the met4moves MET output file for the batch run of MOVES</entry>
</row>
<row>
<entry><link linkend="sect_intmed_moves_output">MOVES_OUTFILE</link></entry>
<entry>ASCII</entry>
<entry><command>Met4moves</command> output for each fuel month for the MOVES Driver script (minimum and maximum temperatures, and 24-hour temperature profiles for all representative counties by temperature bin)</entry>
</row>
<row>
<entry><link linkend="sect_intmed_moves_rh_output">MOVES_RH_OUTFILE</link></entry>
<entry>ASCII</entry>
<entry><command>Met4moves</command> outputs fuel month-specific averaged, min, and max temperatures and averaged RH values in local time for all representative counties by temperature bin</entry>
</row>
<row>
<entry><link linkend="sect_input_sourceTypeAgeDist">sourceTypeAgeDistribution</link></entry>
<entry>ASCII</entry>
<entry>Age distribution by source type over 30 vehicle model years</entry>
</row>
<row>
<entry><link linkend="sect_input_fuelsupply">fuelSupply</link></entry>
<entry>ASCII</entry>
<entry>list directed file used to define the fuel properties, their market shares and the months that the fuels are used for each representative county</entry>
</row>
<row>
<entry><link linkend="sect_input_fuelformulation">fuelformulation (optional)</link></entry>
<entry>ASCII</entry>
<entry>list directed file used to define the fuel supply and the months that the fuels are used for each representative counties</entry>
</row>
<row>
<entry><link linkend="sect_input_IMcoverage">IMCoverage</link></entry>
<entry>ASCII</entry>
<entry>list directed file used to define the inspection and maintanance data available for each representative counties</entry>
</row>
<row>
<entry><link linkend="sect_input_sourcetypeyear">sourcetypeyear</link></entry>
<entry>ASCII</entry>
<entry>Vehicle population by MOVES source type</entry>
</row>
<row>
<entry><link linkend="sect_input_HPMSVTypeYear">HPMSVTypeYear</link></entry>
<entry>ASCII</entry>
<entry>list directed file used to define the annual VMT by Highway Performance Monitoring System (HPMS) vehicle type</entry>
</row>
<row>
<entry><link linkend="sect_input_dummy_avgspeeddistribution">dummy_avgspeeddistribution</link></entry>
<entry>ASCII</entry>
<entry>Speed distribution by roadway type and vehicle class. MOVES dummy inputs files provided with tool package in OUTDIR directory</entry>
</row>
<row>
<entry><link linkend="sect_input_dummy_monthvmtfraction">dummy_monthvmtfraction</link></entry>
<entry>ASCII</entry>
<entry>list directed file that allocates annual VMT to the individual months</entry>
</row>
<row>
<entry><link linkend="sect_input_dummy_dayvmtfraction">dummy_dayvmtfraction</link></entry>
<entry>ASCII</entry>
<entry>file that allocates month VMT day type, weekday or weekend and the decimal fraction of the proportion of vehicle miles travelled for the weekday or weekend day type</entry>
</row>
<row>
<entry><link linkend="sect_input_dummy_hourvmtfraction">dummy_hourvmtfraction</link></entry>
<entry>ASCII</entry>
<entry>list directed file that allocates the day-type VMT to individual hours of the day</entry>
</row>
<row>
<entry><link linkend="sect_input_dummy_roadtypedistribution">dummy_roadtypedistribution</link></entry>
<entry>ASCII</entry>
<entry>list directed file that allocates annual VMT to five MOVES roadway types</entry>
</row>
</tbody>
</tgroup>
</table>
</section>
<section id="section_moves_driver_script_output">
<title>Output Files</title>
<informaltable>
<tgroup cols="3">
<colspec colwidth="25*" />
<colspec colwidth="10*" />
<colspec colwidth="60*" />
<thead>
<row>
<entry>File Name</entry>
<entry>Format</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry><link linkend="section_moves_runspec_batch">runspec.csh</link></entry>
<entry>ASCII</entry>
<entry>Batch or c-shell script to run required MOVES runs. Fine more information from <xref linkend="section_moves_runspec_batch"/></entry>
</row>
<row>
<entry><link linkend="section_moves_importer">importer.csh</link></entry>
<entry>ASCII</entry>
<entry>Batch or c-shell Script to create MySQL MOVES databases and import the data. Fine more information from <xref linkend="section_moves_importer"/></entry>
</row>
<row>
<entry>InputDBlist</entry>
<entry>ASCII</entry>
<entry>
<para>List of MySQL database names to process. It will be used as an input to MOVES Post-processing script. See example below:</para>
<programlisting>
localhost
/work/MOVES_Processing_Scripts/post_process
13121_2008_1
</programlisting>
</entry>
</row>
<row>
<entry>Data importer files</entry>
<entry>ASCII</entry>
<entry>data importer files (*_imp.xml)</entry>
</row>
<row>
<entry>Runspec files</entry>
<entry>ASCII</entry>
<entry>runspec files (*_mrs.xml)</entry>
</row>
<row>
<entry>zonemonthhour files</entry>
<entry>ASCII</entry>
<entry>MOVES-formatted zonemonthhour (*_zmh.csv) contains temperature and RH data from the Met4Moves Meteorological processor. Relative Humidity is a single value averaged over the time period selected by the user in Met4Moves and averaged over the entire group of inventory counties that map to a representative county.</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>
</section>
</section>
<section id="section_moves_runs">
<title>Run MOVES Model</title>
<section>
<title>Overview</title>
<para>Automatically execute multiple MOVES runs based on automatically generated county-specific data importer script and the MOVES run script file by <command>Runspec_generator.pl</command>, which specifies the characteristic of the particular scenario to be modeled.</para>
</section>
<section id="section_moves_importer">
<title>MOVES importer script</title>
<section>
<title>Description</title>
<para>The MOVES importer script <quote>importer.[bat|csh]</quote> can be written in Linux C-shell or Windows Batch script format depending on which option is chosen by the user in the <command>Runspec_generator.pl</command>. The importer script loads the county-specific data in the file and creates the MySQL input database containing local data for the representative county. </para>
<para>The output of the MOVES batch importer script includes:</para>
<itemizedlist>
<listitem>
<para>MySQL databases (*_in).</para>
</listitem>
</itemizedlist>
</section>
<section>
<title>Processing Order</title>
<para>importer.csh should be run before runspec.csh. The importer.csh is written in Linux c-shell script format.</para>
<para>The importer.csh uses following steps:</para>
<orderedlist>
<listitem>
<para>The importer.csh contains all of the user selections needed to import data from the files into a MySQL MOVES database</para>
</listitem>
<listitem>
<para>Imports the data for each of the three different emissions processes: RPD, RPV, RPP.</para>
</listitem>
<listitem>
<para>Review log file of the MOVES, called importlog_*.txt.</para>
</listitem>
</orderedlist>
</section>
<section>
<title>Files, Environment Variables, and Run Syntax</title>
<section>
<title>Input Files</title>
<informaltable>
<tgroup cols="3">
<colspec colwidth="60*" />
<colspec colwidth="8*" />
<colspec colwidth="40*" />
<thead>
<row>
<entry>File Name</entry>
<entry>Format</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>RV_[CountyRep]_[yearID]_[monthID]_[TempBin]_imp.xml </entry>
<entry>XML</entry>
<entry>file specifies the zonemonthhour (*zmh.csv) files and other files that will be imported to MOVES for the Rate Per Vehicle Mode, note: TempBin varies, in 5 degree increments to cover the Temperature Range ie. [TempBin] = T10, T15,.. T105 for the temperature range [TempRange]= T10_105</entry>
</row>
<row>
<entry>RP_[CountyRep]_[yearID]_[monthID]_[MetProfID]_imp.xml </entry>
<entry>XML</entry>
<entry>file specifies the zonemonthhour (*zmh.csv) files that will be imported to MOVES for the Rate Per Process Mode</entry>
</row>
<row>
<entry>RD_[CountyRep]_[yearID]_[monthID]_[TempRange]_imp.xml </entry>
<entry>XML</entry>
<entry>importer file specifies the zonemonthhour (*zmh.csv) files that will be imported to MOVES for Rate Per Distance Mode</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>
<section>
<title>Output Files</title>
<informaltable><tgroup cols="3">
<colspec colwidth="40*" />
<colspec colwidth="9*" />
<colspec colwidth="40*" />
<thead>
<row>
<entry>File Name</entry>
<entry>Format</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>RD_[CountyRep]_[yearID]_[monthID]_[TempRange]_in</entry>
<entry>MySQL </entry>
<entry>MOVES MySQL Database RPD Table (*_in)</entry>
</row>
<row>
<entry>RP_[CountyRep]_[yearID]_[monthID]_[MetProfID]_in</entry>
<entry>MySQL </entry>
<entry>MOVES MySQL Database RPP SMOKE format Table (*_in)</entry>
</row>
<row>
<entry>RV_[CountyRep]_[yearID]_[monthID]_[TempBin]_in</entry>
<entry>MySQL</entry>
<entry>MOVES MySQL Database RPV Table(*_in)</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>
</section>
</section>
<section id="section_moves_runspec_batch">
<title>MOVES Runspec batch script</title>
<section>
<title>Description</title>
<para>The MOVES Runspec batch script file <quote>runspec.csh</quote> is used to execute the MOVES runs for the representative county and reference fuel month. </para>
<para>The output directories are named according to the following naming convention: [CountyRep]_[monthID]_[YearID]_[PollutantID], ie. 13121_Apr_2009_ozone</para>
<para>The output files include:</para>
<itemizedlist>
<listitem>
<para>rateperdistance.[frm|MYD|MYI]</para>
</listitem>
<listitem>
<para>ratepervehicle.[frm|MYD|MYI]</para>
</listitem>
<listitem>
<para>rateperprofile.[frm|MYD|MYI]</para>
</listitem>
</itemizedlist>
</section>
<section>
<title>Processing Order</title>
<para>runspec.csh is created by <command>Runspec_generator.pl</command> and should be run after importer.csh and before <command>moves2smkEF.pl</command>. The runspec.csh is written in Linux c-shell script format depending on which platform is being used (this option is specified by the user in the Runspec_generator.pl) the script is used to run MOVES for the appropriate temperature bins, source types, and poluutants. </para>
<para>The runspec.csh uses following steps:</para>
<orderedlist>
<listitem>
<para>The runspec.csh contains all of the user selections needed to run MOVES using the imported MySQL MOVES databases that were created by importer.csh</para>
</listitem>
<listitem>
<para>Creates the MOVES output in ASCII format and also provides the associated XML files for the three different emissions processes: RPD, RPV, RPP.</para>
</listitem>
<listitem>
<para>Review log file of the MOVES, called runlog_*.txt.</para>
</listitem>
</orderedlist>
</section>
<section>
<title>Files, Environment Variables, and Run Syntax</title>
<section>
<title>Input Files</title>
<informaltable>
<tgroup cols="3">
<colspec colwidth="40*" />
<colspec colwidth="10*" />
<colspec colwidth="50*" />
<thead>
<row>
<entry>File Name</entry>
<entry>Format</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry><link linkend="section_moves_runspec_batch">runspec.csh</link></entry>
<entry>ASCII</entry>
<entry>runspec script to use the MySQL MOVES databases created by importer.csh and run MOVES</entry>
</row>
<row>
<entry>RV_[SCC]_[YR]_[M]_[TempBin]_mrs.xml </entry>
<entry>XML</entry>
<entry>importer file specifies the zonemonthhour (*zmh.csv files that will be imported to MOVES for the Rate Per Vehicle Mode</entry>
</row>
<row>
<entry>RP_[SCC]_[YR]_[M]_[ProfMYEAR???]_mrs.xml </entry>
<entry>XML</entry>
<entry>importer file specifies the *.csv files that will be imported to MOVES for the Rate Per Process Mode</entry>
</row>
<row>
<entry>RD_[SCC]_[YR]_[M]_[TempBin]_[85 or 90?]_mrs.xml </entry>
<entry>XML</entry>
<entry>importer file specifies the *.csv files that will be imported to MOVES for Rate Per Distance Mode</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>
<section>
<title>Output Files</title>
<para>Note: these output files are placed in separate directories for each representative county, fuel month and pollutant. Example: .../outputs/mysql/13121_Jan_2009_ozone</para>
<informaltable><tgroup cols="3">
<colspec colwidth="40*" />
<colspec colwidth="9*" />
<colspec colwidth="40*" />
<thead>
<row>
<entry>File Name</entry>
<entry>Format</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>rateperdistance.[frm|MYD|MYI]</entry>
<entry>MySQL </entry>
<entry>MOVES MySQL Database RPD Table (*.frm,*.MYD,*.MYI)</entry>
</row>
<row>
<entry>ratepervehicle.[frm|MYD|MYI]</entry>
<entry>MySQL</entry>
<entry>MOVES MySQL Database RPV Table(*.frm,*.MYD,*.MYI)</entry>
</row>
<row>
<entry>ratepervehicle_smoke.[frm|MYD|MYI]</entry>
<entry>MySQL</entry>
<entry>MOVES MySQL Database RPV SMOKE format Table(*.frm,*.MYD,*.MYI)</entry>
</row>
<row>
<entry>rateperprofile.[frm|MYD|MYI]</entry>
<entry>MySQL</entry>
<entry>MOVES MySQL Database RPP Table (*.frm,*.MYD,*.MYI)</entry>
</row>
<row>
<entry>rateperprofile_smoke.[frm|MYD|MYI]</entry>
<entry>MySQL</entry>
<entry>MOVES MySQL Database RPP SMOKE format Table (*.frm,*.MYD,*.MYI)</entry>
</row>
<row>
<entry>activitytype.[frm|MYD|MYI]</entry>
<entry>MySQL </entry>
<entry>MOVES MySQL Database activity type Table (*.frm,*.MYD,*.MYI)</entry>
</row>
<row>
<entry>agefractotals.[frm|MYD|MYI]</entry>
<entry>MySQL</entry>
<entry>MOVES age fraction totals Table(*.frm,*.MYD,*.MYI)</entry>
</row>
<row>
<entry>movesactivityoutput.[frm|MYD|MYI]</entry>
<entry>MySQL</entry>
<entry>MOVES MySQL Database activity output Table (*.frm,*.MYD,*.MYI)</entry>
</row>
<row>
<entry>moveserror.[frm|MYD|MYI]</entry>
<entry>MySQL </entry>
<entry>MOVES MySQL Database error Table (*.frm,*.MYD,*.MYI)</entry>
</row>
<row>
<entry>moveseventlog.[frm|MYD|MYI]</entry>
<entry>MySQL</entry>
<entry>MOVES MySQL Database event log Table(*.frm,*.MYD,*.MYI)</entry>
</row>
<row>
<entry>movesoutput.[frm|MYD|MYI]</entry>
<entry>MySQL</entry>
<entry>MOVES MySQL Database output Table (*.frm,*.MYD,*.MYI)</entry>
</row>
<row>
<entry>movesrun.[frm|MYD|MYI]</entry>
<entry>MySQL</entry>
<entry>MOVES MySQL Database run Table (*.frm,*.MYD,*.MYI)</entry>
</row>
<row>
<entry>movestablesused.[frm|MYD|MYI]</entry>
<entry>MySQL </entry>
<entry>MOVES MySQL Database tables used Table (*.frm,*.MYD,*.MYI)</entry>
</row>
<row>
<entry>movesworkersused.[frm|MYD|MYI]</entry>
<entry>MySQL</entry>
<entry>MOVES MySQL Database workers used Table(*.frm,*.MYD,*.MYI)</entry>
</row>
<row>
<entry>moves.[frm|MYD|MYI]</entry>
<entry>MySQL</entry>
<entry>MOVES MySQL Database output Table (*.frm,*.MYD,*.MYI)</entry>
</row>
<row>
<entry>rdprex.[frm|MYD|MYI]</entry>
<entry>MySQL</entry>
<entry>MOVES MySQL Database RDPREX Table(*.frm,*.MYD,*.MYI)</entry>
</row>
<row>
<entry>rpprex.[frm|MYD|MYI]</entry>
<entry>MySQL</entry>
<entry>MOVES MySQL Database RPPREX output Table (*.frm,*.MYD,*.MYI)</entry>
</row>
<row>
<entry>rvprex.[frm|MYD|MYI]</entry>
<entry>MySQL</entry>
<entry>MOVES MySQL Database RVPREX Table(*.frm,*.MYD,*.MYI)</entry>
</row>
<row>
<entry>sccvtypeagedistribution.[frm|MYD|MYI]</entry>
<entry>MySQL</entry>
<entry>MOVES MySQL Database SCCV Type Age Distribution output Table (*.frm,*.MYD,*.MYI)</entry>
</row>
<row>
<entry>sccvtypeagedistribution_final.[frm|MYD|MYI]</entry>
<entry>MySQL</entry>
<entry>MOVES MySQL Database SCCV Type Age Distribution Final output Table (*.frm,*.MYD,*.MYI)</entry>
</row>
<row>
<entry>tmprdscc.[frm|MYD|MYI]</entry>
<entry>MySQL</entry>
<entry>MOVES MySQL Database temporary RD SCC output Table (*.frm,*.MYD,*.MYI)</entry>
</row>
<row>
<entry>tmprpscc.[frm|MYD|MYI]</entry>
<entry>MySQL</entry>
<entry>MOVES MySQL Database temporary RP SCC output Table (*.frm,*.MYD,*.MYI)</entry>
</row>
<row>
<entry>tmprvscc.[frm|MYD|MYI]</entry>
<entry>MySQL</entry>
<entry>MOVES MySQL Database temporary RV SCC output Table (*.frm,*.MYD,*.MYI)</entry>
</row>
<row>
<entry>tmp_sccroadtypedistribution.[frm|MYD|MYI]</entry>
<entry>MySQL</entry>
<entry>MOVES MySQL Database temporary scc road type distribution output Table (*.frm,*.MYD,*.MYI)</entry>
</row>
<row>
<entry>tmp_srcfuelagedistribution.[frm|MYD|MYI]</entry>
<entry>MySQL</entry>
<entry>MOVES MySQL Database temporary source fuel age distribution output Table (*.frm,*.MYD,*.MYI)</entry>
</row>
<row>
<entry>travelfrac_denominator.[frm|MYD|MYI]</entry>
<entry>MySQL</entry>
<entry>MOVES MySQL Database travel fraction denominator Table (*.frm,*.MYD,*.MYI)</entry>
</row>
<row>
<entry>travelfrac_numerator.[frm|MYD|MYI]</entry>
<entry>MySQL</entry>
<entry>MOVES MySQL Database travel fraction numerator Table (*.frm,*.MYD,*.MYI)</entry>
</row>
<row>
<entry>travelfractions.[frm|MYD|MYI]</entry>
<entry>MySQL</entry>
<entry>MOVES MySQL Database travel fractions Table (*.frm,*.MYD,*.MYI)</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>
</section>
</section>
</section>
<section id="section_moves_postprocessing_scripts">
<title>MOVES Post-processing scripts</title>
<section>
<title>Overview</title>
<para>The MOVES Post-processing scripts consist of two Perl scripts. One is called <command><quote>Moves2smkEF.pl</quote></command> which extracts the emissions factor tables from the MOVES databases and converts them into a format that can be used as SMOKE inputs. The second script, called <command><quote>gen_8digit_scc.pl</quote></command>, produces a file mapping 8-digit SCCs to 10-digit SCCs used when importing activity data in <command>Smkinven</command>.</para>
</section>
<section>
<title><command>Moves2smkEF.pl</command></title>
<section>
<title>Description</title>
<para>The MOVES post-processor script <command><quote>Moves2smkEF.pl</quote></command> extracts the emission factor tables from the MOVES databases (RPD, RPV, RPP, and RPH MOVES formatted Lookup tables) and converts them into a format that can be processed using <command>Movesmrg</command>.</para>
<orderedlist>
<listitem>
<para>Create a new field for 'countyID'</para>
<para>None of the MOVES lookup tables contain a countyID field solely dedicated to a state-county FIPS code, but SMOKE needs this information. For this reason, <command>Moves2smkEF.pl</command> creates a county field by extracting it from other fields that include county codes as part of their value. The RPD table has a linkID field that contains countyID in the leading five digits followed by more numbers to allow for future implementation of link modeling. The RPV table has a zoneID field that is countyID with a trailing zero. The RPP table has a TemperatureProfileID field, which also leads with countyID and is trailed by other numbers to indicate month and other identification. The RPH table has a linkID field the same as the RPD table. The postprocessing script parses countyID from linkID, zoneID and TemperatureProfileID and stores it as a separate field.</para>
</listitem>
<listitem>
<para>Map MOVES pollutantID to output pollutant/species name</para>
<para>The pollutant mapping file has columns for MOVES2014 Pollutant ID, MOVES2014 Pollutant Name, and SMOKE Pollutant/Model Species Name. <command>Moves2smkEF.pl</command> reads this list to determine which MOVES pollutants to output in the emission factor files and what name to use for each pollutant. Because MOVES2014 contains emission factors for both inventory pollutants and model species, the sample pollutant mapping file included with SMOKE uses the _INV suffix to distinguish inventory pollutants from model species.</para>
</listitem>
<listitem>
<para>Cross-tab pollutantID to reduce output table size</para>
<para>Each of the four MOVES lookup tables contains a pollutantID field, and associated emission rates for each are listed in the ratePerDistance, ratePerVehicle, or ratePerHour field (depending on lookup table). This table structure repeats the leftmost fields (e.g., MOVESRunID, yearID, monthID) for each pollutantID, which greatly increases the total number of rows. The cross-tabbing postprocessing step replaces the column for 'ratePerDistance' (or 'ratePerVehicle' or 'ratePerHour') with additional pollutant-specific columns containing values of emission rates. For example, new field headings would include 'CO_INV', 'NOX', 'BENZENE_INV', etc. Performing this cross-tab on the pollutant emission rates significantly reduces the size of the tables for use by SMOKE.</para>
</listitem>
<listitem>
<para>Aggregate emission factors by fuel type, source type, road type, and/or process type</para>
<para>To reduce the total number of sources to be processed in SMOKE, <command>Moves2smkEF.pl</command> supports user-specified aggregations of MOVES fuel types, source types, road types, and process types to SCCs.</para>
</listitem>
<listitem>
<para>Apply formulas to calculate additional inventory pollutants or model species</para>
<para>Formulas can be applied to augment the existing MOVES output pollutants. For example, speciated versions of criteria pollutants are not provided in the MOVES2014 output nor are speciated emission factors for brake and tire wear.</para>
</listitem>
<listitem>
<para>Create final emission rate lookup tables in SMOKE format</para>
<para>The four postprocessed tables named rateperdistance_smoke, ratepervehicle_smoke, rateperprofile_smoke, and rateperhour_smoke are exported from MySQL into ASCII files for their use in SMOKE.</para>
</listitem>
</orderedlist>
</section>
<section>
<title>Processing Order</title>
<para><command>Moves2smkEF.pl</command> is run after <command>Runspec_generator.pl</command>, and before any SMOKE processing. The <command>Moves2smkEF.pl</command> is written in Perl, generates SMOKE-ready MOVES lookup tables (i.e., RPD, RPV, RPP, and RPH) by each representative county and fuel month for inputs to <link linkend="sect_programs_movesmrg"><command>Movesmrg</command></link>.</para>
</section>
<section>
<title>Files, Environment Variables and Run Syntax</title>
<section>
<title>Input Files</title>
<informaltable id="tbl_moves_lookup_tables">
<tgroup cols="3">
<colspec colwidth="20*" />
<colspec colwidth="20*" />
<colspec colwidth="60*" />
<thead>
<row>
<entry>File Name</entry>
<entry>Format</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>
<simplelist>
<member>rateperdistance</member>
<member>ratepervehicle</member>
<member>rateperprofile</member>
<member>rateperhour</member>
</simplelist>
</entry>
<entry>MOVES format</entry><entry>Columns in the MOVES Emission Rate Lookup Table are described in <xref linkend="tbl_concepts_moves_lookup_tbl_mv_format"/>.</entry></row><row>
</row>
<row>
<entry><envar>InputDBList</envar>:</entry>
<entry>ASCII</entry>
<entry>List of MySQL database names to process generated by <command>Runspec_generator.pl</command></entry>
</row>
<row>
<entry><envar>PollutantFormulasFile</envar>:</entry>
<entry>ASCII</entry>
<entry>List of formulas used to calculate additional emission factors</entry>
</row>
<row>
<entry><envar>FuelTypeMappingFile</envar>:</entry>
<entry>ASCII</entry>
<entry>List of MOVES fuel type IDs and corresponding aggregated fuel type ID</entry>
</row>
<row>
<entry><envar>SourceTypeMappingFile</envar>:</entry>
<entry>ASCII</entry>
<entry>List of MOVES source type IDs and corresponding aggregated source type ID</entry>
</row>
<row>
<entry><envar>RoadTypeMappingFile</envar>:</entry>
<entry>ASCII</entry>
<entry>List of MOVES road type IDs and corresponding aggregated road type ID</entry>
</row>
<row>
<entry><envar>ProcessTypeMappingFile</envar>:</entry>
<entry>ASCII</entry>
<entry>List of MOVES process type IDs and corresponding aggregated process type ID</entry>
</row>
<row>
<entry><envar>PollutantMappingFile</envar>:</entry>
<entry>ASCII</entry>
<entry>List of MOVES pollutant IDs and corresponding pollutant name; only listed pollutants will be included in output emission factor tables</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>
<section>
<title>Run Command syntax</title>
<programlisting>
moves2smkEF.pl [-r RPD|RPV|RPP|RPH] [--formulas PollutantFormulasFile] [--fuel_agg FuelTypeMappingFile] [--src_agg SourceTypeMappingFile] [--road_agg RoadTypeMappingFile] [--proc_agg ProcessTypeMappingFile] InputDBList PollutantMappingFile [OutputPath]
</programlisting>
<itemizedlist>
<listitem>
RPD|RPP|RPV|RPH - optional type of emission factors to process (rate-per-distance, rate-per-vehicle, rate-per-profile, or rate-per-hour); if not specified, script will process all four types
</listitem>
<listitem>
PollutantFormulasFile - list of formulas used to calculate additional emission factors
</listitem>
<listitem>
FuelTypeMappingFile - list of MOVES fuel type IDs and corresponding aggregated fuel type ID
</listitem>
<listitem>
SourceTypeMappingFile - list of MOVES source type IDs and corresponding aggregated source type ID
</listitem>
<listitem>
RoadTypeMappingFile - list of MOVES road type IDs and corresponding aggregated road type ID
</listitem>
<listitem>
ProcessTypeMappingFile - list of MOVES process type IDs and corresponding aggregated process type ID
</listitem>
<listitem>
InputDBList - list of MySQL database names to process (generated by runspec_generator.pl MOVES preprocessor)
</listitem>
<listitem>
PollutantMappingFile - list of MOVES pollutant IDs and corresponding pollutant name
</listitem>
<listitem>
OutputPath - optional; overrides the output path specified in InputDBList
</listitem>
</itemizedlist>
</section>
<section>
<title>Output Files</title>
<informaltable id="tbl_smoke_lookup_tables">
<tgroup cols="3">
<colspec colwidth="20*" />
<colspec colwidth="20*" />
<colspec colwidth="60*" />
<thead>
<row>
<entry>File Name</entry>
<entry>Format</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry><envar>rateperdistance_smoke*.csv</envar></entry>
<entry>ASCII</entry>
<entry>RPD SMOKE formatted lookup table (fuel month specific). The format of MOVES lookup tables are described in <xref linkend="tbl_concepts_moves_lookup_tbl_sm_format"/>.</entry>
</row>
<row>
<entry><envar>ratepervehicle_smoke*.csv</envar></entry>
<entry>ASCII</entry>
<entry>RPV SMOKE formatted lookup table (fuel month specific)</entry>
</row>
<row>
<entry><envar>rateperprofile_smoke*.csv</envar></entry>
<entry>ASCII</entry>
<entry>RPP SMOKE formatted lookup table (fuel month specific)</entry>
</row>
<row>
<entry><envar>rateperhour_smoke*.csv</envar></entry>
<entry>ASCII</entry>
<entry>RPH SMOKE formatted lookup table (fuel month specific)</entry>
</row>
<row>
<entry><envar>mcrlist.rateperdistance*.lst</envar>:</entry>
<entry>ASCII</entry>
<entry>list of MOVES-based rateperdistance lookup tables </entry>
</row>
<row>
<entry><envar>mcrlist.ratepervehicle*.lst</envar>:</entry>
<entry>ASCII</entry>
<entry>list of MOVES-based ratepervehicle lookup tables </entry>
</row>
<row>
<entry><envar>mcrlist.rateperprofile*.lst</envar>:</entry>
<entry>ASCII</entry>
<entry>list of MOVES-based rateperprofile lookup tables </entry>
</row>
<row>
<entry><envar>mcrlist.rateperhour*.lst</envar>:</entry>
<entry>ASCII</entry>
<entry>list of MOVES-based rateperhour lookup tables </entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>
</section>
</section>
<section id="sect_moves_gen_sccxref">
<title><command>gen_8digit_scc.pl</command></title>
<section>
<title>Description</title>
<para>The <command>gen_8digit_scc.pl</command> script generates a file mapping 8-digits SCCs to aggregated SCCs produced by <command>Moves2smkEF.pl</command>.</para>
</section>
<section>
<title>Processing Order</title>
<para>The Perl script performs the following steps:</para>
<itemizedlist>
<listitem>
<para>Connect to the first database listed in the InputDBList file</para>
</listitem>
<listitem>
<para>Query the specified database table (rateperdistance, ratepervehicle, rateperprofile, or rateperhour) and generate a list of all SCCs in the MOVES2014 output</para>
</listitem>
<listitem>
<para>Apply the fuel type, source type, road type, and process type mappings to generate a list of 10-digit aggregated SCCs</para>
</listitem>
<listitem>
<para>Output the list of 10-digit aggregated SCCs with corresponding 8-digit SCC (first 8 digits of 10-digit SCC)</para>
</listitem>
</itemizedlist>
</section>
<section>
<title>Files, Environment Variables and Run Syntax</title>
<title>Input Files</title>
<informaltable>
<tgroup cols="3">
<colspec colwidth="20*" />
<colspec colwidth="20*" />
<colspec colwidth="60*" />
<thead>
<row>
<entry>File Name</entry>
<entry>Format</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry><envar>FuelTypeMappingFile</envar>:</entry>
<entry>ASCII</entry>
<entry>List of MOVES fuel type IDs and corresponding aggregated fuel type ID</entry>
</row>
<row>
<entry><envar>SourceTypeMappingFile</envar>:</entry>
<entry>ASCII</entry>
<entry>List of MOVES source type IDs and corresponding aggregated source type ID</entry>
</row>
<row>
<entry><envar>RoadTypeMappingFile</envar>:</entry>
<entry>ASCII</entry>
<entry>List of MOVES road type IDs and corresponding aggregated road type ID</entry>
</row>
<row>
<entry><envar>ProcessTypeMappingFile</envar>:</entry>
<entry>ASCII</entry>
<entry>List of MOVES process type IDs and corresponding aggregated process type ID</entry>
</row>
<row>
<entry><envar>InputDBList</envar>:</entry>
<entry>ASCII</entry>
<entry>List of MySQL database names to process generated by <command>Runspec_generator.pl</command>; only the first database listed will be used</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>
<section>
<title>Run Command syntax</title>
<programlisting>
gen_8digit_scc.pl -r RPD|RPV|RPP|RPH [--fuel_agg FuelTypeMappingFile] [--src_agg SourceTypeMappingFile] [--road_agg RoadTypeMappingFile] [--proc_agg ProcessTypeMappingFile] InputDBList
</programlisting>
<itemizedlist>
<listitem>
RPD|RPP|RPV|RPH - emission factor table to query (rateperdistance, ratepervehicle, rateperprofile, or rateperhour)
</listitem>
<listitem>
FuelTypeMappingFile - list of MOVES fuel type IDs and corresponding aggregated fuel type ID
</listitem>
<listitem>
SourceTypeMappingFile - list of MOVES source type IDs and corresponding aggregated source type ID
</listitem>
<listitem>
RoadTypeMappingFile - list of MOVES road type IDs and corresponding aggregated road type ID
</listitem>
<listitem>
ProcessTypeMappingFile - list of MOVES process type IDs and corresponding aggregated process type ID
</listitem>