Skip to content

Commit

Permalink
Merge pull request #36 from GEOS-ESM/feature/mathomp4/update-to-lates…
Browse files Browse the repository at this point in the history
…tgcm-fvdy

Update to be in sync with GEOSgcm v10.19.4
  • Loading branch information
mathomp4 authored Oct 8, 2021
2 parents a06a094 + f1f0276 commit 50a197c
Show file tree
Hide file tree
Showing 11 changed files with 383 additions and 52 deletions.
101 changes: 73 additions & 28 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
version: 2.1

executors:
gcc-build-env:
gfortran-large:
docker:
- 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.7-openmpi_4.0.6-gcc_11.2.0
auth:
username: $DOCKERHUB_USER
password: $DOCKERHUB_AUTH_TOKEN
Expand All @@ -14,70 +14,110 @@ executors:
resource_class: large
#MEDIUM# resource_class: medium

ifort-large:
docker:
- image: gmao/ubuntu20-geos-env:v6.2.7-intelmpi_2021.2.0-intel_2021.2.0
auth:
username: $DOCKERHUB_USER
password: $DOCKERHUB_AUTH_TOKEN
resource_class: large
#MEDIUM# resource_class: medium

workflows:
version: 2.1
build-and-test:
jobs:
- build:
context:
- build-GEOSfvdycore:
name: build-GEOSfvdycore-on-<< matrix.compiler >>
matrix:
parameters:
compiler: [gfortran, ifort]
context:
- docker-hub-creds
- make-experiment:
- make-fv3-experiment:
name: make-fv3-experiment-on-<< matrix.compiler >>
matrix:
parameters:
compiler: [gfortran, ifort]
requires:
- build
- build-GEOSfvdycore-on-<< matrix.compiler >>
context:
- docker-hub-creds
- run-standalone:
- run-fv3-standalone:
name: run-fv3-standalone-on-<< matrix.compiler >>
matrix:
parameters:
compiler: [gfortran, ifort]
requires:
- make-experiment
- make-fv3-experiment-on-<< matrix.compiler >>
context:
- docker-hub-creds

jobs:
build:
executor: gcc-build-env
build-GEOSfvdycore:
parameters:
compiler:
type: string
executor: << parameters.compiler >>-large
working_directory: /root/project
steps:
- checkout:
path: GEOSfvdycore
- run:
name: "Versions etc"
command: mpirun --version && gfortran --version && echo $BASEDIR && pwd && ls
command: mpirun --version && << parameters.compiler>> --version && echo $BASEDIR && pwd && ls
- run:
name: "Mepo clone external repos"
command: |
cd ${CIRCLE_WORKING_DIRECTORY}/GEOSfvdycore
mepo clone
mepo status
- run:
name: "Mepo checkout-if-exists"
command: |
cd ${CIRCLE_WORKING_DIRECTORY}/GEOSfvdycore
echo "${CIRCLE_BRANCH}"
if [ "${CIRCLE_BRANCH}" != "develop" ] && [ "${CIRCLE_BRANCH}" != "main" ]
then
mepo checkout-if-exists ${CIRCLE_BRANCH}
fi
mepo status
- run:
name: "CMake"
command: |
mkdir -p /logfiles
cd ${CIRCLE_WORKING_DIRECTORY}/GEOSfvdycore
mkdir build
cd build
cmake .. -DBASEDIR=$BASEDIR/Linux -DCMAKE_Fortran_COMPILER=gfortran -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=${CIRCLE_WORKING_DIRECTORY}/workspace/install -DUSE_F2PY=OFF
mkdir -p ${CIRCLE_WORKING_DIRECTORY}/workspace/build-GEOSfvdycore
cd ${CIRCLE_WORKING_DIRECTORY}/workspace/build-GEOSfvdycore
cmake ${CIRCLE_WORKING_DIRECTORY}/GEOSfvdycore -DBASEDIR=$BASEDIR/Linux -DCMAKE_Fortran_COMPILER=<< parameters.compiler >> -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=${CIRCLE_WORKING_DIRECTORY}/workspace/install-GEOSfvdycore -DUSE_F2PY=OFF |& tee /logfiles/cmake.log
- run:
name: "Build and install"
command: |
cd ${CIRCLE_WORKING_DIRECTORY}/GEOSfvdycore/build
make -j"$(nproc)" install
#MEDIUM# make -j4 install
cd ${CIRCLE_WORKING_DIRECTORY}/workspace/build-GEOSfvdycore
make -j"$(nproc)" install |& tee /logfiles/make.log
#MEDIUM# make -j4 install |& tee /logfiles/make.log
- store_artifacts:
path: /logfiles
# We need to persist the install for the next step
# but only if we are running gcm tests
- persist_to_workspace:
root: workspace
paths:
- install
- install-GEOSfvdycore

