Versions Compared
compared with
Key
- This line was added.
- This line was removed.
- Formatting was changed.
How to work with the
ACMEE3SM code base.
- Read the Development Big Picture page. Note in particular the recommended philosophy of working with branches is different than what you may be used to.
- github account for source code
- Sign up for a free account at http://github.com
- Add your github user name to the "About Me" section in your Confluence profile.
- Email James Foucar (jgfouca@sandia.gov) and ask to be added to the ACME E3SM private organization on github. Include your Confluence account name so he can verify you're a member of ACME.
- Instructions for /wiki/spaces/WORKFLOW/pages/7998629
- For the CESM inputdata server, use any of the following
- Use the guest account: user id: guestuser password: friendly
- OR Register as a CESM user. Register here first: http://www.cesm.ucar.edu/models/register/register.html (if that doesn't work, try http://www.cesm.ucar.edu/models/current.html and then Acquiring the CESM code). Note that this it the unrestricted public release.
- OR If you have access to the restricted CESM development repository, that account will also work for the inputdata repo.
- cache your username/password on each machine you use with either of the 2 methods below:
- using a web browser: Go to https://acme-svn2.ornl.gov/acme-repo/ and https://svn-ccsm-inputdata.cgd.ucar.edu/trunk/inputdata/ and enter your xcams and cesm username and password using svn directly: type 'svn ls https://acme-svn2.ornl.gov/acme-repo/', then enter your XCAMS user name and password at the prompt. If asked whether you would like to "store password unencrypted?", answer "yes'. Then type 'svn ls https://svn-ccsm-inputdata.cgd.ucar.edu/trunk/inputdata/' and enter the needed username and password.E3SM. OR "fork" the model to your own github account.
(NOTE: you can skip the next four steps below by running this script https://gist.github.com/douglasjacobsen/3ea4421c0d8ae8c460b0 )
git config --global user.name “First Last”
git config --global user.email “user@lab.gov” (NOTE: use the email you registered on github.com)
- git config --global push.default nothing
- git config --global core.editor ${EDITOR} (vim, emacs, etc.)
git config --global color.ui true
- git config --global core.autocrlf false
- git config --global core.safecrlf false
- git config --global pull.ff only
git clone git@github.com:ACMEE3SM-Climate/ACME.git Project/E3SM.git (Or clone your fork to you development machine).
git submodule update --init
rm -rf .git/hooks; git clone git@github.com:ACMEE3SM-ClimateProject/ACMEE3SM-Hooks.git .git/hooks
git config commit.template ${PWD}/.git/hooks/commit.template
git remote rename origin ACMEE3SM
cd components/mpas-o/model/src/core_ocean
./get_cvmix.sh
./get_BGC.sh
Note these commands should probably be run whenever MPAS-O is updated in case of new cvmix or BGC versions
You are ready to start developing!
- To switch your working tree (local copy) to a pre-existing branch:
- look for remote branch names: git branch -r or see Existing and Planned Tags and Branches
- Run: git checkout --track <remote branchname>
- Ensure your checkout is up to date: git pull --ff-only
- Update MPAS components and other submodules: git submodule update --init
- To create a new topic branch for your development: The following command assumes you are on the master branch, change 'master' to the branch name you're using if it's different
- Ensure your clone is up to date: git pull --ff-only origin master
- If an error is encountered when pulling, talk to an integrator about fixing it
- Create your topic branch for your development: FOLLOW THE ACME E3SM BRANCH NAME CONVENTIONS!
- create the branch in your repository, branching from master: git branch <branchname> master
- switch your working tree (local copy) to this branch: git checkout <branchname>
- Update MPAS Components and other submodules: git submodule update --init
- Note: The URL for submodules may change in the future. If this happens, git does not automatically update the URL of the submodule for you. As long as the URL that your submodule refers to contains the commit being requested for the submodule, this is fine. However, if you get an error saying the commit was not found, you may need to update the URL used by your local submodule to the one updated and stored in .gitmodules. This can be done with the command: git submodule sync If this is needed, it is a one-time operation that is only needed when the URL to which a submodule refers to changes.
- Note: The URL for submodules may change in the future. If this happens, git does not automatically update the URL of the submodule for you. As long as the URL that your submodule refers to contains the commit being requested for the submodule, this is fine. However, if you get an error saying the commit was not found, you may need to update the URL used by your local submodule to the one updated and stored in .gitmodules. This can be done with the command: git submodule sync If this is needed, it is a one-time operation that is only needed when the URL to which a submodule refers to changes.
- To ensure you are working on the correct branch, run "git branch" which will show all your local branches and list a "*" by the branch in your current working tree.
- Ensure your clone is up to date: git pull --ff-only origin master
- git push origin <branchname> Anytime you run "git push" you need to be extremely careful that you know exactly what git is going to do (use --dry-run if you're not sure).
- Never run git push without specifying a branchname. This ensures you push the correct branch (and not the master branch)
NOTE: Do NOT merge your own branch. DO NOT PUSH THE MERGE PULL REQUEST button.
Remaining steps will be led by an ACME E3SM Integrator. Your feature is not done until the Integrator moves your changes to the "master" branch.
Further and more detailed instructions can be found in the Development Reference.
If you're new to git, see the Git Tutorial page
START: Steps 1-3 are done once per person
SETUP: Steps 4-14 are done once per platform.
BASIC DEVELOPMENT: Steps 15-21 are done for each "chunk" of code development.
FINISHING UP: Steps 22-25 are done for each "chunk" of code development.