Skip to content

Commit

Permalink
Merge branch 'dev/gfdl' into ice_dynamics
Browse files Browse the repository at this point in the history
  • Loading branch information
Hallberg-NOAA authored Mar 12, 2021
2 parents abc8fe4 + 250f007 commit 5839494
Show file tree
Hide file tree
Showing 204 changed files with 15,350 additions and 11,410 deletions.
13 changes: 11 additions & 2 deletions .github/actions/testing-setup/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
name: 'Build-.testing-prerequisites'
description: 'Build pre-requisites for .testing including FMS and a symmetric MOM6 executable'
inputs:
build_symmetric:
description: 'If true, will build the symmetric MOM6 executable'
required: false
default: 'true'
install_python:
description: 'If true, will install the local python env needed for .testing'
required: false
default: 'true'
runs:
using: 'composite'
steps:
Expand Down Expand Up @@ -51,15 +60,15 @@ runs:
run: |
echo "::group::Compile MOM6 in symmetric memory mode"
cd .testing
make build/symmetric/MOM6 -j
test ${{ inputs.build_symmetric }} == true && make build/symmetric/MOM6 -j
echo "::endgroup::"
- name: Install local python venv for generating input data
shell: bash
run: |
echo "::group::Create local python env for input data generation"
cd .testing
make work/local-env
test ${{ inputs.install_python }} == true && make work/local-env
echo "::endgroup::"
- name: Set flags
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/coupled-api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: API for coupled drivers

on: [push, pull_request]

jobs:
test-top-api:

runs-on: ubuntu-latest
defaults:
run:
working-directory: .testing

steps:
- uses: actions/checkout@v2
with:
submodules: recursive

- uses: ./.github/actions/testing-setup
with:
build_symmetric: 'false'
install_python: 'false'

- name: Compile MOM6 for the GFDL coupled driver
shell: bash
run: make check_mom6_api_coupled -j

- name: Compile MOM6 for the NUOPC driver
shell: bash
run: make check_mom6_api_nuopc -j

- name: Compile MOM6 for the MCT driver
shell: bash
run: make check_mom6_api_mct -j
3 changes: 2 additions & 1 deletion .github/workflows/documentation-and-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

- name: Check white space (non-blocking)
run: |
./.testing/trailer.py -e TEOS10 -l 120 src config_src | tee style_errors
./.testing/trailer.py -e TEOS10 -l 120 src config_src 2>&1 | tee style_errors
continue-on-error: true

