Skip to content

Commit f084b36

Browse files
committed
Merge branch 'release-v8.1.0'
MPAS Version 8.1.0 This release of MPAS introduces several updates and new capabilities for MPAS-Atmosphere, most notably: * The MYNN Surface Layer and Planetary Boundary Layer (PBL) schemes have been updated. The PBL scheme includes the options needed to run the Eddy Diffusivity Mass Flux (EDMF) scheme. * A separate driver for the parameterization of surface processes over sea-ice points has been added. * The build system now tests for the availability of the modern 'mpi_f08' module in the MPI library. If detected, the 'mpi_f08' module interface to Fortran MPI routines will be used in favor of the older 'mpi' module interface. * The atmosphere core now supports the storage and retrieval of time-invariant fields in a separate I/O stream, offering significant disk space savings, especially in cases where large ensembles or cycled simulations are being run. * The top-level Makefile provides a new 'intel' build target for the Intel oneAPI Fortran, C, and C++ compiler suite. * To support real-data simulations on meshes with grid distances approaching 1 km or less, the init_atmosphere core provides an option, config_30s_supersample_factor, for super-sampling of the 30 arc-second terrestrial fields (terrain, land use, soil category, and MODIS FPAR monthly vegetation fraction). * When compiling, PRECISION=single is now the default, and double-precision builds must be specified with PRECISION=double.
2 parents 585c96a + f9cfd78 commit f084b36

File tree

99 files changed

+16486
-7664
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+16486
-7664
lines changed

Makefile

Lines changed: 83 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ gnu: # BUILDTARGET GNU Fortran, C, and C++ compilers
2020
"CFLAGS_OPT = -O3" \
2121
"CXXFLAGS_OPT = -O3" \
2222
"LDFLAGS_OPT = -O3" \
23-
"FFLAGS_DEBUG = -g -ffree-line-length-none -fconvert=big-endian -ffree-form -fcheck=all -fbacktrace -ffpe-trap=invalid,zero,overflow" \
23+
"FFLAGS_DEBUG = -std=f2008 -g -ffree-line-length-none -fconvert=big-endian -ffree-form -fcheck=all -fbacktrace -ffpe-trap=invalid,zero,overflow" \
2424
"CFLAGS_DEBUG = -g" \
2525
"CXXFLAGS_DEBUG = -g" \
2626
"LDFLAGS_DEBUG = -g" \
@@ -654,6 +654,33 @@ cray: # BUILDTARGET Cray Programming Environment
654654
"OPENMP = $(OPENMP)" \
655655
"CPPFLAGS = $(MODEL_FORMULATION) -D_MPI" )
656656

657+
intel: # BUILDTARGET Intel oneAPI Fortran, C, and C++ compiler suite
658+
( $(MAKE) all \
659+
"FC_PARALLEL = mpifort" \
660+
"CC_PARALLEL = mpicc" \
661+
"CXX_PARALLEL = mpic++" \
662+
"FC_SERIAL = ifx" \
663+
"CC_SERIAL = icx" \
664+
"CXX_SERIAL = icpx" \
665+
"FFLAGS_PROMOTION = -real-size 64" \
666+
"FFLAGS_OPT = -O3 -convert big_endian -free -align array64byte" \
667+
"CFLAGS_OPT = -O3" \
668+
"CXXFLAGS_OPT = -O3" \
669+
"LDFLAGS_OPT = -O3" \
670+
"FFLAGS_DEBUG = -g -convert big_endian -free -check all -fpe0 -traceback" \
671+
"CFLAGS_DEBUG = -g -traceback" \
672+
"CXXFLAGS_DEBUG = -g -traceback" \
673+
"LDFLAGS_DEBUG = -g -fpe0 -traceback" \
674+
"FFLAGS_OMP = -qopenmp" \
675+
"CFLAGS_OMP = -qopenmp" \
676+
"PICFLAG = -fpic" \
677+
"BUILD_TARGET = $(@)" \
678+
"CORE = $(CORE)" \
679+
"DEBUG = $(DEBUG)" \
680+
"USE_PAPI = $(USE_PAPI)" \
681+
"OPENMP = $(OPENMP)" \
682+
"CPPFLAGS = $(MODEL_FORMULATION) -D_MPI" )
683+
657684
CPPINCLUDES =
658685
FCINCLUDES =
659686
LIBS =
@@ -831,14 +858,18 @@ ifeq "$(OPENMP_OFFLOAD)" "true"
831858
LDFLAGS += $(LDFLAGS_GPU)
832859
endif #OPENMP_OFFLOAD IF
833860

