diff --git a/.github/jobs/set_job_controls.sh b/.github/jobs/set_job_controls.sh index 10f3b4c21e..aa72ad4162 100755 --- a/.github/jobs/set_job_controls.sh +++ b/.github/jobs/set_job_controls.sh @@ -6,7 +6,7 @@ run_unit_tests=false run_diff=false run_update_truth=false met_base_repo=met-base -met_base_tag=v3.2 +met_base_tag=v3.3 input_data_version=develop truth_data_version=develop diff --git a/.github/workflows/build_docker_and_trigger_metplus.yml b/.github/workflows/build_docker_and_trigger_metplus.yml index 13606d5ed3..7d7dcce29c 100644 --- a/.github/workflows/build_docker_and_trigger_metplus.yml +++ b/.github/workflows/build_docker_and_trigger_metplus.yml @@ -29,7 +29,7 @@ jobs: env: SOURCE_BRANCH: ${{ steps.get_branch_name.outputs.branch_name }}-lite MET_BASE_REPO: met-base - MET_BASE_TAG: v3.2 + MET_BASE_TAG: v3.3 - name: Push Docker Image run: .github/jobs/push_docker_image.sh diff --git a/.github/workflows/compilation_options.yml b/.github/workflows/compilation_options.yml index 7a8dc73cf0..cf6c5fc97a 100644 --- a/.github/workflows/compilation_options.yml +++ b/.github/workflows/compilation_options.yml @@ -63,6 +63,10 @@ jobs: config: '--enable-mode_graphics' - jobid: 'job8' config: '--enable-modis' + - jobid: 'job9' + config: '--enable-all MET_CXX_STANDARD=11' + - jobid: 'job10' + config: '--enable-all MET_CXX_STANDARD=14' fail-fast: false steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/sonarqube.yml b/.github/workflows/sonarqube.yml index 6a6627fb69..b476a488b6 100644 --- a/.github/workflows/sonarqube.yml +++ b/.github/workflows/sonarqube.yml @@ -61,7 +61,7 @@ jobs: run: .github/jobs/build_sonarqube_image.sh env: MET_BASE_REPO: met-base - MET_BASE_TAG: v3.2 + MET_BASE_TAG: v3.3 SOURCE_BRANCH: ${{ steps.get_branch_name.outputs.branch_name }} WD_REFERENCE_BRANCH: ${{ github.event.inputs.reference_branch }} SONAR_SCANNER_VERSION: 5.0.1.3006 diff --git a/Makefile.in b/Makefile.in index 582d2a65c8..0ae957d7b3 100644 --- a/Makefile.in +++ b/Makefile.in @@ -256,6 +256,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/configure b/configure index 40672ec913..758f3502f6 100755 --- a/configure +++ b/configure @@ -797,6 +797,7 @@ MET_ATLAS MET_PROJLIB MET_PROJINC MET_PROJ +MET_CXX_STANDARD OPENMP_CFLAGS am__fastdepCC_FALSE am__fastdepCC_TRUE @@ -933,6 +934,7 @@ CFLAGS LDFLAGS LIBS CPPFLAGS +MET_CXX_STANDARD MET_PROJ MET_PROJINC MET_PROJLIB @@ -1667,6 +1669,9 @@ Some influential environment variables: LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory + MET_CXX_STANDARD + Specify the version of the supported C++ standard. Values may be + 11, 14, or 17. Default value is 17. MET_PROJ Where proj lib and include subdirectories are located. If they are installed in /usr/local, you don't have to specify them. MET_PROJINC Where proj include files are located. Use if the libraries and @@ -5317,6 +5322,26 @@ printf "%s\n" "$ac_cv_prog_c_openmp" >&6; } CPPFLAGS="${CPPFLAGS} ${OPENMP_CFLAGS}" LDFLAGS="${LDFLAGS} ${OPENMP_CFLAGS}" +# +# Look for a specified C++ Standard +# + +# Configure the variable. The help text will appear if the user uses "configure --help". + + + +# Set a default value + +if (test -z "$MET_CXX_STANDARD"); then + MET_CXX_STANDARD=17 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: c++17 will be used as the C++ standard" >&5 +printf "%s\n" "$as_me: c++17 will be used as the C++ standard" >&6;} +elif (test -n "$MET_CXX_STANDARD"); then + MET_CXX_STANDARD=${MET_CXX_STANDARD} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: MET_CXX_STANDARD will be set" >&5 +printf "%s\n" "$as_me: MET_CXX_STANDARD will be set" >&6;} +fi + # # Look for the Proj library. # @@ -6988,7 +7013,7 @@ fi CPPFLAGS=$CPPFLAGS' -DMET_BASE="\"$(pkgdatadir)\""' # Add -std=c++11 to CXXFLAGS -CXXFLAGS=$CXXFLAGS' -std=c++11' +CXXFLAGS=$CXXFLAGS' -std=c++'$MET_CXX_STANDARD # Define other variables for the makefiles diff --git a/configure.ac b/configure.ac index 2f8159d58c..03436847af 100644 --- a/configure.ac +++ b/configure.ac @@ -15,6 +15,24 @@ AC_OPENMP() CPPFLAGS="${CPPFLAGS} ${OPENMP_CFLAGS}" LDFLAGS="${LDFLAGS} ${OPENMP_CFLAGS}" +# +# Look for a specified C++ Standard +# + +# Configure the variable. The help text will appear if the user uses "configure --help". + +AC_ARG_VAR([MET_CXX_STANDARD], [Specify the version of the supported C++ standard. Values may be 11, 14, or 17. Default value is 17.]) + +# Set a default value + +if (test -z "$MET_CXX_STANDARD"); then + MET_CXX_STANDARD=17 + AC_MSG_NOTICE([c++17 will be used as the C++ standard]) +elif (test -n "$MET_CXX_STANDARD"); then + MET_CXX_STANDARD=${MET_CXX_STANDARD} + AC_MSG_NOTICE([MET_CXX_STANDARD will be set]) +fi + # # Look for the Proj library. # @@ -1160,7 +1178,7 @@ AM_CONDITIONAL([ENABLE_DEVELOPMENT], [test -n "$MET_DEVELOPMENT"]) CPPFLAGS=$CPPFLAGS' -DMET_BASE="\"$(pkgdatadir)\""' # Add -std=c++11 to CXXFLAGS -CXXFLAGS=$CXXFLAGS' -std=c++11' +CXXFLAGS=$CXXFLAGS' -std=c++'$MET_CXX_STANDARD # Define other variables for the makefiles diff --git a/data/Makefile.in b/data/Makefile.in index 262e9e43cc..43aab3f3d9 100644 --- a/data/Makefile.in +++ b/data/Makefile.in @@ -260,6 +260,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/data/climo/Makefile.in b/data/climo/Makefile.in index c6415ac06c..0030bfbd90 100644 --- a/data/climo/Makefile.in +++ b/data/climo/Makefile.in @@ -230,6 +230,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/data/climo/seeps/Makefile.in b/data/climo/seeps/Makefile.in index 761a867e6b..f40096bb49 100644 --- a/data/climo/seeps/Makefile.in +++ b/data/climo/seeps/Makefile.in @@ -202,6 +202,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/data/colortables/Makefile.in b/data/colortables/Makefile.in index 82b6b46710..05fcc3df5a 100644 --- a/data/colortables/Makefile.in +++ b/data/colortables/Makefile.in @@ -260,6 +260,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/data/colortables/NCL_colortables/Makefile.in b/data/colortables/NCL_colortables/Makefile.in index df79826d8d..1d174cffda 100644 --- a/data/colortables/NCL_colortables/Makefile.in +++ b/data/colortables/NCL_colortables/Makefile.in @@ -202,6 +202,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/data/config/Makefile.in b/data/config/Makefile.in index e88150a766..6ff5c30139 100644 --- a/data/config/Makefile.in +++ b/data/config/Makefile.in @@ -202,6 +202,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/data/map/Makefile.in b/data/map/Makefile.in index a34c9c189f..12e4540ca0 100644 --- a/data/map/Makefile.in +++ b/data/map/Makefile.in @@ -260,6 +260,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/data/map/admin_by_country/Makefile.in b/data/map/admin_by_country/Makefile.in index 3f36ae61fb..825f9576c6 100644 --- a/data/map/admin_by_country/Makefile.in +++ b/data/map/admin_by_country/Makefile.in @@ -202,6 +202,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/data/poly/HMT_masks/Makefile.in b/data/poly/HMT_masks/Makefile.in index 7284d8de7d..305405cc2a 100644 --- a/data/poly/HMT_masks/Makefile.in +++ b/data/poly/HMT_masks/Makefile.in @@ -202,6 +202,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/data/poly/Makefile.in b/data/poly/Makefile.in index 36890cca0a..04906070f5 100644 --- a/data/poly/Makefile.in +++ b/data/poly/Makefile.in @@ -260,6 +260,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/data/poly/NCEP_masks/Makefile.in b/data/poly/NCEP_masks/Makefile.in index acda936d43..4ecea4b0d0 100644 --- a/data/poly/NCEP_masks/Makefile.in +++ b/data/poly/NCEP_masks/Makefile.in @@ -202,6 +202,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/data/ps/Makefile.in b/data/ps/Makefile.in index c017420485..2677c7fb04 100644 --- a/data/ps/Makefile.in +++ b/data/ps/Makefile.in @@ -202,6 +202,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/data/table_files/Makefile.in b/data/table_files/Makefile.in index 08d91b866e..5f82cc573e 100644 --- a/data/table_files/Makefile.in +++ b/data/table_files/Makefile.in @@ -202,6 +202,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/data/tc_data/Makefile.in b/data/tc_data/Makefile.in index 9ef1261884..eee63e1885 100644 --- a/data/tc_data/Makefile.in +++ b/data/tc_data/Makefile.in @@ -202,6 +202,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/docs/Users_Guide/installation.rst b/docs/Users_Guide/installation.rst index 4540d341b4..2494abe520 100644 --- a/docs/Users_Guide/installation.rst +++ b/docs/Users_Guide/installation.rst @@ -247,7 +247,7 @@ Environment Variable Descriptions containing the bin, include, lib, and share directories for Python. **MET_PYTHON_CC** - Format is -I followed by the directory containing - the Python include files (ex. -I/usr/local/python3/include/python3.10). + the Python include files (e.g. -I/usr/local/python3/include/python3.10). This information may be obtained by running :code:`python3-config --cflags`; however, this command can, on certain systems, @@ -257,7 +257,7 @@ Environment Variable Descriptions the Python library files then a space, then -l followed by the necessary Python libraries to link to - (ex. -L/usr/local/python3/lib/\\ -lpython3.10\\ + (e.g. -L/usr/local/python3/lib/\\ -lpython3.10\\ -lpthread\\ -ldl\\ -lutil\\ -lm). The backslashes are necessary in the example shown because of the spaces, which will be @@ -285,7 +285,11 @@ Environment Variable Descriptions without a specified value of cores to use. The automated MET testing scripts in the Docker environment have been successful with a value of - 5 (ex. export MAKE_ARGS=”-j 5”). + 5 (e.g. export MAKE_ARGS=”-j 5”). + + **export MET_CXX_STANDARD** - Specify the version of the supported + C++ standard. Values may be 11, 14, or 17. The default value is 17. + (e.g. export MET_CXX_STANDARD=11). External Library Handling in compile_MET_all.sh diff --git a/docs/Users_Guide/reformat_point.rst b/docs/Users_Guide/reformat_point.rst index fb0a7b2766..ae9691745f 100644 --- a/docs/Users_Guide/reformat_point.rst +++ b/docs/Users_Guide/reformat_point.rst @@ -1092,9 +1092,22 @@ Optional Arguments for point2grid 16. The **-compress level** option indicates the desired level of compression (deflate level) for NetCDF variables. The valid level is between 0 and 9. The value of "level" will override the default setting of 0 from the configuration file or the environment variable MET_NC_COMPRESS. Setting the compression level to 0 will make no compression for the NetCDF output. Lower number is for fast compression and higher number is for better compression. Only 4 interpolation methods are applied to the field variables; MIN/MAX/MEDIAN/UW_MEAN. The GAUSSIAN method is applied to the probability variable only. Unlike regrad_data_plane, MAX method is applied to the file variable and Gaussian method to the probability variable with the MAXGAUSS method. If the probability variable is not requested, MAXGAUSS method is the same as MAX method. - + For the GOES-16 and GOES-17 data, the computing lat/long is time consuming. The computed coordinate (lat/long) is saved to a temporary NetCDF file, as described in :numref:`Contributor's Guide Section %s `. The computing lat/long step can be skipped if the coordinate file is given through the environment variable MET_GEOSTATIONARY_DATA. The grid mapping to the target grid is saved to MET_TMP_DIR to save the execution time. Once this file is created, the MET_GEOSTATIONARY_DATA is ignored. The grid mapping file should be deleted manually in order to apply a new MET_GEOSTATIONARY_DATA environment variable or to re-generate the grid mapping file. An example of call point2grid to process GOES-16 AOD data is shown below: + +The grid name or the grid definition can be given with the -field option when the grid information is missing from the input NetCDF file for the latitude_longitude projection. The latitude and longitude variable names should be defined by the user, and the grid information from the set_attr_grid is ignored in this case + +.. code-block:: none + + point2grid \ + iceh.2018-01-03.c00.tlat_tlon.nc \ + G231 \ + point2grid_cice_to_G231.nc \ + -config Point2GridConfig_tlat_tlon \ + -field 'name="hi_d"; level="(0,*,*)"; set_attr_grid="latlon 1440 1080 -79.80672 60.28144 0.04 0.04";' \ + -v 1 + .. code-block:: none point2grid \ diff --git a/internal/scripts/docker/Dockerfile b/internal/scripts/docker/Dockerfile index c5daf58492..c7a2ca5bdd 100644 --- a/internal/scripts/docker/Dockerfile +++ b/internal/scripts/docker/Dockerfile @@ -1,5 +1,5 @@ ARG MET_BASE_REPO=met-base -ARG MET_BASE_TAG=v3.2 +ARG MET_BASE_TAG=v3.3 FROM dtcenter/${MET_BASE_REPO}:${MET_BASE_TAG} MAINTAINER John Halley Gotway diff --git a/internal/scripts/docker/Dockerfile.copy b/internal/scripts/docker/Dockerfile.copy index 4d3d9476cd..51ae55ec3a 100644 --- a/internal/scripts/docker/Dockerfile.copy +++ b/internal/scripts/docker/Dockerfile.copy @@ -1,5 +1,5 @@ ARG MET_BASE_REPO=met-base-unit-test -ARG MET_BASE_TAG=v3.2 +ARG MET_BASE_TAG=v3.3 FROM dtcenter/${MET_BASE_REPO}:${MET_BASE_TAG} MAINTAINER John Halley Gotway diff --git a/internal/scripts/docker/Dockerfile.sonarqube b/internal/scripts/docker/Dockerfile.sonarqube index 75dc3c952c..e1e935d857 100644 --- a/internal/scripts/docker/Dockerfile.sonarqube +++ b/internal/scripts/docker/Dockerfile.sonarqube @@ -1,5 +1,5 @@ ARG MET_BASE_REPO=met-base -ARG MET_BASE_TAG=v3.2 +ARG MET_BASE_TAG=v3.3 FROM dtcenter/${MET_BASE_REPO}:${MET_BASE_TAG} MAINTAINER John Halley Gotway diff --git a/internal/scripts/installation/compile_MET_all.sh b/internal/scripts/installation/compile_MET_all.sh index 6524aa8563..2497e582a8 100755 --- a/internal/scripts/installation/compile_MET_all.sh +++ b/internal/scripts/installation/compile_MET_all.sh @@ -640,7 +640,11 @@ if [ $COMPILE_ECKIT -eq 1 ]; then # Need to obtain ecbuild before installing eckit - vrs="3.5.0" + if [[ ! -z ${MET_CXX_STANDARD} && ${MET_CXX_STANDARD} -le 14 ]]; then + vrs="3.5.0" + elif [[ -z ${MET_CXX_STANDARD} ]]; then + vrs="3.7.0" + fi echo echo "Compiling ECBUILD at `date`" @@ -652,9 +656,13 @@ if [ $COMPILE_ECKIT -eq 1 ]; then run_cmd "mkdir build; cd build" run_cmd "cmake ../ -DCMAKE_INSTALL_PREFIX=${LIB_DIR} > $(pwd)/ecbuild.cmake.log 2>&1" run_cmd "make ${MAKE_ARGS} install > $(pwd)/ecbuild.make_install.log 2>&1" - - vrs="1.20.2" + if [[ ! -z ${MET_CXX_STANDARD} && ${MET_CXX_STANDARD} -le 14 ]]; then + vrs="1.20.2" + elif [[ -z ${MET_CXX_STANDARD} ]]; then + vrs="1.24.4" + fi + echo echo "Compiling ECKIT at `date`" mkdir -p ${LIB_DIR}/eckit @@ -671,7 +679,11 @@ fi # Compile ATLAS if [ $COMPILE_ATLAS -eq 1 ]; then - vrs="0.30.0" + if [[ ! -z ${MET_CXX_STANDARD} && ${MET_CXX_STANDARD} -le 14 ]]; then + vrs="0.30.0" + elif [[ -z ${MET_CXX_STANDARD} ]]; then + vrs="0.35.0" + fi echo echo "Compiling ATLAS at `date`" @@ -862,9 +874,11 @@ if [ -z ${MET_PROJ} ]; then export MET_PROJ=${LIB_DIR} fi -export MET_PYTHON_BIN_EXE=${MET_PYTHON_BIN_EXE:=${MET_PYTHON}/bin/python3} -export MET_PYTHON_LD -export MET_PYTHON_CC +if [[ ! -z ${MET_PYTHON_CC} || ! -z ${MET_PYTHON_LD} ]]; then + export MET_PYTHON_BIN_EXE=${MET_PYTHON_BIN_EXE:=${MET_PYTHON}/bin/python3} + export MET_PYTHON_LD + export MET_PYTHON_CC +fi # add flags to user-defined LDFLAGS for MacOS if [[ $machine != "Mac" ]]; then diff --git a/internal/test_unit/config/Point2GridConfig_tlat_tlon b/internal/test_unit/config/Point2GridConfig_tlat_tlon new file mode 100644 index 0000000000..66f2f854b4 --- /dev/null +++ b/internal/test_unit/config/Point2GridConfig_tlat_tlon @@ -0,0 +1,6 @@ +file_type = NETCDF_NCCF; + +var_name_map = [ + { key = "lat_vname"; val = "TLAT"; }, + { key = "lon_vname"; val = "TLON"; } +]; diff --git a/internal/test_unit/xml/unit_plot_data_plane.xml b/internal/test_unit/xml/unit_plot_data_plane.xml index 5c56a389d8..599bfd0742 100644 --- a/internal/test_unit/xml/unit_plot_data_plane.xml +++ b/internal/test_unit/xml/unit_plot_data_plane.xml @@ -680,4 +680,18 @@ + + &MET_BIN;/plot_data_plane + \ + &DATA_DIR_MODEL;/nccf/MITLL.ProxyEchoTopsCalibratedMosaic.20200831_235328_v_20200831_235328.nc \ + &OUTPUT_DIR;/plot_data_plane/EchoTops_set_attr_grid.ps \ + 'name="ProxyEchoTopsCalibratedMosaic"; level="(0,*,*)"; set_attr_grid="latlon 8008 4004 -90 -180 0.04 0.04";' \ + -title "Global Synthetic Weather Radar EchoTops" \ + -v 1 + + + &OUTPUT_DIR;/plot_data_plane/EchoTops_set_attr_grid.ps + + + diff --git a/internal/test_unit/xml/unit_point2grid.xml b/internal/test_unit/xml/unit_point2grid.xml index aa9a1d0410..840fbdc7ea 100644 --- a/internal/test_unit/xml/unit_point2grid.xml +++ b/internal/test_unit/xml/unit_point2grid.xml @@ -356,4 +356,23 @@ + + &MET_BIN;/point2grid + + MET_TMP_DIR &OUTPUT_DIR;/point2grid + + \ + &DATA_DIR_MODEL;/cice/iceh.2018-01-03.c00.tlat_tlon.nc \ + G231 \ + &OUTPUT_DIR;/point2grid/point2grid_cice_to_G231.nc \ + -config &CONFIG_DIR;/Point2GridConfig_tlat_tlon \ + -field 'name="hi_d"; level="(0,*,*)"; set_attr_grid="latlon 180 360 -80 -180 1 1";' \ + -v 1 + + + &OUTPUT_DIR;/point2grid/point2grid_cice_to_G231.nc + + + + diff --git a/internal/test_util/Makefile.in b/internal/test_util/Makefile.in index 91fbb38a04..32c2b09cef 100644 --- a/internal/test_util/Makefile.in +++ b/internal/test_util/Makefile.in @@ -230,6 +230,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/internal/test_util/basic/Makefile.in b/internal/test_util/basic/Makefile.in index 8f7a6ae5f5..eacf3b24c2 100644 --- a/internal/test_util/basic/Makefile.in +++ b/internal/test_util/basic/Makefile.in @@ -230,6 +230,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/internal/test_util/basic/vx_config/Makefile.in b/internal/test_util/basic/vx_config/Makefile.in index 259d6dae5e..11f8c27d32 100644 --- a/internal/test_util/basic/vx_config/Makefile.in +++ b/internal/test_util/basic/vx_config/Makefile.in @@ -255,6 +255,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/internal/test_util/basic/vx_log/Makefile.in b/internal/test_util/basic/vx_log/Makefile.in index 0913f22a00..bc602758e2 100644 --- a/internal/test_util/basic/vx_log/Makefile.in +++ b/internal/test_util/basic/vx_log/Makefile.in @@ -224,6 +224,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/internal/test_util/basic/vx_util/Makefile.in b/internal/test_util/basic/vx_util/Makefile.in index ebbef0522c..7c4663e135 100644 --- a/internal/test_util/basic/vx_util/Makefile.in +++ b/internal/test_util/basic/vx_util/Makefile.in @@ -262,6 +262,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/internal/test_util/libcode/Makefile.in b/internal/test_util/libcode/Makefile.in index 4d4f244b34..38acababa3 100644 --- a/internal/test_util/libcode/Makefile.in +++ b/internal/test_util/libcode/Makefile.in @@ -234,6 +234,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/internal/test_util/libcode/vx_data2d/Makefile.in b/internal/test_util/libcode/vx_data2d/Makefile.in index f659f7c81a..25f644ed86 100644 --- a/internal/test_util/libcode/vx_data2d/Makefile.in +++ b/internal/test_util/libcode/vx_data2d/Makefile.in @@ -230,6 +230,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/internal/test_util/libcode/vx_data2d_factory/Makefile.in b/internal/test_util/libcode/vx_data2d_factory/Makefile.in index 1d93387de5..31ea2c180b 100644 --- a/internal/test_util/libcode/vx_data2d_factory/Makefile.in +++ b/internal/test_util/libcode/vx_data2d_factory/Makefile.in @@ -228,6 +228,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/internal/test_util/libcode/vx_data2d_grib/Makefile.in b/internal/test_util/libcode/vx_data2d_grib/Makefile.in index 5591f6439b..892f5eca9e 100644 --- a/internal/test_util/libcode/vx_data2d_grib/Makefile.in +++ b/internal/test_util/libcode/vx_data2d_grib/Makefile.in @@ -221,6 +221,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/internal/test_util/libcode/vx_data2d_nc_cf/Makefile.in b/internal/test_util/libcode/vx_data2d_nc_cf/Makefile.in index 52429cc106..749c25c8c9 100644 --- a/internal/test_util/libcode/vx_data2d_nc_cf/Makefile.in +++ b/internal/test_util/libcode/vx_data2d_nc_cf/Makefile.in @@ -220,6 +220,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/internal/test_util/libcode/vx_data2d_nc_met/Makefile.in b/internal/test_util/libcode/vx_data2d_nc_met/Makefile.in index 25fc3da12e..b02eb106d7 100644 --- a/internal/test_util/libcode/vx_data2d_nc_met/Makefile.in +++ b/internal/test_util/libcode/vx_data2d_nc_met/Makefile.in @@ -222,6 +222,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/internal/test_util/libcode/vx_geodesy/Makefile.in b/internal/test_util/libcode/vx_geodesy/Makefile.in index 63e759c489..f196c88c92 100644 --- a/internal/test_util/libcode/vx_geodesy/Makefile.in +++ b/internal/test_util/libcode/vx_geodesy/Makefile.in @@ -218,6 +218,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/internal/test_util/libcode/vx_grid/Makefile.in b/internal/test_util/libcode/vx_grid/Makefile.in index 05203d024a..9f7c65ed86 100644 --- a/internal/test_util/libcode/vx_grid/Makefile.in +++ b/internal/test_util/libcode/vx_grid/Makefile.in @@ -220,6 +220,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/internal/test_util/libcode/vx_nc_util/Makefile.in b/internal/test_util/libcode/vx_nc_util/Makefile.in index ad865d558f..af0e249f7b 100644 --- a/internal/test_util/libcode/vx_nc_util/Makefile.in +++ b/internal/test_util/libcode/vx_nc_util/Makefile.in @@ -225,6 +225,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/internal/test_util/libcode/vx_physics/Makefile.in b/internal/test_util/libcode/vx_physics/Makefile.in index 02f6ef57ae..20b0102618 100644 --- a/internal/test_util/libcode/vx_physics/Makefile.in +++ b/internal/test_util/libcode/vx_physics/Makefile.in @@ -218,6 +218,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/internal/test_util/libcode/vx_plot_util/Makefile.in b/internal/test_util/libcode/vx_plot_util/Makefile.in index 6a950df3aa..7f6bdd6dbc 100644 --- a/internal/test_util/libcode/vx_plot_util/Makefile.in +++ b/internal/test_util/libcode/vx_plot_util/Makefile.in @@ -219,6 +219,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/internal/test_util/libcode/vx_ps/Makefile.in b/internal/test_util/libcode/vx_ps/Makefile.in index d288997194..78db014c97 100644 --- a/internal/test_util/libcode/vx_ps/Makefile.in +++ b/internal/test_util/libcode/vx_ps/Makefile.in @@ -218,6 +218,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/internal/test_util/libcode/vx_python3_utils/Makefile.in b/internal/test_util/libcode/vx_python3_utils/Makefile.in index 3d3d12cefb..b416b84940 100644 --- a/internal/test_util/libcode/vx_python3_utils/Makefile.in +++ b/internal/test_util/libcode/vx_python3_utils/Makefile.in @@ -225,6 +225,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/internal/test_util/libcode/vx_series_data/Makefile.in b/internal/test_util/libcode/vx_series_data/Makefile.in index 94871489e0..ff1dd2b402 100644 --- a/internal/test_util/libcode/vx_series_data/Makefile.in +++ b/internal/test_util/libcode/vx_series_data/Makefile.in @@ -220,6 +220,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/internal/test_util/libcode/vx_solar/Makefile.in b/internal/test_util/libcode/vx_solar/Makefile.in index a7026539c3..9912971dc5 100644 --- a/internal/test_util/libcode/vx_solar/Makefile.in +++ b/internal/test_util/libcode/vx_solar/Makefile.in @@ -218,6 +218,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/internal/test_util/libcode/vx_tc_util/Makefile.in b/internal/test_util/libcode/vx_tc_util/Makefile.in index daf8dce673..a7d3c13818 100644 --- a/internal/test_util/libcode/vx_tc_util/Makefile.in +++ b/internal/test_util/libcode/vx_tc_util/Makefile.in @@ -243,6 +243,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/internal/test_util/tools/Makefile.in b/internal/test_util/tools/Makefile.in index e84bca7acf..c22646fb06 100644 --- a/internal/test_util/tools/Makefile.in +++ b/internal/test_util/tools/Makefile.in @@ -230,6 +230,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/internal/test_util/tools/other/Makefile.in b/internal/test_util/tools/other/Makefile.in index c054cf412f..8e6a1799bd 100644 --- a/internal/test_util/tools/other/Makefile.in +++ b/internal/test_util/tools/other/Makefile.in @@ -230,6 +230,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/internal/test_util/tools/other/mode_time_domain/Makefile.in b/internal/test_util/tools/other/mode_time_domain/Makefile.in index 3e70894414..c87b755d7d 100644 --- a/internal/test_util/tools/other/mode_time_domain/Makefile.in +++ b/internal/test_util/tools/other/mode_time_domain/Makefile.in @@ -245,6 +245,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/scripts/Rscripts/Makefile.in b/scripts/Rscripts/Makefile.in index fa8e805787..e53f9fe2df 100644 --- a/scripts/Rscripts/Makefile.in +++ b/scripts/Rscripts/Makefile.in @@ -260,6 +260,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/scripts/Rscripts/include/Makefile.in b/scripts/Rscripts/include/Makefile.in index 5d625c4e28..d62ae95412 100644 --- a/scripts/Rscripts/include/Makefile.in +++ b/scripts/Rscripts/include/Makefile.in @@ -202,6 +202,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/scripts/python/Makefile.in b/scripts/python/Makefile.in index e45eb05cd4..670db075a0 100644 --- a/scripts/python/Makefile.in +++ b/scripts/python/Makefile.in @@ -232,6 +232,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/scripts/python/examples/Makefile.in b/scripts/python/examples/Makefile.in index b994ccfd57..cdf8f0feb4 100644 --- a/scripts/python/examples/Makefile.in +++ b/scripts/python/examples/Makefile.in @@ -204,6 +204,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/scripts/python/met/Makefile.in b/scripts/python/met/Makefile.in index 6a7570efa2..d8541387db 100644 --- a/scripts/python/met/Makefile.in +++ b/scripts/python/met/Makefile.in @@ -204,6 +204,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/scripts/python/pyembed/Makefile.in b/scripts/python/pyembed/Makefile.in index b8fef31f8b..1ffd7a4eb5 100644 --- a/scripts/python/pyembed/Makefile.in +++ b/scripts/python/pyembed/Makefile.in @@ -260,6 +260,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/scripts/python/tc_diag/Makefile.in b/scripts/python/tc_diag/Makefile.in index 9d098740ad..6cda357496 100644 --- a/scripts/python/tc_diag/Makefile.in +++ b/scripts/python/tc_diag/Makefile.in @@ -262,6 +262,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/scripts/python/tc_diag/atcf_tools/Makefile.in b/scripts/python/tc_diag/atcf_tools/Makefile.in index fec6217c14..67b691d180 100644 --- a/scripts/python/tc_diag/atcf_tools/Makefile.in +++ b/scripts/python/tc_diag/atcf_tools/Makefile.in @@ -204,6 +204,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/scripts/python/tc_diag/config/Makefile.in b/scripts/python/tc_diag/config/Makefile.in index cc4019b28f..df494ac1c5 100644 --- a/scripts/python/tc_diag/config/Makefile.in +++ b/scripts/python/tc_diag/config/Makefile.in @@ -204,6 +204,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/scripts/python/tc_diag/diag_lib/Makefile.in b/scripts/python/tc_diag/diag_lib/Makefile.in index aa48ed0c5f..64b9c40add 100644 --- a/scripts/python/tc_diag/diag_lib/Makefile.in +++ b/scripts/python/tc_diag/diag_lib/Makefile.in @@ -204,6 +204,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/scripts/python/tc_diag/tc_diag_driver/Makefile.in b/scripts/python/tc_diag/tc_diag_driver/Makefile.in index b4468d4bb2..41d0c24e56 100644 --- a/scripts/python/tc_diag/tc_diag_driver/Makefile.in +++ b/scripts/python/tc_diag/tc_diag_driver/Makefile.in @@ -204,6 +204,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/scripts/python/utility/Makefile.in b/scripts/python/utility/Makefile.in index 0b977854db..bb8de463d2 100644 --- a/scripts/python/utility/Makefile.in +++ b/scripts/python/utility/Makefile.in @@ -204,6 +204,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/Makefile.in b/src/Makefile.in index 175bb0381a..05916e66b0 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -230,6 +230,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/basic/Makefile.in b/src/basic/Makefile.in index 1df9e615ba..a5e04f07e1 100644 --- a/src/basic/Makefile.in +++ b/src/basic/Makefile.in @@ -232,6 +232,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/basic/enum_to_string/Makefile.in b/src/basic/enum_to_string/Makefile.in index 6c1a9607bf..69c57f75cf 100644 --- a/src/basic/enum_to_string/Makefile.in +++ b/src/basic/enum_to_string/Makefile.in @@ -249,6 +249,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/basic/vx_cal/Makefile.in b/src/basic/vx_cal/Makefile.in index a80d944f0a..bf9c15aa6c 100644 --- a/src/basic/vx_cal/Makefile.in +++ b/src/basic/vx_cal/Makefile.in @@ -256,6 +256,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/basic/vx_config/Makefile.in b/src/basic/vx_config/Makefile.in index 5fddc64397..61940aed88 100644 --- a/src/basic/vx_config/Makefile.in +++ b/src/basic/vx_config/Makefile.in @@ -304,6 +304,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/basic/vx_log/Makefile.in b/src/basic/vx_log/Makefile.in index 272dddb3ca..9b4c7969ca 100644 --- a/src/basic/vx_log/Makefile.in +++ b/src/basic/vx_log/Makefile.in @@ -235,6 +235,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/basic/vx_log/vx_log.h b/src/basic/vx_log/vx_log.h index ce8a8132cb..0ae10c3811 100644 --- a/src/basic/vx_log/vx_log.h +++ b/src/basic/vx_log/vx_log.h @@ -26,6 +26,15 @@ //////////////////////////////////////////////////////////////////////// +inline double get_exe_duration(clock_t start_clock, clock_t end_clock) { + return ((double)(end_clock - start_clock)) / CLOCKS_PER_SEC; +} + +inline double get_exe_duration(clock_t start_clock) { + return get_exe_duration(start_clock, clock()); +} + +//////////////////////////////////////////////////////////////////////// #endif // __VX_LOG_H__ diff --git a/src/basic/vx_math/Makefile.in b/src/basic/vx_math/Makefile.in index f42012d3ea..28c953fbbf 100644 --- a/src/basic/vx_math/Makefile.in +++ b/src/basic/vx_math/Makefile.in @@ -249,6 +249,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/basic/vx_math/is_bad_data.h b/src/basic/vx_math/is_bad_data.h index d8d7b334c3..80af0916ef 100644 --- a/src/basic/vx_math/is_bad_data.h +++ b/src/basic/vx_math/is_bad_data.h @@ -48,7 +48,7 @@ inline int is_bad_data(float a) { } inline int is_bad_data(char a) { - return(a == bad_data_char); + return (a == bad_data_char); } inline int is_eq(double a, double b, double tol) { @@ -60,6 +60,30 @@ inline int is_eq(double a, double b) { return is_eq(a, b, default_tol); } +inline int is_eq(double a, int b) { + return is_eq(a, (double)b); +} + +inline int is_eq(int a, double b) { + return is_eq((double)a, b); +} + +inline int is_eq(double a, unixtime b) { + return is_eq(a, (double)b); +} + +inline int is_eq(unixtime a, double b) { + return is_eq((double)a, b); +} + +inline int is_eq(float a, float b) { + return is_eq((double)a, (double)b); +} + +template +inline int is_eq(T a, T b) { + return (a == b); +} //////////////////////////////////////////////////////////////////////// diff --git a/src/basic/vx_util/Makefile.in b/src/basic/vx_util/Makefile.in index 83579ba1b4..4c05def519 100644 --- a/src/basic/vx_util/Makefile.in +++ b/src/basic/vx_util/Makefile.in @@ -354,6 +354,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/basic/vx_util_math/Makefile.in b/src/basic/vx_util_math/Makefile.in index bd06680091..b742f23078 100644 --- a/src/basic/vx_util_math/Makefile.in +++ b/src/basic/vx_util_math/Makefile.in @@ -234,6 +234,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/Makefile.in b/src/libcode/Makefile.in index 5a7e7eb12d..f7629e1481 100644 --- a/src/libcode/Makefile.in +++ b/src/libcode/Makefile.in @@ -242,6 +242,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_afm/Makefile.in b/src/libcode/vx_afm/Makefile.in index 27f3023563..5498f8a896 100644 --- a/src/libcode/vx_afm/Makefile.in +++ b/src/libcode/vx_afm/Makefile.in @@ -243,6 +243,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_analysis_util/Makefile.in b/src/libcode/vx_analysis_util/Makefile.in index 10bbb3aea6..fe6a3bb1a4 100644 --- a/src/libcode/vx_analysis_util/Makefile.in +++ b/src/libcode/vx_analysis_util/Makefile.in @@ -250,6 +250,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_bool_calc/Makefile.in b/src/libcode/vx_bool_calc/Makefile.in index 07bead994d..531f87fa08 100644 --- a/src/libcode/vx_bool_calc/Makefile.in +++ b/src/libcode/vx_bool_calc/Makefile.in @@ -245,6 +245,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_color/Makefile.in b/src/libcode/vx_color/Makefile.in index 08977daff3..217fc0590c 100644 --- a/src/libcode/vx_color/Makefile.in +++ b/src/libcode/vx_color/Makefile.in @@ -262,6 +262,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_data2d/Makefile.in b/src/libcode/vx_data2d/Makefile.in index 947fb3d73f..ead0ee6915 100644 --- a/src/libcode/vx_data2d/Makefile.in +++ b/src/libcode/vx_data2d/Makefile.in @@ -247,6 +247,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_data2d/data2d_utils.cc b/src/libcode/vx_data2d/data2d_utils.cc index 6284ca434b..6fc68a93cc 100644 --- a/src/libcode/vx_data2d/data2d_utils.cc +++ b/src/libcode/vx_data2d/data2d_utils.cc @@ -24,6 +24,54 @@ using namespace std; //////////////////////////////////////////////////////////////////////// +bool build_grid_by_grid_string(const char *grid_str, Grid &grid, + const char *caller_name, bool do_warning) { + bool status = false; + + if (nullptr != grid_str && m_strlen(grid_str) > 0) { + // Parse as a white-space separated string + + StringArray sa; + sa.parse_wsss(grid_str); + + // Search for a named grid + if (sa.n() == 1 && find_grid_by_name(sa[0].c_str(), grid)) { + status = true; + mlog << Debug(3) << "Use the grid named \"" << grid_str << "\".\n"; + } + // Parse grid definition + else if (sa.n() > 1 && parse_grid_def(sa, grid)) { + status = true; + mlog << Debug(3) << "Use the grid defined by string \"" + << grid_str << "\".\n"; + } + else if (do_warning) { + mlog << Warning << "\nbuild_grid_by_grid_string() by " << caller_name + << " unsupported " << conf_key_set_attr_grid + << " definition string (" << grid_str + << ")!\n\n"; + } + } + + return status; +} + +//////////////////////////////////////////////////////////////////////// + +bool build_grid_by_grid_string(const ConcatString &grid_str, Grid &grid, + const char *caller_name, bool do_warning) { + bool status = false; + + if(grid_str.nonempty()) { + status = build_grid_by_grid_string(grid_str.c_str(), grid, + caller_name, do_warning); + } + + return status; +} + +//////////////////////////////////////////////////////////////////////// + bool derive_wdir(const DataPlane &u2d, const DataPlane &v2d, DataPlane &wdir2d) { int x, y; diff --git a/src/libcode/vx_data2d/data2d_utils.h b/src/libcode/vx_data2d/data2d_utils.h index 317eb92f72..24299475d3 100644 --- a/src/libcode/vx_data2d/data2d_utils.h +++ b/src/libcode/vx_data2d/data2d_utils.h @@ -20,6 +20,14 @@ //////////////////////////////////////////////////////////////////////// +extern bool build_grid_by_grid_string(const char *attr_grid, Grid &grid, + const char *caller_name=nullptr, + bool do_warning=true); + +extern bool build_grid_by_grid_string(const ConcatString &attr_grid, Grid &grid, + const char *caller_name=nullptr, + bool do_warning=true); + extern bool derive_wdir(const DataPlane &u2d, const DataPlane &v2d, DataPlane &wdir); diff --git a/src/libcode/vx_data2d/data_class.cc b/src/libcode/vx_data2d/data_class.cc index 23ff40f93f..f364e34e42 100644 --- a/src/libcode/vx_data2d/data_class.cc +++ b/src/libcode/vx_data2d/data_class.cc @@ -257,13 +257,21 @@ mlog << Debug(3) << "Resetting grid definition from \"" // Make sure the grid dimensions do not change // - if ( raw_nx() != grid.nx() || raw_ny() != grid.ny() ) { + if ( raw_nx() <= 0 && raw_ny() <= 0 ) { - mlog << Error << "\nMet2dDataFile::set_grid() -> " + mlog << Warning << "\nMet2dDataFile::set_grid() -> " << "When resetting the grid definition to \"" << grid.serialize() << "\", the grid dimensions " - << "cannot change (" << grid.nx() << ", " << grid.ny() + << "are changed (" << grid.nx() << ", " << grid.ny() << ") != (" << raw_nx() << ", " << raw_ny() << ").\n\n"; + } + else if ( raw_nx() != grid.nx() || raw_ny() != grid.ny() ) { + + mlog << Error << "\nMet2dDataFile::set_grid() -> " + << "When resetting the grid definition to \"" + << grid.serialize() << "\", the grid dimensions " + << "cannot change to (" << grid.nx() << ", " << grid.ny() + << ") from (" << raw_nx() << ", " << raw_ny() << ").\n\n"; exit ( 1 ); diff --git a/src/libcode/vx_data2d/var_info.cc b/src/libcode/vx_data2d/var_info.cc index a1775a7275..2c92c6bf69 100644 --- a/src/libcode/vx_data2d/var_info.cc +++ b/src/libcode/vx_data2d/var_info.cc @@ -26,6 +26,7 @@ #include "vx_cal.h" #include "vx_math.h" #include "vx_log.h" +#include "data2d_utils.h" using namespace std; @@ -541,25 +542,7 @@ void VarInfo::set_dict(Dictionary &dict) { // Parse set_attr grid s = parse_set_attr_string(dict, conf_key_set_attr_grid); - if(s.nonempty()) { - - // Parse as a white-space separated string - StringArray sa; - sa.parse_wsss(s); - - // Search for a named grid - if(sa.n() == 1 && find_grid_by_name(sa[0].c_str(), SetAttrGrid)) { - } - // Parse grid definition - else if(sa.n() > 1 && parse_grid_def(sa, SetAttrGrid)) { - } - else { - mlog << Warning << "\nVarInfo::set_dict() -> " - << "unsupported " << conf_key_set_attr_grid - << " definition string (" << s - << ")!\n\n"; - } - } + build_grid_by_grid_string(s, SetAttrGrid, "VarInfo::set_dict(Dictionary &dict) ->"); // Parse set_attr times s = parse_set_attr_string(dict, conf_key_set_attr_init); diff --git a/src/libcode/vx_data2d_factory/Makefile.in b/src/libcode/vx_data2d_factory/Makefile.in index e9254cb32b..ee7e40e244 100644 --- a/src/libcode/vx_data2d_factory/Makefile.in +++ b/src/libcode/vx_data2d_factory/Makefile.in @@ -248,6 +248,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_data2d_grib/Makefile.in b/src/libcode/vx_data2d_grib/Makefile.in index 684bfa9d81..c844d9278b 100644 --- a/src/libcode/vx_data2d_grib/Makefile.in +++ b/src/libcode/vx_data2d_grib/Makefile.in @@ -245,6 +245,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_data2d_grib2/Makefile.in b/src/libcode/vx_data2d_grib2/Makefile.in index e26d1e102b..ed24c03da3 100644 --- a/src/libcode/vx_data2d_grib2/Makefile.in +++ b/src/libcode/vx_data2d_grib2/Makefile.in @@ -238,6 +238,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_data2d_nc_cf/Makefile.in b/src/libcode/vx_data2d_nc_cf/Makefile.in index cd972c6936..fb06b420b5 100644 --- a/src/libcode/vx_data2d_nc_cf/Makefile.in +++ b/src/libcode/vx_data2d_nc_cf/Makefile.in @@ -240,6 +240,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_data2d_nc_cf/data2d_nc_cf.cc b/src/libcode/vx_data2d_nc_cf/data2d_nc_cf.cc index 8c4373a62c..cc77b7f17a 100644 --- a/src/libcode/vx_data2d_nc_cf/data2d_nc_cf.cc +++ b/src/libcode/vx_data2d_nc_cf/data2d_nc_cf.cc @@ -159,11 +159,14 @@ bool MetNcCFDataFile::data_plane(VarInfo &vinfo, DataPlane &plane) { // Not sure why we do this - NcVarInfo *data_var = (NcVarInfo *)nullptr; - VarInfoNcCF *vinfo_nc = (VarInfoNcCF *)&vinfo; + auto data_var = (NcVarInfo *)nullptr; + auto vinfo_nc = (VarInfoNcCF *)&vinfo; static const string method_name = "MetNcCFDataFile::data_plane(VarInfo &, DataPlane &) -> "; + Grid grid_attr = vinfo.grid_attr(); + _file->update_grid(grid_attr); + // Initialize the data plane plane.clear(); @@ -339,6 +342,9 @@ int MetNcCFDataFile::data_plane_array(VarInfo &vinfo, static const string method_name = "MetNcCFDataFile::data_plane_array(VarInfo &, DataPlaneArray &) -> "; + Grid grid_attr = vinfo.grid_attr(); + _file->update_grid(grid_attr); + // Initialize plane_array.clear(); diff --git a/src/libcode/vx_data2d_nc_cf/nc_cf_file.cc b/src/libcode/vx_data2d_nc_cf/nc_cf_file.cc index 3038965ab6..a739c5ae0d 100644 --- a/src/libcode/vx_data2d_nc_cf/nc_cf_file.cc +++ b/src/libcode/vx_data2d_nc_cf/nc_cf_file.cc @@ -57,8 +57,6 @@ static ConcatString y_dim_var_name; static double get_nc_var_att_double(const NcVar *nc_var, const char *att_name, bool is_required=true); -#define USE_BUFFER 1 - //////////////////////////////////////////////////////////////////////// @@ -136,6 +134,9 @@ void NcCfFile::close() _dims = (NcDim **)nullptr; } + grid_ready = false; + has_attr_grid = false; + _numDims = 0; _dimNames.clear(); @@ -213,8 +214,8 @@ bool NcCfFile::open(const char * filepath) // Pull out the variables int max_dim_count = 0; - NcVar *z_var = (NcVar *)nullptr; - NcVar *valid_time_var = (NcVar *)nullptr; + auto z_var = (NcVar *)nullptr; + auto valid_time_var = (NcVar *)nullptr; ConcatString att_value; StringArray varNames; @@ -311,7 +312,7 @@ bool NcCfFile::open(const char * filepath) // Parse the units for the time variable. ut = sec_per_unit = 0; if (get_var_units(valid_time_var, units)) { - if (units.length() == 0) { + if (units.empty()) { mlog << Warning << "\n" << method_name << "the \"time\" variable must contain a \"units\" attribute. " << "Using valid time of 0\n\n"; @@ -324,7 +325,7 @@ bool NcCfFile::open(const char * filepath) } NcVar bounds_time_var; - NcVar *nc_time_var = (NcVar *)nullptr; + auto nc_time_var = (NcVar *)nullptr; bool use_bounds_var = false; ConcatString bounds_var_name; nc_time_var = valid_time_var; @@ -341,10 +342,10 @@ bool NcCfFile::open(const char * filepath) if (bounds_att) delete bounds_att; // Determine the number of times present. - int n_times = (int) get_data_size(valid_time_var); + int n_times = get_data_size(valid_time_var); int tim_buf_size = n_times; if (use_bounds_var) tim_buf_size *= 2; - double *time_values = new double[tim_buf_size]; + auto time_values = new double[tim_buf_size]; if( get_nc_data(nc_time_var, time_values) ) { bool no_leap_year = get_att_no_leap_year(valid_time_var); @@ -403,7 +404,7 @@ bool NcCfFile::open(const char * filepath) // Parse the units for the time variable. if (get_var_units(&init_time_var, units)) { - if (units.length() == 0) { + if (units.empty()) { mlog << Warning << "\n" << method_name << "the \"forecast_reference_time\" variable must contain a \"units\" attribute.\n\n"; ut = sec_per_unit = 0; @@ -418,8 +419,8 @@ bool NcCfFile::open(const char * filepath) ut = sec_per_unit = 0; } - double time_value = get_nc_time(&init_time_var,(int)0); - InitTime = (unixtime)ut + sec_per_unit * time_value; + double time_value = get_nc_time(&init_time_var,0); + InitTime = ut + (unixtime)(sec_per_unit * time_value); } // Pull out the grid. This must be done after pulling out the dimension @@ -436,7 +437,8 @@ bool NcCfFile::open(const char * filepath) StringArray z_dims; StringArray t_dims; StringArray dimNames; - string var_x_dim_name, var_y_dim_name; + string var_x_dim_name; + string 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; jx_slot) && (j != var->y_slot)) ) { - ++count; - if ( var == nullptr || ((j != var->x_slot) && (j != var->y_slot)) ) - { + if (has_attr_grid) { + mlog << Debug(3) << "\n" << method_name + << "star found in unknown slot (" << j << ") for " << GET_NC_NAME_P(v) << "\n\n"; + } + else { mlog << Error << "\n" << method_name << "star found in bad slot (" << j << ") for " << GET_NC_NAME_P(v) << "\n\n"; + exit(1); } } @@ -1011,13 +1041,22 @@ bool NcCfFile::getData(NcVar * v, const LongArray & a, DataPlane & plane) const } // check slots - additional logic to satisfy Fortify Null Dereference - int x_slot_tmp = 0; - int y_slot_tmp = 0; + int x_slot_tmp = 0; + int y_slot_tmp = 0; if (var == nullptr || var->x_slot < 0 || var->y_slot < 0) { - mlog << Error << "\n" << method_name - << "bad x|y|z slot\n\n"; - exit(1); + if (has_attr_grid) { + mlog << Warning << "\n" << method_name + << "bad x|y|z slot (" << var->x_slot << "|" << var->y_slot + << "|" << var->z_slot << "|" << var->t_slot <<")\n\n"; + x_slot_tmp = dim_count - 1; + y_slot_tmp = dim_count - 2; + } + else { + mlog << Error << "\n" << method_name + << "bad x|y|z slot\n\n"; + exit(1); + } } else { x_slot_tmp = var->x_slot; @@ -1116,7 +1155,7 @@ bool NcCfFile::getData(NcVar * v, const LongArray & a, DataPlane & plane) const // done mlog << Debug(6) << method_name << "took " - << (clock()-start_clock)/double(CLOCKS_PER_SEC) << " seconds\n"; + << get_exe_duration(start_clock) << " seconds\n"; return true; } @@ -1462,9 +1501,9 @@ void NcCfFile::read_netcdf_grid() !((_xDim && _yDim) || (x_dim_var_name.nonempty() && y_dim_var_name.nonempty()))) { - mlog << Error << "\nNcCfFile::read_netcdf_grid() -> " + mlog << Warning << "\nNcCfFile::read_netcdf_grid() -> " << "Couldn't figure out projection from information in netCDF file.\n\n"; - exit(1); + return; } return; @@ -1478,7 +1517,7 @@ void NcCfFile::read_netcdf_grid() Grid NcCfFile::build_grid_from_lat_lon_vars(NcVar *lat_var, NcVar *lon_var, const long lat_counts, const long lon_counts) { Grid grid_ll; - bool swap_to_north; + bool swap_to_north = false; LatLonData data = get_data_from_lat_lon_vars(lat_var, lon_var, lat_counts, lon_counts, swap_to_north); @@ -1506,9 +1545,9 @@ void NcCfFile::get_grid_from_grid_mapping(const NcVarAtt *grid_mapping_att) bool status = get_att_value_chars(grid_mapping_att, mapping_name); if (!status) { - mlog << Error << "\n" << method_name << " -> " + mlog << Warning << "\n" << method_name << " -> " << "Cannot extract grid mapping name from netCDF file.\n\n"; - exit(1); + return; } NcVar *grid_mapping_var = nullptr; @@ -1522,12 +1561,12 @@ void NcCfFile::get_grid_from_grid_mapping(const NcVarAtt *grid_mapping_att) } } /* endfor - i */ - if ((grid_mapping_var == 0) || (IS_INVALID_NC_P(grid_mapping_var))) + if ((nullptr == grid_mapping_var) || (IS_INVALID_NC_P(grid_mapping_var))) { - mlog << Error << "\n" << method_name << " -> " + mlog << Warning << "\n" << method_name << " -> " << "Cannot extract grid mapping variable (" << mapping_name << ") from netCDF file.\n\n"; - exit(1); + return; } // Get the name of the grid mapping @@ -1536,9 +1575,10 @@ void NcCfFile::get_grid_from_grid_mapping(const NcVarAtt *grid_mapping_att) if (IS_INVALID_NC_P(grid_mapping_name_att)) { - mlog << Error << "\n" << method_name << " -> " + mlog << Warning << "\n" << method_name << " -> " << "Cannot get coordinate system name from netCDF file.\n\n"; - exit(1); + if (grid_mapping_name_att) delete grid_mapping_name_att; + return; } //string grid_mapping_name = grid_mapping_name_att->getValues(att->as_string(0); @@ -1606,10 +1646,10 @@ void NcCfFile::get_grid_from_grid_mapping(const NcVarAtt *grid_mapping_att) } else { - mlog << Error << "\n" << method_name << " -> " + mlog << Warning << "\n" << method_name << " -> " << "Unknown grid mapping name (" << grid_mapping_name << ") found in netCDF file.\n\n"; - exit(1); + return; } } @@ -1673,9 +1713,9 @@ void NcCfFile::get_grid_mapping_lambert_azimuthal_equal_area(const NcVar *grid_m x_coord_units_name == "meters") x_coord_to_m_cf = 1.0; else if (x_coord_units_name == "km") x_coord_to_m_cf = 1000.0; else { - mlog << Error << "\n" << method_name << " -> " + mlog << Warning << "\n" << method_name << " -> " << "The X coordinates must be in meters or kilometers for MET.\n\n"; - exit(1); + return; } } } @@ -1698,9 +1738,9 @@ void NcCfFile::get_grid_mapping_lambert_azimuthal_equal_area(const NcVar *grid_m y_coord_units_name == "meters" ) y_coord_to_m_cf = 1.0; else if (y_coord_units_name == "km") y_coord_to_m_cf = 1000.0; else { - mlog << Error << "\n" << method_name << " -> " - << "The X coordinates must be in meters or kilometers for MET.\n\n"; - exit(1); + mlog << Warning << "\n" << method_name << " -> " + << "The Y coordinates must be in meters or kilometers for MET.\n\n"; + return; } } } @@ -1737,11 +1777,11 @@ void NcCfFile::get_grid_mapping_lambert_azimuthal_equal_area(const NcVar *grid_m double curr_delta = fabs(x_values[i] - x_values[i-1]); if (fabs(curr_delta - dx_m_a) > DELTA_TOLERANCE) { - mlog << Error << "\n" << method_name << " -> " + mlog << Warning << "\n" << method_name << " -> " << "MET can only process Lambert Azimuthal Equal Area files " << "where the delta along the x-axis is constant (" << curr_delta << " != " << dx_m_a << ")\n\n"; - exit(1); + return; } } @@ -1750,11 +1790,11 @@ void NcCfFile::get_grid_mapping_lambert_azimuthal_equal_area(const NcVar *grid_m double curr_delta = fabs(y_values[i] - y_values[i-1]); if (fabs(curr_delta - dy_m_a) > DELTA_TOLERANCE) { - mlog << Error << "\n" << method_name << " -> " + mlog << Warning << "\n" << method_name << " -> " << "MET can only process Lambert Azimuthal Equal Area files " << "where the delta along the y-axis is constant (" << curr_delta << " != " << dy_m_a << ")\n\n"; - exit(1); + return; } } @@ -1806,11 +1846,11 @@ void NcCfFile::get_grid_mapping_lambert_azimuthal_equal_area(const NcVar *grid_m if(!is_bad_data(false_easting) && !is_eq(false_easting, 0.0)) { - mlog << Error << "\n" << method_name << " -> " + mlog << Warning << "\n" << method_name << " -> " << "MET cannot process Lambert Azimuthal Equal Area files " << "with non-zero false_easting (" << false_easting << ").\n\n"; - exit(1); + return; } // false_northing @@ -1820,11 +1860,11 @@ void NcCfFile::get_grid_mapping_lambert_azimuthal_equal_area(const NcVar *grid_m if(!is_bad_data(false_northing) && !is_eq(false_northing, 0.0)) { - mlog << Error << "\n" << method_name << " -> " + mlog << Warning << "\n" << method_name << " -> " << "MET cannot process Lambert Azimuthal Equal Area files " << "with non-zero false_northing (" << false_northing << ").\n\n"; - exit(1); + return; } // Calculate the pin indices. The pin will be located at the grid's reference @@ -1845,6 +1885,8 @@ void NcCfFile::get_grid_mapping_lambert_azimuthal_equal_area(const NcVar *grid_m grid.set(data); if (dy_m < 0) grid.set_swap_to_north(true); + grid_ready = true; + } @@ -1863,10 +1905,10 @@ void NcCfFile::get_grid_mapping_lambert_conformal_conic(const NcVar *grid_mappin grid_mapping_var, (string)"standard_parallel"); if (IS_INVALID_NC_P(std_parallel_att)) { - mlog << Error << "\n" << method_name << " -> " + mlog << Warning << "\n" << method_name << " -> " << "Cannot get standard_parallel attribute from " << GET_NC_NAME_P(grid_mapping_var) << " variable.\n\n"; - exit(1); + return; } // longitude_of_central_meridian @@ -1875,10 +1917,10 @@ void NcCfFile::get_grid_mapping_lambert_conformal_conic(const NcVar *grid_mappin grid_mapping_var, (string)"longitude_of_central_meridian"); if (IS_INVALID_NC_P(central_lon_att)) { - mlog << Error << "\n" << method_name << " -> " + mlog << Warning << "\n" << method_name << " -> " << "Cannot get longitude_of_central_meridian attribute from " << GET_NC_NAME_P(grid_mapping_var) << " variable.\n\n"; - exit(1); + return; } // latitude_of_projection_origin @@ -1887,10 +1929,10 @@ void NcCfFile::get_grid_mapping_lambert_conformal_conic(const NcVar *grid_mappin grid_mapping_var, (string)"latitude_of_projection_origin"); if (IS_INVALID_NC_P(proj_origin_lat_att)) { - mlog << Error << "\n" << method_name << " -> " + mlog << Warning << "\n" << method_name << " -> " << "Cannot get latitude_of_projection_origin attribute from " << GET_NC_NAME_P(grid_mapping_var) << " variable.\n\n"; - exit(1); + return; } // Look for the x/y dimensions and x/y coordinate variables @@ -1899,9 +1941,9 @@ void NcCfFile::get_grid_mapping_lambert_conformal_conic(const NcVar *grid_mappin 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 << " -> " + mlog << Warning << "\n" << method_name << " -> " << "Coordinate variables don't match dimension sizes in netCDF file.\n\n"; - exit(1); + return; } // Make sure that the coordinate variables are given in meters. If we get @@ -1925,9 +1967,9 @@ void NcCfFile::get_grid_mapping_lambert_conformal_conic(const NcVar *grid_mappin x_coord_units_name == "meters") x_coord_to_m_cf = 1.0; else if (x_coord_units_name == "km") x_coord_to_m_cf = 1000.0; else { - mlog << Error << "\n" << method_name << " -> " + mlog << Warning << "\n" << method_name << " -> " << "The X coordinates must be in meters or kilometers for MET.\n\n"; - exit(1); + return; } } } @@ -1949,9 +1991,9 @@ void NcCfFile::get_grid_mapping_lambert_conformal_conic(const NcVar *grid_mappin y_coord_units_name == "meters" ) y_coord_to_m_cf = 1.0; else if (y_coord_units_name == "km") y_coord_to_m_cf = 1000.0; else { - mlog << Error << "\n" << method_name << " -> " - << "The X coordinates must be in meters or kilometers for MET.\n\n"; - exit(1); + mlog << Warning << "\n" << method_name << " -> " + << "The Y coordinates must be in meters or kilometers for MET.\n\n"; + return; } } } @@ -1983,9 +2025,9 @@ void NcCfFile::get_grid_mapping_lambert_conformal_conic(const NcVar *grid_mappin if (fabs(dx_m_a - dy_m_a) > DELTA_TOLERANCE) { - mlog << Error << "\n" << method_name << " -> " + mlog << Warning << "\n" << method_name << " -> " << "MET can only process Lambert Conformal files where the x-axis and y-axis deltas are the same\n\n"; - exit(1); + return; } // As a sanity check, make sure that the deltas are constant through the @@ -1996,9 +2038,9 @@ void NcCfFile::get_grid_mapping_lambert_conformal_conic(const NcVar *grid_mappin double curr_delta = fabs(x_values[i] - x_values[i-1]); if (fabs(curr_delta - dx_m_a) > DELTA_TOLERANCE) { - mlog << Error << "\n" << method_name << " -> " + mlog << Warning << "\n" << method_name << " -> " << "MET can only process Lambert Conformal files where the delta along the x-axis is constant\n\n"; - exit(1); + return; } } @@ -2007,9 +2049,9 @@ void NcCfFile::get_grid_mapping_lambert_conformal_conic(const NcVar *grid_mappin double curr_delta = fabs(y_values[i] - y_values[i-1]); if (fabs(curr_delta - dy_m_a) > DELTA_TOLERANCE) { - mlog << Error << "\n" << method_name << " -> " + mlog << Warning << "\n" << method_name << " -> " << "MET can only process Lambert Conformal files where the delta along the y-axis is constant\n\n"; - exit(1); + return; } } @@ -2051,6 +2093,7 @@ void NcCfFile::get_grid_mapping_lambert_conformal_conic(const NcVar *grid_mappin grid.set(data); if (dy_m < 0) grid.set_swap_to_north(true); + grid_ready = true; if(std_parallel_att) delete std_parallel_att; if(central_lon_att) delete central_lon_att; @@ -2144,32 +2187,32 @@ void NcCfFile::get_grid_mapping_latitude_longitude(const NcVar *grid_mapping_var if (_xDim == nullptr) { - mlog << Error << "\n" << method_name << " -> " + mlog << Warning << "\n" << method_name << " -> " << "Didn't find X dimension (degrees_east) in netCDF file.\n\n"; - exit(1); + return; } if (_yDim == nullptr) { - mlog << Error << "\n" << method_name << " -> " + mlog << Warning << "\n" << method_name << " -> " << "Didn't find Y dimension (degrees_north) in netCDF file.\n\n"; - exit(1); + return; } if (_xCoordVar == nullptr) { - mlog << Error << "\n" << method_name << " -> " + mlog << Warning << "\n" << method_name << " -> " << "Didn't find X coord variable (" << GET_NC_NAME_P(_xDim) << ") in netCDF file.\n\n"; - exit(1); + return; } if (_yCoordVar == nullptr) { - mlog << Error << "\n" << method_name << " -> " + mlog << Warning << "\n" << method_name << " -> " << "Didn't find Y coord variable (" << GET_NC_NAME_P(_yDim) << ") in netCDF file.\n\n"; - exit(1); + return; } long lon_counts = _xDim->getSize(); @@ -2177,9 +2220,9 @@ void NcCfFile::get_grid_mapping_latitude_longitude(const NcVar *grid_mapping_var if (get_data_size(_xCoordVar) != lon_counts || get_data_size(_yCoordVar) != lat_counts) { - mlog << Error << "\n" << method_name << " -> " + mlog << Warning << "\n" << method_name << " -> " << "Coordinate variables don't match dimension sizes in netCDF file.\n\n"; - exit(1); + return; } get_grid_from_lat_lon_vars(_yCoordVar, _xCoordVar, lat_counts, lon_counts); @@ -2277,17 +2320,17 @@ void NcCfFile::get_grid_mapping_polar_stereographic(const NcVar *grid_mapping_va << "This is an ellipsoidal earth.\n\n"; } else if(!has_scale_factor && !has_standard_parallel) { - mlog << Error << "\n" << method_name + mlog << Warning << "\n" << method_name << "The attribute \"scale_factor_at_projection_origin\" and \"standard_parallel\" of the " << GET_NC_NAME_P(grid_mapping_var) << " variable do not exist.\n\n"; - exit(1); + return; } else if(has_scale_factor && !is_eq(proj_origin_scale_factor, 1.0)) { - mlog << Error << "\n" << method_name + mlog << Warning << "\n" << method_name << "Unexpected attribute value of " << proj_origin_scale_factor << " for the scale_factor_at_projection_origin attribute of the " << GET_NC_NAME_P(grid_mapping_var) << " variable.\n\n"; - exit(1); + return; } // Look for the x/y dimensions and x/y coordinate variables @@ -2296,9 +2339,9 @@ void NcCfFile::get_grid_mapping_polar_stereographic(const NcVar *grid_mapping_va 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 + mlog << Warning << "\n" << method_name << "Coordinate variables don't match dimension sizes in netCDF file.\n\n"; - exit(1); + return; } // Make sure that the coordinate variables are given in meters. If we get @@ -2322,10 +2365,10 @@ void NcCfFile::get_grid_mapping_polar_stereographic(const NcVar *grid_mapping_va x_coord_units_name == "meters") x_coord_to_m_cf = 1.0; else if ( x_coord_units_name == "km") x_coord_to_m_cf = 1000.0; else { - mlog << Error << "\n" << method_name + mlog << Warning << "\n" << method_name << "The X coordinates (" << x_coord_units_name << ") must be in meters or kilometers for MET.\n\n"; - exit(1); + return; } } } @@ -2347,9 +2390,9 @@ void NcCfFile::get_grid_mapping_polar_stereographic(const NcVar *grid_mapping_va y_coord_units_name == "meters" ) y_coord_to_m_cf = 1.0; else if ( y_coord_units_name == "km") y_coord_to_m_cf = 1000.0; else { - mlog << Error << "\n" << method_name - << "The X coordinates must be in meters or kilometers for MET.\n\n"; - exit(1); + mlog << Warning << "\n" << method_name + << "The Y coordinates must be in meters or kilometers for MET.\n\n"; + return; } } } @@ -2381,9 +2424,9 @@ void NcCfFile::get_grid_mapping_polar_stereographic(const NcVar *grid_mapping_va if (fabs(dx_m_a - dy_m_a) > DELTA_TOLERANCE) { - mlog << Error << "\n" << method_name + mlog << Warning << "\n" << method_name << "MET can only process Polar Stereographic files where the x-axis and y-axis deltas are the same.\n\n"; - exit(1); + return; } if (is_eq(semi_major_axis, bad_data_double)) @@ -2470,6 +2513,7 @@ void NcCfFile::get_grid_mapping_polar_stereographic(const NcVar *grid_mapping_va data.dump(); grid.set(data); + grid_ready = true; //Note: do not set grid.set_swap_to_north() @@ -2611,10 +2655,10 @@ void NcCfFile::get_grid_mapping_rotated_latitude_longitude(const NcVar *grid_map grid_mapping_var, (string)"grid_north_pole_latitude"); if (IS_INVALID_NC_P(grid_np_lat_att)) { - mlog << Error << "\n" << method_name << " -> " + mlog << Warning << "\n" << method_name << " -> " << "Cannot get grid_north_pole_latitude attribute from " << GET_NC_NAME_P(grid_mapping_var) << " variable.\n\n"; - exit(1); + return; } // grid_north_pole_longitude @@ -2623,10 +2667,10 @@ void NcCfFile::get_grid_mapping_rotated_latitude_longitude(const NcVar *grid_map grid_mapping_var, (string)"grid_north_pole_longitude"); if (IS_INVALID_NC_P(grid_np_lon_att)) { - mlog << Error << "\n" << method_name << " -> " + mlog << Warning << "\n" << method_name << " -> " << "Cannot get grid_north_pole_longitude attribute from " << GET_NC_NAME_P(grid_mapping_var) << " variable.\n\n"; - exit(1); + return; } // Look for the grid_latitude and grid_longitude dimensions @@ -2703,32 +2747,32 @@ void NcCfFile::get_grid_mapping_rotated_latitude_longitude(const NcVar *grid_map if (_xDim == nullptr) { - mlog << Error << "\n" << method_name << " -> " + mlog << Warning << "\n" << method_name << " -> " << "Didn't find X dimension (degrees_east) in netCDF file.\n\n"; - exit(1); + return; } if (_yDim == nullptr) { - mlog << Error << "\n" << method_name << " -> " + mlog << Warning << "\n" << method_name << " -> " << "Didn't find Y dimension (degrees_north) in netCDF file.\n\n"; - exit(1); + return; } if (_xCoordVar == nullptr) { - mlog << Error << "\n" << method_name << " -> " + mlog << Warning << "\n" << method_name << " -> " << "Didn't find X coord variable (" << GET_NC_NAME_P(_xDim) << ") in netCDF file.\n\n"; - exit(1); + return; } if (_yCoordVar == nullptr) { - mlog << Error << "\n" << method_name << " -> " + mlog << Warning << "\n" << method_name << " -> " << "Didn't find Y coord variable (" << GET_NC_NAME_P(_yDim) << ") in netCDF file.\n\n"; - exit(1); + return; } long lon_counts = _xDim->getSize(); @@ -2736,9 +2780,9 @@ void NcCfFile::get_grid_mapping_rotated_latitude_longitude(const NcVar *grid_map if (get_data_size(_xCoordVar) != lon_counts || get_data_size(_yCoordVar) != lat_counts) { - mlog << Error << "\n" << method_name << " -> " + mlog << Warning << "\n" << method_name << " -> " << "Coordinate variables don't match dimension sizes in netCDF file.\n\n"; - exit(1); + return; } // Store spacing in LatLon data structure @@ -2832,10 +2876,10 @@ void NcCfFile::get_grid_mapping_geostationary( grid_mapping_var, (string)"perspective_point_height"); if (IS_INVALID_NC_P(perspective_point_height_att)) { - mlog << Error << "\n" << method_name + mlog << Warning << "\n" << method_name << "-> Cannot get perspective_point_height attribute from " << GET_NC_NAME_P(grid_mapping_var) << " variable.\n\n"; - exit(1); + return; } // semi_major_axis @@ -2843,10 +2887,10 @@ void NcCfFile::get_grid_mapping_geostationary( grid_mapping_var, (string)"semi_major_axis"); if (IS_INVALID_NC_P(semi_major_axis_att)) { - mlog << Error << "\n" << method_name + mlog << Warning << "\n" << method_name << "-> Cannot get semi_major_axis attribute from " << GET_NC_NAME_P(grid_mapping_var) << " variable.\n\n"; - exit(1); + return; } // semi_minor_axis @@ -2854,10 +2898,10 @@ void NcCfFile::get_grid_mapping_geostationary( grid_mapping_var, (string)"semi_minor_axis"); if (IS_INVALID_NC_P(semi_minor_axis_att)) { - mlog << Error << "\n" << method_name + mlog << Warning << "\n" << method_name << "-> Cannot get semi_minor_axis attribute from " << GET_NC_NAME_P(grid_mapping_var) << " variable.\n\n"; - exit(1); + return; } // inverse_flattening @@ -2865,10 +2909,10 @@ void NcCfFile::get_grid_mapping_geostationary( grid_mapping_var, (string)"inverse_flattening"); if (IS_INVALID_NC_P(inverse_flattening_att)) { - mlog << Error << "\n" << method_name + mlog << Warning << "\n" << method_name << "-> Cannot get inverse_flattening attribute from " << GET_NC_NAME_P(grid_mapping_var) << " variable.\n\n"; - exit(1); + return; } // latitude_of_projection_origin @@ -2876,10 +2920,10 @@ void NcCfFile::get_grid_mapping_geostationary( grid_mapping_var, (string)"latitude_of_projection_origin"); if (IS_INVALID_NC_P(proj_origin_lat_att)) { - mlog << Error << "\n" << method_name + mlog << Warning << "\n" << method_name << "-> Cannot get latitude_of_projection_origin attribute from " << GET_NC_NAME_P(grid_mapping_var) << " variable.\n\n"; - exit(1); + return; } // longitude_of_projection_origin @@ -2887,10 +2931,10 @@ void NcCfFile::get_grid_mapping_geostationary( grid_mapping_var, (string)"longitude_of_projection_origin"); if (IS_INVALID_NC_P(proj_origin_lon_att)) { - mlog << Error << "\n" << method_name + mlog << Warning << "\n" << method_name << "-> Cannot get longitude_of_projection_origin attribute from " << GET_NC_NAME_P(grid_mapping_var) << " variable.\n\n"; - exit(1); + return; } // sweep_angle_axis @@ -2898,10 +2942,10 @@ void NcCfFile::get_grid_mapping_geostationary( grid_mapping_var, (string)"sweep_angle_axis"); if (IS_INVALID_NC_P(sweep_angle_axis_att)) { - mlog << Error << "\n" << method_name + mlog << Warning << "\n" << method_name << "-> Cannot get sweep_angle_axis attribute from " << GET_NC_NAME_P(grid_mapping_var) << " variable.\n\n"; - exit(1); + return; } // Look for the x/y dimensions and x/y coordinate variables @@ -2910,21 +2954,21 @@ void NcCfFile::get_grid_mapping_geostationary( bool do_exit = false; if (_xDim == nullptr) { - mlog << Error << "\n" << method_name + mlog << Warning << "\n" << method_name << "-> Didn't find X dimension (projection_x_coordinate) in netCDF file.\n\n"; do_exit = true; } if (_yDim == nullptr) { - mlog << Error << "\n" << method_name + mlog << Warning << "\n" << method_name << "-> Didn't find Y dimension (projection_y_coordinate) in netCDF file.\n\n"; do_exit = true; } if (_xCoordVar == nullptr) { - mlog << Error << "\n" << method_name + mlog << Warning << "\n" << method_name << "-> Didn't find X coord variable (" << GET_NC_NAME_P(_xDim) << ") in netCDF file.\n\n"; do_exit = true; @@ -2932,7 +2976,7 @@ void NcCfFile::get_grid_mapping_geostationary( if (_yCoordVar == nullptr) { - mlog << Error << "\n" << method_name + mlog << Warning << "\n" << method_name << "-> Didn't find Y coord variable (" << GET_NC_NAME_P(_yDim) << ") in netCDF file.\n\n"; do_exit = true; @@ -2941,12 +2985,12 @@ void NcCfFile::get_grid_mapping_geostationary( 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 + mlog << Warning << "\n" << method_name << "-> Coordinate variables don't match dimension sizes in netCDF file.\n\n"; do_exit = true; } - if (do_exit) exit(1); + if (do_exit) return; // Figure out the dx/dy and x/y pin values from the dimension variables @@ -2955,7 +2999,6 @@ void NcCfFile::get_grid_mapping_geostationary( get_nc_data(_xCoordVar, x_values); - long y_counts = GET_NC_SIZE_P(_yDim); double y_values[y_counts]; @@ -2977,7 +3020,7 @@ void NcCfFile::get_grid_mapping_geostationary( NcVar *var_y_bound = (NcVar *)nullptr; for (int j=0; j 0) { data.x_image_bounds = new double[bound_count]; data.y_image_bounds = new double[bound_count]; - if (0 != var_x_bound) get_nc_data(var_x_bound, data.x_image_bounds); - if (0 != var_y_bound) get_nc_data(var_y_bound, data.y_image_bounds); + if (nullptr != var_x_bound) get_nc_data(var_x_bound, data.x_image_bounds); + if (nullptr != var_y_bound) get_nc_data(var_y_bound, data.y_image_bounds); } double flatten = 1.0/data.inverse_flattening; @@ -3034,6 +3077,7 @@ void NcCfFile::get_grid_mapping_geostationary( // Note: Computing lat/lon was deferred because it took 1 minutes grid.set(data); + grid_ready = true; if (perspective_point_height_att) delete perspective_point_height_att; if (semi_major_axis_att) delete semi_major_axis_att; @@ -3112,19 +3156,19 @@ bool NcCfFile::get_grid_from_coordinates(const NcVar *data_var) { } if (_xCoordVar == nullptr) { - mlog << Error << "\n" << method_name << " -> " + mlog << Warning << "\n" << method_name << " -> " << "Didn't find X coord variable (" << x_dim_var_name << ") in netCDF file.\n\n"; if (coordinates_att) delete coordinates_att; - return true; + return false; } if (_yCoordVar == nullptr) { - mlog << Error << "\n" << method_name << " -> " + mlog << Warning << "\n" << method_name << " -> " << "Didn't find Y coord variable (" << y_dim_var_name << ") in netCDF file.\n\n"; if (coordinates_att) delete coordinates_att; - return true; + return false; } StringArray dimNames; @@ -3153,10 +3197,10 @@ bool NcCfFile::get_grid_from_coordinates(const NcVar *data_var) { if ((x_size != lon_counts && x_size != latlon_counts) || (y_size != lat_counts && x_size != latlon_counts)) { - mlog << Error << "\n" << method_name << " -> " + mlog << Warning << "\n" << method_name << " -> " << "Coordinate variables don't match dimension sizes in netCDF file.\n\n"; if (coordinates_att) delete coordinates_att; - exit(1); + return false; } if (coordinates_att) { @@ -3280,18 +3324,18 @@ bool NcCfFile::get_grid_from_dimensions() if (_xCoordVar == nullptr) { - mlog << Error << "\n" << method_name << " -> " + mlog << Warning << "\n" << method_name << " -> " << "Didn't find X coord variable (" << GET_NC_NAME_P(_xDim) << ") in netCDF file.\n\n"; - exit(1); + return false; } if (_yCoordVar == nullptr) { - mlog << Error << "\n" << method_name << " -> " + mlog << Warning << "\n" << method_name << " -> " << "Didn't find Y coord variable (" << GET_NC_NAME_P(_yDim) << ") in netCDF file.\n\n"; - exit(1); + return false; } long lat_counts = GET_NC_SIZE_P(_yDim); @@ -3327,19 +3371,25 @@ void NcCfFile::get_grid_from_lat_lon_vars(NcVar *lat_var, NcVar *lon_var, LatLonData NcCfFile::get_data_from_lat_lon_vars(NcVar *lat_var, NcVar *lon_var, const long lat_counts, const long lon_counts, bool &swap_to_north) { - static const string method_name = "get_data_from_lat_lon_vars()"; + static const string method_name = "NcCfFile::get_data_from_lat_lon_vars()"; // Figure out the dlat/dlon values from the dimension variables + LatLonData data; + data.name = latlon_proj_type; + data.Nlat = (int)lat_counts; + data.Nlon = (int)lon_counts; + long x_size = get_data_size(lon_var); long y_size = get_data_size(lat_var); long latlon_counts = lon_counts*lat_counts; bool two_dim_coord = (x_size == latlon_counts) && (y_size == latlon_counts ); + if( !two_dim_coord && (x_size != lon_counts || y_size != lat_counts)) { - mlog << Error << "\n" << method_name << " -> " + mlog << Warning << "\n" << method_name << " -> " << "Coordinate variables don't match dimension sizes in netCDF file.\n\n"; - exit(1); + return data; } double lat_values[lat_counts]; @@ -3365,6 +3415,8 @@ LatLonData NcCfFile::get_data_from_lat_lon_vars(NcVar *lat_var, NcVar *lon_var, get_nc_data(lat_var,lat_values); get_nc_data(lon_var,lon_values); } + data.lat_ll = lat_values[0]; + data.lon_ll = rescale_lon(-lon_values[0]); // Calculate dlat and dlon assuming they are constant. @@ -3376,6 +3428,9 @@ LatLonData NcCfFile::get_data_from_lat_lon_vars(NcVar *lat_var, NcVar *lon_var, << " lon[" << (lon_counts-1) << "]=" << lon_values[lon_counts-1] << " dlon=" << dlon << "\n"; + data.delta_lat = dlat; + data.delta_lon = dlon; + ConcatString point_nccf; bool skip_sanity_check = get_att_value_string(_ncFile, nc_att_met_point_nccf, point_nccf); if (!skip_sanity_check) { @@ -3406,7 +3461,7 @@ LatLonData NcCfFile::get_data_from_lat_lon_vars(NcVar *lat_var, NcVar *lon_var, << i-1 << "]=" << lat_values[i-1] << " lat[" << i << "]=" << lat_values[i] << " " << fabs(curr_delta - dlat) << " > " << degree_tolerance << "\n"; - mlog << Error << "\n" << method_name << " -> " + mlog << Warning << "\n" << method_name << " -> " << "MET can only process Latitude/Longitude files where the latitudes are evenly spaced (dlat=" << dlat <<", delta[" << i << "]=" << curr_delta << ")\n\n"; sanity_check_failed = true; @@ -3426,7 +3481,7 @@ LatLonData NcCfFile::get_data_from_lat_lon_vars(NcVar *lat_var, NcVar *lon_var, << i-1 << "]=" << lon_values[i-1] << " lon[" << i << "]=" << lon_values[i] << " " << fabs(curr_delta - dlon) << " > " << degree_tolerance << "\n"; - mlog << Error << "\n" << method_name << " -> " + mlog << Warning << "\n" << method_name << " -> " << "MET can only process Latitude/Longitude files where the longitudes are evenly spaced (dlon=" << dlon <<", delta[" << i << "]=" << curr_delta << ")\n\n"; sanity_check_failed = true; @@ -3435,9 +3490,9 @@ LatLonData NcCfFile::get_data_from_lat_lon_vars(NcVar *lat_var, NcVar *lon_var, } if (sanity_check_failed) { - mlog << Error << "\n" << method_name << " -> " + mlog << Warning << "\n" << method_name << " -> " << "Please check the input data is the lat/lon projection\n\n"; - exit(1); + return data; } } @@ -3450,16 +3505,6 @@ LatLonData NcCfFile::get_data_from_lat_lon_vars(NcVar *lat_var, NcVar *lon_var, // guaranteed anywhere that I see. But if this is not the case, then we // will probably also need to reorder the data itself. - LatLonData data; - - data.name = latlon_proj_type; - data.lat_ll = lat_values[0]; - data.lon_ll = rescale_lon(-lon_values[0]); - data.delta_lat = dlat; - data.delta_lon = dlon; - data.Nlat = lat_counts; - data.Nlon = lon_counts; - if (dlat < 0) { swap_to_north = true; data.delta_lat = -dlat; @@ -3468,6 +3513,7 @@ LatLonData NcCfFile::get_data_from_lat_lon_vars(NcVar *lat_var, NcVar *lon_var, else { swap_to_north = false; } + grid_ready = true; return data; diff --git a/src/libcode/vx_data2d_nc_cf/nc_cf_file.h b/src/libcode/vx_data2d_nc_cf/nc_cf_file.h index 5e29896459..f6f0b8b3fa 100644 --- a/src/libcode/vx_data2d_nc_cf/nc_cf_file.h +++ b/src/libcode/vx_data2d_nc_cf/nc_cf_file.h @@ -56,18 +56,18 @@ class NcCfFile { int getNx() const { - if (_xDim == 0) + if (_xDim == nullptr) return 0; - return GET_NC_SIZE_P(_xDim); + return (int)GET_NC_SIZE_P(_xDim); } int getNy() const { - if (_yDim == 0) + if (_yDim == nullptr) return 0; - return GET_NC_SIZE_P(_yDim); + return (int)GET_NC_SIZE_P(_yDim); } NcVarInfo *get_time_var_info() const { return _time_var_info; } @@ -112,6 +112,8 @@ class NcCfFile { bool getData(const char *, const LongArray &, DataPlane &, NcVarInfo *&) const; + bool update_grid(const Grid &); + Grid build_grid_from_lat_lon_vars(netCDF::NcVar *lat_var, netCDF::NcVar *lon_var, const long lat_counts, const long lon_counts); NcVarInfo* find_var_name(const char * var_name) const; @@ -122,6 +124,8 @@ class NcCfFile { static const double DELTA_TOLERANCE; netCDF::NcFile * _ncFile; // allocated + bool grid_ready; + bool has_attr_grid; // // dimensions diff --git a/src/libcode/vx_data2d_nc_met/Makefile.in b/src/libcode/vx_data2d_nc_met/Makefile.in index e160b86a38..a40eb0c86a 100644 --- a/src/libcode/vx_data2d_nc_met/Makefile.in +++ b/src/libcode/vx_data2d_nc_met/Makefile.in @@ -242,6 +242,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_data2d_nc_wrf/Makefile.in b/src/libcode/vx_data2d_nc_wrf/Makefile.in index dbe34976c3..682fe818bc 100644 --- a/src/libcode/vx_data2d_nc_wrf/Makefile.in +++ b/src/libcode/vx_data2d_nc_wrf/Makefile.in @@ -242,6 +242,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_data2d_python/Makefile.in b/src/libcode/vx_data2d_python/Makefile.in index cf782561fc..6367816286 100644 --- a/src/libcode/vx_data2d_python/Makefile.in +++ b/src/libcode/vx_data2d_python/Makefile.in @@ -246,6 +246,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_data2d_ugrid/Makefile.in b/src/libcode/vx_data2d_ugrid/Makefile.in index 7712baafe9..b6f107c162 100644 --- a/src/libcode/vx_data2d_ugrid/Makefile.in +++ b/src/libcode/vx_data2d_ugrid/Makefile.in @@ -240,6 +240,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_geodesy/Makefile.in b/src/libcode/vx_geodesy/Makefile.in index 25a281b257..d3160d305f 100644 --- a/src/libcode/vx_geodesy/Makefile.in +++ b/src/libcode/vx_geodesy/Makefile.in @@ -234,6 +234,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_gis/Makefile.in b/src/libcode/vx_gis/Makefile.in index a382caa1d3..dd666ba6cd 100644 --- a/src/libcode/vx_gis/Makefile.in +++ b/src/libcode/vx_gis/Makefile.in @@ -243,6 +243,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_gnomon/Makefile.in b/src/libcode/vx_gnomon/Makefile.in index adec4f8fb1..62729f1c9f 100644 --- a/src/libcode/vx_gnomon/Makefile.in +++ b/src/libcode/vx_gnomon/Makefile.in @@ -234,6 +234,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_grid/Makefile.in b/src/libcode/vx_grid/Makefile.in index 99bb769bf1..c42467a57a 100644 --- a/src/libcode/vx_grid/Makefile.in +++ b/src/libcode/vx_grid/Makefile.in @@ -276,6 +276,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_gsl_prob/Makefile.in b/src/libcode/vx_gsl_prob/Makefile.in index e3ca39e845..298ff0f95d 100644 --- a/src/libcode/vx_gsl_prob/Makefile.in +++ b/src/libcode/vx_gsl_prob/Makefile.in @@ -242,6 +242,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_nav/Makefile.in b/src/libcode/vx_nav/Makefile.in index e91a581ff9..75018bdc9b 100644 --- a/src/libcode/vx_nav/Makefile.in +++ b/src/libcode/vx_nav/Makefile.in @@ -234,6 +234,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_nc_obs/Makefile.in b/src/libcode/vx_nc_obs/Makefile.in index b88b793888..709b4c356d 100644 --- a/src/libcode/vx_nc_obs/Makefile.in +++ b/src/libcode/vx_nc_obs/Makefile.in @@ -244,6 +244,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_nc_util/Makefile.in b/src/libcode/vx_nc_util/Makefile.in index f2f564ff93..8079c5d628 100644 --- a/src/libcode/vx_nc_util/Makefile.in +++ b/src/libcode/vx_nc_util/Makefile.in @@ -242,6 +242,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_nc_util/nc_utils.hpp b/src/libcode/vx_nc_util/nc_utils.hpp index c9024a471d..7298a7e4d8 100644 --- a/src/libcode/vx_nc_util/nc_utils.hpp +++ b/src/libcode/vx_nc_util/nc_utils.hpp @@ -236,46 +236,100 @@ void apply_scale_factor_(T *data, const int cell_count, clock_t start_clock = clock(); const char *method_name = "apply_scale_factor(T) "; - if (cell_count > 0) { - int idx; - int positive_cnt = 0; - int unpacked_count = 0; - T min_value, max_value; - T raw_min_val, raw_max_val; + if (cell_count <= 0) return; + + T min_value; + T max_value; + T raw_min_val; + T raw_max_val; + int idx = 0; + int positive_cnt = 0; + int unpacked_count = 0; + + if (has_fill_value) { + // Set met_fill_value (-9999) for FillValues (missing values) + for (; idx data[idx]) raw_min_val = data[idx]; + if (raw_max_val < data[idx]) raw_max_val = data[idx]; + data[idx] = (data[idx] * scale_factor) + add_offset; + if (data[idx] > 0) positive_cnt++; + if (min_value > data[idx]) min_value = data[idx]; + if (max_value < data[idx]) max_value = data[idx]; + unpacked_count++; } + } + mlog << Debug(debug_level) << method_name << var_name + << "(data_type=" << typeid(data[0]).name() << "): unpacked data: count=" + << unpacked_count << " out of " << cell_count + << ", scale_factor=" << scale_factor<< " add_offset=" << add_offset + << ". FillValue(" << data_type << ")=" << nc_fill_value << "\n"; + mlog << Debug(debug_level) << method_name + << " data range [" << min_value << " - " << max_value + << "] raw data: [" << raw_min_val << " - " << raw_max_val + << "] Positive count: " << positive_cnt << "\n"; - raw_min_val = raw_max_val = data[idx]; - min_value = max_value = (data[idx] * scale_factor) + add_offset; - for (; idx data[idx]) raw_min_val = data[idx]; - if (raw_max_val < data[idx]) raw_max_val = data[idx]; - data[idx] = (data[idx] * scale_factor) + add_offset; - if (data[idx] > 0) positive_cnt++; - if (min_value > data[idx]) min_value = data[idx]; - if (max_value < data[idx]) max_value = data[idx]; - unpacked_count++; - } + mlog << Debug(debug_level) << method_name << " took " + << (clock()-start_clock)/double(CLOCKS_PER_SEC) << " seconds\n"; + return; +} + +//////////////////////////////////////////////////////////////////////// + +template +void update_missing_values(T *data, const long cell_count, + const T nc_fill_value, const T met_fill_value, + const char *data_type, const char *var_name) { + int missing_count = 0; + const int debug_level = 7; + clock_t start_clock = clock(); + const char *method_name = "update_missing_values(T) "; + + if (cell_count <= 0) return; + + T max_value; + T min_value; + long idx = 0; + int positive_cnt = 0; + + // Set met_fill_value (-9999) for FillValues (missing values) + for (; idx data[idx]) min_value = data[idx]; + if (max_value < data[idx]) max_value = data[idx]; + } + } + mlog << Debug(debug_level) << method_name << var_name + << "(data_type=" << typeid(data[0]).name() << "): FillValue(" << data_type << ")=" << nc_fill_value << "\n"; + mlog << Debug(debug_level) << method_name + << " data range [" << min_value << " - " << max_value + << "] Positive count: " << positive_cnt << "\n"; + if (0 < missing_count) { + mlog << Debug(3) << method_name << var_name + << "(data_type=" << typeid(data[0]).name() << "): found " << missing_count << " FillValues out of " << cell_count << "\n"; } mlog << Debug(debug_level) << method_name << " took " << (clock()-start_clock)/double(CLOCKS_PER_SEC) << " seconds\n"; @@ -311,18 +365,23 @@ bool get_nc_data_(netCDF::NcVar *var, T *data, const T met_missing) { bool return_status = get_nc_data_t(var, data); if (return_status) { + T nc_missing; + const int cell_count = get_data_size(var); + bool has_missing_attr = get_var_fill_value(var, nc_missing); + if (!has_missing_attr) nc_missing = met_missing; + //scale_factor and add_offset if (has_add_offset_attr(var) || has_scale_factor_attr(var)) { - T nc_missing; - const int cell_count = get_data_size(var); double add_offset = get_var_add_offset(var); double scale_factor = get_var_scale_factor(var); - bool has_missing_attr = get_var_fill_value(var, nc_missing); - if (!has_missing_attr) nc_missing = met_missing; apply_scale_factor_(data, cell_count, add_offset, scale_factor, nc_missing, met_missing, has_missing_attr, "", GET_NC_NAME_P(var).c_str()); } + else if (has_missing_attr) { + update_missing_values(data, cell_count, nc_missing, met_missing, + "", GET_NC_NAME_P(var).c_str()); + } } return return_status; } @@ -330,7 +389,7 @@ bool get_nc_data_(netCDF::NcVar *var, T *data, const T met_missing) { //////////////////////////////////////////////////////////////////////// template -bool get_nc_data_(netCDF::NcVar *var, T *data, T bad_data, const LongArray &dims, const LongArray &curs) { +bool get_nc_data_(netCDF::NcVar *var, T *data, T met_missing, const LongArray &dims, const LongArray &curs) { bool return_status = false; const char *method_name = "get_nc_data_(T, *dims, *curs) "; @@ -371,7 +430,7 @@ bool get_nc_data_(netCDF::NcVar *var, T *data, T bad_data, const LongArray &dims } for (int idx1=0; idx1getVar(start, count, data); return_status = true; + T nc_missing; + bool has_missing_attr = get_var_fill_value(var, nc_missing); + if (!has_missing_attr) nc_missing = met_missing; + //scale_factor and add_offset if (has_add_offset_attr(var) || has_scale_factor_attr(var)) { - T nc_missing; double add_offset = get_var_add_offset(var); double scale_factor = get_var_scale_factor(var); - bool has_missing_attr = get_var_fill_value(var, nc_missing); - if (!has_missing_attr) nc_missing = bad_data; apply_scale_factor_(data, data_size, add_offset, scale_factor, - nc_missing, bad_data, has_missing_attr, + nc_missing, met_missing, has_missing_attr, "", GET_NC_NAME_P(var).c_str()); } + else if (has_missing_attr) { + update_missing_values(data, data_size, nc_missing, met_missing, + "", GET_NC_NAME_P(var).c_str()); + } } return return_status; } @@ -437,17 +501,22 @@ bool get_nc_data_(netCDF::NcVar *var, T *data, T met_missing, const long dim, co var->getVar(start, count, data); return_status = true; + T nc_missing; + bool has_missing_attr = get_var_fill_value(var, nc_missing); + if (!has_missing_attr) nc_missing = met_missing; + //scale_factor and add_offset if (has_add_offset_attr(var) || has_scale_factor_attr(var)) { - T nc_missing; double add_offset = get_var_add_offset(var); double scale_factor = get_var_scale_factor(var); - bool has_missing_attr = get_var_fill_value(var, nc_missing); - if (!has_missing_attr) nc_missing = met_missing; apply_scale_factor_(data, dim, add_offset, scale_factor, nc_missing, met_missing, has_missing_attr, "", GET_NC_NAME_P(var).c_str()); } + else if (has_missing_attr) { + update_missing_values(data, dim, nc_missing, met_missing, + "", GET_NC_NAME_P(var).c_str()); + } } return return_status; } @@ -456,7 +525,7 @@ bool get_nc_data_(netCDF::NcVar *var, T *data, T met_missing, const long dim, co // read a single data template -bool get_nc_data_(netCDF::NcVar *var, T *data, T bad_data, const LongArray &curs) { +bool get_nc_data_(netCDF::NcVar *var, T *data, T met_missing, const LongArray &curs) { bool return_status = false; //const char *method_name = "get_nc_data_(*curs) "; @@ -470,7 +539,7 @@ bool get_nc_data_(netCDF::NcVar *var, T *data, T bad_data, const LongArray &curs } // Retrieve the NetCDF value from the NetCDF variable. - return_status = get_nc_data_(var, data, bad_data, dims, curs); + return_status = get_nc_data_(var, data, met_missing, dims, curs); } return return_status; } diff --git a/src/libcode/vx_pb_util/Makefile.in b/src/libcode/vx_pb_util/Makefile.in index 4155cbd87d..c60be5fb82 100644 --- a/src/libcode/vx_pb_util/Makefile.in +++ b/src/libcode/vx_pb_util/Makefile.in @@ -240,6 +240,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_physics/Makefile.in b/src/libcode/vx_physics/Makefile.in index 4a92b393e6..88c09d0f76 100644 --- a/src/libcode/vx_physics/Makefile.in +++ b/src/libcode/vx_physics/Makefile.in @@ -234,6 +234,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_plot_util/Makefile.in b/src/libcode/vx_plot_util/Makefile.in index b04ac2aff8..16cd426cde 100644 --- a/src/libcode/vx_plot_util/Makefile.in +++ b/src/libcode/vx_plot_util/Makefile.in @@ -239,6 +239,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_pointdata_python/Makefile.in b/src/libcode/vx_pointdata_python/Makefile.in index 9df1cb65f5..e2ff7db4d5 100644 --- a/src/libcode/vx_pointdata_python/Makefile.in +++ b/src/libcode/vx_pointdata_python/Makefile.in @@ -241,6 +241,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_ps/Makefile.in b/src/libcode/vx_ps/Makefile.in index 9f1f61d8d9..3b1c14b3e7 100644 --- a/src/libcode/vx_ps/Makefile.in +++ b/src/libcode/vx_ps/Makefile.in @@ -244,6 +244,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_pxm/Makefile.in b/src/libcode/vx_pxm/Makefile.in index 9f78c084cc..b3053d4199 100644 --- a/src/libcode/vx_pxm/Makefile.in +++ b/src/libcode/vx_pxm/Makefile.in @@ -241,6 +241,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_python3_utils/Makefile.in b/src/libcode/vx_python3_utils/Makefile.in index 625aeafb9a..6c9138d22f 100644 --- a/src/libcode/vx_python3_utils/Makefile.in +++ b/src/libcode/vx_python3_utils/Makefile.in @@ -247,6 +247,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_regrid/Makefile.in b/src/libcode/vx_regrid/Makefile.in index dacbe937e9..67e3833844 100644 --- a/src/libcode/vx_regrid/Makefile.in +++ b/src/libcode/vx_regrid/Makefile.in @@ -236,6 +236,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_render/Makefile.in b/src/libcode/vx_render/Makefile.in index 54ad601137..647a42f006 100644 --- a/src/libcode/vx_render/Makefile.in +++ b/src/libcode/vx_render/Makefile.in @@ -258,6 +258,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_seeps/Makefile.in b/src/libcode/vx_seeps/Makefile.in index 0fabf3df09..510e05b214 100644 --- a/src/libcode/vx_seeps/Makefile.in +++ b/src/libcode/vx_seeps/Makefile.in @@ -234,6 +234,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_series_data/Makefile.in b/src/libcode/vx_series_data/Makefile.in index 897d818054..6344467e44 100644 --- a/src/libcode/vx_series_data/Makefile.in +++ b/src/libcode/vx_series_data/Makefile.in @@ -237,6 +237,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_shapedata/Makefile.in b/src/libcode/vx_shapedata/Makefile.in index 290ee7582f..9702c46133 100644 --- a/src/libcode/vx_shapedata/Makefile.in +++ b/src/libcode/vx_shapedata/Makefile.in @@ -250,6 +250,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_solar/Makefile.in b/src/libcode/vx_solar/Makefile.in index 3d12890618..ada5952624 100644 --- a/src/libcode/vx_solar/Makefile.in +++ b/src/libcode/vx_solar/Makefile.in @@ -236,6 +236,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_stat_out/Makefile.in b/src/libcode/vx_stat_out/Makefile.in index d12b414cf1..77d31a4ea1 100644 --- a/src/libcode/vx_stat_out/Makefile.in +++ b/src/libcode/vx_stat_out/Makefile.in @@ -236,6 +236,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_statistics/Makefile.in b/src/libcode/vx_statistics/Makefile.in index dbd2500d6a..ef3c09e5e9 100644 --- a/src/libcode/vx_statistics/Makefile.in +++ b/src/libcode/vx_statistics/Makefile.in @@ -261,6 +261,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_statistics/apply_mask.cc b/src/libcode/vx_statistics/apply_mask.cc index 03e31e97c7..bd12b1a25b 100644 --- a/src/libcode/vx_statistics/apply_mask.cc +++ b/src/libcode/vx_statistics/apply_mask.cc @@ -89,21 +89,8 @@ Grid parse_grid_string(const char *grid_str) { Grid grid; StringArray sa; - // Parse as a white-space separated string - sa.parse_wsss(grid_str); - - // Search for a named grid - if(sa.n() == 1 && find_grid_by_name(sa[0].c_str(), grid)) { - mlog << Debug(3) << "Use the grid named \"" - << grid_str << "\".\n"; - } - // Parse grid definition - else if(sa.n() > 1 && parse_grid_def(sa, grid)) { - mlog << Debug(3) << "Use the grid defined by string \"" - << grid_str << "\".\n"; - } - // Extract the grid from a gridded data file - else { + if (!build_grid_by_grid_string(grid_str, grid, "parse_grid_strin", false)) { + // Extract the grid from a gridded data file mlog << Debug(3) << "Use the grid defined by file \"" << grid_str << "\".\n"; @@ -228,24 +215,8 @@ void parse_grid_mask(const ConcatString &mask_grid_str, Grid &grid) { // Check for empty input string if(mask_grid_str.empty()) return; - // Parse mask_grid_str as a white-space separated string - StringArray sa; - sa.parse_wsss(mask_grid_str); - - // Named grid - if(sa.n() == 1 && find_grid_by_name(mask_grid_str.c_str(), grid)) { - mlog << Debug(3) - << "Use the grid named \"" << mask_grid_str << "\".\n"; - } - // Grid specification string - else if(sa.n() > 1 && parse_grid_def(sa, grid)) { - mlog << Debug(3) - << "Use the grid defined by string \"" << mask_grid_str - << "\".\n"; - } - // Extract the grid from a gridded data file - else { - + if (!build_grid_by_grid_string(mask_grid_str, grid, "parse_grid_mask", false)) { + // Extract the grid from a gridded data file mlog << Debug(3) << "Use the grid defined by file \"" << mask_grid_str << "\".\n"; diff --git a/src/libcode/vx_statistics/contable_stats.cc b/src/libcode/vx_statistics/contable_stats.cc index 7e7194c11d..7e7b8b4783 100644 --- a/src/libcode/vx_statistics/contable_stats.cc +++ b/src/libcode/vx_statistics/contable_stats.cc @@ -309,8 +309,8 @@ double TTContingencyTable::bagss() const { ha = (double) oy() - (fy_on() / lf) * lw; } - num = ha - (oy() * oy() / n()); - den = 2.0*oy() - ha - (oy() * oy() / n()); + num = ha - ((double) oy() * oy() / n()); + den = 2.0*oy() - ha - ((double) oy() * oy() / n()); if(is_eq(den, 0.0)) v = bad_data_double; else v = num/den; @@ -698,7 +698,7 @@ double TTContingencyTable::sedi_ci(double alpha, double &cl, double &cu) const { double v, h, f, b, se, mf, mh; - v = edi(); + v = sedi(); f = (double) fy_on() / (fy_on() + fn_on()); h = pod_yes(); b = baser(); diff --git a/src/libcode/vx_summary/Makefile.in b/src/libcode/vx_summary/Makefile.in index 6c057f2622..42cac04abd 100644 --- a/src/libcode/vx_summary/Makefile.in +++ b/src/libcode/vx_summary/Makefile.in @@ -256,6 +256,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_tc_util/Makefile.in b/src/libcode/vx_tc_util/Makefile.in index 747df71532..faae6b3f1d 100644 --- a/src/libcode/vx_tc_util/Makefile.in +++ b/src/libcode/vx_tc_util/Makefile.in @@ -270,6 +270,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/libcode/vx_time_series/Makefile.in b/src/libcode/vx_time_series/Makefile.in index a5eacf5ac7..a7bed2cf24 100644 --- a/src/libcode/vx_time_series/Makefile.in +++ b/src/libcode/vx_time_series/Makefile.in @@ -238,6 +238,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/tools/Makefile.in b/src/tools/Makefile.in index c9b6f05b61..6862443abb 100644 --- a/src/tools/Makefile.in +++ b/src/tools/Makefile.in @@ -232,6 +232,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/tools/core/Makefile.in b/src/tools/core/Makefile.in index 6e18774f39..cacc9eabec 100644 --- a/src/tools/core/Makefile.in +++ b/src/tools/core/Makefile.in @@ -240,6 +240,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/tools/core/ensemble_stat/Makefile.in b/src/tools/core/ensemble_stat/Makefile.in index a960e21483..0c0f147c70 100644 --- a/src/tools/core/ensemble_stat/Makefile.in +++ b/src/tools/core/ensemble_stat/Makefile.in @@ -225,6 +225,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/tools/core/grid_stat/Makefile.in b/src/tools/core/grid_stat/Makefile.in index 30cc717d27..97b6321c73 100644 --- a/src/tools/core/grid_stat/Makefile.in +++ b/src/tools/core/grid_stat/Makefile.in @@ -224,6 +224,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/tools/core/mode/Makefile.in b/src/tools/core/mode/Makefile.in index 10f09a3200..55999c4871 100644 --- a/src/tools/core/mode/Makefile.in +++ b/src/tools/core/mode/Makefile.in @@ -243,6 +243,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/tools/core/mode_analysis/Makefile.in b/src/tools/core/mode_analysis/Makefile.in index 334137147a..1c7c1f441d 100644 --- a/src/tools/core/mode_analysis/Makefile.in +++ b/src/tools/core/mode_analysis/Makefile.in @@ -225,6 +225,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/tools/core/pcp_combine/Makefile.in b/src/tools/core/pcp_combine/Makefile.in index 44b0f69c50..f866be8cc3 100644 --- a/src/tools/core/pcp_combine/Makefile.in +++ b/src/tools/core/pcp_combine/Makefile.in @@ -222,6 +222,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/tools/core/point_stat/Makefile.in b/src/tools/core/point_stat/Makefile.in index 81735f1efb..4efc7d8ba8 100644 --- a/src/tools/core/point_stat/Makefile.in +++ b/src/tools/core/point_stat/Makefile.in @@ -224,6 +224,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/tools/core/series_analysis/Makefile.in b/src/tools/core/series_analysis/Makefile.in index 2e26c49701..fd4915a5a5 100644 --- a/src/tools/core/series_analysis/Makefile.in +++ b/src/tools/core/series_analysis/Makefile.in @@ -226,6 +226,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/tools/core/stat_analysis/Makefile.in b/src/tools/core/stat_analysis/Makefile.in index 168c3da589..e1b0bda93d 100644 --- a/src/tools/core/stat_analysis/Makefile.in +++ b/src/tools/core/stat_analysis/Makefile.in @@ -231,6 +231,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/tools/core/wavelet_stat/Makefile.in b/src/tools/core/wavelet_stat/Makefile.in index 96490833a2..5826b4102e 100644 --- a/src/tools/core/wavelet_stat/Makefile.in +++ b/src/tools/core/wavelet_stat/Makefile.in @@ -225,6 +225,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/tools/dev_utils/Makefile.in b/src/tools/dev_utils/Makefile.in index e9b745a97f..46d98a6aeb 100644 --- a/src/tools/dev_utils/Makefile.in +++ b/src/tools/dev_utils/Makefile.in @@ -368,6 +368,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/tools/dev_utils/shapefiles/Makefile.in b/src/tools/dev_utils/shapefiles/Makefile.in index f5454f70fb..62ec442a56 100644 --- a/src/tools/dev_utils/shapefiles/Makefile.in +++ b/src/tools/dev_utils/shapefiles/Makefile.in @@ -219,6 +219,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/tools/other/Makefile.in b/src/tools/other/Makefile.in index 7574bf3ce1..010a792155 100644 --- a/src/tools/other/Makefile.in +++ b/src/tools/other/Makefile.in @@ -252,6 +252,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/tools/other/ascii2nc/Makefile.in b/src/tools/other/ascii2nc/Makefile.in index ccc217163a..d7d75fb04a 100644 --- a/src/tools/other/ascii2nc/Makefile.in +++ b/src/tools/other/ascii2nc/Makefile.in @@ -274,6 +274,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/tools/other/gen_ens_prod/Makefile.in b/src/tools/other/gen_ens_prod/Makefile.in index 8586403cb6..4f070ce15d 100644 --- a/src/tools/other/gen_ens_prod/Makefile.in +++ b/src/tools/other/gen_ens_prod/Makefile.in @@ -225,6 +225,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/tools/other/gen_vx_mask/Makefile.in b/src/tools/other/gen_vx_mask/Makefile.in index 0454fcc726..4203003677 100644 --- a/src/tools/other/gen_vx_mask/Makefile.in +++ b/src/tools/other/gen_vx_mask/Makefile.in @@ -222,6 +222,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/tools/other/gen_vx_mask/gen_vx_mask.cc b/src/tools/other/gen_vx_mask/gen_vx_mask.cc index 7612f0d7d2..98b15a212a 100644 --- a/src/tools/other/gen_vx_mask/gen_vx_mask.cc +++ b/src/tools/other/gen_vx_mask/gen_vx_mask.cc @@ -177,24 +177,8 @@ void process_command_line(int argc, char **argv) { void process_input_grid(DataPlane &dp) { - // Parse the input grid as a white-space separated string - StringArray sa; - sa.parse_wsss(input_gridname); - - // Search for a named grid - if(sa.n() == 1 && find_grid_by_name(sa[0].c_str(), grid)) { - mlog << Debug(3) - << "Use input grid named \"" << input_gridname << "\".\n"; - } - // Parse grid definition - else if(sa.n() > 1 && parse_grid_def(sa, grid)) { - mlog << Debug(3) - << "Use input grid defined by string \"" << input_gridname - << "\".\n"; - } - // Extract the grid from a gridded data file - else { - + if (!build_grid_by_grid_string(input_gridname, grid, "process_input_grid", false)) { + // Extract the grid from a gridded data file mlog << Debug(3) << "Use input grid defined by file \"" << input_gridname << "\".\n"; @@ -284,22 +268,7 @@ void process_mask_file(DataPlane &dp) { // For the grid mask type, support named grids and grid // specification strings if(mask_type == MaskType::Grid) { - - // Parse the mask file as a white-space separated string - StringArray sa; - sa.parse_wsss(mask_filename); - - // Search for a named grid - if(sa.n() == 1 && find_grid_by_name(sa[0].c_str(), grid_mask)) { - mlog << Debug(3) - << "Use mask grid named \"" << mask_filename << "\".\n"; - } - // Parse grid definition - else if(sa.n() > 1 && parse_grid_def(sa, grid_mask)) { - mlog << Debug(3) - << "Use mask grid defined by string \"" << mask_filename - << "\".\n"; - } + build_grid_by_grid_string(mask_filename, grid_mask, "process_mask_file", false); } // Parse as a gridded data file if not already set diff --git a/src/tools/other/gis_utils/Makefile.in b/src/tools/other/gis_utils/Makefile.in index aa3780a9bc..0afd97e00c 100644 --- a/src/tools/other/gis_utils/Makefile.in +++ b/src/tools/other/gis_utils/Makefile.in @@ -234,6 +234,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/tools/other/grid_diag/Makefile.in b/src/tools/other/grid_diag/Makefile.in index c93be79561..65e3b5196f 100644 --- a/src/tools/other/grid_diag/Makefile.in +++ b/src/tools/other/grid_diag/Makefile.in @@ -224,6 +224,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/tools/other/gsi_tools/Makefile.in b/src/tools/other/gsi_tools/Makefile.in index c7f068cfd9..455195d757 100644 --- a/src/tools/other/gsi_tools/Makefile.in +++ b/src/tools/other/gsi_tools/Makefile.in @@ -261,6 +261,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/tools/other/ioda2nc/Makefile.in b/src/tools/other/ioda2nc/Makefile.in index 37f335deae..cff7fbea89 100644 --- a/src/tools/other/ioda2nc/Makefile.in +++ b/src/tools/other/ioda2nc/Makefile.in @@ -237,6 +237,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/tools/other/lidar2nc/Makefile.in b/src/tools/other/lidar2nc/Makefile.in index e5d3703780..ad7371e7f2 100644 --- a/src/tools/other/lidar2nc/Makefile.in +++ b/src/tools/other/lidar2nc/Makefile.in @@ -237,6 +237,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/tools/other/madis2nc/Makefile.in b/src/tools/other/madis2nc/Makefile.in index c6eb822fc3..e70b8e0d65 100644 --- a/src/tools/other/madis2nc/Makefile.in +++ b/src/tools/other/madis2nc/Makefile.in @@ -224,6 +224,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/tools/other/mode_graphics/Makefile.in b/src/tools/other/mode_graphics/Makefile.in index ead2e5dcb4..abc9301ea0 100644 --- a/src/tools/other/mode_graphics/Makefile.in +++ b/src/tools/other/mode_graphics/Makefile.in @@ -245,6 +245,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/tools/other/mode_time_domain/3d_conv.cc b/src/tools/other/mode_time_domain/3d_conv.cc index d204ee61b0..1ecbe0b68a 100644 --- a/src/tools/other/mode_time_domain/3d_conv.cc +++ b/src/tools/other/mode_time_domain/3d_conv.cc @@ -154,8 +154,6 @@ struct DataHandle { { - int j; - _out.put('\n'); _out << " DataHandle:\n"; @@ -168,13 +166,13 @@ struct DataHandle { _out << " plane_loaded = ["; - for (j=0; j 0) { - - // Parse as a white-space separated string - sa.parse_wsss(plot_grid_string); - - // Search for a named grid - if(sa.n() == 1 && find_grid_by_name(sa[0].c_str(), grid)) { - mlog << Debug(3) << "Use the grid named \"" - << plot_grid_string << "\".\n"; - } - // Parse grid definition - else if(sa.n() > 1 && parse_grid_def(sa, grid)) { - mlog << Debug(3) << "Use the grid defined by string \"" - << plot_grid_string << "\".\n"; - } - // Extract the grid from a gridded data file - else { + if (!build_grid_by_grid_string(plot_grid_string, grid, + "PlotPointObsConfInfo::process_config -> ", false)) { + // Extract the grid from a gridded data file mlog << Debug(3) << "Use the grid defined by file \"" << plot_grid_string << "\".\n"; diff --git a/src/tools/other/point2grid/Makefile.in b/src/tools/other/point2grid/Makefile.in index 17f72484ab..9c8efa6ea4 100644 --- a/src/tools/other/point2grid/Makefile.in +++ b/src/tools/other/point2grid/Makefile.in @@ -236,6 +236,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/tools/other/point2grid/point2grid.cc b/src/tools/other/point2grid/point2grid.cc index de7d284fc1..73210e4b27 100644 --- a/src/tools/other/point2grid/point2grid.cc +++ b/src/tools/other/point2grid/point2grid.cc @@ -30,7 +30,7 @@ #include #include -#include +#include #include "main.h" #include "vx_log.h" @@ -424,6 +424,7 @@ static void process_data_file() { // Get the obs type before opening NetCDF obs_type = get_obs_type(nc_in); goes_data = (obs_type == TYPE_GOES || obs_type == TYPE_GOES_ADP); + if (obs_type == TYPE_UNKNOWN && ftype == FileType_NcCF) obs_type = TYPE_NCCF; if (obs_type == TYPE_NCCF) setenv(nc_att_met_point_nccf, "yes", 1); // Read the input data file @@ -594,14 +595,33 @@ bool get_nc_data_string_array(NcFile *nc, const char *var_name, static int get_obs_type(NcFile *nc) { int obs_type = TYPE_UNKNOWN; + MetConfig config; ConcatString att_val_scene_id; ConcatString att_val_project; ConcatString input_type; static const char *method_name = "get_obs_type() -> "; - bool has_project = get_global_att(nc, (string)"project", att_val_project); - bool has_scene_id = get_global_att(nc, (string)"scene_id", att_val_scene_id); - if( has_scene_id && has_project && att_val_project == "GOES" ) { + bool has_attr_grid = false; + auto vinfo = VarInfoFactory::new_var_info(FileType_NcCF); + for(int i=0; iclear(); + // Populate the VarInfo object using the config string + config.read_string(FieldSA[i].c_str()); + vinfo->set_dict(config); + if (vinfo->grid_attr().is_set()) { + has_attr_grid = true; + break; + } + } + if (vinfo) { delete vinfo; vinfo = (VarInfo *) nullptr; } + + if (has_attr_grid) { + obs_type = TYPE_NCCF; + input_type = "OBS_NCCF"; + } + else if (get_global_att(nc, (string)"scene_id", att_val_scene_id) + && get_global_att(nc, (string)"project", att_val_project) + && att_val_project == "GOES" ) { obs_type = TYPE_GOES; input_type = "GOES"; if (!adp_filename.empty()) { @@ -693,12 +713,15 @@ std::set prepare_qoes_qc_array() { void process_point_met_data(MetPointData *met_point_obs, MetConfig &config, VarInfo *vinfo, const Grid &to_grid) { - int idx, hdr_idx; + int hdr_idx; int var_idx_or_gc; ConcatString vname; - DataPlane fr_dp, to_dp; - DataPlane cnt_dp, mask_dp; - DataPlane prob_dp, prob_mask_dp; + DataPlane fr_dp; + DataPlane to_dp; + DataPlane cnt_dp; + DataPlane mask_dp; + DataPlane prob_dp; + DataPlane prob_mask_dp; bool has_prob_thresh = !prob_cat_thresh.check(bad_data_double); @@ -807,7 +830,7 @@ void process_point_met_data(MetPointData *met_point_obs, MetConfig &config, VarI } else { bool not_found_grib_code = true; - for (idx=0; idxobs_ids[idx]) { not_found_grib_code = false; break; @@ -824,7 +847,7 @@ void process_point_met_data(MetPointData *met_point_obs, MetConfig &config, VarI if (exit_by_field_name_error) { ConcatString log_msg; if (use_var_id) { - for (idx=0; idxobs_ids[idx])) { grib_codes.add(obs_data->obs_ids[idx]); if (0 < idx) log_msg << ", "; @@ -855,7 +878,9 @@ void process_point_met_data(MetPointData *met_point_obs, MetConfig &config, VarI // Check the time range. Apply the time window bool valid_time_from_config = true; - unixtime valid_beg_ut, valid_end_ut, obs_time; + unixtime valid_beg_ut; + unixtime valid_end_ut; + unixtime obs_time; valid_time_array.clear(); valid_time = vinfo->valid(); @@ -865,7 +890,7 @@ void process_point_met_data(MetPointData *met_point_obs, MetConfig &config, VarI valid_beg_ut = valid_end_ut = valid_time; if (!is_bad_data(conf_info.beg_ds)) valid_beg_ut += conf_info.beg_ds; if (!is_bad_data(conf_info.end_ds)) valid_end_ut += conf_info.end_ds; - for(idx=0; idx valid_time) valid_time = obs_time; } @@ -915,7 +940,7 @@ void process_point_met_data(MetPointData *met_point_obs, MetConfig &config, VarI int filtered_by_time = 0; int filtered_by_msg_type = 0; int filtered_by_qc = 0; - for (idx=0; idx < nobs; idx++) { + for (int idx=0; idx < nobs; idx++) { if (var_idx_or_gc == obs_data->obs_ids[idx]) { var_count2++; hdr_idx = obs_data->obs_hids[idx]; @@ -1104,7 +1129,7 @@ void process_point_met_data(MetPointData *met_point_obs, MetConfig &config, VarI log_msg << ", by msg_type: " << filtered_by_msg_type; if (0 < filtered_by_msg_type) { log_msg << " ["; - for(idx=0; idx 0) log_msg << ","; log_msg << conf_info.message_type[idx]; } @@ -1113,7 +1138,7 @@ void process_point_met_data(MetPointData *met_point_obs, MetConfig &config, VarI log_msg << ", by QC: " << filtered_by_qc; if (0 < filtered_by_qc) { log_msg << " ["; - for(idx=0; idx 0) log_msg << ","; log_msg << qc_flags[idx]; } @@ -1179,7 +1204,7 @@ static void process_point_file(NcFile *nc_in, MetConfig &config, VarInfo *vinfo, nc_point_obs.close(); mlog << Debug(LEVEL_FOR_PERFORMANCE) << method_name << "took " - << (clock()-start_clock)/double(CLOCKS_PER_SEC) << " seconds\n"; + << get_exe_duration(start_clock) << " seconds\n"; } @@ -1216,7 +1241,7 @@ static void process_point_python(const string python_command, MetConfig &config, met_point_file.close(); mlog << Debug(LEVEL_FOR_PERFORMANCE) << method_name << "took " - << (clock()-start_clock)/double(CLOCKS_PER_SEC) << " seconds\n"; + << get_exe_duration(start_clock) << " seconds\n"; return; } @@ -1234,10 +1259,10 @@ static void process_point_nccf_file(NcFile *nc_in, MetConfig &config, bool *skip_times = nullptr; double *valid_times = nullptr; int filtered_by_time = 0; + int time_from_size = 1; clock_t start_clock = clock(); bool opt_all_attrs = false; Grid fr_grid = fr_mtddf->grid(); - int from_size = fr_grid.nx() * fr_grid.ny(); static const char *method_name = "process_point_nccf_file() -> "; NcVar var_lat; @@ -1247,10 +1272,10 @@ static void process_point_nccf_file(NcFile *nc_in, MetConfig &config, ConcatString lon_vname = conf_info.get_var_name(conf_key_lon_vname); if (lat_vname != conf_key_lat_vname && lon_vname != conf_key_lon_vname) { - if (lat_vname != conf_key_lat_vname && has_var(nc_in, lat_vname.c_str())) { + if (has_var(nc_in, lat_vname.c_str())) { var_lat = get_nc_var(nc_in, lat_vname.c_str()); } - if (lon_vname != conf_key_lon_vname && has_var(nc_in, lon_vname.c_str())) { + if (has_var(nc_in, lon_vname.c_str())) { var_lon = get_nc_var(nc_in, lon_vname.c_str()); } if (IS_INVALID_NC(var_lat)) { @@ -1270,7 +1295,7 @@ static void process_point_nccf_file(NcFile *nc_in, MetConfig &config, // Find lat/lon variables from the coordinates attribue if (0 < FieldSA.n() && !user_defined_latlon) { ConcatString coordinates_value; - VarInfoNcCF var_info = VarInfoNcCF(*(VarInfoNcCF *)vinfo); + auto var_info = VarInfoNcCF(*(VarInfoNcCF *)vinfo); // Initialize var_info.clear(); // Populate the VarInfo object using the config string @@ -1322,8 +1347,9 @@ static void process_point_nccf_file(NcFile *nc_in, MetConfig &config, if( IS_VALID_NC(time_var) ) { if( 1 < get_dim_count(&time_var) ) { double max_time = bad_data_double; - skip_times = new bool[from_size]; - valid_times = new double[from_size]; + time_from_size = get_data_size(&time_var); + skip_times = new bool[time_from_size]; + valid_times = new double[time_from_size]; if (get_nc_data(&time_var, valid_times)) { int sec_per_unit = 0; bool no_leap_year = false; @@ -1334,7 +1360,7 @@ static void process_point_nccf_file(NcFile *nc_in, MetConfig &config, if (!is_bad_data(conf_info.end_ds)) valid_end_ut += conf_info.end_ds; ref_ut = get_reference_unixtime(&time_var, sec_per_unit, no_leap_year); } - for (int i=0; i 0 ) { tmp_time = add_to_unixtime(ref_ut, sec_per_unit, valid_times[i], no_leap_year); @@ -1405,7 +1431,10 @@ static void process_point_nccf_file(NcFile *nc_in, MetConfig &config, // List range of data values if(mlog.verbosity_level() >= 2) { - double fr_dmin, fr_dmax, to_dmin, to_dmax; + double fr_dmin; + double fr_dmax; + double to_dmin; + double to_dmax; fr_dp.data_range(fr_dmin, fr_dmax); to_dp.data_range(to_dmin, to_dmax); mlog << Debug(2) << "Range of data (" << FieldSA[i] << ")\n" @@ -1428,7 +1457,8 @@ static void process_point_nccf_file(NcFile *nc_in, MetConfig &config, bool has_prob_thresh = !prob_cat_thresh.check(bad_data_double); if (has_prob_thresh || do_gaussian_filter) { - DataPlane prob_dp, prob_mask_dp; + DataPlane prob_dp; + DataPlane prob_mask_dp; ConcatString vname_prob = vname; vname_prob << "_prob_" << prob_cat_thresh.get_abbr_str(); int nx = to_dp.nx(); @@ -1477,12 +1507,12 @@ static void process_point_nccf_file(NcFile *nc_in, MetConfig &config, cellMapping = (IntArray *) nullptr; if( 0 < filtered_by_time ) { mlog << Debug(2) << method_name << "Filtered by time: " << filtered_by_time - << " out of " << from_size + << " out of " << time_from_size << " [" << unix_to_yyyymmdd_hhmmss(valid_beg_ut) << " to " << unix_to_yyyymmdd_hhmmss(valid_end_ut) << "]\n"; } mlog << Debug(LEVEL_FOR_PERFORMANCE) << method_name << "took " - << (clock()-start_clock)/double(CLOCKS_PER_SEC) << " seconds\n"; + << get_exe_duration(start_clock) << " seconds\n"; return; } @@ -1506,9 +1536,6 @@ static void regrid_nc_variable(NcFile *nc_in, Met2dDataFile *fr_mtddf, exit(1); } - int from_lat_cnt = fr_grid.ny(); - int from_lon_cnt = fr_grid.nx(); - int from_data_size = from_lat_cnt * from_lon_cnt; if(!fr_mtddf->data_plane(*vinfo, fr_dp)) { mlog << Error << "\n" << method_name << "Trouble reading data \"" @@ -1516,106 +1543,112 @@ static void regrid_nc_variable(NcFile *nc_in, Met2dDataFile *fr_mtddf, << InputFilename << "\"\n\n"; exit(1); } - else { - bool is_to_north = !fr_grid.get_swap_to_north(); - auto from_data = new float[from_data_size]; - for (int xIdx=0; xIdx= 4) { - if (from_min_value > data_value) from_min_value = data_value; - if (from_max_value < data_value) from_max_value = data_value; - } + int from_index; + int no_map_cnt = 0; + int missing_cnt = 0; + int non_missing_cnt = 0; + double data_value; + IntArray cellArray; + NumArray dataArray; + double from_min_value = 10e10; + double from_max_value = -10e10; + int to_lat_cnt = to_grid.ny(); + int to_lon_cnt = to_grid.nx(); + + missing_cnt = non_missing_cnt = 0; + to_dp.set_constant(bad_data_double); + + for (int xIdx=0; xIdx= 9) { - double to_lat, to_lon; - to_grid.xy_to_latlon(xIdx,yIdx, to_lat, to_lon); - to_lon *= -1; - if (1 == data_cnt) - mlog << Debug(9) << method_name - << "value: " << to_value << " to (" << to_lon << ", " << to_lat - << ") from offset " << from_index << ".\n"; - else - mlog << Debug(9) << method_name - << "value: " << to_value - << ", max: " << dataArray.max() - << ", min: " << dataArray.min() - << ", mean: " << dataArray.sum()/data_cnt - << " from " << data_cnt << " (out of " << cellArray.n() - << ") data values to (" << to_lon << ", " << to_lat << ").\n"; - } + dataArray.add(data_value); + non_missing_cnt++; + if(mlog.verbosity_level() >= 4) { + if (from_min_value > data_value) from_min_value = data_value; + if (from_max_value < data_value) from_max_value = data_value; } } - else { - no_map_cnt++; + + if (0 < dataArray.n()) { + double to_value; + int data_cnt = dataArray.n(); + if (1 == data_cnt) to_value = dataArray[0]; + else if (RGInfo.method == InterpMthd::Min) to_value = dataArray.min(); + else if (RGInfo.method == InterpMthd::Max) to_value = dataArray.max(); + else if (RGInfo.method == InterpMthd::Median) { + dataArray.sort_array(); + to_value = dataArray[data_cnt/2]; + if (0 == data_cnt % 2) + to_value = (to_value + dataArray[(data_cnt/2)+1])/2; + } + else to_value = dataArray.sum() / data_cnt; // UW_Mean + + to_dp.set(to_value, xIdx, yIdx); + to_cell_cnt++; + if(mlog.verbosity_level() >= 9) { + double to_lat; + double to_lon; + to_grid.xy_to_latlon(xIdx,yIdx, to_lat, to_lon); + to_lon *= -1; + if (1 == data_cnt) + mlog << Debug(9) << method_name + << "value: " << to_value << " to (" << to_lon << ", " << to_lat + << ") from offset " << from_index << ".\n"; + else + mlog << Debug(9) << method_name + << "value: " << to_value + << ", max: " << dataArray.max() + << ", min: " << dataArray.min() + << ", mean: " << dataArray.sum()/data_cnt + << " from " << data_cnt << " (out of " << cellArray.n() + << ") data values to (" << to_lon << ", " << to_lat << ").\n"; + } } } + else { + no_map_cnt++; + } } + } - delete [] from_data; + delete [] from_data; - mlog << Debug(4) << method_name << "[Count] data cells: " << to_cell_cnt - << ", missing: " << missing_cnt << ", non_missing: " << non_missing_cnt - << ", non mapped cells: " << no_map_cnt - << " out of " << (to_lat_cnt*to_lon_cnt) - << "\n\tRange: data: [" << from_min_value << " - " << from_max_value - << "]\n"; - } + mlog << Debug(4) << method_name << "[Count] data cells: " << to_cell_cnt + << ", missing: " << missing_cnt << ", non_missing: " << non_missing_cnt + << ", non mapped cells: " << no_map_cnt + << " out of " << (to_lat_cnt*to_lon_cnt) + << "\n\tRange: data: [" << from_min_value << " - " << from_max_value + << "]\n"; if (to_cell_cnt == 0) { mlog << Warning << "\n" << method_name @@ -1623,7 +1656,7 @@ static void regrid_nc_variable(NcFile *nc_in, Met2dDataFile *fr_mtddf, } mlog << Debug(LEVEL_FOR_PERFORMANCE) << method_name << "took " - << (clock()-start_clock)/double(CLOCKS_PER_SEC) << " seconds\n"; + << get_exe_duration(start_clock) << " seconds\n"; } //////////////////////////////////////////////////////////////////////// @@ -1818,7 +1851,10 @@ static void process_goes_file(NcFile *nc_in, MetConfig &config, VarInfo *vinfo, // List range of data values if(mlog.verbosity_level() >= 2) { - double fr_dmin, fr_dmax, to_dmin, to_dmax; + double fr_dmin; + double fr_dmax; + double to_dmin; + double to_dmax; fr_dp.data_range(fr_dmin, fr_dmax); to_dp.data_range(to_dmin, to_dmax); mlog << Debug(2) << "Range of data (" << FieldSA[i] << ")\n" @@ -1848,7 +1884,8 @@ static void process_goes_file(NcFile *nc_in, MetConfig &config, VarInfo *vinfo, bool has_prob_thresh = !prob_cat_thresh.check(bad_data_double); if (has_prob_thresh || do_gaussian_filter) { - DataPlane prob_dp, prob_mask_dp; + DataPlane prob_dp; + DataPlane prob_mask_dp; ConcatString vname_prob = vname; vname_prob << "_prob_" << prob_cat_thresh.get_abbr_str(); int nx = to_dp.nx(); @@ -1901,7 +1938,7 @@ static void process_goes_file(NcFile *nc_in, MetConfig &config, VarInfo *vinfo, clear_cell_mapping(cellMapping); delete [] cellMapping; cellMapping = (IntArray *) nullptr; mlog << Debug(LEVEL_FOR_PERFORMANCE) << method_name << "took " - << (clock()-start_clock)/double(CLOCKS_PER_SEC) << " seconds\n"; + << get_exe_duration(start_clock) << " seconds\n"; return; } @@ -2018,7 +2055,8 @@ static bool get_grid_mapping(const Grid &to_grid, IntArray *cellMapping, return status; } - double x, y; + double x; + double y; DataPlane to_dp; int to_lat_count = to_grid.ny(); int to_lon_count = to_grid.nx(); @@ -2050,7 +2088,7 @@ static bool get_grid_mapping(const Grid &to_grid, IntArray *cellMapping, << ((obs_count > 0) ? 1.0*count_in_grid/obs_count*100 : 0) << "%)\n"; } mlog << Debug(LEVEL_FOR_PERFORMANCE) << method_name << "took " - << (clock()-start_clock)/double(CLOCKS_PER_SEC) << " seconds\n"; + << get_exe_duration(start_clock) << " seconds\n"; return status; } @@ -2061,15 +2099,17 @@ static void get_grid_mapping_latlon( DataPlane from_dp, DataPlane to_dp, Grid to_grid, IntArray *cellMapping, float *latitudes, float *longitudes, int from_lat_count, int from_lon_count, bool *skip_times, bool to_north) { - double x, y; - double to_ll_lat, to_ll_lon; + double x; + double y; + double to_ll_lat; + double to_ll_lon; int count_in_grid = 0; clock_t start_clock = clock(); int to_lat_count = to_grid.ny(); int to_lon_count = to_grid.nx(); int to_size = to_lat_count * to_lon_count; int data_size = from_lat_count * from_lon_count; - static const char *method_name = "get_grid_mapping(lats, lons) -> "; + static const char *method_name = "get_grid_mapping_latlon(lats, lons) -> "; auto to_cell_counts = new int[to_size]; auto mapping_indices = new int[data_size]; @@ -2088,7 +2128,7 @@ static void get_grid_mapping_latlon( float lat = latitudes[coord_offset]; float lon = longitudes[coord_offset]; if( lat < MISSING_LATLON || lon < MISSING_LATLON ) continue; - to_grid.latlon_to_xy(lat, -1.0*lon, x, y); + to_grid.latlon_to_xy(lat, -1.0*rescale_lon(lon), x, y); int idx_x = nint(x); int idx_y = nint(y); if (0 <= idx_x && idx_x < to_lon_count && 0 <= idx_y && idx_y < to_lat_count) { @@ -2097,16 +2137,17 @@ static void get_grid_mapping_latlon( to_cell_counts[to_offset] += 1; count_in_grid++; if(mlog.verbosity_level() >= 15) { - double to_lat, to_lon; + double to_lat; + double to_lon; to_grid.xy_to_latlon(idx_x, idx_y, to_lat, to_lon); - mlog << Debug(15) << method_name << " [" << xIdx << "," << yIdx << "] to " << coord_offset - << " (" << lon << ", " << lat << ") to (" << (to_lon*-1) << ", " << to_lat << ")\n"; + mlog << Debug(15) << method_name << " index: [" << xIdx << "," << yIdx << "] to " << coord_offset + << " (" << lon << ", " << lat << ") to (" << rescale_lon(-1*to_lon) << ", " << to_lat << ")\n"; } } } } mlog << Debug(LEVEL_FOR_PERFORMANCE+2) << method_name << "took " - << (clock()-start_clock)/double(CLOCKS_PER_SEC) << " seconds for mapping cells\n"; + << get_exe_duration(start_clock) << " seconds for mapping cells\n"; // Count the mapping cells for each to_cell and prepare IntArray int max_count = 0; @@ -2129,7 +2170,7 @@ static void get_grid_mapping_latlon( } } mlog << Debug(LEVEL_FOR_PERFORMANCE+1) << method_name << "took " - << (clock()-tmp_clock)/double(CLOCKS_PER_SEC) + << get_exe_duration(tmp_clock) << " seconds for extending IntArray (max_cells=" << max_count << ")\n"; // Build cell mapping @@ -2150,7 +2191,7 @@ static void get_grid_mapping_latlon( mlog << Debug(3) << method_name << "within grid: " << count_in_grid << " out of " << data_size << " (" << 1.0*count_in_grid/data_size*100 << "%)\n"; mlog << Debug(LEVEL_FOR_PERFORMANCE) << method_name << "took " - << (clock()-start_clock)/double(CLOCKS_PER_SEC) << " seconds\n"; + << get_exe_duration(start_clock) << " seconds\n"; } //////////////////////////////////////////////////////////////////////// @@ -2158,7 +2199,8 @@ static void get_grid_mapping_latlon( static bool get_grid_mapping(const Grid &fr_grid, const Grid &to_grid, IntArray *cellMapping, NcVar var_lat, NcVar var_lon, bool *skip_times) { bool status = false; - DataPlane from_dp, to_dp; + DataPlane from_dp; + DataPlane to_dp; ConcatString cur_coord_name; clock_t start_clock = clock(); static const char *method_name = "get_grid_mapping(var_lat, var_lon) -> "; @@ -2167,7 +2209,14 @@ static bool get_grid_mapping(const Grid &fr_grid, const Grid &to_grid, IntArray int to_lon_count = to_grid.nx(); int from_lat_count = fr_grid.ny(); int from_lon_count = fr_grid.nx(); - + if (0 == from_lat_count) { + int dim_offset = get_dim_count(&var_lat) - 1; + if (dim_offset < 0) dim_offset = 0; + from_lat_count = get_dim_size(&var_lat, dim_offset); + dim_offset = get_dim_count(&var_lon) - 2; + if (dim_offset < 0) dim_offset = 0; + from_lon_count = get_dim_size(&var_lon, dim_offset); + } // Override the from nx & ny from NetCDF if exists int data_size = from_lat_count * from_lon_count; mlog << Debug(4) << method_name << "data_size (ny*nx): " << data_size @@ -2212,7 +2261,7 @@ static bool get_grid_mapping(const Grid &fr_grid, const Grid &to_grid, IntArray if( longitudes ) delete [] longitudes; } // if data_size > 0 mlog << Debug(LEVEL_FOR_PERFORMANCE) << method_name << "took " - << (clock()-start_clock)/double(CLOCKS_PER_SEC) << " seconds\n"; + << get_exe_duration(start_clock) << " seconds\n"; return status; } @@ -2272,7 +2321,8 @@ static ConcatString get_goes_grid_input(MetConfig config, const Grid fr_grid) { static void get_grid_mapping(const Grid &fr_grid, const Grid &to_grid, IntArray *cellMapping, const ConcatString &geostationary_file) { static const char *method_name = "get_grid_mapping() -> "; - DataPlane from_dp, to_dp; + DataPlane from_dp; + DataPlane to_dp; ConcatString cur_coord_name; clock_t start_clock = clock(); @@ -2431,7 +2481,7 @@ static void get_grid_mapping(const Grid &fr_grid, const Grid &to_grid, IntArray if(coord_nc_in) delete coord_nc_in; mlog << Debug(LEVEL_FOR_PERFORMANCE) << method_name << "took " - << (clock()-start_clock)/double(CLOCKS_PER_SEC) << " seconds\n"; + << get_exe_duration(start_clock) << " seconds\n"; } //////////////////////////////////////////////////////////////////////// @@ -2831,7 +2881,7 @@ static void regrid_goes_variable(NcFile *nc_in, const VarInfo *vinfo, } mlog << Debug(LEVEL_FOR_PERFORMANCE) << method_name << "took " - << (clock()-start_clock)/double(CLOCKS_PER_SEC) << " seconds\n"; + << get_exe_duration(start_clock) << " seconds\n"; } //////////////////////////////////////////////////////////////////////// @@ -2900,7 +2950,7 @@ static void save_geostationary_data(const ConcatString geostationary_file, delete nc_file; nc_file = nullptr; mlog << Debug(LEVEL_FOR_PERFORMANCE) << method_name << "took " - << (clock()-start_clock)/double(CLOCKS_PER_SEC) << " seconds\n"; + << get_exe_duration(start_clock) << " seconds\n"; } //////////////////////////////////////////////////////////////////////// diff --git a/src/tools/other/regrid_data_plane/Makefile.in b/src/tools/other/regrid_data_plane/Makefile.in index 61c475b1ae..75f0f17630 100644 --- a/src/tools/other/regrid_data_plane/Makefile.in +++ b/src/tools/other/regrid_data_plane/Makefile.in @@ -225,6 +225,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/tools/other/shift_data_plane/Makefile.in b/src/tools/other/shift_data_plane/Makefile.in index 4eb7b7f50b..aa38481fea 100644 --- a/src/tools/other/shift_data_plane/Makefile.in +++ b/src/tools/other/shift_data_plane/Makefile.in @@ -225,6 +225,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/tools/other/wwmca_tool/Makefile.in b/src/tools/other/wwmca_tool/Makefile.in index 972b3f9255..e3be6b2af6 100644 --- a/src/tools/other/wwmca_tool/Makefile.in +++ b/src/tools/other/wwmca_tool/Makefile.in @@ -285,6 +285,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/tools/tc_utils/Makefile.in b/src/tools/tc_utils/Makefile.in index 7c74bba2fa..858a6de0b8 100644 --- a/src/tools/tc_utils/Makefile.in +++ b/src/tools/tc_utils/Makefile.in @@ -232,6 +232,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/tools/tc_utils/rmw_analysis/Makefile.in b/src/tools/tc_utils/rmw_analysis/Makefile.in index 9a89e51057..6d37dbd043 100644 --- a/src/tools/tc_utils/rmw_analysis/Makefile.in +++ b/src/tools/tc_utils/rmw_analysis/Makefile.in @@ -225,6 +225,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/tools/tc_utils/tc_diag/Makefile.in b/src/tools/tc_utils/tc_diag/Makefile.in index b884c28f85..66b5eb365d 100644 --- a/src/tools/tc_utils/tc_diag/Makefile.in +++ b/src/tools/tc_utils/tc_diag/Makefile.in @@ -227,6 +227,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/tools/tc_utils/tc_dland/Makefile.in b/src/tools/tc_utils/tc_dland/Makefile.in index 66bc377e52..b31ca8a29e 100644 --- a/src/tools/tc_utils/tc_dland/Makefile.in +++ b/src/tools/tc_utils/tc_dland/Makefile.in @@ -235,6 +235,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/tools/tc_utils/tc_gen/Makefile.in b/src/tools/tc_utils/tc_gen/Makefile.in index 97b0b5994f..98881f5a22 100644 --- a/src/tools/tc_utils/tc_gen/Makefile.in +++ b/src/tools/tc_utils/tc_gen/Makefile.in @@ -225,6 +225,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/tools/tc_utils/tc_pairs/Makefile.in b/src/tools/tc_utils/tc_pairs/Makefile.in index 736cb2afe3..f56d6bbcbd 100644 --- a/src/tools/tc_utils/tc_pairs/Makefile.in +++ b/src/tools/tc_utils/tc_pairs/Makefile.in @@ -249,6 +249,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/tools/tc_utils/tc_rmw/Makefile.in b/src/tools/tc_utils/tc_rmw/Makefile.in index 0c5220595a..05430c1fa0 100644 --- a/src/tools/tc_utils/tc_rmw/Makefile.in +++ b/src/tools/tc_utils/tc_rmw/Makefile.in @@ -227,6 +227,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@ diff --git a/src/tools/tc_utils/tc_stat/Makefile.in b/src/tools/tc_utils/tc_stat/Makefile.in index 24bba4f72e..d6926559a0 100644 --- a/src/tools/tc_utils/tc_stat/Makefile.in +++ b/src/tools/tc_utils/tc_stat/Makefile.in @@ -227,6 +227,7 @@ MET_BUFRLIB = @MET_BUFRLIB@ MET_CAIRO = @MET_CAIRO@ MET_CAIROINC = @MET_CAIROINC@ MET_CAIROLIB = @MET_CAIROLIB@ +MET_CXX_STANDARD = @MET_CXX_STANDARD@ MET_ECKIT = @MET_ECKIT@ MET_ECKITINC = @MET_ECKITINC@ MET_ECKITLIB = @MET_ECKITLIB@