Instructions to generate SMOKE FF10 activity files from MOVES2014 formatted county databases (CDBs)
7/1/2015, A. DenBleyker, Eastern Research Group, Inc.

Steps 1-6 will convert a CDB formatted for MOVES2014 into FF10 tables formatted for SMOKE.
Steps 7-13 will modify existing FF10 tables (ff10vmt and ff10hot) for consistency with CRC A-88 data used in the NEI.

################
#### Steps #####
################
1. Execute the script 'HPMS_VMT_POP_db_20140815_clean.sql' in MySQL.  This script creates a database named 'nei2011ff10' containing five empty tables (ff10hot, ff10pop, ff10spd, ff10vmt, and spdpro).
2. Modify the script 'CreateFF10_fromMOVES2010bCDB.sql' if you need to globally replace the MOVES2014 default database version with your version.  
3. Prepare list of CDB names for the counties you wish to include in the FF10 files.  Example: cdblist.txt
4. Modify Perl script 'Process_ManyCDBs_clean.plx' to update the filepaths to your CDB list and MySQL script.
5. Execute Perl script and wait. After it completes, the database tables 'nei2011ff10' should be populated.
6. Export the tables and manually add any additional headers using a text editor.
##########################
#### Additional Steps ####
##########################
7. Execute the script 'CRC_FF10_1_CreateDB.sql' in MySQL.  This script creates a database named '2011ff10_crclonghaul' containing two empty tables (ff10hot and ff10vmt) and two populated tables (state2region and longhaulfractions).
8. In Excel, manually join VMT values (ann_value, jan_value, feb_value, ... , dec_value) from table 'ff10vmt_st1' onto table 'ff10vmt_st' and rename the later to 'ff10vmt_st2'. Delete field 'index1' from 'ff10vmt_st2' before re-importing to MySQL.  See example CSV files.
9. Execute the queries in 'CRC_FF10_3_Import_St2RightJoinedXL.qbquery' to re-import ff10vmt_st2 into MySQL.
10. Execute the script 'CRC_FF10_4_MultiplyFractions.sql' in MySQL.
11. Execute the script 'CRC_FF10_5_FinishVMT_CRC.sql' in MySQL. 
12. Execute the script 'CRC_FF10_6_CalcHOT_CRC.sql' in MySQL.
13. Export the MySQL tables 'ff10vmt_crc' and 'ff10hot_crc' and add any headers using a text editor.
