-
Notifications
You must be signed in to change notification settings - Fork 18
New page and some minor fixes #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rjplevin
wants to merge
1
commit into
JGCRI:gh-pages
Choose a base branch
from
rjplevin:gh-pages
base: gh-pages
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| # Understanding GCAM XML | ||
|
|
||
| As described in the [overview](overview.hmtl), GCAM reads model structure and data from files written in [XML](https://en.wikipedia.org/wiki/XML), a hierarchical file format that is easy to parse and search. For working with XML files, it is convenient to use an XML editor that can expand and | ||
| collapse portions of the hierarchy. | ||
|
|
||
| The XML inputs to GCAM v5.1.2 provides over 34 million lines of XML. The GCAM data system creates 217 files -- not all of which are used at the same time -- which must be assembled into a single hierarchy. | ||
|
|
||
| ## XML files are combined into a single XML tree | ||
|
|
||
| GCAM's data files begin with: | ||
|
|
||
| ```XML | ||
| <scenario> | ||
| <world> | ||
| ``` | ||
|
|
||
| and end with the corresponding closing tags: | ||
|
|
||
| ```XML | ||
| </world> | ||
| </scenario> | ||
| ``` | ||
| The `scenario` node is the root of the hierarchy. As XML files are read in, in the order specified in the `configuration.xml` file, their contents are merged into this hierarchy. For example, if one file has this: | ||
|
|
||
| ```XML | ||
| <scenario> | ||
| <world> | ||
| <region name="USA"> | ||
| <x>1</x> | ||
| <y>42</y> | ||
| </region> | ||
| </world> | ||
| </scenario> | ||
| ``` | ||
|
|
||
| And a second file has this: | ||
|
|
||
| ```XML | ||
| <scenario> | ||
| <world> | ||
| <region name="Mexico"> | ||
| <x>2</x> | ||
| <y>3</y> | ||
| </region> | ||
| <region name="USA"> | ||
| <x>10</x> | ||
| </region> | ||
| </world> | ||
| </scenario> | ||
| ``` | ||
|
|
||
| The merged result would be: | ||
|
|
||
| ```XML | ||
| <scenario> | ||
| <world> | ||
| <region name="USA"> | ||
| <x>10</x> | ||
| <y>42</y> | ||
| </region> | ||
| <region name="Mexico"> | ||
| <x>2</x> | ||
| <y>3</y> | ||
| </region> | ||
| </world> | ||
| </scenario> | ||
| ``` | ||
|
|
||
| The rules for combining XML data are these: | ||
|
|
||
| 1. If the element being read in includes the attribute `delete="1"`, any corresponding node in the document is deleted before the new node is added. That is, the `delete` attribute overrides the merging of content that would otherwise occur. | ||
|
|
||
| 2. If the element being read in includes the attribute `nocreate="1"`, the element will be merged into the document only if a corresponding node already exists in the document. Otherwise, the new element will be discarded. | ||
|
|
||
| 3. If the document has a container element with the same "path" (i.e., sequence of container elements from the root of the hierarchy) as the element being read in, the new element's contents are merged (recursively) with those already in the document. If no corresponding element previously existed in the document, the new element is added at the appropriate location. | ||
|
|
||
|
|
||
| ## Global Technology Database | ||
|
|
||
| To reduce redundancy, most technologies are defined in an element in the XML files called the `global-technology-database`, which we'll abbreviate here as GTDB. This provides common information about technologies, and of which can be overwritten in individual regions. Regional references to technologies in the GTDB are specified using the `stub-technology` element. | ||
|
|
||
| The `global-technology-database` element occurs in 54 files in GCAM v5.1.2. As the XML files are read in, these elements are merged according to the rules above. After all of the XML files have been | ||
| read, all stub-technology nodes are replaced by copying the corresponding technology definition from the GTDB, and then merging any regionally-defined information for that technology, creating a region-specific version of the generic technology. | ||
|
|
||
| ## Pass-through sectors and technologies | ||
|
|
||
| GCAM provides two levels of nesting: subsector and technology. Occasionally, additional levels of competition are needed to achieve the desired behavior. For example, (starting with GCAM v5) most electricity production technologies are further differentiated by cooling technology. To allow these additional levels of competition, GCAM allows “pass-through” sectors that provide additional levels of subsector/technology competition; the original “main” sector is represented with a technology that consumes the “pass-through” with a coefficient of 1 (perfect efficiency) and no additional costs. Pass through sectors must have only this one input. | ||
|
|
||
| ### Pass-through Example | ||
|
|
||
| - An example and figure would be nice here | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's drop the specific numbers here with the reference to the GCAM version. We are trying to avoid having too many places with specifics like this that we would then have to go back and update when things change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're adding details etc, I assume you can delete the numbers, too, right?