diff --git a/.gitignore b/.gitignore index 08b2e983b66139671503e34e6a79134346eb9c91..30618d0f35e5395a784e85895e7f983d6e0036e2 100644 --- a/.gitignore +++ b/.gitignore @@ -41,6 +41,8 @@ pub/ncl_ncarg*/ src/dir_obj-* src/LIB/eccodes* !src/LIB/eccodes*.tar.gz +src/LIB/grib_api* +!src/LIB/grib_api*.tar.gz src/LIB/hdf5* !src/LIB/hdf5*.tar.gz src/LIB/libaec* diff --git a/conf/profile_mesonh.ihm b/conf/profile_mesonh.ihm index 2db28c7019cbb5bd47844f1572ad401ea56cef91..0311dd184682098caee8eed6deaaec8df667dc75 100755 --- a/conf/profile_mesonh.ihm +++ b/conf/profile_mesonh.ihm @@ -1,5 +1,5 @@ #!/bin/bash -#MNH_LIC Copyright 1994-2020 CNRS, Meteo-France and Universite Paul Sabatier +#MNH_LIC Copyright 1994-2021 CNRS, Meteo-France and Universite Paul Sabatier #MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence #MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt #MNH_LIC for details. version 1. @@ -76,6 +76,11 @@ export VERSION_LIBAEC=${VERSION_LIBAEC} # export MNH_IOCDF4=${MNH_IOCDF4} # +# Version of GRIBAPI +# +export VER_GRIBAPI=${VER_GRIBAPI} +export VERSION_GRIBAPI=${VERSION_GRIBAPI} +# # Version of ecCodes # export VERSION_ECCODES=${VERSION_ECCODES} diff --git a/src/LIB/grib_api-1.26.0-Source.tar.gz b/src/LIB/grib_api-1.26.0-Source.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..149f53758041541499365601725a91107114d57d --- /dev/null +++ b/src/LIB/grib_api-1.26.0-Source.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0ca45544c54a3a67de78a62663d4be6be8d9c95a63f1bd30fcb4c14588ac9501 +size 4857336 diff --git a/src/Makefile b/src/Makefile index 8d724499448449805a0ad87c7bdfd095726a15b1..03c5d4492c4f7bc0cba2db78ed82a3ad46a152ae 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,4 +1,4 @@ -#MNH_LIC Copyright 1994-2020 CNRS, Meteo-France and Universite Paul Sabatier +#MNH_LIC Copyright 1994-2021 CNRS, Meteo-France and Universite Paul Sabatier #MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence #MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt #MNH_LIC for details. version 1. @@ -177,7 +177,11 @@ DEP_ALL_USER = $(sort $(filter-out $(IGNORE_DEP_USER) ,$(DEP_USER)) ) .PHONY : all objdirmaster libmaster bibmaster objmaster progmaster .PHONY : installmaster cleanlibmaster cleanmaster cleanobjmaster cleanprogmaster +ifeq "$(MNH_GRIBAPI)" "yes" +all : gribapi progmaster +else all : eccodes_lib progmaster +endif objdirmaster : $(OBJDIR_MASTER)/.dummy @@ -196,7 +200,11 @@ ifeq "$(VER_OASIS)" "OASISAUTO" depmaster : oasis endif +ifeq "$(MNH_GRIBAPI)" "yes" +depmaster : gribapi +else depmaster : eccodes_lib +endif filedepallmaster : $(DEP_ALL_MASTER) find $(OBJDIR_MASTER) -follow -name "*.D" > $(OBJDIR_MASTER)/filemaster @@ -290,6 +298,22 @@ cleanproguser : ########################################################## # # +# EXTRA LIB : GRIBAPI # +# # +########################################################## +ifneq "$(findstring 64,$(shell uname -m))" "" +A64=A64 +endif +gribapi : $(GRIBAPI_INC) +$(GRIBAPI_INC) : + cd ${DIR_GRIBAPI} && ./configure --disable-shared --disable-jpeg --prefix=${GRIBAPI_PATH} CC="$(CC)" \ + FC="$(FC)" FCFLAGS="$(GRIB_FLAGS)" ${GRIBAPI_CONF} && $(MAKE) -j 1 clean && \ + $(MAKE) -j 1 && $(MAKE) -j 1 install && $(MAKE) -j 1 clean + +gribapi_clean : + - [ -d ${GRIBAPI_PATH} ] && rm -fr ${GRIBAPI_PATH} +########################################################## +# # # EXTRA LIB : ecCodes # # # ########################################################## diff --git a/src/Makefile.MESONH.mk b/src/Makefile.MESONH.mk index 9ad6ff289c7ea800231b7228b7bded17a74c405d..c7ee64669c751e81fb653ed0fe1977751191fec8 100644 --- a/src/Makefile.MESONH.mk +++ b/src/Makefile.MESONH.mk @@ -416,9 +416,28 @@ endif ARCH_XYZ := $(ARCH_XYZ)-$(VER_MPI) +########################################################## +# Librairie GRIBAPI # +########################################################## +ifeq "$(MNH_GRIBAPI)" "yes" +DIR_GRIBAPI?=${SRC_MESONH}/src/LIB/grib_api-${VERSION_GRIBAPI} +GRIBAPI_PATH?=${OBJDIR_MASTER}/GRIBAPI-${VERSION_GRIBAPI} +GRIBAPI_INC?=${GRIBAPI_PATH}/include/grib_api.mod +# +ifdef DIR_GRIBAPI +INC_GRIBAPI ?= -I${GRIBAPI_PATH}/include +LIB_GRIBAPI ?= -L${GRIBAPI_PATH}/lib -L${GRIBAPI_PATH}/lib64 -lgrib_api_f90 -lgrib_api +INC += $(INC_GRIBAPI) +LIBS += $(LIB_GRIBAPI) +VPATH += $(GRIBAPI_PATH)/include +R64_GRIBAPI=R64 +endif +endif + ########################################################## # ecCodes library # ########################################################## +ifneq "$(MNH_GRIBAPI)" "yes" DIR_ECCODES_SRC?=${SRC_MESONH}/src/LIB/eccodes-${VERSION_ECCODES}-Source DIR_ECCODES_BUILD?=${SRC_MESONH}/src/LIB/eccodes-${VERSION_ECCODES}-${ARCH}-R${MNH_REAL}I${MNH_INT} DIR_ECCODES_INSTALL?=${OBJDIR_MASTER}/ECCODES-${VERSION_ECCODES} @@ -431,6 +450,7 @@ INC += $(INC_ECCODES) LIBS += $(LIB_ECCODES) VPATH += $(DIR_ECCODES_INSTALL)/include endif +endif ########################################################## # Librairie OASIS # diff --git a/src/Rules.AIX64.mk b/src/Rules.AIX64.mk index a6903634a69cd8285ee8d37036de28104114f5f6..5f750fdcd0834593bf318df7f3003f1c19a90732 100644 --- a/src/Rules.AIX64.mk +++ b/src/Rules.AIX64.mk @@ -106,6 +106,12 @@ MNH_COMPRESS=yes #if MNH_S4PY exists => compile the libs4py library (for epygram) #MNH_S4PY=no # +## ecCodes or grib_api selection +#MNH_GRIBAPI: if set to no: use ecCodes +# if set to yes: use grib_api (deprecated library) +# +MNH_GRIBAPI=no +# ########################################################## # # # Source of MESONH PACKAGE Distribution # diff --git a/src/Rules.BG.mk b/src/Rules.BG.mk index 7e66bdb4ad770ebab79530683f69dff4f7c996c4..7f4261c7599a8580df10c866f1e855bba192675c 100644 --- a/src/Rules.BG.mk +++ b/src/Rules.BG.mk @@ -117,6 +117,12 @@ MNH_IOLFI=yes #if MNH_S4PY exists => compile the libs4py library (for epygram) #MNH_S4PY=no # +## ecCodes or grib_api selection +#MNH_GRIBAPI: if set to no: use ecCodes +# if set to yes: use grib_api (deprecated library) +# +MNH_GRIBAPI=no +# ########################################################## # # # Source of MESONH PACKAGE Distribution # diff --git a/src/Rules.BGQ.mk b/src/Rules.BGQ.mk index 28744cc11f87a237deb07e395744262facd24035..1fd0a07bd041649c96d941cd91a50b58d5063364 100644 --- a/src/Rules.BGQ.mk +++ b/src/Rules.BGQ.mk @@ -173,6 +173,12 @@ MNH_IOLFI=yes #if MNH_S4PY exists => compile the libs4py library (for epygram) #MNH_S4PY=no # +## ecCodes or grib_api selection +#MNH_GRIBAPI: if set to no: use ecCodes +# if set to yes: use grib_api (deprecated library) +# +MNH_GRIBAPI=no +# ########################################################## # # # Source of MESONH PACKAGE Distribution # diff --git a/src/Rules.LXNAGfor.mk b/src/Rules.LXNAGfor.mk index 28e64bd5c2040547581bf15d9a791fc3b0ded0cb..f623af39cfc550ed248e92cb7a5085f10f3255c4 100644 --- a/src/Rules.LXNAGfor.mk +++ b/src/Rules.LXNAGfor.mk @@ -99,6 +99,12 @@ MNH_COMPRESS=yes #if MNH_S4PY exists => compile the libs4py library (for epygram) #MNH_S4PY=no # +## ecCodes or grib_api selection +#MNH_GRIBAPI: if set to no: use ecCodes +# if set to yes: use grib_api (deprecated library) +# +MNH_GRIBAPI=no +# ########################################################## # # # Source of MESONH PACKAGE Distribution # diff --git a/src/Rules.LXarm.mk b/src/Rules.LXarm.mk index 539936b92f2eb7b0af178585bf6f999b64a48e89..5ae81163a76f5575199c1553a04821c1ddd95abe 100644 --- a/src/Rules.LXarm.mk +++ b/src/Rules.LXarm.mk @@ -122,6 +122,12 @@ MNH_COMPRESS=yes #if MNH_S4PY exists => compile the libs4py library (for epygram) #MNH_S4PY=no # +## ecCodes or grib_api selection +#MNH_GRIBAPI: if set to no: use ecCodes +# if set to yes: use grib_api (deprecated library) +# +MNH_GRIBAPI=no +# ########################################################## # # # Source of MESONH PACKAGE Distribution # diff --git a/src/Rules.LXcray.mk b/src/Rules.LXcray.mk index c6c34f133d4c88729dd9ff389da53080baa0e8f5..8b5a2ec2e28d06909c75cd99c88f3a866b9f7707 100644 --- a/src/Rules.LXcray.mk +++ b/src/Rules.LXcray.mk @@ -111,6 +111,12 @@ MNH_COMPRESS=yes #if MNH_S4PY exists => compile the libs4py library (for epygram) #MNH_S4PY=no # +## ecCodes or grib_api selection +#MNH_GRIBAPI: if set to no: use ecCodes +# if set to yes: use grib_api (deprecated library) +# +MNH_GRIBAPI=no +# ########################################################## # # # Source of MESONH PACKAGE Distribution # diff --git a/src/Rules.LXg95.mk b/src/Rules.LXg95.mk index b147aeeb2dc97dc6ede8ab98c17fdee0a6436216..305f9f56c94423a95e415dce2fb5939f4ee24470 100644 --- a/src/Rules.LXg95.mk +++ b/src/Rules.LXg95.mk @@ -87,6 +87,12 @@ MNH_COMPRESS=yes #if MNH_S4PY exists => compile the libs4py library (for epygram) #MNH_S4PY=no # +## ecCodes or grib_api selection +#MNH_GRIBAPI: if set to no: use ecCodes +# if set to yes: use grib_api (deprecated library) +# +MNH_GRIBAPI=no +# ########################################################## # # # Source of MESONH PACKAGE Distribution # diff --git a/src/Rules.LXgfortran.mk b/src/Rules.LXgfortran.mk index 2c4401b01bafebabe365db964b34007003965a3a..73839121f600b5bf5ff025c40f66e2e3789a9dc6 100644 --- a/src/Rules.LXgfortran.mk +++ b/src/Rules.LXgfortran.mk @@ -116,6 +116,12 @@ MNH_COMPRESS=yes #if MNH_S4PY exists => compile the libs4py library (for epygram) #MNH_S4PY=no # +## ecCodes or grib_api selection +#MNH_GRIBAPI: if set to no: use ecCodes +# if set to yes: use grib_api (deprecated library) +# +MNH_GRIBAPI=no +# # # Force -fallow-argument-mismatch option for gcc >= 10.1 # Necessary because some subroutines may be called with different datatypes @@ -124,6 +130,7 @@ MNH_COMPRESS=yes # ifeq ($(shell test $(GFV) -ge 1010 ; echo $$?),0) OPT_BASE += -fallow-argument-mismatch +GRIB_FLAGS += -fallow-argument-mismatch NETCDF_SUPPFLAGS += -fallow-argument-mismatch ECCODES_FFLAGS += -fallow-argument-mismatch endif diff --git a/src/Rules.LXifort.mk b/src/Rules.LXifort.mk index 903e4d236a0e46919fe6d2f4ba420bb19a1647f0..7538eee8f843b9046e1b906aaf5bac43c61b6ac7 100644 --- a/src/Rules.LXifort.mk +++ b/src/Rules.LXifort.mk @@ -211,6 +211,12 @@ MNH_COMPRESS=yes #if MNH_S4PY exists => compile the libs4py library (for epygram) #MNH_S4PY=no # +## ecCodes or grib_api selection +#MNH_GRIBAPI: if set to no: use ecCodes +# if set to yes: use grib_api (deprecated library) +# +MNH_GRIBAPI=no +# ########################################################## # # # Source of MESONH PACKAGE Distribution # diff --git a/src/Rules.LXpathf95.mk b/src/Rules.LXpathf95.mk index a59f82f1696aec11c97609fa12e0a51deedcaca9..932b438aae162bf04a54b30433af09a957c17c3a 100644 --- a/src/Rules.LXpathf95.mk +++ b/src/Rules.LXpathf95.mk @@ -67,6 +67,12 @@ MNH_COMPRESS=yes #if MNH_S4PY exists => compile the libs4py library (for epygram) #MNH_S4PY=no # +## ecCodes or grib_api selection +#MNH_GRIBAPI: if set to no: use ecCodes +# if set to yes: use grib_api (deprecated library) +# +MNH_GRIBAPI=no +# ########################################################## # # # Source of MESONH PACKAGE Distribution # diff --git a/src/Rules.LXpgi.mk b/src/Rules.LXpgi.mk index 21aea204e2f1007a789086874c9d05b7e29f338c..efdb4569fafc0d0b45838c52e27c735aaf164554 100644 --- a/src/Rules.LXpgi.mk +++ b/src/Rules.LXpgi.mk @@ -122,6 +122,12 @@ MNH_COMPRESS=yes #if MNH_S4PY exists => compile the libs4py library (for epygram) #MNH_S4PY=no # +## ecCodes or grib_api selection +#MNH_GRIBAPI: if set to no: use ecCodes +# if set to yes: use grib_api (deprecated library) +# +MNH_GRIBAPI=no +# ########################################################## # # # Source of MESONH PACKAGE Distribution # diff --git a/src/Rules.SX8.mk b/src/Rules.SX8.mk index 085a11728abae7a073d419950b84d1214b15ff62..79e63f46c80122ec97fcb3072079381431c731b1 100644 --- a/src/Rules.SX8.mk +++ b/src/Rules.SX8.mk @@ -109,6 +109,12 @@ MNH_IOLFI=yes #if MNH_S4PY exists => compile the libs4py library (for epygram) #MNH_S4PY=no # +## ecCodes or grib_api selection +#MNH_GRIBAPI: if set to no: use ecCodes +# if set to yes: use grib_api (deprecated library) +# +MNH_GRIBAPI=no +# ########################################################## # # # Source of MESONH PACKAGE Distribution # diff --git a/src/configure b/src/configure index 45c0474c60a137c5ac2f3461a1cc4699a9045501..d15f5aa06d4963a44d34736a476dde1cfef2c7df 100755 --- a/src/configure +++ b/src/configure @@ -17,6 +17,7 @@ export VERSION_HDF=${VERSION_HDF:-"1.12.0"} export VERSION_CDFC=${VERSION_CDFC:-"4.7.4"} export VERSION_CDFCXX=${VERSION_CDFCXX:-"4.3.1"} export VERSION_CDFF=${VERSION_CDFF:-"4.5.3"} +export VERSION_GRIBAPI=${VERSION_GRIBAPI:-"1.26.0-Source"} export VERSION_ECCODES=${VERSION_ECCODES:-"2.18.0"} export MNH_INT=${MNH_INT:-"4"} export LFI_INT=${LFI_INT:-8} @@ -550,6 +551,10 @@ if [ "x${MNH_MEGAN}" == "x1" ] ; then ( cd $LOCAL/src/LIB ; [ ! -d MEGAN ] && tar xvfz megan.tar.gz ) fi # +# Install GRIBAPI +# +cd $LOCAL/src/LIB ; [ ! -d grib_api-${VERSION_GRIBAPI} ] && [ -f grib_api-${VERSION_GRIBAPI}.tar.gz ] && gunzip -c grib_api-${VERSION_GRIBAPI}.tar.gz |tar -xvf - +# # Install ecCodes # cd $LOCAL/src/LIB ; [ ! -d eccodes-${VERSION_ECCODES}-Source ] && [ -f eccodes-${VERSION_ECCODES}-Source.tar.gz ] && gunzip -c eccodes-${VERSION_ECCODES}-Source.tar.gz |tar -xvf -