
The CAMx conversion script and executables converts the low level post-SMOKE sector merged 2D emissions from CMAQ netCDF to CAMx 
UAM. The script will also convert the inline post-SMOKE emissions files into CAMx UAM files and merge them into a single file of 
CAMx ready point emissions.

---------
Scripts
---------
Two scripts are provided:
camx_convert_2011ef_12US2.csh for converting the 2011ef emissions
camx_convert_2025ef_12US2.csh for converting the 2025ef emissions
The 2018ef case was not converted to CAMx ready emissions.

Each script begins with a section for defining the run setting variables. All paths will need to be modified to match your file 

system. The start and end dates may need to be modified depending on the dates to be converted.
A sectorlist file is used to define the case and date approach for each of the inline sectors.

---------
Executables
---------
The binary versions of the executables are provided in the bin path. These may not work on your platform given your available 
libraries and architecture.

The FORTRAN source for the executables are provided in the src path. The IOAPI and NETCDF libraries are required for compiling. 

Makefiles are provided for compiling with the Intel FORTRAN compiler.
Working versions of cmaq2uam, j2g, ptht, pthtq, spcmap, mrguam, ptsmrg, qalowemis, and qaelev executables will need to be placed 
in the bin path in order for the conversion to work.

The source and binaries for the seasalt generation and merge are also provided, but require meteorology and land use data.
Seasalt is currently turned off for the runs as the meteorology and land use are not provided in this package.

---------
Configuration
---------
Switches for four run sections are available:
-CTM_2DEMIS - Converts the 2D sector merged emissions into CAMx UAM "emis2d" format. Set to "Y" to run this conversion.
-CTM_SEASALT - Merges in seasalt to the "emis2d" file produced in the 2DEMIS section. Seasalt is currently disabled.
-CTM_PT3DEMIS - Converts the inline and stack groups file for each individual elevated point sector into CAMx UAM "ptsr" format.
-CTM_PTSMRG - Merges the "ptsr" files from the PT3DEMIS section together into a CAMx ready "mrgpt" ptsr UAM file.

EMIS_ROOT and INLN_ROOT are used for setting the input root paths of the 2D and inline emissions, respectively. The case name, 
grid short name, speciation name, and any file prefixes are automatically appended to these paths. The EMIS_ROOT is also the 
root for the CAMx ready output files.

SPECIES_MAPPING defines the path to the CMAQ to CAMx species name mapping file. Only one is provided.

The fire_path variable is the directory to the CAMx converted "ptsr" ptfire files. These may be provided in another package. A 
prefix is automatically appended to the ptsr file names.

The start_date and end_date variables set the Julian start and end date for the conversion loop.

---------
Processing
---------
Once the script is configured the conversion can be initiated simply by executing the camx_convert script.

A qatemp and work directory will be generated in the execution path. The qatemp will contain various QA files for the 
conversions. The work directory will contain temporary files.

A log file is also generated that contains the path of all files that are converted for each day. This is a good place to check 
for path errors during a crash.

The script will output to STDOUT and STDERR. When troubleshooting problems it is beneficial to redirect output to a file that 
can be searched.