- name: Install packages used when generating documentation
Expand All @@ -35,4 +35,5 @@ jobs:
run: |
grep "warning:" docs/_build/doxygen_warn_nortd_log.txt | grep -v "as part of a" | tee doxy_errors
cat style_errors doxy_errors > all_errors
cat all_errors
test ! -s all_errors
9 changes: 5 additions & 4 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ setup:
# Clone regressions directory
- git clone --recursive http://gitlab.gfdl.noaa.gov/ogrp/Gaea-stats-MOM6-examples.git tests && cd tests
# Install / update testing scripts
- git clone https://github.com/adcroft/MRS.git MRS
- git clone -b new-code-struct https://github.com/adcroft/MRS.git MRS
# Update MOM6-examples and submodules
- (cd MOM6-examples && git checkout . && git checkout dev/gfdl && git pull && git submodule init && git submodule update)
- (cd MOM6-examples/src/MOM6 && git submodule update)
Expand Down Expand Up @@ -60,7 +60,7 @@ gnu:ocean-only-nolibs:
- time tar zxf $CACHE_DIR/tests_$CI_PIPELINE_ID.tgz && cd tests
- make -f MRS/Makefile.build build/gnu/env && cd build/gnu
# mkdir -p build/gnu/repro/symmetric_dynamic/ocean_only && cd build/gnu/repro/symmetric_dynamic/ocean_only
- ../../MOM6-examples/src/mkmf/bin/list_paths -l ../../../config_src/{solo_driver,dynamic_symmetric,ext*} ../../../src ../../MOM6-examples/src/FMS
- ../../MOM6-examples/src/mkmf/bin/list_paths -l ../../../config_src/{drivers/solo_driver,memory/dynamic_symmetric,infra/FMS1,ext*} ../../../src ../../MOM6-examples/src/FMS
- sed -i '/FMS\/.*\/test_/d' path_names
- ../../MOM6-examples/src/mkmf/bin/mkmf -t ../../MOM6-examples/src/mkmf/templates/ncrc-gnu.mk -p MOM6 -c"-Duse_libMPI -Duse_netCDF" path_names
- time (source ./env ; make NETCDF=3 REPRO=1 MOM6 -s -j)
Expand All @@ -73,7 +73,7 @@ gnu:ice-ocean-nolibs:
- time tar zxf $CACHE_DIR/tests_$CI_PIPELINE_ID.tgz && cd tests
- make -f MRS/Makefile.build build/gnu/env && cd build/gnu
# mkdir -p build/gnu/repro/symmetric_dynamic/ocean_only && cd build/gnu/repro/symmetric_dynamic/ocean_only
- ../../MOM6-examples/src/mkmf/bin/list_paths -l ../../../config_src/{coupled_driver,dynamic,ext*} ../../../src ../../MOM6-examples/src/{FMS,coupler,SIS2,icebergs,ice_param,land_null,atmos_null}
- ../../MOM6-examples/src/mkmf/bin/list_paths -l ../../../config_src/{drivers/FMS_cap,memory/dynamic_nonsymmetric,infra/FMS1,ext*} ../../../src ../../MOM6-examples/src/{FMS,coupler,SIS2,icebergs,ice_param,land_null,atmos_null}
- sed -i '/FMS\/.*\/test_/d' path_names
- ../../MOM6-examples/src/mkmf/bin/mkmf -t ../../MOM6-examples/src/mkmf/templates/ncrc-gnu.mk -p MOM6 -c"-Duse_libMPI -Duse_netCDF -D_USE_LEGACY_LAND_ -Duse_AM3_physics" path_names
- time (source ./env ; make NETCDF=3 REPRO=1 MOM6 -s -j)
Expand Down Expand Up @@ -117,8 +117,9 @@ run:
- time tar zxf $CACHE_DIR/build-pgi-repro-$CI_PIPELINE_ID.tgz
# time tar zxf $CACHE_DIR/build-gnu-debug-$CI_PIPELINE_ID.tgz
- (echo '#!/bin/tcsh';echo 'make -f MRS/Makefile.tests all') > job.sh
- sbatch --clusters=c3,c4 --nodes=29 --time=0:34:00 --account=gfdl_o --qos=debug --job-name=mom6_regressions --output=log.$CI_PIPELINE_ID --wait job.sh
- sbatch --clusters=c3,c4 --nodes=29 --time=0:34:00 --account=gfdl_o --qos=debug --job-name=mom6_regressions --output=log.$CI_PIPELINE_ID --wait job.sh || MJOB_RETURN_STATE=Fail
- cat log.$CI_PIPELINE_ID
- test -z "$MJOB_RETURN_STATE"
- test -f restart_results_gnu.tar.gz
- time tar zvcf $CACHE_DIR/results-$CI_PIPELINE_ID.tgz *.tar.gz

Expand Down
47 changes: 34 additions & 13 deletions .testing/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
# MPIFC MPI Fortran compiler
#
# Build configuration:
#
# FCFLAGS_DEBUG Testing ("debug") compiler flags
# FCFLAGS_REPRO Production ("repro") compiler flags
# FCFLAGS_INIT Variable initialization flags
Expand Down Expand Up @@ -76,7 +75,6 @@ FCFLAGS_REPRO ?= -g -O2
FCFLAGS_INIT ?=
FCFLAGS_COVERAGE ?=
# Additional notes:
#
# - The default values are simple, minimalist flags, supported by nearly all
# compilers which are comparable to GFDL's canonical DEBUG and REPRO builds.
#
Expand All @@ -87,13 +85,14 @@ FCFLAGS_COVERAGE ?=
# so FCFLAGS_INIT is used to provide additional MOM6 configuration.

# Set to `true` to require identical results from DEBUG and REPRO builds
# NOTE: Many compilers (Intel, GCC on ARM64) do not yet produce identical
# results across DEBUG and REPRO builds (as defined below), so we disable on
# default.
DO_REPRO_TESTS ?=

# Time measurement (configurable by the CI)
TIME ?= time

# Many compilers (Intel, GCC on ARM64) do not yet produce identical results
# across DEBUG and REPRO builds (as defined below), so we disable on default.

