diff --git a/.github/jobs/build_docker_image.sh b/.github/jobs/build_docker_image.sh index 81ce302b44..47dc46e20a 100755 --- a/.github/jobs/build_docker_image.sh +++ b/.github/jobs/build_docker_image.sh @@ -12,6 +12,7 @@ time_command docker build -t ${DOCKERHUB_TAG} \ --build-arg SOURCE_BRANCH \ --build-arg MET_BASE_REPO \ --build-arg MET_BASE_TAG \ + --build-arg MET_CONFIG_OPTS \ -f $DOCKERFILE_PATH ${GITHUB_WORKSPACE} if [ $? != 0 ]; then cat ${GITHUB_WORKSPACE}/docker_build.log diff --git a/.github/workflows/compilation_options.yml b/.github/workflows/compilation_options.yml new file mode 100644 index 0000000000..48e7be9ca5 --- /dev/null +++ b/.github/workflows/compilation_options.yml @@ -0,0 +1,84 @@ +name: Compilation Options + +# Test matrix of MET configuration/compilation options + +on: + + # Note that scheduled cron events are run on the default branch. + # Enable this schedule when main_v12.0 becomes the default branch. + + # schedule: + # - cron: '0 7 * * 0'' + + push: + + tags: + - '**' + + workflow_dispatch: + +env: + DOCKERHUB_REPO: dtcenter/met-dev + +jobs: + + job_control: + name: Determine which jobs to run + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set job controls + id: job_status + run: .github/jobs/set_job_controls.sh + env: + commit_msg: ${{ github.event.head_commit.message }} + force_tests: ${{ github.event.inputs.force_tests }} + + outputs: + met_base_repo: ${{ steps.job_status.outputs.met_base_repo }} + met_base_tag: ${{ steps.job_status.outputs.met_base_tag }} + branch_name: ${{ steps.job_status.outputs.branch_name }} + + compile: + name: Config Opts + runs-on: ubuntu-latest + needs: job_control + strategy: + matrix: + config_opts: + - '' + - '--enable-all' + - '--enable-grib2' + - '--enable-python' + - '--enable-ugrid' + - '--enable-lidar2nc' + - '--enable-mode_graphics' + - '--enable-modis' + fail-fast: false + steps: + - uses: actions/checkout@v3 + + - name: Create directories to store output + run: mkdir -p ${RUNNER_WORKSPACE}/logs + + - name: Compile MET in Docker + run: .github/jobs/build_docker_image.sh + env: + SOURCE_BRANCH: ${{ needs.job_control.outputs.branch_name }} + MET_BASE_REPO: ${{ needs.job_control.outputs.met_base_repo }} + MET_BASE_TAG: ${{ needs.job_control.outputs.met_base_tag }} + MET_CONFIG_OPTS: ${{ matrix.config_opts }} + + - name: Copy all build log files into logs directory + if: always() + run: cp ${GITHUB_WORKSPACE}/*.log ${RUNNER_WORKSPACE}/logs/ + + - name: Upload logs as artifact + if: always() + uses: actions/upload-artifact@v3 + with: + name: logs + path: ${{ runner.workspace }}/logs + if-no-files-found: ignore + diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index fcfb898db0..bc43679221 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -87,6 +87,7 @@ jobs: SOURCE_BRANCH: ${{ needs.job_control.outputs.branch_name }} MET_BASE_REPO: ${{ needs.job_control.outputs.met_base_repo }} MET_BASE_TAG: ${{ needs.job_control.outputs.met_base_tag }} + MET_CONFIG_OPTS: '--enable-all' - name: Copy all build log files into logs directory if: always() diff --git a/aclocal.m4 b/aclocal.m4 index 3aee821715..b58d8d33ae 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.16.1 -*- Autoconf -*- +# generated automatically by aclocal 1.16.5 -*- Autoconf -*- -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -14,13 +14,13 @@ m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, -[m4_warning([this file was generated for autoconf 2.69. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, +[m4_warning([this file was generated for autoconf 2.71. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002-2018 Free Software Foundation, Inc. +# Copyright (C) 2002-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -35,7 +35,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.16.1], [], +m4_if([$1], [1.16.5], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.16.1])dnl +[AM_AUTOMAKE_VERSION([1.16.5])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -110,7 +110,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd` # AM_COND_IF -*- Autoconf -*- -# Copyright (C) 2008-2018 Free Software Foundation, Inc. +# Copyright (C) 2008-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -147,7 +147,7 @@ fi[]dnl # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2018 Free Software Foundation, Inc. +# Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -178,7 +178,7 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -369,7 +369,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -408,7 +408,9 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments - for automatic dependency tracking. Try re-running configure with the + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE="gmake" (or whatever is + necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking).]) fi @@ -435,7 +437,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -463,6 +465,10 @@ m4_defn([AC_PROG_CC]) # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl +m4_ifdef([_$0_ALREADY_INIT], + [m4_fatal([$0 expanded multiple times +]m4_defn([_$0_ALREADY_INIT]))], + [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl @@ -499,7 +505,7 @@ m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( - m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl @@ -551,6 +557,20 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi +AC_SUBST([CTAGS]) +if test -z "$ETAGS"; then + ETAGS=etags +fi +AC_SUBST([ETAGS]) +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi +AC_SUBST([CSCOPE]) + AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This @@ -632,7 +652,7 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -653,7 +673,7 @@ if test x"${install_sh+set}" != xset; then fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2018 Free Software Foundation, Inc. +# Copyright (C) 2003-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -674,7 +694,7 @@ AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -717,7 +737,7 @@ AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2018 Free Software Foundation, Inc. +# Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -738,12 +758,7 @@ AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac + MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then @@ -756,7 +771,7 @@ fi # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -785,7 +800,7 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -832,7 +847,7 @@ AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -851,7 +866,7 @@ AC_DEFUN([AM_RUN_LOG], # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -932,7 +947,7 @@ AC_CONFIG_COMMANDS_PRE( rm -f conftest.file ]) -# Copyright (C) 2009-2018 Free Software Foundation, Inc. +# Copyright (C) 2009-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -992,7 +1007,7 @@ AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1020,7 +1035,7 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2018 Free Software Foundation, Inc. +# Copyright (C) 2006-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1039,7 +1054,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2018 Free Software Foundation, Inc. +# Copyright (C) 2004-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/config.h.in b/config.h.in index c686129b5e..931b16f6f2 100644 --- a/config.h.in +++ b/config.h.in @@ -15,7 +15,7 @@ /* "build gis_utils" */ #undef ENABLE_GIS_UTILS -/* "build GRIB2 utilities" */ +/* "build GRIB2 support" */ #undef ENABLE_GRIB2 /* "build grid_stat" */ @@ -66,7 +66,7 @@ /* "build point_stat" */ #undef ENABLE_POINT_STAT -/* "build python embedding" */ +/* "build Python embedding support" */ #undef ENABLE_PYTHON /* "build regrid_data_plane" */ @@ -84,7 +84,7 @@ /* "build tc_utils" */ #undef ENABLE_TC_UTILS -/* "build unstructured grid with Atlas and eckit libraries" */ +/* "build unstructured grid support" */ #undef ENABLE_UGRID /* "build wavelet_stat" */ @@ -147,6 +147,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_H + /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H @@ -216,7 +219,9 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION -/* Define to 1 if you have the ANSI C header files. */ +/* Define to 1 if all of the C90 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ #undef STDC_HEADERS /* Version number of package */ diff --git a/configure b/configure index 2ff30f104d..b7d9098c4f 100755 --- a/configure +++ b/configure @@ -753,6 +753,8 @@ ENABLE_STATIC_LINKING_FALSE ENABLE_STATIC_LINKING_TRUE ENABLE_BLOCK4_FALSE ENABLE_BLOCK4_TRUE +ENABLE_ALL_FALSE +ENABLE_ALL_TRUE MET_FREETYPELIB MET_FREETYPEINC MET_FREETYPE @@ -888,6 +890,7 @@ enable_option_checking enable_silent_rules enable_openmp enable_dependency_tracking +enable_all enable_block4 enable_static_linking enable_ascii2nc @@ -1611,6 +1614,9 @@ Optional Features: do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build + --enable-all Enable compilation options --enable-grib2 + --enable-python --enable-ugrid --enable-lidar2nc + --enable-modis --enable-mode_graphics --disable-block4 Disable use of BLOCK4 in the compilation. Use this if you have trouble using PrepBufr files. --enable-static_linking Enable static linking of the applications @@ -1648,10 +1654,10 @@ Optional Features: Disable compilation of mode_time_domain --disable-tc_utils Disable compilation of tc_utils --disable-gsi_tools Disable compilation of gsi_tools - --enable-grib2 Enable compilation of utilities using GRIB2 - --enable-python Enable python embedding - --enable-ugrid Enable unstructured grid with Atlas and eckit - libraries + --enable-grib2 Enable compilation of GRIB2 support + --enable-python Enable compilation of Python embedding support + --enable-ugrid Enable compilation of unstructured grid support with + the Atlas and ecKit libraries Some influential environment variables: CC C compiler command @@ -1683,16 +1689,16 @@ Some influential environment variables: include files are not under the same main Atlas directory. If used, MET_ATLASINC must also be defined and MET_ATLAS will be ignored. - MET_ECKIT Where eckit lib and include subdirectories are located. If they + MET_ECKIT Where ecKit lib and include subdirectories are located. If they are installed in /usr/local, you don't have to specify them. MET_ECKITINC - Where eckit include files are located. Use if the libraries and - include files are not under the same main eckit directory. If + Where ecKit include files are located. Use if the libraries and + include files are not under the same main ecKit directory. If used, MET_ECKITLIB must also be defined and MET_ECKIT will be ignored. MET_ECKITLIB - Where eckit libraries are located. Use if the libraries and - include files are not under the same main eckit directory. If + Where ecKit libraries are located. Use if the libraries and + include files are not under the same main ecKit directory. If used, MET_ECKITINC must also be defined and MET_ECKIT will be ignored. MET_NETCDF Where netcdf lib and include subdirectories are located. If they @@ -1734,14 +1740,14 @@ Some influential environment variables: -lgrib2c_v1.6.0 or -lgrib2c, etc. If it is -lgrib2c, you don't have to specify it. MET_PYTHON_BIN_EXE - Full path to the python executable corresponding to + Full path to the Python executable corresponding to MET_PYTHON_CC and MET_PYTHON_LD, e.g. /usr/bin/python3. MET_PYTHON_CC - Where the python header files are located, e.g. -I. + Where the Python header files are located, e.g. -I. Set to the output of 'python3-config --cflags'. MET_PYTHON_LD - Where the python library files are located, e.g. -L, - followed by the python library names, e.g. -l. Set to + Where the Python library files are located, e.g. -L, + followed by the Python library names, e.g. -l. Set to the output of 'python3-config --ldflags'. MET_GSL Where gsl lib and include subdirectories are located. If they are installed in /usr/local, you don't have to specify them. @@ -5370,8 +5376,13 @@ fi # AC_SUBST command line variables. +if (test -n "$MET_ATLASLIB"); then + CPPFLAGS="${CPPFLAGS} -I${MET_ATLASINC}" + LDFLAGS="${LDFLAGS} -L${MET_ATLASLIB}" +fi + # -# Look for the Eckit library. +# Look for the ecKit library. # # Configure the variables. The help text will appear if the user uses "configure --help". @@ -5397,6 +5408,11 @@ fi # AC_SUBST command line variables. +if (test -n "$MET_ECKITLIB"); then + CPPFLAGS="${CPPFLAGS} -I${MET_ECKITINC}" + LDFLAGS="${LDFLAGS} -L${MET_ECKITLIB}" +fi + # # Look for the NetCDF library. # @@ -5734,6 +5750,35 @@ fi # Process any enable flags specified by the user # +# Enable all compilation options + +# Check whether --enable-all was given. +if test ${enable_all+y} +then : + enableval=$enable_all; case "${enableval}" in + yes | no ) ENABLE_ALL="${enableval}" ;; + *) as_fn_error $? "bad value ${enableval} for --enable-all" "$LINENO" 5 ;; + esac +else $as_nop + ENABLE_ALL="no" + +fi + + + if test "x$ENABLE_ALL" = "xyes"; then + ENABLE_ALL_TRUE= + ENABLE_ALL_FALSE='#' +else + ENABLE_ALL_TRUE='#' + ENABLE_ALL_FALSE= +fi + + +if test "x$ENABLE_ALL" = "xyes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: all options will be compiled" >&5 +printf "%s\n" "$as_me: all options will be compiled" >&6;} +fi + # BLOCK4 # Check whether --enable-block4 was given. @@ -5842,7 +5887,7 @@ if test ${enable_lidar2nc+y} then : enableval=$enable_lidar2nc; case "${enableval}" in yes | no ) ENABLE_LIDAR2NC="${enableval}" ;; - *) as_fn_error $? "bad value ${enableval} for --disable-lidar2nc" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-lidar2nc" "$LINENO" 5 ;; esac else $as_nop ENABLE_LIDAR2NC="no" @@ -5850,7 +5895,7 @@ else $as_nop fi - if test "x$ENABLE_LIDAR2NC" = "xyes"; then + if test "x$ENABLE_LIDAR2NC" = "xyes" || test "x$ENABLE_ALL" = "xyes"; then ENABLE_LIDAR2NC_TRUE= ENABLE_LIDAR2NC_FALSE='#' else @@ -5859,7 +5904,7 @@ else fi -if test "x$ENABLE_LIDAR2NC" = "xyes"; then +if test "x$ENABLE_LIDAR2NC" = "xyes" || test "x$ENABLE_ALL" = "xyes"; then printf "%s\n" "#define ENABLE_LIDAR2NC /**/" >>confdefs.h @@ -6615,7 +6660,7 @@ if test ${enable_modis+y} then : enableval=$enable_modis; case "${enableval}" in yes | no ) ENABLE_MODIS="${enableval}" ;; - *) as_fn_error $? "bad value ${enableval} for --disable-modis" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-modis" "$LINENO" 5 ;; esac else $as_nop ENABLE_MODIS="no" @@ -6623,7 +6668,7 @@ else $as_nop fi - if test "x$ENABLE_MODIS" = "xyes"; then + if test "x$ENABLE_MODIS" = "xyes" || test "x$ENABLE_ALL" = "xyes"; then ENABLE_MODIS_TRUE= ENABLE_MODIS_FALSE='#' else @@ -6632,7 +6677,7 @@ else fi -if test "x$ENABLE_MODIS" = "xyes"; then +if test "x$ENABLE_MODIS" = "xyes" || test "x$ENABLE_ALL" = "xyes"; then printf "%s\n" "#define ENABLE_MODIS /**/" >>confdefs.h @@ -6658,7 +6703,7 @@ else $as_nop fi - if test "x$ENABLE_MODE_GRAPHICS" = "xyes"; then + if test "x$ENABLE_MODE_GRAPHICS" = "xyes" || test "x$ENABLE_ALL" = "xyes"; then ENABLE_MODE_GRAPHICS_TRUE= ENABLE_MODE_GRAPHICS_FALSE='#' else @@ -6667,7 +6712,7 @@ else fi -if test "x$ENABLE_MODE_GRAPHICS" = "xyes"; then +if test "x$ENABLE_MODE_GRAPHICS" = "xyes" || test "x$ENABLE_ALL" = "xyes"; then printf "%s\n" "#define ENABLE_MODE_GRAPHICS /**/" >>confdefs.h @@ -6798,7 +6843,7 @@ else $as_nop fi - if test "x$ENABLE_GRIB2" = "xyes"; then + if test "x$ENABLE_GRIB2" = "xyes" || test "x$ENABLE_ALL" = "xyes"; then ENABLE_GRIB2_TRUE= ENABLE_GRIB2_FALSE='#' else @@ -6815,12 +6860,12 @@ else fi -if test "x$ENABLE_GRIB2" = "xyes"; then +if test "x$ENABLE_GRIB2" = "xyes" || test "x$ENABLE_ALL" = "xyes"; then printf "%s\n" "#define ENABLE_GRIB2 /**/" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: GRIB2 utilites will be compiled" >&5 -printf "%s\n" "$as_me: GRIB2 utilites will be compiled" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: GRIB2 support will be compiled" >&5 +printf "%s\n" "$as_me: GRIB2 support will be compiled" >&6;} CPPFLAGS="${CPPFLAGS} -DWITH_GRIB2" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: GRIB2CLIB_NAME will be set" >&5 @@ -6833,8 +6878,8 @@ printf "%s\n" "$as_me: GRIB2CLIB_NAME will be set" >&6;} GRIB2_DEP_LIBS="${GRIB2CLIB_NAME} -ljasper -lpng -lz" fi else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: GRIB2 utilities will not be compiled" >&5 -printf "%s\n" "$as_me: GRIB2 utilities will not be compiled" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: GRIB2 support will not be compiled" >&5 +printf "%s\n" "$as_me: GRIB2 support will not be compiled" >&6;} GRIB2_MET_LIBS= GRIB2_DEP_LIBS= fi @@ -6856,7 +6901,7 @@ else $as_nop fi - if test "x$ENABLE_PYTHON" = "xyes"; then + if test "x$ENABLE_PYTHON" = "xyes" || test "x$ENABLE_ALL" = "xyes"; then ENABLE_PYTHON_TRUE= ENABLE_PYTHON_FALSE='#' else @@ -6865,18 +6910,18 @@ else fi -if test "x$ENABLE_PYTHON" = "xyes"; then +if test "x$ENABLE_PYTHON" = "xyes" || test "x$ENABLE_ALL" = "xyes"; then printf "%s\n" "#define ENABLE_PYTHON /**/" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: python embedding will be compiled" >&5 -printf "%s\n" "$as_me: python embedding will be compiled" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Python embedding support will be compiled" >&5 +printf "%s\n" "$as_me: Python embedding support will be compiled" >&6;} CPPFLAGS="${CPPFLAGS} -DWITH_PYTHON" PYTHON_MET_LIBS="-lvx_data2d_python -lvx_pointdata_python -lvx_python3_utils" PYTHON_DEP_LIBS="${MET_PYTHON_LD}" else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: python embedding will not be compiled" >&5 -printf "%s\n" "$as_me: python embedding will not be compiled" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Python embedding support will not be compiled" >&5 +printf "%s\n" "$as_me: Python embedding support will not be compiled" >&6;} PYTHON_MET_LIBS= PYTHON_DEP_LIBS= fi @@ -6898,7 +6943,7 @@ else $as_nop fi - if test "x$ENABLE_UGRID" = "xyes"; then + if test "x$ENABLE_UGRID" = "xyes" || test "x$ENABLE_ALL" = "xyes"; then ENABLE_UGRID_TRUE= ENABLE_UGRID_FALSE='#' else @@ -6907,19 +6952,18 @@ else fi -if test "x$ENABLE_UGRID" = "xyes"; then +if test "x$ENABLE_UGRID" = "xyes" || test "x$ENABLE_ALL" = "xyes"; then printf "%s\n" "#define ENABLE_UGRID /**/" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: unstructured grid will be compiled" >&5 -printf "%s\n" "$as_me: unstructured grid will be compiled" >&6;} - CPPFLAGS="${CPPFLAGS} -I${MET_ATLASINC} -I${MET_ECKITINC} -DWITH_UGRID" - LDFLAGS="${LDFLAGS} -L${MET_ATLASLIB} -L${MET_ECKITLIB} -Wl,-rpath,${MET_ATLASLIB}:${MET_ECKITLIB}" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: unstructured grid support will be compiled" >&5 +printf "%s\n" "$as_me: unstructured grid support will be compiled" >&6;} + CPPFLAGS="${CPPFLAGS} -DWITH_UGRID" UGRID_MET_LIBS="-lvx_data2d_ugrid" UGRID_DEP_LIBS="-latlas -leckit -leckit_mpi -leckit_geometry" else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: unstructured grid will not be compiled" >&5 -printf "%s\n" "$as_me: unstructured grid will not be compiled" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: unstructured grid support will not be compiled" >&5 +printf "%s\n" "$as_me: unstructured grid support will not be compiled" >&6;} UGRID_MET_LIBS= UGRID_DEP_LIBS= fi @@ -10093,7 +10137,7 @@ ac_config_files="$ac_config_files Makefile scripts/Rscripts/Makefile scripts/Rsc if test -n "$MET_DEVELOPMENT"; then - ac_config_files="$ac_config_files src/tools/dev_utils/Makefile src/tools/dev_utils/shapefiles/Makefile internal/test_util/Makefile internal/test_util/basic/Makefile internal/test_util/basic/vx_config/Makefile internal/test_util/basic/vx_log/Makefile internal/test_util/basic/vx_util/Makefile internal/test_util/libcode/Makefile internal/test_util/libcode/vx_data2d/Makefile internal/test_util/libcode/vx_data2d_factory/Makefile internal/test_util/libcode/vx_data2d_grib/Makefile internal/test_util/libcode/vx_data2d_nc_met/Makefile internal/test_util/libcode/vx_data2d_nccf/Makefile internal/test_util/libcode/vx_geodesy/Makefile internal/test_util/libcode/vx_grid/Makefile internal/test_util/libcode/vx_plot_util/Makefile internal/test_util/libcode/vx_ps/Makefile internal/test_util/libcode/vx_tc_util/Makefile internal/test_util/libcode/vx_nc_util/Makefile internal/test_util/libcode/vx_physics/Makefile internal/test_util/libcode/vx_series_data/Makefile internal/test_util/libcode/vx_solar/Makefile internal/test_util/tools/Makefile internal/test_util/tools/other/Makefile internal/test_util/tools/other/mode_time_domain/Makefile" + ac_config_files="$ac_config_files src/tools/dev_utils/Makefile src/tools/dev_utils/shapefiles/Makefile internal/test_util/Makefile internal/test_util/basic/Makefile internal/test_util/basic/vx_config/Makefile internal/test_util/basic/vx_log/Makefile internal/test_util/basic/vx_util/Makefile internal/test_util/libcode/Makefile internal/test_util/libcode/vx_data2d/Makefile internal/test_util/libcode/vx_data2d_factory/Makefile internal/test_util/libcode/vx_data2d_grib/Makefile internal/test_util/libcode/vx_data2d_nc_met/Makefile internal/test_util/libcode/vx_data2d_nccf/Makefile internal/test_util/libcode/vx_geodesy/Makefile internal/test_util/libcode/vx_grid/Makefile internal/test_util/libcode/vx_plot_util/Makefile internal/test_util/libcode/vx_ps/Makefile internal/test_util/libcode/vx_tc_util/Makefile internal/test_util/libcode/vx_nc_util/Makefile internal/test_util/libcode/vx_python3_utils/Makefile internal/test_util/libcode/vx_physics/Makefile internal/test_util/libcode/vx_series_data/Makefile internal/test_util/libcode/vx_solar/Makefile internal/test_util/tools/Makefile internal/test_util/tools/other/Makefile internal/test_util/tools/other/mode_time_domain/Makefile" fi @@ -10234,6 +10278,10 @@ if test -z "${BUFRLIB_NAME_SET_TRUE}" && test -z "${BUFRLIB_NAME_SET_FALSE}"; th as_fn_error $? "conditional \"BUFRLIB_NAME_SET\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${ENABLE_ALL_TRUE}" && test -z "${ENABLE_ALL_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_ALL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${ENABLE_BLOCK4_TRUE}" && test -z "${ENABLE_BLOCK4_FALSE}"; then as_fn_error $? "conditional \"ENABLE_BLOCK4\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -11106,6 +11154,7 @@ do "internal/test_util/libcode/vx_ps/Makefile") CONFIG_FILES="$CONFIG_FILES internal/test_util/libcode/vx_ps/Makefile" ;; "internal/test_util/libcode/vx_tc_util/Makefile") CONFIG_FILES="$CONFIG_FILES internal/test_util/libcode/vx_tc_util/Makefile" ;; "internal/test_util/libcode/vx_nc_util/Makefile") CONFIG_FILES="$CONFIG_FILES internal/test_util/libcode/vx_nc_util/Makefile" ;; + "internal/test_util/libcode/vx_python3_utils/Makefile") CONFIG_FILES="$CONFIG_FILES internal/test_util/libcode/vx_python3_utils/Makefile" ;; "internal/test_util/libcode/vx_physics/Makefile") CONFIG_FILES="$CONFIG_FILES internal/test_util/libcode/vx_physics/Makefile" ;; "internal/test_util/libcode/vx_series_data/Makefile") CONFIG_FILES="$CONFIG_FILES internal/test_util/libcode/vx_series_data/Makefile" ;; "internal/test_util/libcode/vx_solar/Makefile") CONFIG_FILES="$CONFIG_FILES internal/test_util/libcode/vx_solar/Makefile" ;; diff --git a/configure.ac b/configure.ac index f56c2aedaa..f7b2a73453 100644 --- a/configure.ac +++ b/configure.ac @@ -74,15 +74,20 @@ fi # AC_SUBST command line variables. +if (test -n "$MET_ATLASLIB"); then + CPPFLAGS="${CPPFLAGS} -I${MET_ATLASINC}" + LDFLAGS="${LDFLAGS} -L${MET_ATLASLIB}" +fi + # -# Look for the Eckit library. +# Look for the ecKit library. # # Configure the variables. The help text will appear if the user uses "configure --help". -AC_ARG_VAR([MET_ECKIT], [Where eckit lib and include subdirectories are located. If they are installed in /usr/local, you don't have to specify them.]) -AC_ARG_VAR([MET_ECKITINC], [Where eckit include files are located. Use if the libraries and include files are not under the same main eckit directory. If used, MET_ECKITLIB must also be defined and MET_ECKIT will be ignored.]) -AC_ARG_VAR([MET_ECKITLIB], [Where eckit libraries are located. Use if the libraries and include files are not under the same main eckit directory. If used, MET_ECKITINC must also be defined and MET_ECKIT will be ignored.]) +AC_ARG_VAR([MET_ECKIT], [Where ecKit lib and include subdirectories are located. If they are installed in /usr/local, you don't have to specify them.]) +AC_ARG_VAR([MET_ECKITINC], [Where ecKit include files are located. Use if the libraries and include files are not under the same main ecKit directory. If used, MET_ECKITLIB must also be defined and MET_ECKIT will be ignored.]) +AC_ARG_VAR([MET_ECKITLIB], [Where ecKit libraries are located. Use if the libraries and include files are not under the same main ecKit directory. If used, MET_ECKITINC must also be defined and MET_ECKIT will be ignored.]) # Ensure that both or neither are specified. @@ -101,6 +106,11 @@ fi # AC_SUBST command line variables. +if (test -n "$MET_ECKITLIB"); then + CPPFLAGS="${CPPFLAGS} -I${MET_ECKITINC}" + LDFLAGS="${LDFLAGS} -L${MET_ECKITLIB}" +fi + # # Look for the NetCDF library. # @@ -204,9 +214,9 @@ fi # Configure the variables. The help text will appear if the user uses "configure --help". -AC_ARG_VAR([MET_PYTHON_BIN_EXE], [Full path to the python executable corresponding to MET_PYTHON_CC and MET_PYTHON_LD, e.g. /usr/bin/python3.]) -AC_ARG_VAR([MET_PYTHON_CC], [Where the python header files are located, e.g. -I. Set to the output of 'python3-config --cflags'.]) -AC_ARG_VAR([MET_PYTHON_LD], [Where the python library files are located, e.g. -L, followed by the python library names, e.g. -l. Set to the output of 'python3-config --ldflags'.]) +AC_ARG_VAR([MET_PYTHON_BIN_EXE], [Full path to the Python executable corresponding to MET_PYTHON_CC and MET_PYTHON_LD, e.g. /usr/bin/python3.]) +AC_ARG_VAR([MET_PYTHON_CC], [Where the Python header files are located, e.g. -I. Set to the output of 'python3-config --cflags'.]) +AC_ARG_VAR([MET_PYTHON_LD], [Where the Python library files are located, e.g. -L, followed by the Python library names, e.g. -l. Set to the output of 'python3-config --ldflags'.]) # Ensure that all or none are specified. @@ -430,6 +440,23 @@ fi # Process any enable flags specified by the user # +# Enable all compilation options + +AC_ARG_ENABLE(all, + [AS_HELP_STRING([--enable-all], [Enable compilation options --enable-grib2 --enable-python --enable-ugrid --enable-lidar2nc --enable-modis --enable-mode_graphics])], + [case "${enableval}" in + yes | no ) ENABLE_ALL="${enableval}" ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-all) ;; + esac], + [ENABLE_ALL="no"] +) + +AM_CONDITIONAL([ENABLE_ALL], [test "x$ENABLE_ALL" = "xyes"]) + +if test "x$ENABLE_ALL" = "xyes"; then + AC_MSG_NOTICE([all options will be compiled]) +fi + # BLOCK4 AC_ARG_ENABLE(block4, @@ -496,14 +523,14 @@ AC_ARG_ENABLE(lidar2nc, [AS_HELP_STRING([--enable-lidar2nc], [Enable compilation of lidar2nc])], [case "${enableval}" in yes | no ) ENABLE_LIDAR2NC="${enableval}" ;; - *) AC_MSG_ERROR(bad value ${enableval} for --disable-lidar2nc) ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-lidar2nc) ;; esac], [ENABLE_LIDAR2NC="no"] ) -AM_CONDITIONAL([ENABLE_LIDAR2NC], [test "x$ENABLE_LIDAR2NC" = "xyes"]) +AM_CONDITIONAL([ENABLE_LIDAR2NC], [test "x$ENABLE_LIDAR2NC" = "xyes" || test "x$ENABLE_ALL" = "xyes"]) -if test "x$ENABLE_LIDAR2NC" = "xyes"; then +if test "x$ENABLE_LIDAR2NC" = "xyes" || test "x$ENABLE_ALL" = "xyes"; then AC_DEFINE([ENABLE_LIDAR2NC], [], ["build lidar2nc"]) AC_MSG_NOTICE([lidar2nc will be compiled]) else @@ -939,14 +966,14 @@ AC_ARG_ENABLE(modis, [AS_HELP_STRING([--enable-modis], [Enable compilation of modis])], [case "${enableval}" in yes | no ) ENABLE_MODIS="${enableval}" ;; - *) AC_MSG_ERROR(bad value ${enableval} for --disable-modis) ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-modis) ;; esac], [ENABLE_MODIS="no"] ) -AM_CONDITIONAL([ENABLE_MODIS], [test "x$ENABLE_MODIS" = "xyes"]) +AM_CONDITIONAL([ENABLE_MODIS], [test "x$ENABLE_MODIS" = "xyes" || test "x$ENABLE_ALL" = "xyes"]) -if test "x$ENABLE_MODIS" = "xyes"; then +if test "x$ENABLE_MODIS" = "xyes" || test "x$ENABLE_ALL" = "xyes"; then AC_DEFINE([ENABLE_MODIS], [], ["build modis"]) AC_MSG_NOTICE([modis will be compiled]) else @@ -964,9 +991,9 @@ AC_ARG_ENABLE(mode_graphics, [ENABLE_MODE_GRAPHICS="no"] ) -AM_CONDITIONAL([ENABLE_MODE_GRAPHICS], [test "x$ENABLE_MODE_GRAPHICS" = "xyes"]) +AM_CONDITIONAL([ENABLE_MODE_GRAPHICS], [test "x$ENABLE_MODE_GRAPHICS" = "xyes" || test "x$ENABLE_ALL" = "xyes"]) -if test "x$ENABLE_MODE_GRAPHICS" = "xyes"; then +if test "x$ENABLE_MODE_GRAPHICS" = "xyes" || test "x$ENABLE_ALL" = "xyes"; then AC_DEFINE([ENABLE_MODE_GRAPHICS], [], ["build mode_graphics"]) AC_MSG_NOTICE([mode_graphics will be compiled]) else @@ -1036,7 +1063,7 @@ fi # GRIB2 AC_ARG_ENABLE(grib2, - [AS_HELP_STRING([--enable-grib2], [Enable compilation of utilities using GRIB2])], + [AS_HELP_STRING([--enable-grib2], [Enable compilation of GRIB2 support])], [case "${enableval}" in yes | no ) ENABLE_GRIB2="${enableval}" ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-grib2) ;; @@ -1044,12 +1071,12 @@ AC_ARG_ENABLE(grib2, [ENABLE_GRIB2="no"] ) -AM_CONDITIONAL([ENABLE_GRIB2], [test "x$ENABLE_GRIB2" = "xyes"]) +AM_CONDITIONAL([ENABLE_GRIB2], [test "x$ENABLE_GRIB2" = "xyes" || test "x$ENABLE_ALL" = "xyes"]) AM_CONDITIONAL([GRIB2CLIB_NAME_SET], [test ! -z "$GRIB2CLIB_NAME"]) -if test "x$ENABLE_GRIB2" = "xyes"; then - AC_DEFINE([ENABLE_GRIB2], [], ["build GRIB2 utilities"]) - AC_MSG_NOTICE([GRIB2 utilites will be compiled]) +if test "x$ENABLE_GRIB2" = "xyes" || test "x$ENABLE_ALL" = "xyes"; then + AC_DEFINE([ENABLE_GRIB2], [], ["build GRIB2 support"]) + AC_MSG_NOTICE([GRIB2 support will be compiled]) CPPFLAGS="${CPPFLAGS} -DWITH_GRIB2" AC_SUBST([GRIB2CLIB_NAME]) AC_MSG_NOTICE([GRIB2CLIB_NAME will be set]) @@ -1061,7 +1088,7 @@ if test "x$ENABLE_GRIB2" = "xyes"; then GRIB2_DEP_LIBS="${GRIB2CLIB_NAME} -ljasper -lpng -lz" fi else - AC_MSG_NOTICE([GRIB2 utilities will not be compiled]) + AC_MSG_NOTICE([GRIB2 support will not be compiled]) GRIB2_MET_LIBS= GRIB2_DEP_LIBS= fi @@ -1071,7 +1098,7 @@ AC_SUBST([GRIB2_DEP_LIBS]) # Python AC_ARG_ENABLE(python, - [AS_HELP_STRING([--enable-python], [Enable python embedding])], + [AS_HELP_STRING([--enable-python], [Enable compilation of Python embedding support])], [case "${enableval}" in yes | no ) ENABLE_PYTHON="${enableval}" ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-python) ;; @@ -1079,16 +1106,16 @@ AC_ARG_ENABLE(python, [ENABLE_PYTHON="no"] ) -AM_CONDITIONAL([ENABLE_PYTHON], [test "x$ENABLE_PYTHON" = "xyes"]) +AM_CONDITIONAL([ENABLE_PYTHON], [test "x$ENABLE_PYTHON" = "xyes" || test "x$ENABLE_ALL" = "xyes"]) -if test "x$ENABLE_PYTHON" = "xyes"; then - AC_DEFINE([ENABLE_PYTHON], [], ["build python embedding"]) - AC_MSG_NOTICE([python embedding will be compiled]) +if test "x$ENABLE_PYTHON" = "xyes" || test "x$ENABLE_ALL" = "xyes"; then + AC_DEFINE([ENABLE_PYTHON], [], ["build Python embedding support"]) + AC_MSG_NOTICE([Python embedding support will be compiled]) CPPFLAGS="${CPPFLAGS} -DWITH_PYTHON" PYTHON_MET_LIBS="-lvx_data2d_python -lvx_pointdata_python -lvx_python3_utils" PYTHON_DEP_LIBS="${MET_PYTHON_LD}" else - AC_MSG_NOTICE([python embedding will not be compiled]) + AC_MSG_NOTICE([Python embedding support will not be compiled]) PYTHON_MET_LIBS= PYTHON_DEP_LIBS= fi @@ -1098,7 +1125,7 @@ AC_SUBST([PYTHON_DEP_LIBS]) # Unstructure grid with ECMF libraries (Atlas/ecKit) AC_ARG_ENABLE(ugrid, - [AS_HELP_STRING([--enable-ugrid], [Enable unstructured grid with Atlas and eckit libraries])], + [AS_HELP_STRING([--enable-ugrid], [Enable compilation of unstructured grid support with the Atlas and ecKit libraries])], [case "${enableval}" in yes | no ) ENABLE_UGRID="${enableval}" ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-ugrid) ;; @@ -1106,17 +1133,16 @@ AC_ARG_ENABLE(ugrid, [ENABLE_UGRID="no"] ) -AM_CONDITIONAL([ENABLE_UGRID], [test "x$ENABLE_UGRID" = "xyes"]) +AM_CONDITIONAL([ENABLE_UGRID], [test "x$ENABLE_UGRID" = "xyes" || test "x$ENABLE_ALL" = "xyes"]) -if test "x$ENABLE_UGRID" = "xyes"; then - AC_DEFINE([ENABLE_UGRID], [], ["build unstructured grid with Atlas and eckit libraries"]) - AC_MSG_NOTICE([unstructured grid will be compiled]) - CPPFLAGS="${CPPFLAGS} -I${MET_ATLASINC} -I${MET_ECKITINC} -DWITH_UGRID" - LDFLAGS="${LDFLAGS} -L${MET_ATLASLIB} -L${MET_ECKITLIB} -Wl,-rpath,${MET_ATLASLIB}:${MET_ECKITLIB}" +if test "x$ENABLE_UGRID" = "xyes" || test "x$ENABLE_ALL" = "xyes"; then + AC_DEFINE([ENABLE_UGRID], [], ["build unstructured grid support"]) + AC_MSG_NOTICE([unstructured grid support will be compiled]) + CPPFLAGS="${CPPFLAGS} -DWITH_UGRID" UGRID_MET_LIBS="-lvx_data2d_ugrid" UGRID_DEP_LIBS="-latlas -leckit -leckit_mpi -leckit_geometry" else - AC_MSG_NOTICE([unstructured grid will not be compiled]) + AC_MSG_NOTICE([unstructured grid support will not be compiled]) UGRID_MET_LIBS= UGRID_DEP_LIBS= fi @@ -1386,6 +1412,7 @@ if test -n "$MET_DEVELOPMENT"; then internal/test_util/libcode/vx_ps/Makefile internal/test_util/libcode/vx_tc_util/Makefile internal/test_util/libcode/vx_nc_util/Makefile + internal/test_util/libcode/vx_python3_utils/Makefile internal/test_util/libcode/vx_physics/Makefile internal/test_util/libcode/vx_series_data/Makefile internal/test_util/libcode/vx_solar/Makefile diff --git a/docs/Users_Guide/config_options.rst b/docs/Users_Guide/config_options.rst index 521ff451a8..9ff10893df 100644 --- a/docs/Users_Guide/config_options.rst +++ b/docs/Users_Guide/config_options.rst @@ -1084,7 +1084,19 @@ File-format specific settings for the "field" entry: * The "GRIB2_perc_val" is an integer specifying the requested percentile value (0 to 100) to be used. This applies only to GRIB2 product definition templates 4.6 and 4.10. - + + * The "GRIB2_aerosol_type" is an integer specifying the aerosol type + (Table 4.233). This applies only to GRIB2 product defintion templates + 4.46 and 4.48. + + * The "GRIB2_aerosol_interval_type" is an integer specifying the aerosol + size interval (Table 4.91). This applies only to GRIB2 product defintion + templates 4.46 and 4.48. + + * The "GRIB2_aerosol_size_lower" and "GRIB2_aerosol_size_upper" are doubles + specifying the endpoints of the aerosol size interval. These applies only + to GRIB2 product defintion templates 4.46 and 4.48. + * The "GRIB2_ipdtmpl_index" and "GRIB2_ipdtmpl_val" entries are arrays of integers which specify the product description template values to be used. The indices are 0-based. For example, use the following to diff --git a/docs/Users_Guide/ensemble-stat.rst b/docs/Users_Guide/ensemble-stat.rst index bb6b70b879..42443aa315 100644 --- a/docs/Users_Guide/ensemble-stat.rst +++ b/docs/Users_Guide/ensemble-stat.rst @@ -304,7 +304,7 @@ __________________ } -The **obs_error** dictionary controls how observation error information should be handled. This dictionary may be set separately for each **obs.field** entry. Observation error information can either be specified directly in the configuration file or by parsing information from an external table file. By default, the **MET_BASE/data/table_files/obs_error_table.txt** file is read but this may be overridden by setting the **$MET_OBS_ERROR_TABLE** environment variable at runtime. +The **obs_error** dictionary controls how observation error information should be handled. This dictionary may be set separately for each **obs.field** entry. Observation error information can either be specified directly in the configuration file or by parsing information from an external table file. By default, the **MET_BASE/share/met/table_files/obs_error_table.txt** file is read but this may be overridden by setting the **$MET_OBS_ERROR_TABLE** environment variable at runtime. The **flag** entry toggles the observation error logic on (**TRUE**) and off (**FALSE**). When the **flag** is **TRUE**, random observation error perturbations are applied to the ensemble member values. No perturbation is applied to the observation values but the bias scale and offset values, if specified, are applied. diff --git a/docs/Users_Guide/installation.rst b/docs/Users_Guide/installation.rst index a8c743f9e6..668da2f71d 100644 --- a/docs/Users_Guide/installation.rst +++ b/docs/Users_Guide/installation.rst @@ -124,7 +124,7 @@ MET Directory Structure The top-level MET directory consists of Makefiles, configuration files, and several subdirectories. The top-level Makefile and configuration files control how the entire toolkit is built. Instructions for using these files to build MET can be found in :numref:`Install_Building-the-MET`. -When MET has been successfully built and installed, the installation directory contains two subdirectories. The *bin/* directory contains executables for each module of MET as well as several plotting utilities. The *share/met/* directory contains many subdirectories with data required at runtime and a subdirectory of sample R scripts utilities. The *colortables/*, *map/*, and *ps/* subdirectories contain data used in creating PostScript plots for several MET tools. The *poly/* subdirectory contains predefined lat/lon polyline regions for use in selecting regions over which to verify. The polylines defined correspond to verification regions used by NCEP as described in :numref:`Appendix B, Section %s `. The *config/* directory contains default configuration files for the MET tools. The *python/* subdirectory contains python scripts. The *python/examples* subdirectory contains sample scripts used in Python embedding (:numref:`Appendix F, Section %s `). The *python/pyembed/* subdirectory contains code used in Python embedding (:numref:`Appendix F, Section %s `). The *table_files/* and *tc_data/* subdirectories contain GRIB table definitions and tropical cyclone data, respectively. The *Rscripts/* subdirectory contains a handful of plotting graphic utilities for MET-TC. These are the same Rscripts that reside under the top-level MET *scripts/Rscripts* directory, other than it is the installed location. +When MET has been successfully built and installed, the installation directory contains two subdirectories. The *bin/* directory contains executables for each module of MET as well as several plotting utilities. The *share/met/* directory contains many subdirectories with data required at runtime and a subdirectory of sample R scripts utilities. The *colortables/*, *map/*, and *ps/* subdirectories contain data used in creating PostScript plots for several MET tools. The *poly/* subdirectory contains predefined lat/lon polyline regions for use in selecting regions over which to verify. The polylines defined correspond to verification regions used by NCEP as described in :numref:`Appendix B, Section %s `. The *config/* directory contains default configuration files for the MET tools. The *python/* subdirectory contains Python scripts. The *python/examples* subdirectory contains sample scripts used in Python embedding (:numref:`Appendix F, Section %s `). The *python/pyembed/* subdirectory contains code used in Python embedding (:numref:`Appendix F, Section %s `). The *table_files/* and *tc_data/* subdirectories contain GRIB table definitions and tropical cyclone data, respectively. The *Rscripts/* subdirectory contains a handful of plotting graphic utilities for MET-TC. These are the same Rscripts that reside under the top-level MET *scripts/Rscripts* directory, other than it is the installed location. The *data/* directory contains several configuration and static data files used by MET. The *sample_fcst/* and *sample_obs/* subdirectories contain sample data used by the test scripts provided in the *scripts/* directory. @@ -205,7 +205,7 @@ The following environment variables should also be set: * If compiling support for GRIB2, set $MET_GRIB2CINC and $MET_GRIB2CLIB to point to the main GRIB2C directory which contains both the include and library files. These are used instead of $MET_GRIB2C since the main GRIB2C directory does not contain include and lib subdirectories. -* If compiling support for PYTHON, set $MET_PYTHON_BIN_EXE to specify the desired python executable to be used. Also set $MET_PYTHON_CC, and $MET_PYTHON_LD to specify the compiler (-I) and linker (-L) flags required for python. Set $MET_PYTHON_CC for the directory containing the "Python.h" header file. Set $MET_PYTHON_LD for the directory containing the python library file and indicate the name of that file. For example: +* If compiling support for PYTHON, set $MET_PYTHON_BIN_EXE to specify the desired Python executable to be used. Also set $MET_PYTHON_CC, and $MET_PYTHON_LD to specify the compiler (-I) and linker (-L) flags required for Python. Set $MET_PYTHON_CC for the directory containing the "Python.h" header file. Set $MET_PYTHON_LD for the directory containing the Python library file and indicate the name of that file. For example: .. code-block:: none @@ -215,24 +215,26 @@ The following environment variables should also be set: Note that this version of Python must include support for a minimum set of required packages. For more information about Python support in MET, including the list of required packages, please refer to :numref:`Appendix F, Section %s `. +* If compiling support for unstructured grids, specify the location of the Atlas and ecKit libraries. Set $MET_ATLAS to point to the main Atlas directory, or set $MET_ATLASINC to point to the directory with the Atlas include files and set $MET_ATLASLIB to point to the directory with the Atlas library files. Set $MET_ECKIT to point to the main ecKit directory, or set $MET_ECKITINC to point to the directory with the ecKit include files and set $MET_ECKITLIB to point to the directory with the ecKit library files. * If compiling MODIS-Regrid and/or lidar2nc, set $MET_HDF to point to the main HDF4 directory, or set $MET_HDFINC to point to the directory with the HDF4 include files and set $MET_HDFLIB to point to the directory with the HDF4 library files. Also, set $MET_HDFEOS to point to the main HDF EOS directory, or set $MET_HDFEOSINC to point to the directory with the HDF EOS include files and set $MET_HDFEOSLIB to point to the directory with the HDF EOS library files. * If compiling MODE Graphics, set $MET_CAIRO to point to the main Cairo directory, or set$MET_CAIROINC to point to the directory with the Cairo include files and set $MET_CAIROLIB to point to the directory with the Cairo library files. Also, set $MET_FREETYPE to point to the main FreeType directory, or set $MET_FREETYPEINC to point to the directory with the FreeType include files and set $MET_FREETYPELIB to point to the directory with the FreeType library files. -* When running MODE Graphics, set $MET_FONT_DIR to the directory containing font data required at runtime. A link to the tarball containing this font data can be found on the MET website. +* When running MODE Graphics, set $MET_FONT_DIR to the directory containing font data required at runtime. A link to the tarball containing this font data can be found on the MET website. -For ease of use, you should define these in your .cshrc or equivalent file. +For ease of use, you should define these in your .cshrc, .bashrc, or equivalent file. Configure and Execute the Build ------------------------------- -Example: To configure MET to install all of the available tools in the "bin" subdirectory of your current directory, you would use the following commands: +Example: To configure MET to install all of the available tools and options in the "bin" subdirectory of your current directory, you would use the following commands: .. code-block:: none - 1. ./configure --prefix=`pwd` --enable-grib2 --enable-python \ - --enable-modis --enable-mode_graphics --enable-lidar2nc + 1. Type './configure --prefix=`pwd` --enable-all' + Note that --enable-all is equivalent to specifying: + --enable-grib2 --enable-python --enable-ugrid --enable-modis --enable-mode_graphics --enable-lidar2nc 2. Type 'make install >& make_install.log &' 3. Type 'tail -f make_install.log' to view the execution of the make. 4. When make is finished, type 'CTRL-C' to quit the tail. @@ -270,6 +272,7 @@ If all tools are enabled and the build is successful, the "*/bin*" direc - series_analysis - shift_data_plane - stat_analysis + - tc_diag - tc_dland - tc_gen - tc_pairs @@ -291,23 +294,35 @@ The configure script has command line options to specify where to install MET an By default, MET will install all the files in "*/usr/local/bin*". You can specify an installation prefix other than "*/usr/local*" using "--prefix", for instance "--prefix=$HOME" or "--prefix=`pwd`". +.. code-block:: none + + --enable-all + +Enable the configuration options --enable-grib2, --enable-python, --enable-ugrid, --enable-lidar2nc, --enable-mode_graphics, and --enable-modis, described below. + .. code-block:: none --enable-grib2 -Enable compilation of utilities using GRIB2. Requires $MET_GRIB2C. +Enable compilation of GRIB2 support. Requires $MET_GRIB2C. .. code-block:: none --enable-python -Enable compilation of python interface. Requires $MET_PYTHON_CC and $MET_PYTHON_LD. +Enable compilation of Python embedding support. Requires $MET_PYTHON_CC and $MET_PYTHON_LD. + +.. code-block:: none + + --enable-ugrid + +Enable compilation of unstructured grid support. Requires $MET_ATLAS and $MET_ECKIT. .. code-block:: none --enable-lidar2nc -Enable compilation of utilities using the LIDAR2NC tool. +Enable compilation of the LIDAR2NC tool. Requires $MET_HDF. .. code-block:: none diff --git a/internal/scripts/docker/build_met_docker.sh b/internal/scripts/docker/build_met_docker.sh index f8f008f5e1..3d7b827494 100755 --- a/internal/scripts/docker/build_met_docker.sh +++ b/internal/scripts/docker/build_met_docker.sh @@ -10,6 +10,12 @@ if [ -z ${MET_GIT_NAME+x} ]; then echo "Setting MET_GIT_NAME=${MET_GIT_NAME} based on the current branch." fi +# Check whether MET_CONFIG_OPTS is defined +if [ -z ${MET_CONFIG_OPTS+x} ]; then + MET_CONFIG_OPTS='--enable-all' + echo "Setting MET_CONFIG_OPTS=${MET_CONFIG_OPTS} to compile all available options." +fi + # Create log directory mkdir -p /met/logs @@ -19,7 +25,7 @@ echo "Running bootstrap for MET ${MET_GIT_NAME} and writing log file ${LOG_FILE} echo "Configuring MET ${MET_GIT_NAME} and appending to log file ${LOG_FILE}" ./configure \ BUFRLIB_NAME=${BUFRLIB_NAME} GRIB2CLIB_NAME=${GRIB2CLIB_NAME} \ - --enable-grib2 --enable-mode_graphics --enable-modis --enable-lidar2nc --enable-python --enable-ugrid \ + ${MET_CONFIG_OPTS} \ CPPFLAGS="-I/usr/local/include -I/usr/local/include/freetype2 -I/usr/local/include/cairo" \ LIBS="-ltirpc" >> ${LOG_FILE} 2>&1 if [ $? != 0 ]; then diff --git a/internal/scripts/environment/development.seneca b/internal/scripts/environment/development.seneca index cc623c8d95..7007241362 100644 --- a/internal/scripts/environment/development.seneca +++ b/internal/scripts/environment/development.seneca @@ -1,34 +1,35 @@ # Define the development environment for NCAR project machine seneca -# Based on settings in /usr/local/src/met/README.snat +# Based on settings in /nrit/ral/src/met/README.ral-it # Top-level MET project directory MET_PROJ_DIR=/d1/projects/MET # Variables required to build MET export MET_DEVELOPMENT=true -export MET_DST=/usr/local +export MET_DST=/nrit/ral export MET_PROJ=${MET_DST}/proj-9.2.1 -export MET_NETCDF=${MET_DST}/netcdf-4.7.0/gcc-8.3.0 -export MET_HDF5=${MET_DST}/hdf5-1.8.21 -export MET_HDFINC=${MET_DST}/hdf4-4.2.15/include/hdf -export MET_HDFLIB=${MET_DST}/hdf4-4.2.15/lib -export MET_HDFEOS=${MET_DST}/hdf-eos2-20v1 -export MET_BUFR=${MET_DST} -export MET_GRIB2C=${MET_DST} -export MET_GSL=${MET_PROJ_DIR}/MET_releases/external_libs/gnu_8.3.0 +export MET_NETCDF=${MET_DST}/netcdf-4.9.2/gnu-12.2.0 +export MET_HDF5=${MET_DST}/hdf5-1.14.2 +export MET_HDFINC=${MET_DST}/hdf4-4.2.16-2/include/hdf +export MET_HDFLIB=${MET_DST}/hdf4-4.2.16-2/lib +export MET_HDFEOS=${MET_DST}/hdf-eos2-3.0 +export MET_BUFR=${MET_DST}/nceplibs-1.4.0/bufr-12.0.1 +export MET_GRIB2C=${MET_DST}/nceplibs-1.4.0/g2c-1.6.2 +export MET_GSLINC=/usr/include +export MET_GSLLIB=/usr/lib/x86_64-linux-gnu export MET_CAIROINC=/usr/include/cairo export MET_CAIROLIB=/usr/lib/x86_64-linux-gnu export MET_FREETYPEINC=/usr/include/freetype2 export MET_FREETYPELIB=/usr/lib/x86_64-linux-gnu -export MET_JASPER=${MET_DST}/jasper-1.900.1 -export MET_ATLAS=${MET_PROJ_DIR}/MET_releases/external_libs/gnu_8.3.0/atlas -export MET_ECKIT=${MET_PROJ_DIR}/MET_releases/external_libs/gnu_8.3.0/eckit +export MET_ATLAS=${MET_DST}/atlas-0.30.0 +export MET_ECKIT=${MET_DST}/eckit-1.20.2 +export JASPER=${MET_DST}/jasper-1.900.1 # For Python 3 in met-9.0 -export MET_PYTHON=/usr/local/met-python3 -export MET_PYTHON_BIN_EXE=${MET_PYTHON}/bin/python3.8 -export MET_PYTHON_CC="-I${MET_PYTHON}/include/python3.8" -export MET_PYTHON_LD="-L${MET_PYTHON}/lib -lpython3.8 -lcrypt -lpthread -ldl -lutil -lm" +export MET_PYTHON=${MET_DST}/met-python3 +export MET_PYTHON_BIN_EXE=${MET_PYTHON}/bin/python3.10 +export MET_PYTHON_CC="-I${MET_PYTHON}/include/python3.10" +export MET_PYTHON_LD="-L${MET_PYTHON}/lib -lpython3.10 -lcrypt -lpthread -ldl -lutil -lm" # -D__64BIT__ is required because we've compiled libgrib2c.a with that flag export CFLAGS="-DUNDERSCORE -fPIC -D__64BIT__ -g" @@ -37,21 +38,24 @@ export CXXFLAGS=${CFLAGS} # Set LDFLAGS to include -rpath settings when compiling MET export LDFLAGS="-Wl,--disable-new-dtags" export LDFLAGS="${LDFLAGS} -Wl,-rpath,${MET_DST}/lib:${MET_HDFEOS}/lib:${MET_PROJ}/lib:${MET_NETCDF}/lib:${MET_DST}/zlib-1.2.11/lib:${MET_DST}/szip-2.1.1/lib" -export LDFLAGS="${LDFLAGS} -Wl,-rpath,${MET_HDFLIB}:${MET_HDF5}/lib:${MET_GSL}/lib:${MET_PYTHON}/lib:${MET_JASPER}/lib" -export LDFLAGS="${LDFLAGS} -L${MET_JASPER}/lib" +export LDFLAGS="${LDFLAGS} -Wl,-rpath,${MET_HDFLIB}:${MET_HDF5}/lib:${MET_GSL}/lib:${MET_PYTHON}/lib:${JASPER}/lib" +export LDFLAGS="${LDFLAGS} -L${JASPER}/lib -Wl,-rpath,${MET_ATLAS}/lib -Wl,-rpath,${MET_ECKIT}/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/local/R-4.1.2/bin/Rscript +export MET_TEST_RSCRIPT=/nrit/ral/R-4.3.1/bin/Rscript + +# Define runtime Python version +export MET_TEST_MET_PYTHON_EXE=${MET_PYTHON_BIN_EXE} # This is a cron script -- create the shell environment for this job # - NCO is for ncdiff # - NetCDF is for ncdump. -export PATH="/usr/local/nco/bin:/usr/local/netcdf/bin:\ - /usr/local/sbin:/usr/local/bin:/usr/sbin:\ +export PATH="/nrit/ral/nco/bin:/nrit/ral/netcdf4/bin:\ + /nrit/ral/sbin:/nrit/ral/bin:/usr/sbin:\ /usr/bin:/sbin:/bin:/usr/bin/X11:/opt/bin:$PATH" # SonarQube diff --git a/internal/scripts/installation/compile_MET_all.sh b/internal/scripts/installation/compile_MET_all.sh index 4cd2d40950..f06b6c5c6c 100755 --- a/internal/scripts/installation/compile_MET_all.sh +++ b/internal/scripts/installation/compile_MET_all.sh @@ -725,7 +725,7 @@ if [ $COMPILE_NETCDF -eq 1 ]; then echo "cd `pwd`" configure_lib_args="" if [[ $machine == "Mac" ]]; then - configure_lib_args="-lhdf5_hl -lhdf5 -lz" + configure_lib_args="-lnetcdf -lhdf5_hl -lhdf5 -lz" fi run_cmd "./configure --prefix=${LIB_DIR} LDFLAGS=-L${LIB_DIR}/lib CPPFLAGS=-I${LIB_DIR}/include LIBS=\"${LIBS} ${configure_lib_args}\" > netcdf-cxx.configure.log 2>&1" diff --git a/internal/scripts/installation/config/install_met_env.acorn_py3.10 b/internal/scripts/installation/config/install_met_env.acorn_py3.10 index 1c77fafe93..930323e5c8 100644 --- a/internal/scripts/installation/config/install_met_env.acorn_py3.10 +++ b/internal/scripts/installation/config/install_met_env.acorn_py3.10 @@ -11,7 +11,15 @@ module load libpng/1.6.37 module load gsl/2.7 module load g2c/1.6.4 module load proj/7.1.0 +module use /apps/dev/lmodules/intel/19.1.3.304 +module load atlas/0.30.0 +module load eckit/1.20.2 +export FC=ifort +export F77=ifort +export F90=ifort +export CC=icc +export CXX=icpc export TEST_BASE=/apps/sw_review/emc/MET/12.0.0 export LIB_DIR=${TEST_BASE}/external_libs export COMPILER=intel_19.1.3.304 @@ -31,11 +39,12 @@ export MET_GRIB2CLIB=/apps/ops/prod/libs/intel/19.1.3.304/g2c/1.6.4/lib64 export MET_GRIB2CINC=/apps/ops/prod/libs/intel/19.1.3.304/g2c/1.6.4/include export MET_GSL=/apps/spack/gsl/2.7/intel/19.1.3.304/xks7dxbowrdxhjck5zxc4rompopocevb export MET_PROJ=/apps/spack/proj/7.1.0/intel/19.1.3.304/cjbmc7tacv5qcfatslqmcrzo5kb4raaq/ +export MET_ATLAS=/apps/dev/intel-19.1.3.304/cray-mpich-8.1.9/atlas/0.30.0 +export MET_ECKIT=/apps/dev/intel-19.1.3.304/cray-mpich-8.1.9/eckit/1.20.2 export BUFRLIB_NAME=-lbufr_4 export GRIB2CLIB_NAME=-lg2c export LIB_JASPER=/apps/spack/jasper/2.0.25/intel/19.1.3.304/sjib74krrorkyczqpqah4tvewmlnqdx4/lib64 export LIB_LIBPNG=/apps/spack/libpng/1.6.37/intel/19.1.3.304/4ohkronuhlyherusoszzrmur5ewvlwzh/lib export LIB_Z=/apps/spack/zlib/1.2.11/intel/19.1.3.304/hjotqkckeoyt6j6tibalwzrlfljcjtdh/lib -export SET_D64BIT=FALSE export export MAKE_ARGS=-j export CXXFLAGS="-std=c++11" diff --git a/internal/scripts/installation/config/install_met_env.generic b/internal/scripts/installation/config/install_met_env.generic index 5c6c5f42d0..b001f069c0 100644 --- a/internal/scripts/installation/config/install_met_env.generic +++ b/internal/scripts/installation/config/install_met_env.generic @@ -36,7 +36,9 @@ export MET_PYTHON_CC=`python3-config --cflags` # Use MAKE_ARGS to sped up the compilation of the external libaries and/or MET # MAKE_ARGS can be set "-j #" where # is replaced with the number of # cores to use (as an integer) or to simply "-j" to use all available cores. -export MAKE_ARGS=-j +# Recommend setting to "-j 5" as some users have experienced problems with +# higher values or no # specified. +export MAKE_ARGS="-j 5" # If users have already installed these libraries and would like to make use of # them, uncomment out the export statements. If those pre-existing libraries are @@ -44,23 +46,32 @@ export MAKE_ARGS=-j # that have the pre-existing libraries not in the external_libs directory will # need to update the paths to the appropriate location. #export EXTERNAL_LIBS=${TEST_BASE}/external_libs +#export MET_PROJ=${EXTERNAL_LIBS} +#export SQLITE_INCLUDE_DIR=${EXTERNAL_LIBS}/include +#export SQLITE_LIB_DIR=${EXTERNAL_LIBS}/lib #export MET_GSL=${EXTERNAL_LIBS} #export MET_BUFRLIB=${EXTERNAL_LIBS}/lib -#export BUFRLIB_NAME=-lbufr +#export BUFRLIB_NAME=-lbufr_4 #export LIB_JASPER=${EXTERNAL_LIBS}/lib #export LIB_LIBPNG=${EXTERNAL_LIBS}/lib #export LIB_Z=${EXTERNAL_LIBS}/lib #export MET_GRIB2CLIB=${EXTERNAL_LIBS}/lib #export MET_GRIB2CINC=${EXTERNAL_LIBS}/include -#export GRIB2CLIB_NAME=-lgrib2c +#export GRIB2CLIB_NAME=-lg2c #export MET_HDF5=${EXTERNAL_LIBS} #export MET_NETCDF=${EXTERNAL_LIBS} +#export MET_ECKIT==${EXTERNAL_LIBS} +#export MET_ATLAS==${EXTERNAL_LIBS} -# The optional libraries HDF4, HDFEOS, FREETYPE, and CAIRO are used for the -# following, not widely used tools: MODIS-Regrid, lidar2nc, and MODE Graphics. -# To enable the compilation of these libraries, set the compilation flags for -# the library (e.g. COMPILE_HDF, COMPILE_HDFEOS, COMPILE_CAIRO, -# COMPILE_FREETYPE) to any value in the environment config file. If these -# libraries have already been installed and don't need to be reinstalled, set -# MET_HDF, MET_HDFEOS, MET_FREETYPEINC, MET_FREETYPELIB, MET_CAIROINC, -# and MET_CAIROLIB to their installed locations. +# The optional libraries ecKit and atlas offer support for unstructured +# grids. The optional libraries HDF4, HDFEOS, FREETYPE, and CAIRO are +# used for the following, not widely used tools, MODIS-Regrid, +# lidar2nc, and MODE Graphics. To enable building of these libraries, +# set the compile flags for the library (e.g. COMPILE_ECKIT, COMPILE_ATLAS, +# COMPILE_HDF, COMPILE_HDFEOS) to any value in the environment config +# file. If these libraries have already been installed and don't need +# to be reinstalled, please supply values for the following environment +# variables in the input environment configuration file +# (install_met_env.): MET_ECKIT, MET_ATLAS, MET_HDF, +# MET_HDFEOS, MET_FREETYPEINC, MET_FREETYPELIB, MET_CAIROINC, +# MET_CAIROLIB. diff --git a/internal/scripts/installation/config/install_met_env.wcoss2_py3.10 b/internal/scripts/installation/config/install_met_env.wcoss2_py3.10 index d9e3af44c2..f2f29e57df 100644 --- a/internal/scripts/installation/config/install_met_env.wcoss2_py3.10 +++ b/internal/scripts/installation/config/install_met_env.wcoss2_py3.10 @@ -12,7 +12,15 @@ module load libpng/1.6.37 module load gsl/2.7 module load g2c/1.6.4 module load proj/7.1.0 +module use /apps/dev/lmodules/intel/19.1.3.304/ +module load atlas/0.30.0 +module load eckit/1.20.2 +export FC=ifort +export F77=ifort +export F90=ifort +export CC=icc +export CXX=icpc #export TEST_BASE=/apps/ops/para/libs/intel/19.1.3.304/met/12.0.0-beta1 export TEST_BASE=$(pwd) export LIB_DIR=${TEST_BASE}/external_libs @@ -37,6 +45,10 @@ export MET_GRIB2CLIB=${g2c_ROOT}/lib64 export MET_GRIB2CINC=${G2C_INC} export MET_GSL=/apps/spack/gsl/2.7/intel/19.1.3.304/xks7dxbowrdxhjck5zxc4rompopocevb export MET_PROJ=/apps/spack/proj/7.1.0/intel/19.1.3.304/cjbmc7tacv5qcfatslqmcrzo5kb4raaq +export MET_ATLASLIB=/apps/dev/intel-19.1.3.304/cray-mpich-8.1.9/atlas/0.30.0/lib64 +export MET_ATLASINC=/apps/dev/intel-19.1.3.304/cray-mpich-8.1.9/atlas/0.30.0/include/atlas +export MET_ECKITLIB=/apps/dev/intel-19.1.3.304/cray-mpich-8.1.9/eckit/1.20.2/lib64 +export MET_ECKITINC=/apps/dev/intel-19.1.3.304/cray-mpich-8.1.9/eckit/1.20.2/include/eckit export BUFRLIB_NAME=-lbufr_4 export GRIB2CLIB_NAME=-lg2c # JY export LIB_JASPER=/apps/spack/jasper/2.0.25/intel/19.1.3.304/sjib74krrorkyczqpqah4tvewmlnqdx4/lib64 @@ -45,6 +57,5 @@ export LIB_JASPER=${JASPER_LIBDIR} export LIB_LIBPNG=${LIBPNG_LIBDIR} # JY export LIB_Z=/apps/spack/zlib/1.2.11/intel/19.1.3.304/hjotqkckeoyt6j6tibalwzrlfljcjtdh/lib export LIB_Z=${ZLIB_LIBDIR} -export SET_D64BIT=FALSE export MAKE_ARGS=-j export CXXFLAGS="-std=c++11" diff --git a/internal/scripts/sonarqube/python.sonar-project.properties b/internal/scripts/sonarqube/python.sonar-project.properties index 90d2843c06..f304a07204 100644 --- a/internal/scripts/sonarqube/python.sonar-project.properties +++ b/internal/scripts/sonarqube/python.sonar-project.properties @@ -3,6 +3,7 @@ sonar.projectName=MET python Nightly Build sonar.projectVersion=1.0 sonar.sources=scripts/python,data/wrappers +sonar.python.version=3.6.3 # The build-wrapper output dir @@ -11,7 +12,7 @@ sonar.sourceEncoding=UTF-8 #----- Default SonarQube server #sonar.host.url=http://localhost:9000 -sonar.host.url=http://needham.rap.ucar.edu:9000 +sonar.host.url=SONAR_SERVER_URL -sonar.login=squ_dc703a41ce76b4c421b7e68dc79c6d211272900d +sonar.token=SONAR_TOKEN_VALUE sonar.branch.name=develop diff --git a/internal/scripts/sonarqube/run_nightly.sh b/internal/scripts/sonarqube/run_nightly.sh index 5efd86c9bd..76164cc657 100755 --- a/internal/scripts/sonarqube/run_nightly.sh +++ b/internal/scripts/sonarqube/run_nightly.sh @@ -20,9 +20,9 @@ #======================================================================= # Constants -#EMAIL_LIST="johnhg@ucar.edu hsoh@ucar.edu jpresto@ucar.edu linden@ucar.edu mccabe@ucar.edu" -EMAIL_LIST="hsoh@ucar.edu" +EMAIL_LIST="hsoh@ucar.edu" # overridden by $MET_CRON_EMAIL_LIST_MET or $MET_CRON_EMAIL_LIST KEEP_DAYS=5 +GIT_REPO_NAME=MET function usage { echo @@ -65,8 +65,12 @@ LOGFILE=${RUN_DIR}/run_sonarqube_${TODAY}.log # Run scan and check for bad return status ${SCRIPT_DIR}/run_sonarqube.sh ${1} > ${LOGFILE} if [[ $? -ne 0 ]]; then - echo "$0: The nightly SonarQube scan FAILED in `basename ${RUN_DIR}`." >> ${LOGFILE} - cat ${LOGFILE} | mail -s "MET SonarQube scan Failed for ${1} in `basename ${RUN_DIR}` (autogen msg)" ${EMAIL_LIST} + my_cmd="echo \$MET_CRON_EMAIL_LIST_${GIT_REPO_NAME}" + _EMAIL_LIST="$(eval $my_cmd)" + [ -z "$_EMAIL_LIST" ] && _EMAIL_LIST="$MET_CRON_EMAIL_LIST" + [ -z "$_EMAIL_LIST" ] && _EMAIL_LIST="$EMAIL_LIST" + echo "$0: The nightly SonarQube scanning for $GIT_REPO_NAME FAILED in `basename ${RUN_DIR}`." >> ${LOGFILE} + cat ${LOGFILE} | mail -s "$GIT_REPO_NAME SonarQube scanning failed for ${1} in `basename ${RUN_DIR}` (autogen msg)" ${_EMAIL_LIST} exit 1 fi diff --git a/internal/scripts/sonarqube/run_sonarqube.sh b/internal/scripts/sonarqube/run_sonarqube.sh index 491c8b6cea..31264f2f9b 100755 --- a/internal/scripts/sonarqube/run_sonarqube.sh +++ b/internal/scripts/sonarqube/run_sonarqube.sh @@ -20,7 +20,8 @@ #======================================================================= # Constants -GIT_REPO="https://github.com/dtcenter/MET" +[ -z "$GIT_REPO_NAME" ] && GIT_REPO_NAME=MET +GIT_REPO="https://github.com/dtcenter/${GIT_REPO_NAME}" function usage { echo @@ -34,36 +35,35 @@ if [[ $# -lt 1 ]]; then usage; exit; fi # Check that SONARQUBE_WRAPPER_BIN is defined if [ -z ${SONARQUBE_WRAPPER_BIN} ]; then - which build-wrapper-linux-x86-64 2> /dev/null - if [ $? -eq 0 ]; then - SONARQUBE_WRAPPER_BIN=$(which build-wrapper-linux-x86-64 2> /dev/null) - else - which build-wrapper 2> /dev/null - if [ $? -eq 0 ]; then - SONARQUBE_WRAPPER_BIN=$(which build-wrapper 2> /dev/null) - else + SONAR_WRAPPER=$(which build-wrapper-linux-x86-64 2> /dev/null) + if [ $? -ne 0 ]; then + SONAR_WRAPPER=$(which build-wrapper 2> /dev/null) + if [ $? -ne 0 ]; then echo "ERROR: SONARQUBE_WRAPPER_BIN must be set" exit 1 fi fi +else + SONAR_WRAPPER=${SONARQUBE_WRAPPER_BIN}/build-wrapper-linux-x86-64 fi -if [ ! -e ${SONARQUBE_WRAPPER_BIN} ]; then - echo "ERROR: SONARQUBE_WRAPPER_BIN (${SONARQUBE_WRAPPER_BIN}) does not exist" +if [ ! -e ${SONAR_WRAPPER} ]; then + echo "ERROR: ${SONAR_WRAPPER} does not exist" exit 1 fi # Check that SONARQUBE_SCANNER_BIN is defined +SCANNER_NAME=sonar-scanner if [ -z ${SONARQUBE_SCANNER_BIN} ]; then - which sonar-scanner 2> /dev/null - if [ $? -eq 0 ]; then - SONARQUBE_SCANNER_BIN=$(which sonar-scanner 2> /dev/null) - else + SONAR_SCANNER=$(which $SCANNER_NAME 2> /dev/null) + if [ $? -ne 0 ]; then echo "ERROR: SONARQUBE_SCANNER_BIN must be set" exit 1 fi +else + SONAR_SCANNER=${SONARQUBE_SCANNER_BIN}/$SCANNER_NAME fi -if [ ! -e ${SONARQUBE_SCANNER_BIN} ]; then - echo "ERROR: SONARQUBE_SCANNER_BIN (${SONARQUBE_SCANNER_BIN}) does not exist" +if [ ! -e $SONAR_SCANNER ]; then + echo "ERROR: SONAR_SCANNER (${SONAR_SCANNER}) does not exist" exit 1 fi @@ -116,7 +116,8 @@ run_command "./configure --prefix=`pwd` \ --enable-modis \ --enable-mode_graphics \ --enable-lidar2nc \ - --enable-python" + --enable-python \ + --enable-ugrid" # Set the build id #BUILD_ID="MET-${1}" @@ -125,23 +126,31 @@ SONAR_PROPERTIES=sonar-project.properties # Copy sonar-project.properties for Python code [ -e $SONAR_PROPERTIES ] && rm $SONAR_PROPERTIES -cp -p $SCRIPT_DIR/python.sonar-project.properties $SONAR_PROPERTIES +[ -z "$SONAR_SERVER_URL" ] && SONAR_SERVER_URL="http://localhost:9000" +if [ -z "$SONAR_TOKEN_VALUE" ]; then + echo " == ERROR == SONAR_TOKEN_VALUE is not defined" + exit 1 +else + sed -e "s|SONAR_TOKEN_VALUE|$SONAR_TOKEN_VALUE|" -e "s|SONAR_SERVER_URL|$SONAR_SERVER_URL|" $SCRIPT_DIR/python.sonar-project.properties > $SONAR_PROPERTIES -# Run SonarQube scan for Python code -run_command "${SONARQUBE_SCANNER_BIN}/sonar-scanner" + # Run SonarQube scan for Python code + run_command "$SONAR_SCANNER" -# Copy sonar-project.properties for C/C++ code -[ -e $SONAR_PROPERTIES ] && rm $SONAR_PROPERTIES -cp -p $SCRIPT_DIR/$SONAR_PROPERTIES . + # Copy sonar-project.properties for C/C++ code + [ -e $SONAR_PROPERTIES ] && rm $SONAR_PROPERTIES + sed -e "s|SONAR_TOKEN_VALUE|$SONAR_TOKEN_VALUE|" -e "s|SONAR_SERVER_URL|$SONAR_SERVER_URL|" $SCRIPT_DIR/sonar-project.properties > $SONAR_PROPERTIES -# Run SonarQube clean -run_command "make clean" + # Run SonarQube clean + run_command "make clean" -# Run SonarQube make -run_command "${SONARQUBE_WRAPPER_BIN}/build-wrapper-linux-x86-64 --out-dir $SONARQUBE_OUT_DIR make" + # Run SonarQube make + run_command "$SONAR_WRAPPER --out-dir $SONARQUBE_OUT_DIR make" -# Run SonarQube scan for C/C++ code -run_command "${SONARQUBE_SCANNER_BIN}/sonar-scanner" + # Run SonarQube scan for C/C++ code + run_command "$SONAR_SCANNER" + + [ -e $SONAR_PROPERTIES ] && rm $SONAR_PROPERTIES +fi # Run SonarQube report generator to make a PDF file #TODAY=`date +%Y%m%d` diff --git a/internal/scripts/sonarqube/sonar-project.properties b/internal/scripts/sonarqube/sonar-project.properties index 96db8de7dd..ec39576c4f 100644 --- a/internal/scripts/sonarqube/sonar-project.properties +++ b/internal/scripts/sonarqube/sonar-project.properties @@ -12,7 +12,7 @@ sonar.sourceEncoding=UTF-8 #----- Default SonarQube server #sonar.host.url=http://localhost:9000 -sonar.host.url=http://needham.rap.ucar.edu:9000 +sonar.host.url=SONAR_SERVER_URL -sonar.login=squ_dc703a41ce76b4c421b7e68dc79c6d211272900d +sonar.token=SONAR_TOKEN_VALUE sonar.branch.name=develop diff --git a/internal/test_unit/R_test/test_util.R b/internal/test_unit/R_test/test_util.R index 7d83360ecd..3d4a2d3f9b 100644 --- a/internal/test_unit/R_test/test_util.R +++ b/internal/test_unit/R_test/test_util.R @@ -696,7 +696,7 @@ compareNc = function(nc1, nc2, verb, strict=0, delta=-1, comp_var=0){ } # build and run the ncdiff command - strCmd = paste(strNcDiffExec, " -x -v time_bounds \\\n ", nc1, " \\\n ", nc2, " \\\n ", strNcDiff, sep=""); + strCmd = paste(strNcDiffExec, " -C -x -v time_bounds \\\n ", nc1, " \\\n ", nc2, " \\\n ", strNcDiff, sep=""); if( 2 <= verb ){ cat("NCDIFF:", strCmd, "\n"); } strCmdOut = system(paste(strCmd, "2>&1"), intern=T); diff --git a/internal/test_unit/xml/unit_plot_data_plane.xml b/internal/test_unit/xml/unit_plot_data_plane.xml index e9e5ae965f..86709b0621 100644 --- a/internal/test_unit/xml/unit_plot_data_plane.xml +++ b/internal/test_unit/xml/unit_plot_data_plane.xml @@ -564,4 +564,21 @@ + + &MET_BIN;/plot_data_plane + \ + &DATA_DIR_MODEL;/grib2/rrfs/rrfs.t00z.prslev.f036.conus_3km.MASSDEN.grib2 \ + &OUTPUT_DIR;/plot_data_plane/RRFS_GRIB2_TABLE_4.48_MASSDEN.ps \ + 'name="MASSDEN"; level="Z8"; \ + GRIB2_aerosol_type=62001; \ + GRIB2_aerosol_interval_type=0; \ + GRIB2_aerosol_size_lower=2.5e-06;' \ + -title "Mass Density of Dry Dust up to 2.5e-06" \ + -v 1 + + + &OUTPUT_DIR;/plot_data_plane/RRFS_GRIB2_TABLE_4.48_MASSDEN.ps + + + diff --git a/internal/test_util/libcode/Makefile.am b/internal/test_util/libcode/Makefile.am index 64403c660a..e05a0595fc 100644 --- a/internal/test_util/libcode/Makefile.am +++ b/internal/test_util/libcode/Makefile.am @@ -31,4 +31,8 @@ SUBDIRS = vx_data2d \ vx_physics \ vx_series_data +if ENABLE_PYTHON + SUBDIRS += vx_python3_utils +endif + MAINTAINERCLEANFILES = Makefile.in diff --git a/internal/test_util/libcode/Makefile.in b/internal/test_util/libcode/Makefile.in index d83ed27ca1..2f708a52b2 100644 --- a/internal/test_util/libcode/Makefile.in +++ b/internal/test_util/libcode/Makefile.in @@ -87,6 +87,7 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +@ENABLE_PYTHON_TRUE@am__append_1 = vx_python3_utils subdir = internal/test_util/libcode ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac @@ -149,7 +150,10 @@ am__define_uniq_tagged_files = \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -DIST_SUBDIRS = $(SUBDIRS) +DIST_SUBDIRS = vx_data2d vx_data2d_grib vx_data2d_nc_met \ + vx_data2d_nccf vx_data2d_factory vx_geodesy vx_grid vx_ps \ + vx_solar vx_plot_util vx_tc_util vx_nc_util vx_physics \ + vx_series_data vx_python3_utils am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ @@ -335,21 +339,10 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUBDIRS = vx_data2d \ - vx_data2d_grib \ - vx_data2d_nc_met \ - vx_data2d_nccf \ - vx_data2d_factory \ - vx_geodesy \ - vx_grid \ - vx_ps \ - vx_solar \ - vx_plot_util \ - vx_tc_util \ - vx_nc_util \ - vx_physics \ - vx_series_data - +SUBDIRS = vx_data2d vx_data2d_grib vx_data2d_nc_met vx_data2d_nccf \ + vx_data2d_factory vx_geodesy vx_grid vx_ps vx_solar \ + vx_plot_util vx_tc_util vx_nc_util vx_physics vx_series_data \ + $(am__append_1) MAINTAINERCLEANFILES = Makefile.in all: all-recursive diff --git a/internal/test_util/libcode/vx_data2d/Makefile.am b/internal/test_util/libcode/vx_data2d/Makefile.am index 1759c4087c..72359847c8 100644 --- a/internal/test_util/libcode/vx_data2d/Makefile.am +++ b/internal/test_util/libcode/vx_data2d/Makefile.am @@ -11,7 +11,7 @@ include ${top_srcdir}/Make-include # Test programs noinst_PROGRAMS = test_table_read \ - dump_default_table + dump_default_table test_table_read_SOURCES = test_table_read.cc test_table_read_CPPFLAGS = ${MET_CPPFLAGS} diff --git a/internal/test_util/libcode/vx_python3_utils/.gitignore b/internal/test_util/libcode/vx_python3_utils/.gitignore new file mode 100644 index 0000000000..8aa7461ede --- /dev/null +++ b/internal/test_util/libcode/vx_python3_utils/.gitignore @@ -0,0 +1,7 @@ +test_get +test_numpy +*.o +*.a +.deps +Makefile +*.dSYM diff --git a/internal/test_util/libcode/vx_python3_utils/Makefile.am b/internal/test_util/libcode/vx_python3_utils/Makefile.am new file mode 100644 index 0000000000..ac5c10d6c3 --- /dev/null +++ b/internal/test_util/libcode/vx_python3_utils/Makefile.am @@ -0,0 +1,37 @@ +## @start 1 +## Makefile.am -- Process this file with automake to produce Makefile.in +## @end 1 + +MAINTAINERCLEANFILES = Makefile.in + +# Include the project definitions + +include ${top_srcdir}/Make-include + +# Test programs + +noinst_PROGRAMS = test_get \ + test_numpy + +test_get_SOURCES = test_get.cc +test_get_CPPFLAGS = ${MET_CPPFLAGS} +test_get_LDFLAGS = -L. ${MET_LDFLAGS} +test_get_LDADD = \ + -lvx_python3_utils \ + -lvx_util \ + -lvx_math \ + -lvx_cal \ + -lvx_log \ + $(PYTHON_DEP_LIBS) + +test_numpy_SOURCES = test_numpy.cc +test_numpy_CPPFLAGS = ${MET_CPPFLAGS} +test_numpy_LDFLAGS = -L. ${MET_LDFLAGS} +test_numpy_LDADD = \ + -lvx_python3_utils \ + -lvx_util \ + -lvx_math \ + -lvx_cal \ + -lvx_log \ + $(PYTHON_DEP_LIBS) + diff --git a/internal/test_util/libcode/vx_python3_utils/Makefile.in b/internal/test_util/libcode/vx_python3_utils/Makefile.in new file mode 100644 index 0000000000..3d3d12cefb --- /dev/null +++ b/internal/test_util/libcode/vx_python3_utils/Makefile.in @@ -0,0 +1,672 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +noinst_PROGRAMS = test_get$(EXEEXT) test_numpy$(EXEEXT) +subdir = internal/test_util/libcode/vx_python3_utils +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +PROGRAMS = $(noinst_PROGRAMS) +am_test_get_OBJECTS = test_get-test_get.$(OBJEXT) +test_get_OBJECTS = $(am_test_get_OBJECTS) +am__DEPENDENCIES_1 = +test_get_DEPENDENCIES = $(am__DEPENDENCIES_1) +test_get_LINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ + $(test_get_LDFLAGS) $(LDFLAGS) -o $@ +am_test_numpy_OBJECTS = test_numpy-test_numpy.$(OBJEXT) +test_numpy_OBJECTS = $(am_test_numpy_OBJECTS) +test_numpy_DEPENDENCIES = $(am__DEPENDENCIES_1) +test_numpy_LINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ + $(test_numpy_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/test_get-test_get.Po \ + ./$(DEPDIR)/test_numpy-test_numpy.Po +am__mv = mv -f +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +AM_V_CXX = $(am__v_CXX_@AM_V@) +am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) +am__v_CXX_0 = @echo " CXX " $@; +am__v_CXX_1 = +CXXLD = $(CXX) +CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) +am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) +am__v_CXXLD_0 = @echo " CXXLD " $@; +am__v_CXXLD_1 = +SOURCES = $(test_get_SOURCES) $(test_numpy_SOURCES) +DIST_SOURCES = $(test_get_SOURCES) $(test_numpy_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUFRLIB_NAME = @BUFRLIB_NAME@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FC_LIBS = @FC_LIBS@ +FFLAGS = @FFLAGS@ +FLIBS = @FLIBS@ +GRIB2CLIB_NAME = @GRIB2CLIB_NAME@ +GRIB2_DEP_LIBS = @GRIB2_DEP_LIBS@ +GRIB2_MET_LIBS = @GRIB2_MET_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MET_ATLAS = @MET_ATLAS@ +MET_ATLASINC = @MET_ATLASINC@ +MET_ATLASLIB = @MET_ATLASLIB@ +MET_BUFR = @MET_BUFR@ +MET_BUFRLIB = @MET_BUFRLIB@ +MET_CAIRO = @MET_CAIRO@ +MET_CAIROINC = @MET_CAIROINC@ +MET_CAIROLIB = @MET_CAIROLIB@ +MET_ECKIT = @MET_ECKIT@ +MET_ECKITINC = @MET_ECKITINC@ +MET_ECKITLIB = @MET_ECKITLIB@ +MET_FREETYPE = @MET_FREETYPE@ +MET_FREETYPEINC = @MET_FREETYPEINC@ +MET_FREETYPELIB = @MET_FREETYPELIB@ +MET_GRIB2C = @MET_GRIB2C@ +MET_GRIB2CINC = @MET_GRIB2CINC@ +MET_GRIB2CLIB = @MET_GRIB2CLIB@ +MET_GSL = @MET_GSL@ +MET_GSLINC = @MET_GSLINC@ +MET_GSLLIB = @MET_GSLLIB@ +MET_HDF = @MET_HDF@ +MET_HDF5 = @MET_HDF5@ +MET_HDF5INC = @MET_HDF5INC@ +MET_HDF5LIB = @MET_HDF5LIB@ +MET_HDFEOS = @MET_HDFEOS@ +MET_HDFEOSINC = @MET_HDFEOSINC@ +MET_HDFEOSLIB = @MET_HDFEOSLIB@ +MET_HDFINC = @MET_HDFINC@ +MET_HDFLIB = @MET_HDFLIB@ +MET_NETCDF = @MET_NETCDF@ +MET_NETCDFINC = @MET_NETCDFINC@ +MET_NETCDFLIB = @MET_NETCDFLIB@ +MET_PROJ = @MET_PROJ@ +MET_PROJINC = @MET_PROJINC@ +MET_PROJLIB = @MET_PROJLIB@ +MET_PYTHON_BIN_EXE = @MET_PYTHON_BIN_EXE@ +MET_PYTHON_CC = @MET_PYTHON_CC@ +MET_PYTHON_LD = @MET_PYTHON_LD@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OPENMP_CFLAGS = @OPENMP_CFLAGS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PYTHON_DEP_LIBS = @PYTHON_DEP_LIBS@ +PYTHON_MET_LIBS = @PYTHON_MET_LIBS@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UGRID_DEP_LIBS = @UGRID_DEP_LIBS@ +UGRID_MET_LIBS = @UGRID_MET_LIBS@ +VERSION = @VERSION@ +YACC = @YACC@ +YFLAGS = @YFLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +MAINTAINERCLEANFILES = Makefile.in +test_get_SOURCES = test_get.cc +test_get_CPPFLAGS = ${MET_CPPFLAGS} +test_get_LDFLAGS = -L. ${MET_LDFLAGS} +test_get_LDADD = \ + -lvx_python3_utils \ + -lvx_util \ + -lvx_math \ + -lvx_cal \ + -lvx_log \ + $(PYTHON_DEP_LIBS) + +test_numpy_SOURCES = test_numpy.cc +test_numpy_CPPFLAGS = ${MET_CPPFLAGS} +test_numpy_LDFLAGS = -L. ${MET_LDFLAGS} +test_numpy_LDADD = \ + -lvx_python3_utils \ + -lvx_util \ + -lvx_math \ + -lvx_cal \ + -lvx_log \ + $(PYTHON_DEP_LIBS) + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cc .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign internal/test_util/libcode/vx_python3_utils/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign internal/test_util/libcode/vx_python3_utils/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstPROGRAMS: + -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) + +test_get$(EXEEXT): $(test_get_OBJECTS) $(test_get_DEPENDENCIES) $(EXTRA_test_get_DEPENDENCIES) + @rm -f test_get$(EXEEXT) + $(AM_V_CXXLD)$(test_get_LINK) $(test_get_OBJECTS) $(test_get_LDADD) $(LIBS) + +test_numpy$(EXEEXT): $(test_numpy_OBJECTS) $(test_numpy_DEPENDENCIES) $(EXTRA_test_numpy_DEPENDENCIES) + @rm -f test_numpy$(EXEEXT) + $(AM_V_CXXLD)$(test_numpy_LINK) $(test_numpy_OBJECTS) $(test_numpy_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_get-test_get.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_numpy-test_numpy.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.cc.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cc.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +test_get-test_get.o: test_get.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_get_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_get-test_get.o -MD -MP -MF $(DEPDIR)/test_get-test_get.Tpo -c -o test_get-test_get.o `test -f 'test_get.cc' || echo '$(srcdir)/'`test_get.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_get-test_get.Tpo $(DEPDIR)/test_get-test_get.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_get.cc' object='test_get-test_get.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_get_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_get-test_get.o `test -f 'test_get.cc' || echo '$(srcdir)/'`test_get.cc + +test_get-test_get.obj: test_get.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_get_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_get-test_get.obj -MD -MP -MF $(DEPDIR)/test_get-test_get.Tpo -c -o test_get-test_get.obj `if test -f 'test_get.cc'; then $(CYGPATH_W) 'test_get.cc'; else $(CYGPATH_W) '$(srcdir)/test_get.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_get-test_get.Tpo $(DEPDIR)/test_get-test_get.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_get.cc' object='test_get-test_get.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_get_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_get-test_get.obj `if test -f 'test_get.cc'; then $(CYGPATH_W) 'test_get.cc'; else $(CYGPATH_W) '$(srcdir)/test_get.cc'; fi` + +test_numpy-test_numpy.o: test_numpy.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_numpy_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_numpy-test_numpy.o -MD -MP -MF $(DEPDIR)/test_numpy-test_numpy.Tpo -c -o test_numpy-test_numpy.o `test -f 'test_numpy.cc' || echo '$(srcdir)/'`test_numpy.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_numpy-test_numpy.Tpo $(DEPDIR)/test_numpy-test_numpy.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_numpy.cc' object='test_numpy-test_numpy.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_numpy_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_numpy-test_numpy.o `test -f 'test_numpy.cc' || echo '$(srcdir)/'`test_numpy.cc + +test_numpy-test_numpy.obj: test_numpy.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_numpy_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_numpy-test_numpy.obj -MD -MP -MF $(DEPDIR)/test_numpy-test_numpy.Tpo -c -o test_numpy-test_numpy.obj `if test -f 'test_numpy.cc'; then $(CYGPATH_W) 'test_numpy.cc'; else $(CYGPATH_W) '$(srcdir)/test_numpy.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_numpy-test_numpy.Tpo $(DEPDIR)/test_numpy-test_numpy.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_numpy.cc' object='test_numpy-test_numpy.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_numpy_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_numpy-test_numpy.obj `if test -f 'test_numpy.cc'; then $(CYGPATH_W) 'test_numpy.cc'; else $(CYGPATH_W) '$(srcdir)/test_numpy.cc'; fi` + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-am + +clean-am: clean-generic clean-noinstPROGRAMS mostlyclean-am + +distclean: distclean-am + -rm -f ./$(DEPDIR)/test_get-test_get.Po + -rm -f ./$(DEPDIR)/test_numpy-test_numpy.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f ./$(DEPDIR)/test_get-test_get.Po + -rm -f ./$(DEPDIR)/test_numpy-test_numpy.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-generic clean-noinstPROGRAMS cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# Include the project definitions + +include ${top_srcdir}/Make-include + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/internal/test_util/libcode/vx_python3_utils/test_get.cc b/internal/test_util/libcode/vx_python3_utils/test_get.cc index eedf339389..eae1428bda 100644 --- a/internal/test_util/libcode/vx_python3_utils/test_get.cc +++ b/internal/test_util/libcode/vx_python3_utils/test_get.cc @@ -60,12 +60,12 @@ ConcatString variable_name = argv[2]; script_name.chomp(".py"); -Python3_Script script(script_name); +Python3_Script script(script_name.c_str()); PyObject * var = 0; -var = script.lookup(variable_name); +var = script.lookup(variable_name.c_str()); if ( var ) { diff --git a/internal/test_util/libcode/vx_tc_util/.gitignore b/internal/test_util/libcode/vx_tc_util/.gitignore index b5e28af92c..635d358e43 100644 --- a/internal/test_util/libcode/vx_tc_util/.gitignore +++ b/internal/test_util/libcode/vx_tc_util/.gitignore @@ -1,5 +1,6 @@ -test_read_prob test_read +test_read_prob +test_read_rmw *.o *.a .deps diff --git a/internal/test_util/libcode/vx_tc_util/Makefile.am b/internal/test_util/libcode/vx_tc_util/Makefile.am index 1aca803372..6c19dad86e 100644 --- a/internal/test_util/libcode/vx_tc_util/Makefile.am +++ b/internal/test_util/libcode/vx_tc_util/Makefile.am @@ -15,7 +15,8 @@ endif # Test programs noinst_PROGRAMS = test_read \ - test_read_prob + test_read_prob \ + test_read_rmw test_read_SOURCES = test_read.cc test_read_CPPFLAGS = ${MET_CPPFLAGS} @@ -88,3 +89,39 @@ test_read_prob_LDADD = -lvx_stat_out \ -lvx_log \ -lm -lproj -lnetcdf_c++4 -lnetcdf -lgsl -lgslcblas -lvx_util +test_read_rmw_SOURCES = test_read_rmw.cc +test_read_rmw_CPPFLAGS = ${MET_CPPFLAGS} +test_read_rmw_LDFLAGS = -L. ${MET_LDFLAGS} +test_read_rmw_LDADD = -lvx_stat_out \ + -lvx_statistics \ + -lvx_shapedata \ + -lvx_gsl_prob \ + -lvx_analysis_util \ + -lvx_tc_util \ + -lvx_shapedata \ + -lvx_util_math \ + -lvx_util \ + $(PYTHON_MET_LIBS) $(PYTHON_DEP_LIBS) \ + -lvx_statistics \ + -lvx_data2d_factory \ + -lvx_data2d_nc_met \ + -lvx_data2d_nc_pinterp \ + $(PYTHON_MET_LIBS) $(PYTHON_DEP_LIBS) \ + -lvx_data2d_nccf \ + -lvx_data2d_grib $(GRIB2_MET_LIBS) $(GRIB2_DEP_LIBS) \ + -lvx_data2d \ + -lvx_nc_util \ + -lvx_regrid \ + -lvx_grid \ + -lvx_geodesy \ + -lvx_config \ + -lvx_gsl_prob \ + -lvx_cal \ + -lvx_nav \ + -lvx_util_math \ + -lvx_util \ + -lvx_math \ + -lvx_color \ + -lvx_log \ + -lm -lproj -lnetcdf_c++4 -lnetcdf -lgsl -lgslcblas -lvx_util + diff --git a/internal/test_util/libcode/vx_tc_util/Makefile.in b/internal/test_util/libcode/vx_tc_util/Makefile.in index 9ba04b2a14..ed6e1a58d6 100644 --- a/internal/test_util/libcode/vx_tc_util/Makefile.in +++ b/internal/test_util/libcode/vx_tc_util/Makefile.in @@ -89,7 +89,8 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @ENABLE_PYTHON_TRUE@am__append_1 = -lvx_python3_utils -noinst_PROGRAMS = test_read$(EXEEXT) test_read_prob$(EXEEXT) +noinst_PROGRAMS = test_read$(EXEEXT) test_read_prob$(EXEEXT) \ + test_read_rmw$(EXEEXT) subdir = internal/test_util/libcode/vx_tc_util ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac @@ -117,6 +118,14 @@ test_read_prob_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) test_read_prob_LINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ $(test_read_prob_LDFLAGS) $(LDFLAGS) -o $@ +am_test_read_rmw_OBJECTS = test_read_rmw-test_read_rmw.$(OBJEXT) +test_read_rmw_OBJECTS = $(am_test_read_rmw_OBJECTS) +test_read_rmw_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +test_read_rmw_LINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ + $(test_read_rmw_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -133,7 +142,8 @@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/test_read-test_read.Po \ - ./$(DEPDIR)/test_read_prob-test_read_prob.Po + ./$(DEPDIR)/test_read_prob-test_read_prob.Po \ + ./$(DEPDIR)/test_read_rmw-test_read_rmw.Po am__mv = mv -f AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -152,8 +162,10 @@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = -SOURCES = $(test_read_SOURCES) $(test_read_prob_SOURCES) -DIST_SOURCES = $(test_read_SOURCES) $(test_read_prob_SOURCES) +SOURCES = $(test_read_SOURCES) $(test_read_prob_SOURCES) \ + $(test_read_rmw_SOURCES) +DIST_SOURCES = $(test_read_SOURCES) $(test_read_prob_SOURCES) \ + $(test_read_rmw_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -408,6 +420,42 @@ test_read_prob_LDADD = -lvx_stat_out \ -lvx_log \ -lm -lproj -lnetcdf_c++4 -lnetcdf -lgsl -lgslcblas -lvx_util +test_read_rmw_SOURCES = test_read_rmw.cc +test_read_rmw_CPPFLAGS = ${MET_CPPFLAGS} +test_read_rmw_LDFLAGS = -L. ${MET_LDFLAGS} +test_read_rmw_LDADD = -lvx_stat_out \ + -lvx_statistics \ + -lvx_shapedata \ + -lvx_gsl_prob \ + -lvx_analysis_util \ + -lvx_tc_util \ + -lvx_shapedata \ + -lvx_util_math \ + -lvx_util \ + $(PYTHON_MET_LIBS) $(PYTHON_DEP_LIBS) \ + -lvx_statistics \ + -lvx_data2d_factory \ + -lvx_data2d_nc_met \ + -lvx_data2d_nc_pinterp \ + $(PYTHON_MET_LIBS) $(PYTHON_DEP_LIBS) \ + -lvx_data2d_nccf \ + -lvx_data2d_grib $(GRIB2_MET_LIBS) $(GRIB2_DEP_LIBS) \ + -lvx_data2d \ + -lvx_nc_util \ + -lvx_regrid \ + -lvx_grid \ + -lvx_geodesy \ + -lvx_config \ + -lvx_gsl_prob \ + -lvx_cal \ + -lvx_nav \ + -lvx_util_math \ + -lvx_util \ + -lvx_math \ + -lvx_color \ + -lvx_log \ + -lm -lproj -lnetcdf_c++4 -lnetcdf -lgsl -lgslcblas -lvx_util + all: all-am .SUFFIXES: @@ -453,6 +501,10 @@ test_read_prob$(EXEEXT): $(test_read_prob_OBJECTS) $(test_read_prob_DEPENDENCIES @rm -f test_read_prob$(EXEEXT) $(AM_V_CXXLD)$(test_read_prob_LINK) $(test_read_prob_OBJECTS) $(test_read_prob_LDADD) $(LIBS) +test_read_rmw$(EXEEXT): $(test_read_rmw_OBJECTS) $(test_read_rmw_DEPENDENCIES) $(EXTRA_test_read_rmw_DEPENDENCIES) + @rm -f test_read_rmw$(EXEEXT) + $(AM_V_CXXLD)$(test_read_rmw_LINK) $(test_read_rmw_OBJECTS) $(test_read_rmw_LDADD) $(LIBS) + mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -461,6 +513,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_read-test_read.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_read_prob-test_read_prob.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_read_rmw-test_read_rmw.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @@ -510,6 +563,20 @@ test_read_prob-test_read_prob.obj: test_read_prob.cc @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_read_prob_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_read_prob-test_read_prob.obj `if test -f 'test_read_prob.cc'; then $(CYGPATH_W) 'test_read_prob.cc'; else $(CYGPATH_W) '$(srcdir)/test_read_prob.cc'; fi` +test_read_rmw-test_read_rmw.o: test_read_rmw.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_read_rmw_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_read_rmw-test_read_rmw.o -MD -MP -MF $(DEPDIR)/test_read_rmw-test_read_rmw.Tpo -c -o test_read_rmw-test_read_rmw.o `test -f 'test_read_rmw.cc' || echo '$(srcdir)/'`test_read_rmw.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_read_rmw-test_read_rmw.Tpo $(DEPDIR)/test_read_rmw-test_read_rmw.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_read_rmw.cc' object='test_read_rmw-test_read_rmw.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_read_rmw_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_read_rmw-test_read_rmw.o `test -f 'test_read_rmw.cc' || echo '$(srcdir)/'`test_read_rmw.cc + +test_read_rmw-test_read_rmw.obj: test_read_rmw.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_read_rmw_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test_read_rmw-test_read_rmw.obj -MD -MP -MF $(DEPDIR)/test_read_rmw-test_read_rmw.Tpo -c -o test_read_rmw-test_read_rmw.obj `if test -f 'test_read_rmw.cc'; then $(CYGPATH_W) 'test_read_rmw.cc'; else $(CYGPATH_W) '$(srcdir)/test_read_rmw.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_read_rmw-test_read_rmw.Tpo $(DEPDIR)/test_read_rmw-test_read_rmw.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='test_read_rmw.cc' object='test_read_rmw-test_read_rmw.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_read_rmw_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test_read_rmw-test_read_rmw.obj `if test -f 'test_read_rmw.cc'; then $(CYGPATH_W) 'test_read_rmw.cc'; else $(CYGPATH_W) '$(srcdir)/test_read_rmw.cc'; fi` + ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am @@ -636,6 +703,7 @@ clean-am: clean-generic clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/test_read-test_read.Po -rm -f ./$(DEPDIR)/test_read_prob-test_read_prob.Po + -rm -f ./$(DEPDIR)/test_read_rmw-test_read_rmw.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -683,6 +751,7 @@ installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/test_read-test_read.Po -rm -f ./$(DEPDIR)/test_read_prob-test_read_prob.Po + -rm -f ./$(DEPDIR)/test_read_rmw-test_read_rmw.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic diff --git a/internal/test_util/libcode/vx_tc_util/test_read_rmw.cc b/internal/test_util/libcode/vx_tc_util/test_read_rmw.cc index 72eacbe4ae..ff813e27cb 100644 --- a/internal/test_util/libcode/vx_tc_util/test_read_rmw.cc +++ b/internal/test_util/libcode/vx_tc_util/test_read_rmw.cc @@ -15,6 +15,9 @@ using namespace std; #include #include +#include +using namespace netCDF; + #include "vx_util.h" #include "vx_nc_util.h" #include "vx_tc_util.h" diff --git a/src/basic/vx_config/config.tab.cc b/src/basic/vx_config/config.tab.cc index a352c67307..6805b14a43 100644 --- a/src/basic/vx_config/config.tab.cc +++ b/src/basic/vx_config/config.tab.cc @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.3.2. */ +/* A Bison parser, made by GNU Bison 3.8.2. */ /* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ 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 . */ + along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -34,6 +34,10 @@ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ +/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, + especially those whose name start with YY_ or yy_. They are + private implementation details that can be changed or removed. */ + /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. @@ -41,14 +45,11 @@ define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ -/* Undocumented macros, especially those whose name start with YY_, - are private implementation details. Do not rely on them. */ - -/* Identify Bison output. */ -#define YYBISON 1 +/* Identify Bison output, and Bison version. */ +#define YYBISON 30802 -/* Bison version. */ -#define YYBISON_VERSION "3.3.2" +/* Bison version string. */ +#define YYBISON_VERSION "3.8.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -69,12 +70,11 @@ #define yyerror configerror #define yydebug configdebug #define yynerrs confignerrs - #define yylval configlval #define yychar configchar /* First part of user prologue. */ -#line 3 "config.tab.yy" /* yacc.c:337 */ +#line 3 "config.tab.yy" //////////////////////////////////////////////////////////////////////// @@ -261,7 +261,17 @@ static void do_user_function_def(); -#line 265 "config.tab.cc" /* yacc.c:337 */ +#line 265 "config.tab.cc" + +# ifndef YY_CAST +# ifdef __cplusplus +# define YY_CAST(Type, Val) static_cast (Val) +# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) +# else +# define YY_CAST(Type, Val) ((Type) (Val)) +# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) +# endif +# endif # ifndef YY_NULLPTR # if defined __cplusplus # if 201103L <= __cplusplus @@ -274,137 +284,165 @@ static void do_user_function_def(); # endif # endif -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* In a future release of Bison, this section will be replaced - by #include "config.tab.h". */ -#ifndef YY_CONFIG_CONFIG_TAB_H_INCLUDED -# define YY_CONFIG_CONFIG_TAB_H_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int configdebug; -#endif - -/* Token type. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - IDENTIFIER = 258, - QUOTED_STRING = 259, - INTEGER = 260, - FLOAT = 261, - BOOLEAN = 262, - COMPARISON = 263, - NA_COMPARISON = 264, - LOGICAL_OP_NOT = 265, - LOGICAL_OP_AND = 266, - LOGICAL_OP_OR = 267, - FORTRAN_THRESHOLD = 268, - BUILTIN = 269, - LOCAL_VAR = 270, - SIMPLE_PERC_THRESH = 271, - USER_FUNCTION = 272, - PRINT = 273, - UNARY_MINUS = 274 - }; -#endif -/* Tokens. */ -#define IDENTIFIER 258 -#define QUOTED_STRING 259 -#define INTEGER 260 -#define FLOAT 261 -#define BOOLEAN 262 -#define COMPARISON 263 -#define NA_COMPARISON 264 -#define LOGICAL_OP_NOT 265 -#define LOGICAL_OP_AND 266 -#define LOGICAL_OP_OR 267 -#define FORTRAN_THRESHOLD 268 -#define BUILTIN 269 -#define LOCAL_VAR 270 -#define SIMPLE_PERC_THRESH 271 -#define USER_FUNCTION 272 -#define PRINT 273 -#define UNARY_MINUS 274 - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED - -union YYSTYPE +#include "config.tab.h" +/* Symbol kind. */ +enum yysymbol_kind_t { -#line 191 "config.tab.yy" /* yacc.c:352 */ - - - char text[max_id_length + 1]; - - Number nval; - - bool bval; - - int index; - - ThreshType cval; - - ThreshNode * node; - - const DictionaryEntry * entry; - - PC_info pc_info; - - -#line 366 "config.tab.cc" /* yacc.c:352 */ + YYSYMBOL_YYEMPTY = -2, + YYSYMBOL_YYEOF = 0, /* "end of file" */ + YYSYMBOL_YYerror = 1, /* error */ + YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ + YYSYMBOL_IDENTIFIER = 3, /* IDENTIFIER */ + YYSYMBOL_QUOTED_STRING = 4, /* QUOTED_STRING */ + YYSYMBOL_INTEGER = 5, /* INTEGER */ + YYSYMBOL_FLOAT = 6, /* FLOAT */ + YYSYMBOL_BOOLEAN = 7, /* BOOLEAN */ + YYSYMBOL_COMPARISON = 8, /* COMPARISON */ + YYSYMBOL_NA_COMPARISON = 9, /* NA_COMPARISON */ + YYSYMBOL_LOGICAL_OP_NOT = 10, /* LOGICAL_OP_NOT */ + YYSYMBOL_LOGICAL_OP_AND = 11, /* LOGICAL_OP_AND */ + YYSYMBOL_LOGICAL_OP_OR = 12, /* LOGICAL_OP_OR */ + YYSYMBOL_FORTRAN_THRESHOLD = 13, /* FORTRAN_THRESHOLD */ + YYSYMBOL_BUILTIN = 14, /* BUILTIN */ + YYSYMBOL_LOCAL_VAR = 15, /* LOCAL_VAR */ + YYSYMBOL_SIMPLE_PERC_THRESH = 16, /* SIMPLE_PERC_THRESH */ + YYSYMBOL_USER_FUNCTION = 17, /* USER_FUNCTION */ + YYSYMBOL_PRINT = 18, /* PRINT */ + YYSYMBOL_19_ = 19, /* '+' */ + YYSYMBOL_20_ = 20, /* '-' */ + YYSYMBOL_21_ = 21, /* '*' */ + YYSYMBOL_22_ = 22, /* '/' */ + YYSYMBOL_23_ = 23, /* '^' */ + YYSYMBOL_UNARY_MINUS = 24, /* UNARY_MINUS */ + YYSYMBOL_25_ = 25, /* ';' */ + YYSYMBOL_26_ = 26, /* ']' */ + YYSYMBOL_27_ = 27, /* ',' */ + YYSYMBOL_28_ = 28, /* '(' */ + YYSYMBOL_29_ = 29, /* ')' */ + YYSYMBOL_30_ = 30, /* '=' */ + YYSYMBOL_31_ = 31, /* '[' */ + YYSYMBOL_32_ = 32, /* '{' */ + YYSYMBOL_33_ = 33, /* '}' */ + YYSYMBOL_YYACCEPT = 34, /* $accept */ + YYSYMBOL_statement_list = 35, /* statement_list */ + YYSYMBOL_statement = 36, /* statement */ + YYSYMBOL_print_stmt = 37, /* print_stmt */ + YYSYMBOL_print_prefix = 38, /* print_prefix */ + YYSYMBOL_assign_stmt = 39, /* assign_stmt */ + YYSYMBOL_id_list = 40, /* id_list */ + YYSYMBOL_function_prefix = 41, /* function_prefix */ + YYSYMBOL_assign_prefix = 42, /* assign_prefix */ + YYSYMBOL_array_prefix = 43, /* array_prefix */ + YYSYMBOL_44_1 = 44, /* $@1 */ + YYSYMBOL_dictionary = 45, /* dictionary */ + YYSYMBOL_dictionary_list = 46, /* dictionary_list */ + YYSYMBOL_string_list = 47, /* string_list */ + YYSYMBOL_threshold_list = 48, /* threshold_list */ + YYSYMBOL_threshold = 49, /* threshold */ + YYSYMBOL_thresh_node = 50, /* thresh_node */ + YYSYMBOL_simple_thresh = 51, /* simple_thresh */ + YYSYMBOL_number = 52, /* number */ + YYSYMBOL_boolean_list = 53, /* boolean_list */ + YYSYMBOL_opt_semi = 54, /* opt_semi */ + YYSYMBOL_opt_comma = 55, /* opt_comma */ + YYSYMBOL_expression = 56, /* expression */ + YYSYMBOL_57_2 = 57, /* $@2 */ + YYSYMBOL_58_3 = 58, /* $@3 */ + YYSYMBOL_expression_list = 59, /* expression_list */ + YYSYMBOL_piecewise_linear = 60, /* piecewise_linear */ + YYSYMBOL_point_list = 61, /* point_list */ + YYSYMBOL_point = 62 /* point */ }; +typedef enum yysymbol_kind_t yysymbol_kind_t; -typedef union YYSTYPE YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif -extern YYSTYPE configlval; -int configparse (void); +#ifdef short +# undef short +#endif -#endif /* !YY_CONFIG_CONFIG_TAB_H_INCLUDED */ +/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure + and (if available) are included + so that the code can choose integer types of a good width. */ +#ifndef __PTRDIFF_MAX__ +# include /* INFRINGES ON USER NAME SPACE */ +# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_STDINT_H +# endif +#endif +/* Narrow types that promote to a signed type and that can represent a + signed or unsigned integer of at least N bits. In tables they can + save space and decrease cache pressure. Promoting to a signed type + helps avoid bugs in integer arithmetic. */ -#ifdef short -# undef short +#ifdef __INT_LEAST8_MAX__ +typedef __INT_LEAST8_TYPE__ yytype_int8; +#elif defined YY_STDINT_H +typedef int_least8_t yytype_int8; +#else +typedef signed char yytype_int8; #endif -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; +#ifdef __INT_LEAST16_MAX__ +typedef __INT_LEAST16_TYPE__ yytype_int16; +#elif defined YY_STDINT_H +typedef int_least16_t yytype_int16; #else -typedef unsigned char yytype_uint8; +typedef short yytype_int16; #endif -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#else -typedef signed char yytype_int8; +/* Work around bug in HP-UX 11.23, which defines these macros + incorrectly for preprocessor constants. This workaround can likely + be removed in 2023, as HPE has promised support for HP-UX 11.23 + (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of + . */ +#ifdef __hpux +# undef UINT_LEAST8_MAX +# undef UINT_LEAST16_MAX +# define UINT_LEAST8_MAX 255 +# define UINT_LEAST16_MAX 65535 #endif -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; +#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ +typedef __UINT_LEAST8_TYPE__ yytype_uint8; +#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ + && UINT_LEAST8_MAX <= INT_MAX) +typedef uint_least8_t yytype_uint8; +#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX +typedef unsigned char yytype_uint8; #else -typedef unsigned short yytype_uint16; +typedef short yytype_uint8; #endif -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; +#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__ +typedef __UINT_LEAST16_TYPE__ yytype_uint16; +#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \ + && UINT_LEAST16_MAX <= INT_MAX) +typedef uint_least16_t yytype_uint16; +#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX +typedef unsigned short yytype_uint16; #else -typedef short yytype_int16; +typedef int yytype_uint16; +#endif + +#ifndef YYPTRDIFF_T +# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ +# define YYPTRDIFF_T __PTRDIFF_TYPE__ +# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ +# elif defined PTRDIFF_MAX +# ifndef ptrdiff_t +# include /* INFRINGES ON USER NAME SPACE */ +# endif +# define YYPTRDIFF_T ptrdiff_t +# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX +# else +# define YYPTRDIFF_T long +# define YYPTRDIFF_MAXIMUM LONG_MAX +# endif #endif #ifndef YYSIZE_T @@ -412,7 +450,7 @@ typedef short yytype_int16; # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t -# elif ! defined YYSIZE_T +# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else @@ -420,7 +458,20 @@ typedef short yytype_int16; # endif #endif -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) +#define YYSIZE_MAXIMUM \ + YY_CAST (YYPTRDIFF_T, \ + (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ + ? YYPTRDIFF_MAXIMUM \ + : YY_CAST (YYSIZE_T, -1))) + +#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) + + +/* Stored state numbers (used for stacks). */ +typedef yytype_uint8 yy_state_t; + +/* State numbers in computations. */ +typedef int yy_state_fast_t; #ifndef YY_ # if defined YYENABLE_NLS && YYENABLE_NLS @@ -434,38 +485,43 @@ typedef short yytype_int16; # endif #endif -#ifndef YY_ATTRIBUTE -# if (defined __GNUC__ \ - && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ - || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C -# define YY_ATTRIBUTE(Spec) __attribute__(Spec) -# else -# define YY_ATTRIBUTE(Spec) /* empty */ -# endif -#endif #ifndef YY_ATTRIBUTE_PURE -# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) +# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) +# else +# define YY_ATTRIBUTE_PURE +# endif #endif #ifndef YY_ATTRIBUTE_UNUSED -# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) +# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +# else +# define YY_ATTRIBUTE_UNUSED +# endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) +# define YY_USE(E) ((void) (E)) #else -# define YYUSE(E) /* empty */ +# define YY_USE(E) /* empty */ #endif -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ +# endif +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else # define YY_INITIAL_VALUE(Value) Value @@ -478,8 +534,22 @@ typedef short yytype_int16; # define YY_INITIAL_VALUE(Value) /* Nothing. */ #endif +#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ +# define YY_IGNORE_USELESS_CAST_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") +# define YY_IGNORE_USELESS_CAST_END \ + _Pragma ("GCC diagnostic pop") +#endif +#ifndef YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_END +#endif + + +#define YY_ASSERT(E) ((void) (0 && (E))) -#if ! defined yyoverflow || YYERROR_VERBOSE +#if !defined yyoverflow /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -544,8 +614,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - +#endif /* !defined yyoverflow */ #if (! defined yyoverflow \ && (! defined __cplusplus \ @@ -554,17 +623,17 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ /* A type that is properly aligned for any stack member. */ union yyalloc { - yytype_int16 yyss_alloc; + yy_state_t yyss_alloc; YYSTYPE yyvs_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) +# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) # define YYCOPY_NEEDED 1 @@ -577,11 +646,11 @@ union yyalloc # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ do \ { \ - YYSIZE_T yynewbytes; \ + YYPTRDIFF_T yynewbytes; \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ + yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / YYSIZEOF (*yyptr); \ } \ while (0) @@ -593,12 +662,12 @@ union yyalloc # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(Dst, Src, Count) \ - __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) + __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) # else # define YYCOPY(Dst, Src, Count) \ do \ { \ - YYSIZE_T yyi; \ + YYPTRDIFF_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (Dst)[yyi] = (Src)[yyi]; \ } \ @@ -621,17 +690,20 @@ union yyalloc /* YYNSTATES -- Number of states. */ #define YYNSTATES 144 -#define YYUNDEFTOK 2 +/* YYMAXUTOK -- Last valid token kind. */ #define YYMAXUTOK 274 + /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM as returned by yylex, with out-of-bounds checking. */ -#define YYTRANSLATE(YYX) \ - ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) +#define YYTRANSLATE(YYX) \ + (0 <= (YYX) && (YYX) <= YYMAXUTOK \ + ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ + : YYSYMBOL_YYUNDEF) /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM as returned by yylex. */ -static const yytype_uint8 yytranslate[] = +static const yytype_int8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -664,8 +736,8 @@ static const yytype_uint8 yytranslate[] = }; #if YYDEBUG - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = +/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ +static const yytype_int16 yyrline[] = { 0, 255, 255, 256, 259, 260, 261, 265, 266, 270, 275, 276, 277, 278, 280, 281, 282, 284, 285, 286, @@ -678,50 +750,52 @@ static const yytype_uint16 yyrline[] = }; #endif -#if YYDEBUG || YYERROR_VERBOSE || 0 +/** Accessing symbol of state STATE. */ +#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) + +#if YYDEBUG || 0 +/* The user-facing name of the symbol whose (internal) number is + YYSYMBOL. No bounds checking. */ +static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; + /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { - "$end", "error", "$undefined", "IDENTIFIER", "QUOTED_STRING", "INTEGER", - "FLOAT", "BOOLEAN", "COMPARISON", "NA_COMPARISON", "LOGICAL_OP_NOT", - "LOGICAL_OP_AND", "LOGICAL_OP_OR", "FORTRAN_THRESHOLD", "BUILTIN", - "LOCAL_VAR", "SIMPLE_PERC_THRESH", "USER_FUNCTION", "PRINT", "'+'", - "'-'", "'*'", "'/'", "'^'", "UNARY_MINUS", "';'", "']'", "','", "'('", - "')'", "'='", "'['", "'{'", "'}'", "$accept", "statement_list", - "statement", "print_stmt", "print_prefix", "assign_stmt", "id_list", - "function_prefix", "assign_prefix", "array_prefix", "$@1", "dictionary", - "dictionary_list", "string_list", "threshold_list", "threshold", - "thresh_node", "simple_thresh", "number", "boolean_list", "opt_semi", - "opt_comma", "expression", "$@2", "$@3", "expression_list", - "piecewise_linear", "point_list", "point", YY_NULLPTR + "\"end of file\"", "error", "\"invalid token\"", "IDENTIFIER", + "QUOTED_STRING", "INTEGER", "FLOAT", "BOOLEAN", "COMPARISON", + "NA_COMPARISON", "LOGICAL_OP_NOT", "LOGICAL_OP_AND", "LOGICAL_OP_OR", + "FORTRAN_THRESHOLD", "BUILTIN", "LOCAL_VAR", "SIMPLE_PERC_THRESH", + "USER_FUNCTION", "PRINT", "'+'", "'-'", "'*'", "'/'", "'^'", + "UNARY_MINUS", "';'", "']'", "','", "'('", "')'", "'='", "'['", "'{'", + "'}'", "$accept", "statement_list", "statement", "print_stmt", + "print_prefix", "assign_stmt", "id_list", "function_prefix", + "assign_prefix", "array_prefix", "$@1", "dictionary", "dictionary_list", + "string_list", "threshold_list", "threshold", "thresh_node", + "simple_thresh", "number", "boolean_list", "opt_semi", "opt_comma", + "expression", "$@2", "$@3", "expression_list", "piecewise_linear", + "point_list", "point", YY_NULLPTR }; -#endif -# ifdef YYPRINT -/* YYTOKNUM[NUM] -- (External) token number corresponding to the - (internal) symbol number NUM (which must be that of a token). */ -static const yytype_uint16 yytoknum[] = +static const char * +yysymbol_name (yysymbol_kind_t yysymbol) { - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 43, - 45, 42, 47, 94, 274, 59, 93, 44, 40, 41, - 61, 91, 123, 125 -}; -# endif + return yytname[yysymbol]; +} +#endif -#define YYPACT_NINF -17 +#define YYPACT_NINF (-17) -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-17))) +#define yypact_value_is_default(Yyn) \ + ((Yyn) == YYPACT_NINF) -#define YYTABLE_NINF -1 +#define YYTABLE_NINF (-1) -#define yytable_value_is_error(Yytable_value) \ +#define yytable_value_is_error(Yyn) \ 0 - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ static const yytype_int16 yypact[] = { 40, -16, 3, -17, 110, -17, -17, 110, 24, -17, @@ -741,10 +815,10 @@ static const yytype_int16 yypact[] = -17, -17, 202, -17 }; - /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE does not specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = +/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ +static const yytype_int8 yydefact[] = { 0, 0, 0, 38, 0, 47, 9, 0, 0, 2, 5, 0, 4, 0, 28, 0, 6, 37, 39, 0, @@ -763,7 +837,7 @@ static const yytype_uint8 yydefact[] = 66, 68, 0, 74 }; - /* YYPGOTO[NTERM-NUM]. */ +/* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { -17, 163, -7, -17, -17, -17, -17, -17, -17, -17, @@ -771,17 +845,17 @@ static const yytype_int16 yypgoto[] = -17, -17, -11, -17, -17, 84, -17, -17, 124 }; - /* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_uint8 yydefgoto[] = { - -1, 8, 9, 10, 11, 12, 63, 13, 14, 15, + 0, 8, 9, 10, 11, 12, 63, 13, 14, 15, 43, 44, 53, 54, 55, 16, 17, 18, 35, 57, 139, 67, 58, 107, 108, 59, 47, 83, 84 }; - /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule whose - number is the opposite. If YYTABLE_NINF, syntax error. */ +/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_uint8 yytable[] = { 36, 28, 37, 46, 45, 56, 52, 24, 21, 22, @@ -842,9 +916,9 @@ static const yytype_int16 yycheck[] = 22, 23 }; - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = +/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + state STATE-NUM. */ +static const yytype_int8 yystos[] = { 0, 3, 8, 9, 10, 13, 18, 28, 35, 36, 37, 38, 39, 41, 42, 43, 49, 50, 51, 28, @@ -863,8 +937,8 @@ static const yytype_uint8 yystos[] = 29, 29, 56, 29 }; - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = +/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ +static const yytype_int8 yyr1[] = { 0, 34, 35, 35, 36, 36, 36, 37, 37, 38, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, @@ -876,8 +950,8 @@ static const yytype_uint8 yyr1[] = 59, 60, 61, 61, 62 }; - /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = +/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ +static const yytype_int8 yyr2[] = { 0, 2, 1, 2, 1, 1, 1, 3, 5, 1, 3, 3, 3, 3, 3, 3, 2, 4, 4, 4, @@ -890,14 +964,15 @@ static const yytype_uint8 yyr2[] = }; +enum { YYENOMEM = -2 }; + #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab +#define YYNOMEM goto yyexhaustedlab #define YYRECOVERING() (!!yyerrstatus) @@ -919,10 +994,9 @@ static const yytype_uint8 yyr2[] = } \ while (0) -/* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 - +/* Backward compatibility with an undocumented macro. + Use YYerror or YYUNDEF. */ +#define YYERRCODE YYUNDEF /* Enable debugging if requested. */ @@ -939,19 +1013,16 @@ do { \ YYFPRINTF Args; \ } while (0) -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ + +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ - Type, Value); \ + Kind, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) @@ -962,17 +1033,16 @@ do { \ `-----------------------------------*/ static void -yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) +yy_symbol_value_print (FILE *yyo, + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) { FILE *yyoutput = yyo; - YYUSE (yyoutput); + YY_USE (yyoutput); if (!yyvaluep) return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyo, yytoknum[yytype], *yyvaluep); -# endif - YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YY_USE (yykind); + YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -981,12 +1051,13 @@ yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) `---------------------------*/ static void -yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) +yy_symbol_print (FILE *yyo, + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) { YYFPRINTF (yyo, "%s %s (", - yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); + yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); - yy_symbol_value_print (yyo, yytype, yyvaluep); + yy_symbol_value_print (yyo, yykind, yyvaluep); YYFPRINTF (yyo, ")"); } @@ -996,7 +1067,7 @@ yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) `------------------------------------------------------------------*/ static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) +yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) @@ -1019,21 +1090,21 @@ do { \ `------------------------------------------------*/ static void -yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) +yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, + int yyrule) { - unsigned long yylno = yyrline[yyrule]; + int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, - yystos[yyssp[yyi + 1 - yynrhs]], - &yyvsp[(yyi + 1) - (yynrhs)] - ); + YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]), + &yyvsp[(yyi + 1) - (yynrhs)]); YYFPRINTF (stderr, "\n"); } } @@ -1048,8 +1119,8 @@ do { \ multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YYDPRINTF(Args) ((void) 0) +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ @@ -1072,254 +1143,30 @@ int yydebug; #endif -#if YYERROR_VERBOSE -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -yystrlen (const char *yystr) -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -yystpcpy (char *yydest, const char *yysrc) -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - else - goto append; - - append: - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres); -} -# endif -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - yytype_int16 *yyssp, int yytoken) -{ - YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULLPTR; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; - - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) - { - int yyn = yypact[*yyssp]; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); - if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) - yysize = yysize1; - else - return 2; - } - } - } - } - - switch (yycount) - { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - default: /* Avoid compiler warnings. */ - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } - - { - YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) - yysize = yysize1; - else - return 2; - } - - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } - - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - return 0; -} -#endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +yydestruct (const char *yymsg, + yysymbol_kind_t yykind, YYSTYPE *yyvaluep) { - YYUSE (yyvaluep); + YY_USE (yyvaluep); if (!yymsg) yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yytype); + YY_USE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } - - -/* The lookahead symbol. */ +/* Lookahead token kind. */ int yychar; /* The semantic value of the lookahead symbol. */ @@ -1328,6 +1175,8 @@ YYSTYPE yylval; int yynerrs; + + /*----------. | yyparse. | `----------*/ @@ -1335,43 +1184,36 @@ int yynerrs; int yyparse (void) { - int yystate; + yy_state_fast_t yystate = 8; /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - 'yyss': related to states. - 'yyvs': related to semantic values. + int yyerrstatus = 0; - Refer to the stacks through separate pointers, to allow yyoverflow + /* Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; + /* Their size. */ + YYPTRDIFF_T yystacksize = YYINITDEPTH; - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; + /* The state stack: array, bottom, top. */ + yy_state_t yyssa[YYINITDEPTH]; + yy_state_t *yyss = yyssa; + yy_state_t *yyssp = yyss; - YYSIZE_T yystacksize; + /* The semantic value stack: array, bottom, top. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp = yyvs; int yyn; + /* The return value of yyparse. */ int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; + /* Lookahead symbol kind. */ + yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif + #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) @@ -1379,16 +1221,10 @@ yyparse (void) Keep to zero when no symbol should be popped. */ int yylen = 0; - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; - yystacksize = YYINITDEPTH; - YYDPRINTF ((stderr, "Starting parse\n")); - yystate = 8; - yyerrstatus = 0; - yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ + goto yysetstate; @@ -1402,34 +1238,39 @@ yyparse (void) /*--------------------------------------------------------------------. -| yynewstate -- set current state (the top of the stack) to yystate. | +| yysetstate -- set current state (the top of the stack) to yystate. | `--------------------------------------------------------------------*/ yysetstate: - *yyssp = (yytype_int16) yystate; + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + YY_ASSERT (0 <= yystate && yystate < YYNSTATES); + YY_IGNORE_USELESS_CAST_BEGIN + *yyssp = YY_CAST (yy_state_t, yystate); + YY_IGNORE_USELESS_CAST_END + YY_STACK_PRINT (yyss, yyssp); if (yyss + yystacksize - 1 <= yyssp) #if !defined yyoverflow && !defined YYSTACK_RELOCATE - goto yyexhaustedlab; + YYNOMEM; #else { /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1); + YYPTRDIFF_T yysize = yyssp - yyss + 1; # if defined yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ + yy_state_t *yyss1 = yyss; YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), + &yyss1, yysize * YYSIZEOF (*yyssp), + &yyvs1, yysize * YYSIZEOF (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; @@ -1437,20 +1278,21 @@ yyparse (void) # else /* defined YYSTACK_RELOCATE */ /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + YYNOMEM; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { - yytype_int16 *yyss1 = yyss; + yy_state_t *yyss1 = yyss; union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + YY_CAST (union yyalloc *, + YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); if (! yyptr) - goto yyexhaustedlab; + YYNOMEM; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE +# undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } @@ -1459,15 +1301,16 @@ yyparse (void) yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long) yystacksize)); + YY_IGNORE_USELESS_CAST_BEGIN + YYDPRINTF ((stderr, "Stack size increased to %ld\n", + YY_CAST (long, yystacksize))); + YY_IGNORE_USELESS_CAST_END if (yyss + yystacksize - 1 <= yyssp) YYABORT; } #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); if (yystate == YYFINAL) YYACCEPT; @@ -1489,18 +1332,29 @@ yyparse (void) /* Not known => get a lookahead token if don't already have one. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ if (yychar == YYEMPTY) { - YYDPRINTF ((stderr, "Reading a token: ")); + YYDPRINTF ((stderr, "Reading a token\n")); yychar = yylex (); } if (yychar <= YYEOF) { - yychar = yytoken = YYEOF; + yychar = YYEOF; + yytoken = YYSYMBOL_YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } + else if (yychar == YYerror) + { + /* The scanner already issued an error message, process directly + to error recovery. But do not keep the error token as + lookahead, it is too special and may lead us to an endless + loop in error recovery. */ + yychar = YYUNDEF; + yytoken = YYSYMBOL_YYerror; + goto yyerrlab1; + } else { yytoken = YYTRANSLATE (yychar); @@ -1528,15 +1382,13 @@ yyparse (void) /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token. */ - yychar = YYEMPTY; - yystate = yyn; YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END + /* Discard the shifted token. */ + yychar = YYEMPTY; goto yynewstate; @@ -1571,398 +1423,399 @@ yyparse (void) YY_REDUCE_PRINT (yyn); switch (yyn) { - case 2: -#line 255 "config.tab.yy" /* yacc.c:1652 */ - { is_lhs = true; } -#line 1578 "config.tab.cc" /* yacc.c:1652 */ + case 2: /* statement_list: statement */ +#line 255 "config.tab.yy" + { is_lhs = true; } +#line 1430 "config.tab.cc" break; - case 3: -#line 256 "config.tab.yy" /* yacc.c:1652 */ - { is_lhs = true; } -#line 1584 "config.tab.cc" /* yacc.c:1652 */ + case 3: /* statement_list: statement_list statement */ +#line 256 "config.tab.yy" + { is_lhs = true; } +#line 1436 "config.tab.cc" break; - case 4: -#line 259 "config.tab.yy" /* yacc.c:1652 */ - { is_lhs = true; } -#line 1590 "config.tab.cc" /* yacc.c:1652 */ + case 4: /* statement: assign_stmt */ +#line 259 "config.tab.yy" + { is_lhs = true; } +#line 1442 "config.tab.cc" break; - case 5: -#line 260 "config.tab.yy" /* yacc.c:1652 */ - { is_lhs = true; } -#line 1596 "config.tab.cc" /* yacc.c:1652 */ + case 5: /* statement: print_stmt */ +#line 260 "config.tab.yy" + { is_lhs = true; } +#line 1448 "config.tab.cc" break; - case 6: -#line 261 "config.tab.yy" /* yacc.c:1652 */ - { } -#line 1602 "config.tab.cc" /* yacc.c:1652 */ + case 6: /* statement: threshold */ +#line 261 "config.tab.yy" + { } +#line 1454 "config.tab.cc" break; - case 7: -#line 265 "config.tab.yy" /* yacc.c:1652 */ - { do_print( 0); } -#line 1608 "config.tab.cc" /* yacc.c:1652 */ + case 7: /* print_stmt: print_prefix expression ';' */ +#line 265 "config.tab.yy" + { do_print( 0); } +#line 1460 "config.tab.cc" break; - case 8: -#line 266 "config.tab.yy" /* yacc.c:1652 */ - { do_print((yyvsp[-3].text)); } -#line 1614 "config.tab.cc" /* yacc.c:1652 */ + case 8: /* print_stmt: print_prefix QUOTED_STRING opt_comma expression ';' */ +#line 266 "config.tab.yy" + { do_print((yyvsp[-3].text)); } +#line 1466 "config.tab.cc" break; - case 9: -#line 270 "config.tab.yy" /* yacc.c:1652 */ - { is_lhs = false; } -#line 1620 "config.tab.cc" /* yacc.c:1652 */ + case 9: /* print_prefix: PRINT */ +#line 270 "config.tab.yy" + { is_lhs = false; } +#line 1472 "config.tab.cc" break; - case 10: -#line 275 "config.tab.yy" /* yacc.c:1652 */ - { do_assign_boolean ((yyvsp[-2].text), (yyvsp[-1].bval)); } -#line 1626 "config.tab.cc" /* yacc.c:1652 */ + case 10: /* assign_stmt: assign_prefix BOOLEAN ';' */ +#line 275 "config.tab.yy" + { do_assign_boolean ((yyvsp[-2].text), (yyvsp[-1].bval)); } +#line 1478 "config.tab.cc" break; - case 11: -#line 276 "config.tab.yy" /* yacc.c:1652 */ - { do_assign_exp ((yyvsp[-2].text)); } -#line 1632 "config.tab.cc" /* yacc.c:1652 */ + case 11: /* assign_stmt: assign_prefix expression ';' */ +#line 276 "config.tab.yy" + { do_assign_exp ((yyvsp[-2].text)); } +#line 1484 "config.tab.cc" break; - case 12: -#line 277 "config.tab.yy" /* yacc.c:1652 */ - { do_assign_id ((yyvsp[-2].text), (yyvsp[-1].text)); } -#line 1638 "config.tab.cc" /* yacc.c:1652 */ + case 12: /* assign_stmt: assign_prefix IDENTIFIER ';' */ +#line 277 "config.tab.yy" + { do_assign_id ((yyvsp[-2].text), (yyvsp[-1].text)); } +#line 1490 "config.tab.cc" break; - case 13: -#line 278 "config.tab.yy" /* yacc.c:1652 */ - { do_pwl ((yyvsp[-2].text)); } -#line 1644 "config.tab.cc" /* yacc.c:1652 */ + case 13: /* assign_stmt: assign_prefix piecewise_linear ';' */ +#line 278 "config.tab.yy" + { do_pwl ((yyvsp[-2].text)); } +#line 1496 "config.tab.cc" break; - case 14: -#line 280 "config.tab.yy" /* yacc.c:1652 */ - { do_assign_threshold ((yyvsp[-2].text)); } -#line 1650 "config.tab.cc" /* yacc.c:1652 */ + case 14: /* assign_stmt: assign_prefix threshold ';' */ +#line 280 "config.tab.yy" + { do_assign_threshold ((yyvsp[-2].text)); } +#line 1502 "config.tab.cc" break; - case 15: -#line 281 "config.tab.yy" /* yacc.c:1652 */ - { do_assign_string ((yyvsp[-2].text), (yyvsp[-1].text)); } -#line 1656 "config.tab.cc" /* yacc.c:1652 */ + case 15: /* assign_stmt: assign_prefix QUOTED_STRING ';' */ +#line 281 "config.tab.yy" + { do_assign_string ((yyvsp[-2].text), (yyvsp[-1].text)); } +#line 1508 "config.tab.cc" break; - case 16: -#line 282 "config.tab.yy" /* yacc.c:1652 */ - { do_assign_dict ((yyvsp[-1].text)); } -#line 1662 "config.tab.cc" /* yacc.c:1652 */ + case 16: /* assign_stmt: assign_prefix dictionary */ +#line 282 "config.tab.yy" + { do_assign_dict ((yyvsp[-1].text)); } +#line 1514 "config.tab.cc" break; - case 17: -#line 284 "config.tab.yy" /* yacc.c:1652 */ - { do_assign_dict((yyvsp[-3].text)); } -#line 1668 "config.tab.cc" /* yacc.c:1652 */ + case 17: /* assign_stmt: array_prefix boolean_list ']' ';' */ +#line 284 "config.tab.yy" + { do_assign_dict((yyvsp[-3].text)); } +#line 1520 "config.tab.cc" break; - case 18: -#line 285 "config.tab.yy" /* yacc.c:1652 */ - { do_assign_exp_array((yyvsp[-3].text)); } -#line 1674 "config.tab.cc" /* yacc.c:1652 */ + case 18: /* assign_stmt: array_prefix expression_list ']' ';' */ +#line 285 "config.tab.yy" + { do_assign_exp_array((yyvsp[-3].text)); } +#line 1526 "config.tab.cc" break; - case 19: -#line 286 "config.tab.yy" /* yacc.c:1652 */ - { do_assign_dict((yyvsp[-3].text)); } -#line 1680 "config.tab.cc" /* yacc.c:1652 */ + case 19: /* assign_stmt: array_prefix string_list ']' ';' */ +#line 286 "config.tab.yy" + { do_assign_dict((yyvsp[-3].text)); } +#line 1532 "config.tab.cc" break; - case 20: -#line 287 "config.tab.yy" /* yacc.c:1652 */ - { do_assign_dict((yyvsp[-3].text)); } -#line 1686 "config.tab.cc" /* yacc.c:1652 */ + case 20: /* assign_stmt: array_prefix threshold_list ']' ';' */ +#line 287 "config.tab.yy" + { do_assign_dict((yyvsp[-3].text)); } +#line 1538 "config.tab.cc" break; - case 21: -#line 288 "config.tab.yy" /* yacc.c:1652 */ - { do_assign_dict((yyvsp[-3].text)); } -#line 1692 "config.tab.cc" /* yacc.c:1652 */ + case 21: /* assign_stmt: array_prefix dictionary_list ']' ';' */ +#line 288 "config.tab.yy" + { do_assign_dict((yyvsp[-3].text)); } +#line 1544 "config.tab.cc" break; - case 22: -#line 289 "config.tab.yy" /* yacc.c:1652 */ - { do_assign_dict((yyvsp[-2].text)); } -#line 1698 "config.tab.cc" /* yacc.c:1652 */ + case 22: /* assign_stmt: array_prefix ']' ';' */ +#line 289 "config.tab.yy" + { do_assign_dict((yyvsp[-2].text)); } +#line 1550 "config.tab.cc" break; - case 23: -#line 291 "config.tab.yy" /* yacc.c:1652 */ - { do_user_function_def(); } -#line 1704 "config.tab.cc" /* yacc.c:1652 */ + case 23: /* assign_stmt: function_prefix expression ';' */ +#line 291 "config.tab.yy" + { do_user_function_def(); } +#line 1556 "config.tab.cc" break; - case 24: -#line 297 "config.tab.yy" /* yacc.c:1652 */ - { ida.add((yyvsp[0].text)); } -#line 1710 "config.tab.cc" /* yacc.c:1652 */ + case 24: /* id_list: IDENTIFIER */ +#line 297 "config.tab.yy" + { ida.add((yyvsp[0].text)); } +#line 1562 "config.tab.cc" break; - case 25: -#line 298 "config.tab.yy" /* yacc.c:1652 */ - { ida.add((yyvsp[0].text)); } -#line 1716 "config.tab.cc" /* yacc.c:1652 */ + case 25: /* id_list: id_list ',' IDENTIFIER */ +#line 298 "config.tab.yy" + { ida.add((yyvsp[0].text)); } +#line 1568 "config.tab.cc" break; - case 26: -#line 302 "config.tab.yy" /* yacc.c:1652 */ - { is_lhs = false; function_name = (yyvsp[-4].text); is_function_def = true; } -#line 1722 "config.tab.cc" /* yacc.c:1652 */ + case 26: /* function_prefix: IDENTIFIER '(' id_list ')' '=' */ +#line 302 "config.tab.yy" + { is_lhs = false; function_name = (yyvsp[-4].text); is_function_def = true; } +#line 1574 "config.tab.cc" break; - case 27: -#line 306 "config.tab.yy" /* yacc.c:1652 */ - { is_lhs = false; strcpy((yyval.text), (yyvsp[-1].text)); } -#line 1728 "config.tab.cc" /* yacc.c:1652 */ + case 27: /* assign_prefix: IDENTIFIER '=' */ +#line 306 "config.tab.yy" + { is_lhs = false; strcpy((yyval.text), (yyvsp[-1].text)); } +#line 1580 "config.tab.cc" break; - case 28: -#line 310 "config.tab.yy" /* yacc.c:1652 */ - { mark(apm); } -#line 1734 "config.tab.cc" /* yacc.c:1652 */ + case 28: /* $@1: %empty */ +#line 310 "config.tab.yy" + { mark(apm); } +#line 1586 "config.tab.cc" break; - case 29: -#line 310 "config.tab.yy" /* yacc.c:1652 */ - { is_lhs = false; strcpy((yyval.text), (yyvsp[-2].text)); } -#line 1740 "config.tab.cc" /* yacc.c:1652 */ + case 29: /* array_prefix: assign_prefix $@1 '[' */ +#line 310 "config.tab.yy" + { is_lhs = false; strcpy((yyval.text), (yyvsp[-2].text)); } +#line 1592 "config.tab.cc" break; - case 30: -#line 314 "config.tab.yy" /* yacc.c:1652 */ - { do_dict(); } -#line 1746 "config.tab.cc" /* yacc.c:1652 */ + case 30: /* dictionary: '{' statement_list '}' opt_semi */ +#line 314 "config.tab.yy" + { do_dict(); } +#line 1598 "config.tab.cc" break; - case 33: -#line 323 "config.tab.yy" /* yacc.c:1652 */ - { do_string((yyvsp[0].text)); } -#line 1752 "config.tab.cc" /* yacc.c:1652 */ + case 33: /* string_list: QUOTED_STRING */ +#line 323 "config.tab.yy" + { do_string((yyvsp[0].text)); } +#line 1604 "config.tab.cc" break; - case 34: -#line 324 "config.tab.yy" /* yacc.c:1652 */ - { do_string((yyvsp[0].text)); } -#line 1758 "config.tab.cc" /* yacc.c:1652 */ + case 34: /* string_list: string_list ',' QUOTED_STRING */ +#line 324 "config.tab.yy" + { do_string((yyvsp[0].text)); } +#line 1610 "config.tab.cc" break; - case 37: -#line 332 "config.tab.yy" /* yacc.c:1652 */ - { do_thresh ((yyvsp[0].node)); } -#line 1764 "config.tab.cc" /* yacc.c:1652 */ + case 37: /* threshold: thresh_node */ +#line 332 "config.tab.yy" + { do_thresh ((yyvsp[0].node)); } +#line 1616 "config.tab.cc" break; - case 38: -#line 333 "config.tab.yy" /* yacc.c:1652 */ - { do_na_thresh (); } -#line 1770 "config.tab.cc" /* yacc.c:1652 */ + case 38: /* threshold: NA_COMPARISON */ +#line 333 "config.tab.yy" + { do_na_thresh (); } +#line 1622 "config.tab.cc" break; - case 39: -#line 337 "config.tab.yy" /* yacc.c:1652 */ - { (yyval.node) = (yyvsp[0].node); } -#line 1776 "config.tab.cc" /* yacc.c:1652 */ + case 39: /* thresh_node: simple_thresh */ +#line 337 "config.tab.yy" + { (yyval.node) = (yyvsp[0].node); } +#line 1628 "config.tab.cc" break; - case 40: -#line 338 "config.tab.yy" /* yacc.c:1652 */ - { (yyval.node) = do_and_thresh ((yyvsp[-2].node), (yyvsp[0].node)); } -#line 1782 "config.tab.cc" /* yacc.c:1652 */ + case 40: /* thresh_node: thresh_node LOGICAL_OP_AND thresh_node */ +#line 338 "config.tab.yy" + { (yyval.node) = do_and_thresh ((yyvsp[-2].node), (yyvsp[0].node)); } +#line 1634 "config.tab.cc" break; - case 41: -#line 339 "config.tab.yy" /* yacc.c:1652 */ - { (yyval.node) = do_or_thresh ((yyvsp[-2].node), (yyvsp[0].node)); } -#line 1788 "config.tab.cc" /* yacc.c:1652 */ + case 41: /* thresh_node: thresh_node LOGICAL_OP_OR thresh_node */ +#line 339 "config.tab.yy" + { (yyval.node) = do_or_thresh ((yyvsp[-2].node), (yyvsp[0].node)); } +#line 1640 "config.tab.cc" break; - case 42: -#line 340 "config.tab.yy" /* yacc.c:1652 */ - { (yyval.node) = do_not_thresh ((yyvsp[0].node)); } -#line 1794 "config.tab.cc" /* yacc.c:1652 */ + case 42: /* thresh_node: LOGICAL_OP_NOT thresh_node */ +#line 340 "config.tab.yy" + { (yyval.node) = do_not_thresh ((yyvsp[0].node)); } +#line 1646 "config.tab.cc" break; - case 43: -#line 341 "config.tab.yy" /* yacc.c:1652 */ - { (yyval.node) = do_paren_thresh ((yyvsp[-1].node)); } -#line 1800 "config.tab.cc" /* yacc.c:1652 */ + case 43: /* thresh_node: '(' thresh_node ')' */ +#line 341 "config.tab.yy" + { (yyval.node) = do_paren_thresh ((yyvsp[-1].node)); } +#line 1652 "config.tab.cc" break; - case 44: -#line 345 "config.tab.yy" /* yacc.c:1652 */ - { (yyval.node) = do_simple_thresh((yyvsp[-1].cval), (yyvsp[0].nval)); } -#line 1806 "config.tab.cc" /* yacc.c:1652 */ + case 44: /* simple_thresh: COMPARISON number */ +#line 345 "config.tab.yy" + { (yyval.node) = do_simple_thresh((yyvsp[-1].cval), (yyvsp[0].nval)); } +#line 1658 "config.tab.cc" break; - case 45: -#line 346 "config.tab.yy" /* yacc.c:1652 */ - { (yyval.node) = do_simple_perc_thresh((yyvsp[-1].cval), (yyvsp[0].pc_info)); } -#line 1812 "config.tab.cc" /* yacc.c:1652 */ + case 45: /* simple_thresh: COMPARISON SIMPLE_PERC_THRESH */ +#line 346 "config.tab.yy" + { (yyval.node) = do_simple_perc_thresh((yyvsp[-1].cval), (yyvsp[0].pc_info)); } +#line 1664 "config.tab.cc" break; - case 46: -#line 347 "config.tab.yy" /* yacc.c:1652 */ - { (yyval.node) = do_compound_perc_thresh((yyvsp[-4].cval), (yyvsp[-3].pc_info), (yyvsp[-1].nval)); } -#line 1818 "config.tab.cc" /* yacc.c:1652 */ + case 46: /* simple_thresh: COMPARISON SIMPLE_PERC_THRESH '(' number ')' */ +#line 347 "config.tab.yy" + { (yyval.node) = do_compound_perc_thresh((yyvsp[-4].cval), (yyvsp[-3].pc_info), (yyvsp[-1].nval)); } +#line 1670 "config.tab.cc" break; - case 47: -#line 348 "config.tab.yy" /* yacc.c:1652 */ - { (yyval.node) = do_fortran_thresh((yyvsp[0].text)); } -#line 1824 "config.tab.cc" /* yacc.c:1652 */ + case 47: /* simple_thresh: FORTRAN_THRESHOLD */ +#line 348 "config.tab.yy" + { (yyval.node) = do_fortran_thresh((yyvsp[0].text)); } +#line 1676 "config.tab.cc" break; - case 48: -#line 352 "config.tab.yy" /* yacc.c:1652 */ - { set_number_string(); } -#line 1830 "config.tab.cc" /* yacc.c:1652 */ + case 48: /* number: INTEGER */ +#line 352 "config.tab.yy" + { set_number_string(); } +#line 1682 "config.tab.cc" break; - case 49: -#line 353 "config.tab.yy" /* yacc.c:1652 */ - { set_number_string(); } -#line 1836 "config.tab.cc" /* yacc.c:1652 */ + case 49: /* number: FLOAT */ +#line 353 "config.tab.yy" + { set_number_string(); } +#line 1688 "config.tab.cc" break; - case 50: -#line 357 "config.tab.yy" /* yacc.c:1652 */ - { do_boolean((yyvsp[0].bval)); } -#line 1842 "config.tab.cc" /* yacc.c:1652 */ + case 50: /* boolean_list: BOOLEAN */ +#line 357 "config.tab.yy" + { do_boolean((yyvsp[0].bval)); } +#line 1694 "config.tab.cc" break; - case 51: -#line 358 "config.tab.yy" /* yacc.c:1652 */ - { do_boolean((yyvsp[0].bval)); } -#line 1848 "config.tab.cc" /* yacc.c:1652 */ + case 51: /* boolean_list: boolean_list ',' BOOLEAN */ +#line 358 "config.tab.yy" + { do_boolean((yyvsp[0].bval)); } +#line 1700 "config.tab.cc" break; - case 56: -#line 372 "config.tab.yy" /* yacc.c:1652 */ - { do_number((yyvsp[0].nval)); } -#line 1854 "config.tab.cc" /* yacc.c:1652 */ + case 56: /* expression: number */ +#line 372 "config.tab.yy" + { do_number((yyvsp[0].nval)); } +#line 1706 "config.tab.cc" break; - case 57: -#line 373 "config.tab.yy" /* yacc.c:1652 */ - { do_local_var((yyvsp[0].index)); } -#line 1860 "config.tab.cc" /* yacc.c:1652 */ + case 57: /* expression: LOCAL_VAR */ +#line 373 "config.tab.yy" + { do_local_var((yyvsp[0].index)); } +#line 1712 "config.tab.cc" break; - case 58: -#line 374 "config.tab.yy" /* yacc.c:1652 */ - { do_op('+'); } -#line 1866 "config.tab.cc" /* yacc.c:1652 */ + case 58: /* expression: expression '+' expression */ +#line 374 "config.tab.yy" + { do_op('+'); } +#line 1718 "config.tab.cc" break; - case 59: -#line 375 "config.tab.yy" /* yacc.c:1652 */ - { do_op('-'); } -#line 1872 "config.tab.cc" /* yacc.c:1652 */ + case 59: /* expression: expression '-' expression */ +#line 375 "config.tab.yy" + { do_op('-'); } +#line 1724 "config.tab.cc" break; - case 60: -#line 376 "config.tab.yy" /* yacc.c:1652 */ - { do_op('*'); } -#line 1878 "config.tab.cc" /* yacc.c:1652 */ + case 60: /* expression: expression '*' expression */ +#line 376 "config.tab.yy" + { do_op('*'); } +#line 1730 "config.tab.cc" break; - case 61: -#line 377 "config.tab.yy" /* yacc.c:1652 */ - { do_op('/'); } -#line 1884 "config.tab.cc" /* yacc.c:1652 */ + case 61: /* expression: expression '/' expression */ +#line 377 "config.tab.yy" + { do_op('/'); } +#line 1736 "config.tab.cc" break; - case 62: -#line 378 "config.tab.yy" /* yacc.c:1652 */ - { do_op('^'); } -#line 1890 "config.tab.cc" /* yacc.c:1652 */ + case 62: /* expression: expression '^' expression */ +#line 378 "config.tab.yy" + { do_op('^'); } +#line 1742 "config.tab.cc" break; - case 63: -#line 379 "config.tab.yy" /* yacc.c:1652 */ - { do_negate(); } -#line 1896 "config.tab.cc" /* yacc.c:1652 */ + case 63: /* expression: '-' expression */ +#line 379 "config.tab.yy" + { do_negate(); } +#line 1748 "config.tab.cc" break; - case 64: -#line 380 "config.tab.yy" /* yacc.c:1652 */ - { do_paren_exp(); } -#line 1902 "config.tab.cc" /* yacc.c:1652 */ + case 64: /* expression: '(' expression ')' */ +#line 380 "config.tab.yy" + { do_paren_exp(); } +#line 1754 "config.tab.cc" break; - case 65: -#line 381 "config.tab.yy" /* yacc.c:1652 */ - { mark(fcm); } -#line 1908 "config.tab.cc" /* yacc.c:1652 */ + case 65: /* $@2: %empty */ +#line 381 "config.tab.yy" + { mark(fcm); } +#line 1760 "config.tab.cc" break; - case 66: -#line 381 "config.tab.yy" /* yacc.c:1652 */ - { do_builtin_call((yyvsp[-4].index)); } -#line 1914 "config.tab.cc" /* yacc.c:1652 */ + case 66: /* expression: BUILTIN '(' $@2 expression_list ')' */ +#line 381 "config.tab.yy" + { do_builtin_call((yyvsp[-4].index)); } +#line 1766 "config.tab.cc" break; - case 67: -#line 382 "config.tab.yy" /* yacc.c:1652 */ - { mark(fcm); } -#line 1920 "config.tab.cc" /* yacc.c:1652 */ + case 67: /* $@3: %empty */ +#line 382 "config.tab.yy" + { mark(fcm); } +#line 1772 "config.tab.cc" break; - case 68: -#line 382 "config.tab.yy" /* yacc.c:1652 */ - { do_user_function_call((yyvsp[-4].entry)); } -#line 1926 "config.tab.cc" /* yacc.c:1652 */ + case 68: /* expression: USER_FUNCTION '(' $@3 expression_list ')' */ +#line 382 "config.tab.yy" + { do_user_function_call((yyvsp[-4].entry)); } +#line 1778 "config.tab.cc" break; - case 69: -#line 387 "config.tab.yy" /* yacc.c:1652 */ - { store_exp(); } -#line 1932 "config.tab.cc" /* yacc.c:1652 */ + case 69: /* expression_list: expression */ +#line 387 "config.tab.yy" + { store_exp(); } +#line 1784 "config.tab.cc" break; - case 70: -#line 388 "config.tab.yy" /* yacc.c:1652 */ - { store_exp(); } -#line 1938 "config.tab.cc" /* yacc.c:1652 */ + case 70: /* expression_list: expression_list ',' expression */ +#line 388 "config.tab.yy" + { store_exp(); } +#line 1790 "config.tab.cc" break; - case 71: -#line 392 "config.tab.yy" /* yacc.c:1652 */ - { } -#line 1944 "config.tab.cc" /* yacc.c:1652 */ + case 71: /* piecewise_linear: '(' point_list ')' */ +#line 392 "config.tab.yy" + { } +#line 1796 "config.tab.cc" break; - case 72: -#line 396 "config.tab.yy" /* yacc.c:1652 */ - { } -#line 1950 "config.tab.cc" /* yacc.c:1652 */ + case 72: /* point_list: point */ +#line 396 "config.tab.yy" + { } +#line 1802 "config.tab.cc" break; - case 73: -#line 397 "config.tab.yy" /* yacc.c:1652 */ - { } -#line 1956 "config.tab.cc" /* yacc.c:1652 */ + case 73: /* point_list: point_list point */ +#line 397 "config.tab.yy" + { } +#line 1808 "config.tab.cc" break; - case 74: -#line 401 "config.tab.yy" /* yacc.c:1652 */ - { add_point(); } -#line 1962 "config.tab.cc" /* yacc.c:1652 */ + case 74: /* point: '(' expression ',' expression ')' */ +#line 401 "config.tab.yy" + { add_point(); } +#line 1814 "config.tab.cc" break; -#line 1966 "config.tab.cc" /* yacc.c:1652 */ +#line 1818 "config.tab.cc" + default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -1976,11 +1829,10 @@ yyparse (void) case of YYERROR or YYBACKUP, subsequent parser actions might lead to an incorrect destructor call or verbose syntax error message before the lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); + YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; - YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; @@ -2004,50 +1856,14 @@ yyparse (void) yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); - + yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; -#if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); -#else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ - yyssp, yytoken) - { - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == 1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); - if (!yymsg) - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } - else - { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror (yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; - } -# undef YYSYNTAX_ERROR -#endif } - - if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an @@ -2080,6 +1896,7 @@ yyparse (void) label yyerrorlab therefore never appears in user code. */ if (0) YYERROR; + ++yynerrs; /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ @@ -2096,13 +1913,14 @@ yyparse (void) yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ + /* Pop stack until we find a state that shifts the error token. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + yyn += YYSYMBOL_YYerror; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) { yyn = yytable[yyn]; if (0 < yyn) @@ -2116,7 +1934,7 @@ yyparse (void) yydestruct ("Error: popping", - yystos[yystate], yyvsp); + YY_ACCESSING_SYMBOL (yystate), yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); @@ -2128,7 +1946,7 @@ yyparse (void) /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp); yystate = yyn; goto yynewstate; @@ -2139,7 +1957,7 @@ yyparse (void) `-------------------------------------*/ yyacceptlab: yyresult = 0; - goto yyreturn; + goto yyreturnlab; /*-----------------------------------. @@ -2147,24 +1965,22 @@ yyparse (void) `-----------------------------------*/ yyabortlab: yyresult = 1; - goto yyreturn; + goto yyreturnlab; -#if !defined yyoverflow || YYERROR_VERBOSE -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ +/*-----------------------------------------------------------. +| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | +`-----------------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; - /* Fall through. */ -#endif + goto yyreturnlab; -/*-----------------------------------------------------. -| yyreturn -- parsing is finished, return the result. | -`-----------------------------------------------------*/ -yyreturn: +/*----------------------------------------------------------. +| yyreturnlab -- parsing is finished, clean up and return. | +`----------------------------------------------------------*/ +yyreturnlab: if (yychar != YYEMPTY) { /* Make sure we have latest lookahead translation. See comments at @@ -2180,20 +1996,18 @@ yyparse (void) while (yyssp != yyss) { yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); + YY_ACCESSING_SYMBOL (+*yyssp), yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif + return yyresult; } -#line 405 "config.tab.yy" /* yacc.c:1918 */ + +#line 405 "config.tab.yy" diff --git a/src/basic/vx_config/config.tab.h b/src/basic/vx_config/config.tab.h index 501f4087bb..cf9ca10762 100644 --- a/src/basic/vx_config/config.tab.h +++ b/src/basic/vx_config/config.tab.h @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.3.2. */ +/* A Bison parser, made by GNU Bison 3.8.2. */ /* Bison interface for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ 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 . */ + along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -31,8 +31,9 @@ This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ -/* Undocumented macros, especially those whose name start with YY_, - are private implementation details. Do not rely on them. */ +/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, + especially those whose name start with YY_ or yy_. They are + private implementation details that can be changed or removed. */ #ifndef YY_CONFIG_CONFIG_TAB_H_INCLUDED # define YY_CONFIG_CONFIG_TAB_H_INCLUDED @@ -44,31 +45,40 @@ extern int configdebug; #endif -/* Token type. */ +/* Token kinds. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { - IDENTIFIER = 258, - QUOTED_STRING = 259, - INTEGER = 260, - FLOAT = 261, - BOOLEAN = 262, - COMPARISON = 263, - NA_COMPARISON = 264, - LOGICAL_OP_NOT = 265, - LOGICAL_OP_AND = 266, - LOGICAL_OP_OR = 267, - FORTRAN_THRESHOLD = 268, - BUILTIN = 269, - LOCAL_VAR = 270, - SIMPLE_PERC_THRESH = 271, - USER_FUNCTION = 272, - PRINT = 273, - UNARY_MINUS = 274 + YYEMPTY = -2, + YYEOF = 0, /* "end of file" */ + YYerror = 256, /* error */ + YYUNDEF = 257, /* "invalid token" */ + IDENTIFIER = 258, /* IDENTIFIER */ + QUOTED_STRING = 259, /* QUOTED_STRING */ + INTEGER = 260, /* INTEGER */ + FLOAT = 261, /* FLOAT */ + BOOLEAN = 262, /* BOOLEAN */ + COMPARISON = 263, /* COMPARISON */ + NA_COMPARISON = 264, /* NA_COMPARISON */ + LOGICAL_OP_NOT = 265, /* LOGICAL_OP_NOT */ + LOGICAL_OP_AND = 266, /* LOGICAL_OP_AND */ + LOGICAL_OP_OR = 267, /* LOGICAL_OP_OR */ + FORTRAN_THRESHOLD = 268, /* FORTRAN_THRESHOLD */ + BUILTIN = 269, /* BUILTIN */ + LOCAL_VAR = 270, /* LOCAL_VAR */ + SIMPLE_PERC_THRESH = 271, /* SIMPLE_PERC_THRESH */ + USER_FUNCTION = 272, /* USER_FUNCTION */ + PRINT = 273, /* PRINT */ + UNARY_MINUS = 274 /* UNARY_MINUS */ }; + typedef enum yytokentype yytoken_kind_t; #endif -/* Tokens. */ +/* Token kinds. */ +#define YYEMPTY -2 +#define YYEOF 0 +#define YYerror 256 +#define YYUNDEF 257 #define IDENTIFIER 258 #define QUOTED_STRING 259 #define INTEGER 260 @@ -89,10 +99,9 @@ extern int configdebug; /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED - union YYSTYPE { -#line 191 "config.tab.yy" /* yacc.c:1921 */ +#line 191 "config.tab.yy" char text[max_id_length + 1]; @@ -112,9 +121,9 @@ union YYSTYPE PC_info pc_info; -#line 116 "config.tab.h" /* yacc.c:1921 */ -}; +#line 125 "config.tab.h" +}; typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 @@ -123,6 +132,8 @@ typedef union YYSTYPE YYSTYPE; extern YYSTYPE configlval; + int configparse (void); + #endif /* !YY_CONFIG_CONFIG_TAB_H_INCLUDED */ diff --git a/src/basic/vx_config/config_constants.h b/src/basic/vx_config/config_constants.h index 7b1fc43ad3..5794a86336 100644 --- a/src/basic/vx_config/config_constants.h +++ b/src/basic/vx_config/config_constants.h @@ -555,6 +555,7 @@ static const char conf_key_GRIB1_subcenter[] = "GRIB1_subcenter"; static const char conf_key_GRIB1_rec[] = "GRIB1_rec"; static const char conf_key_GRIB1_code[] = "GRIB1_code"; static const char conf_key_GRIB1_tri[] = "GRIB1_tri"; + static const char conf_key_GRIB2_disc[] = "GRIB2_disc"; static const char conf_key_GRIB2_parm_cat[] = "GRIB2_parm_cat"; static const char conf_key_GRIB2_parm[] = "GRIB2_parm"; @@ -567,6 +568,12 @@ static const char conf_key_GRIB2_ens_type[] = "GRIB2_ens_type"; static const char conf_key_GRIB2_der_type[] = "GRIB2_der_type"; static const char conf_key_GRIB2_stat_type[] = "GRIB2_stat_type"; static const char conf_key_GRIB2_perc_val[] = "GRIB2_perc_val"; + +static const char conf_key_GRIB2_aerosol_type[] = "GRIB2_aerosol_type"; +static const char conf_key_GRIB2_aerosol_interval_type[] = "GRIB2_aerosol_interval_type"; +static const char conf_key_GRIB2_aerosol_size_lower[] = "GRIB2_aerosol_size_lower"; +static const char conf_key_GRIB2_aerosol_size_upper[] = "GRIB2_aerosol_size_upper"; + static const char conf_key_GRIB2_ipdtmpl_index[] = "GRIB2_ipdtmpl_index"; static const char conf_key_GRIB2_ipdtmpl_val[] = "GRIB2_ipdtmpl_val"; static const char conf_key_level[] = "level"; diff --git a/src/libcode/vx_color/color_parser_yacc.cc b/src/libcode/vx_color/color_parser_yacc.cc index 755db94b51..7b25159984 100644 --- a/src/libcode/vx_color/color_parser_yacc.cc +++ b/src/libcode/vx_color/color_parser_yacc.cc @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.3.2. */ +/* A Bison parser, made by GNU Bison 3.8.2. */ /* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ 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 . */ + along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -34,6 +34,10 @@ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ +/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, + especially those whose name start with YY_ or yy_. They are + private implementation details that can be changed or removed. */ + /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. @@ -41,14 +45,11 @@ define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ -/* Undocumented macros, especially those whose name start with YY_, - are private implementation details. Do not rely on them. */ - -/* Identify Bison output. */ -#define YYBISON 1 +/* Identify Bison output, and Bison version. */ +#define YYBISON 30802 -/* Bison version. */ -#define YYBISON_VERSION "3.3.2" +/* Bison version string. */ +#define YYBISON_VERSION "3.8.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -69,12 +70,11 @@ #define yyerror colorerror #define yydebug colordebug #define yynerrs colornerrs - #define yylval colorlval #define yychar colorchar /* First part of user prologue. */ -#line 3 "color_parser_yacc.yy" /* yacc.c:337 */ +#line 3 "color_parser_yacc.yy" @@ -195,7 +195,17 @@ static Color dcolor_to_color(const Dcolor &); -#line 199 "color_parser_yacc.cc" /* yacc.c:337 */ +#line 199 "color_parser_yacc.cc" + +# ifndef YY_CAST +# ifdef __cplusplus +# define YY_CAST(Type, Val) static_cast (Val) +# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) +# else +# define YY_CAST(Type, Val) ((Type) (Val)) +# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) +# endif +# endif # ifndef YY_NULLPTR # if defined __cplusplus # if 201103L <= __cplusplus @@ -208,115 +218,127 @@ static Color dcolor_to_color(const Dcolor &); # endif # endif -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* In a future release of Bison, this section will be replaced - by #include "color_parser_yacc.h". */ -#ifndef YY_COLOR_COLOR_PARSER_YACC_H_INCLUDED -# define YY_COLOR_COLOR_PARSER_YACC_H_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int colordebug; -#endif - -/* Token type. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - ID = 258, - COLOR_NAME = 259, - INTEGER = 260, - QUOTED_STRING = 261, - FLOAT = 262, - BLEND = 263, - HSV = 264, - GRAYVALUE = 265, - CMYK = 266 - }; -#endif -/* Tokens. */ -#define ID 258 -#define COLOR_NAME 259 -#define INTEGER 260 -#define QUOTED_STRING 261 -#define FLOAT 262 -#define BLEND 263 -#define HSV 264 -#define GRAYVALUE 265 -#define CMYK 266 - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED - -union YYSTYPE +#include "color_parser_yacc.h" +/* Symbol kind. */ +enum yysymbol_kind_t { -#line 126 "color_parser_yacc.yy" /* yacc.c:352 */ - - - char text[129]; - - int ival; - - double dval; - - Dcolor cval; - - ColorNumber nval; - - -#line 278 "color_parser_yacc.cc" /* yacc.c:352 */ + YYSYMBOL_YYEMPTY = -2, + YYSYMBOL_YYEOF = 0, /* "end of file" */ + YYSYMBOL_YYerror = 1, /* error */ + YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ + YYSYMBOL_ID = 3, /* ID */ + YYSYMBOL_COLOR_NAME = 4, /* COLOR_NAME */ + YYSYMBOL_INTEGER = 5, /* INTEGER */ + YYSYMBOL_QUOTED_STRING = 6, /* QUOTED_STRING */ + YYSYMBOL_FLOAT = 7, /* FLOAT */ + YYSYMBOL_BLEND = 8, /* BLEND */ + YYSYMBOL_HSV = 9, /* HSV */ + YYSYMBOL_GRAYVALUE = 10, /* GRAYVALUE */ + YYSYMBOL_CMYK = 11, /* CMYK */ + YYSYMBOL_12_ = 12, /* '=' */ + YYSYMBOL_13_ = 13, /* '{' */ + YYSYMBOL_14_ = 14, /* ',' */ + YYSYMBOL_15_ = 15, /* '}' */ + YYSYMBOL_16_ = 16, /* '(' */ + YYSYMBOL_17_ = 17, /* ')' */ + YYSYMBOL_YYACCEPT = 18, /* $accept */ + YYSYMBOL_statement_list = 19, /* statement_list */ + YYSYMBOL_statement = 20, /* statement */ + YYSYMBOL_ctable_entry = 21, /* ctable_entry */ + YYSYMBOL_color_assignment = 22, /* color_assignment */ + YYSYMBOL_color = 23, /* color */ + YYSYMBOL_number = 24 /* number */ }; +typedef enum yysymbol_kind_t yysymbol_kind_t; -typedef union YYSTYPE YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif -extern YYSTYPE colorlval; -int colorparse (void); +#ifdef short +# undef short +#endif -#endif /* !YY_COLOR_COLOR_PARSER_YACC_H_INCLUDED */ +/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure + and (if available) are included + so that the code can choose integer types of a good width. */ +#ifndef __PTRDIFF_MAX__ +# include /* INFRINGES ON USER NAME SPACE */ +# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_STDINT_H +# endif +#endif +/* Narrow types that promote to a signed type and that can represent a + signed or unsigned integer of at least N bits. In tables they can + save space and decrease cache pressure. Promoting to a signed type + helps avoid bugs in integer arithmetic. */ -#ifdef short -# undef short +#ifdef __INT_LEAST8_MAX__ +typedef __INT_LEAST8_TYPE__ yytype_int8; +#elif defined YY_STDINT_H +typedef int_least8_t yytype_int8; +#else +typedef signed char yytype_int8; #endif -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; +#ifdef __INT_LEAST16_MAX__ +typedef __INT_LEAST16_TYPE__ yytype_int16; +#elif defined YY_STDINT_H +typedef int_least16_t yytype_int16; #else -typedef unsigned char yytype_uint8; +typedef short yytype_int16; #endif -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#else -typedef signed char yytype_int8; +/* Work around bug in HP-UX 11.23, which defines these macros + incorrectly for preprocessor constants. This workaround can likely + be removed in 2023, as HPE has promised support for HP-UX 11.23 + (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of + . */ +#ifdef __hpux +# undef UINT_LEAST8_MAX +# undef UINT_LEAST16_MAX +# define UINT_LEAST8_MAX 255 +# define UINT_LEAST16_MAX 65535 #endif -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; +#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ +typedef __UINT_LEAST8_TYPE__ yytype_uint8; +#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ + && UINT_LEAST8_MAX <= INT_MAX) +typedef uint_least8_t yytype_uint8; +#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX +typedef unsigned char yytype_uint8; #else -typedef unsigned short yytype_uint16; +typedef short yytype_uint8; #endif -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; +#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__ +typedef __UINT_LEAST16_TYPE__ yytype_uint16; +#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \ + && UINT_LEAST16_MAX <= INT_MAX) +typedef uint_least16_t yytype_uint16; +#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX +typedef unsigned short yytype_uint16; #else -typedef short yytype_int16; +typedef int yytype_uint16; +#endif + +#ifndef YYPTRDIFF_T +# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ +# define YYPTRDIFF_T __PTRDIFF_TYPE__ +# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ +# elif defined PTRDIFF_MAX +# ifndef ptrdiff_t +# include /* INFRINGES ON USER NAME SPACE */ +# endif +# define YYPTRDIFF_T ptrdiff_t +# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX +# else +# define YYPTRDIFF_T long +# define YYPTRDIFF_MAXIMUM LONG_MAX +# endif #endif #ifndef YYSIZE_T @@ -324,7 +346,7 @@ typedef short yytype_int16; # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t -# elif ! defined YYSIZE_T +# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else @@ -332,7 +354,20 @@ typedef short yytype_int16; # endif #endif -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) +#define YYSIZE_MAXIMUM \ + YY_CAST (YYPTRDIFF_T, \ + (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ + ? YYPTRDIFF_MAXIMUM \ + : YY_CAST (YYSIZE_T, -1))) + +#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) + + +/* Stored state numbers (used for stacks). */ +typedef yytype_int8 yy_state_t; + +/* State numbers in computations. */ +typedef int yy_state_fast_t; #ifndef YY_ # if defined YYENABLE_NLS && YYENABLE_NLS @@ -346,38 +381,43 @@ typedef short yytype_int16; # endif #endif -#ifndef YY_ATTRIBUTE -# if (defined __GNUC__ \ - && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ - || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C -# define YY_ATTRIBUTE(Spec) __attribute__(Spec) -# else -# define YY_ATTRIBUTE(Spec) /* empty */ -# endif -#endif #ifndef YY_ATTRIBUTE_PURE -# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) +# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) +# else +# define YY_ATTRIBUTE_PURE +# endif #endif #ifndef YY_ATTRIBUTE_UNUSED -# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) +# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +# else +# define YY_ATTRIBUTE_UNUSED +# endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) +# define YY_USE(E) ((void) (E)) #else -# define YYUSE(E) /* empty */ +# define YY_USE(E) /* empty */ #endif -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ +# endif +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else # define YY_INITIAL_VALUE(Value) Value @@ -390,8 +430,22 @@ typedef short yytype_int16; # define YY_INITIAL_VALUE(Value) /* Nothing. */ #endif +#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ +# define YY_IGNORE_USELESS_CAST_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") +# define YY_IGNORE_USELESS_CAST_END \ + _Pragma ("GCC diagnostic pop") +#endif +#ifndef YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_END +#endif + -#if ! defined yyoverflow || YYERROR_VERBOSE +#define YY_ASSERT(E) ((void) (0 && (E))) + +#if !defined yyoverflow /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -456,8 +510,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - +#endif /* !defined yyoverflow */ #if (! defined yyoverflow \ && (! defined __cplusplus \ @@ -466,17 +519,17 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ /* A type that is properly aligned for any stack member. */ union yyalloc { - yytype_int16 yyss_alloc; + yy_state_t yyss_alloc; YYSTYPE yyvs_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) +# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) # define YYCOPY_NEEDED 1 @@ -489,11 +542,11 @@ union yyalloc # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ do \ { \ - YYSIZE_T yynewbytes; \ + YYPTRDIFF_T yynewbytes; \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ + yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / YYSIZEOF (*yyptr); \ } \ while (0) @@ -505,12 +558,12 @@ union yyalloc # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(Dst, Src, Count) \ - __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) + __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) # else # define YYCOPY(Dst, Src, Count) \ do \ { \ - YYSIZE_T yyi; \ + YYPTRDIFF_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (Dst)[yyi] = (Src)[yyi]; \ } \ @@ -533,17 +586,20 @@ union yyalloc /* YYNSTATES -- Number of states. */ #define YYNSTATES 57 -#define YYUNDEFTOK 2 +/* YYMAXUTOK -- Last valid token kind. */ #define YYMAXUTOK 266 + /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM as returned by yylex, with out-of-bounds checking. */ -#define YYTRANSLATE(YYX) \ - ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) +#define YYTRANSLATE(YYX) \ + (0 <= (YYX) && (YYX) <= YYMAXUTOK \ + ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ + : YYSYMBOL_YYUNDEF) /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM as returned by yylex. */ -static const yytype_uint8 yytranslate[] = +static const yytype_int8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -575,7 +631,7 @@ static const yytype_uint8 yytranslate[] = }; #if YYDEBUG - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ +/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint8 yyrline[] = { 0, 161, 161, 162, 166, 167, 171, 172, 176, 177, @@ -583,40 +639,43 @@ static const yytype_uint8 yyrline[] = }; #endif -#if YYDEBUG || YYERROR_VERBOSE || 0 +/** Accessing symbol of state STATE. */ +#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) + +#if YYDEBUG || 0 +/* The user-facing name of the symbol whose (internal) number is + YYSYMBOL. No bounds checking. */ +static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; + /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { - "$end", "error", "$undefined", "ID", "COLOR_NAME", "INTEGER", - "QUOTED_STRING", "FLOAT", "BLEND", "HSV", "GRAYVALUE", "CMYK", "'='", - "'{'", "','", "'}'", "'('", "')'", "$accept", "statement_list", + "\"end of file\"", "error", "\"invalid token\"", "ID", "COLOR_NAME", + "INTEGER", "QUOTED_STRING", "FLOAT", "BLEND", "HSV", "GRAYVALUE", "CMYK", + "'='", "'{'", "','", "'}'", "'('", "')'", "$accept", "statement_list", "statement", "ctable_entry", "color_assignment", "color", "number", YY_NULLPTR }; -#endif -# ifdef YYPRINT -/* YYTOKNUM[NUM] -- (External) token number corresponding to the - (internal) symbol number NUM (which must be that of a token). */ -static const yytype_uint16 yytoknum[] = +static const char * +yysymbol_name (yysymbol_kind_t yysymbol) { - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 61, 123, 44, 125, 40, 41 -}; -# endif + return yytname[yysymbol]; +} +#endif -#define YYPACT_NINF -12 +#define YYPACT_NINF (-12) -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-12))) +#define yypact_value_is_default(Yyn) \ + ((Yyn) == YYPACT_NINF) -#define YYTABLE_NINF -1 +#define YYTABLE_NINF (-1) -#define yytable_value_is_error(Yytable_value) \ +#define yytable_value_is_error(Yyn) \ 0 - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ static const yytype_int8 yypact[] = { -1, -11, 1, -12, -12, 59, -12, -12, -12, 39, @@ -627,10 +686,10 @@ static const yytype_int8 yypact[] = 27, -12, -12, -12, 0, 37, -12 }; - /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE does not specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = +/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ +static const yytype_int8 yydefact[] = { 0, 0, 0, 16, 17, 0, 2, 5, 4, 0, 0, 0, 1, 3, 15, 0, 0, 0, 0, 0, @@ -640,22 +699,22 @@ static const yytype_uint8 yydefact[] = 0, 10, 11, 12, 0, 0, 13 }; - /* YYPGOTO[NTERM-NUM]. */ +/* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { -12, -12, 56, -12, -12, -2, -9 }; - /* YYDEFGOTO[NTERM-NUM]. */ +/* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { - -1, 5, 6, 7, 8, 20, 9 + 0, 5, 6, 7, 8, 20, 9 }; - /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule whose - number is the opposite. If YYTABLE_NINF, syntax error. */ -static const yytype_uint8 yytable[] = +/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ +static const yytype_int8 yytable[] = { 21, 10, 1, 2, 3, 3, 4, 4, 22, 23, 28, 24, 25, 11, 37, 0, 31, 32, 33, 29, @@ -677,9 +736,9 @@ static const yytype_int8 yycheck[] = 13, 5, 3, 4, 5, -1, 7 }; - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = +/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + state STATE-NUM. */ +static const yytype_int8 yystos[] = { 0, 3, 4, 5, 7, 19, 20, 21, 22, 24, 12, 12, 0, 20, 4, 8, 9, 10, 11, 13, @@ -689,29 +748,30 @@ static const yytype_uint8 yystos[] = 24, 15, 17, 17, 14, 24, 17 }; - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = +/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ +static const yytype_int8 yyr1[] = { 0, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 23, 23, 23, 23, 24, 24 }; - /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = +/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ +static const yytype_int8 yyr2[] = { 0, 2, 1, 2, 1, 1, 2, 3, 3, 3, 7, 8, 8, 10, 4, 1, 1, 1 }; +enum { YYENOMEM = -2 }; + #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab +#define YYNOMEM goto yyexhaustedlab #define YYRECOVERING() (!!yyerrstatus) @@ -733,10 +793,9 @@ static const yytype_uint8 yyr2[] = } \ while (0) -/* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 - +/* Backward compatibility with an undocumented macro. + Use YYerror or YYUNDEF. */ +#define YYERRCODE YYUNDEF /* Enable debugging if requested. */ @@ -753,19 +812,16 @@ do { \ YYFPRINTF Args; \ } while (0) -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ + +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ - Type, Value); \ + Kind, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) @@ -776,17 +832,16 @@ do { \ `-----------------------------------*/ static void -yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) +yy_symbol_value_print (FILE *yyo, + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) { FILE *yyoutput = yyo; - YYUSE (yyoutput); + YY_USE (yyoutput); if (!yyvaluep) return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyo, yytoknum[yytype], *yyvaluep); -# endif - YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YY_USE (yykind); + YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -795,12 +850,13 @@ yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) `---------------------------*/ static void -yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) +yy_symbol_print (FILE *yyo, + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) { YYFPRINTF (yyo, "%s %s (", - yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); + yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); - yy_symbol_value_print (yyo, yytype, yyvaluep); + yy_symbol_value_print (yyo, yykind, yyvaluep); YYFPRINTF (yyo, ")"); } @@ -810,7 +866,7 @@ yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) `------------------------------------------------------------------*/ static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) +yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) @@ -833,21 +889,21 @@ do { \ `------------------------------------------------*/ static void -yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) +yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, + int yyrule) { - unsigned long yylno = yyrline[yyrule]; + int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, - yystos[yyssp[yyi + 1 - yynrhs]], - &yyvsp[(yyi + 1) - (yynrhs)] - ); + YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]), + &yyvsp[(yyi + 1) - (yynrhs)]); YYFPRINTF (stderr, "\n"); } } @@ -862,8 +918,8 @@ do { \ multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YYDPRINTF(Args) ((void) 0) +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ @@ -886,254 +942,30 @@ int yydebug; #endif -#if YYERROR_VERBOSE -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -yystrlen (const char *yystr) -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -yystpcpy (char *yydest, const char *yysrc) -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - else - goto append; - - append: - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres); -} -# endif - -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - yytype_int16 *yyssp, int yytoken) -{ - YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULLPTR; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; - - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) - { - int yyn = yypact[*yyssp]; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); - if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) - yysize = yysize1; - else - return 2; - } - } - } - } - - switch (yycount) - { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - default: /* Avoid compiler warnings. */ - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } - - { - YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) - yysize = yysize1; - else - return 2; - } - - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } - - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - return 0; -} -#endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +yydestruct (const char *yymsg, + yysymbol_kind_t yykind, YYSTYPE *yyvaluep) { - YYUSE (yyvaluep); + YY_USE (yyvaluep); if (!yymsg) yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yytype); + YY_USE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } - - -/* The lookahead symbol. */ +/* Lookahead token kind. */ int yychar; /* The semantic value of the lookahead symbol. */ @@ -1142,6 +974,8 @@ YYSTYPE yylval; int yynerrs; + + /*----------. | yyparse. | `----------*/ @@ -1149,43 +983,36 @@ int yynerrs; int yyparse (void) { - int yystate; + yy_state_fast_t yystate = 0; /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - 'yyss': related to states. - 'yyvs': related to semantic values. + int yyerrstatus = 0; - Refer to the stacks through separate pointers, to allow yyoverflow + /* Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; + /* Their size. */ + YYPTRDIFF_T yystacksize = YYINITDEPTH; - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; + /* The state stack: array, bottom, top. */ + yy_state_t yyssa[YYINITDEPTH]; + yy_state_t *yyss = yyssa; + yy_state_t *yyssp = yyss; - YYSIZE_T yystacksize; + /* The semantic value stack: array, bottom, top. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp = yyvs; int yyn; + /* The return value of yyparse. */ int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; + /* Lookahead symbol kind. */ + yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif + #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) @@ -1193,16 +1020,10 @@ yyparse (void) Keep to zero when no symbol should be popped. */ int yylen = 0; - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; - yystacksize = YYINITDEPTH; - YYDPRINTF ((stderr, "Starting parse\n")); - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ + goto yysetstate; @@ -1216,34 +1037,39 @@ yyparse (void) /*--------------------------------------------------------------------. -| yynewstate -- set current state (the top of the stack) to yystate. | +| yysetstate -- set current state (the top of the stack) to yystate. | `--------------------------------------------------------------------*/ yysetstate: - *yyssp = (yytype_int16) yystate; + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + YY_ASSERT (0 <= yystate && yystate < YYNSTATES); + YY_IGNORE_USELESS_CAST_BEGIN + *yyssp = YY_CAST (yy_state_t, yystate); + YY_IGNORE_USELESS_CAST_END + YY_STACK_PRINT (yyss, yyssp); if (yyss + yystacksize - 1 <= yyssp) #if !defined yyoverflow && !defined YYSTACK_RELOCATE - goto yyexhaustedlab; + YYNOMEM; #else { /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1); + YYPTRDIFF_T yysize = yyssp - yyss + 1; # if defined yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ + yy_state_t *yyss1 = yyss; YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), + &yyss1, yysize * YYSIZEOF (*yyssp), + &yyvs1, yysize * YYSIZEOF (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; @@ -1251,20 +1077,21 @@ yyparse (void) # else /* defined YYSTACK_RELOCATE */ /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + YYNOMEM; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { - yytype_int16 *yyss1 = yyss; + yy_state_t *yyss1 = yyss; union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + YY_CAST (union yyalloc *, + YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); if (! yyptr) - goto yyexhaustedlab; + YYNOMEM; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE +# undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } @@ -1273,15 +1100,16 @@ yyparse (void) yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long) yystacksize)); + YY_IGNORE_USELESS_CAST_BEGIN + YYDPRINTF ((stderr, "Stack size increased to %ld\n", + YY_CAST (long, yystacksize))); + YY_IGNORE_USELESS_CAST_END if (yyss + yystacksize - 1 <= yyssp) YYABORT; } #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); if (yystate == YYFINAL) YYACCEPT; @@ -1303,18 +1131,29 @@ yyparse (void) /* Not known => get a lookahead token if don't already have one. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ if (yychar == YYEMPTY) { - YYDPRINTF ((stderr, "Reading a token: ")); + YYDPRINTF ((stderr, "Reading a token\n")); yychar = yylex (); } if (yychar <= YYEOF) { - yychar = yytoken = YYEOF; + yychar = YYEOF; + yytoken = YYSYMBOL_YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } + else if (yychar == YYerror) + { + /* The scanner already issued an error message, process directly + to error recovery. But do not keep the error token as + lookahead, it is too special and may lead us to an endless + loop in error recovery. */ + yychar = YYUNDEF; + yytoken = YYSYMBOL_YYerror; + goto yyerrlab1; + } else { yytoken = YYTRANSLATE (yychar); @@ -1342,15 +1181,13 @@ yyparse (void) /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token. */ - yychar = YYEMPTY; - yystate = yyn; YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END + /* Discard the shifted token. */ + yychar = YYEMPTY; goto yynewstate; @@ -1385,80 +1222,81 @@ yyparse (void) YY_REDUCE_PRINT (yyn); switch (yyn) { - case 6: -#line 171 "color_parser_yacc.yy" /* yacc.c:1652 */ - { add_to_table((yyvsp[-1].nval), (yyvsp[0].cval)); } -#line 1392 "color_parser_yacc.cc" /* yacc.c:1652 */ + case 6: /* ctable_entry: number color */ +#line 171 "color_parser_yacc.yy" + { add_to_table((yyvsp[-1].nval), (yyvsp[0].cval)); } +#line 1229 "color_parser_yacc.cc" break; - case 7: -#line 172 "color_parser_yacc.yy" /* yacc.c:1652 */ - { add_2_to_table((yyvsp[-2].nval), (yyvsp[-1].nval), (yyvsp[0].cval)); } -#line 1398 "color_parser_yacc.cc" /* yacc.c:1652 */ + case 7: /* ctable_entry: number number color */ +#line 172 "color_parser_yacc.yy" + { add_2_to_table((yyvsp[-2].nval), (yyvsp[-1].nval), (yyvsp[0].cval)); } +#line 1235 "color_parser_yacc.cc" break; - case 8: -#line 176 "color_parser_yacc.yy" /* yacc.c:1652 */ - { assign_color_1((yyvsp[-2].text), (yyvsp[0].cval)); } -#line 1404 "color_parser_yacc.cc" /* yacc.c:1652 */ + case 8: /* color_assignment: ID '=' color */ +#line 176 "color_parser_yacc.yy" + { assign_color_1((yyvsp[-2].text), (yyvsp[0].cval)); } +#line 1241 "color_parser_yacc.cc" break; - case 9: -#line 177 "color_parser_yacc.yy" /* yacc.c:1652 */ - { assign_color_2((yyvsp[-2].ival), (yyvsp[0].cval)); } -#line 1410 "color_parser_yacc.cc" /* yacc.c:1652 */ + case 9: /* color_assignment: COLOR_NAME '=' color */ +#line 177 "color_parser_yacc.yy" + { assign_color_2((yyvsp[-2].ival), (yyvsp[0].cval)); } +#line 1247 "color_parser_yacc.cc" break; - case 10: -#line 181 "color_parser_yacc.yy" /* yacc.c:1652 */ - { (yyval.cval) = do_simple_color((yyvsp[-5].nval), (yyvsp[-3].nval), (yyvsp[-1].nval)); } -#line 1416 "color_parser_yacc.cc" /* yacc.c:1652 */ + case 10: /* color: '{' number ',' number ',' number '}' */ +#line 181 "color_parser_yacc.yy" + { (yyval.cval) = do_simple_color((yyvsp[-5].nval), (yyvsp[-3].nval), (yyvsp[-1].nval)); } +#line 1253 "color_parser_yacc.cc" break; - case 11: -#line 182 "color_parser_yacc.yy" /* yacc.c:1652 */ - { (yyval.cval) = blend((yyvsp[-5].cval), (yyvsp[-3].cval), (yyvsp[-1].nval)); } -#line 1422 "color_parser_yacc.cc" /* yacc.c:1652 */ + case 11: /* color: BLEND '(' color ',' color ',' number ')' */ +#line 182 "color_parser_yacc.yy" + { (yyval.cval) = blend((yyvsp[-5].cval), (yyvsp[-3].cval), (yyvsp[-1].nval)); } +#line 1259 "color_parser_yacc.cc" break; - case 12: -#line 183 "color_parser_yacc.yy" /* yacc.c:1652 */ - { (yyval.cval) = hsv((yyvsp[-5].nval), (yyvsp[-3].nval), (yyvsp[-1].nval)); } -#line 1428 "color_parser_yacc.cc" /* yacc.c:1652 */ + case 12: /* color: HSV '(' number ',' number ',' number ')' */ +#line 183 "color_parser_yacc.yy" + { (yyval.cval) = hsv((yyvsp[-5].nval), (yyvsp[-3].nval), (yyvsp[-1].nval)); } +#line 1265 "color_parser_yacc.cc" break; - case 13: -#line 184 "color_parser_yacc.yy" /* yacc.c:1652 */ - { (yyval.cval) = cmyk((yyvsp[-7].nval), (yyvsp[-5].nval), (yyvsp[-3].nval), (yyvsp[-1].nval)); } -#line 1434 "color_parser_yacc.cc" /* yacc.c:1652 */ + case 13: /* color: CMYK '(' number ',' number ',' number ',' number ')' */ +#line 184 "color_parser_yacc.yy" + { (yyval.cval) = cmyk((yyvsp[-7].nval), (yyvsp[-5].nval), (yyvsp[-3].nval), (yyvsp[-1].nval)); } +#line 1271 "color_parser_yacc.cc" break; - case 14: -#line 185 "color_parser_yacc.yy" /* yacc.c:1652 */ - { (yyval.cval) = do_gray((yyvsp[-1].nval)); } -#line 1440 "color_parser_yacc.cc" /* yacc.c:1652 */ + case 14: /* color: GRAYVALUE '(' number ')' */ +#line 185 "color_parser_yacc.yy" + { (yyval.cval) = do_gray((yyvsp[-1].nval)); } +#line 1277 "color_parser_yacc.cc" break; - case 15: -#line 186 "color_parser_yacc.yy" /* yacc.c:1652 */ - { (yyval.cval) = color_lookup((yyvsp[0].ival)); } -#line 1446 "color_parser_yacc.cc" /* yacc.c:1652 */ + case 15: /* color: COLOR_NAME */ +#line 186 "color_parser_yacc.yy" + { (yyval.cval) = color_lookup((yyvsp[0].ival)); } +#line 1283 "color_parser_yacc.cc" break; - case 16: -#line 190 "color_parser_yacc.yy" /* yacc.c:1652 */ - { (yyval.nval) = int_to_num((yyvsp[0].ival)); } -#line 1452 "color_parser_yacc.cc" /* yacc.c:1652 */ + case 16: /* number: INTEGER */ +#line 190 "color_parser_yacc.yy" + { (yyval.nval) = int_to_num((yyvsp[0].ival)); } +#line 1289 "color_parser_yacc.cc" break; - case 17: -#line 191 "color_parser_yacc.yy" /* yacc.c:1652 */ - { (yyval.nval) = int_to_double((yyvsp[0].dval)); } -#line 1458 "color_parser_yacc.cc" /* yacc.c:1652 */ + case 17: /* number: FLOAT */ +#line 191 "color_parser_yacc.yy" + { (yyval.nval) = int_to_double((yyvsp[0].dval)); } +#line 1295 "color_parser_yacc.cc" break; -#line 1462 "color_parser_yacc.cc" /* yacc.c:1652 */ +#line 1299 "color_parser_yacc.cc" + default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -1472,11 +1310,10 @@ yyparse (void) case of YYERROR or YYBACKUP, subsequent parser actions might lead to an incorrect destructor call or verbose syntax error message before the lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); + YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; - YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; @@ -1500,50 +1337,14 @@ yyparse (void) yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); - + yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; -#if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); -#else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ - yyssp, yytoken) - { - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == 1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); - if (!yymsg) - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } - else - { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror (yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; - } -# undef YYSYNTAX_ERROR -#endif } - - if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an @@ -1576,6 +1377,7 @@ yyparse (void) label yyerrorlab therefore never appears in user code. */ if (0) YYERROR; + ++yynerrs; /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ @@ -1592,13 +1394,14 @@ yyparse (void) yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ + /* Pop stack until we find a state that shifts the error token. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + yyn += YYSYMBOL_YYerror; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) { yyn = yytable[yyn]; if (0 < yyn) @@ -1612,7 +1415,7 @@ yyparse (void) yydestruct ("Error: popping", - yystos[yystate], yyvsp); + YY_ACCESSING_SYMBOL (yystate), yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); @@ -1624,7 +1427,7 @@ yyparse (void) /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp); yystate = yyn; goto yynewstate; @@ -1635,7 +1438,7 @@ yyparse (void) `-------------------------------------*/ yyacceptlab: yyresult = 0; - goto yyreturn; + goto yyreturnlab; /*-----------------------------------. @@ -1643,24 +1446,22 @@ yyparse (void) `-----------------------------------*/ yyabortlab: yyresult = 1; - goto yyreturn; + goto yyreturnlab; -#if !defined yyoverflow || YYERROR_VERBOSE -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ +/*-----------------------------------------------------------. +| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | +`-----------------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; - /* Fall through. */ -#endif + goto yyreturnlab; -/*-----------------------------------------------------. -| yyreturn -- parsing is finished, return the result. | -`-----------------------------------------------------*/ -yyreturn: +/*----------------------------------------------------------. +| yyreturnlab -- parsing is finished, clean up and return. | +`----------------------------------------------------------*/ +yyreturnlab: if (yychar != YYEMPTY) { /* Make sure we have latest lookahead translation. See comments at @@ -1676,20 +1477,18 @@ yyparse (void) while (yyssp != yyss) { yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); + YY_ACCESSING_SYMBOL (+*yyssp), yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif + return yyresult; } -#line 196 "color_parser_yacc.yy" /* yacc.c:1918 */ + +#line 196 "color_parser_yacc.yy" diff --git a/src/libcode/vx_color/color_parser_yacc.h b/src/libcode/vx_color/color_parser_yacc.h index 84c875305f..f472c92333 100644 --- a/src/libcode/vx_color/color_parser_yacc.h +++ b/src/libcode/vx_color/color_parser_yacc.h @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.3.2. */ +/* A Bison parser, made by GNU Bison 3.8.2. */ /* Bison interface for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ 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 . */ + along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -31,8 +31,9 @@ This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ -/* Undocumented macros, especially those whose name start with YY_, - are private implementation details. Do not rely on them. */ +/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, + especially those whose name start with YY_ or yy_. They are + private implementation details that can be changed or removed. */ #ifndef YY_COLOR_COLOR_PARSER_YACC_H_INCLUDED # define YY_COLOR_COLOR_PARSER_YACC_H_INCLUDED @@ -44,23 +45,32 @@ extern int colordebug; #endif -/* Token type. */ +/* Token kinds. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { - ID = 258, - COLOR_NAME = 259, - INTEGER = 260, - QUOTED_STRING = 261, - FLOAT = 262, - BLEND = 263, - HSV = 264, - GRAYVALUE = 265, - CMYK = 266 + YYEMPTY = -2, + YYEOF = 0, /* "end of file" */ + YYerror = 256, /* error */ + YYUNDEF = 257, /* "invalid token" */ + ID = 258, /* ID */ + COLOR_NAME = 259, /* COLOR_NAME */ + INTEGER = 260, /* INTEGER */ + QUOTED_STRING = 261, /* QUOTED_STRING */ + FLOAT = 262, /* FLOAT */ + BLEND = 263, /* BLEND */ + HSV = 264, /* HSV */ + GRAYVALUE = 265, /* GRAYVALUE */ + CMYK = 266 /* CMYK */ }; + typedef enum yytokentype yytoken_kind_t; #endif -/* Tokens. */ +/* Token kinds. */ +#define YYEMPTY -2 +#define YYEOF 0 +#define YYerror 256 +#define YYUNDEF 257 #define ID 258 #define COLOR_NAME 259 #define INTEGER 260 @@ -73,10 +83,9 @@ extern int colordebug; /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED - union YYSTYPE { -#line 126 "color_parser_yacc.yy" /* yacc.c:1921 */ +#line 126 "color_parser_yacc.yy" char text[129]; @@ -90,9 +99,9 @@ union YYSTYPE ColorNumber nval; -#line 94 "color_parser_yacc.h" /* yacc.c:1921 */ -}; +#line 103 "color_parser_yacc.h" +}; typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 @@ -101,6 +110,8 @@ typedef union YYSTYPE YYSTYPE; extern YYSTYPE colorlval; + int colorparse (void); + #endif /* !YY_COLOR_COLOR_PARSER_YACC_H_INCLUDED */ diff --git a/src/libcode/vx_data2d/Makefile.am b/src/libcode/vx_data2d/Makefile.am index 9eddedac76..c705ee2486 100644 --- a/src/libcode/vx_data2d/Makefile.am +++ b/src/libcode/vx_data2d/Makefile.am @@ -18,6 +18,7 @@ libvx_data2d_a_SOURCES = \ data_class.cc data_class.h \ data2d_utils.cc data2d_utils.h \ table_lookup.cc table_lookup.h \ + mask_filters.cc mask_filters.h \ vx_data2d.h libvx_data2d_a_CPPFLAGS = ${MET_CPPFLAGS} diff --git a/src/libcode/vx_data2d/Makefile.in b/src/libcode/vx_data2d/Makefile.in index f3229e9a6a..947fb3d73f 100644 --- a/src/libcode/vx_data2d/Makefile.in +++ b/src/libcode/vx_data2d/Makefile.in @@ -113,7 +113,8 @@ am_libvx_data2d_a_OBJECTS = \ libvx_data2d_a-var_info.$(OBJEXT) \ libvx_data2d_a-data_class.$(OBJEXT) \ libvx_data2d_a-data2d_utils.$(OBJEXT) \ - libvx_data2d_a-table_lookup.$(OBJEXT) + libvx_data2d_a-table_lookup.$(OBJEXT) \ + libvx_data2d_a-mask_filters.$(OBJEXT) libvx_data2d_a_OBJECTS = $(am_libvx_data2d_a_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) @@ -134,6 +135,7 @@ am__depfiles_remade = ./$(DEPDIR)/libvx_data2d_a-data2d_utils.Po \ ./$(DEPDIR)/libvx_data2d_a-data_class.Po \ ./$(DEPDIR)/libvx_data2d_a-level_info.Po \ ./$(DEPDIR)/libvx_data2d_a-leveltype_to_string.Po \ + ./$(DEPDIR)/libvx_data2d_a-mask_filters.Po \ ./$(DEPDIR)/libvx_data2d_a-table_lookup.Po \ ./$(DEPDIR)/libvx_data2d_a-var_info.Po am__mv = mv -f @@ -361,6 +363,7 @@ libvx_data2d_a_SOURCES = \ data_class.cc data_class.h \ data2d_utils.cc data2d_utils.h \ table_lookup.cc table_lookup.h \ + mask_filters.cc mask_filters.h \ vx_data2d.h libvx_data2d_a_CPPFLAGS = ${MET_CPPFLAGS} @@ -416,6 +419,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvx_data2d_a-data_class.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvx_data2d_a-level_info.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvx_data2d_a-leveltype_to_string.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvx_data2d_a-mask_filters.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvx_data2d_a-table_lookup.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvx_data2d_a-var_info.Po@am__quote@ # am--include-marker @@ -523,6 +527,20 @@ libvx_data2d_a-table_lookup.obj: table_lookup.cc @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libvx_data2d_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libvx_data2d_a-table_lookup.obj `if test -f 'table_lookup.cc'; then $(CYGPATH_W) 'table_lookup.cc'; else $(CYGPATH_W) '$(srcdir)/table_lookup.cc'; fi` +libvx_data2d_a-mask_filters.o: mask_filters.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libvx_data2d_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libvx_data2d_a-mask_filters.o -MD -MP -MF $(DEPDIR)/libvx_data2d_a-mask_filters.Tpo -c -o libvx_data2d_a-mask_filters.o `test -f 'mask_filters.cc' || echo '$(srcdir)/'`mask_filters.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libvx_data2d_a-mask_filters.Tpo $(DEPDIR)/libvx_data2d_a-mask_filters.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='mask_filters.cc' object='libvx_data2d_a-mask_filters.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libvx_data2d_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libvx_data2d_a-mask_filters.o `test -f 'mask_filters.cc' || echo '$(srcdir)/'`mask_filters.cc + +libvx_data2d_a-mask_filters.obj: mask_filters.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libvx_data2d_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libvx_data2d_a-mask_filters.obj -MD -MP -MF $(DEPDIR)/libvx_data2d_a-mask_filters.Tpo -c -o libvx_data2d_a-mask_filters.obj `if test -f 'mask_filters.cc'; then $(CYGPATH_W) 'mask_filters.cc'; else $(CYGPATH_W) '$(srcdir)/mask_filters.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libvx_data2d_a-mask_filters.Tpo $(DEPDIR)/libvx_data2d_a-mask_filters.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='mask_filters.cc' object='libvx_data2d_a-mask_filters.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libvx_data2d_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libvx_data2d_a-mask_filters.obj `if test -f 'mask_filters.cc'; then $(CYGPATH_W) 'mask_filters.cc'; else $(CYGPATH_W) '$(srcdir)/mask_filters.cc'; fi` + ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am @@ -651,6 +669,7 @@ distclean: distclean-am -rm -f ./$(DEPDIR)/libvx_data2d_a-data_class.Po -rm -f ./$(DEPDIR)/libvx_data2d_a-level_info.Po -rm -f ./$(DEPDIR)/libvx_data2d_a-leveltype_to_string.Po + -rm -f ./$(DEPDIR)/libvx_data2d_a-mask_filters.Po -rm -f ./$(DEPDIR)/libvx_data2d_a-table_lookup.Po -rm -f ./$(DEPDIR)/libvx_data2d_a-var_info.Po -rm -f Makefile @@ -702,6 +721,7 @@ maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libvx_data2d_a-data_class.Po -rm -f ./$(DEPDIR)/libvx_data2d_a-level_info.Po -rm -f ./$(DEPDIR)/libvx_data2d_a-leveltype_to_string.Po + -rm -f ./$(DEPDIR)/libvx_data2d_a-mask_filters.Po -rm -f ./$(DEPDIR)/libvx_data2d_a-table_lookup.Po -rm -f ./$(DEPDIR)/libvx_data2d_a-var_info.Po -rm -f Makefile diff --git a/src/libcode/vx_pointdata_python/mask_filters.cc b/src/libcode/vx_data2d/mask_filters.cc similarity index 100% rename from src/libcode/vx_pointdata_python/mask_filters.cc rename to src/libcode/vx_data2d/mask_filters.cc diff --git a/src/libcode/vx_pointdata_python/mask_filters.h b/src/libcode/vx_data2d/mask_filters.h similarity index 100% rename from src/libcode/vx_pointdata_python/mask_filters.h rename to src/libcode/vx_data2d/mask_filters.h diff --git a/src/libcode/vx_data2d_grib2/data2d_grib2.cc b/src/libcode/vx_data2d_grib2/data2d_grib2.cc index f86516c2b7..e86ef7ca2c 100644 --- a/src/libcode/vx_data2d_grib2/data2d_grib2.cc +++ b/src/libcode/vx_data2d_grib2/data2d_grib2.cc @@ -198,8 +198,9 @@ bool MetGrib2DataFile::data_plane(VarInfo &vinfo, DataPlane &plane) { if( 1 < listMatch.size() ){ ConcatString msg; for(size_t i=0; i < listMatch.size(); i++) { - msg << "record " << listMatch[i]->RecNum + msg << " Record " << listMatch[i]->RecNum << " field " << listMatch[i]->FieldNum + << ", table 4." << listMatch[i]->PdsTmpl << ": ipdtmpl[" << listMatch[i]->IPDTmpl.n() << "] = "; for(int j=0; j < listMatch[i]->IPDTmpl.n(); j++) { @@ -259,8 +260,9 @@ int MetGrib2DataFile::data_plane_array(VarInfo &vinfo, if( 1 < listMatchExact.size() ){ ConcatString msg; for(size_t i=0; i < listMatchExact.size(); i++) { - msg << "record " << listMatchExact[i]->RecNum + msg << " Record " << listMatchExact[i]->RecNum << " field " << listMatchExact[i]->FieldNum + << ", table 4." << listMatchExact[i]->PdsTmpl << ": ipdtmpl[" << listMatchExact[i]->IPDTmpl.n() << "] = "; for(int j=0; j < listMatchExact[i]->IPDTmpl.n(); j++) { @@ -435,6 +437,14 @@ void MetGrib2DataFile::find_record_matches(VarInfoGrib2* vinfo, continue; } + // test aerosol config file options + if( (!is_bad_data(vinfo->aerosol_type()) && vinfo->aerosol_type() != (*it)->AerosolType ) || + (!is_bad_data(vinfo->aerosol_interval_type()) && vinfo->aerosol_interval_type() != (*it)->AerosolIntervalType ) || + (!is_bad_data(vinfo->aerosol_size_lower()) && !is_eq(vinfo->aerosol_size_lower(), (*it)->AerosolSizeLower )) || + (!is_bad_data(vinfo->aerosol_size_upper()) && !is_eq(vinfo->aerosol_size_upper(), (*it)->AerosolSizeUpper )) ){ + continue; + } + // test ipdtmpl array values if(vinfo->n_ipdtmpl() > 0) { int i, j; @@ -728,11 +738,17 @@ void MetGrib2DataFile::read_grib2_record_list() { rec->PdsTmpl = gfld->ipdtnum; rec->ParmCat = gfld->ipdtmpl[0]; rec->Parm = gfld->ipdtmpl[1]; - rec->Process = gfld->ipdtmpl[2]; + + // get the process id + if( gfld->ipdtnum != 46 && gfld->ipdtnum != 48 ) { + rec->Process = gfld->ipdtmpl[2]; + } // get the level type if( gfld->ipdtnum == 46 ) { rec->LvlTyp = gfld->ipdtmpl[15]; + } else if( gfld->ipdtnum == 48 ) { + rec->LvlTyp = gfld->ipdtmpl[20]; } else { rec->LvlTyp = gfld->ipdtmpl[9]; } @@ -745,10 +761,16 @@ void MetGrib2DataFile::read_grib2_record_list() { // check for template number 46 if( gfld->ipdtnum == 46 ) { rec->LvlVal1 = scaled2dbl(gfld->ipdtmpl[16], gfld->ipdtmpl[17]); - rec->LvlVal2 = rec->LvlVal1; - // check for special fixed level types (1 through 10 or 101) and set the level values to 0 - // Reference: https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table4-5.shtml - } else if( (rec->LvlTyp >= 1 && rec->LvlTyp <= 10) || rec->LvlTyp == 101 ) { + rec->LvlVal2 = rec->LvlVal1; + } + // check for template number 48 + else if( gfld->ipdtnum == 48 ) { + rec->LvlVal1 = scaled2dbl(gfld->ipdtmpl[21], gfld->ipdtmpl[22]); + rec->LvlVal2 = rec->LvlVal1; + } + // check for special fixed level types (1 through 10 or 101) and set the level values to 0 + // Reference: https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table4-5.shtml + else if( (rec->LvlTyp >= 1 && rec->LvlTyp <= 10) || rec->LvlTyp == 101 ) { rec->LvlVal1 = 0; rec->LvlVal2 = 0; } else { @@ -805,6 +827,14 @@ void MetGrib2DataFile::read_grib2_record_list() { rec->PercVal = gfld->ipdtmpl[15]; } + // aerosol type and size for templates 46 and 48 + if( 46 == gfld->ipdtnum || 48 == gfld->ipdtnum ){ + rec->AerosolType = gfld->ipdtmpl[2]; + rec->AerosolIntervalType = gfld->ipdtmpl[3]; + rec->AerosolSizeLower = scaled2dbl(gfld->ipdtmpl[4], gfld->ipdtmpl[5]); + rec->AerosolSizeUpper = scaled2dbl(gfld->ipdtmpl[6], gfld->ipdtmpl[7]); + } + // depending on the template number, determine the reference times if( 8 <= gfld->ipdtnum && 12 >= gfld->ipdtnum ){ diff --git a/src/libcode/vx_data2d_grib2/data2d_grib2.h b/src/libcode/vx_data2d_grib2/data2d_grib2.h index 4191e19728..abf334a837 100644 --- a/src/libcode/vx_data2d_grib2/data2d_grib2.h +++ b/src/libcode/vx_data2d_grib2/data2d_grib2.h @@ -62,6 +62,10 @@ typedef struct { int DerType; int StatType; int PercVal; + int AerosolType; + int AerosolIntervalType; + double AerosolSizeLower; + double AerosolSizeUpper; IntArray IPDTmpl; } Grib2Record; diff --git a/src/libcode/vx_data2d_grib2/var_info_grib2.cc b/src/libcode/vx_data2d_grib2/var_info_grib2.cc index 90f5275bbc..6ea70eecfa 100644 --- a/src/libcode/vx_data2d_grib2/var_info_grib2.cc +++ b/src/libcode/vx_data2d_grib2/var_info_grib2.cc @@ -110,6 +110,11 @@ void VarInfoGrib2::assign(const VarInfoGrib2 &v) { StatType = v.StatType; PercVal = v.PercVal; + AerosolType = v.AerosolType; + AerosolIntervalType = v.AerosolIntervalType; + AerosolSizeLower = v.AerosolSizeLower; + AerosolSizeUpper = v.AerosolSizeUpper; + IPDTmplIndex = v.IPDTmplIndex; IPDTmplVal = v.IPDTmplVal; @@ -137,6 +142,11 @@ void VarInfoGrib2::clear() { StatType = bad_data_int; PercVal = bad_data_int; + AerosolType = bad_data_int; + AerosolIntervalType = bad_data_int; + AerosolSizeLower = bad_data_double; + AerosolSizeUpper = bad_data_double; + IPDTmplIndex.clear(); IPDTmplVal.clear(); @@ -149,18 +159,22 @@ void VarInfoGrib2::dump(ostream &out) const { // Dump out the contents out << "VarInfoGrib2::dump():\n" - << " Record = " << Record << "\n" - << " Discipline = " << Discipline << "\n" - << " MTable = " << MTable << "\n" - << " LTable = " << LTable << "\n" - << " ParmCat = " << ParmCat << "\n" - << " Parm = " << Parm << "\n" - << " PDTmpl = " << PDTmpl << "\n" - << " Process = " << Process << "\n" - << " EnsType = " << EnsType << "\n" - << " DerType = " << DerType << "\n" - << " StatType = " << StatType << "\n" - << " PercVal = " << PercVal << "\n"; + << " Record = " << Record << "\n" + << " Discipline = " << Discipline << "\n" + << " MTable = " << MTable << "\n" + << " LTable = " << LTable << "\n" + << " ParmCat = " << ParmCat << "\n" + << " Parm = " << Parm << "\n" + << " PDTmpl = " << PDTmpl << "\n" + << " Process = " << Process << "\n" + << " EnsType = " << EnsType << "\n" + << " DerType = " << DerType << "\n" + << " StatType = " << StatType << "\n" + << " PercVal = " << PercVal << "\n" + << " AerosolType = " << AerosolType << "\n" + << " AerosolIntervalType = " << AerosolIntervalType << "\n" + << " AerosolSizeLower = " << AerosolSizeLower << "\n" + << " AerosolSizeUpper = " << AerosolSizeUpper << "\n"; out << " IPDTmplIndex:\n"; IPDTmplIndex.dump(out); out << " IPDTmplVal:\n"; @@ -255,6 +269,34 @@ void VarInfoGrib2::set_perc_val(int v) { /////////////////////////////////////////////////////////////////////////////// +void VarInfoGrib2::set_aerosol_type(int v) { + AerosolType = v; + return; +} + +/////////////////////////////////////////////////////////////////////////////// + +void VarInfoGrib2::set_aerosol_interval_type(int v) { + AerosolIntervalType = v; + return; +} + +/////////////////////////////////////////////////////////////////////////////// + +void VarInfoGrib2::set_aerosol_size_lower(double v) { + AerosolSizeLower = v; + return; +} + +/////////////////////////////////////////////////////////////////////////////// + +void VarInfoGrib2::set_aerosol_size_upper(double v) { + AerosolSizeUpper = v; + return; +} + +/////////////////////////////////////////////////////////////////////////////// + void VarInfoGrib2::set_ipdtmpl_index(const IntArray &v) { IPDTmplIndex = v; return; @@ -292,6 +334,11 @@ void VarInfoGrib2::set_dict(Dictionary & dict) { StatType = dict.lookup_int (conf_key_GRIB2_stat_type, false); PercVal = dict.lookup_int (conf_key_GRIB2_perc_val, false); + AerosolType = dict.lookup_int (conf_key_GRIB2_aerosol_type, false); + AerosolIntervalType = dict.lookup_int (conf_key_GRIB2_aerosol_interval_type, false); + AerosolSizeLower = dict.lookup_double(conf_key_GRIB2_aerosol_size_lower, false); + AerosolSizeUpper = dict.lookup_double(conf_key_GRIB2_aerosol_size_upper, false); + IPDTmplIndex = dict.lookup_int_array(conf_key_GRIB2_ipdtmpl_index, false); IPDTmplVal = dict.lookup_int_array(conf_key_GRIB2_ipdtmpl_val, false); diff --git a/src/libcode/vx_data2d_grib2/var_info_grib2.h b/src/libcode/vx_data2d_grib2/var_info_grib2.h index 7f47facf08..619508358b 100644 --- a/src/libcode/vx_data2d_grib2/var_info_grib2.h +++ b/src/libcode/vx_data2d_grib2/var_info_grib2.h @@ -56,6 +56,11 @@ class VarInfoGrib2 : public VarInfo int StatType; // Statistical Processing Type (Table 4.10) int PercVal; // Percentile Value (Octet 35 for Templates 4.6 and 4.10) + int AerosolType; // Aerosol Type (Table 4.46 and 4.48) + int AerosolIntervalType; // Aerosol Interval Type (Table 4.46 and 4.48) + double AerosolSizeLower; // Lower limit of Aerosol Size + double AerosolSizeUpper; // Upper limit of Aerosol Size + IntArray IPDTmplIndex; // Index into the GRIB2 ipdtmpl array IntArray IPDTmplVal; // Corresponding GRIB2 ipdtmpl value @@ -89,6 +94,11 @@ class VarInfoGrib2 : public VarInfo int stat_type() const; int perc_val() const; + int aerosol_type() const; + int aerosol_interval_type() const; + double aerosol_size_lower() const; + double aerosol_size_upper() const; + int n_ipdtmpl() const; int ipdtmpl_index(int) const; int ipdtmpl_val(int) const; @@ -111,6 +121,10 @@ class VarInfoGrib2 : public VarInfo void set_der_type(int); void set_stat_type(int); void set_perc_val(int); + void set_aerosol_type(int); + void set_aerosol_interval_type(int); + void set_aerosol_size_lower(double); + void set_aerosol_size_upper(double); void set_ipdtmpl_index(const IntArray &); void set_ipdtmpl_val(const IntArray &); @@ -145,6 +159,12 @@ inline int VarInfoGrib2::ens_type() const { return(EnsType); } inline int VarInfoGrib2::der_type() const { return(DerType); } inline int VarInfoGrib2::stat_type() const { return(StatType); } inline int VarInfoGrib2::perc_val() const { return(PercVal); } + +inline int VarInfoGrib2::aerosol_type() const { return(AerosolType); } +inline int VarInfoGrib2::aerosol_interval_type() const { return(AerosolIntervalType); } +inline double VarInfoGrib2::aerosol_size_lower() const { return(AerosolSizeLower); } +inline double VarInfoGrib2::aerosol_size_upper() const { return(AerosolSizeUpper); } + inline int VarInfoGrib2::n_ipdtmpl() const { return(IPDTmplIndex.n()); } inline int VarInfoGrib2::ipdtmpl_index(int i) const { diff --git a/src/libcode/vx_data2d_nccf/nccf_file.cc b/src/libcode/vx_data2d_nccf/nccf_file.cc index 9c562bb74f..a1cd259ee0 100644 --- a/src/libcode/vx_data2d_nccf/nccf_file.cc +++ b/src/libcode/vx_data2d_nccf/nccf_file.cc @@ -93,18 +93,18 @@ void NcCfFile::init_from_scratch() { // Initialize the pointers - _ncFile = (NcFile *) 0; - _dims = (NcDim **) 0; - Var = (NcVarInfo *) 0; + _ncFile = (NcFile *) nullptr; + _dims = (NcDim **) nullptr; + Var = (NcVarInfo *) nullptr; _time_var_info = (NcVarInfo *)nullptr; - _xDim = (NcDim *)0; - _yDim = (NcDim *)0; - _tDim = (NcDim *)0; - _latVar = (NcVar *)0; - _lonVar = (NcVar *)0; - _xCoordVar = (NcVar *)0; - _yCoordVar = (NcVar *)0; + _xDim = (NcDim *)nullptr; + _yDim = (NcDim *)nullptr; + _tDim = (NcDim *)nullptr; + _latVar = (NcVar *)nullptr; + _lonVar = (NcVar *)nullptr; + _xCoordVar = (NcVar *)nullptr; + _yCoordVar = (NcVar *)nullptr; // Close any existing file @@ -125,7 +125,7 @@ void NcCfFile::close() if (_ncFile) { delete _ncFile; - _ncFile = (NcFile *)0; + _ncFile = (NcFile *)nullptr; } // Reclaim the dimension pointers @@ -133,21 +133,21 @@ void NcCfFile::close() if (_dims) { delete [] _dims; - _dims = (NcDim **)0; + _dims = (NcDim **)nullptr; } _numDims = 0; _dimNames.clear(); - _xDim = _yDim = _tDim = (NcDim *) 0; + _xDim = _yDim = _tDim = (NcDim *) nullptr; // Reclaim the variable pointers if (Var) { delete [] Var; - Var = (NcVarInfo *)0; + Var = (NcVarInfo *)nullptr; } Nvars = 0; @@ -213,8 +213,8 @@ bool NcCfFile::open(const char * filepath) // Pull out the variables int max_dim_count = 0; - NcVar *z_var = (NcVar *)0; - NcVar *valid_time_var = (NcVar *)0; + NcVar *z_var = (NcVar *)nullptr; + NcVar *valid_time_var = (NcVar *)nullptr; ConcatString att_value; StringArray varNames; @@ -257,9 +257,9 @@ bool NcCfFile::open(const char * filepath) else if( "latitude" == att_value ) _latVar = Var[j].var; else if( "longitude" == att_value ) _lonVar = Var[j].var; else if( ("air_pressure" == att_value || "height" == att_value) - && (0 == z_var) ) z_var = Var[j].var; + && (nullptr==z_var && 1==get_dim_count(Var[j].var))) z_var = Var[j].var; } - if ( Var[j].name == "time" && (valid_time_var == 0)) { + if ( Var[j].name == "time" && (valid_time_var == nullptr)) { valid_time_var = Var[j].var; _time_var_info = &Var[j]; } @@ -325,7 +325,7 @@ bool NcCfFile::open(const char * filepath) } NcVar bounds_time_var; - NcVar *nc_time_var = (NcVar *)0; + NcVar *nc_time_var = (NcVar *)nullptr; bool use_bounds_var = false; ConcatString bounds_var_name; nc_time_var = valid_time_var; @@ -438,6 +438,9 @@ bool NcCfFile::open(const char * filepath) StringArray z_dims; StringArray t_dims; StringArray dimNames; + string var_x_dim_name, var_y_dim_name; + if (IS_VALID_NC_P(_xDim)) var_x_dim_name = GET_NC_NAME_P(_xDim); + if (IS_VALID_NC_P(_yDim)) var_y_dim_name = GET_NC_NAME_P(_yDim); for (int j=0; jvar; } + mlog << Debug(5) << method_name << "coordinate variables:" + << " x=" << (IS_VALID_NC_P(_xCoordVar) ? GET_NC_NAME_P(_xCoordVar) : "N/A") + << ", y=" << (IS_VALID_NC_P(_yCoordVar) ? GET_NC_NAME_P(_yCoordVar) : "N/A") + << ", z=" << (IS_VALID_NC_P(z_var) ? GET_NC_NAME_P(z_var) : "N/A") + << ", t=" << (IS_VALID_NC_P(valid_time_var) ? GET_NC_NAME_P(valid_time_var) : "N/A") + << "\n"; + // Pull out the vertical levels if (IS_VALID_NC_P(z_var)) { @@ -958,7 +968,7 @@ bool NcCfFile::getData(NcVar * v, const LongArray & a, DataPlane & plane) const // find varinfo's bool found = false; - NcVarInfo *var = (NcVarInfo *)0; + NcVarInfo *var = (NcVarInfo *)nullptr; for (int j = 0; j < Nvars; ++j) { @@ -973,7 +983,7 @@ bool NcCfFile::getData(NcVar * v, const LongArray & a, DataPlane & plane) const if (!found) { mlog << Error << "\n" << method_name - << "variable " << (GET_NC_NAME_P(v)) << " not found!\n\n"; + << "variable " << GET_NC_NAME_P(v) << " not found!\n\n"; exit(1); } @@ -989,7 +999,7 @@ bool NcCfFile::getData(NcVar * v, const LongArray & a, DataPlane & plane) const if ( var == nullptr || ((j != var->x_slot) && (j != var->y_slot)) ) { mlog << Error << "\n" << method_name - << "star found in bad slot\n\n"; + << "star found in bad slot (" << j << ") for " << GET_NC_NAME_P(v) << "\n\n"; exit(1); } } @@ -1079,13 +1089,13 @@ bool NcCfFile::getData(NcVar * v, const LongArray & a, DataPlane & plane) const for (int x = 0; x< nx; ++x) { double value = d[offset++]; - + if( is_eq(value, missing_value) || is_eq(value, fill_value) ) { value = bad_data_double; } - + plane.set(value, x, y_offset); - + } // for x } // for y } @@ -1100,9 +1110,9 @@ bool NcCfFile::getData(NcVar * v, const LongArray & a, DataPlane & plane) const if( is_eq(value, missing_value) || is_eq(value, fill_value) ) { value = bad_data_double; } - + plane.set(value, x, y_offset); - + } // for y } // for x } @@ -1161,13 +1171,128 @@ bool NcCfFile::getData(const char *var_name, //////////////////////////////////////////////////////////////////////// +void NcCfFile::find_xy_vars(const string &caller_name) { + + // Look for the x/y dimensions + + for (int dim_num = 0; dim_num < _numDims; ++dim_num) + { + // Get the standard name for the coordinate variable + + const NcVar coord_var = get_var(_ncFile, _dims[dim_num]->getName().c_str()); + if (IS_INVALID_NC(coord_var)) continue; + + ConcatString dim_std_name; + if (!get_var_standard_name(&coord_var, dim_std_name)) { + continue; + } + + // See if this is an X or Y dimension + + if (dim_std_name == x_dim_key_name) + { + _xDim = _dims[dim_num]; + + x_dim_var_name = GET_NC_NAME_P(_xDim); + for (int var_num = 0; var_num < Nvars; ++var_num) + { + if (Var[var_num].name == x_dim_var_name) + { + _xCoordVar = Var[var_num].var; + break; + } + } + } + + if (dim_std_name == y_dim_key_name) + { + _yDim = _dims[dim_num]; + + y_dim_var_name = GET_NC_NAME_P(_yDim); + for (int var_num = 0; var_num < Nvars; ++var_num) + { + if ( Var[var_num].name == y_dim_var_name) + { + _yCoordVar = Var[var_num].var; + break; + } + } + } + + } + + if (_xDim == nullptr || _xCoordVar == nullptr) + { + if (_xCoordVar == nullptr) _xCoordVar = find_var_by_standard_name(x_dim_key_name); + if (_xCoordVar != nullptr && _xDim == nullptr) { + NcDim dim = get_nc_dim(_xCoordVar, (get_dim_count(_xCoordVar)-1)); + for (int dim_num = 0; dim_num < _numDims; ++dim_num) { + if(GET_NC_NAME(dim) == GET_NC_NAME_P(_dims[dim_num])) { + _xDim = _dims[dim_num]; + break; + } + } + } + } + + if (_yDim == nullptr || _yCoordVar == nullptr) + { + if (_yCoordVar == nullptr) _yCoordVar = find_var_by_standard_name(y_dim_key_name); + if (_yCoordVar != nullptr && _yDim == nullptr) { + int dim_offset = get_dim_count(_xCoordVar) - 2; + if (dim_offset < 0) dim_offset = 0; + NcDim dim = get_nc_dim(_yCoordVar, dim_offset); + for (int dim_num = 0; dim_num < _numDims; ++dim_num) { + if(GET_NC_NAME(dim) == GET_NC_NAME_P(_dims[dim_num])) { + _yDim = _dims[dim_num]; + break; + } + } + } + } + + if (_xDim == nullptr) + { + mlog << Error << "\n" << caller_name + << "Didn't find X dimension (projection_x_coordinate) in netCDF file.\n\n"; + exit(1); + } + + if (_yDim == nullptr) + { + mlog << Error << "\n" << caller_name + << "Didn't find Y dimension (projection_y_coordinate) in netCDF file.\n\n"; + exit(1); + } + + if (_xCoordVar == nullptr) + { + mlog << Error << "\n" << caller_name + << "Didn't find X coord variable (" << GET_NC_NAME_P(_xDim) + << ") in netCDF file.\n\n"; + exit(1); + } + + if (_yCoordVar == nullptr) + { + mlog << Error << "\n" << caller_name + << "Didn't find Y coord variable (" << GET_NC_NAME_P(_yDim) + << ") in netCDF file.\n\n"; + exit(1); + } +} + + +//////////////////////////////////////////////////////////////////////// + + NcVarInfo* NcCfFile::find_var_name(const char * var_name) const { for (int i = 0; i < Nvars; i++) if (Var[i].name == var_name) return &Var[i]; - return 0; + return nullptr; } @@ -1200,6 +1325,34 @@ NcVarInfo* NcCfFile::find_var_by_dim_name(const char *dim_name) const //////////////////////////////////////////////////////////////////////// +NcVar *NcCfFile::find_var_by_standard_name(const char *standard_name) const +{ + NcVar *var = nullptr; + if (!var) { + ConcatString att_value; + for (int i=0; igetName().c_str()); - if (IS_INVALID_NC(coord_var)) continue; - - const NcVarAtt *std_name_att = get_nc_att(&coord_var, (string)"standard_name"); - if (IS_INVALID_NC_P(std_name_att)) { - if (std_name_att) delete std_name_att; - continue; - } - - ConcatString dim_std_name; - if (!get_att_value_chars(std_name_att, dim_std_name)) { - if (std_name_att) delete std_name_att; - continue; - } - - if (std_name_att) { - delete std_name_att; - std_name_att = (NcVarAtt *)0; - } - - // See if this is an X or Y dimension - - if ( dim_std_name == x_dim_key_name ) - { - _xDim = _dims[dim_num]; - - x_dim_var_name = GET_NC_NAME_P(_xDim).c_str(); - for (int var_num = 0; var_num < Nvars; ++var_num) - { - if ( Var[var_num].name == x_dim_var_name) - { - _xCoordVar = Var[var_num].var; - break; - } - } - } - - if ( dim_std_name == y_dim_key_name) - { - _yDim = _dims[dim_num]; - - y_dim_var_name = GET_NC_NAME_P(_yDim).c_str(); - for (int var_num = 0; var_num < Nvars; ++var_num) - { - if (Var[var_num].name == y_dim_var_name) - { - _yCoordVar = Var[var_num].var; - break; - } - } - } - - } - - if (_xDim == 0) - { - mlog << Error << "\n" << method_name << " -> " - << "Didn't find X dimension (projection_x_coordinate) in netCDF file.\n\n"; - exit(1); - } - - if (_yDim == 0) - { - mlog << Error << "\n" << method_name << " -> " - << "Didn't find Y dimension (projection_y_coordinate) in netCDF file.\n\n"; - exit(1); - } - - if (_xCoordVar == 0) - { - mlog << Error << "\n" << method_name << " -> " - << "Didn't find X coord variable (" << GET_NC_NAME_P(_xDim) - << ") in netCDF file.\n\n"; - exit(1); - } - - if (_yCoordVar == 0) - { - mlog << Error << "\n" << method_name << " -> " - << "Didn't find Y coord variable (" << GET_NC_NAME_P(_yDim) - << ") in netCDF file.\n\n"; - exit(1); - } - - if (get_data_size(_xCoordVar) != (int) GET_NC_SIZE_P(_xDim) || - get_data_size(_yCoordVar) != (int) GET_NC_SIZE_P(_yDim)) - { - mlog << Error << "\n" << method_name << " -> " - << "Coordinate variables don't match dimension sizes in netCDF file.\n\n"; - exit(1); - } + // Look for the x/y dimensions and x/y coordinate variables + find_xy_vars(method_name); // Handle coordinate variable units @@ -1824,95 +1881,8 @@ void NcCfFile::get_grid_mapping_lambert_conformal_conic(const NcVar *grid_mappin exit(1); } - // Look for the x/y dimensions - - for (int dim_num = 0; dim_num < _numDims; ++dim_num) - { - // Get the standard name for the coordinate variable - - const NcVar coord_var = get_var(_ncFile, _dims[dim_num]->getName().c_str()); - if (IS_INVALID_NC(coord_var)) continue; - - const NcVarAtt *std_name_att = get_nc_att(&coord_var, (string)"standard_name"); - if (IS_INVALID_NC_P(std_name_att)) { - if (std_name_att) delete std_name_att; - continue; - } - - ConcatString dim_std_name; - if (!get_att_value_chars(std_name_att, dim_std_name)) { - if (std_name_att) delete std_name_att; - continue; - } - - if (std_name_att) { - delete std_name_att; - std_name_att = (NcVarAtt *)0; - } - - // See if this is an X or Y dimension - - if ( dim_std_name == x_dim_key_name ) - { - _xDim = _dims[dim_num]; - - x_dim_var_name = GET_NC_NAME_P(_xDim).c_str(); - for (int var_num = 0; var_num < Nvars; ++var_num) - { - if ( Var[var_num].name == x_dim_var_name) - { - _xCoordVar = Var[var_num].var; - break; - } - } - } - - if ( dim_std_name == y_dim_key_name) - { - _yDim = _dims[dim_num]; - - y_dim_var_name = GET_NC_NAME_P(_yDim).c_str(); - for (int var_num = 0; var_num < Nvars; ++var_num) - { - if (Var[var_num].name == y_dim_var_name) - { - _yCoordVar = Var[var_num].var; - break; - } - } - } - - } - - if (_xDim == 0) - { - mlog << Error << "\n" << method_name << " -> " - << "Didn't find X dimension (projection_x_coordinate) in netCDF file.\n\n"; - exit(1); - } - - if (_yDim == 0) - { - mlog << Error << "\n" << method_name << " -> " - << "Didn't find Y dimension (projection_y_coordinate) in netCDF file.\n\n"; - exit(1); - } - - if (_xCoordVar == 0) - { - mlog << Error << "\n" << method_name << " -> " - << "Didn't find X coord variable (" << GET_NC_NAME_P(_xDim) - << ") in netCDF file.\n\n"; - exit(1); - } - - if (_yCoordVar == 0) - { - mlog << Error << "\n" << method_name << " -> " - << "Didn't find Y coord variable (" << GET_NC_NAME_P(_yDim) - << ") in netCDF file.\n\n"; - exit(1); - } + // Look for the x/y dimensions and x/y coordinate variables + find_xy_vars(method_name); if (get_data_size(_xCoordVar) != (int) GET_NC_SIZE_P(_xDim) || get_data_size(_yCoordVar) != (int) GET_NC_SIZE_P(_yDim)) @@ -2112,7 +2082,7 @@ void NcCfFile::get_grid_mapping_latitude_longitude(const NcVar *grid_mapping_var if (is_nc_unit_latitude(dim_units.c_str())) { - if (_yDim == 0) + if (_yDim == nullptr) { _yDim = _dims[dim_num]; @@ -2136,7 +2106,7 @@ void NcCfFile::get_grid_mapping_latitude_longitude(const NcVar *grid_mapping_var if (is_nc_unit_longitude(dim_units.c_str())) { - if (_xDim == 0) + if (_xDim == nullptr) { _xDim = _dims[dim_num]; @@ -2160,21 +2130,21 @@ void NcCfFile::get_grid_mapping_latitude_longitude(const NcVar *grid_mapping_var } - if (_xDim == 0) + if (_xDim == nullptr) { mlog << Error << "\n" << method_name << " -> " << "Didn't find X dimension (degrees_east) in netCDF file.\n\n"; exit(1); } - if (_yDim == 0) + if (_yDim == nullptr) { mlog << Error << "\n" << method_name << " -> " << "Didn't find Y dimension (degrees_north) in netCDF file.\n\n"; exit(1); } - if (_xCoordVar == 0) + if (_xCoordVar == nullptr) { mlog << Error << "\n" << method_name << " -> " << "Didn't find X coord variable (" << GET_NC_NAME_P(_xDim) @@ -2182,7 +2152,7 @@ void NcCfFile::get_grid_mapping_latitude_longitude(const NcVar *grid_mapping_var exit(1); } - if (_yCoordVar == 0) + if (_yCoordVar == nullptr) { mlog << Error << "\n" << method_name << " -> " << "Didn't find Y coord variable (" << GET_NC_NAME_P(_yDim) @@ -2308,85 +2278,8 @@ void NcCfFile::get_grid_mapping_polar_stereographic(const NcVar *grid_mapping_va exit(1); } - // Look for the x/y dimensions - - for (int dim_num = 0; dim_num < _numDims; ++dim_num) - { - // Get the standard name for the coordinate variable - - const NcVar coord_var = get_var(_ncFile, _dims[dim_num]->getName().c_str()); - if (IS_INVALID_NC(coord_var)) - continue; - - ConcatString dim_std_name; - const NcVarAtt *std_name_att = get_nc_att(&coord_var, standard_name_att_name); - if (!get_var_standard_name(&coord_var, dim_std_name)) { - continue; - } - - // See if this is an X or Y dimension - - if ( dim_std_name == x_dim_key_name) - { - _xDim = _dims[dim_num]; - - x_dim_var_name = GET_NC_NAME_P(_xDim).c_str(); - for (int var_num = 0; var_num < Nvars; ++var_num) - { - if (Var[var_num].name == x_dim_var_name) - { - _xCoordVar = Var[var_num].var; - break; - } - } - } - - if ( dim_std_name == y_dim_key_name) - { - _yDim = _dims[dim_num]; - - y_dim_var_name = GET_NC_NAME_P(_yDim).c_str(); - for (int var_num = 0; var_num < Nvars; ++var_num) - { - if ( Var[var_num].name == y_dim_var_name) - { - _yCoordVar = Var[var_num].var; - break; - } - } - } - - } - - if (_xDim == 0) - { - mlog << Error << "\n" << method_name - << "Didn't find X dimension (projection_x_coordinate) in netCDF file.\n\n"; - exit(1); - } - - if (_yDim == 0) - { - mlog << Error << "\n" << method_name - << "Didn't find Y dimension (projection_y_coordinate) in netCDF file.\n\n"; - exit(1); - } - - if (_xCoordVar == 0) - { - mlog << Error << "\n" << method_name - << "Didn't find X coord variable (" << GET_NC_NAME_P(_xDim) - << ") in netCDF file.\n\n"; - exit(1); - } - - if (_yCoordVar == 0) - { - mlog << Error << "\n" << method_name - << "Didn't find Y coord variable (" << GET_NC_NAME_P(_yDim) - << ") in netCDF file.\n\n"; - exit(1); - } + // Look for the x/y dimensions and x/y coordinate variables + find_xy_vars(method_name); if (get_data_size(_xCoordVar) != (int) GET_NC_SIZE_P(_xDim) || get_data_size(_yCoordVar) != (int) GET_NC_SIZE_P(_yDim)) @@ -2749,7 +2642,7 @@ void NcCfFile::get_grid_mapping_rotated_latitude_longitude(const NcVar *grid_map if (dim_standard_name == "grid_latitude") { - if (_yDim == 0) + if (_yDim == nullptr) { _yDim = _dims[dim_num]; @@ -2774,7 +2667,7 @@ void NcCfFile::get_grid_mapping_rotated_latitude_longitude(const NcVar *grid_map if (dim_standard_name == "grid_longitude") { - if (_xDim == 0) + if (_xDim == nullptr) { _xDim = _dims[dim_num]; @@ -2798,21 +2691,21 @@ void NcCfFile::get_grid_mapping_rotated_latitude_longitude(const NcVar *grid_map } - if (_xDim == 0) + if (_xDim == nullptr) { mlog << Error << "\n" << method_name << " -> " << "Didn't find X dimension (degrees_east) in netCDF file.\n\n"; exit(1); } - if (_yDim == 0) + if (_yDim == nullptr) { mlog << Error << "\n" << method_name << " -> " << "Didn't find Y dimension (degrees_north) in netCDF file.\n\n"; exit(1); } - if (_xCoordVar == 0) + if (_xCoordVar == nullptr) { mlog << Error << "\n" << method_name << " -> " << "Didn't find X coord variable (" << GET_NC_NAME_P(_xDim) @@ -2820,7 +2713,7 @@ void NcCfFile::get_grid_mapping_rotated_latitude_longitude(const NcVar *grid_map exit(1); } - if (_yCoordVar == 0) + if (_yCoordVar == nullptr) { mlog << Error << "\n" << method_name << " -> " << "Didn't find Y coord variable (" << GET_NC_NAME_P(_yDim) @@ -3001,79 +2894,25 @@ void NcCfFile::get_grid_mapping_geostationary( exit(1); } - // Look for the x/y dimensions - - for (int dim_num = 0; dim_num < _numDims; ++dim_num) - { - // Get the standard name for the coordinate variable - - const NcVar coord_var = get_var(_ncFile, _dims[dim_num]->getName().c_str()); - if (IS_INVALID_NC(coord_var)) - continue; - - const NcVarAtt *std_name_att = get_nc_att(&coord_var, standard_name_att_name); - if (IS_INVALID_NC_P(std_name_att)) { - if (std_name_att) delete std_name_att; - continue; - } - ConcatString dim_std_name; - if (!get_att_value_chars(std_name_att, dim_std_name)) { - if (std_name_att) delete std_name_att; - continue; - } - if (std_name_att) delete std_name_att; - - - // See if this is an X or Y dimension - - if ( dim_std_name == x_dim_key_name ) - { - _xDim = _dims[dim_num]; - - x_dim_var_name = GET_NC_NAME_P(_xDim).c_str(); - for (int var_num = 0; var_num < Nvars; ++var_num) - { - if ( Var[var_num].name == x_dim_var_name ) - { - _xCoordVar = Var[var_num].var; - break; - } - } - } - - if ( dim_std_name == y_dim_key_name ) - { - _yDim = _dims[dim_num]; - - y_dim_var_name = GET_NC_NAME_P(_yDim).c_str(); - for (int var_num = 0; var_num < Nvars; ++var_num) - { - if ( Var[var_num].name == y_dim_var_name ) - { - _yCoordVar = Var[var_num].var; - break; - } - } - } - - } + // Look for the x/y dimensions and x/y coordinate variables + find_xy_vars(method_name); bool do_exit = false; - if (_xDim == 0) + if (_xDim == nullptr) { mlog << Error << "\n" << method_name << "-> Didn't find X dimension (projection_x_coordinate) in netCDF file.\n\n"; do_exit = true; } - if (_yDim == 0) + if (_yDim == nullptr) { mlog << Error << "\n" << method_name << "-> Didn't find Y dimension (projection_y_coordinate) in netCDF file.\n\n"; do_exit = true; } - if (_xCoordVar == 0) + if (_xCoordVar == nullptr) { mlog << Error << "\n" << method_name << "-> Didn't find X coord variable (" << GET_NC_NAME_P(_xDim) @@ -3081,7 +2920,7 @@ void NcCfFile::get_grid_mapping_geostationary( do_exit = true; } - if (_yCoordVar == 0) + if (_yCoordVar == nullptr) { mlog << Error << "\n" << method_name << "-> Didn't find Y coord variable (" << GET_NC_NAME_P(_yDim) @@ -3124,8 +2963,8 @@ void NcCfFile::get_grid_mapping_geostationary( break; } } - NcVar *var_x_bound = (NcVar *)0; - NcVar *var_y_bound = (NcVar *)0; + NcVar *var_x_bound = (NcVar *)nullptr; + NcVar *var_y_bound = (NcVar *)nullptr; for (int j=0; j " << "collect GRID info from \"" << GET_NC_NAME_P(data_var) << "\".\n\n"; - + NcVarAtt *coordinates_att = get_nc_att(data_var, coordinates_att_name); if (IS_VALID_NC_P(coordinates_att)) { @@ -3262,7 +3101,7 @@ bool NcCfFile::get_grid_from_coordinates(const NcVar *data_var) { } } - if (_xCoordVar == 0) { + if (_xCoordVar == nullptr) { mlog << Error << "\n" << method_name << " -> " << "Didn't find X coord variable (" << x_dim_var_name << ") in netCDF file.\n\n"; @@ -3270,7 +3109,7 @@ bool NcCfFile::get_grid_from_coordinates(const NcVar *data_var) { return true; } - if (_yCoordVar == 0) { + if (_yCoordVar == nullptr) { mlog << Error << "\n" << method_name << " -> " << "Didn't find Y coord variable (" << y_dim_var_name << ") in netCDF file.\n\n"; @@ -3312,7 +3151,7 @@ bool NcCfFile::get_grid_from_coordinates(const NcVar *data_var) { if (coordinates_att) { delete coordinates_att; - coordinates_att = (NcVarAtt *)0; + coordinates_att = (NcVarAtt *)nullptr; } get_grid_from_lat_lon_vars(_yCoordVar, _xCoordVar, lat_counts, lon_counts); } @@ -3348,7 +3187,7 @@ bool NcCfFile::get_grid_from_dimensions() else if (dim_lon_nt == dim_name) { dim_name = var_lon_nt; } - + if (!has_var(_ncFile, dim_name.c_str())) { mlog << Debug(4) << method_name << " -> " << "The coordinate variable \"" << _dims[dim_num]->getName() << "\" does not exist.\n"; @@ -3367,7 +3206,7 @@ bool NcCfFile::get_grid_from_dimensions() if (is_nc_unit_latitude(dim_units.c_str())) { - if (_yDim == 0) + if (_yDim == nullptr) { _yDim = _dims[dim_num]; @@ -3396,7 +3235,7 @@ bool NcCfFile::get_grid_from_dimensions() } else if (is_nc_unit_longitude(dim_units.c_str())) { - if (_xDim == 0) + if (_xDim == nullptr) { _xDim = _dims[dim_num]; @@ -3426,10 +3265,10 @@ bool NcCfFile::get_grid_from_dimensions() } - if (_xDim == 0 || _yDim == 0) + if (_xDim == nullptr || _yDim == nullptr) return false; - if (_xCoordVar == 0) + if (_xCoordVar == nullptr) { mlog << Error << "\n" << method_name << " -> " << "Didn't find X coord variable (" << GET_NC_NAME_P(_xDim) @@ -3437,7 +3276,7 @@ bool NcCfFile::get_grid_from_dimensions() exit(1); } - if (_yCoordVar == 0) + if (_yCoordVar == nullptr) { mlog << Error << "\n" << method_name << " -> " << "Didn't find Y coord variable (" << GET_NC_NAME_P(_yDim) diff --git a/src/libcode/vx_data2d_nccf/nccf_file.h b/src/libcode/vx_data2d_nccf/nccf_file.h index fde3b48e28..02d12c6d5a 100644 --- a/src/libcode/vx_data2d_nccf/nccf_file.h +++ b/src/libcode/vx_data2d_nccf/nccf_file.h @@ -159,6 +159,9 @@ class NcCfFile { // Read the grid information from the netCDF file and fill in the // grid member with that information. + void find_xy_vars(const std::string &); + netCDF::NcVar *find_var_by_standard_name(const char *standard_name) const; + void read_netcdf_grid(); void get_grid_from_grid_mapping(const netCDF::NcVarAtt *grid_mapping_att); diff --git a/src/libcode/vx_pointdata_python/Makefile.am b/src/libcode/vx_pointdata_python/Makefile.am index 4045badcde..5579afc6fe 100644 --- a/src/libcode/vx_pointdata_python/Makefile.am +++ b/src/libcode/vx_pointdata_python/Makefile.am @@ -12,7 +12,6 @@ include ${top_srcdir}/Make-include noinst_LIBRARIES = libvx_pointdata_python.a libvx_pointdata_python_a_SOURCES = \ - mask_filters.h mask_filters.cc \ pointdata_python.h pointdata_python.cc \ pointdata_from_array.h pointdata_from_array.cc pointdata_from_array.hpp \ python_pointdata.h python_pointdata.cc python_pointdata.hpp diff --git a/src/libcode/vx_pointdata_python/Makefile.in b/src/libcode/vx_pointdata_python/Makefile.in index ef7b4a4c67..9df1cb65f5 100644 --- a/src/libcode/vx_pointdata_python/Makefile.in +++ b/src/libcode/vx_pointdata_python/Makefile.in @@ -108,7 +108,6 @@ am__v_AR_1 = libvx_pointdata_python_a_AR = $(AR) $(ARFLAGS) libvx_pointdata_python_a_LIBADD = am_libvx_pointdata_python_a_OBJECTS = \ - libvx_pointdata_python_a-mask_filters.$(OBJEXT) \ libvx_pointdata_python_a-pointdata_python.$(OBJEXT) \ libvx_pointdata_python_a-pointdata_from_array.$(OBJEXT) \ libvx_pointdata_python_a-python_pointdata.$(OBJEXT) @@ -130,7 +129,6 @@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = \ - ./$(DEPDIR)/libvx_pointdata_python_a-mask_filters.Po \ ./$(DEPDIR)/libvx_pointdata_python_a-pointdata_from_array.Po \ ./$(DEPDIR)/libvx_pointdata_python_a-pointdata_python.Po \ ./$(DEPDIR)/libvx_pointdata_python_a-python_pointdata.Po @@ -353,7 +351,6 @@ MAINTAINERCLEANFILES = Makefile.in # The library noinst_LIBRARIES = libvx_pointdata_python.a libvx_pointdata_python_a_SOURCES = \ - mask_filters.h mask_filters.cc \ pointdata_python.h pointdata_python.cc \ pointdata_from_array.h pointdata_from_array.cc pointdata_from_array.hpp \ python_pointdata.h python_pointdata.cc python_pointdata.hpp @@ -407,7 +404,6 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvx_pointdata_python_a-mask_filters.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvx_pointdata_python_a-pointdata_from_array.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvx_pointdata_python_a-pointdata_python.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvx_pointdata_python_a-python_pointdata.Po@am__quote@ # am--include-marker @@ -432,20 +428,6 @@ am--depfiles: $(am__depfiles_remade) @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` -libvx_pointdata_python_a-mask_filters.o: mask_filters.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libvx_pointdata_python_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libvx_pointdata_python_a-mask_filters.o -MD -MP -MF $(DEPDIR)/libvx_pointdata_python_a-mask_filters.Tpo -c -o libvx_pointdata_python_a-mask_filters.o `test -f 'mask_filters.cc' || echo '$(srcdir)/'`mask_filters.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libvx_pointdata_python_a-mask_filters.Tpo $(DEPDIR)/libvx_pointdata_python_a-mask_filters.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='mask_filters.cc' object='libvx_pointdata_python_a-mask_filters.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libvx_pointdata_python_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libvx_pointdata_python_a-mask_filters.o `test -f 'mask_filters.cc' || echo '$(srcdir)/'`mask_filters.cc - -libvx_pointdata_python_a-mask_filters.obj: mask_filters.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libvx_pointdata_python_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libvx_pointdata_python_a-mask_filters.obj -MD -MP -MF $(DEPDIR)/libvx_pointdata_python_a-mask_filters.Tpo -c -o libvx_pointdata_python_a-mask_filters.obj `if test -f 'mask_filters.cc'; then $(CYGPATH_W) 'mask_filters.cc'; else $(CYGPATH_W) '$(srcdir)/mask_filters.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libvx_pointdata_python_a-mask_filters.Tpo $(DEPDIR)/libvx_pointdata_python_a-mask_filters.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='mask_filters.cc' object='libvx_pointdata_python_a-mask_filters.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libvx_pointdata_python_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libvx_pointdata_python_a-mask_filters.obj `if test -f 'mask_filters.cc'; then $(CYGPATH_W) 'mask_filters.cc'; else $(CYGPATH_W) '$(srcdir)/mask_filters.cc'; fi` - libvx_pointdata_python_a-pointdata_python.o: pointdata_python.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libvx_pointdata_python_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libvx_pointdata_python_a-pointdata_python.o -MD -MP -MF $(DEPDIR)/libvx_pointdata_python_a-pointdata_python.Tpo -c -o libvx_pointdata_python_a-pointdata_python.o `test -f 'pointdata_python.cc' || echo '$(srcdir)/'`pointdata_python.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libvx_pointdata_python_a-pointdata_python.Tpo $(DEPDIR)/libvx_pointdata_python_a-pointdata_python.Po @@ -612,8 +594,7 @@ clean: clean-am clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am - -rm -f ./$(DEPDIR)/libvx_pointdata_python_a-mask_filters.Po - -rm -f ./$(DEPDIR)/libvx_pointdata_python_a-pointdata_from_array.Po + -rm -f ./$(DEPDIR)/libvx_pointdata_python_a-pointdata_from_array.Po -rm -f ./$(DEPDIR)/libvx_pointdata_python_a-pointdata_python.Po -rm -f ./$(DEPDIR)/libvx_pointdata_python_a-python_pointdata.Po -rm -f Makefile @@ -661,8 +642,7 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am - -rm -f ./$(DEPDIR)/libvx_pointdata_python_a-mask_filters.Po - -rm -f ./$(DEPDIR)/libvx_pointdata_python_a-pointdata_from_array.Po + -rm -f ./$(DEPDIR)/libvx_pointdata_python_a-pointdata_from_array.Po -rm -f ./$(DEPDIR)/libvx_pointdata_python_a-pointdata_python.Po -rm -f ./$(DEPDIR)/libvx_pointdata_python_a-python_pointdata.Po -rm -f Makefile diff --git a/src/libcode/vx_tc_util/prob_pair_info.cc b/src/libcode/vx_tc_util/prob_pair_info.cc deleted file mode 100644 index 754ba05df2..0000000000 --- a/src/libcode/vx_tc_util/prob_pair_info.cc +++ /dev/null @@ -1,225 +0,0 @@ -// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* -// ** Copyright UCAR (c) 1992 - 2023 -// ** University Corporation for Atmospheric Research (UCAR) -// ** National Center for Atmospheric Research (NCAR) -// ** Research Applications Lab (RAL) -// ** P.O.Box 3000, Boulder, Colorado, 80307-3000, USA -// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* - -//////////////////////////////////////////////////////////////////////// - -using namespace std; - -#include -#include -#include -#include -#include -#include - -#include "prob_pair_info_base.h" -#include "prob_rirw_pair_info.h" -#include "prob_pair_info_array.h" - -//////////////////////////////////////////////////////////////////////// -// -// Code for class ProbPairInfoArray -// -//////////////////////////////////////////////////////////////////////// - -ProbPairInfoArray::ProbPairInfoArray() { - - init_from_scratch(); -} - -//////////////////////////////////////////////////////////////////////// - -ProbPairInfoArray::~ProbPairInfoArray() { - - clear(); -} - -//////////////////////////////////////////////////////////////////////// - -ProbPairInfoArray::ProbPairInfoArray(const ProbPairInfoArray & t) { - - init_from_scratch(); - - assign(t); -} - -//////////////////////////////////////////////////////////////////////// - -ProbPairInfoArray & ProbPairInfoArray::operator=(const ProbPairInfoArray & t) { - - if(this == &t) return(*this); - - assign(t); - - return(*this); -} - -//////////////////////////////////////////////////////////////////////// - -void ProbPairInfoArray::init_from_scratch() { - - clear(); - - return; -} - -//////////////////////////////////////////////////////////////////////// - -void ProbPairInfoArray::clear() { - - // Deallocate memory for each entry - for(int i=0; idump(out, indent_depth+1); - } - - out << flush; - - return; -} - -//////////////////////////////////////////////////////////////////////// - -ConcatString ProbPairInfoArray::serialize() const { - ConcatString s; - - s << "ProbPairInfoArray: " - << "NPairs = " << n_pairs(); - - return(s); -} - -//////////////////////////////////////////////////////////////////////// - -ConcatString ProbPairInfoArray::serialize_r(int indent_depth) const { - Indent prefix(indent_depth); - ConcatString s; - - s << prefix << serialize() << ", Pairs:\n"; - - for(int i=0; iserialize_r(i+1, indent_depth+1); - } - - return(s); -} - -//////////////////////////////////////////////////////////////////////// - -void ProbPairInfoArray::assign(const ProbPairInfoArray &p) { - - clear(); - - // Allocate space and copy each element - for(int i=0; itype())); - *(Pair[i]) = *(p.Pair[i]); - } - - return; -} - -//////////////////////////////////////////////////////////////////////// - -const ProbPairInfoBase * ProbPairInfoArray::operator[](int n) const { - - // Check range - if((n < 0) || (n >= Pair.size())) { - mlog << Error - << "\nProbPairInfoArray::operator[](int) -> " - << "range check error for index value " << n << "\n\n"; - exit(1); - } - - return(Pair[n]); -} - -//////////////////////////////////////////////////////////////////////// - -bool ProbPairInfoArray::add(const ATCFProbLine &l, bool check_dup) { - - // Check for no pairs or a mismatch with the latest entry - if( Pair.size() == 0 || - (Pair.size() > 0 && !Pair[Pair.size()-1]->add(l, check_dup))) { - - // Allocate and store new pair - Pair.push_back(new_prob_pair(l.type())); - - // Add current line to new pair - if(!Pair[Pair.size()-1]->add(l, check_dup)) { - mlog << Warning - << "\nbool ProbPairInfoArray::add(const ATCFProbLine &l, bool check_dup) -> " - << "cannot store ATCFProbLine:\n" << l.get_line() << "\n\n"; - return(false); - } - } - - return(true); -} - -//////////////////////////////////////////////////////////////////////// - -bool ProbPairInfoArray::add(const ProbPairInfoBase *p) { - ProbPairInfoBase *new_pair; - - // Allocate new pair, set its value, and store it - new_pair = new_prob_pair(p->type()); - *(new_pair) = *(p); - Pair.push_back(new_pair); - - return(true); -} - -//////////////////////////////////////////////////////////////////////// - -ProbPairInfoBase * new_prob_pair(const ATCFLineType t) { - ProbPairInfoBase *new_pair = (ProbPairInfoBase *) 0; - - switch(t) { - case ATCFLineType_ProbRI: - new_pair = new ProbRIRWPairInfo; - break; - - default: - mlog << Warning - << "\nProbPairInfoBase * new_prob_pair(const ATCFLineType t) -> " - << "unexpected ATCF line type (" - << atcflinetype_to_string(t) << ")\n\n"; - break; - } - - if(!new_pair) { - mlog << Error - << "\nProbPairInfoBase * new_prob_pair(const ATCFLineType t) -> " - << "memory allocation error!\n\n"; - exit(1); - } - - return(new_pair); -} - -//////////////////////////////////////////////////////////////////////// diff --git a/src/libcode/vx_tc_util/prob_pair_info.h b/src/libcode/vx_tc_util/prob_pair_info.h deleted file mode 100644 index e83626527d..0000000000 --- a/src/libcode/vx_tc_util/prob_pair_info.h +++ /dev/null @@ -1,81 +0,0 @@ -// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* -// ** Copyright UCAR (c) 1992 - 2023 -// ** University Corporation for Atmospheric Research (UCAR) -// ** National Center for Atmospheric Research (NCAR) -// ** Research Applications Lab (RAL) -// ** P.O.Box 3000, Boulder, Colorado, 80307-3000, USA -// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* - -//////////////////////////////////////////////////////////////////////// - -#ifndef __VX_PROB_PAIR_INFO_H__ -#define __VX_PROB_PAIR_INFO_H__ - -//////////////////////////////////////////////////////////////////////// - -#include -#include - -#include "atcf_prob_line.h" -#include "prob_info_array.h" - -#include "vx_util.h" - -//////////////////////////////////////////////////////////////////////// -// -// ProbPairInfo class stores a ProbInfoBase class pointer and a -// verifying -// -//////////////////////////////////////////////////////////////////////// - -class ProbPairInfo { - - protected: - - void init_from_scratch(); - void assign(const ProbPairInfo &); - - vector Pair; - - public: - - ProbPairInfo(); - ~ProbPairInfo(); - ProbPairInfo(const ProbPairInfo &); - ProbPairInfo & operator=(const ProbPairInfo &); - - void clear(); - - void dump(std::ostream &, int = 0) const; - ConcatString serialize() const; - ConcatString serialize_r(int = 0) const; - - // - // get stuff - // - - const ProbPairInfoBase * operator[](int) const; - int n_pairs() const; - - // - // do stuff - // - - bool add(const ATCFProbLine &, bool check_dup = false); - bool add(const ProbPairInfoBase *); - -}; - -//////////////////////////////////////////////////////////////////////// - -inline int ProbPairInfo::n_pairs() const { return(Pair.size()); } - -//////////////////////////////////////////////////////////////////////// - -extern ProbPairInfoBase * new_prob_pair(const ATCFLineType); - -//////////////////////////////////////////////////////////////////////// - -#endif /* __VX_PROB_PAIR_INFO_H__ */ - -//////////////////////////////////////////////////////////////////////// diff --git a/src/tools/other/wwmca_tool/wwmca_utils.cc b/src/tools/other/wwmca_tool/wwmca_utils.cc deleted file mode 100644 index 2be5deb979..0000000000 --- a/src/tools/other/wwmca_tool/wwmca_utils.cc +++ /dev/null @@ -1,181 +0,0 @@ -// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* -// ** Copyright UCAR (c) 1992 - 2023 -// ** University Corporation for Atmospheric Research (UCAR) -// ** National Center for Atmospheric Research (NCAR) -// ** Research Applications Lab (RAL) -// ** P.O.Box 3000, Boulder, Colorado, 80307-3000, USA -// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* - - -//////////////////////////////////////////////////////////////////////// - - -static const bool west_longitude_positive = true; - - -//////////////////////////////////////////////////////////////////////// - - -using namespace std; - -#include -#include -#include -#include -#include - -#include "wwmca_utils.h" - - -//////////////////////////////////////////////////////////////////////// - - -GridHemisphere find_grid_hemisphere(const Grid & grid) - -{ - -int j; -double x, y, lat, lon; -bool nh = false; -bool sh = false; -const int Nx = grid.nx(); -const int Ny = grid.ny(); - - // - // bottom, top - // - -for (j=0; j 0.0 ) nh = true; - if ( lat < 0.0 ) sh = true; - - grid.xy_to_latlon(x, Ny - 1.0, lat, lon); - - if ( lat > 0.0 ) nh = true; - if ( lat < 0.0 ) sh = true; - -} - -if ( nh && sh ) return ( both_hemispheres ); - - // - // left, right - // - -for (j=0; j 0.0 ) nh = true; - if ( lat < 0.0 ) sh = true; - - grid.xy_to_latlon(Nx - 1.0, y, lat, lon); - - if ( lat > 0.0 ) nh = true; - if ( lat < 0.0 ) sh = true; - -} - -if ( nh && sh ) return ( both_hemispheres ); - -if ( nh ) return ( north_hemisphere ); -if ( sh ) return ( south_hemisphere ); - - // - // done - // - -return ( no_hemisphere ); // this shouldn't happen - -} - - -//////////////////////////////////////////////////////////////////////// - - -Interpolator * get_interpolator(wwmca_regrid_Conf & config) - -{ - -int width, good_percent; -int n_good_needed; -ConcatString method; -Ave_Interp ave; -Nearest_Interp nearest; -Min_Interp mini; -Max_Interp maxi; - - -width = config.interp_width(); - -good_percent = config.good_percent(); - -n_good_needed = nint(ceil(0.01*good_percent*width)); - -method = (const char *) config.interp_method(); - - // - // get to work - // - -if ( method == "average" ) { - - ave.set_size(width); - - ave.set_ngood_needed(n_good_needed); - - return ( ave.copy() ); - -} - - -if ( method == "nearest" ) { - - nearest.set_size(width); - - nearest.set_ngood_needed(n_good_needed); - - return ( nearest.copy() ); - -} - - -if ( method == "min" ) { - - mini.set_size(width); - - mini.set_ngood_needed(n_good_needed); - - return ( mini.copy() ); - -} - - -if ( method == "max" ) { - - maxi.set_size(width); - - maxi.set_ngood_needed(n_good_needed); - - return ( maxi.copy() ); - -} - - - // - // nope - // - -return ( (Interpolator *) 0 ); - -} - - -//////////////////////////////////////////////////////////////////////// diff --git a/src/tools/other/wwmca_tool/wwmca_utils.h b/src/tools/other/wwmca_tool/wwmca_utils.h deleted file mode 100644 index 3728c9ae81..0000000000 --- a/src/tools/other/wwmca_tool/wwmca_utils.h +++ /dev/null @@ -1,77 +0,0 @@ -// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* -// ** Copyright UCAR (c) 1992 - 2023 -// ** University Corporation for Atmospheric Research (UCAR) -// ** National Center for Atmospheric Research (NCAR) -// ** Research Applications Lab (RAL) -// ** P.O.Box 3000, Boulder, Colorado, 80307-3000, USA -// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* - - -//////////////////////////////////////////////////////////////////////// - - -#ifndef __WWMCA_UTILS_H__ -#define __WWMCA_UTILS_H__ - - -//////////////////////////////////////////////////////////////////////// - - -#include "wwmca_regrid_Conf.h" - -#include "interp_base.h" -#include "max_interp.h" -#include "min_interp.h" -#include "ave_interp.h" -#include "nearest_interp.h" - -#include "vx_grid.h" - - -//////////////////////////////////////////////////////////////////////// - - - // - // Is the given grid confined to either the north - // - // or south hemisphere, or does it straddle the - // - // equator? - // - - -extern GridHemisphere find_grid_hemisphere(const Grid &); - - -//////////////////////////////////////////////////////////////////////// - - - // - // Create an interpolator instance given the info - // - // from the config file - // - - -extern Interpolator * get_interpolator(wwmca_regrid_Conf &); - - -//////////////////////////////////////////////////////////////////////// - - - // - // Create the "to" grid from the grid info string in the config file - // - -// extern GridInfo get_grid(const char * gridinfo_string); - - -//////////////////////////////////////////////////////////////////////// - - -#endif /* __WWMCA_UTILS_H__ */ - - -//////////////////////////////////////////////////////////////////////// - - diff --git a/src/tools/tc_utils/rmw_analysis/rmw_analysis_utils.cc b/src/tools/tc_utils/rmw_analysis/rmw_analysis_utils.cc deleted file mode 100644 index c06c7b219a..0000000000 --- a/src/tools/tc_utils/rmw_analysis/rmw_analysis_utils.cc +++ /dev/null @@ -1,6 +0,0 @@ -#include "rmw_analysis_utils.h" - -bool filter_track_point() { - - return true; -} diff --git a/src/tools/tc_utils/rmw_analysis/rmw_analysis_utils.h b/src/tools/tc_utils/rmw_analysis/rmw_analysis_utils.h deleted file mode 100644 index 217a08f9c1..0000000000 --- a/src/tools/tc_utils/rmw_analysis/rmw_analysis_utils.h +++ /dev/null @@ -1 +0,0 @@ -bool filter_track_point();