Skip to content

Updating components

Andrew Kiss edited this page Aug 30, 2024 · 2 revisions

All the components that make up OM3 (models, coupler, etc) are currently included as git submodules and built using CMake. This means that, in a nutshell, updating a given component usually requires updating the git submodule and the CMake build system.

Step by step instructions

Submodule update

Although not required, we recommend starting the process from a clean git repository:

git clone --recursive https://github.com/COSIMA/access-om3.git

Next, go to the directory of the component to update. For example, to update MOM6:

cd access-om3/MOM6/MOM6

and checkout the branch/tag/commit you want to update to:

git checkout <branch/tag/commit>

Some of the components have git submodules themselves. If that's the case, they need also need to be updated:

git submodule update --recursive

CMake update

Quite often the changes to the component's sources will include addition and/or removal of files. When this happens, the CMake build system also need to be updated accordingly. The sources are listed in the CMakeLists.txt files that one can find in each component subdirectory. For example, in the case of WW3, that's the WW3/CMakeLists.txt(notWW3/WW3/CMakeLists.txt`!).

At this point, it might also happen that some patches are not necessary anymore and they will throw an error when building the code. If this happens, one needs to update the corresponding patch. If no patch at all is needed after the update, the corresponding patch should be removed from the git repository:

git rm <COMPONENT>/patches/<file>.F90_patch

and the original source file needs to be moved from the list of sources to patch to the "normal" source files list in CMakeLists.txt. The changes should look like this:

 target_sources(OM3_<target> PRIVATE
   ...
+  <file>
   ...
 )
 ...
-add_patched_source(OM3_<target> <file>)
Clone this wiki locally