#---
# Dependencies
DEPS = deps
Expand Down Expand Up @@ -154,10 +153,12 @@ SOURCE = \
$(foreach ext,F90 inc c h,$(wildcard $(1)/*/*.$(ext) $(1)/*/*/*.$(ext)))

MOM_SOURCE = $(call SOURCE,../src) \
$(wildcard ../config_src/solo_driver/*.F90) \
$(wildcard ../config_src/infra/FMS1/*.F90) \
$(wildcard ../config_src/drivers/solo_driver/*.F90) \
$(wildcard ../config_src/ext*/*/*.F90)
TARGET_SOURCE = $(call SOURCE,build/target_codebase/src) \
$(wildcard build/target_codebase/config_src/solo_driver/*.F90) \
$(wildcard build/target_codebase/config_src/infra/FMS1/*.F90) \
$(wildcard build/target_codebase/config_src/drivers/solo_driver/*.F90) \
$(wildcard build/target_codebase/config_src/ext*/*.F90)
FMS_SOURCE = $(call SOURCE,$(DEPS)/fms/src)

Expand Down Expand Up @@ -226,15 +227,19 @@ build/asymmetric/Makefile: MOM_ENV=$(PATH_FMS) $(ASYMMETRIC_FCFLAGS) $(MOM_LDFLA
build/repro/Makefile: MOM_ENV=$(PATH_FMS) $(REPRO_FCFLAGS) $(MOM_LDFLAGS)
build/openmp/Makefile: MOM_ENV=$(PATH_FMS) $(OPENMP_FCFLAGS) $(MOM_LDFLAGS)
build/target/Makefile: MOM_ENV=$(PATH_FMS) $(TARGET_FCFLAGS) $(MOM_LDFLAGS)

build/coupled/Makefile: MOM_ENV=$(PATH_FMS) $(SYMMETRIC_FCFLAGS) $(SYMMETRIC_LDFLAGS)
build/nuopc/Makefile: MOM_ENV=$(PATH_FMS) $(SYMMETRIC_FCFLAGS) $(SYMMETRIC_LDFLAGS)
build/mct/Makefile: MOM_ENV=$(PATH_FMS) $(SYMMETRIC_FCFLAGS) $(SYMMETRIC_LDFLAGS)

# Configure script flags
build/symmetric/Makefile: MOM_ACFLAGS=
build/asymmetric/Makefile: MOM_ACFLAGS=--enable-asymmetric
build/repro/Makefile: MOM_ACFLAGS=
build/openmp/Makefile: MOM_ACFLAGS=--enable-openmp
build/target/Makefile: MOM_ACFLAGS=

build/coupled/Makefile: MOM_ACFLAGS=--with-driver=coupled_driver
build/nuopc/Makefile: MOM_ACFLAGS=--with-driver=nuopc_driver
build/mct/Makefile: MOM_ACFLAGS=--with-driver=mct_driver

# Fetch regression target source code
build/target/Makefile: | $(TARGET_CODEBASE)
Expand All @@ -245,7 +250,7 @@ build/target/Makefile: | $(TARGET_CODEBASE)
# Ideally we would want to re-run both Makefile and mkmf, but our mkmf call
# is inside ./configure, so we must re-run ./configure as well.
$(foreach b,$(filter-out target,$(BUILDS)),build/$(b)/Makefile): $(MOM_SOURCE)
build/target/configure: $(TARGET_SOURCE)
build/target_codebase/configure: $(TARGET_SOURCE)


# Build MOM6
Expand Down Expand Up @@ -282,9 +287,6 @@ $(TARGET_CODEBASE)/ac/configure: $(TARGET_CODEBASE)
$(TARGET_CODEBASE):
git clone --recursive $(MOM_TARGET_URL) $@
cd $@ && git checkout $(MOM_TARGET_BRANCH)
# Copy modern autoconf files to target?
mkdir -p $(TARGET_CODEBASE)/ac
cp -r ../ac/{configure.ac,Makefile.in,m4} $(TARGET_CODEBASE)/ac


#---
Expand Down Expand Up @@ -328,6 +330,25 @@ $(DEPS)/Makefile: ../ac/deps/Makefile
mkdir -p $(@D)
cp $< $@

#---
# The following block does a non-library build of a coupled driver interface to MOM, along with everything below it.
# This simply checks that we have not broken the ability to compile. This is not a means to build a complete coupled executable.
# Todo:
# - avoid re-building FMS and MOM6 src by re-using existing object/mod files
# - use autoconf rather than mkmf templates
MK_TEMPLATE ?= ../../$(DEPS)/mkmf/templates/ncrc-gnu.mk
# NUOPC driver
build/nuopc/mom_ocean_model_nuopc.o: build/nuopc/Makefile
cd $(@D) && make $(@F)
check_mom6_api_nuopc: build/nuopc/mom_ocean_model_nuopc.o
# GFDL coupled driver
build/coupled/ocean_model_MOM.o: build/coupled/Makefile
cd $(@D) && make $(@F)
check_mom6_api_coupled: build/coupled/ocean_model_MOM.o
# MCT driver
build/mct/mom_ocean_model_mct.o: build/mct/Makefile
cd $(@D) && make $(@F)
check_mom6_api_mct: build/mct/mom_ocean_model_mct.o

#---
# Python preprocessing
Expand Down
Loading

0 comments on commit 5839494

Please sign in to comment.