Skip to content

Commit

Permalink
Merge pull request #61 from jiandewang/feature/update-to-GFDL-20210308
Browse files Browse the repository at this point in the history
Feature/update to gfdl 20210308
  • Loading branch information
jiandewang authored Mar 13, 2021
2 parents 00cb11c + 3703ca7 commit e5a4035
Show file tree
Hide file tree
Showing 53 changed files with 362 additions and 109 deletions.
6 changes: 3 additions & 3 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
20 changes: 9 additions & 11 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 @@ -249,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 @@ -286,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
9 changes: 5 additions & 4 deletions ac/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,18 @@ srcdir=$srcdir/..
# Default to symmetric grid
# NOTE: --enable is more properly used to add a feature, rather than to select
# a compile-time mode, so this is not exactly being used as intended.
MEM_LAYOUT=${srcdir}/config_src/dynamic_symmetric
MEM_LAYOUT=${srcdir}/config_src/memory/dynamic_symmetric
AC_ARG_ENABLE([asymmetric],
AS_HELP_STRING([--enable-asymmetric], [Use the asymmetric grid]))
AS_IF([test "$enable_asymmetric" = yes],
[MEM_LAYOUT=${srcdir}/config_src/dynamic])
[MEM_LAYOUT=${srcdir}/config_src/memory/dynamic_nonsymmetric])

# Default to solo_driver
DRIVER_DIR=${srcdir}/config_src/solo_driver
DRIVER_DIR=${srcdir}/config_src/drivers/solo_driver
AC_ARG_WITH([driver],
AS_HELP_STRING([--with-driver=coupled_driver|solo_driver], [Select directory for driver source code]))
AS_IF([test "x$with_driver" != "x"],
[DRIVER_DIR=${srcdir}/config_src/${with_driver}])
[DRIVER_DIR=${srcdir}/config_src/drivers/${with_driver}])

