def main(cime_path): """Main function Args: cime_path (str): path to the cime that we're using (this is passed in explicitly rather than relying on calling path_to_cime so that we can be absolutely sure that the scripts called here are coming from the same cime as the cime library we're using). """ setup_logging_pre_config() args = parse_command_line() process_logging_args(args) buildnml( cime_path=cime_path, rundir=args.rundir)
def main(cime_path): """Main function called when run_sys_tests is run from the command-line Args: cime_path (str): path to the cime that we're using (this is passed in explicitly rather than relying on calling path_to_cime so that we can be absolutely sure that the scripts called here are coming from the same cime as the cime library we're using). """ setup_logging_pre_config() args = _commandline_args() process_logging_args(args) logger.info('Running on machine: %s', args.machine_name) if args.job_launcher_nobatch: job_launcher_type = JOB_LAUNCHER_NOBATCH else: job_launcher_type = None machine = create_machine( machine_name=args.machine_name, job_launcher_type=job_launcher_type, defaults=MACHINE_DEFAULTS, account=args.account, job_launcher_queue=args.job_launcher_queue, job_launcher_walltime=args.job_launcher_walltime, job_launcher_nice_level=_NICE_LEVEL, job_launcher_extra_args=args.job_launcher_extra_args) logger.debug("Machine info: %s", machine) run_sys_tests(machine=machine, cime_path=cime_path, skip_testroot_creation=args.skip_testroot_creation, skip_git_status=args.skip_git_status, dry_run=args.dry_run, suite_name=args.suite_name, testfile=args.testfile, testlist=args.testname, suite_compilers=args.suite_compiler, testid_base=args.testid_base, testroot_base=args.testroot_base, rerun_existing_failures=args.rerun_existing_failures, compare_name=args.compare, generate_name=args.generate, baseline_root=args.baseline_root, walltime=args.walltime, queue=args.queue, retry=args.retry, extra_create_test_args=args.extra_create_test_args)
def main (): """ Description ----------- Calls function that modifies an fsurdat (surface dataset) """ # set up logging allowing user control setup_logging_pre_config() # read the command line argument to obtain the path to the .cfg file parser = argparse.ArgumentParser() parser.add_argument('cfg_path', help='/path/name.cfg of input file, eg ./modify.cfg') add_logging_args(parser) args = parser.parse_args() process_logging_args(args) fsurdat_modifier(args.cfg_path)
def main(): """ Main function for gen_mksurf_namelist. """ # -- add logging flags from ctsm_logging setup_logging_pre_config() parser = get_parser() add_logging_args(parser) args = parser.parse_args() process_logging_args(args) res = args.res glc_nec = args.glc_nec input_path = args.input_path ssp_rcp = args.ssp_rcp crop_flag = args.crop_flag vic_flag = args.vic_flag glc_flag = args.glc_flag hres_flag = args.hres_flag start_year = args.start_year end_year = args.end_year # -- determine end_year if not given as an argument: if not end_year: end_year = start_year # -- check if the input path exist if not os.path.exists(input_path): sys.exit("ERROR: \n" + "\t raw_dir does not exist on this machine. \n" + "\t Please point to the correct raw_dir using --raw-dir" + "or --rawdata-dir flags.") ctsm_case = CtsmCase(res, glc_nec, ssp_rcp, crop_flag, input_path, vic_flag, glc_flag, start_year, end_year, hres_flag) logger.info("--------------------------") logger.info(" ctsm case : %s", ctsm_case) logger.info("--------------------------") ctsm_case.create_namelist_file()
def main(cime_path): """Main function called when build_ctsm is run from the command-line Args: cime_path (str): path to the cime that we're using (this is passed in explicitly rather than relying on calling path_to_cime so that we can be absolutely sure that the scripts called here are coming from the same cime as the cime library we're using). """ setup_logging_pre_config() args = _commandline_args() process_logging_args(args) build_dir = os.path.abspath(args.build_dir) if args.rebuild: rebuild_ctsm(build_dir=build_dir) else: build_ctsm(cime_path=cime_path, build_dir=build_dir, compiler=args.compiler, no_build=args.no_build, machine=args.machine, os_type=args.os, netcdf_path=args.netcdf_path, esmf_lib_path=args.esmf_lib_path, max_mpitasks_per_node=args.max_mpitasks_per_node, gmake=args.gmake, gmake_j=args.gmake_j, pnetcdf_path=args.pnetcdf_path, pio_filesystem_hints=args.pio_filesystem_hints, gptl_nano_timers=args.gptl_nano_timers, extra_fflags=args.extra_fflags, extra_cflags=args.extra_cflags, no_pnetcdf=args.no_pnetcdf, build_debug=args.build_debug, build_with_openmp=args.build_with_openmp, inputdata_path=args.inputdata_path)