Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CTM to be in line with GEOSgcm 10.21.0 (and a bit more) #42

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ executors:

ifort-large:
docker:
- image: gmao/ubuntu20-geos-env:v6.2.8-intelmpi_2021.2.0-intel_2021.2.0
- image: gmao/ubuntu20-geos-env:v6.2.8-intelmpi_2021.3.0-intel_2021.3.0
auth:
username: $DOCKERHUB_USER
password: $DOCKERHUB_AUTH_TOKEN
Expand Down
14 changes: 7 additions & 7 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
# Order is important; the last matching pattern takes the most
# precedence.

# Everything in GEOSgcm should be owned by the GCM Gatekeepers
# Everything in GEOSctm should be owned by the CTM Gatekeepers
* @GEOS-ESM/ctm-gatekeepers

# The GCM gatekeepers and CMake should know/approve these
# The CTM gatekeepers and CMake should know/approve these
/.github/ @GEOS-ESM/cmake-team @GEOS-ESM/ctm-gatekeepers
/.circleci/ @GEOS-ESM/cmake-team @GEOS-ESM/ctm-gatekeepers
/.codebuild/ @GEOS-ESM/cmake-team @GEOS-ESM/ctm-gatekeepers
/.circleci/ @GEOS-ESM/cmake-team @GEOS-ESM/ctm-gatekeepers
/.codebuild/ @GEOS-ESM/cmake-team @GEOS-ESM/ctm-gatekeepers

# The GEOS CMake Team is the CODEOWNER for the CMakeLists.txt files in this repository
CMakeLists.txt @GEOS-ESM/cmake-team
# The GEOS CMake Team should be notified about changes to the CMakeLists.txt files in this repository
CMakeLists.txt @GEOS-ESM/cmake-team @GEOS-ESM/ctm-gatekeepers

# The GEOS CMake Team should be notified about and approve config changes
/config/ @GEOS-ESM/cmake-team
/config/ @GEOS-ESM/cmake-team @GEOS-ESM/ctm-gatekeepers
38 changes: 38 additions & 0 deletions .github/workflows/release-tarball.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Create Complete Release Tarball

on:
release:
types: [published]

jobs:
release:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
with:
path: ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}

- name: Checkout mepo
uses: actions/checkout@v2
with:
repository: GEOS-ESM/mepo
path: mepo

- name: Run mepo
run : |
cd ${GITHUB_WORKSPACE}/${{ github.event.repository.name }}-${{ github.event.release.tag_name }}
${GITHUB_WORKSPACE}/mepo/mepo clone

- name: Create tarball
run: |
tar --exclude-vcs --exclude=.mepo -cf ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}.COMPLETE.tar ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}
xz -T6 ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}.COMPLETE.tar

- name: Upload tarball
run: |
gh release upload ${{ github.event.release.tag_name }} ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}.COMPLETE.tar.xz -R ${{ github.repository_owner }}/${{ github.event.repository.name }}
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

4 changes: 2 additions & 2 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
# Do not run if the only files changed cannot affect the build
paths-ignore:
- "**.md"
- "**.json"
- "parallel_build.csh"
- ".github/CODEOWNERS"
- ".codebuild/**"
Expand All @@ -17,7 +18,7 @@ jobs:
if: "!contains(github.event.pull_request.labels.*.name, '0 diff trivial')"
runs-on: ubuntu-latest
container:
image: gmao/ubuntu20-geos-env-mkl:v6.2.4-openmpi_4.0.5-gcc_10.3.0
image: gmao/ubuntu20-geos-env-mkl:v6.2.8-openmpi_4.0.6-gcc_11.2.0
credentials:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand All @@ -43,7 +44,6 @@ jobs:
run: |
mepo clone
mepo status
mepo status
- name: Update other branches
if:
"!contains('refs/heads/main,refs/heads/develop', github.ref)"
Expand Down
12 changes: 11 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ set (FV_PRECISION "R8" CACHE STRING "Precision of FV3 core (R4, R4R8, R8)")
foreach (dir cmake @cmake cmake@)
if (EXISTS ${CMAKE_CURRENT_LIST_DIR}/${dir})
list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/${dir}")
set (ESMA_CMAKE_PATH "${CMAKE_CURRENT_LIST_DIR}/${dir}" CACHE PATH "Path to ESMA_cmake code")
endif ()
endforeach ()
include (esma)
Expand Down Expand Up @@ -63,5 +64,14 @@ install(
DESTINATION ${CMAKE_INSTALL_PREFIX}
)

# Adds abiilty to tar source
# Adds ability to tar source
include (esma_cpack)

# This installs a tarball of the source code
# in the installation directory.
# MUST BE THE LAST CODE IN THIS FILE
option(INSTALL_SOURCE_TARFILE "Create and install source tarfile" OFF)
if(INSTALL_SOURCE_TARFILE)
install(CODE "set(CMAKE_PROJECT_NAME \"${CMAKE_PROJECT_NAME}\")")
install(SCRIPT "${ESMA_CMAKE_PATH}/esma_postinstall.cmake")
endif()
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,29 @@ you choose.

If all you wish is to build the model, you can run `parallel_build.csh` from a head node. Doing so will checkout all the external repositories of the model and build it. When done, the resulting model build will be found in `build/` and the installation will be found in `install/` with setup scripts like `ctm_setup` in `install/bin`.

#### Develop Version of GEOS CTM

