Skip to content

Commit

Permalink
Merge branch 'dev/gfdl' into cvmix-update
Browse files Browse the repository at this point in the history
  • Loading branch information
marshallward authored Mar 12, 2021
2 parents e56d453 + 250f007 commit b911a39
Show file tree
Hide file tree
Showing 53 changed files with 311 additions and 93 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
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ program Shelf_main
endif
endif

call Get_MOM_Input(param_file, dirs)

! Read ocean_solo restart, which can override settings from the namelist.
if (file_exists(trim(dirs%restart_input_dir)//'ice_solo.res')) then
call open_ASCII_file(unit, trim(dirs%restart_input_dir)//'ice_solo.res', action=READONLY_FILE)
Expand Down Expand Up @@ -215,7 +217,6 @@ program Shelf_main
Start_time = real_to_time(0.0)
endif

call Get_MOM_Input(param_file, dirs)
! Determining the internal unit scaling factors for this run.
call unit_scaling_init(param_file, US)

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.
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,10 @@ program MOM_main
! This call sets the number and affinity of threads with openMP.
!$ call set_MOM_thread_affinity(ocean_nthreads, use_hyper_thread)

! This call is required to initiate dirs%restart_input_dir for ocean_solo.res
! The contents of dirs will be reread in initialize_MOM.
call get_MOM_input(dirs=dirs)

! Read ocean_solo restart, which can override settings from the namelist.
if (file_exists(trim(dirs%restart_input_dir)//'ocean_solo.res')) then
call open_ASCII_file(unit, trim(dirs%restart_input_dir)//'ocean_solo.res', action=READONLY_FILE)
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.
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ module MOM_diag_manager_infra
use diag_manager_mod, only : register_diag_field_fms => register_diag_field
use diag_manager_mod, only : register_static_field_fms => register_static_field
use diag_manager_mod, only : get_diag_field_id_fms => get_diag_field_id
use time_manager_mod, only : time_type
use MOM_time_manager, only : time_type
use MOM_domain_infra, only : MOM_domain_type
use MOM_error_handler, only : MOM_error, FATAL, WARNING
use MOM_error_infra, only : MOM_error => MOM_err, FATAL, WARNING

implicit none ; private

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module MOM_domain_infra
! This file is part of MOM6. See LICENSE.md for the license.

use MOM_coms_infra, only : PE_here, root_PE, num_PEs
use MOM_cpu_clock, only : cpu_clock_begin, cpu_clock_end
use MOM_cpu_clock_infra, only : cpu_clock_begin, cpu_clock_end
use MOM_error_infra, only : MOM_error=>MOM_err, NOTE, WARNING, FATAL

use mpp_domains_mod, only : domain2D, domain1D
Expand Down Expand Up @@ -1689,6 +1689,8 @@ subroutine clone_MD_to_d2D(MD_in, mpp_domain, min_halo, halo_size, symmetric, &
if ((MD_in%io_layout(1) + MD_in%io_layout(2) > 0) .and. &
(MD_in%layout(1)*MD_in%layout(2) > 1)) then
call mpp_define_io_domain(mpp_domain, MD_in%io_layout)
else
call mpp_define_io_domain(mpp_domain, (/ 1, 1 /) )
endif

end subroutine clone_MD_to_d2D
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.
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 b911a39

Please sign in to comment.