Skip to content

Commit

Permalink
Merge pull request #559 from EPIC-model/dev
Browse files Browse the repository at this point in the history
New release 0.14.1
  • Loading branch information
matt-frey authored Feb 26, 2024
2 parents 5d953cd + fd50016 commit ad55557
Show file tree
Hide file tree
Showing 31 changed files with 1,501 additions and 786 deletions.
9 changes: 6 additions & 3 deletions .zenodo.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"metadata": {
"description": "Elliptical Parcel-in-Cell model for fluid dynamics",
"description": "The Elliptical Parcel-In-Cell (EPIC) model for fluid dynamics",
"access_right": "open",
"upload_type": "software",
"keywords": ["PIC",
Expand All @@ -24,6 +23,11 @@
"affiliation": "University of St Andrews",
"name": "Dritschel, David",
"orcid": "0000-0001-6489-3395"
},
{
"affiliation": "Edinburgh Parallel Computing Centre (EPCC)",
"name": "Apóstolo, Rui",
"orcid": "0000-0003-1161-9098"
}
],
"grants": [
Expand All @@ -34,5 +38,4 @@
"id": "10.13039/100014013::EP/T025409/1"
}
]
}
}
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
## EPIC version 0.14.1
* [Added/changed ifort style flags](https://github.com/EPIC-model/epic/pull/494)
* [Fix .zenodo.json](https://github.com/EPIC-model/epic/pull/542)
* [Generalise configure.ac](https://github.com/EPIC-model/epic/pull/492)
* [Selective parcel attribute writes](https://github.com/EPIC-model/epic/pull/543)
* [Need to calculate buoyancy extrema for total buoyancy](https://github.com/EPIC-model/epic/pull/546)
* [Update writing statistics to improved interface](https://github.com/EPIC-model/epic/pull/545)
* [Fix rk_timer](https://github.com/EPIC-model/epic/pull/547)
* [Collect merger statistics](https://github.com/EPIC-model/epic/pull/544)
* [Update conda environment](https://github.com/EPIC-model/epic/pull/550)
* [Damping implementation](https://github.com/EPIC-model/epic/pull/549)
* [Add missing stop_timer; fix resetting parcel split and merge diagnostics](https://github.com/EPIC-model/epic/pull/552)
* [Fix loop for nearest parcel check](https://github.com/EPIC-model/epic/pull/555)
* [Gridded strain](https://github.com/EPIC-model/epic/pull/553)
* [Ensure link exists before calling netcdf routine](https://github.com/EPIC-model/epic/pull/558)

## EPIC version 0.14.0
* [Fix the write frequency](https://github.com/EPIC-model/epic/pull/527)
* [Add boundary surface fluxes](https://github.com/EPIC-model/epic/pull/451)
Expand Down
67 changes: 60 additions & 7 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AC_INIT([epic], [0.14.0], [[email protected]], [], [https://github.com/matt-frey/epic])
AC_INIT([epic], [0.14.1], [[email protected]], [], [https://github.com/matt-frey/epic])
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
AC_PROG_FC([gfortran])
AC_LANG(Fortran)
Expand All @@ -8,8 +8,7 @@ LT_INIT
# change file extension from *.f to *.f90
# (important for library tests since it autogenerates a file conftest.f90)
AC_FC_SRCEXT(f90)

FCFLAGS="-std=f2018 -fdefault-real-8 -fdefault-double-8 -cpp -mcmodel=large -fall-intrinsics"
AC_FC_PP_SRCEXT(f90)

AC_CONFIG_MACRO_DIRS([m4])
AC_CONFIG_HEADERS([src/config.h])
Expand Down Expand Up @@ -41,6 +40,31 @@ AC_CONFIG_FILES([
run-script/Makefile
])

# 30 May 2023
# https://www.gnu.org/software/autoconf-archive/ax_compiler_vendor.html
# https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
AX_COMPILER_VENDOR

if test "$ax_cv_fc_compiler_vendor" = "unknown"; then
AC_MSG_ERROR([Could not deduce compiler vendor.])
fi

AX_CHECK_COMPILE_FLAG([-cpp], [FCFLAGS="$FCFLAGS -cpp"])
AX_CHECK_COMPILE_FLAG([-mcmodel=large], [FCFLAGS="$FCFLAGS -mcmodel=large"])

# gfortran compiler flags
AX_CHECK_COMPILE_FLAG([-std=f2018], [FCFLAGS="$FCFLAGS -std=f2018"])
AX_CHECK_COMPILE_FLAG([-fall-intrinsics], [FCFLAGS="$FCFLAGS -fall-intrinsics"])
AX_CHECK_COMPILE_FLAG([-fdefault-real-8], [FCFLAGS="$FCFLAGS -fdefault-real-8"])
AX_CHECK_COMPILE_FLAG([-fdefault-double-8], [FCFLAGS="$FCFLAGS -fdefault-double-8"])

# intel compiler flags
AX_CHECK_COMPILE_FLAG([-std18], [FCFLAGS="$FCFLAGS -std18"])
AX_CHECK_COMPILE_FLAG([-fp-model=source], [FCFLAGS="$FCFLAGS -fp-model=source"])
AX_CHECK_COMPILE_FLAG([-real-size 8], [FCFLAGS="$FCFLAGS -real-size 8"])
AX_CHECK_COMPILE_FLAG([-double-size 64], [FCFLAGS="$FCFLAGS -double-size 64"])


#######################################################################################
##
## "--with" flags
Expand Down Expand Up @@ -468,11 +492,36 @@ AM_CONDITIONAL([ENABLE_DEBUG], [test "$ENABLE_DEBUG" = "yes"])
AC_MSG_CHECKING([whether we are compiling in debug mode])
if test "x$ENABLE_DEBUG" = "xyes"; then
AC_MSG_RESULT([yes])
FCFLAGS="$FCFLAGS -Wall -Wuninitialized -Wmaybe-uninitialized -Werror -g -O0"
FCFLAGS="$FCFLAGS -fcheck=all -fbounds-check -fbacktrace -ffpe-trap=denormal,invalid,zero,overflow,underflow"
AX_CHECK_COMPILE_FLAG([-g], [FCFLAGS="$FCFLAGS -g"])
AX_CHECK_COMPILE_FLAG([-O0], [FCFLAGS="$FCFLAGS -O0"])

# gfortran compiler flags
AX_CHECK_COMPILE_FLAG([-Wall], [FCFLAGS="$FCFLAGS -Wall"])
AX_CHECK_COMPILE_FLAG([-Wuninitialized], [FCFLAGS="$FCFLAGS -Wuninitialized"])
AX_CHECK_COMPILE_FLAG([-Wmaybe-uninitialized], [FCFLAGS="$FCFLAGS -Wmaybe-uninitialized"])
AX_CHECK_COMPILE_FLAG([-Werror], [FCFLAGS="$FCFLAGS -Werror"])
AX_CHECK_COMPILE_FLAG([-fcheck=all], [FCFLAGS="$FCFLAGS -fcheck=all"])
AX_CHECK_COMPILE_FLAG([-fbounds-check], [FCFLAGS="$FCFLAGS -fbounds-check"])
AX_CHECK_COMPILE_FLAG([-fbacktrace], [FCFLAGS="$FCFLAGS -fbacktrace"])
AX_CHECK_COMPILE_FLAG([-ffpe-trap=denormal,invalid,zero,overflow,underflow],
[FCFLAGS="$FCFLAGS -ffpe-trap=denormal,invalid,zero,overflow,underflow"])

# intel compiler flags
AX_CHECK_COMPILE_FLAG([-warn all], [FCFLAGS="$FCFLAGS -Wall"])
AX_CHECK_COMPILE_FLAG([-warn error], [FCFLAGS="$FCFLAGS -warn error"])
AX_CHECK_COMPILE_FLAG([-debug full], [FCFLAGS="$FCFLAGS -debug full"])
else
AC_MSG_RESULT([no])
FCFLAGS="$FCFLAGS -O3 -funroll-all-loops -flto -DNDEBUG"
AX_CHECK_COMPILE_FLAG([-O3], [FCFLAGS="$FCFLAGS -O3"])
AX_CHECK_COMPILE_FLAG([-DNDEBUG], [FCFLAGS="$FCFLAGS -DNDEBUG"])

# gfortran compiler flags
AX_CHECK_COMPILE_FLAG([-funroll-all-loops], [FCFLAGS="$FCFLAGS -funroll-all-loops"])
AX_CHECK_COMPILE_FLAG([-flto], [FCFLAGS="$FCFLAGS -flto"])

# intel compiler flags
AX_CHECK_COMPILE_FLAG([-funroll-loops], [FCFLAGS="$FCFLAGS -funroll-loops"])
AX_CHECK_COMPILE_FLAG([-ffat-lto-objects], [FCFLAGS="$FCFLAGS -ffat-lto-objects"])
fi


Expand Down Expand Up @@ -505,7 +554,11 @@ AM_CONDITIONAL([ENABLE_OPENMP], [test "$ENABLE_OPENMP" = "yes"])
AC_MSG_CHECKING([whether we are enabling OpenMP])
if test "x$ENABLE_OPENMP" = "xyes"; then
AC_MSG_RESULT([yes])
FCFLAGS="$FCFLAGS -fopenmp -DENABLE_OPENMP"
# gfortran compiler flags
AX_CHECK_COMPILE_FLAG([-fopenmp], [FCFLAGS="$FCFLAGS -fopenmp -DENABLE_OPENMP"])

# intel compiler flags
AX_CHECK_COMPILE_FLAG([-qopenmp], [FCFLAGS="$FCFLAGS -qopenmp -DENABLE_OPENMP"])
else
AC_MSG_RESULT([no])
fi
Expand Down
8 changes: 7 additions & 1 deletion examples/moist.config
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
! output info
!
output%field_freq = 50 ![s] write after these many seconds to the field NetCDF file
output%parcel_freq = 50 ![s] write after these many seconds to the parcel NetCDF file
output%parcel_freq = 200 ![s] write after these many seconds to the parcel NetCDF file
output%parcel_stats_freq = 50 ![s] write after these many seconds to parcel stats NetCDF file
output%field_stats_freq = 50 ![s] write after these many seconds to the field stats NetCDF file
output%write_fields = .true. ! enable / disable field dump
Expand All @@ -35,4 +35,10 @@
time%limit = 1000.0 ! time limit (s)
time%alpha = 0.2 ! scaling factor for the strain and buoyancy gradient time step
time%precise_stop = .false. ! time limit exact

!
! damping info
!
damping%l_vorticity = .false.
damping%l_scalars = .false.
/
53 changes: 53 additions & 0 deletions m4/ax_check_compile_flag.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
#
# DESCRIPTION
#
# Check whether the given FLAG works with the current language's compiler
# or gives an error. (Warnings, however, are ignored)
#
# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
# success/failure.
#
# If EXTRA-FLAGS is defined, it is added to the current language's default
# flags (e.g. CFLAGS) when the check is done. The check is thus made with
# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
# force the compiler to issue an error when a bad flag is given.
#
# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
#
# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
#
# LICENSE
#
# Copyright (c) 2008 Guido U. Draheim <[email protected]>
# Copyright (c) 2011 Maarten Bosmans <[email protected]>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.

#serial 6

AC_DEFUN([AX_CHECK_COMPILE_FLAG],
[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
_AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
[AS_VAR_SET(CACHEVAR,[yes])],
[AS_VAR_SET(CACHEVAR,[no])])
_AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
AS_VAR_IF(CACHEVAR,yes,
[m4_default([$2], :)],
[m4_default([$3], :)])
AS_VAR_POPDEF([CACHEVAR])dnl
])dnl AX_CHECK_COMPILE_FLAGS
119 changes: 119 additions & 0 deletions m4/ax_compiler_vendor.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_compiler_vendor.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_COMPILER_VENDOR
#
# DESCRIPTION
#
# Determine the vendor of the C, C++ or Fortran compiler. The vendor is
# returned in the cache variable $ax_cv_c_compiler_vendor for C,
# $ax_cv_cxx_compiler_vendor for C++ or $ax_cv_fc_compiler_vendor for
# (modern) Fortran. The value is one of "intel", "ibm", "pathscale",
# "clang" (LLVM), "cray", "fujitsu", "sdcc", "sx", "nvhpc" (NVIDIA HPC
# Compiler), "portland" (PGI), "gnu" (GCC), "sun" (Oracle Developer
# Studio), "hp", "dec", "borland", "comeau", "kai", "lcc", "sgi",
# "microsoft", "metrowerks", "watcom", "tcc" (Tiny CC) or "unknown" (if
# the compiler cannot be determined).
#
# To check for a Fortran compiler, you must first call AC_FC_PP_SRCEXT
# with an appropriate preprocessor-enabled extension. For example:
#
# AC_LANG_PUSH([Fortran])
# AC_PROG_FC
# AC_FC_PP_SRCEXT([F])
# AX_COMPILER_VENDOR
# AC_LANG_POP([Fortran])
#
# LICENSE
#
# Copyright (c) 2008 Steven G. Johnson <[email protected]>
# Copyright (c) 2008 Matteo Frigo
# Copyright (c) 2018-19 John Zaitseff <[email protected]>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.

#serial 32

AC_DEFUN([AX_COMPILER_VENDOR], [dnl
AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor, [dnl
dnl If you modify this list of vendors, please add similar support
dnl to ax_compiler_version.m4 if at all possible.
dnl
dnl Note: Do NOT check for GCC first since some other compilers
dnl define __GNUC__ to remain compatible with it. Compilers that
dnl are very slow to start (such as Intel) are listed first.
vendors="
intel: __ICC,__ECC,__INTEL_COMPILER
ibm: __xlc__,__xlC__,__IBMC__,__IBMCPP__,__ibmxl__
pathscale: __PATHCC__,__PATHSCALE__
clang: __clang__
cray: _CRAYC
fujitsu: __FUJITSU
sdcc: SDCC,__SDCC
sx: _SX
nvhpc: __NVCOMPILER
portland: __PGI
gnu: __GNUC__
sun: __SUNPRO_C,__SUNPRO_CC,__SUNPRO_F90,__SUNPRO_F95
hp: __HP_cc,__HP_aCC
dec: __DECC,__DECCXX,__DECC_VER,__DECCXX_VER
borland: __BORLANDC__,__CODEGEARC__,__TURBOC__
comeau: __COMO__
kai: __KCC
lcc: __LCC__
sgi: __sgi,sgi
microsoft: _MSC_VER
metrowerks: __MWERKS__
watcom: __WATCOMC__
tcc: __TINYC__
unknown: UNKNOWN
"
for ventest in $vendors; do
case $ventest in
*:)
vendor=$ventest
continue
;;
*)
vencpp="defined("`echo $ventest | sed 's/,/) || defined(/g'`")"
;;
esac
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
#if !($vencpp)
thisisanerror;
#endif
]])], [break])
done
ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=`echo $vendor | cut -d: -f1`
])
])dnl
1 change: 1 addition & 0 deletions src/3d/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ epic3d_SOURCES = \
boundary_layer/bndry_fluxes.f90 \
utils/utils.f90 \
stepper/rk_utils.f90 \
parcels/parcel_damping.f90 \
stepper/ls_rk.f90 \
epic3d.f90

Expand Down
2 changes: 2 additions & 0 deletions src/3d/epic3d.f90
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ program epic3d
use parcel_diagnostics, only : parcel_stats_timer
use parcel_netcdf, only : parcel_io_timer
use parcel_diagnostics_netcdf, only : parcel_stats_io_timer
use parcel_damping, only : damping_timer
use fields
use field_netcdf, only : field_io_timer
use field_diagnostics, only : field_stats_timer
Expand Down Expand Up @@ -89,6 +90,7 @@ subroutine pre_run
call register_timer('merge tree resolve', merge_tree_resolve_timer)
call register_timer('p2g/v2g halo (non-excl.)', halo_swap_timer)
call register_timer('boundary fluxes', bndry_flux_timer)
call register_timer('damping', damping_timer)

call start_timer(epic_timer)

Expand Down
Loading

0 comments on commit ad55557

Please sign in to comment.