Part of #4950 . Slice 3A of 5. Estimated 4 weeks. Depends on #4996 .
This is a new feature with breaking-change potential — done with feature
flag and 4-stage rollout.
Goal
Remove config_files.xml indirection and standardize SRCROOT resolution for
submodule and standalone usage. Resolves #4956 and addresses #3923 .
Resolution priority for SRCROOT
Environment variable SRCROOT
User config ~/.cime/config
Command-line flag --srcroot
Step up one directory from CIMEROOT (typical submodule layout)
CIMEROOT itself (standalone mode)
Expected directory structure
$SRCROOT/
├── cime_config/ # Model config (validated)
│ ├── config_grids.xml
│ ├── config_compsets.xml
│ ├── config_machines.xml
│ └── config_tests.xml
└── cime/ # CIME submodule
What's removed
CIME/data/config/{e3sm,cesm,ufs}/config_files.xml
MODEL_CONFIG_FILES indirection
Model-specific get_config_path() logic
What's added
CIME/core/config/srcroot.py — SRCROOTResolver (constructor injection,
no globals, fully testable).
CIME/core/config/loader.py — ConfigFileLoader for direct config XML
loading.
--srcroot flag on CLI tools.
Explicit standalone mode for unit tests.
Tasks
Implementation
Move from utils.py → core/config/
get_cime_root, get_src_root, get_model, set_model,
get_cime_config, get_config_path, get_schema_path,
get_template_path, get_tools_path, get_cime_default_driver,
get_all_cime_models, get_model_config_location_within_cime,
get_scripts_root, get_model_config_root, get_htmlroot,
get_urlroot.
Migration (4-stage rollout)
Opt-in (weeks 1–2): feature flag CIME_USE_NEW_CONFIG_LOADER=true.
Opt-out (weeks 3–4): new system default; old available via flag.
Deprecation : warnings on old code paths.
Removal : delete config_files.xml system.
Validation
Definition of done
Related
Part of #4950. Slice 3A of 5. Estimated 4 weeks. Depends on #4996.
This is a new feature with breaking-change potential — done with feature
flag and 4-stage rollout.
Goal
Remove
config_files.xmlindirection and standardize SRCROOT resolution forsubmodule and standalone usage. Resolves #4956 and addresses #3923.
Resolution priority for SRCROOT
SRCROOT~/.cime/config--srcrootExpected directory structure
What's removed
CIME/data/config/{e3sm,cesm,ufs}/config_files.xmlMODEL_CONFIG_FILESindirectionget_config_path()logicWhat's added
CIME/core/config/srcroot.py—SRCROOTResolver(constructor injection,no globals, fully testable).
CIME/core/config/loader.py—ConfigFileLoaderfor direct config XMLloading.
--srcrootflag on CLI tools.Tasks
Implementation
CIME/core/config/srcroot.pywithSRCROOTResolverclass.CIME/core/config/loader.pywithConfigFileLoaderclass.--srcrootflag to all CLI tools.CIME/XML/files.pyto use new loader (gated by feature flag).Move from
utils.py→core/config/get_cime_root,get_src_root,get_model,set_model,get_cime_config,get_config_path,get_schema_path,get_template_path,get_tools_path,get_cime_default_driver,get_all_cime_models,get_model_config_location_within_cime,get_scripts_root,get_model_config_root,get_htmlroot,get_urlroot.Migration (4-stage rollout)
CIME_USE_NEW_CONFIG_LOADER=true.config_files.xmlsystem.Validation
Definition of done
config_files.xmlno longer referenced after stage 4.--srcrootflag works on every CLI tool.Related
CIME/core/build/#4999 (build refactor must come after stable config loading)