#!/usr/bin/env python3

"""
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:
   ./preview_namelists
"""

from standard_script_setup import *

from CIME.case import Case
from CIME.utils import expect

import argparse

###############################################################################
def parse_command_line(args, description):
    ###############################################################################
    parser = argparse.ArgumentParser(
        description=description, formatter_class=argparse.RawTextHelpFormatter
    )

    CIME.utils.setup_standard_logging_options(parser)

    parser.add_argument(
        "caseroot",
        nargs="?",
        default=os.getcwd(),
        help="Case directory for which namelists are generated.\n"
        "Default is current directory.",
    )

    parser.add_argument(
        "--component",
        help="Specify component's namelist to build.\n"
        "If not specified, generates namelists for all components.",
    )

    args = CIME.utils.parse_args_and_handle_standard_logging_options(args, parser)

    return args


###############################################################################
def _main_func(description):
    ###############################################################################
    args = parse_command_line(sys.argv, description)

    expect(
        os.path.isfile(os.path.join(args.caseroot, "CaseStatus")),
        "case.setup must be run prior to running preview_namelists",
    )
    with Case(args.caseroot, read_only=False, record=True) as case:
        case.create_namelists(component=args.component)


if __name__ == "__main__":
    _main_func(__doc__)

a7fb3507b3d32f79413ce4ace9bd83caf1626cbe
<mask token>

<mask token>


def parse_command_line(args, description):
    parser = argparse.ArgumentParser(description=description,
        formatter_class=argparse.RawTextHelpFormatter)
    CIME.utils.setup_standard_logging_options(parser)
    parser.add_argument('caseroot', nargs='?', default=os.getcwd(), help=
        """Case directory for which namelists are generated.
Default is current directory."""
        )
    parser.add_argument('--component', help=
        """Specify component's namelist to build.
If not specified, generates namelists for all components."""
        )
    args = CIME.utils.parse_args_and_handle_standard_logging_options(args,
        parser)
    return args


def _main_func(description):
    args = parse_command_line(sys.argv, description)
    expect(os.path.isfile(os.path.join(args.caseroot, 'CaseStatus')),
        'case.setup must be run prior to running preview_namelists')
    with Case(args.caseroot, read_only=False, record=True) as case:
        case.create_namelists(component=args.component)


<mask token>

<mask token>


def parse_command_line(args, description):
    parser = argparse.ArgumentParser(description=description,
        formatter_class=argparse.RawTextHelpFormatter)
    CIME.utils.setup_standard_logging_options(parser)
    parser.add_argument('caseroot', nargs='?', default=os.getcwd(), help=
        """Case directory for which namelists are generated.
Default is current directory."""
        )
    parser.add_argument('--component', help=
        """Specify component's namelist to build.
If not specified, generates namelists for all components."""
        )
    args = CIME.utils.parse_args_and_handle_standard_logging_options(args,
        parser)
    return args


def _main_func(description):
    args = parse_command_line(sys.argv, description)
    expect(os.path.isfile(os.path.join(args.caseroot, 'CaseStatus')),
        'case.setup must be run prior to running preview_namelists')
    with Case(args.caseroot, read_only=False, record=True) as case:
        case.create_namelists(component=args.component)


if __name__ == '__main__':
    _main_func(__doc__)

<mask token>
from standard_script_setup import *
from CIME.case import Case
from CIME.utils import expect
import argparse


def parse_command_line(args, description):
    parser = argparse.ArgumentParser(description=description,
        formatter_class=argparse.RawTextHelpFormatter)
    CIME.utils.setup_standard_logging_options(parser)
    parser.add_argument('caseroot', nargs='?', default=os.getcwd(), help=
        """Case directory for which namelists are generated.
Default is current directory."""
        )
    parser.add_argument('--component', help=
        """Specify component's namelist to build.
If not specified, generates namelists for all components."""
        )
    args = CIME.utils.parse_args_and_handle_standard_logging_options(args,
        parser)
    return args


def _main_func(description):
    args = parse_command_line(sys.argv, description)
    expect(os.path.isfile(os.path.join(args.caseroot, 'CaseStatus')),
        'case.setup must be run prior to running preview_namelists')
    with Case(args.caseroot, read_only=False, record=True) as case:
        case.create_namelists(component=args.component)


if __name__ == '__main__':
    _main_func(__doc__)

#!/usr/bin/env python3

"""
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:
   ./preview_namelists
"""

from standard_script_setup import *

from CIME.case import Case
from CIME.utils import expect

import argparse

###############################################################################
def parse_command_line(args, description):
    ###############################################################################
    parser = argparse.ArgumentParser(
        description=description, formatter_class=argparse.RawTextHelpFormatter
    )

    CIME.utils.setup_standard_logging_options(parser)

    parser.add_argument(
        "caseroot",
        nargs="?",
        default=os.getcwd(),
        help="Case directory for which namelists are generated.\n"
        "Default is current directory.",
    )

    parser.add_argument(
        "--component",
        help="Specify component's namelist to build.\n"
        "If not specified, generates namelists for all components.",
    )

    args = CIME.utils.parse_args_and_handle_standard_logging_options(args, parser)

    return args


###############################################################################
def _main_func(description):
    ###############################################################################
    args = parse_command_line(sys.argv, description)

    expect(
        os.path.isfile(os.path.join(args.caseroot, "CaseStatus")),
        "case.setup must be run prior to running preview_namelists",
    )
    with Case(args.caseroot, read_only=False, record=True) as case:
        case.create_namelists(component=args.component)


if __name__ == "__main__":
    _main_func(__doc__)