834-
ifeq "$(PRECISION)" "single"
861+
ifneq (,$(filter-out double single,$(PRECISION)))
862+
$(error PRECISION should be "", "single", or "double"; received value "$(PRECISION)")
863+
endif
864+
ifeq "$(PRECISION)" "double"
865+
FFLAGS += $(FFLAGS_PROMOTION)
866+
PRECISION_MESSAGE="MPAS was built with default double-precision reals."
867+
else
868+
$(if $(PRECISION),$(info NOTE: PRECISION=single is unnecessary, single is the default))
835869
CFLAGS += "-DSINGLE_PRECISION"
836870
CXXFLAGS += "-DSINGLE_PRECISION"
837871
override CPPFLAGS += "-DSINGLE_PRECISION"
838872
PRECISION_MESSAGE="MPAS was built with default single-precision reals."
839-
else
840-
FFLAGS += $(FFLAGS_PROMOTION)
841-
PRECISION_MESSAGE="MPAS was built with default double-precision reals."
842873
endif #PRECISION IF
843874

844875
ifeq "$(USE_PAPI)" "true"
@@ -996,6 +1027,7 @@ override CPPFLAGS += -DMPAS_BUILD_TARGET=$(BUILD_TARGET)
9961027
ifeq ($(wildcard src/core_$(CORE)), ) # CHECK FOR EXISTENCE OF CORE DIRECTORY
9971028

9981029
all: core_error
1030+
clean: core_error
9991031

10001032
else
10011033

