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 Tools, 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”), and the EDSS Tools library (Section 11.1.2, “EDSS Tools 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/modmake.inc
  • $FS_ROOT/openset.f
  • $FS_ROOT/promptset.f
  • $FS_ROOT/readset.F
  • $FS_ROOT/SETDECL.EXT
  • $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.

  • $ETINC/IOCNST3.EXT
  • $ETINC/IOPRVT3.EXT
  • $ETINC/IOSTRG3.EXT
  • $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/modmake.inc

11.1.3. 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
Cntlmat $SMKROOT/src/cntlmat CL_SRC
Elevpoint $SMKROOT/src/point PT_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
Metcombine $SMKROOT/src/emutil UT_SRC
Metscan $SMKROOT/src/emutil UT_SRC
Met4moves $SMKROOT/src/movesmrg MV_SRC
Movesmrg $SMKROOT/src/movesmrg MV_SRC
Mrggrid $SMKROOT/src/smkmerge MG_SRC
Normbeis3 $SMKROOT/src/biog BG_SRC
Pktreduc $SMKROOT/src/emutil UT_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
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