CIME 提供了定义模型特定配置和hooks的能力。
配置会改变 CIME 的运行时, hooks 会在其事件期间被触发。
9.1. CIME 如何加载自定义设置?
CIME 将搜索 cime_config/customize
目录,并加载该目录及其子目录下找到的任何 Python 文件。
加载的任何变量、函数或类都可以从 CIME.customize
模块中访问。
9.2. CIME 配置
可用的配置和描述。
变量名 | 默认 | 类型 | 描述 |
---|---|---|---|
additional_archive_components | (‘drv’,‘dart’) | tuple | 需要归档的其他组件。 |
allow_unsupported | True | bool | 如果设置为 True,则允许使用不支持的 compsets 和分辨率。 |
baseline_store_teststatus | True | bool | 如果设置为 True 且 GENERATE_BASELINE 也设置,则会在 Case 的 base_line 中创建一个 teststatus.log。 |
build_cime_component_lib | True | bool | 如果设置为 True,则会将 Filepath、CIME_cppdefs 和 CCSM_cppdefs 目录从 CASEBUILD 目录复制到 BUILDROOT,以便构建 CIME 的内部组件。 |
build_model_use_cmake | False | bool | 如果设置为 True,则使用 CMake 构建模型,否则使用 Make。 |
calculate_mode_build_cost | False | bool | 如果设置为 True,TestScheduler 将设置构建模型的处理器数量为 min(16, (($GMAKE_J * 2) / 3) + 1),否则设置为 4。 |
case_setup_generate_namelist | False | bool | 如果设置为 True 且 case 是一个测试,则在 case.setup 期间会创建 namelists。 |
check_invalid_args | True | bool | 如果设置为 True,则会检查脚本参数是否有效。 |
check_machine_name_from_test_name | True | bool | 如果设置为 True,则 TestScheduler 将使用测试列表来解析测试列表。 |
common_sharedlibroot | True | bool | 如果设置为 True,则会为该 Case 设置 SHAREDLIBROOT,并且 SystemTests 将仅构建一次动态库。 |
copy_cesm_tools | True | bool | 如果设置为 True,则会将 CESM 特定工具复制到 Case 目录中。 |
copy_cism_source_mods | True | bool | 如果设置为 True,则会创建$CASEROOT/SourceMods/src.cism/source_cism,并在该目录中写入 README 文件。 |
copy_e3sm_tools | False | bool | 如果设置为 True,则将 E3SM 特定工具复制到 Case 目录中。 |
create_bless_log | False | bool | 如果设置为 True,并且在比较测试与 baselines 时,最新添加的 bless 会被添加到注释中。 |
create_test_flag_mode | cesm | str | 设置 create_test 脚本的标志模式。当设置为 cesm 时,-c 标志将比较 baselines与给定目录。 |
default_short_term_archiving | True | bool | 如果设置为 True 且 Case 不是测试,则 DOUT_S 设置为 True,TIMER_LEVEL 设置为 4。 |
driver_choices | (‘mct’, ‘nuopc’) | tuple | 设置模型的可用驱动选项。 |
driver_default | nuopc | str | 设置模型的默认驱动程序。 |
enable_smp | True | bool | 如果设置为 True,则 SMP= 将被添加到模型编译命令中。 |
make_case_run_batch_script | False | bool | 如果设置为 True 且 case 不是测试,则会在 case 目录中从$MACHDIR/template.case.run.sh 创建 case.run.sh。 |
mct_path | {srcroot}/libraries/mct | str | 设置 mct 库的路径。 |
serialize_sharedlib_builds | True | bool | 如果设置为 True,则 TestScheduler 将使用 proc_pool + 1 个处理器来构建动态库,否则将使用单个处理器。 |
set_comp_root_dir_cpl | True | bool | 如果设置为 True,则针对此 Case 设置 COMP_ROOT_DIR_CPL。 |
share_exes | False | bool | 如果设置为 True,则 TestScheduler 将在测试之间共享可执行文件。 |
shared_clm_component | True | bool | 如果设置为 True,并且 clm 陆地组件被构建为动态库。 |
sort_tests | False | bool | 如果设置为 True,则 TestScheduler 将按运行时对测试进行排序。 |
test_custom_project_machine | melvin | str | 当测试没有 PROJECT 的机器时,设置机器名称。 |
test_mode | cesm | str | 设置测试模式,这将更改 CIME 的单元测试和系统测试的各种配置。 |
ufs_alternative_config | False | bool | 如果设置为 True 且 UFS_DRIVER 设置为 nems,则模型配置目录设置为$CIMEROOT/../src/model/NEMS/cime/cime_config。 |
use_kokkos | False | 布尔值 | 如果设置为 True 且 CAM_TARGET 是 preqx_kokkos、theta-l 或 theta-l_kokkos,则 kokkos 将使用动态库构建。 |
use_nems_comp_root_dir | False | bool | 如果设置为 True,则使用 UFS_DRIVER(如果定义)来设置 COMP_ROOT_DIR_CPL。 |
use_testreporter_template | True | bool | 如果设置为 True,则 TestScheduler 将在$CIME_OUTPUT_ROOT 创建 testreporter。 |
verbose_run_phase | False | bool | 如果设置为 True,则在 SystemTests 成功运行阶段后,经过的时间将被记录到 BASELINE_ROOT 中;如果失败,则测试将与之前的运行结果进行对比,并在测试日志中列出潜在的破坏性合并。 |
xml_component_key | COMP_ROOT_DIR_{} | str | 作为查询 XML 系统以找到组件根目录的键所使用的字符串模板,例如模板 COMP_ROOT_DIR_{},组件 LND 变为 COMP_ROOT_DIR_LND。 |
9.3. CIME hooks
可用的 hooks 和描述。
函数 | 描述 |
---|---|
save_build_provenance(case, lid) | 在模型构建后调用。 |
save_prerun_provenance(case, lid) | 在模型运行前调用。 |
save_postrun_provenance(case, lid) | 在模型运行后调用。 |
Last updated on