7.5.2. Reviewing log files

The SMOKE log files are the first source of information about whether your SMOKE run has completed properly. The simplest thing to check in the log file is that the program ran to completion. If it did, the last line of the log file will be “Normal Completion of program...” followed by the program name. This line is simply a first step to understanding whether your program actually completed successfully because this “successful completion” statement will be printed even if your program ran with warnings. If errors occurred in your program run, this line will not be printed.

To fully evaluate whether your program run was indeed successful, you must review the entire log file and also perform additional QA as described in Section 7.5.3, “Reviewing reports created by SMOKE core programs” and Section 7.5.4, “Reviewing and customizing reports created by Smkreport”. In this section, we describe how to further review the log files. Figure 7.1, “Flow diagram for examining log files” is a flow diagram that gives step-by-step instructions on how to evaluate the errors and warnings in the log files.

In the diagram, “SMOKE support” refers to several resources that you can use for support on SMOKE. The primary support mechanism is the Community Modeling and Analysis System (CMAS) Center Help Desk. This web site can be used to look up questions and answers as well as submit new questions about SMOKE usage and behavior. Another resource available to all emissions modelers is the emregional listserv. This listserv is hosted by the University of North Carolina at Chapel Hill’s Carolina Environmental Program (CEP) and is open to all questions, concerns, and issues related to emissions modeling.

Figure 7.1. Flow diagram for examining log files

Flow diagram for examining log files

One technique you can use to quickly create a list of the major types of errors or warnings that occurred, without listing all of the many specific instances, is to use the UNIX grep command. This approach will find the types of errors and warnings, but when multiple instances of an error or warning are present (e.g., for multiple sources) only one instance of the error or warning will be listed. The UNIX command to perform this function is:

grep ERROR <logfile> | cut -c1-50 | sort -u

The “ERROR” in this command can be replaced by “WARNING”, and the number “50” can be increased or reduced depending on whether you need more or fewer of the warnings in order to obtain the information you want. The “50” controls how many columns of text are included. The sort -u performs a unique (-u) sort that will eliminate duplicate records created by the cut part of the command. So, since more lines will be similar when the cut command includes fewer columns, the unique sort will produce fewer unique entries as the cut limit is decreased. The number 50 is usually a good starting point, since it captures the majority of the critical part of the warning, without capturing less significant details such as a line number from an input file on which the error or warning occurred.

In addition to reviewing the log files for errors and warnings, we recommend that you compare the environment variable settings listed in the log files with those you intended to use. Previously, we recommended that you create a table that includes all of the correct SMOKE scripts settings to be used in the modeling effort. The settings shown in the log files should be compared back to that master table to ensure that everything worked properly. This can help you prevent the SMOKE programs from obtaining and using incorrect settings due to typographical errors in the scripts.

Finally, the log files include all of the names of the input and output files. These should be reviewed to confirm that the correct input files and output files were actually used by the program. It is possible that an error in the Assigns file or script could cause the wrong input files to be used, or the output files to be written to the wrong locations.