-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathch04_scripts.xml
More file actions
3427 lines (2645 loc) · 216 KB
/
ch04_scripts.xml
File metadata and controls
3427 lines (2645 loc) · 216 KB
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_scripts">
<title>How to Use SMOKE</title>
<section id="sect_scripts_introduction">
<title>Introduction</title>
<para>In this chapter, we provide information about using the UNIX scripts that come with SMOKE to run the test cases and adapting the scripts to run any case. There are several features of these scripts that specifically support SMOKE v1.5 and later, and using scripts developed for earlier versions of SMOKE will not work without adaptations. We provide a section in this document that explains what changes need to be made to users’ existing scripts to allow them to work with SMOKE. Alternatively, current users can adapt the new example scripts to their case. New users are advised to create their scripts based on the example scripts, following the instructions included in <xref linkend="sect_scripts_how_use_smoke" /> this chapter.</para>
<para>For all SMOKE users, a critical file to use and know about is the Assigns file. If you have followed the SMOKE installation instructions, then your Assigns file will be located in the directory: <filename class="directory"><envar>$SMK_HOME</envar>/subsys/smoke/assigns</filename> where the <envar>SMK_HOME</envar> directory is set in your <filename>.cshrc</filename> file in your home directory, during the SMOKE installation process.</para>
<para><emphasis role="bold">When using SMOKE, the first thing that you should do is go to the Assigns directory and invoke the Assigns file for the case that you will be working with. This step needs to be taken in every UNIX window from which you intend to run SMOKE.</emphasis></para>
<para>To invoke the Assigns file, use the following commands:</para>
<para><userinput><command>cd</command> <filename class="directory"><envar>$SMK_HOME</envar>/subsys/smoke/assigns</filename></userinput> <emphasis>(this changes to the correct directory)</emphasis></para>
<para><userinput><command>source</command> <filename>ASSIGNS.nctox.cmaq.cb05_soa.us12-nc</filename></userinput> <emphasis>(this invokes the default assigns file)</emphasis></para>
<para>Doing this will set a large number of environment variables that you will then have available for navigating the SMOKE directory structure. <xref linkend="tbl_scripts_variables_files" /> and <xref linkend="tbl_scripts_variables_time" /> in <xref linkend="sect_scripts_change_assigns" /> list those environment variables. The environment variables used to build some of the directory names are also set by the user in the Assigns file and described in that section.</para>
</section>
<section id="sect_dirs_example_data_files">
<para>Many of the support files used in the test cases are based on the EPA’s NEI modeling platform, available online at EPA’s Emission Modeling Clearinghouse (<ulink url="http://www.epa.gov/ttn/chief/emch/index.html">http://www.epa.gov/ttn/chief/emch/</ulink>). </para>
<title>Test case descriptions</title>
<section id="sect_scripts_nctox_case">
<title>nctox case for area, nonroad, mobile, biogenic and point sources</title>
<para>The nctox case provides users with an example of using both criteria and toxics emissions inventories. The purposes of this case include:</para>
<itemizedlist>
<listitem>
<para>Providing a test case for SMOKE on users computers. It is not recommended for actual user's emissions modeling work.</para>
</listitem>
<listitem>
<para>Provide example scripts that users may adapt to their own cases</para>
</listitem>
</itemizedlist>
<para>This case has the following major features. It runs for July 10th and 11th, 2005 on a 12-km Lambert Conformal grid over North Carolina. The spatial extent of this case has been limited to provide a relatively fast test case, and the domain is a subdomain of EPA’s 12-km national grid. The case includes toxics processing for stationary area, nonroad mobile, and point sources.</para>
<figure id="fig_scripts_nctox_domain">
<title>nctox domain</title>
<mediaobject>
<imageobject role="pdf">
<imagedata width="5in" fileref="images/scripts/nctox_domain_pdf.jpg" />
</imageobject>
<imageobject role="html">
<imagedata fileref="images/scripts/nctox_domain_html.jpg" />
</imageobject>
</mediaobject>
</figure>
<para>At this time, the case uses North Carolina records <emphasis>only</emphasis> from the following inventory data:</para>
<para><emphasis role="bold">stationary area sources:</emphasis> 2005 NEI for CO, NO<subscript>x</subscript>, VOC, SO<subscript>2</subscript>, NH<subscript>3</subscript>, PM<subscript>10</subscript>, and PM<subscript>2.5</subscript> from nonpt, averfire and alm sectors</para>
<para><emphasis role="bold">nonroad mobile sources:</emphasis> 2005 NEI for CO, NO<subscript>x</subscript>, VOC, SO<subscript>2</subscript>, NH<subscript>3</subscript>, PM<subscript>10</subscript>, and PM<subscript>2.5</subscript> from nonroad sector</para>
<para><emphasis role="bold">point sources:</emphasis> 2005 NEI for CO, NO<subscript>x</subscript>, VOC, SO<subscript>2</subscript>, NH<subscript>3</subscript>, PM<subscript>10</subscript>, and PM<subscript>2.5</subscript> from ptipm and ptnonipm sectors</para>
<para><emphasis role="bold">mobile sources:</emphasis> vehicle mileage traveled (VMT) and its average speed (SPEED), and vehicle average hotteling (HOTELLING) for onroad mobile sources, and vehicle population (VPOP) for offroad mobile sources</para>
<para><emphasis role="bold">biogenic sources:</emphasis> BELD3 data processed using BEIS3 (for entire grid, even those cells that are not in North Carolina)</para>
<para>For area, mobile, and point sources, this case uses toxics inventories for ozone modeling. The VOC model species for the current CB6 mechanism are based in part on the toxic inventory. SMOKE resolves the duplicate VOC mass caused by combining VOC emissions with toxic VOC emissions by subtracting the toxic VOC mass from the VOC mass and computing a NONHAPVOC emissions value. This is the <quote>integrate</quote> approach for VOC emissions, described in <xref linkend="sect_concepts_combine_toxics" />. The speciation profiles provided with this version of SMOKE include profiles that map the toxics VOC and NONHAPVOC pollutants to current CB6 species. Choices for speciation profiles in this version of SMOKE are listed in <xref linkend="sect_scripts_change_speciation" />.</para>
<para>In addition to the inventory data listed above, the parameters of the case are the following:</para>
<itemizedlist>
<listitem>
<para><emphasis role="bold">Episode:</emphasis> July 10th and 11th of 2005</para>
</listitem>
<listitem>
<para><emphasis role="bold">Output time zone:</emphasis> Greenwich Mean Time (zone 0)</para>
</listitem>
<listitem>
<para><emphasis role="bold">Projection:</emphasis> Lambert Conformal with Alpha=33, Beta=45, Gamma=-97, and center at (-97,40)</para>
</listitem>
<listitem>
<para><emphasis role="bold">Domain:</emphasis> Origin at (1128, -672) kilometers with 66 columns by 52 rows and 12-km square grid cells (shown in <xref linkend="fig_scripts_nctox_domain" />)</para>
</listitem>
<listitem>
<para><emphasis role="bold">Meteorology data:</emphasis> Daily (25-hour) 2005 meteorology files generated originally by EPA using MM5 and MCIP; the files have been reduced to the modeling domain and contain only the variables needed by SMOKE.</para>
</listitem>
<listitem>
<para><emphasis role="bold">Chemical speciation data:</emphasis> Revised <envar>GSPRO</envar> and <envar>GSREF</envar> files to include toxic pollutants mapped to current-CB6 mechanism for both on-road and nonroad mobile source classification category (SCC) codes.</para>
</listitem>
</itemizedlist>
</section>
<section id="sect_scripts_script_descriptions">
<title>Script descriptions</title>
<section>
<title>Overview</title>
<para>Running SMOKE from scripts provides a flexible approach to running SMOKE. We recommend that new users start with the standard configuration of scripts and directories provided with the default installation. This configuration uses the directory structures described in <xref linkend="ch_dirs_files" /> and a separate run script for each source category, as we will get to soon. In <xref linkend="sect_scripts_how_use_smoke" />, we provide all of the information you need to know to adapt the test case configuration to your modeling case. If you ever want to move beyond using the default configuration, we do not describe how to do that in detail. In fact, we could not describe this, because there are an infinite number of ways to arrange the directories and scripting for SMOKE; however, we have provided some information about what do to in <xref linkend="sect_dirs_change_directory" />.</para>
<para>Running SMOKE using scripts involves many scripts working together. This can be confusing for new users, but we have made efforts to make using the scripts easier and more robust with this version of SMOKE.</para>
<para>All SMOKE scripts can be found in the <filename class="directory"><envar>$SMKROOT</envar>/scripts/run</filename> directory, or simply the <filename class="directory"><envar>$SCRIPTS</envar>/run</filename> directory (after having invoked the Assigns file).</para>
</section>
<section id="sect_scripts_assigns_files">
<title>Assigns files</title>
<para>The assigns files are located in <filename class="directory"><envar>$SMKROOT</envar>/assigns</filename>. The nctox case assigns file is called <filename>ASSIGNS.nctox.cmaq.cb05_soa.us12-nc</filename>. One Assigns file is provided for the nctox case, and you can create your own files by copying it to a new name and changing it. At least one Assigns file must come with each preconfigured run (such as the nctox case) for SMOKE.</para>
<para>The Assigns files are divided into three major sections. The first section contains environment variables for controlling the setup of a case, such as the dates being modeled, the name of the grid, and the name of the chemical mechanism. The second section lists all of the input files in SMOKE (by source category) and users can change these adapt the Assigns files to their cases by changing the input files. The third section calls helper scripts to create input and output directories and configure the compiler environment variables. It is wise to copy an existing Assigns files to new files and modify the new files, so that you do not lose the default configuration.</para>
<para>In addition, there are a number of helper scripts used by the Assigns files. Unless users are changing the way SMOKE behaves when running from scripts, it should not be necessary to change these scripts. Changing them could result in behavior different from what is documented in this chapter. The helper scripts and their purposes are:</para>
<itemizedlist>
<listitem>
<para><filename>check_settings.scr</filename>: Set all environment variables used in Assigns file to default values if they are not already defined by a calling script (e.g., when invoking the Assigns file from the UNIX prompt instead of a script).</para>
</listitem>
<listitem>
<para><filename>set_case.scr</filename>: Set the environment variables that control output file names (<envar>ABASE</envar>, <envar>BBASE</envar>, <envar>MBASE</envar>, <envar>PBASE</envar>, <envar>EBASE</envar>, <envar>ASCEN</envar>, <envar>BSCEN</envar>, <envar>MSCEN</envar>, <envar>PSCEN</envar>, and <envar>ESCEN</envar>). See also the <envar>SMK_FUTURE_YN</envar>, <envar>FYEAR</envar>, <envar>SMK_CONTROL_YN</envar>, and <envar>CNTLCASE</envar> script settings in <xref linkend="sect_scripts_script_settings" /></para>
</listitem>
<listitem>
<para><filename>set_dirs.scr</filename>: Set the SMOKE directory structure</para>
</listitem>
<listitem>
<para><filename>setmerge_files.scr</filename>: Set <command>Smkmerge</command> output file names, depending on run script settings</para>
</listitem>
<listitem>
<para><filename>smk_mkdir</filename>: Create input and output directories</para>
</listitem>
<listitem>
<para><filename>smk_rmfiles.scr</filename>: Remove SMOKE intermediate and output files</para>
</listitem>
<listitem>
<para><filename>sysflags</filename>: Set the compiler options needed for compiling SMOKE</para>
</listitem>
<listitem>
<para><filename>unset.scr</filename>: Unset environment variables that do not need to be defined after the Assigns file has been run</para>
</listitem>
</itemizedlist>
</section>
</section>
<section id="sect_scripts_example_scripts">
<title>Example script files and their purposes</title>
<para>The following files are currently provided with the SMOKE release. There are a number of helper scripts. The only one that users may want to change is the <filename>qa_run.scr</filename> script to add configurations for reporting. The helper scripts are:</para>
<itemizedlist>
<listitem>
<para><filename>cntl_run.csh</filename>: Runs the <command>Cntlmat</command> and <command>Grwinven</command> program. Sets the required <envar>GCNTL</envar> file name depending on script settings, as explained in <xref linkend="sect_scripts_use_projection" />.</para>
</listitem>
<listitem>
<para><filename>make_invdir.csh</filename>: Sets the <envar>INVNAME1</envar> and <envar>INVNAME2</envar> settings that <command>Smkinven</command> uses for creating the map-formatted inventory intermediate files.</para>
</listitem>
<listitem>
<para><filename>metcombine.csh</filename>: Runs the utility program <command>Metcombine</command> to combine the <filename>METCRO2D*</filename> and <filename>METCRO3D*</filename> files in the <filename class="directory"><envar>$METDAT</envar></filename> directory. This script creates files named <filename>METCOMBO*</filename> in the <filename class="directory"><envar>$METDAT</envar></filename> directory.</para>
</listitem>
<listitem>
<para><filename>movelog.csh</filename>: Deletes or renames the log files, depending on the <envar>AUTO_DELETE_LOG</envar> setting.</para>
</listitem>
<listitem>
<para><filename>qa_run.csh</filename>: Runs the <command>Smkreport</command> program</para>
</listitem>
<listitem>
<para><filename>smk_run.csh</filename>: Runs the following SMOKE programs: <command>Smkinven</command>, <command>Rawbio</command> (for both winter and summer runs), <command>Normbeis3</command>, <command>Spcmat</command>, <command>Grdmat</command>, <command>Metscan</command>, <command>Temporal</command>, <command>Tmpbio</command>, <command>Tmpbeis3</command>, <command>Smkmerge</command>, <command>Mrggrid</command>, and <command>Smk2emis</command>.</para>
<para>Creates <envar>PTMPLIST</envar> file for <command>Elevpoint</command> by assuming all files with the name pattern <filename>ptmp*<envar>$PSCEN</envar>*ncf</filename> in the <filename class="directory"><envar>$SMKDAT</envar>/run_<envar>$PSCEN</envar>/*</filename> directories should be included in the file.</para>
<para>Creates the <envar>METLIST</envar> and <envar>RADLIST</envar> files for <command>Tmpbio</command> by listing <envar>$MET_FILE1</envar> to <envar>METLIST</envar> and <envar>$MET_FILE2</envar> to <envar>RADLIST</envar>. <envar>MET_FILE1</envar> and <envar>MET_FILE2</envar> are set in the Assigns file.</para>
<para>Determines which speciation matrix is needed for <command>Smkmerge</command>, based on the requested units. If the <envar>MRG_GRDOUT_UNIT</envar> setting contains the string <quote>mole</quote> then the molar speciation matrix and molar gridded, hourly biogenic emissions are set to be used by <command>Smkmerge</command>.</para>
<para>Creates the <envar>FILELIST</envar> file for <command>Mrggrid</command> from the <envar>MRGFILES</envar> setting in the calling merge run script.</para>
</listitem>
</itemizedlist>
</section>
<section id="sect_scripts_script_settings">
<title>Script settings</title>
<para>The SMOKE scripts have many environment variables that users can set based on the program documentation in <xref linkend="ch_programs" />, as well as environment variables that control the scripts. The variables that control the behavior of the scripts are described in this section. The settings are listed in alphabetical order.</para>
<para><emphasis role="bold">Note that using upper case for the names of these settings in the scripts is required. Any values that are Y or N settings must also be upper case.</emphasis></para>
<para>For documentation on the <envar>A_SPC_OVERRIDE</envar>, <envar>N_SPC_OVERRIDE</envar>, <envar>B_SPC_OVERRIDE</envar>, <envar>M_SPC_OVERRIDE</envar>, and <envar>P_SPC_OVERRIDE</envar> settings, please refer to the <envar>SPC_OVERRIDE</envar> description.</para>
<itemizedlist>
<listitem>
<para><envar>AUTO_DELETE</envar>: [Y | N] When set to Y, will delete all SMOKE intermediate and output I/O API files automatically. It will not delete intermediate and output ASCII files or reports.</para>
</listitem>
<listitem>
<para><envar>AUTO_DELETE_LOG</envar>: [Y | N] When set to Y, SMOKE log files will be automatically deleted. Otherwise, the files will be automatically renamed by appending a number to the end. The first time the a log file needs to be overwritten, but <envar>AUTO_DELETE_LOG</envar> is N, the file will be renamed to a file name with an <quote>_1</quote> appended to the original name. If the same file needs to be moved on a subsequent rerun and the <quote>_1</quote> file is already there, then a <quote>_2</quote> file will be created.</para>
</listitem>
<listitem>
<para><envar>CNTLCASE</envar>: When this is defined to a name of the control case and the <envar>SMK_CONTROL_YN</envar> setting is Y, the following changes are made to the naming environment variables by the <filename><envar>$ASSIGNS</envar>/set_case.scr file</filename>:</para>
<programlisting>setenv ASCEN ${ASCEN}_${CNTLCASE}
setenv MSCEN ${MSCEN}_${CNTLCASE}
setenv PSCEN ${PSCEN}_${CNTLCASE}
setenv ESCEN ${ESCEN}_${CNTLCASE}
setenv FYIOP ${FYIOP}_${CNTLCASE}</programlisting>
<para>When the <envar>CNTLCASE</envar> name is set, regardless of the <envar>SMK_CONTROL_YN</envar> setting, the <filename><envar>$ASSIGNS</envar>/set_case.scr</filename> file also resets <envar>FYINV</envar> as follows:</para>
<programlisting>setenv FYINV ${FYINV}_${CNTLCASE}</programlisting>
<para>This setting is also used for automatic naming of the <envar>GCNTL</envar> file input to <command>Cntlmat</command>. See <xref linkend="sect_scripts_use_projection" />.</para>
</listitem>
<listitem>
<para><envar>DEBUG_EXE</envar>: Should be set to the name of the fortran debugger (e.g., dbx) to use when running with <envar>DEBUGMODE</envar> set to Y.</para>
</listitem>
<listitem>
<para><envar>DEBUGMODE</envar>: [Y | N] When set to Y, the scripts will try to invoke the debug versions of the SMOKE executables. These will only be available to be used if the debug versions of the executables have been created using the <command>Makeall debug</command> command in the <filename class="directory"><envar>$SCRIPTS</envar>/make</filename> directory.</para>
</listitem>
<listitem>
<para><envar>FYEAR</envar>: The 4-digit future year value is used for renaming files and directories when the <envar>SMK_FUTURE_YN</envar> setting is Y. When this is true, the following changes are made to the naming environment variables by the <filename><envar>$ASSIGNS</envar>/set_case.scr</filename> script:</para>
<programlisting>setenv ASCEN ${ASCEN}-${fyr2}
setenv MSCEN ${MSCEN}-${fyr2}
setenv PSCEN ${PSCEN}-${fyr2}
setenv ESCEN ${ESCEN}-${fyr2}
setenv FYIOP ${INVOP}-${fyr2}
</programlisting>
<para>where <envar>${fyr2}</envar> is the last two digits of the <envar>FYEAR</envar> value. These 2 digits are inserted into the output file names for <command>Smkinven</command> output files when <envar>SMK_FUTURE_YN</envar> is set to Y.</para>
<para>In addition, when <envar>FYEAR</envar> is defined, the <filename><envar>$ASSIGNS</envar>/set_case.scr</filename> script makes the follows settings regardless of the value of <envar>SMK_FUTURE_YN</envar>.</para>
<programlisting>setenv FYINV ${FYINV}_${fyr2}
setenv BYFYR ${BYFYR}_${fyr2}</programlisting>
<para>This setting is also used for automatic naming of the <envar>GCNTL</envar> file input to <command>Cntlmat</command>. See <xref linkend="sect_scripts_use_projection" />.</para>
</listitem>
<listitem>
<para><envar>G_STDATE_ADVANCE</envar>: The value should be set to the number of days for 1 run of the <command>Temporal</command>, <command>Laypoint</command>, and <command>Smkmerge</command> programs. The example scripts have this set by the <envar>NDAYS</envar> environment variable in the Assigns file. When this value is set, the Assigns file will automatically increment the <envar>ESDATE</envar> and <envar>G_STDATE</envar> environment variables (that control SMOKE file names and time-dependent programs, respectively) to the next day. This feature is unable to cross from one year to the next.</para>
</listitem>
<listitem>
<para><envar>INVTABLE_OVERRIDE</envar>: Sets a file name for the <envar>INVTABLE</envar> file in the Assigns file that overrides whatever value is actually inside the Assigns file. The Assigns file invokes the override mechanism when this environment variable is defined, so to <emphasis>not</emphasis> use this scripting feature, the variable must <emphasis>not</emphasis> be defined. <emphasis role="bold">In other words, it is not acceptable to set this to a blank value.</emphasis></para>
</listitem>
<listitem>
<para><envar>MRG_GRDOUT_UNIT</envar>: While this setting is primarily a setting for the <command>Smkmerge</command> program, it is also used by the SMOKE scripts to determine whether <command>Smkmerge</command> should use mole-based or mass-based speciation matrices and biogenic model-ready files. When the variable is set with the first four letters to <quote>mole</quote>, for example moles/hr, mole/s, or moles/day, the <command>Smkmerge</command> program will be provided by the scripts the correct input files. The implementation of this feature currently means that units of <quote>gm mole</quote> will not work properly.</para>
</listitem>
<listitem>
<para><envar>NONROAD</envar>: [Y | N] When set to Y, the Assigns file will automatically rename all of the SMOKE area-source intermediate and output files using the <quote>n</quote> prefix on file names instead of the <quote>a</quote> prefix. For example, the <envar>ATMP</envar> file is set to <filename><envar>$SCENARIO</envar>/ntmp.ncf</filename> instead of <filename><envar>$SCENARIO</envar>/atmp.ncf</filename>. Also, the <envar>AREA</envar> file coming out of <command>Smkinven</command> changes to be a different name and use a different map-file directory.</para>
</listitem>
<listitem>
<para><envar>PROMPTFLAG</envar>: [Y | N] When set to Y, users will be prompted for all SMOKE file names. This option should not be set to Y for non-interactive processing. In fact, there is little need for this to ever be set to Y.</para>
</listitem>
<listitem>
<para><envar>QA_LABEL</envar>: Users can label their <command>Smkreport</command> log files and QA reports using this label. Typically, the QA report names are named using the <envar>$FYIOP</envar> variable or <envar>$ESCEN</envar> variable set in the <filename><envar>$ASSIGNS</envar>/set_case.scr</filename> script. When <envar>QA_LABEL</envar> is set to something, the log files and reports are labeled with <envar>$FYIOP</envar>.<envar>$QA_LABEL</envar> or <envar>$ESCEN</envar>.<envar>$QA_LABEL</envar>. This renaming is done in the <filename>qa_run.csh</filename> helper script in the <filename class="directory"><envar>$SCRIPTS</envar>/run</filename> directory.</para>
</listitem>
<listitem>
<para><envar>QA_TYPE</envar>: [none | all | part1 | part2 | part3 | part4 or custom]. This setting controls the <filename>qa_run.csh</filename> helper script and causes different reports to be written. The <envar>QA_TYPE</envar> settings will cause the script to use different <envar>REPCONFIG</envar> files for input to <command>Smkreport</command>, and the <envar>REPCONFIG</envar> files determine which reports are generated. <xref linkend="sect_scripts_change_reports" /> explains these default settings and how to change them to create the reports that you need.</para>
</listitem>
<listitem>
<para><envar>RUN_PART1</envar>, <envar>RUN_PART2</envar>, <envar>RUN_PART3</envar>, <envar>RUN_PART4</envar>: These settings should not have to be changed by most users. They are included for the convenience of those who want to more easily rearrange their SMOKE processing. Each source category has its own parts for processing as follows:</para>
<informaltable>
<tgroup cols="5">
<colspec colname="Variable" colwidth="1*" />
<colspec colname="Area" colwidth="1*" />
<colspec colname="Biogenic" colwidth="1*" />
<colspec colname="Mobile" colwidth="1*" />
<colspec colname="Point" colwidth="1*" />
<thead>
<row>
<entry colname="Area" align="center">Area</entry>
<entry align="center">Biogenic</entry>
<entry align="center">Mobile</entry>
<entry align="center">Point</entry>
</row>
</thead>
<tbody>
<row>
<entry><envar>RUN_PART1</envar></entry>
<entry><command>Smkinven</command>, <command>Spcmat</command>, <command>Grdmat</command>, <command>Cntlmat</command>, <command>Grwinven</command></entry>
<entry><command>Rawbio</command>, <command>Normbeis3</command>, <command>Metscan</command></entry>
<entry><command>Smkinven</command>, <command>Spcmat</command>, <command>Grdmat</command>, <command>Cntlmat</command>, <command>Grwinven</command></entry>
<entry><command>Smkinven</command>, <command>Spcmat</command>, <command>Grdmat</command>, <command>Cntlmat</command>, <command>Grwinven</command></entry>
</row>
<row>
<entry><envar>RUN_PART2</envar></entry>
<entry><command>Temporal</command></entry>
<entry><command>Tmpbio</command>, <command>Tmpbeis3</command></entry>
<entry><command>Temporal</command></entry>
<entry><command>Temporal</command></entry>
</row>
<row>
<entry><envar>RUN_PART3</envar></entry>
<entry colname="Point"><command>Elevpoint</command></entry>
</row>
<row>
<entry><envar>RUN_PART4</envar></entry>
<entry><command>Smkmerge</command>, <command>Mrggrid</command>, <command>Smk2emis</command></entry>
<entry><command>Mrggrid</command>, <command>Smk2emis</command></entry>
<entry><command>Movesmrg</command>, <command>Mrggrid</command>, <command>Smk2emis</command></entry>
<entry><command>Laypoint</command>, <command>Smkmerge</command>, <command>Mrggrid</command>, <command>Smk2emis</command></entry>
</row>
</tbody>
</tgroup>
</informaltable>
</listitem>
<listitem>
<para><envar>RUN_<Program Name></envar>: [Y | N] The collection of <envar>RUN_<Program Name></envar> variables control whether a program is going to be run during a given script run. These can be set to N if the program is not needed for some reason. How these settings should be set is described in <xref linkend="sect_scripts_change_programs" />.</para>
</listitem>
<comment>
<listitem>
<para><envar>SMK_CONTROL_YN</envar>: [Y | N] <remark>Missing text</remark><comment>be sure to mention <envar>FYIOP</envar></comment></para>
</listitem>
</comment>
<listitem>
<para><envar>SMK_FUTURE_YN</envar>: [Y | N] When set to Y, the file names and output directories are changed to use the <envar>FYEAR</envar> variable setting in the names. See the <envar>FYEAR</envar> documentation for more information on how the naming variables are set. This setting is needed only in scripts for processing future-year cases.</para>
</listitem>
<listitem>
<para><envar>SPC_OVERRIDE</envar>: Sets a value for the <envar>SPC</envar> variable in the Assigns file that overrides whatever value is actually inside the Assigns file. The Assigns file invokes the override mechanism when this environment variable is defined, so to not use this scripting feature, the variable must not be defined. <emphasis role="bold">In other words, it is not acceptable to set this to a blank value.</emphasis></para>
<para>In addition, the merge scripts that run the <command>Mrggrid</command> program can also use the <envar>A_SPC_OVERRIDE</envar>, <envar>N_SPC_OVERRIDE</envar>, <envar>B_SPC_OVERRIDE</envar>, <envar>M_SPC_OVERRIDE</envar>, and <envar>P_SPC_OVERRIDE</envar> settings. These settings override the <envar>SPC</envar> variable used <emphasis>only</emphasis> for the definition of the <envar>A_OUT</envar>, <envar>N_OUT</envar>, <envar>B_OUT</envar>, <envar>M_OUT</envar>, and <envar>P_OUT</envar> directories that contain the hourly, gridded, and speciated SMOKE output files. These settings can be used to pull multiple chemical mechanisms (such as toxics and non-toxics) into a single model-ready file. The user must determine which multiple mechanisms are appropriate to combine. It is acceptable to combine toxics-integrated and criteria-only current CB6 mechanisms, but inappropriate to combine CB6 and SARPRC mechanisms.</para>
</listitem>
<listitem>
<para><envar>SRCABBR</envar>: Sets the source category abbreviation name for use in naming log files. The typical settings are ar (area sources), nr (nonroad sources), mb (mobile sources), bg (biogenic sources), and pt (point sources).</para>
</listitem>
<listitem>
<para><envar>YEAR_OVERRIDE</envar>: Sets a value for the <envar>YEAR</envar> variable in the Assigns file that overrides whatever value is actually inside the Assigns file. The Assigns file invokes the override mechanism when this environment variable is defined, so to not use this scripting feature, the variable must not be defined. <emphasis role="bold">In other words, it is not acceptable to set this to a blank value.</emphasis></para>
</listitem>
</itemizedlist>
</section>
<section>
<title>SMOKE settings controlled through scripts</title>
<para>All SMOKE programs can be controlled by input environment variables, and the run scripts control these variables. The program documentation in <xref linkend="ch_utilities" />, <xref linkend="ch_programs" />, and <xref linkend="ch_quality_assurance" /> include the available environment variable settings for each program.</para>
<para>The example run scripts contain most of the major script settings needed for running SMOKE. The major exception to this is the <envar>UAM_*</envar> settings needed for <command>Smkmerge</command> and <command>Smk2emis</command>, when running for UAM-V and CAM<subscript>X</subscript>. These can be added to the scripts as needed.</para>
</section>
</section>
<section id="sect_scripts_run_example">
<title>Running the SMOKE test case</title>
<para>As mentioned in <xref linkend="sect_scripts_introduction" />, the first step in working with SMOKE is invoking the Assigns file. In this section, we will go beyond that first step to actually running the scripts for the nctox case. But first, we will review the essential steps for running SMOKE each and every time you start to work with the SMOKE system.</para>
<para>First, the <envar>SMK_HOME</envar> environment variable needs to be defined. In <xref linkend="sect_install_install" />, we explain that you can configure your UNIX system to set this automatically each time you log into your computer. If you have not done that, then you will need to set the <envar>SMK_HOME</envar> variable manually before invoking an Assigns file:</para>
<para><userinput><command>setenv</command> <envar>SMK_HOME</envar> <replaceable><directory in which you installed SMOKE></replaceable></userinput></para>
<para>Second, you must invoke the Assigns file for the case that you want to run. This will make available all of the environment variables that you can use to navigate through the SMOKE directory structure. There is a different Assigns file for each case, so we provide this instruction with the case-specific documentation below. Of course, when you develop an Assigns file for your case, you will use that instead.</para>
<para><emphasis role="bold">NOTE:</emphasis> All of the SMOKE scripts assume that you are running a variant of the C-shell (either <command>csh</command> or <command>tcsh</command>). The scripts will not work with other shells such as <command>bash</command>. If your shell is not <command>csh</command> or <command>tcsh</command>, you will need to change into an appropriate shell before running any SMOKE scripts.</para>
<para>To run the nctox test case, you must first source the Assigns file using the commands below:</para>
<para><userinput><command>cd</command> <filename class="directory"><envar>$SMK_HOME</envar>/subsys/smoke/assigns</filename></userinput> <emphasis>(change to the assigns directory)</emphasis></para>
<para><userinput><command>source</command> <filename>ASSIGNS.nctox.cmaq.cb05_soa.us12-nc</filename></userinput> <emphasis>(set up for the nctox case)</emphasis></para>
<para>Next, you’ll run the base-year nctox scripts. These scripts process the stationary area, biogenic, nonroad mobile, and point emissions for the base year. The commands to run the scripts are below:</para>
<para><userinput><command>cd</command> <filename class="directory"><envar>$SCRIPTS</envar>/run</filename></userinput> <emphasis>(change to the run scripts directory)</emphasis></para>
<para><userinput><filename>smk_area_nctox.csh</filename></userinput> <emphasis>(invoke the stationary area run script)</emphasis></para>
<para><userinput><filename>smk_bg_nctox.csh</filename></userinput> <emphasis>(invoke the BEIS3 biogenic run script)</emphasis></para>
<para><userinput><filename>smk_nonroad_nctox.csh</filename></userinput> <emphasis>(invoke the nonroad mobile run script)</emphasis></para>
<para><userinput><filename>smk_point_nctox.csh</filename></userinput> <emphasis>(invoke the point run script)</emphasis></para>
<para><userinput><filename>smk_rateperdistance_nctox.csh</filename></userinput> <emphasis>(invoke the MOVES mobile sources on-roadway rate-per-distance (RPD) run script for all processes)</emphasis></para>
<para><userinput><filename>smk_ratepervehicle_nctox.csh</filename></userinput> <emphasis>(invoke the MOVES mobile sources off-network rate-per-vehicle (RPV) run script)</emphasis></para>
<para><userinput><filename>smk_rateperprofile_nctox.csh</filename></userinput> <emphasis>(invoke the MOVES mobile sources off-network rate-per-profile (RPP) run script)</emphasis></para>
<para><userinput><filename>smk_rateperhour_nctox.csh</filename></userinput> <emphasis>(invoke the MOVES mobile sources off-network rate-per-hour (RPH) run script)</emphasis></para>
<para><userinput><filename>smk_mrgall_nctox.csh</filename></userinput> <emphasis>(invoke the all-sources merge script)</emphasis></para>
<para>To verify that the nctox scripts have run correctly, go to the log file directory and look for errors by using:</para>
<para><userinput><command>cd</command> <filename class="directory"><envar>$LOGS</envar></filename></userinput> <emphasis>(change to the log file directory for the test case)</emphasis></para>
<programlisting>
grep ERROR *
</programlisting>
<para> If there are no errors, the next step is to run a QA script to be sure that the answers match.</para>
<para><userinput><command>cd</command> <filename class="directory"><envar>$SCRIPTS</envar>/install</filename></userinput> <emphasis>(change to the install directory)</emphasis></para>
<para><userinput><filename>check_smk_install</filename></userinput> <emphasis>(invoke the smoke install quality assurance script)</emphasis></para>
</section>
<section id="sect_scripts_how_use_smoke">
<title>How to use SMOKE</title>
<para>This section builds on the previous section to describe how to use the SMOKE files, scripts, and programs to create emission inputs for your air quality model. The first part of setting up SMOKE for a case other than the test case that comes with SMOKE is to create an Assigns file and script files for your case. If you have not read through the earlier parts of this chapter, we recommend that you do so. There are some critical points that you need to understand about the Assigns file and scripts. In <xref linkend="sect_scripts_introduction" />, we have described that an Assigns file must always be used when starting to work with SMOKE and the UNIX commands to do that. In <xref linkend="sect_scripts_script_descriptions" />, we have already described the purpose and use of the Assigns file and scripts, so please refer to that section for more information on these.</para>
<para>You may use this section as a step-by-step guide for all of the changes that you need to make to the scripts and files for running SMOKE. If you read it straight through and follow all of the steps that apply to your situation, then you will have set up SMOKE for your modeling case. If you are already familiar with SMOKE, you may also use this section as a reference for changing specific parts of the configuration to meet specific needs.</para>
<para>To create your own scripts and use your own data for the first time, you must take the following steps:</para>
<orderedlist>
<listitem>
<para>Copy the example Assigns file to your own copy. The name of the Assigns file is not critical to the success of this step, but it is useful to name the file something that you will be able to identify easily for the modeling case for which it will be used.</para>
<para><userinput><command>cp</command> <filename>ASSIGNS.nctox.cmaq.cb05_soa.us12-nc</filename> <replaceable><yourfile></replaceable></userinput></para>
</listitem>
<listitem>
<para>Modify the necessary features of the Assigns file for your case. For example, change the scenario names, episode dates, duration, grid name, or speciation name. Some of these changes require additional input files. See <xref linkend="sect_scripts_change_assigns" /> for more details on the settings that you can change and the values to use for each.</para>
</listitem>
<listitem>
<para>Invoke the Assigns file. This will create all of the input and output directories that you will need to set up your case:</para>
<para><userinput><command>source</command> <replaceable><yourfile></replaceable></userinput></para>
</listitem>
<listitem>
<para>Copy the appropriate nctox scripts to your own scripts, change the Assigns file listed in the script to the one that you created in the previous step.</para>
</listitem>
<listitem>
<para>Using one or more of the subsections in this chapter, create your input files and change the options in the scripts. The subsections below explain what files and settings need to be changed and checked for many types of operations for configuring SMOKE.</para>
</listitem>
</orderedlist>
<para>You need not always start from the example Assigns file. Once you have your own case-specific Assigns files, you may use them as starting points for creating other files.</para>
<section id="sect_scripts_change_assigns">
<title>Change Assigns file to set scenario names, grid names, and other case-specific configuration information</title>
<para>This subsection provides an overview of all of the Assigns file settings that you may need to change. The remaining subsections in this chapter include more detail about the changes as associated with specific modeling needs. For example, <xref linkend="sect_scripts_change_speciation" /> explains how to change the Assigns file to set different chemical mechanisms as well as all of the files needed.</para>
<para>In the 5-step list provided in the previous section, note that the Assigns file must first be changed (step 2) and then invoked (step 3) to create the input and output directories for your case. Ideally, all of the settings in the list below would be done in step 2 before step 3 is performed. If this is not possible, however, you should <emphasis>at a minimum</emphasis> set the first five items on the list below before moving to step 3. These are the variables that affect the input and output directory names, so if they are set, then the directories that you need to use will for all other configuration steps will be set up for you.</para>
<para>The list below provides the typical settings that may need to be changed to be consistent with the case that you need. Each item in the list references a different section of this chapter and <xref linkend="tbl_scripts_variables_files" /> or <xref linkend="tbl_scripts_variables_time" /> for more information. The variables in the <xref linkend="tbl_scripts_variables_files" /> are used for naming files and directories. <xref linkend="tbl_scripts_variables_time" /> includes the settings for controlling the time period and grid of your SMOKE runs.</para>
<para>The checklist of major Assigns settings to change is:</para>
<orderedlist>
<listitem>
<para>Change the <envar>INVID</envar>, <envar>INVEN</envar>, and <envar>INVOP</envar> values to a new inventory name. The simplest approach is to set these three variables to the same name, but different names can be used. Examples of which files or directories are affected by these settings are provided in <xref linkend="tbl_scripts_variables_files" />. See also <xref linkend="sect_scripts_use_new_inv" />.</para>
</listitem>
<listitem>
<para>Change the <envar>ABASE</envar>, <envar>BBASE</envar>, <envar>MBASE</envar>, <envar>PBASE</envar>, and <envar>EBASE</envar> values to a new scenario name. The simplest approach is to set these three variables to the same name, but different names can be used. Examples of which files or directories are affected by these settings are provided in <xref linkend="tbl_scripts_variables_files" />. See also <xref linkend="sect_scripts_use_new_inv" />.</para>
</listitem>
<listitem>
<para>Change the <envar>METSCEN</envar> value to your meteorology scenario name. This will affect the name of the input directory for the meteorology files (the <filename class="directory"><envar>$METDAT</envar></filename> directory, which can be a linked directory if you do not want to install your meteorology files under the SMOKE directory structure).</para>
</listitem>
<listitem>
<para>Change the <envar>SPC</envar> value to one of the supported speciation mechanisms (see <xref linkend="sect_scripts_use_default_spc" />) or to a new speciation mechanism (see <xref linkend="sect_scripts_use_new_spc" />).</para>
</listitem>
<listitem>
<para>Change the <envar>GRID</envar> and <envar>IOAPI_GRIDNAME_1</envar> values to the grid names for naming files. See also <xref linkend="sect_scripts_use_grid" />.</para>
</listitem>
<listitem>
<para>Change the run period naming settings <envar>ESDATE</envar> and <envar>NDAYS</envar> (see <xref linkend="tbl_scripts_variables_files" />). See also <xref linkend="sect_scripts_duration_output" />.</para>
</listitem>
<listitem>
<para>Change the episode settings <envar>EPI_STDATE</envar>, <envar>EPI_STTIME</envar>, <envar>EPI_RUNLEN</envar>, and <envar>EPI_NDAY</envar> and the run period settings <envar>G_STDATE</envar>, <envar>G_STTIME</envar>, and <envar>G_RUNLEN</envar>. See <xref linkend="tbl_scripts_variables_time" /> and <xref linkend="sect_scripts_change_episode" /> and <xref linkend="sect_scripts_duration_output" />.</para>
</listitem>
<listitem>
<para>Change the <envar>YEAR</envar> value to the year of your base case inventory.</para>
</listitem>
</orderedlist>
<table id="tbl_scripts_variables_files">
<title>Variable in Assigns file for naming files and directories</title>
<tgroup cols="2">
<colspec colwidth="1*" />
<colspec colwidth="5*" />
<thead>
<row>
<entry align="center">Environment Variable</entry>
<entry align="center" valign="bottom">Description</entry>
</row>
</thead>
<tbody>
<row>
<entry><envar>INVID</envar></entry>
<entry>Inventory input directory identifier. Controls directory path of input inventory. <envar>INVDIR</envar> = <filename class="directory"><envar>$SMKDAT</envar>/inventory/<envar>$INVID</envar></filename></entry>
</row>
<row>
<entry><envar>INVOP</envar></entry>
<entry>Base year inventory output name. Controls output file names for SMOKE intermediate inventory files and other output files from <command>Smkinven</command> and inventory-only reports from <command>Smkreport</command>. This variable is used to initialize the <envar>FYIOP</envar> variable, which is also used in the Assigns file and is equal to <envar>INVOP</envar> for base case modeling. <envar>FYIOP</envar> is reset by the <filename>set_case.scr</filename> helper script (see <xref linkend="sect_scripts_script_settings" /> documentation on <envar>FYEAR</envar> and <envar>CNTLCASE</envar>)</entry>
</row>
<row>
<entry><envar>INVEN</envar></entry>
<entry>Base year inventory name, with version. Controls directory path of output inventory. <envar>INVOPD</envar> = <filename class="directory"><envar>$SMKDAT</envar>/inventory/<envar>$INVEN</envar></filename></entry>
</row>
<row>
<entry><envar>ABASE</envar></entry>
<entry>Scenario identifier for area/non-point and nonroad mobile sources. Controls output file names and directories for outputs from SMOKE programs other than <command>Smkinven</command> (e.g., locations and file names of all matrices, hourly emissions, model-ready files). This variable is used to initialize the <envar>ASCEN</envar> variable, which is also used in the Assigns file and is equal to <envar>ABASE</envar> for base case modeling. <envar>ASCEN</envar> is reset by the <filename>set_case.scr</filename> helper script (see <xref linkend="sect_scripts_script_settings" /> documentation on <envar>FYEAR</envar> and <envar>CNTLCASE</envar>). Should be set to the same value as <envar>BBASE</envar>, <envar>MBASE</envar>, <envar>PBASE</envar>, and <envar>EBASE</envar> for the basic configuration.</entry>
</row>
<row>
<entry><envar>BBASE</envar></entry>
<entry>Scenario identifier for biogenic sources that works the same way as <envar>ABASE</envar>, but affects the <envar>BSCEN</envar> variable.</entry>
</row>
<row>
<entry><envar>MBASE</envar></entry>
<entry>Scenario identifier for on-road mobile sources that works the same way as <envar>ABASE</envar>, but affects the <envar>MSCEN</envar> variable.</entry>
</row>
<row>
<entry><envar>PBASE</envar></entry>
<entry>Scenario identifier for on-road mobile sources that works the same way as <envar>ABASE</envar>, but affects the <envar>PSCEN</envar> variable.</entry>
</row>
<row>
<entry><envar>EBASE</envar></entry>
<entry>Scenario identifier for merged emissions sources. Controls output file names and directories for outputs for final model-ready files. Sets the path for the <envar>STATIC</envar>, <envar>SCENARIO</envar>, and <envar>OUTPUT</envar> directories and file names for the merged outputs for multiple source categories from the <command>Smkmerge</command> program (e.g., the <envar>EGTS3D_L</envar> file).</entry>
</row>
<row>
<entry><envar>METSCEN</envar></entry>
<entry>Meteorology scenario name. Sets the <envar>METDAT</envar> directory for the MCIP meteorology files and can be used to set the meteorology file names (not done in example nctox scripts). Also helps set names for meteorology-dependent SMOKE intermediate files for biogenics (<command>Tmpbeis3</command> outputs <envar>B3GTS_S</envar> and <envar>B3GTS_L</envar>), on-road mobile (<command>Temporal</command> output <envar>MTMP</envar>), and point (<command>Laypoint</command> outputs <envar>PLAY</envar> and <envar>PLAY_EX</envar>).</entry>
</row>
<row>
<entry><envar>GRID</envar></entry>
<entry>Grid name used for naming files that depend on the selected grid. User must coordinate <envar>GRID</envar> settings with <envar>IOAPI_GRIDNAME_1</envar> setting <xref linkend="tbl_scripts_variables_time" />. Dependent files include gridding matrix, gridded land use and biogenic emissions, hourly mobile emissions, layer-fractions files, model-ready emissions, and some reports.</entry>
</row>
<row>
<entry><envar>SPC</envar></entry>
<entry>Speciation profile name for selecting input files and naming output files and directories that depend on the chemical mechanism. This setting can be overridden by the <envar>SPC_OVERRIDE</envar> script setting (see <xref linkend="sect_scripts_script_settings" />). The <envar>SPC</envar> setting sets input files <envar>GSPRO</envar> and <envar>GSREF</envar>; speciation matrix intermediate file names, and output directories <envar>OUTPUT</envar>, <envar>A_OUT</envar>, <envar>B_OUT</envar>, <envar>M_OUT</envar>, <envar>N_OUT</envar>, and <envar>P_OUT</envar>.</entry>
</row>
<row>
<entry><envar>ESDATE</envar></entry>
<entry>Starting date for first modeled period in episode. Has format YYYYMMDD where YYYY is the 4-digit year, MM is the two-digit month (e.g., 07 for July), and DD is the two-digit day (e.g., 01 for the first). Users should coordinate this with the <envar>G_STDATE</envar> setting <xref linkend="tbl_scripts_variables_time" />. The Assigns file resets this variable if the <envar>G_STDATE_ADVANCE</envar> variable is set by a calling script (see <xref linkend="sect_scripts_script_settings" />).</entry>
</row>
<row>
<entry><envar>MSDATE</envar></entry>
<entry>Meteorology file dates. This variable can be used to help name time-dependent meteorology files or directory names. In the example scripts for the nctox case, however, this variable is not used and the <envar>G_STDATE</envar> variable is used instead.</entry>
</row>
<row>
<entry><envar>NDAYS</envar></entry>
<entry>Number of days in a modeling period. To break up a modeling episode into multiple modeling periods of one or more days, the user must set and coordinate this setting with the <envar>G_RUNLEN</envar> setting <xref linkend="tbl_scripts_variables_time" />. <envar>NDAYS</envar> represents the number of days indicated in hours by the <envar>G_RUNLEN</envar> variable. <envar>NDAYS</envar> is used for naming hourly emissions files output from the <command>Temporal</command> program, biogenic outputs from <command>Tmpbio</command>, layer fractions files from <command>Laypoint</command>, and model-ready emissions files from <command>Smkmerge</command>.</entry>
</row>
<row>
<entry><envar>YEAR</envar></entry>
<entry>Base case modeling year. This setting is used to set several things in coordination with the <envar>FYEAR</envar> and <envar>SMK_FUTURE_YN</envar> script settings (see <xref linkend="sect_scripts_script_settings" />). For growth modeling, it is used in the file name for the <envar>GCNTL</envar> input file, set by the growth/control example nctox scripts. This setting can be overridden by the <envar>YEAR_OVERRIDE</envar> setting, also described in <xref linkend="sect_scripts_script_settings" />. Lastly, it is used to set the file name for the winter/summer designations file output from <command>Metscan</command>, called the <envar>BIOSEASON</envar> file.</entry>
</row>
</tbody>
</tgroup>
</table>
<table id="tbl_scripts_variables_time">
<title>Variables in Assigns file for controlling time period and grid of processing</title>
<tgroup cols="2">
<colspec colwidth="1*" />
<colspec colwidth="3*" />
<thead>
<row>
<entry align="center">Environment Variable</entry>
<entry align="center" valign="bottom">Description</entry>
</row>
</thead>
<tbody>
<row>
<entry><envar>G_STDATE</envar></entry>
<entry>Julian starting date of first modeled period in episode. Has format YYYYDDD where YYYY is a 4-digit year and DDD is a 3-digit Julian date (e.g., 001 for the first day of the year). Users should coordinate this with the <envar>ESDATE</envar> setting <xref linkend="tbl_scripts_variables_files" />. The Assigns file resets this variable if the <envar>G_STDATE_ADVANCE</envar> variable is set by a calling script (see <xref linkend="sect_scripts_script_settings" />). Controls operation of time-dependent programs <command>Temporal</command>, <command>Tmpbio</command>, <command>Laypoint</command>, and <command>Smkmerge</command>.</entry>
</row>
<row>
<entry><envar>G_STTIME</envar></entry>
<entry>Start time of each period in the episode. Has format HHMMSS where HH is a 2-digit hour (leading zero not required), MM is a 2-digit minute (set to 00 for SMOKE), and SS is a 2-digit second (set to 00 for SMOKE).</entry>
</row>
<row>
<entry><envar>G_RUNLEN</envar></entry>
<entry>Duration of each run period in episode. To break up a modeling episode into multiple modeling periods of one or more days, the user must set and coordinate this setting with the <envar>NDAYS</envar> setting <xref linkend="tbl_scripts_variables_files" />. <envar>G_RUNLEN</envar> has format HHHHMMSS, where HHHH is a 4-digit duration in hours (leading zeros not required), MM and HH should be set as for <envar>G_STTIME</envar>. <envar>G_RUNLEN</envar> controls the duration modeled for each run of the <command>Temporal</command>, <command>Tmpbio</command>, <command>Laypoint</command>, and <command>Smkmerge</command> programs. Must be set one hour greater than the number of days times 24 (e.g., a two-day period length is 2 x 24 + 1 = 49).</entry>
</row>
<row>
<entry><envar>G_TSTEP</envar></entry>
<entry>Time step. Has format HHMMSS with format the same as described for <envar>G_STTIME</envar>. The current version of SMOKE allows this setting to only be 10000, for hourly timesteps.</entry>
</row>
<row>
<entry><envar>EPI_STDATE</envar></entry>
<entry>Episode start date. Has the same format as <envar>G_STDATE</envar>. Does not change during the course of an episodic run. In the Assigns file, should be set the same as <envar>G_STDATE</envar>.</entry>
</row>
<row>
<entry><envar>EPI_STTIME</envar></entry>
<entry>Episode start time. Has the same format as <envar>G_STTIME</envar>. Does not change during the course of an episodic run. In the Assigns file, should be set the same as <envar>G_STTIME</envar>.</entry>
</row>
<row>
<entry><envar>EPI_RUNLEN</envar></entry>
<entry>Episode duration. Has the same format as <envar>G_RUNLEN</envar>. Does not change during the course of an episodic run. In the Assigns file, should be set for the entire duration of the modeling episode, which must be greater than or equal to <envar>G_RUNLEN</envar> minus one hour, is limited to at most one year, and for best results, should be a multiple of <envar>G_RUNLEN</envar> minus one hour. For example, if <envar>G_RUNLEN</envar> is 250000 (one day plus the required one additional hour), <envar>EPI_RUNLEN</envar> must be at least 240000 and at most 365 x 240000 = 87600000. This example would run an annual episode using 24-hour run periods.</entry>
</row>
<row>
<entry><envar>EPI_NDAY</envar></entry>
<entry>The number of days in the episode. Should be the value of <envar>EPI_RUNLEN</envar> divided by 240000. This settings controls for how many days to use the automatic looping in the example scripts, which loops over all of the periods (set by <envar>G_RUNLEN</envar>) during the episode (set by <envar>EPI_RUNLEN</envar>).</entry>
</row>
<row>
<entry><envar>IOAPI_GRIDNAME_1</envar></entry>
<entry>The selected grid. Controls which grid will be selected by the <command>Grdmat</command> program from the <envar>GRIDDESC</envar> file. Users should coordinate this setting with the <envar>GRID</envar> setting from <xref linkend="tbl_scripts_variables_files" />, which is used for naming files. This setting must match the grid names in the gridded land use and spatial surrogates files’ headers. </entry>
</row>
</tbody>
</tgroup>
</table>
</section>
<section id="sect_scripts_use_new_inv">
<title>Use new inventory data</title>
<para>This section describes what steps are necessary to take when using new inventory data for anthropogenic sources. For information on biogenic sources, see <xref linkend="sect_scripts_use_beis3" />. For more information about the details of each source category (e.g., what is the difference between using MOVES emission factors or precomputed on-road mobile emissions), see <xref linkend="sect_concepts_summary_source_processing" />.</para>
<para>Because this section is so spread out, we provide a small section guide here. This section includes the following subsections:</para>
<itemizedlist spacing="compact">
<listitem>Area/non-point inventories</listitem>
<listitem>Nonroad mobile inventories</listitem>
<listitem>On-road mobile inventories</listitem>
<listitem>Point inventories</listitem>
<listitem>Day-specific and hour-specific point and fire inventories</listitem>
<listitem>Future-year inventories</listitem>
<listitem>Pre-gridded inventories (for same output modeling domain or for converting to a different modeling domain (example: EDGAR/RCP/HTAP to CMAQ ready emissions file)</listitem>
<listitem>Using seasonal and annual data in the same run</listitem>
<listitem>Files and settings for all inventories</listitem>
</itemizedlist>
<section id="sect_scripts_area_invs">
<title>Area/non-point inventories</title>
<orderedlist>
<listitem>
<para>Determine the file format that you have (for preformatted data) or want to create (for new data).</para>
<orderedlist>
<listitem>
<para>Preformatted data considerations</para>
<itemizedlist>
<listitem>
<para>If you have preexisting data in SMOKE input format, then you will most likely want to use that format to input to SMOKE, unless you discover that you need a different format to take advantage of a SMOKE feature not available in a different format.</para>
</listitem>
<listitem>
<para>If you have multiple files in a single format, then you can combine these into a single SMOKE run using a list file.</para>
</listitem>
<listitem>
<para>If you have data in more than one format other than the case just mentioned, you must convert all files to the same format or process them separately in SMOKE, merging the hourly, gridded, speciated emissions files using <command>Mrggrid</command>.</para>
</listitem>
<listitem>
<para>If your area inventory includes nonroad mobile sources, you can process nonroad mobile sources with stationary area sources in most cases (see next bullet for exception).</para>
</listitem>
<listitem>
<para>If you want to combine nonroad mobile criteria and toxics inventories, you need to process nonroad mobile sources separately from area sources (see <xref linkend="sect_scripts_nonroad_invs" />).</para>
</listitem>
<listitem>
<para>Pregridded data from any source category can be input to SMOKE as an area source, but you must convert the data to an I/O API NetCDF file format first. See <xref linkend="sect_scripts_pregridded_invs_same" /> for more information.</para>
</listitem>
</itemizedlist>
</listitem>
</orderedlist>
</listitem>
<listitem>
<para>Collect or create inventories in correct formats.</para>
<para>Inventory files for area sources are usually named starting with <quote>arinv</quote>, because <envar>ARINV</envar> is the logical file name (environment variable) that <command>Smkinven</command> uses to read the file. The formats available for area/non-point sources are:</para>
<orderedlist>
<listitem>
<para>List format. The list format is simply an ASCII file that lists all of the files that you want SMOKE to import in a single run.</para>
</listitem>
<listitem>
<para>List Grid format. The list grid format is simply an ASCII file that lists all of the global gridded inventory files that you want SMOKE to import in a single run. The List Grid format has four columns.
Assigned SCC, Pollutant ID, Local Variable Name, Month of inventory and Full inventory fine directory path and filename.</para>
</listitem>
<listitem>
<para>ORL and FF10 formats. These formats are most appropriate for non-point toxics inventories, but also can be used for any inventory data.</para>
</listitem>
<listitem>
<para>Pregridded I/O API format. This format can only be used for pregridded data that has been converted to a time-independent, gridded I/O API file. The variables in the file are the pollutants. No SCCs or other source information can be provided with this format.</para>
</listitem>
</orderedlist>
</listitem>
<listitem>
<para>Set and/or check the file headers that apply for your file format.</para>
<orderedlist>
<listitem>
<para>File format header: Make sure that the first line of the list file or individual files start with the #LIST (for list files only),#LIST GRID, #ORL, #FF10 (see <xref linkend="sect_input_inventory_format" />).</para>
</listitem>
<listitem>
<para>File type (#TYPE header): The type is important because it helps SMOKE determine the file format. Make sure that the header has been set according to the directions in <xref linkend="sect_input_inventory_header" />.</para>
</listitem>
<listitem>
<para>Country (#COUNTRY header): Make sure that this head has been used and that the country name used in this header matches the name in the country section of the <envar>COSTCY</envar> or <envar>GEOCODE_LEVEL[1-4]</envar> file (if USE_EXP_GEOCODE Y) file.</para>
</listitem>
<listitem>
<para>Inventory year (#YEAR). Make sure that the inventory year is accurately reflected in the header. This is the only way SMOKE knows what year the data is for. <comment>If the year is not the same for all of your inventory files and you want to make them the same, you will have to use the inventory growth, which is described in <xref linkend="sect_scripts_use_projection" />.</comment> If this year is not a base year but a future-year, make sure to follow the additional instructions in <xref linkend="sect_scripts_future_invs" />.</para>
</listitem>
<listitem>
<para>Description (#DESC header): Although this header is not required, it is good practice to take advantage of it and include as much information about the data as you have. There is no limit to the number of #DESC headers that can be included in the file.</para>
</listitem>
<listitem>
<para>Data header (#POLID or #DATA header): Make sure that this required header is included in the file. It should accurately reflect the data values provided on each line of the file. If there are data fields at the end of the file that you want to drop from being imported, you can leave them off of the #POLID or #DATA header to cause them to not be imported by <command>Smkinven</command> (see also the <envar>INVTABLE</envar> file for dropping emissions during import).</para>
<para>For ORL format, this header does not apply. The pollutants are designated by code number (i.e., CAS number) in the file format and therefore the header is not needed.</para>
</listitem>
</orderedlist>
</listitem>
<listitem>
<para>Install inventory files in <filename class="directory"><envar>$ARDAT</envar></filename> directory.</para>
<para>This directory is <filename class="directory"><envar>$SMKDAT</envar>/inventory/<envar>$INVID</envar>/area</filename>.</para>
</listitem>
<listitem>
<para>Ensure the Assigns file has the <envar>ARINV</envar> variable set to the <envar>ARINV</envar> file name for your area-source inventory file.</para>
</listitem>
<listitem>
<para>Optionally, set up to assign point-source locations to area sources using the <envar>ARTOPNT</envar> file.</para>
<orderedlist>
<listitem>
<para>Put the <envar>ARTOPNT</envar> file in the <filename class="directory"><envar>$INVDIR</envar>/other</filename> directory.</para>
</listitem>
<listitem>
<para>Ensure the name of the <envar>ARTOPNT</envar> file is consistent with the <envar>ARTOPNT</envar> setting in the Assigns file.</para>
</listitem>
<listitem>
<para>Make sure that the <envar>ARTOPNT</envar> file data are consistent with the year of your inventory (e.g., use 1999 coordinates for a 1999 inventory), or that you can accept any discrepancies.</para>
</listitem>
</orderedlist>
</listitem>
<listitem>
<para>See also steps for all source categories in <xref linkend="sect_scripts_all_invs" />.</para>
</listitem>
</orderedlist>
</section>
<section id="sect_scripts_nonroad_invs">
<title>Nonroad mobile inventories</title>
<orderedlist>
<listitem>
<para>Determine the file format that you have (for preformatted data) or want to create (for new data).</para>
<orderedlist>
<listitem>
<itemizedlist>
<listitem>
<para>See <xref linkend="sect_scripts_area_invs" /> for issues relating to stationary area / non-point sources. These are the same issues as for nonroad mobile sources.</para>
</listitem>
<listitem>
<para>If you need to process nonroad mobile separately from stationary area/non-point sources because of recommendations in <xref linkend="sect_scripts_area_invs" />, you must separate the stationary area/non-point and nonroad mobile sources to two separate files if they are not already separated. There is no SMOKE utility to do this, but the UNIX <command>grep</command> command can be used to search for all SCCs in the nonroad mobile inventory; for example, all SCCs starting with <quote>22</quote>.</para>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<para>New data considerations</para>
<itemizedlist>
<listitem>
<para>See <xref linkend="sect_scripts_area_invs" /> for issues relating to stationary area and non-point sources. These are the same issues as for nonroad mobile sources.</para>
</listitem>
<listitem>
<para>Decide whether area and nonroad mobile sources will be processed together, which may depend on whether the available inventory data include both area and nonroad mobile or whether they are already separate. One reason for separate processing is if you anticipate control strategies that affect only stationary area or only nonroad mobile sources, though it is not required that the processing be separate to apply such controls. A second reason for separate files if you are also using toxics inventories.</para>
</listitem>
</itemizedlist>
</listitem>
</orderedlist>
<para><emphasis>If processing nonroad mobile sources separately, continue with these steps. Otherwise, the steps for area/non-point sources listed in <xref linkend="sect_scripts_area_invs" /> will be sufficient.</emphasis></para>
</listitem>
<listitem>
<para>Collect or create inventories in correct formats.</para>
<para>Inventory files for nonroad sources are usually named starting with <quote>nrinv</quote>, because the Assigns file uses the <envar>NRINV</envar> environment variable to set the <envar>ARINV</envar> logical file name (environment variable) that <command>Smkinven</command> uses to read the file. The list of available formats for nonroad mobile sources is:</para>
<orderedlist>
<listitem>
<para>List format. The list format is simply an ASCII file that lists all of the files that you want SMOKE to import in a single run.</para>
</listitem>
<listitem>
<para>ORL format. This format is most appropriate for criteria and toxics inventories, but also can be used for any inventory data.</para>
</listitem>
<listitem>
<para>FF10 format. This format is most appropriate for criteria and toxics inventories, but also can be used for any inventory data.</para>
</listitem>
</orderedlist>
</listitem>
<listitem>
<para>Set and/or check the file headers that apply for your file format.</para>
<orderedlist>
<listitem>
<para>File format header: Make sure that the first line of the list file or individual files start with the #LIST (for list files only),#LIST GRID, #ORL, #FF10.</para>
</listitem>
<listitem>
<para>For other headers, please refer to the documentation in step (3) of the area/non-point steps in <xref linkend="sect_scripts_area_invs" />.</para>
</listitem>
</orderedlist>
</listitem>
<listitem>
<para>Install inventory files in <filename class="directory"><envar>$NRDAT</envar></filename> directory.</para>
<para>This directory is <filename class="directory"><envar>$SMKDAT</envar>/inventory/<envar>$INVID</envar>/nonroad</filename>.</para>
</listitem>
<listitem>
<para>Ensure the Assigns file has the <envar>NRINV</envar> variable set to the <envar>NRINV</envar> file name for your new nonroad-mobile-source inventory file.</para>
</listitem>
<listitem>
<para>Optionally, set up to assign point-source locations to nonroad mobile sources using the <envar>ARTOPNT</envar> file.</para>
<para>Please refer to the documentation in step (6) of the area/non-point steps in <xref linkend="sect_scripts_area_invs" />.</para>
</listitem>
<listitem>
<para>See also steps for all source categories in <xref linkend="sect_scripts_all_invs" />.</para>
</listitem>
</orderedlist>
</section>
<section>
<title>On-road mobile inventories</title>
<orderedlist>
<listitem>
<para>Determine the file format that you have (for preformatted data) or want to create (for new data).</para>
<orderedlist>
<itemizedlist>
<listitem>
<para>If using MOVES emission factors through SMOKE, create a VMT file in FF10 on-road mobile activity format (or use in combination with list format).</para>
</listitem>
<listitem>
<para>If using both VMT and emissions, you <emphasis>must</emphasis> use a list-format to import the two separate inventories together. <comment>Also, it is important to make sure that the same sources appear in both inventories. This can be done outside of SMOKE before importing the inventory, or with <command>Smkreport</command>, after importing the inventories. After import, both VMT and emissions should appear in a report by source.</comment></para>
</listitem>
<listitem>
<para>If using both criteria and toxics data and wish to have the full functionality of SMOKE for both inventories, you must use a list file to list both inventory files (criteria and toxics) for SMOKE to combine.</para>
</listitem>
<comment>
<listitem>
<para><remark>It is possible to use the ORL format for criteria inventories, but you will not be able to integrate your VOC emissions in this case (<xref linkend="sect_concepts_combine_toxics" /> explains VOC integration).</remark></para>
</listitem>
</comment>
</itemizedlist>
</orderedlist>
</listitem>
<listitem>
<para>Collect or create inventories in correct formats.</para>
<para>Inventory files for on-road mobile sources are usually named starting with <quote>mbinv</quote>, because <command>Smkinven</command> uses the <envar>MBINV</envar> logical file name (environment variable) to read the file. The list of available formats for on-road mobile sources is:</para>
<orderedlist>
<listitem>
<para>List format. The list format is simply an ASCII file that lists all of the files that you want SMOKE to import in a single run.</para>
</listitem>
<listitem>
<para>ORL and FF10 format. These formats are most appropriate for toxics inventories, but also can be used for any inventory data.</para>
</listitem>
</orderedlist>
</listitem>
<listitem>
<para>Set and/or check the file headers that apply for your file format.</para>
<orderedlist>
<listitem>
<para>Please refer to the documentation in step (3) of the area/non-point steps in <xref linkend="sect_scripts_area_invs" />.</para>
</listitem>
</orderedlist>
</listitem>
<listitem>
<para>Install inventory files in <filename class="directory"><envar>$MBDAT</envar></filename> directory.</para>
<para>This directory is <filename class="directory"><envar>$SMKDAT</envar>/inventory/<envar>$INVID</envar>/mobile</filename></para>
</listitem>
<listitem>
<para>Install other mobile-specific files in inventory directories.</para>
<para>The following mobile-specific files must also be installed in the <envar>MBDAT</envar> directory. These files can usually be copied from the example files provided with the SMOKE installation. The formats and additional discussion about the contents of these files can be found in <xref linkend="sect_input_source_mobile" />. These files are:</para>
<itemizedlist>
<listitem>
<para><envar>MCXREF</envar> (MOVES usage only)</para>
</listitem>
<listitem>
<para><envar>MFMREF</envar> (MOVES usage only)</para>
</listitem>
<listitem>
<para><envar>MEPROC</envar> (MOVES usage only)</para>
</listitem>
</itemizedlist>
<para>For all inputs needed for MOVES usage only, refer to <xref linkend="sect_scripts_use_moves" />.</para>
</listitem>
<listitem>
<para>See also steps for all source categories in <xref linkend="sect_scripts_all_invs" />.</para>
</listitem>
</orderedlist>
</section>
<section>
<title>Point/fires inventories</title>
<orderedlist>
<listitem>
<para>Determine the file format that you have (for preformatted data) or want to create (for new data).</para>
<orderedlist>
<listitem>
<para>Preformatted data considerations</para>
<itemizedlist>
<listitem>
<para>If you have preexisting data in SMOKE input format, then you will most likely want to use that format to input to SMOKE, unless you discover that you need a different format to take advantage of a SMOKE feature not available in a different format.</para>
</listitem>
<listitem>
<para>Pregridded data must be input as an area source.</para>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<para>New data considerations</para>