Chapter 11. Source Code and Include Files

11.1. Source Code
11.2. Include Files

The SMOKE modeling system consists of several core programs (described in Chapter 6, SMOKE Core Programs), several utility programs (described in Chapter 5, SMOKE Utility Programs), and the quality assurance program Smkreport (described in Chapter 7, SMOKE Quality Assurance). The source code for all programs is available in the $SMKROOT/src directory.

SMOKE also uses several libraries for shared functionality. The I/O API and NetCDF libraries were discussed in Chapter 12, Downloading, Installing, and Compiling SMOKE. In addition, SMOKE is distributed with the FileSetAPI library (Section 11.1.1, “FileSetAPI library”), the EDSS Tools library (Section 11.1.2, “EDSS Tools library”), and a library version of MOBILE6 (Section 11.1.3, “MOBILE6 library”).

11.1. Source Code

All source code for SMOKE and its associated libraries can be found in the $SMK_SUBSYS directory.

11.1.1. FileSetAPI library

This library is used to open multiple I/O API files to avoid the limit of 120 variables per I/O API file. The source code in found in the $SMK_SUBSYS/filesetapi directory (also accessible using the FS_ROOT environment variable), which contains the following source code and Makefiles.

  • $FS_ROOT/appendname.f
  • $FS_ROOT/chkfileset.f
  • $FS_ROOT/chksetdesc.f
  • $FS_ROOT/cleanup.f
  • $FS_ROOT/closeset.f
  • $FS_ROOT/createset.f
  • $FS_ROOT/descset.f
  • $FS_ROOT/Makefile
  • $FS_ROOT/Makeit
  • $FS_ROOT/modfileset.f
  • $FS_ROOT/
  • $FS_ROOT/openset.f
  • $FS_ROOT/promptset.f
  • $FS_ROOT/readset.F
  • $FS_ROOT/writeset.F

11.1.2. EDSS Tools library

The EDSS Tools library is built on the EDSS framework and contains a variety of routines used for accessing I/O API data and other Models-3 conventions. The main directory for the EDSS Tools library is $SMK_SUBSYS/edss_tools, which is also accessible with the TOOLS_ROOT environment variable. The source code for the EDSS Tools library is in the $TOOLS_ROOT/src directory and consists of the following source code and Makefiles.

  • $ETLSRC/checkmem.f
  • $ETLSRC/chkgrid.f
  • $ETLSRC/chkint.f
  • $ETLSRC/chkreal.f
  • $ETLSRC/dscm3grd.f
  • $ETLSRC/dscm3lay.f
  • $ETLSRC/flterr.f
  • $ETLSRC/fltrneg.f
  • $ETLSRC/getcfdsc.f
  • $ETLSRC/getfline.f
  • $ETLSRC/getifdsc.f
  • $ETLSRC/getm3epi.f
  • $ETLSRC/getnlist.f
  • $ETLSRC/hdrmiss3.f
  • $ETLSRC/ioapi_grd_size.f
  • $ETLSRC/m3mesg.F
  • $ETLSRC/Makefile
  • $ETLSRC/Makeit
  • $ETLSRC/multunit.f
  • $ETLSRC/nextime.f
  • $ETLSRC/openphys.f
  • $ETLSRC/padnzero.f
  • $ETLSRC/padzero.f
  • $ETLSRC/parsline.f
  • $ETLSRC/polmesg.f
  • $ETLSRC/rd3mask.f
  • $ETLSRC/rdsetmask.f
  • $ETLSRC/unitfac.f
  • $ETLSRC/unitmatch.f
  • $ETDSRC/modgrid.f
  • $ETDSRC/

11.1.3. MOBILE6 library

The code for the library version of MOBILE6 is in $SMKROOT/src/mo6, also accessible with the M6_SRC environment variable. This code is the stand-alone version of MOBILE6.2.03 with special aggregation code to create the emission factors at the resolution needed by SMOKE. In addition, we have added code to allow MOBILE6 to pass the emission factors back to SMOKE in memory, rather than writing an output file. The SMOKE version of MOBILE6 has also been updated to allow lowercase input file names and to look for external input files in the $SMK_M6PATH directory.

11.1.4. SMOKE programs

The source code needed for the SMOKE programs is in the $SMKROOT/src directory. Table 11.1, “SMOKE programs and source code directories” lists each SMOKE program and the corresponding source code directory and environment variable you can use to access that directory.

Table 11.1. SMOKE programs and source code directories

SMOKE Program Source Code Directory Environment Variable
Beld3to2 $SMKROOT/src/emutil UT_SRC
Cntlmat $SMKROOT/src/cntlmat CL_SRC
Elevpoint $SMKROOT/src/point PT_SRC
Emisfac $SMKROOT/src/mobile MB_SRC
Extractida $SMKROOT/src/emutil UT_SRC
Geofac $SMKROOT/src/emutil UT_SRC
Grdmat $SMKROOT/src/grdmat GD_SRC
Grwinven $SMKROOT/src/smkinven IV_SRC
Invsplit $SMKROOT/src/emutil UT_SRC
Laypoint $SMKROOT/src/point PT_SRC
Mbsetup $SMKROOT/src/mobile MB_SRC
Metcombine $SMKROOT/src/emutil UT_SRC
Metscan $SMKROOT/src/emutil UT_SRC
Mrggrid $SMKROOT/src/smkmerge MG_SRC
Normbeis3 $SMKROOT/src/biog BG_SRC
Pktreduc $SMKROOT/src/emutil UT_SRC
Premobl $SMKROOT/src/mobile MB_SRC
Rawbio $SMKROOT/src/biog BG_SRC
Smk2emis $SMKROOT/src/emutil UT_SRC
Smkinven $SMKROOT/src/smkinven IV_SRC
Smkmerge $SMKROOT/src/smkmerge MG_SRC
Smkreport $SMKROOT/src/emqa QA_SRC
Spcmat $SMKROOT/src/spcmat SP_SRC
Surgtool $SMKROOT/src/emutil UT_SRC
Temporal $SMKROOT/src/temporal TM_SRC
Tmpbeis3 $SMKROOT/src/biog BG_SRC
Tmpbio $SMKROOT/src/biog BG_SRC
Uam2ncf $SMKROOT/src/emutil UT_SRC

There are three additional directories in the $SMKROOT/src that we have not mentioned. They are:

  • $SMKROOT/src/emmod (MD_SRC): Contains modules for shared program variables

  • $SMKROOT/src/inc (INC): Contains include files (discussed in Section 11.2, “Include Files”)

  • $SMKROOT/src/lib (EL_SRC): Contains source code for the main SMOKE library