Skip to content

Commit e65b8d4

Browse files
authored
Merge pull request #54 from GEOS-ESM/feature/mathomp4/update-components-ctm-2025Mar11
Update to match GEOSgcm main as of 2025-Mar-11
2 parents e23ab57 + af95f51 commit e65b8d4

38 files changed

+3870
-1605
lines changed

.circleci/config.yml

Lines changed: 29 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,39 @@
11
version: 2.1
22

3-
executors:
4-
gfortran-large:
5-
docker:
6-
- image: gmao/ubuntu20-geos-env-mkl:v6.2.8-openmpi_4.0.6-gcc_11.2.0
7-
auth:
8-
username: $DOCKERHUB_USER
9-
password: $DOCKERHUB_AUTH_TOKEN
10-
environment:
11-
OMPI_ALLOW_RUN_AS_ROOT: 1
12-
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
13-
OMPI_MCA_btl_vader_single_copy_mechanism: none
14-
resource_class: large
3+
parameters:
4+
GHA_Actor:
5+
type: string
6+
default: ""
7+
GHA_Action:
8+
type: string
9+
default: ""
10+
GHA_Event:
11+
type: string
12+
default: ""
13+
GHA_Meta:
14+
type: string
15+
default: ""
1516

16-
ifort-large:
17-
docker:
18-
- image: gmao/ubuntu20-geos-env:v6.2.8-intelmpi_2021.2.0-intel_2021.2.0
19-
auth:
20-
username: $DOCKERHUB_USER
21-
password: $DOCKERHUB_AUTH_TOKEN
22-
resource_class: large
17+
# Anchors to prevent forgetting to update a version
18+
os_version: &os_version ubuntu24
19+
baselibs_version: &baselibs_version v7.32.0
20+
bcs_version: &bcs_version v11.6.0
21+
tag_build_arg_name: &tag_build_arg_name gcmversion
22+
23+
orbs:
24+
ci: geos-esm/circleci-tools@4
2325