make-experiment:
executor: gcc-build-env
make-fv3-experiment:
parameters:
compiler:
type: string
executor: << parameters.compiler >>-large
working_directory: /root/project
steps:
- attach_workspace:
at: workspace
- run:
name: "Run fv3_setup"
command: |
cd ${CIRCLE_WORKING_DIRECTORY}/workspace/install/bin
cd ${CIRCLE_WORKING_DIRECTORY}/workspace/install-GEOSfvdycore/bin
INPUT_FOR_SETUP=$(cat \<<END_HEREDOC
test-fv3-c12
Expand All @@ -103,15 +143,19 @@ jobs:
command: |
cd ${CIRCLE_WORKING_DIRECTORY}/workspace/test-fv3-c12
cat fv3.j
# We need to persist the install for the next step
- persist_to_workspace:
root: workspace
paths:
- test-fv3-c12
- store_artifacts:
path: /logfiles

run-standalone:
executor: gcc-build-env
run-fv3-standalone:
parameters:
compiler:
type: string
executor: << parameters.compiler >>-large
working_directory: /root/project
steps:
- attach_workspace:
Expand All @@ -137,8 +181,9 @@ jobs:
exit 1
fi
- run:
name: "Cat log file"
name: "Copy log files"
command: |
cd ${CIRCLE_WORKING_DIRECTORY}/workspace/test-fv3-c12
cat *.log
cp *.log /logfiles
- store_artifacts:
path: /logfiles
2 changes: 1 addition & 1 deletion .github/workflows/enforce-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
require-label:
runs-on: ubuntu-latest
steps:
- uses: yogevbd/[email protected].1
- uses: yogevbd/[email protected].2
with:
REQUIRED_LABELS_ANY: "0 diff,0 diff trivial,Non 0-diff,0 diff structural"
REQUIRED_LABELS_ANY_DESCRIPTION: "Select at least one label ['0 diff', '0 diff trivial', 'Non 0-diff', '0 diff structural']"
Expand Down
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}}

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
/.mepo/
parallel_build.o*
log.*
CMakeUserPresets.json
20 changes: 15 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cmake_policy (SET CMP0054 NEW)

project (
GEOSfvdycore
VERSION 1.2.7
VERSION 1.3
LANGUAGES Fortran CXX C) # Note - CXX is required for ESMF

if ("${PROJECT_SOURCE_DIR}" STREQUAL "${PROJECT_BINARY_DIR}")
Expand All @@ -18,16 +18,24 @@ if (NOT CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property (CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
"Debug" "Release" "Aggressive")
endif ()

set (DOING_GEOS5 YES)

# Should find a better place for this - used in Chem component
set (ACG_FLAGS -v)

# This flag at R4 means that FV3 is compiled at R4 and *linked* to
# FMS built at R4.
set (FV_PRECISION "R4" CACHE STRING "Precision of FV3 core (R4, R4R8, R8)")

list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/@cmake")
# mepo can now clone subrepos in three styles
foreach (dir cmake @cmake cmake@)
if (EXISTS ${CMAKE_CURRENT_LIST_DIR}/${dir})
list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/${dir}")
endif ()
endforeach ()
include (esma)

ecbuild_declare_project()
Expand All @@ -38,8 +46,9 @@ add_definitions(-Dsys${CMAKE_SYSTEM_NAME} -DESMA64)
add_definitions(${MPI_Fortran_COMPILE_FLAGS})
include_directories(${MPI_Fortran_INCLUDE_PATH})

esma_mepo_style(env env_dir)
esma_add_subdirectory (${env_dir})
# Recursively build source tree
add_subdirectory (@env)
add_subdirectory (src)

# https://www.scivision.dev/cmake-auto-gitignore-build-dir/
Expand All @@ -54,4 +63,5 @@ install(
DESTINATION ${CMAKE_INSTALL_PREFIX}
)


# Adds abiilty to tar source
include (esma_cpack)
Loading

0 comments on commit 50a197c

Please sign in to comment.