Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FLEXPART] Version 10.4.2 #9002

Merged
merged 1 commit into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions F/FLEXPART/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
using BinaryBuilder, Pkg

name = "FLEXPART"
version = v"10.4"
version = v"10.4.2"

# Collection of sources required to complete build
sources = [
GitSource("https://www.flexpart.eu/gitmob/flexpart", "3d7eebf7c4909f59db5ec32c524f88fb846e9fe5"),
GitSource("https://www.flexpart.eu/gitmob/flexpart", "8ad70c708b59dad8f4adabf7ab51dd110ace76d1"),
DirectorySource("./bundled"),
]

Expand All @@ -25,10 +25,14 @@ cp FLEXPART $bindir
install_license ../LICENSE
"""

platforms = [
Platform("x86_64", "linux"; libc = "glibc")
]
platforms = supported_platforms()
# 32 bit platforms are not supported by dependency eccodes
filter!(p -> nbits(p) == 64, platforms)
platforms = expand_gfortran_versions(platforms)
filter!(p -> libgfortran_version(p) != v"3", platforms) # Also for eccodes compatibility
filter!(p -> arch(p) != "powerpc64le" && !Sys.isfreebsd(p) && libc(p) != "musl", platforms) # Fliter for netcdff platforms
filter!(!Sys.iswindows, platforms) # Excluded because of "Error: value of ... too large for field of 4 bytes at ..."
filter!(!Sys.isapple, platforms) # Excluded because of "invalid variant" errors

# The products that we will ensure are always built
products = [
Expand All @@ -38,8 +42,9 @@ products = [
# Dependencies that must be installed before this package can be built
dependencies = [
Dependency("CompilerSupportLibraries_jll"),
Dependency("eccodes_jll"),
Dependency("NetCDFF_jll"),
Dependency("eccodes_jll"; compat="2.36.0"),
Dependency("NetCDFF_jll"; compat="4.6.1"),
Dependency("JasPer_jll"; compat="2.0.33"),
]

# Build the tarballs, and possibly a `build.jl` as well.
Expand Down
81 changes: 38 additions & 43 deletions F/FLEXPART/bundled/patches/flexpart-makefile.patch
Original file line number Diff line number Diff line change
@@ -1,44 +1,39 @@
diff --git a/src/makefile b/src/makefile
index 43d335d..3668d11 100644
--- a/src/makefile
+++ b/src/makefile
@@ -62,14 +62,13 @@ ifeq ($(gcc), 4.9)
LIBPATH1 = ${ROOT_DIR}/lib
else
# Compiled libraries under user ~flexpart, gfortran v5.4
- ROOT_DIR = /homevip/flexpart/
+ ROOT_DIR = ${prefix}

- F90 = /usr/bin/gfortran
+ F90 = gfortran
MPIF90 = /usr/bin/mpifort

- INCPATH1 = ${ROOT_DIR}/gcc-5.4.0/include
- INCPATH2 = /usr/include
- LIBPATH1 = ${ROOT_DIR}/gcc-5.4.0/lib
diff --color -ur flexpart-orig/src/makefile flexpart/src/makefile
--- flexpart-orig/src/makefile 2024-06-28 12:00:25.488456542 +0200
+++ flexpart/src/makefile 2024-06-28 12:08:25.775123497 +0200
@@ -91,13 +91,9 @@
F90 = gfortran
MPIF90 = mpifort

- INCPATH1 = /usr/include/
+ INCPATH1 = ${includedir}
+ LIBPATH1 = ${libdir}
endif


@@ -87,16 +86,16 @@ VPATH = gributils/


## OPTIMIZATION LEVEL
-O_LEV = 0 # [0,1,2,3,g,s,fast]
+O_LEV = 3 # [0,1,2,3,g,s,fast]
O_LEV_DBG = g # [0,g]

## LIBRARIES
#LIBS = -lgrib_api_f90 -lgrib_api -lm -ljasper -lnetcdff
-LIBS = -lgrib_api_f90 -lgrib_api -lm -ljasper $(NCOPT)
+LIBS = -leccodes_f90 -leccodes -lm $(NCOPT)

-FFLAGS = -I$(INCPATH1) -I$(INCPATH2) -O$(O_LEV) -g -cpp -m64 -mcmodel=medium -fconvert=little-endian -frecord-marker=4 -fmessage-length=0 -flto=jobserver -O$(O_LEV) $(NCOPT) $(FUSER) #-Warray-bounds -fcheck=all # -march=native
+FFLAGS = -I$(INCPATH1) -O$(O_LEV) -cpp -m64 -mcmodel=medium -fconvert=little-endian -frecord-marker=4 -fmessage-length=0 -O$(O_LEV) $(NCOPT) $(FUSER) #-Warray-bounds -fcheck=all # -march=native

-DBGFLAGS = -I$(INCPATH1) -I$(INCPATH2) -O$(O_LEV_DBG) -g3 -ggdb3 -cpp -m64 -mcmodel=medium -fconvert=little-endian -frecord-marker=4 -fmessage-length=0 -flto=jobserver -O$(O_LEV_DBG) $(NCOPT) -fbacktrace -Wall -fdump-core $(FUSER) # -ffpe-trap=invalid,overflow,denormal,underflow,zero -Warray-bounds -fcheck=all
+DBGFLAGS = -I$(INCPATH1) -O$(O_LEV_DBG) -g3 -ggdb3 -cpp -m64 -mcmodel=medium -fconvert=little-endian -frecord-marker=4 -fmessage-length=0 -O$(O_LEV_DBG) $(NCOPT) -fbacktrace -Wall -fdump-core $(FUSER) # -ffpe-trap=invalid,overflow,denormal,underflow,zero -Warray-bounds -fcheck=all

LDFLAGS = $(FFLAGS) -L$(LIBPATH1) -Wl,-rpath,$(LIBPATH1) $(LIBS) #-L$(LIBPATH2)
LDDEBUG = $(DBGFLAGS) -L$(LIBPATH1) $(LIBS) #-L$(LIBPATH2)
INCPATH2 = ./
- LIBPATH1 = /usr/lib/
-
- INCPATH2 = /opt/eccodes/include/
-# INCPATH2 = ./
- LIBPATH2 = /opt/eccodes/lib/
+ LIBPATH1 = ${libdir}

# the following works on a Debian buster (and probably newer) machine
# F90 = gfortran
@@ -128,9 +124,7 @@
#LIBS = -lgrib_api_f90 -lgrib_api -lm -ljasper $(NCOPT)
LIBS = -leccodes_f90 -leccodes -lm -ljasper $(NCOPT)

-FFLAGS = -I$(INCPATH1) -I$(INCPATH2) -O$(O_LEV) -g -cpp -m64 -mcmodel=medium \
- -fconvert=little-endian -frecord-marker=4 -fmessage-length=0 \
- -flto=jobserver -O$(O_LEV) $(NCOPT) $(FUSER) #-Warray-bounds -fcheck=all # -march=native
+FFLAGS = -I$(INCPATH1) -O$(O_LEV) -cpp -mcmodel=large -fconvert=little-endian -frecord-marker=4 -fmessage-length=0 -O$(O_LEV) $(NCOPT) $(FUSER)

DBGFLAGS = -I$(INCPATH1) -I$(INCPATH2) -O$(O_LEV_DBG) -g3 -ggdb3 -cpp \
-m64 -mcmodel=medium -fconvert=little-endian -frecord-marker=4 \
@@ -138,7 +134,7 @@
-fbacktrace -Wall -fdump-core $(FUSER) -fcheck=all #\
# -ffpe-trap=invalid,overflow,denormal,underflow,zero

-LDFLAGS = $(FFLAGS) -L$(LIBPATH1) -L$(LIBPATH2) -Wl,-rpath,$(LIBPATH1) $(LIBS)
+LDFLAGS = $(FFLAGS) -L$(LIBPATH1) -Wl,-rpath,$(LIBPATH1) $(LIBS)
LDDEBUG = $(DBGFLAGS) -L$(LIBPATH1) $(LIBS)

MODOBJS = \
4 changes: 2 additions & 2 deletions F/FLEXPART/bundled/patches/flexpart-parmod.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ diff --git a/src/par_mod.f90 b/src/par_mod.f90
index 776996f..0419fa3 100644
--- a/src/par_mod.f90
+++ b/src/par_mod.f90
@@ -134,12 +134,12 @@ module par_mod
@@ -137,12 +137,12 @@ module par_mod
! integer,parameter :: nxmax=361,nymax=181,nuvzmax=92,nwzmax=92,nzmax=92,nxshift=359 ! 1.0 degree 92 level
! integer,parameter :: nxmax=361,nymax=181,nuvzmax=138,nwzmax=138,nzmax=138,nxshift=0 ! 1.0 degree 138 level
! integer,parameter :: nxmax=361,nymax=181,nuvzmax=138,nwzmax=138,nzmax=138,nxshift=359 ! 1.0 degree 138 level
Expand All @@ -18,7 +18,7 @@ index 776996f..0419fa3 100644


!*********************************************
@@ -204,7 +204,7 @@ module par_mod
@@ -207,7 +207,7 @@ module par_mod
! Maximum number of particles, species, and similar
!**************************************************

Expand Down