`parallel_build.csh` provides a special flag for checking out the
development branch of GMAO_Shared. If you run:

```
parallel_build.csh -develop
```
then `mepo` will run:

```
mepo develop GMAO_Shared
```

#### Debug Version of GEOS

To obtain a debug version, you can run `parallel_build.csh -debug` which will build with debugging flags. This will build in `build-Debug/` and install into `install-Debug/`.

#### Do not create and install source tarfile with parallel_build

Note that running with `parallel_build.csh` will create and install a tarfile of the source code at build time. If you wish to avoid
this, run `parallel_build.csh` with the `-no-tar` option.

---

### Multiple Steps for Building the Model
Expand All @@ -126,6 +145,20 @@ The first command initializes the multi-repository and the second one
clones and assembles all the sub-repositories according to
`components.yaml`

#### Checking out develop branch of GMAO_Shared

To get the development branch of GMAO_Shared (a la
the `-develop` flag for `parallel_build.csh`, one needs to run the
equivalent `mepo` command. As mepo itself knows (via `components.yaml`) what the development branch of each
subrepository is, the equivalent of `-develop` for `mepo` is to
checkout the development branch of GMAO_Shared:
```
mepo develop GMAO_Shared
```

This must be done *after* `mepo clone` as it is running a git command in
each sub-repository.

#### Build the Model

##### Load Compiler, MPI Stack, and Baselibs
Expand Down Expand Up @@ -157,6 +190,14 @@ This will install to a directory parallel to your `build` directory. If you pref
```
and CMake will install there.

###### Create and install source tarfile

Note that running with `parallel_build.csh` will create and install a tarfile of the source code at build time. But if CMake is run by hand, this is not the default action (as many who build with CMake by hand are developers and not often running experiments). In order to enable this at install time, add:
```
-DINSTALL_SOURCE_TARFILE=ON
```
to your CMake command.

##### Build and Install with Make
```
make -jN install
Expand Down
14 changes: 7 additions & 7 deletions components.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ GEOSctm:
env:
local: ./@env
remote: ../ESMA_env.git
tag: v3.4.0
tag: v3.10.0
develop: main

cmake:
local: ./@cmake
remote: ../ESMA_cmake.git
tag: v3.6.2
tag: v3.8.0
develop: develop

ecbuild:
Expand All @@ -22,14 +22,14 @@ ecbuild:
GMAO_Shared:
local: ./src/Shared/@GMAO_Shared
remote: ../GMAO_Shared.git
tag: v1.4.10
tag: v1.5.0
sparse: ./config/GMAO_Shared.sparse
develop: main

MAPL:
local: ./src/Shared/@MAPL
remote: ../MAPL.git
tag: v2.8.6
tag: v2.15.0
develop: develop

FMS:
Expand All @@ -41,19 +41,19 @@ FMS:
FVdycoreCubed_GridComp:
local: ./src/Components/GEOSctm_GridComp/@FVdycoreCubed_GridComp
remote: ../FVdycoreCubed_GridComp.git
tag: v1.2.17
tag: v1.6.0
develop: develop

fvdycore:
local: ./src/Components/GEOSctm_GridComp/@FVdycoreCubed_GridComp/@fvdycore
remote: ../GFDL_atmos_cubed_sphere.git
tag: geos/v1.1.7
tag: geos/v1.3.0
develop: geos/develop

GEOSchem_GridComp:
local: ./src/Components/GEOSctm_GridComp/@GEOSchem_GridComp
remote: ../GEOSchem_GridComp.git
tag: v1.6.0
tag: v1.7.0
develop: develop

HEMCO:
Expand Down
4 changes: 2 additions & 2 deletions parallel_build.csh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ end

if (-d ${ESMADIR}/@env || -d ${ESMADIR}/env@ || -d ${ESMADIR}/env) then
if ( "$DEVELOP" == "TRUE" ) then
echo "Checking out development branches of GMAO_Shared"
echo "Checking out development branch of GMAO_Shared"
mepo develop GMAO_Shared
endif
else
Expand All @@ -46,7 +46,7 @@ else
mepo init
mepo clone
if ( "$DEVELOP" == "TRUE" ) then
echo "Checking out development branches of GEOSgcm_GridComp, GEOSgcm_App, and GMAO_Shared"
echo "Checking out development branch of GMAO_Shared"
mepo develop GMAO_Shared
endif
endif
Expand Down
14 changes: 6 additions & 8 deletions src/Applications/GEOSctm_App/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,11 @@ else()
set(CFG_HYDROSTATIC FALSE)
endif()

# Did we build for AMD Rome hardware (aka EPYC)?
cmake_host_system_information(RESULT proc_decription QUERY PROCESSOR_DESCRIPTION)
if (${proc_decription} MATCHES "EPYC")
set(CFG_BUILT_ON_ROME TRUE)
else ()
set(CFG_BUILT_ON_ROME FALSE)
endif ()
if(INSTALL_SOURCE_TARFILE)
set(CFG_INSTALL_SOURCE_TARFILE TRUE)
else()
set(CFG_INSTALL_SOURCE_TARFILE FALSE)
endif()

set (setup_scripts
ctm_setup
Expand All @@ -59,6 +57,6 @@ foreach (file ${setup_scripts})
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${file} DESTINATION bin)
endforeach ()


configure_file(.GEOSCTM_VERSION .GEOSCTM_VERSION @ONLY)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/.GEOSCTM_VERSION DESTINATION etc)

Loading