If the executables for your platform are not available from the CMAS web site, you will need to compile SMOKE for your system. You may also need to compile SMOKE if you would like to modify the source code. The following steps will help get you set up to compile SMOKE.
Install SMOKE as described in Section 12.3, “Installing SMOKE”. You may receive an error message indicating that the Assigns file could not be sourced when you run the smoke_install.csh script.
The script sets the $SMK_HOME/scripts/setup_edss$EDSS_OS environment variable based on the results of the uname command. The uses $SMK_HOME/scripts/platform$EDSS_OS to determine the appropriate compiler command and options for your system. The platform script has compiler options for several UNIX systems and you will either need to review these settings for your compiler
or add settings if your system is not included.
Source the platform script as follows:
cd $SMK_HOME/scripts
source platform
If your system is not recognized by the script, you will get an error message and you will need to add your system to the
platform script. Check the value of the $EDSS_OS environment variable and set it to the switch statement. This switch statement sets the SMOKE_EXE environment variable which is then used in the switch statement.
The compiler and its options are set by the switch statement. The default Linux Portland Group compiler options for the optimized executable are:
if you are not using the default Linux2_x86pg settings, you will need to check (or add) your Fortran compiler (using the environment
variable FC) and the compiler options. The environment variable FFLAGS sets the Fortran compiler options for the optimized executables and the DBGFLAGS variable sets the options for the debug executables. You should set your options to match the options used for the Linux
compile of SMOKE as closely as possible. First of all, set the environment variables listed below at the command line prior
to invoking the SMOKE Assigns files.
Linux2_x86 with Intel Fortran
setenv SMOKE_EXE Linux2_x86ifcsetenv FC ifortsetenv FFLAG "-O2 -save -zero -extend_source -nbs -W0"setenv DBGFLAG "-g -CB -CS -CU -extend_source -save -zero –nbs"setenv M6_FFLAG "-O2 -save -zero -nbs -extend_source -W0 -mp1"setenv F_UFMTENDIAN big32-bit SGI IRIX6
setenv SMOKE_EXE IRIXn32f90-O2setenv FC f90setenv FFLAG "-static –n32 –col80 -align64 -O3"setenv DBGFLAG "-static -n32 –col80 -align64 -g -C \-DEBUG:conform_check=on:div_check=3:trap_uninitialized=on"64-bit SGI IRIX6
setenv SMOKE_EXE IRIXn64f90Ysetenv FC f90setenv FFLAG "-static –n64 –col80 -align64 -O3"setenv DBGFLAG "-static -n32 –col80 -align64 -g -C \-DEBUG:conform_check=on:div_check=3:trap_uninitialized=on"SunOS5
setenv SMOKE_EXE SunOS5f90setenv FC f90setenv FFLAG "-O3 -Bstatic"setenv DBGFLAG "-g –C"HP UX11
setenv SMOKE_EXE HP_UX11f90setenv FC f90setenv FFLAG "+O3"setenv DBGFLAG "-g –C"64-bit AIX4
setenv SMOKE_EXE AIX4n64f90setenv FC xlfsetenv FFLAG "-O3 -bmaxdata:0X20000000"setenv DBGFLAG "-g -C -b64 -bmaxdata:0X20000000"32-bit AIX4
setenv SMOKE_EXE AIX4f90setenv FC xlfsetenv FFLAG "-O3 -bmaxdata:0X20000000"setenv DBGFLAG "-g -C -bmaxdata:0X20000000"Alpha Linux
setenv SMOKE_EXE Linux2_Alphasetenv FC fortsetenv FFLAG "-O5 -fast -automatic -assume no2underscores"setenv DBGFLAG "-g -C"Download the I/O API library version 3.0 from the I/O API home page and compile with Makeinclude.Linux2_x86pg. The I/O API can be installed in or you can place symbolic links to the $SMK_HOME/subsys/ioapilibioapi.a library file and datshift utility program in the directory.
$SMK_HOME/subsys/ioapi/Linux2_x86pg/
Create the directory and then copy the $SMK_HOME/subsys/ioapi_includes/*.EXT files from the fixed_src directory of your I/O API installation to this new directory.
Note: If the user wants to see interactive screen outputs while running SMOKE, follow these steps; 1) Add IOAPIDEFS = -DIOAPI_STDOUT to Makefile and 2) Add DEFINEFLAGS = IOAPI__DEFS $(ARCHFLAGS) $(PARFLAGS) to the Makefile.nocpl.sed for a proper IOAPI compilation for the SMOKE model.
Note: If there are any error messages during compilation regarding CONST3.EXT, go to the fixed_src directory, edit CONST3.EXT and delete the second & at the end of line 42.
Collect or create the NetCDF library version 3.6.1 for your platform and create a symbolic link to the libnetcdf.a library file in the directory.
$SMK_HOME/subsys/netcdf/$SMOKE_EXE/
If needed, update the files
$SMK_HOME/subsys/edss_tools/setup/sysflags$SMK_HOME/subsys/filesetapi/sysflags$SMK_HOME/subsys/smoke/assigns/sysflagsto have the compiler options for your operating system. See the instructions above for the platform file updates to determine whether you need to do this. All of the same cases available in the platform file are also available in these three files.
After the appropriate libraries and compile options have been installed, you can source an Assigns file to ensure that your system is configured properly.
cd $SMK_HOME/subsys/smoke/assigns
source ASSIGNS.nctox.cmaq.cb4p25.us12-nc
At this point, you may need to create some symbolic links that are normally created by the smoke_install.csh script. If your system was not in the platform script, then these links would not have been created. You can use the following shell script to create the symbolic links.
#!/bin/csh
cd $SMKROOT/src
foreach dir ( biog cntlmat emmod emqa emutil grdmat inc lib \
mo6 mobile point smkinven smkmerge spcmat temporal )
cd $dir
ln -s ../../scripts/make/Makeit ./
cd ..
end
cd $ARDAT
echo "#LIST" > arinv.stationary.lst
ls $ARDAT/arinv.nonpoint.nti99_NC.new.txt >> arinv.stationary.lst
ls $ARDAT/arinv.stationary.nei96_NC.ida.txt >> arinv.stationary.lst
cd $MBDAT
echo "#LIST" > mbinv.lst
ls $MBDAT/mbinv.nei99_NC.ida.txt >> mbinv.lst
ln -s mcref.nctox.txt mcref.nctox_18.txt
ln -s mvref.nctox.txt mvref.nctox_18.txt
cd $INVDIR/nonroad
echo "#LIST" > arinv.nonroad.lst
ls $INVDIR/nonroad/arinv.nonroad.n* >> arinv.nonroad.lst
cd $PTDAT
echo "#LIST" > ptinv.lst
ls $PTDAT/ptinv.n* >> ptinv.lstYou should now be ready to compile the SMOKE programs. Change directories to .
$SCRIPTS/make/
Optionally edit the header of the Makeall file to turn off building one or more libraries needed for SMOKE (libfileset, libedsstools, libsmoke, or libmo6). You can
turn off these options only if these libraries have been previously compiled for your system.
At the UNIX prompt, type:
Makeall
The only errors that are acceptable when you use this script are errors after the /bin/rm commands. The /bin/rm commands will fail if there are no object files (*.o files) in your SMOKE source code directories. This will be the case if you have not previously compiled SMOKE.
After running the Makeall script, you should have the following executables in the $SMK_BIN directory:
aggwndw, beld3to2, bluesky2inv, cemscan, cntlmat, elevpoint, emisfac, extractida, grdmat, grwinven, invsplit, laypoint, mbsetup, metcombine, metscan, mrgelev, mrggrid, normbeis3, pktreduc, premobl, rawbio, smk2emis, smkinven, smkmerge, smkreport, spcmat, surgtool, temporal, tmpbeis3, tmpbio, uam2ncf
If you would like to compile individual programs, you can do so using the Makeit command in the appropriate source code directory. For example, to make the Smkinven program, type the following:
cd $IV_SRC
Makeit smkinven
Once you have compiled the SMOKE programs, you can run the SMOKE example scripts following the instructions in Section 4.4, “Running the nctox test case”.