2426
workflows:
2527
build-test:
2628
jobs:
27-
- build-GEOSctm:
29+
- ci/build:
2830
name: build-GEOSctm-on-<< matrix.compiler >>
29-
matrix:
30-
parameters:
31-
compiler: [gfortran, ifort]
3231
context:
3332
- docker-hub-creds
34-
35-
jobs:
36-
build-GEOSctm:
37-
parameters:
38-
compiler:
39-
type: string
40-
executor: << parameters.compiler >>-large
41-
working_directory: /root/project
42-
steps:
43-
- checkout:
44-
path: GEOSctm
45-
- run:
46-
name: "Versions etc"
47-
command: mpirun --version && << parameters.compiler>> --version && echo $BASEDIR && pwd && ls
48-
- run:
49-
name: "Mepo clone external repos"
50-
command: |
51-
cd ${CIRCLE_WORKING_DIRECTORY}/GEOSctm
52-
mepo clone
53-
mepo status
54-
- run:
55-
name: "Mepo checkout-if-exists"
56-
command: |
57-
cd ${CIRCLE_WORKING_DIRECTORY}/GEOSctm
58-
echo "${CIRCLE_BRANCH}"
59-
if [ "${CIRCLE_BRANCH}" != "develop" ] && [ "${CIRCLE_BRANCH}" != "main" ]
60-
then
61-
mepo checkout-if-exists ${CIRCLE_BRANCH}
62-
fi
63-
mepo status
64-
- run:
65-
name: "CMake"
66-
command: |
67-
mkdir -p /logfiles
68-
cd ${CIRCLE_WORKING_DIRECTORY}/GEOSctm
69-
mkdir -p ${CIRCLE_WORKING_DIRECTORY}/workspace/build-GEOSctm
70-
cd ${CIRCLE_WORKING_DIRECTORY}/workspace/build-GEOSctm
71-
cmake ${CIRCLE_WORKING_DIRECTORY}/GEOSctm -DBASEDIR=$BASEDIR/Linux -DCMAKE_Fortran_COMPILER=<< parameters.compiler >> -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=${CIRCLE_WORKING_DIRECTORY}/workspace/install-GEOSctm -DUSE_F2PY=OFF |& tee /logfiles/cmake.log
72-
- run:
73-
name: "Build and install"
74-
command: |
75-
cd ${CIRCLE_WORKING_DIRECTORY}/workspace/build-GEOSctm
76-
make -j"$(nproc)" install |& tee /logfiles/make.log
77-
- run:
78-
name: "Compress artifacts"
79-
command: |
80-
gzip -9 /logfiles/*
81-
- store_artifacts:
82-
path: /logfiles
33+
matrix:
34+
parameters:
35+
compiler: [gfortran, ifort, ifx]
36+
baselibs_version: *baselibs_version
37+
repo: GEOSctm
38+
develop_repos: "GMAO_Shared GEOS_Util"
39+
persist_workspace: false # Needs to be true to run fv3/gcm experiment, costs extra

.github/workflows/enforce-labels.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
count: 1
1717
labels: "0 diff,0 diff trivial,Non 0-diff,0 diff structural,0-diff trivial,Not 0-diff,0-diff,automatic,0-diff uncoupled,github_actions"
1818
add_comment: true
19+
message: "This PR is being prevented from merging because you have not added one of our required labels: {{ provided }}. Please add one so that the PR can be merged."
20+
1921
blocking-label:
2022
runs-on: ubuntu-latest
2123
steps:

.github/workflows/workflow.yml

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
# Do not run if the only files changed cannot affect the build
77
paths-ignore:
88
- "**.md"
9+
- "**.json"
10+
- "ChangeLog-PreJason.txt"
911
- "parallel_build.csh"
1012
- ".github/CODEOWNERS"
1113
- ".codebuild/**"
@@ -17,33 +19,41 @@ jobs:
1719
if: "!contains(github.event.pull_request.labels.*.name, '0 diff trivial')"
1820
runs-on: ubuntu-latest
1921
container:
20-
image: gmao/ubuntu20-geos-env-mkl:v6.2.4-openmpi_4.0.5-gcc_10.3.0
21-
credentials:
22-
username: ${{ secrets.DOCKERHUB_USERNAME }}
23-
password: ${{ secrets.DOCKERHUB_TOKEN }}
22+
image: gmao/ubuntu24-geos-env:v7.32.0-intelmpi_2021.13-ifort_2021.13
23+
# Per https://github.com/actions/virtual-environments/issues/1445#issuecomment-713861495
24+
# It seems like we might not need secrets on GitHub Actions which is good for forked
25+
# pull requests
26+
#credentials:
27+
#username: ${{ secrets.DOCKERHUB_USERNAME }}
28+
#password: ${{ secrets.DOCKERHUB_TOKEN }}
2429
env:
2530
OMPI_ALLOW_RUN_AS_ROOT: 1
2631
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
2732
OMPI_MCA_btl_vader_single_copy_mechanism: none
2833
steps:
34+
# https://github.com/orgs/community/discussions/25678#discussioncomment-5242449
35+
- name: Delete huge unnecessary tools folder
36+
run: rm -rf /opt/hostedtoolcache
2937
- name: Cancel Previous Runs
30-
uses: styfle/cancel-workflow-action@0.5.0
38+
uses: styfle/cancel-workflow-action@0.12.1
3139
with:
3240
access_token: ${{ github.token }}
3341
- name: Checkout CTM
34-
uses: actions/checkout@v2
42+
uses: actions/checkout@v4
3543
with:
3644
fetch-depth: 1
45+
- name: Set all directories as git safe
46+
run: |
47+
git config --global --add safe.directory '*'
3748
- name: Versions etc.
3849
run: |
39-
gfortran --version
50+
ifort --version
4051
mpirun --version
4152
echo $BASEDIR
4253
- name: Mepo clone external repos
4354
run: |
4455
mepo clone
4556
mepo status
46-
mepo status
4757
- name: Update other branches
4858
if:
4959
"!contains('refs/heads/main,refs/heads/develop', github.ref)"
@@ -54,7 +64,7 @@ jobs:
5464
run: |
5565
mkdir build
5666
cd build
57-
cmake .. -DBASEDIR=$BASEDIR/Linux -DCMAKE_Fortran_COMPILER=gfortran -DCMAKE_BUILD_TYPE=Debug -DMPIEXEC_PREFLAGS='--oversubscribe' -DUSE_F2PY=OFF
67+
cmake .. -DBASEDIR=$BASEDIR/Linux -DCMAKE_Fortran_COMPILER=ifort -DCMAKE_BUILD_TYPE=Debug -DMPIEXEC_PREFLAGS='--oversubscribe' -DUSE_F2PY=OFF
5868
- name: Build
5969
run: |
6070
cd build

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,14 @@
99
parallel_build.o*
1010
log.*
1111
CMakeUserPresets.json
12+
13+
# Ignore possible symlinked directories
14+
build-*
15+
install-*
16+
17+
*.swp
18+
*.swo
19+
.DS_Store
20+
*#
21+
.#*
22+
**/CVS/

