The configure utility provides a flexible way to specify a particular configuration of CAM. The best way to communicate to another user how you built CAM is to simply supply them with the configure commandline that was used (along with the source code version).
configure produces the files Filepath and Makefile. In addition, a
configuration cache file (config_cache.xml by default) is written which
contains the values of all the configuration parameters set by configure.
The files produced by running configure are written to the directory
where CAM will be built, which by default is the directory from which
configure is executed, but can be specified to be elsewhere (see
configure will optionally perform tests to validate that the Fortran
compiler is operational and Fortran 90 compliant, and that the linker can
resolve references to required external libraries (NetCDF and possibly
MPI). These tests will point out problems with the user environment in a
way that is much easier to understand than looking at the output from a
failed build of CAM. We strongly recommend that the first time CAM is
built on any new machine, configure should be invoked to execute these
tests (see the
All configuration options can be specified using command line arguments to configure and this is the recommended practice. Options specified via command line arguments take precedence over options specified any other way.
At the next level of precedence a few options can be specified by setting environment variables. And finally, at the lowest precedence, many options have hard-coded defaults. Most of these are located in the files $CAM_ROOT/models/atm/cam/bld/config_files/defaults_*.xml. A few that depend on the values of other options are set by logic contained in the configure script (a Perl script). The hard-coded defaults are designed to produce the standard production configurations of CAM.
The configure script allows the user to specify compile time options such as model resolution, dynamical core type, additional compiler flags, and many other aspects. The user can type configure --help for a complete list of available options.
The following options may all be specified with either one or two leading
--help. The few
options that can be expressed as single letter switches may not be clumped,
-h -s -v may NOT be expressed
-hsv. When multiple options are listed separated by a
vertical bar either version may be used.
These options will have an effect whether running CAM as part of CESM or running in a CAM standalone mode:
Switch on [off] age of air tracers. Default: on for waccm_phys, otherwise off.
Build CAM with specified prognostic chemistry package
trop_mam3 if the physics package
cam5, otherwise default is
This option is meant to be used with the
It modifies the CAM configuration by increasing the number of advected
constituents by 4.
Default: not set.
Specify the component interfaces
A string of user specified CPP defines appended to
Makefile defaults. E.g.
-DVAR2'. Note that a string containing whitespace will need
to be quoted.
Build CAM with specified dynamical core.
CAMCHEM_EDITOR to allow the user to edit the chemistry mechanism file.
Specify horizontal grid.
For spectral grids use
nlon are the
number of latitude and longitude grid points respectively in the Gaussian grid.
For FV grids use
are the grid cell size in degrees for latitude and longitude respectively.
For the HOMME cubed sphere grid use
mg if the physics package
Set total number of advected species to <n>.
Set number of advected test tracers to <n>. Default: 0.
Set number of levels to <n>.
30 if the physics package
26 if the physics package
66 if the chemistry package
uw if the physics package
Set maximum number of columns in a chunk to <n>. Default: 16.
Switch enables building CAM for perturbation growth tests. Only valid with
cam4 physics package.
Physics package. Default:
Comma separated list of prognostic mozart species packages.
rrtmg if the physics package
Pathname of the user supplied chemistry mechanism file.
Switch enables the use of WACCM physics in any chemistry configuration. The user does not need to set this if one of the waccm chemistry options is chosen.
Configure CAM to generate an IOP file that can be used to drive SCAM. This switch only works with the Eulerian dycore.
Compiles model in single column mode. Only works with Eulerian dycore.
Switch on [off] SMP parallelism (OpenMP).
Switch on [off] SPMD parallelism (MPI).
When CAM is running standalone with CICE the CICE decomposition must be explicitly set using the following options:
Note: *** Either set all of
-cice_bsizex, -cice_bsizey, -cice_maxblocksand
-nthreadswhich are used to determine defaults for the cice decomposition. ***
CICE block size in longitude dimension. This size must evenly divide the number of longitude points in the global grid.
CICE block size in latitude dimension. This size must evenly divide the number of latitude points in the global grid.
Maximum number of CICE blocks per processor.
CICE decomposition type [
Number of MPI tasks. Setting ntasks > 0 implies -spmd. Use -nospmd to turn off linking with an MPI library. To configure for pure MPI specify "-ntasks N -nosmp". ntasks is used to determine default grid decompositions. Currently only used by CICE.
Number of OpenMP threads per process. Setting nthreads > 0 implies -smp. Use -nosmp to turn off compilation of OMP directives. For pure OpenMP set "-nthreads N -nospmd" nthreads is used to determine default grid decompositions. Currently only used by CICE.
Name of output cache file. Default: config_cache.xml.
Name of directory where output cache file is written. Default: CAM build directory.
Switch to specify that CAM is being built from within the CESM scripts.
-help | -h
Print usage to STDOUT.
-silent | -s
Turns on silent mode - only fatal messages printed to STDOUT.
Switch on [off] testing of Fortran compiler and linking to external libraries.
-verbose | -v
Turn on verbose echoing of settings made by configure.
Echo the repository tag name used to check out this CAM distribution.
Options for surface components used in standalone CAM mode:
Switch on VOC emissions in CLM. Default: off.
Specify the sea ice component.
Specify the land component.
Specify ocean component.
Options for building CAM via standalone scripts:
Directory where CAM will be built. This is where configure will write the output files it generates (Makefile, Filepath, etc...). Default: ./
Name of the CAM executable. Default:
Directory where CAM executable will be created. Default: CAM build directory.
User specified C compiler. Overrides Makefile default.
A string of user specified C compiler options. Appended to Makefile defaults.
Switch to turn on building CAM with compiler options for debugging.
Specify a configuration file which will be used to supply defaults instead of one of the config_files/defaults_*.xml files. This file is used to specify model configuration parameters only. Parameters relating to the build which are system dependent will be ignored.
Directory containing ESMF library and the esmf.mk file.
User specified Fortran compiler. Overrides Makefile default.
A string of user specified Fortran compiler flags. Appended to
-fopt to override optimization flags.
A string of user specified Fortran compiler optimization flags. Overrides Makefile defaults.
Name of the GNU make program on your system. Supply the absolute
pathname if the program is not in your path (or fix your path). This is
only needed by configure for running tests via the
Directory containing LAPACK library.
A string of user specified load options. Appended to Makefile defaults.
User specified linker. Overrides Makefile default of FC.
Directory containing MPI include files.
Directory containing MPI library.
Directory containing NetCDF include files.
Directory containing NetCDF library.
Directory containing NetCDF module files.
Directory containing PnetCDF include files.
Directory containing PnetCDF library.
Build CAM with the offline radiation driver. This produces an executable that can only be used for offline radiation calculations.
Override the OS setting for cross platform compilation from the following
Default: OS on which configure is executed as defined by the Perl $OSNAME variable.
Directories containing user source code.