# TODO: Rather than point to a pre-configured header file, autoconf could be
# used to configure a header based on a template.
Expand Down Expand Up @@ -216,6 +216,7 @@ AS_IF([test -z "$MKMF"], [
AC_CONFIG_COMMANDS([path_names],
[list_paths -l \
${srcdir}/src \
${srcdir}/config_src/infra/FMS1 \
${srcdir}/config_src/ext* \
${DRIVER_DIR} \
${MEM_LAYOUT}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions docs/Doxyfile_nortd
Original file line number Diff line number Diff line change
Expand Up @@ -860,10 +860,10 @@ WARN_LOGFILE = _build/doxygen_warn_nortd_log.txt

INPUT = ../src \
front_page.md \
../config_src/solo_driver \
../config_src/dynamic_symmetric \
../config_src/drivers/solo_driver \
../config_src/memory/dynamic_symmetric \
../config_src/external \
../config_src/coupled_driver
../config_src/drivers/FMS_cap

# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
Expand Down Expand Up @@ -2212,7 +2212,7 @@ SEARCH_INCLUDES = YES
# This tag requires that the tag SEARCH_INCLUDES is set to YES.

INCLUDE_PATH = ../src/framework \
../config_src/dynamic_symmetric
../config_src/memory/dynamic_symmetric

# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
Expand Down
8 changes: 4 additions & 4 deletions docs/Doxyfile_nortd_latex
Original file line number Diff line number Diff line change
Expand Up @@ -860,10 +860,10 @@ WARN_LOGFILE = _build/doxygen_warn_nortd_latex_log.txt

INPUT = ../src \
front_page.md \
../config_src/solo_driver \
../config_src/dynamic_symmetric \
../config_src/drivers/solo_driver \
../config_src/memory/dynamic_symmetric \
../config_src/external \
../config_src/coupled_driver
../config_src/drivers/FMS_cap

# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
Expand Down Expand Up @@ -2212,7 +2212,7 @@ SEARCH_INCLUDES = YES
# This tag requires that the tag SEARCH_INCLUDES is set to YES.

INCLUDE_PATH = ../src/framework \
../config_src/dynamic_symmetric
../config_src/memory/dynamic_symmetric

# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
Expand Down
8 changes: 4 additions & 4 deletions docs/Doxyfile_rtd
Original file line number Diff line number Diff line change
Expand Up @@ -810,10 +810,10 @@ WARN_LOGFILE = _build/doxygen_warn_rtd_log.txt
# Note: If this tag is empty the current directory is searched.

INPUT = ../src \
../config_src/solo_driver \
../config_src/dynamic_symmetric \
../config_src/drivers/solo_driver \
../config_src/memory/dynamic_symmetric \
../config_src/external \
../config_src/coupled_driver
../config_src/drivers/FMS_cap

# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
Expand Down Expand Up @@ -2072,7 +2072,7 @@ SEARCH_INCLUDES = YES
# preprocessor.
# This tag requires that the tag SEARCH_INCLUDES is set to YES.

INCLUDE_PATH = ../src/framework ../config_src/dynamic_symmetric
INCLUDE_PATH = ../src/framework ../config_src/memory/dynamic_symmetric

# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
Expand Down
14 changes: 7 additions & 7 deletions docs/Doxyfile_rtd_dox
Original file line number Diff line number Diff line change
Expand Up @@ -810,10 +810,10 @@ WARN_LOGFILE = _build/doxygen_rtd_dox_debug.txt
# Note: If this tag is empty the current directory is searched.

INPUT = ../src \
../config_src/solo_driver \
../config_src/dynamic_symmetric \
../config_src/drivers/solo_driver \
../config_src/memory/dynamic_symmetric \
../config_src/external \
../config_src/coupled_driver \
../config_src/drivers/FMS_cap \
../src/ALE/MOM_ALE.F90 \
../src/ALE/PCM_functions.F90 \
../src/core/MOM.F90 \
Expand All @@ -838,10 +838,10 @@ INPUT = ../src \
#INPUT = ../src/equation_of_state

#INPUT = ../src/ALE \
# ../config_src/solo_driver \
# ../config_src/dynamic_symmetric \
# ../config_src/drivers/solo_driver \
# ../config_src/memory/dynamic_symmetric \
# ../config_src/external \
# ../config_src/coupled_driver
# ../config_src/drivers/FMS_cap

#INPUT = \
# ../src/ALE/_ALE.dox \
Expand Down Expand Up @@ -2112,7 +2112,7 @@ SEARCH_INCLUDES = YES
# preprocessor.
# This tag requires that the tag SEARCH_INCLUDES is set to YES.

INCLUDE_PATH = ../src/framework ../config_src/dynamic_symmetric
INCLUDE_PATH = ../src/framework ../config_src/memory/dynamic_symmetric

# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
Expand Down
20 changes: 12 additions & 8 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,19 @@ The starting state of directories and files:
```
SRC/
config_src/
coupled_driver
dynamic
dynamic_symmetric
drivers/
FMS_cap
ice_solo_driver
mct_cap
nuopc_cap
solo_driver
unit_drivers
external
ice_solo_driver
mct_driver
nuopc_driver
solo_driver
unit_drivers
infra/
FMS1
memory/
dynamic
dynamic_symmetric
pkg/
CVMix-src
GSW-Fortran
Expand Down
37 changes: 22 additions & 15 deletions docs/code_organization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,19 @@ The directory tree is::

MOM6
├── config_src
│   ├── coupled_driver
│   ├── dynamic
│   ├── dynamic_symmetric
│   ├── drivers
│   │   ├── FMS_cap
│   │   ├── ice_solo_driver
│   │   ├── mct_cap
│   │   ├── nuopc_cap
│   │   ├── solo_driver
│   │   └── unit_drivers
│   ├── external
│   │   ├── GFDL_ocean_BGC
│   │   └── ODA_hooks
│   ├── ice_solo_driver
│   ├── mct_driver
│   ├── nuopc_driver
│   ├── solo_driver
│   └── unit_drivers
│   ├── memory
│   │   ├── dynamic_nonsymmetric
│   │   ├── dynamic_symmetric
├── docs
│   └── images
├── pkg
Expand Down Expand Up @@ -84,11 +86,11 @@ The directory tree is::
`config_src/`
-------------

`dynamic/`, `dynamic_symmetric/`
One or none of `config_src/dynamic/` or `config_src/dynamic_symmetric/` can
be included at compile time. If neither is used then a `MOM_memory.h` file
specific to the model configuration must be present - this is known as a
"static" compile with fixed layout and domain shape.
`memory/dynamic_nonsymmetric/`, `memory/dynamic_symmetric/`
One or none of `config_src/memory/dynamic_nonsymmetric/` or
`config_src/dynamic_symmetric/` can be included at compile time. If neither
is used then a `MOM_memory.h` file specific to the model configuration must be
present - this is known as a"static" compile with fixed layout and domain shape.

`external/`
Contains "null" modules providing the API to optional components to use
Expand All @@ -98,12 +100,17 @@ The directory tree is::
To use the actual ODA or BGC, add the appropriate source to the search
paths .

`solo_driver/`
`infra/FMS1`
Contains MOM6-specific thin wrappers to all of the FMS types and routines that
are used by MOM6. The code in this directory should only be called by the
infrastructure-agnostic code in src/framework.

`drivers/solo_driver/`
This driver produces an ocean-only executable with no other coupled
components (no sea-ice, no atmosphere, etc.). It is the simplest
configuration and fastest to compile and thus used for a lot of testing.

`coupled_driver/`
`drivers/FMS_cap/`
This driver provides an interface for the GFDL coupler to call. It requires
compiling MOM6 along with at least a sea-ice model and possibly all other
components in a coupled model.
Expand Down
Loading

0 comments on commit e5a4035

Please sign in to comment.