CMakeLists.txt

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required (VERSION 3.13)
1+
cmake_minimum_required (VERSION 3.24)
22
cmake_policy (SET CMP0053 NEW)
33
cmake_policy (SET CMP0054 NEW)
44

@@ -34,10 +34,58 @@ set (FV_PRECISION "R8" CACHE STRING "Precision of FV3 core (R4, R4R8, R8)")
3434
foreach (dir cmake @cmake cmake@)
3535
if (EXISTS ${CMAKE_CURRENT_LIST_DIR}/${dir})
3636
list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/${dir}")
37+
set (ESMA_CMAKE_PATH "${CMAKE_CURRENT_LIST_DIR}/${dir}" CACHE PATH "Path to ESMA_cmake code")
3738
endif ()
3839
endforeach ()
40+
41+
# We need to find MPI before we go into esma
42+
# for the MPI stack detection to work
43+
set(MPI_DETERMINE_LIBRARY_VERSION TRUE)
44+
find_package(MPI)
45+
3946
include (esma)
4047

48+
# Add CMake for when not using Baselibs
49+
if (NOT Baselibs_FOUND)
50+
51+
find_package(NetCDF REQUIRED C Fortran)
52+
add_definitions(-DHAS_NETCDF4)
53+
add_definitions(-DHAS_NETCDF3)
54+
add_definitions(-DNETCDF_NEED_NF_MPIIO)
55+
add_definitions(-DHAS_NETCDF3)
56+
57+
find_package(HDF5 REQUIRED)
58+
if(HDF5_IS_PARALLEL)
59+
add_definitions(-DH5_HAVE_PARALLEL)
60+
endif()
61+
62+
if (NOT TARGET ESMF::ESMF)
63+
find_package(ESMF 8.6.1 MODULE REQUIRED)
64+
target_link_libraries(ESMF::ESMF INTERFACE MPI::MPI_Fortran)
65+
66+
# GEOS uses lowercase target due to historical reasons but
67+
# the latest FindESMF.cmake file from ESMF produces an ESMF::ESMF target.
68+
if (NOT TARGET esmf)
69+
add_library(esmf ALIAS ESMF::ESMF)
70+
endif ()
71+
if (NOT TARGET ESMF)
72+
add_library(ESMF ALIAS ESMF::ESMF)
73+
endif ()
74+
endif ()
75+
76+
find_package(GFTL_SHARED REQUIRED)
77+
78+
find_package(ZLIB REQUIRED)
79+
# Another issue with historical reasons, old/wrong zlib target used in GEOS
80+
add_library(ZLIB::zlib ALIAS ZLIB::ZLIB)
81+
82+
find_package(MAPL 2.54 QUIET)
83+
if (MAPL_FOUND)
84+
message(STATUS "Found MAPL: ${MAPL_BASE_DIR} (found version \"${MAPL_VERSION})\"")
85+
endif ()
86+
87+
endif ()
88+
4189
ecbuild_declare_project()
4290

4391
# Generic DFLAGS
@@ -63,5 +111,5 @@ install(
63111
DESTINATION ${CMAKE_INSTALL_PREFIX}
64112
)
65113

66-
# Adds abiilty to tar source
114+
# Adds ability to tar source
67115
include (esma_cpack)

CMakePresets.json

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,14 @@
11
{
2-
"version": 3,
2+
"version": 7,
33
"cmakeMinimumRequired": {
44
"major": 3,
5-
"minor": 21,
5+
"minor": 27,
66
"patch": 0
77
},
8+
"include": [
9+
"presets/CMake$penv{CMAKE_PRESET_NAME}Presets.json"
10+
],
811
"configurePresets": [
9-
{
10-
"name": "base-configure",
11-
"hidden": true,
12-
"displayName": "Base Configure Settings",
13-
"description": "Sets build and install directories",
14-
"binaryDir": "${sourceDir}/build-${presetName}",
15-
"cacheVariables": {
16-
"BASEDIR": "$env{BASEDIR}",
17-
"CMAKE_INSTALL_PREFIX": "${sourceDir}/install-${presetName}",
18-
"CMAKE_BUILD_TYPE": "${presetName}"
19-
}
20-
},
2112
{
2213
"name": "base-gnu",
2314
"hidden": true,

0 commit comments

Comments
 (0)