Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

How to retain CESM source code when pushing local CESM version to personal Github repository

Hello,

I am working with the release-cesm2.1.5 tag for CESM and making modifications to the source code to aid an ongoing research project. In order to make this version of the code more accessible to the public, I tried to push a copy on my personal Github account into which I plan to document the changes I am making. However, the source code modifications were not retained and the version that shows up on Github is a skeleton version of the code that lacks the component models.

I believe this is due to the the tagging infrastructure of CESM, but I'm not sure how to account for this. Can anyone recommend a workflow for uploading the full CESM tag on to a personal Github repository?

Thank you for your help!
Hunter
 

katec

CSEG and Liaisons
Staff member
HI there, so yes, CESM uses code from many different models (CAM, MOM, CICE, CTSM, CISM, etc) and brings that code together using git submodules and the git-fleximod tool to manage the code from the external directories. You can see the URLs for each of the included modules in the ".gitmodules" file in the root of each git directory. The typical workflow for managing your own CESM codebase is to make a fork of the CESM repository into your own space. So, you create a fork like github.com/hbrown18/CESM and then fork any model repositories that you want to edit. So you would create, say, github.com/hbrown18/CAM for modified atmosphere code. Then, you would edit the .gitmodule file that points to the CAM repository and point it to check out your fork instead. Then, anybody who checks out your fork of CESM and runs ".gitfleximod update" will get your modified code checked out as well.

There are other "hacky" options too. You could checkout CESM and then build the source tree in a separate location without submodules (just "cp -r" the code to the new directory) and then check all of that into a fresh repo. But there are A LOT of drawbacks to this method, and I wouldn't recommend it at all.

Some people use the source mods feature within a case directory to keep track of their source modifications to their CESM repository. Then, you could create a github repo with just the case directories (which include the modified source files) and those would also include all of your experiment set up and tweaks as well. This is another common method of managing source modifications with NCAR scientists.
 
Vote Upvote 0 Downvote
Top