@@ -1074,70 +1106,70 @@ ifeq "$(OPENACC)" "true"
10741106
@# See whether the test programs can be compiled
10751107
@#
10761108
@echo "Checking [$(BUILD_TARGET)] compilers for OpenACC support..."
1077-
@( $(SCC) openacc.c $(CPPINCLUDES) $(CFLAGS) $(LDFLAGS) $(LIBS) -o openacc_c.out > openacc_c.log 2>&1; \
1109+
@( $(SCC) openacc.c $(CPPINCLUDES) $(CFLAGS) $(LDFLAGS) -o openacc_c.out > openacc_c.log 2>&1; \
10781110
if [ $$? -eq 0 ]; then \
10791111
echo "=> $(SCC) can compile test OpenACC program"; \
10801112
else \
10811113
echo "*********************************************************"; \
10821114
echo "ERROR: Test OpenACC C program could not be compiled by $(SCC)."; \
10831115
echo "Following compilation command failed with errors:" ; \
1084-
echo "$(SCC) openacc.c $(CPPINCLUDES) $(CFLAGS) $(LDFLAGS) $(LIBS) -o openacc_c.out"; \
1116+
echo "$(SCC) openacc.c $(CPPINCLUDES) $(CFLAGS) $(LDFLAGS) -o openacc_c.out"; \
10851117
echo ""; \
10861118
echo "Test program openacc.c and output openacc_c.log have been left"; \
10871119
echo "in the top-level MPAS directory for further debugging"; \
10881120
echo "*********************************************************"; \
10891121
rm -f openacc.f90 openacc_[cf].out openacc_f.log; exit 1; \
10901122
fi )
1091-
@( $(CC) openacc.c $(CPPINCLUDES) $(CFLAGS) $(LDFLAGS) $(LIBS) -o openacc_c.out > openacc_c.log 2>&1; \
1123+
@( $(CC) openacc.c $(CPPINCLUDES) $(CFLAGS) $(LDFLAGS) -o openacc_c.out > openacc_c.log 2>&1; \
10921124
if [ $$? -eq 0 ] ; then \
10931125
echo "=> $(CC) can compile test OpenACC program"; \
10941126
else \
10951127
echo "*********************************************************"; \
10961128
echo "ERROR: Test OpenACC C program could not be compiled by $(CC)."; \
10971129
echo "Following compilation command failed with errors:" ; \
1098-
echo "$(CC) openacc.c $(CPPINCLUDES) $(CFLAGS) $(LDFLAGS) $(LIBS) -o openacc_c.out"; \
1130+
echo "$(CC) openacc.c $(CPPINCLUDES) $(CFLAGS) $(LDFLAGS) -o openacc_c.out"; \
10991131
echo ""; \
11001132
echo "Test program openacc.c and output openacc_c.log have been left"; \
11011133
echo "in the top-level MPAS directory for further debugging"; \
11021134
echo "*********************************************************"; \
11031135
rm -f openacc.f90 openacc_[cf].out openacc_f.log; exit 1; \
11041136
fi )
1105-
@( $(CXX) openacc.c $(CPPINCLUDES) $(CFLAGS) $(LDFLAGS) $(LIBS) -o openacc_c.out > openacc_c.log 2>&1; \
1137+
@( $(CXX) openacc.c $(CPPINCLUDES) $(CFLAGS) $(LDFLAGS) -o openacc_c.out > openacc_c.log 2>&1; \
11061138
if [ $$? -eq 0 ] ; then \
11071139
echo "=> $(CXX) can compile test OpenACC program"; \
11081140
else \
11091141
echo "*********************************************************"; \
11101142
echo "ERROR: Test OpenACC C program could not be compiled by $(CXX)."; \
11111143
echo "Following compilation command failed with errors:" ; \
1112-
echo "$(CXX) openacc.c $(CPPINCLUDES) $(CFLAGS) $(LDFLAGS) $(LIBS) -o openacc_c.out"; \
1144+
echo "$(CXX) openacc.c $(CPPINCLUDES) $(CFLAGS) $(LDFLAGS) -o openacc_c.out"; \
11131145
echo ""; \
11141146
echo "Test program openacc.c and output openacc_c.log have been left"; \
11151147
echo "in the top-level MPAS directory for further debugging"; \
11161148
echo "*********************************************************"; \
11171149
rm -f openacc.f90 openacc_[cf].out openacc_f.log; exit 1; \
11181150
fi )
1119-
@( $(SFC) openacc.f90 $(FCINCLUDES) $(FFLAGS) $(LDFLAGS) $(LIBS) -o openacc_f.out > openacc_f.log 2>&1; \
1151+
@( $(SFC) openacc.f90 $(FCINCLUDES) $(FFLAGS) $(LDFLAGS) -o openacc_f.out > openacc_f.log 2>&1; \
11201152
if [ $$? -eq 0 ] ; then \
11211153
echo "=> $(SFC) can compile test OpenACC program"; \
11221154
else \
11231155
echo "*********************************************************"; \
11241156
echo "ERROR: Test OpenACC Fortran program could not be compiled by $(SFC)."; \
11251157
echo "Following compilation command failed with errors:" ; \
1126-
echo "$(SFC) openacc.f90 $(FCINCLUDES) $(FFLAGS) $(LDFLAGS) $(LIBS) -o openacc_f.out"; \
1158+
echo "$(SFC) openacc.f90 $(FCINCLUDES) $(FFLAGS) $(LDFLAGS) -o openacc_f.out"; \
11271159
echo ""; \
11281160
echo "Test program openacc.f90 and output openacc_f.log have been left"; \
11291161
echo "in the top-level MPAS directory for further debugging"; \
11301162
echo "*********************************************************"; \
11311163
rm -f openacc.c openacc_[cf].out openacc_c.log; exit 1; \
11321164
fi )
1133-
@( $(FC) openacc.f90 $(FCINCLUDES) $(FFLAGS) $(LDFLAGS) $(LIBS) -o openacc_f.out > openacc_f.log 2>&1; \
1165+
@( $(FC) openacc.f90 $(FCINCLUDES) $(FFLAGS) $(LDFLAGS) -o openacc_f.out > openacc_f.log 2>&1; \
11341166
if [ $$? -eq 0 ] ; then \
11351167
echo "=> $(FC) can compile test OpenACC program"; \
11361168
else \
11371169
echo "*********************************************************"; \
11381170
echo "ERROR: Test OpenACC Fortran program could not be compiled by $(FC)."; \
11391171
echo "Following compilation command failed with errors:" ; \
1140-
echo "$(FC) openacc.f90 $(FCINCLUDES) $(FFLAGS) $(LDFLAGS) $(LIBS) -o openacc_f.out"; \
1172+
echo "$(FC) openacc.f90 $(FCINCLUDES) $(FFLAGS) $(LDFLAGS) -o openacc_f.out"; \
11411173
echo ""; \
11421174
echo "Test program openacc.f90 and output openacc_f.log have been left"; \
11431175
echo "in the top-level MPAS directory for further debugging"; \
@@ -1225,11 +1257,42 @@ endif
12251257
exit 1; \
12261258
fi
12271259

1260+
1261+
mpi_f08_test:
1262+
@#
1263+
@# MPAS_MPI_F08 will be set to:
1264+
@# 0 if no mpi_f08 module support was detected
1265+
@# 1 if the MPI library provides an mpi_f08 module
1266+
@#
1267+
$(info Checking for mpi_f08 support...)
1268+
$(eval MPAS_MPI_F08 := $(shell $\
1269+
printf "program main\n$\
1270+
& use mpi_f08, only : MPI_Init, MPI_Comm\n$\
1271+
& integer :: ierr\n$\
1272+
& type (MPI_Comm) :: comm\n$\
1273+
& call MPI_Init(ierr)\n$\
1274+
end program main\n" | sed 's/&/ /' > mpi_f08.f90; $\
1275+
$\
1276+
$(FC) mpi_f08.f90 -o mpi_f08.x $(FFLAGS) $(LDFLAGS) > /dev/null 2>&1; $\
1277+
mpi_f08_status=$$?; $\
1278+
rm -f mpi_f08.f90 mpi_f08.x; $\
1279+
if [ $$mpi_f08_status -eq 0 ]; then $\
1280+
printf "1"; $\
1281+
else $\
1282+
printf "0"; $\
1283+
fi $\
1284+
))
1285+
$(if $(findstring 0,$(MPAS_MPI_F08)), $(eval MPI_F08_MESSAGE = "Using the mpi module."), )
1286+
$(if $(findstring 0,$(MPAS_MPI_F08)), $(info No working mpi_f08 module detected; using mpi module.))
1287+
$(if $(findstring 1,$(MPAS_MPI_F08)), $(eval override CPPFLAGS += -DMPAS_USE_MPI_F08), )
1288+
$(if $(findstring 1,$(MPAS_MPI_F08)), $(eval MPI_F08_MESSAGE = "Using the mpi_f08 module."), )
1289+
$(if $(findstring 1,$(MPAS_MPI_F08)), $(info mpi_f08 module detected.))
1290+
12281291
ifneq "$(PIO)" ""
1229-
MAIN_DEPS = openmp_test openacc_test pio_test
1292+
MAIN_DEPS = openmp_test openacc_test pio_test mpi_f08_test
12301293
override CPPFLAGS += "-DMPAS_PIO_SUPPORT"
12311294
else
1232-
MAIN_DEPS = openmp_test openacc_test
1295+
MAIN_DEPS = openmp_test openacc_test mpi_f08_test
12331296
IO_MESSAGE = "Using the SMIOL library."
12341297
override CPPFLAGS += "-DMPAS_SMIOL_SUPPORT"
12351298
endif
@@ -1268,6 +1331,7 @@ endif
12681331
@echo $(PRECISION_MESSAGE)
12691332
@echo $(DEBUG_MESSAGE)
12701333
@echo $(PARALLEL_MESSAGE)
1334+
@echo $(MPI_F08_MESSAGE)
12711335
@echo $(PAPI_MESSAGE)
12721336
@echo $(TAU_MESSAGE)
12731337
@echo $(OPENMP_MESSAGE)
@@ -1320,8 +1384,7 @@ clean_core:
13201384
else # CORE IF
13211385

13221386
all: error
1323-
clean: errmsg
1324-
exit 1
1387+
clean: error
13251388
error: errmsg
13261389
@echo "************ ERROR ************"
13271390
@echo "No CORE specified. Quitting."
@@ -1353,7 +1416,7 @@ errmsg:
13531416
@echo " TIMER_LIB=tau - Uses TAU for the timer interface instead of the native interface"
13541417
@echo " OPENMP=true - builds and links with OpenMP flags. Default is to not use OpenMP."
13551418
@echo " OPENACC=true - builds and links with OpenACC flags. Default is to not use OpenACC."
1356-
@echo " PRECISION=single - builds with default single-precision real kind. Default is to use double-precision."
1419+
@echo " PRECISION=double - builds with default double-precision real kind. Default is to use single-precision."
13571420
@echo " SHAREDLIB=true - generate position-independent code suitable for use in a shared library. Default is false."
13581421
@echo ""
13591422
@echo "Ensure that NETCDF, PNETCDF, PIO, and PAPI (if USE_PAPI=true) are environment variables"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
MPAS-v8.0.2
1+
MPAS-v8.1.0
22
====
33

44
The Model for Prediction Across Scales (MPAS) is a collaborative project for

azure-pipelines.yml

Lines changed: 0 additions & 141 deletions
This file was deleted.

0 commit comments

Comments
 (0)