Skip to content

Commit

Permalink
Autoconf: Detect FMS IO implementation
Browse files Browse the repository at this point in the history
This patch allows autoconf to detect the version of FMS IO that is
implemented in its library, and select the appropriate "infra" in the
MOM6 source.

The allows for removal of the --with-framework flag, and should prevent
future FMS library/infra mismatches.
  • Loading branch information
marshallward committed May 24, 2024
1 parent 2b69f1e commit 007f36c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
1 change: 0 additions & 1 deletion .testing/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ $(BUILD)/unit/Makefile: MOM_ENV += $(COV_FCFLAGS) $(COV_LDFLAGS)
$(BUILD)/timing/Makefile: MOM_ENV += $(OPT_FCFLAGS) $(MOM_LDFLAGS)

# Configure script flags
MOM_ACFLAGS := --with-framework=$(FRAMEWORK)
$(BUILD)/openmp/Makefile: MOM_ACFLAGS += --enable-openmp
$(BUILD)/coupled/Makefile: MOM_ACFLAGS += --with-driver=FMS_cap
$(BUILD)/nuopc/Makefile: MOM_ACFLAGS += --with-driver=nuopc_cap
Expand Down
21 changes: 8 additions & 13 deletions ac/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,6 @@ AS_IF([test "x$with_driver" != "x"],
# used to configure a header based on a template.
#AC_CONFIG_HEADERS(["$MEM_LAYOUT/MOM_memory.h"])

# Select the model framework (default: FMS1)
# NOTE: We can phase this out after the FMS1 I/O has been removed from FMS and
# replace with a detection test. For now, it is a user-defined switch.
MODEL_FRAMEWORK=${srcdir}/config_src/infra/FMS2
AC_ARG_WITH([framework],
AS_HELP_STRING([--with-framework=fms1|fms2], [Select the model framework]))
AS_CASE(["$with_framework"],
[fms1], [MODEL_FRAMEWORK=${srcdir}/config_src/infra/FMS1],
[fms2], [MODEL_FRAMEWORK=${srcdir}/config_src/infra/FMS2],
[MODEL_FRAMEWORK=${srcdir}/config_src/infra/FMS2]
)


# Explicitly assume free-form Fortran
AC_LANG(Fortran)
Expand Down Expand Up @@ -220,7 +208,6 @@ AX_FC_CHECK_LIB([FMS], [fms_init], [fms_mod],
]
)


# Verify that FMS is at least 2019.01.02
# NOTE: 2019.01.02 introduced two changes:
# - diag_axis_init supports an optional domain_position argument
Expand All @@ -236,6 +223,14 @@ AC_COMPILE_IFELSE(
]
)

# Determine the FMS IO implementation.
AX_FC_CHECK_MODULE([fms2_io_mod], [
MODEL_FRAMEWORK=${srcdir}/config_src/infra/FMS2
],[
MODEL_FRAMEWORK=${srcdir}/config_src/infra/FMS1
])


# Python interpreter test

# Declare the Python interpreter variable
Expand Down

0 comments on commit 007f36c

Please sign in to comment.