forked from NGEET/fates
-
Notifications
You must be signed in to change notification settings - Fork 0
Rosie's developer instructions
Rosie Fisher edited this page Apr 26, 2024
·
27 revisions
These instructions are basic setup instructions for doing FATES development in the context of CTSM.
- Clone CTSM
> git clone https://github.com/ESCOMP/ctsm.git
> cd ctsm
2. Check out external pieces of code, including FATES.
> ./manage_externals/checkout_externals
- Go into sandbox
cd cime/scripts
- Make a test case with vanilla clm5 to check sandbox
./create_newcase --case ctsm_test_case --res f45_f45_mg37 --compset I2000Clm50BgcCrop --run-unsupported
cd ctsm_test_case
./case.setup
./case.build
./xmlchange --id STOP_N --val 10
./xmlchange --id RUN_STARTDATE --val '1996-01-01'
./xmlchange --id STOP_OPTION --val nyears
./xmlchange --id CLM_FORCE_COLDSTART --val on
./xmlchange --id JOB_WALLCLOCK_TIME --val 06:00:00
./xmlchange --id DATM_YR_START --val 1996
./xmlchange --id DATM_YR_END --val 2001
./case.submit
- Make a FATES test case with to check sandbox FATES version
./create_newcase --case clm5-fates_test_case --res f45_f45_mg37 --compset I2000Clm50Fates --run-unsupported
cd clm5-fates_test_case
./case.setup
./case.build
./xmlchange --id STOP_N --val 10
./xmlchange --id RUN_STARTDATE --val '2001-01-01'
./xmlchange --id STOP_OPTION --val nyears
./xmlchange --id CLM_FORCE_COLDSTART --val on
./xmlchange --id JOB_WALLCLOCK_TIME --val 06:00:00
./xmlchange --id DATM_YR_START --val 1996
./xmlchange --id DATM_YR_END --val 2001
./case.submit
- Go to FATES code:
cd ../../../src/fates/
- Check we are in the fates-release repo.
git remote -v
- Add FATES development repo:
git remote add ngeet_repo https://github.com/NGEET/fates.git
- Make your own fork of FATES In a web browser, go to https://github.com/NGEET/FATES and press 'fork'
This should now be in https://github.com/rosiealice/fates/ (obviously, change 'rosiealice' for your own username on github)
Add this repo to your remotes (back in terminal)
git remote add rosie_fates_repo https://github.com/rosiealice/fates
- Synchronize "master" branch with the NGEET/repository
> git fetch ngeet_repo
> git checkout master
> git pull ngeet_repo master
- Create and switch to new feature branch, e.g.
git checkout -b deeproots
note on how to work with an existing branch.. https://www.atlassian.com/git/tutorials/syncing/git-fetch
- Make another FATES test case with to double check branch FATES version
cd ../cime/scripts/
./create_newcase --case clm5-fates_test_case_2 --res f45_f45_mg37 --compset I2000Clm50Fates --run-unsupported
cd clm5-fates_test_case_2
./case.setup
./case.build
./xmlchange STOP_N=10
./xmlchange STOP_OPTION=nyears
./xmlchange CLM_FORCE_COLDSTART=on
./xmlchange --id JOB_WALLCLOCK_TIME --val 06:00:00
./xmlchange --id DATM_CLMNCEP_YR_START --val 1996
./xmlchange --id DATM_CLMNCEP_YR_END --val 2001
./case.submit
-
Modify code.
-
Make new case to test modifications:
./create_newcase --case clm5-fates_btranmod --res f45_f45_mg37 --compset I2000Clm50Fates
cd clm5-fates_test_case_2
./case.setup
./case.build
./xmlchange STOP_N=10
./xmlchange STOP_OPTION=nyears
./xmlchange CLM_FORCE_COLDSTART=on
./case.submit
- Commit modifications to branch:
git add biogeophys/EDBtranMod.F90
git commit -m "btran modifications for deep water access"
- Check for new updates on NGEET/FATES
git pull ngeet_repo master
- Go back to feature branch
git checkout deeproots
- Merge changes back into branch in from ngeet_repo via master branch.
git merge master
- Push committed changes back onto fork
git push rosie_fates_repo deeproots
-
Go look at https://github.com/rosiealice/fates/branches to check that all is well.
-
Make pull request using web interface as per https://github.com/NGEET/fates/wiki/Commit-and-Pull-Request-Protocols
IF YOU GET STUCK IN DETACHED HEAD STATE, USE git reset TO GO BACK TO EARLIER COMMIT.