The complete pipeline from raw data to queriable output, so agents understand where values originate and how to trace them.
Raw CSV data (inst/extdata/)
-> R processing scripts (gcamdata/R/)
-> Generated XML (gcamdata/xml/)
-> GCAM C++ solver
-> BaseX XML output database (output/<scenario>/database_basexdb/)
-> XQuery extraction (this skill)
Location: input/gcamdata/inst/extdata/
These CSVs contain the empirical data and assumptions fed into the model. Key subdirectories:
| Directory | Content |
|---|---|
gcam-china/ |
China-specific sector definitions, province data, I/O tables |
energy/ |
Energy sector technology costs, efficiencies, resource curves |
emissions/ |
Emission factors, control costs |
socioeconomics/ |
GDP, population, SSP projections |
aglu/ |
Agriculture and land use data |
| File | Content |
|---|---|
gcam-china/A323.sector_China.csv |
Sector metadata: names, output-unit, price-unit, logit exponent |
gcam-china/A323.subsector.csv |
Subsector definitions |
gcam-china/A323.globaltech_cost.csv |
Technology non-energy costs |
gcam-china/A323.globaltech_coef.csv |
Input-output coefficients (GJ input per ton output) |
gcam-china/A323.efficiency_improve.csv |
Efficiency improvement rates over time |
gcam-china/detailed_industry_output.csv |
Historical province-level industrial output (Mt) |
gcam-china/IO_detailed_industry.csv |
Province-level input-output tables |
Location: input/gcamdata/R/
Script naming convention: zgcamchina_L{level}{number}.{description}.R
L1xxx: Level 1 — read and process raw dataL2xxx: Level 2 — calibrate parameters, build technology cost/share-weight/coef structureszgcamchina_xml_*.R: Convert processed data to XML formatzgcamchina_L1323.Detailed_industry.R -> reads output, I/O, sector CSV
zgcamchina_L2323.Detailed_industry_CHINA.R -> builds TechCost, ShareWeights, Coefs
zgcamchina_xml_Detailed_industry_CHINA.R -> writes detailed_industry_CHINA.xml
Location: input/gcamdata/xml/
These are the XML files read by the GCAM solver. Each file typically represents one scenario component.
| File | Content |
|---|---|
detailed_industry_CHINA.xml |
All detailed industry sectors by province |
cement_CHINA.xml |
Cement sector |
Fert_CHINA.xml |
Ammonia / nitrogen fertilizer sector |
CCS_shrwt_CHINA.xml |
CCS technology share weights |
Cstorage_CHINA.xml |
Carbon storage resource supply curves |
no_offshore_ccs.xml |
Disable offshore CCS |
turn_off_ccs.xml |
Global CCS disable switch |
The solver (C++ binary) reads the configuration XML, loads all component XMLs, and solves the partial equilibrium system for each time period. Output is written as XML to a BaseX database.
Location: output/<scenario>/database_basexdb/
This is what XQuery queries. The database contains the full model state: all regions, sectors, technologies, costs, outputs, inputs, and marketplace transactions.
sector/cost in BaseX output is NOT a value from any input CSV. It is the model-solved result, influenced by:
globaltech_cost.csv)globaltech_coef.csv or I/O tables)Even when input costs are constant, sector/cost varies across years and provinces because energy prices, carbon prices, and technology shares change.
To trace where a specific output value comes from:
A323.sector_China.csv (output-unit, price-unit)