preview_namelists is a script in CIMEROOT/scripts/Tools.

$ ./preview_namelists --help
usage: preview_namelists [-h] [-d] [-v] [-s] [--component COMPONENT]

Creates namelist and other model input files for each component (by running each
component's buildnml script). Then copies the generated files to the CaseDocs
subdirectory for inspection.

It is not required to run this manually: namelists will be generated
automatically when the run starts. However, this can be useful in order to
review the namelists before submitting the case.

case.setup must be run before this.

Typical usage is simply:

positional arguments:
  caseroot              Case directory for which namelists are generated.
                        Default is current directory.

  -h, --help            show this help message and exit
  -d, --debug           Print debug information (very verbose) to file /home/titters/devel/E3SM/cime/master/scripts/Tools/preview_namelists.log
  -v, --verbose         Add additional context (time and file) to log messages
  -s, --silent          Print only warnings and error messages
  --component COMPONENT
                        Specify component's namelist to build.
                        If not specified, generates namelists for all components.