From 94a14820be011c2fabc13648740436ce456e5e7b Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Sun, 3 Apr 2022 21:54:09 -0600 Subject: [PATCH 1/5] Per #2106, adding shape to the list of shared variables. --- met/src/basic/vx_util/data_plane_util.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/met/src/basic/vx_util/data_plane_util.cc b/met/src/basic/vx_util/data_plane_util.cc index 8f5feea095..89dcae02e0 100644 --- a/met/src/basic/vx_util/data_plane_util.cc +++ b/met/src/basic/vx_util/data_plane_util.cc @@ -251,9 +251,9 @@ void fractional_coverage(const DataPlane &dp, DataPlane &frac_dp, } } -#pragma omp parallel default(none) \ - shared(mlog, dp, frac_dp, width, wrap_lon, t) \ - shared(use_climo, cmn, csd, vld_t, bad) \ +#pragma omp parallel default(none) \ + shared(mlog, dp, frac_dp, shape, width, wrap_lon, t) \ + shared(use_climo, cmn, csd, vld_t, bad) \ private(x, y, n_vld, n_thr, gp, v) { From fbd597850711c5f2593c5b367b9ae45d8f0438fd Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Sun, 3 Apr 2022 22:05:51 -0600 Subject: [PATCH 2/5] Per #2106, not including 'shape' in the shared variable list causes a compilation error in GCC9. data_plane_util.cc:262:36: error: "shape" not specified in enclosing "parallel" However, including it causes a compilation error in GCC8! data_plane_util.cc:257:38: error: 'shape' is predetermined 'shared' for 'shared' private(x, y, n_vld, n_thr, gp, v) Try making "shape" non-const to see if that sidesteps the GCC8 issue. --- met/src/basic/vx_util/data_plane_util.cc | 3 +-- met/src/basic/vx_util/data_plane_util.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/met/src/basic/vx_util/data_plane_util.cc b/met/src/basic/vx_util/data_plane_util.cc index 89dcae02e0..d34e56a361 100644 --- a/met/src/basic/vx_util/data_plane_util.cc +++ b/met/src/basic/vx_util/data_plane_util.cc @@ -30,7 +30,6 @@ using namespace std; #include "GridTemplate.h" - //////////////////////////////////////////////////////////////////////// // // Utility functions operating on a DataPlane @@ -206,7 +205,7 @@ DataPlane smooth_field(const DataPlane &dp, //////////////////////////////////////////////////////////////////////// void fractional_coverage(const DataPlane &dp, DataPlane &frac_dp, - int width, const GridTemplateFactory::GridTemplates shape, + int width, GridTemplateFactory::GridTemplates shape, bool wrap_lon, SingleThresh t, const DataPlane *cmn, const DataPlane *csd, double vld_t) { GridPoint *gp = NULL; diff --git a/met/src/basic/vx_util/data_plane_util.h b/met/src/basic/vx_util/data_plane_util.h index 1b5788dddc..c4f0b07c16 100644 --- a/met/src/basic/vx_util/data_plane_util.h +++ b/met/src/basic/vx_util/data_plane_util.h @@ -51,7 +51,7 @@ extern DataPlane smooth_field(const DataPlane &dp, bool wrap_lon, double t, const GaussianInfo &gaussian); extern void fractional_coverage(const DataPlane &dp, DataPlane &frac_dp, - int width, const GridTemplateFactory::GridTemplates shape, + int width, GridTemplateFactory::GridTemplates shape, bool wrap_lon, SingleThresh t, const DataPlane *cmn, const DataPlane *csd, double vld_t); From f5231f3aaa41b711a364a494294f25a18852c8bd Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Fri, 8 Apr 2022 16:59:17 -0600 Subject: [PATCH 3/5] Per #2106, adding a docker build develoment environment. It was useful for testing this bugfix but could be modified if we change the way the MET software is compiled inside Docker. --- scripts/environment/development.docker | 44 ++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 scripts/environment/development.docker diff --git a/scripts/environment/development.docker b/scripts/environment/development.docker new file mode 100644 index 0000000000..cc5b0fadc6 --- /dev/null +++ b/scripts/environment/development.docker @@ -0,0 +1,44 @@ +# Define the development environment for NCAR project machine seneca +# Based on settings in /usr/local/src/met/README.snat + +# Top-level MET project directory +MET_PROJ_DIR=`ls -1d /met/MET*` + +# Variables required to build MET +export MET_DEVELOPMENT=true + +export MET_NETCDF=/usr/local +export MET_HDF5INC=/usr/include +export MET_HDF5LIB=/usr/lib64 +export MET_HDF=/usr/local/hdf +export MET_HDFEOS=/usr/local/hdfeos2 +export MET_BUFR=/usr/local +export MET_GRIB2CINC=/usr/include +export MET_GRIB2CLIB=/usr/lib64 +export MET_GSLINC=/usr/include/gsl +export MET_GSLLIB=/usr/lib64 +export MET_CAIROINC=/usr/include/cairo +export MET_CAIROLIB=/usr/lib64 +export MET_FREETYPEINC=/usr/include/freetype2 +export MET_FREETYPELIB=/usr/lib64 +export MET_JASPERLIB=/usr/lib64 + +export MET_PYTHON=/usr/bin/python3 +export MET_PYTHON_CC="-I/usr/include/python3.6m -I/usr/include/python3.6m" +export MET_PYTHON_LD="-L/usr/lib64 -lpython3.6m -lpthread -ldl -lutil -lm" + +# -D__64BIT__ is required because we've compiled libgrib2c.a with that flag +export CFLAGS="-DUNDERSCORE -fPIC -D__64BIT__ -g" +export CXXFLAGS=${CFLAGS} + +# Set LDFLAGS to include -rpath settings when compiling MET +export LDFLAGS="-Wl,--disable-new-dtags" +export LDFLAGS="${LDFLAGS} -Wl,-rpath,/usr/local/lib:/usr/lib64:${MET_HDF}/lib:${MET_HDFEOS}/lib" + +# Variables required to run MET +export MET_TEST_INPUT=${MET_PROJ_DIR}/MET_test_data/unit_test +export MET_FONT_DIR=${MET_TEST_INPUT}/fonts + +# Define Rscript to use a version with the ncdf4 package 1.17 or later +export MET_TEST_RSCRIPT=/usr/bin/Rscript + From e8abe14cd172dbe9bc639bfb954df288e5863fc1 Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Fri, 8 Apr 2022 17:00:17 -0600 Subject: [PATCH 4/5] Per #2106, since plot_point_obs can also plot gridded data, it should link to zlib like plot_data_plane does. Compiling with GCC 9 revealed the linker error. --- met/src/tools/other/plot_point_obs/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/met/src/tools/other/plot_point_obs/Makefile.am b/met/src/tools/other/plot_point_obs/Makefile.am index fffb055719..690bb9ab63 100644 --- a/met/src/tools/other/plot_point_obs/Makefile.am +++ b/met/src/tools/other/plot_point_obs/Makefile.am @@ -44,7 +44,7 @@ plot_point_obs_LDADD = -lvx_statistics \ -lvx_cal \ -lvx_log \ $(PYTHON_LIBS) \ - -lm -lnetcdf_c++4 -lnetcdf -lgsl -lgslcblas + -lm -lz -lnetcdf_c++4 -lnetcdf -lgsl -lgslcblas EXTRA_DIST = plot_point_obs.h \ plot_point_obs_conf_info.h From b065f6b1b7bdc500da0f11b4171e1d572bafc591 Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Mon, 11 Apr 2022 10:04:27 -0600 Subject: [PATCH 5/5] Per #2106, fix the location of hdfeos library. --- scripts/environment/development.docker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/environment/development.docker b/scripts/environment/development.docker index cc5b0fadc6..ec4bd202c3 100644 --- a/scripts/environment/development.docker +++ b/scripts/environment/development.docker @@ -11,7 +11,7 @@ export MET_NETCDF=/usr/local export MET_HDF5INC=/usr/include export MET_HDF5LIB=/usr/lib64 export MET_HDF=/usr/local/hdf -export MET_HDFEOS=/usr/local/hdfeos2 +export MET_HDFEOS=/usr/local/hdfeos export MET_BUFR=/usr/local export MET_GRIB2CINC=/usr/include export MET_GRIB2CLIB=/usr/lib64