To add a new component to an existing configuration:
<Value> line inside <ScenarioComponents><ScenarioComponents>
<!-- ... existing components ... -->
<Value name="new_component_label">../input/gcamdata/xml/new_file.xml</Value>
<!-- ... remaining components ... -->
</ScenarioComponents>
<!-- <Value name="component_to_remove">../input/gcamdata/xml/old_file.xml</Value> -->
Comment out rather than delete, to preserve a record.
The XML file you add must reference nodes that already exist in the model. For example, adding CCS share weights that reference N fertilizer when the model uses ammonia will cause initialization failure.
Fix: check the actual sector names in the existing XML before adding new components. XQuery:
distinct-values(collection()/scenario/world/*/*[@type="sector"]/@name)
Some components depend on others. For example, CCS_shrwt_CHINA.xml requires that the basic sector structure (from detailed_industry_CHINA.xml or equivalent) is already loaded.
Fix: ensure the prerequisite component appears earlier in <ScenarioComponents>.
Components are parsed in order. A component that modifies a sector’s StubTechCost should come after the base sector definition but before any component that depends on that cost value.
Adding CCS_shrwt_CHINA.xml directly to a DPEC configuration fails with:
No Discrete Choice function set in AH, N fertilizer
distinct-values(collection()/scenario/world/*[@type="region"]/*[@type="sector"]/@name)
CCS_shrwt_CHINA.xmlammonia, but CCS file references N fertilizerOption A (recommended): Create an adapted CCS XML with corrected sector names:
cp CCS_shrwt_CHINA.xml CCS_shrwt_CHINA_adapted.xml
# Replace all `N fertilizer` with `ammonia` in the adapted file
Then reference the adapted file in configuration.
Option B: Remove problematic sector blocks and test remaining CCS weights (cement, electricity, liquids) first.
Always verify sector name compatibility before loading new components. The GCAM-China R constant gcamchina.FERT_NAME confirms the internal name. See sector-naming-conventions.md for the full mapping.
After a model run, check:
exe/logs/main_log.txt: overall model statusoutput/<scenario>/run.log: scenario-specific logERROR or WARNING in these logs