preview_namelists is a script in CIMEROOT/CIME/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/runner/work/cime/cime/CIME/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.