Difference between revisions of "Interfacing HEMCO into GEOS-Chem"

From Geos-chem
Jump to: navigation, search
(New page: On this page == The == PS: here are the details on how I created the subtree structure: Main sources used (beside the git manual page): *http://psionides.eu/2010/02/04/sharing-code-bet...)
 
(Replaced content with "This content has been migrated to the [https://hemco.readthedocs.io/en/latest/coupling/intro.html '''Coupling HEMCO to other models''' chapter of <tt>hemco.readthedocs.io<...")
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
On this page
+
This content has been migrated to the [https://hemco.readthedocs.io/en/latest/coupling/intro.html '''Coupling HEMCO to other models''' chapter of <tt>hemco.readthedocs.io</tt>].
 
+
== The ==
+
 
+
PS: here are the details on how I created the subtree structure:
+
 
+
Main sources used (beside the git manual page):
+
 
+
*http://psionides.eu/2010/02/04/sharing-code-between-projects-with-git-subtree/
+
*http://makingsoftware.wordpress.com/2013/02/16/using-git-subtrees-for-repository-separation/
+
 
+
1. Create subtree of HEMCO code in GC repo
+
 
+
cd Code.v10-01                        # or whatever your GEOS-Chem code dir is named
+
git subtree split -P HEMCO -b export
+
 
+
2. Import subtree into new repo (this is the new HEMCO source code)
+
 
+
cd /home/ckeller/HEMCO/src/
+
git init
+
git fetch ../Code.v10-01 export
+
git checkout -b master FETCH_HEAD
+
 
+
3. Add HEMCO code as new remote to GC
+
 
+
cd Code.v10-01
+
git remote add hemco /home/ckeller/HEMCO/src/.git
+
git fetch hemco
+
 
+
4. Remove existing HEMCO code from GC repo
+
 
+
git rm -r HEMCO
+
git commit -m "Remove HEMCO from GEOS-Chem. Will be imported as subtree"
+
 
+
5. Add HEMCO as subtree
+
 
+
git subtree add -P HEMCO -m "Readded HEMCO as subtree"  hemco/master
+
 
+
Done!
+
 
+
== Pulling updates from the external HEMCO repository into GEOS-Chem ==
+
 
+
To pull the newest changes from the external HEMCO repository into GEOS-Chem, follow these instructions:
+
 
+
cd Code.v10-01    # or whatever your GEOS-Chem code dir is named
+
git fetch hemco
+
git subtree merge -P HEMCO --squash -m "merged changes from HEMCO" hemco/master
+
 
+
NOTES:
+
#The <tt>-P</tt> option specifies the subdirectory of <tt>Code.v10-01</tt> into which to pull the updates from the separate HEMCO repository.
+
#The <tt>--squash</tt> option "squashes" the git history of the source code into a single commit.  Otherwise, the full history will be imported.
+
#The <tt>-m</tt> option specifies the commit message that will show up in the revision history.
+
 
+
--[[User:Bmy|Bob Y.]] 13:52, 28 July 2014 (EDT)
+
 
+
== Pushing changes made to HEMCO in GEOS-Chem back to the external HEMCO repository ==
+
 
+
If you updated the HEMCO code in GEOS-Chem, and want to send those updates back to the external HEMCO repository, follow this procedure:
+
 
+
To bring changes made in GEOS-Chem (/home/ckeller/geosChem/v10-01c/hemco/Code.v10-01c/HEMCO) into the source code (/home/ckeller/HEMCO/src/):
+
 
+
cd /home/ckeller/geosChem/v10-01c/hemco/Code.v10-01c/
+
git subtree split -P HEMCO -b update
+
git push hemco update:master
+
 
+
NOTES:
+
#The <tt>-P</tt> option specifies the subdirectory of <tt>Code.v10-01</tt> into which to pull the updates from the separate HEMCO repository.
+
#The <tt>-b</tt> lets you specify the branch name in the remote HEMCO repository into which the updates will be sent.
+
 
+
--[[User:Bmy|Bob Y.]] 13:52, 28 July 2014 (EDT)
+

Revision as of 18:23, 10 August 2022

This content has been migrated to the Coupling HEMCO to other models chapter of hemco.readthedocs.io.