From 42f672e7ac65f9bae0bc05260c683ee3dae21966 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 11 Sep 2023 10:02:39 -0600 Subject: [PATCH] Update main_v11.0-ref after 11.0.3 release (#2678) (#2679) Co-authored-by: MET Tools Test Account Co-authored-by: Howard Soh Co-authored-by: John Halley Gotway Co-authored-by: jprestop Co-authored-by: hsoh-u Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com> Co-authored-by: lisagoodrich <33230218+lisagoodrich@users.noreply.github.com> Co-authored-by: Stephen Herbener <32968781+srherbener@users.noreply.github.com> fix #2389 main_v11.0 flowchart (#2391) fix definitions of G172 and G220 based on comments in NOAA-EMC/NCEPLIBS-w3emc#157. (#2405) fix #2380 main_v11.0 override (#2381) fix #2408 main_v11.0 empty config (#2409) fix #2390 main_v11.0 fix compiling hdf5 with zlib and handle NetCDF-C zip (#2403) fix #2415 main_v11.0 modulefiles (#2416) fix #2412 main_v11.0 climo (#2420) fix #2426 main_v11.0 buoy (#2432) fix #2437 main_v11.0 convert (#2438) fix for main_v11.0, for #2437, forgot one reference to the search_parent for a dictionary lookup. fix 2428 python from env main v11.0 (#2443) fix 2428 python csv input (#2450) fix #2452 main_v11.0 airnow (#2453) fix #2402 main_v11.0 sonarqube (First PR) (#2447) fix #2449 main_v11.0 pdf (#2465) fix 2428 python csv input (#2467) fix #2514 main_v11.0 clang (#2556) fix #2575 main_v11.0 python_convert (#2577) fix 2596 main v11.0 rpath compilation (#2600) fix 2596 main v11.0 rpath compilation (#2613) fix #2644 main_v11.0 percentile (#2645) --- .github/ISSUE_TEMPLATE/bug_report.md | 4 +- .github/ISSUE_TEMPLATE/enhancement_request.md | 4 +- .github/ISSUE_TEMPLATE/new_feature_request.md | 4 +- .github/ISSUE_TEMPLATE/sub-issue.md | 4 +- .github/ISSUE_TEMPLATE/task.md | 4 +- .github/workflows/testing.yml | 14 +++- .github/workflows/update_truth.yml | 59 ++++++++++++++++ .readthedocs.yaml | 6 +- docs/Users_Guide/release-notes.rst | 16 +++++ docs/Users_Guide/stat-analysis.rst | 2 +- docs/conf.py | 4 +- .../scripts/installation/compile_MET_all.sh | 28 +++++++- .../installation/config/install_met_env.hera | 6 +- .../installation/config/install_met_env.jet | 6 +- .../installation/config/install_met_env.narya | 26 +++++++ .../installation/config/install_met_env.orion | 6 +- .../config/install_met_env_met_only.hera | 6 +- .../config/install_met_env_met_only.jet | 6 +- .../config/install_met_env_met_only.orion | 6 +- .../installation/modulefiles/11.0.1_hera | 68 +++++++++++++++++++ .../installation/modulefiles/11.0.1_jet | 19 ++++++ .../installation/modulefiles/11.0.1_orion | 45 ++++++++++++ src/basic/vx_log/concat_string.h | 4 +- src/basic/vx_math/ptile.cc | 49 +++++++++++-- src/basic/vx_util/main.cc | 2 +- src/basic/vx_util/util_constants.h | 3 +- src/libcode/vx_data2d_nccf/nccf_file.cc | 1 + src/libcode/vx_data2d_python/data2d_python.cc | 21 ++++-- src/libcode/vx_grid/grid_base.cc | 2 +- src/libcode/vx_nc_util/nc_utils.h | 2 +- 30 files changed, 374 insertions(+), 53 deletions(-) create mode 100644 .github/workflows/update_truth.yml create mode 100644 internal/scripts/installation/config/install_met_env.narya create mode 100644 internal/scripts/installation/modulefiles/11.0.1_hera create mode 100644 internal/scripts/installation/modulefiles/11.0.1_jet create mode 100644 internal/scripts/installation/modulefiles/11.0.1_orion diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 99dcf64150..8ca241ca36 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -2,7 +2,7 @@ name: Bug report about: Fix something that's not working title: 'Bugfix: ' -labels: 'alert: NEED ACCOUNT KEY, alert: NEED MORE DEFINITION, alert: NEED PROJECT ASSIGNMENT, type: bug' +labels: 'alert: NEED ACCOUNT KEY, alert: NEED MORE DEFINITION, alert: NEED CYCLE ASSIGNMENT, type: bug' assignees: '' --- @@ -49,7 +49,7 @@ Describe the steps to reproduce the behavior: ### Projects and Milestone ### - [ ] Select **Organization** level **Project** for support of the current coordinated release -- [ ] Select **Repository** level **Project** for development toward the next official release or add **alert: NEED PROJECT ASSIGNMENT** label +- [ ] Select **Repository** level **Project** for development toward the next official release or add **alert: NEED CYCLE ASSIGNMENT** label - [ ] Select **Milestone** as the next bugfix version ## Define Related Issue(s) ## diff --git a/.github/ISSUE_TEMPLATE/enhancement_request.md b/.github/ISSUE_TEMPLATE/enhancement_request.md index 0b82c047c5..df95cc1587 100644 --- a/.github/ISSUE_TEMPLATE/enhancement_request.md +++ b/.github/ISSUE_TEMPLATE/enhancement_request.md @@ -2,7 +2,7 @@ name: Enhancement request about: Improve something that it's currently doing title: '' -labels: 'alert: NEED ACCOUNT KEY, alert: NEED MORE DEFINITION, alert: NEED PROJECT ASSIGNMENT, type: enhancement' +labels: 'alert: NEED ACCOUNT KEY, alert: NEED MORE DEFINITION, alert: NEED CYCLE ASSIGNMENT, type: enhancement' assignees: '' --- @@ -38,7 +38,7 @@ Consider breaking the enhancement down into sub-issues. - [ ] Select **requestor(s)** ### Projects and Milestone ### -- [ ] Select **Repository** and/or **Organization** level **Project(s)** or add **alert: NEED PROJECT ASSIGNMENT** label +- [ ] Select **Repository** and/or **Organization** level **Project(s)** or add **alert: NEED CYCLE ASSIGNMENT** label - [ ] Select **Milestone** as the next official version or **Future Versions** ## Define Related Issue(s) ## diff --git a/.github/ISSUE_TEMPLATE/new_feature_request.md b/.github/ISSUE_TEMPLATE/new_feature_request.md index 4b1ae69aff..c2e0179c28 100644 --- a/.github/ISSUE_TEMPLATE/new_feature_request.md +++ b/.github/ISSUE_TEMPLATE/new_feature_request.md @@ -2,7 +2,7 @@ name: New feature request about: Make it do something new title: '' -labels: 'alert: NEED ACCOUNT KEY, alert: NEED MORE DEFINITION, alert: NEED PROJECT ASSIGNMENT, type: new feature' +labels: 'alert: NEED ACCOUNT KEY, alert: NEED MORE DEFINITION, alert: NEED CYCLE ASSIGNMENT, type: new feature' assignees: '' --- @@ -42,7 +42,7 @@ Consider breaking the new feature down into sub-issues. - [ ] Select **requestor(s)** ### Projects and Milestone ### -- [ ] Select **Repository** and/or **Organization** level **Project(s)** or add **alert: NEED PROJECT ASSIGNMENT** label +- [ ] Select **Repository** and/or **Organization** level **Project(s)** or add **alert: NEED CYCLE ASSIGNMENT** label - [ ] Select **Milestone** as the next official version or **Future Versions** ## Define Related Issue(s) ## diff --git a/.github/ISSUE_TEMPLATE/sub-issue.md b/.github/ISSUE_TEMPLATE/sub-issue.md index 77bf2b2844..855e27d83d 100644 --- a/.github/ISSUE_TEMPLATE/sub-issue.md +++ b/.github/ISSUE_TEMPLATE/sub-issue.md @@ -2,7 +2,7 @@ name: Sub-Issue about: Break an issue down into smaller parts title: '' -labels: 'alert: NEED ACCOUNT KEY, alert: NEED MORE DEFINITION, alert: NEED PROJECT ASSIGNMENT, type: sub-issue' +labels: 'alert: NEED ACCOUNT KEY, alert: NEED MORE DEFINITION, alert: NEED CYCLE ASSIGNMENT, type: sub-issue' assignees: '' --- @@ -28,5 +28,5 @@ This is a sub-issue of #*List the parent issue number here*. - [ ] Select **requestor(s)** ### Projects and Milestone ### -- [ ] Select **Repository** and/or **Organization** level **Project(s)** or add **alert: NEED PROJECT ASSIGNMENT** label +- [ ] Select **Repository** and/or **Organization** level **Project(s)** or add **alert: NEED CYCLE ASSIGNMENT** label - [ ] Select **Milestone** as the next official version or **Future Versions** diff --git a/.github/ISSUE_TEMPLATE/task.md b/.github/ISSUE_TEMPLATE/task.md index 561012a7f6..f175cdb678 100644 --- a/.github/ISSUE_TEMPLATE/task.md +++ b/.github/ISSUE_TEMPLATE/task.md @@ -2,7 +2,7 @@ name: Task about: Describe something that needs to be done title: '' -labels: 'alert: NEED ACCOUNT KEY, alert: NEED MORE DEFINITION, alert: NEED PROJECT ASSIGNMENT, type: task' +labels: 'alert: NEED ACCOUNT KEY, alert: NEED MORE DEFINITION, alert: NEED CYCLE ASSIGNMENT, type: task' assignees: '' --- @@ -38,7 +38,7 @@ Consider breaking the task down into sub-issues. - [ ] Select **requestor(s)** ### Projects and Milestone ### -- [ ] Select **Repository** and/or **Organization** level **Project(s)** or add **alert: NEED PROJECT ASSIGNMENT** label +- [ ] Select **Repository** and/or **Organization** level **Project(s)** or add **alert: NEED CYCLE ASSIGNMENT** label - [ ] Select **Milestone** as the next official version or **Future Versions** ## Define Related Issue(s) ## diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index d270ba6404..e98d8e5027 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -14,7 +14,12 @@ on: - 'bugfix_**' paths-ignore: - 'docs/**' - + - '.github/pull_request_template.md' + - '.github/ISSUE_TEMPLATE/**' + - '.github/labels/**' + - '**/README.md' + - '**/LICENSE.md' + pull_request: types: [opened, reopened, synchronize] branches: @@ -22,7 +27,12 @@ on: - 'main_v**' paths-ignore: - 'docs/**' - + - '.github/pull_request_template.md' + - '.github/ISSUE_TEMPLATE/**' + - '.github/labels/**' + - '**/README.md' + - '**/LICENSE.md' + workflow_dispatch: inputs: force_tests: diff --git a/.github/workflows/update_truth.yml b/.github/workflows/update_truth.yml new file mode 100644 index 0000000000..cf9734e449 --- /dev/null +++ b/.github/workflows/update_truth.yml @@ -0,0 +1,59 @@ +name: Update Truth Data + +on: + workflow_dispatch: + inputs: + pull_requests: + description: 'Pull request(s) that warranted update, e.g. "#123" or "#123 and dtcenter/MET#123"' + required: true + change_summary: + description: 'Summary of changes to truth data' + required: true + +jobs: + update_truth: + name: "Update or create truth reference branch" + runs-on: ubuntu-latest + steps: + - name: Check if branch is develop or main_vX.Y + run: | + branch_name=${GITHUB_REF#refs/heads/} + echo "branch_name=$branch_name" >> $GITHUB_ENV + if [[ $branch_name == "develop" ]] || \ + [[ $branch_name =~ ^main_v[0-9]+\.[0-9]+$ ]]; then + echo Branch is valid - $branch_name + exit 0 + fi + echo ERROR: Branch is $branch_name - must be develop or match main_vX.Y + exit 1 + - uses: actions/checkout@v3 + name: Checkout repository + with: + fetch-depth: 0 + token: ${{ secrets.METPLUS_BOT_TOKEN }} + - name: Resolve conflicts between branch and branch-ref + run: | + branch_name=${{ env.branch_name }} + cd ${GITHUB_WORKSPACE} + if [[ -z "$(git ls-remote --heads origin ${branch_name}-ref)" ]]; then + echo ERROR: ${branch_name}-ref does not exist + exit 1 + fi + + echo ${branch_name}-ref does exist -- update it + git config --global user.name "metplus-bot" + git config --global user.email "97135045+metplus-bot@users.noreply.github.com" + echo git checkout ${branch_name} + git checkout ${branch_name} + echo git merge -s ours origin/${branch_name}-ref + git merge -s ours origin/${branch_name}-ref + echo git push origin ${branch_name} + git push origin ${branch_name} + + - name: Create Pull Request + run: gh pr create --base $BASE --body "$BODY" --title "$TITLE" + env: + GH_TOKEN: ${{ github.token }} + BASE: ${{ env.branch_name }}-ref + BODY: ${{ github.event.inputs.change_summary }}
Created by @${{ github.actor}} + TITLE: Update ${{ env.branch_name }}-ref after ${{ github.event.inputs.pull_requests }} diff --git a/.readthedocs.yaml b/.readthedocs.yaml index e18cbf4cca..cb3aab55c7 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -9,10 +9,14 @@ version: 2 #formats: all formats: [pdf] +build: + os: ubuntu-22.04 + tools: + python: "3.10" + # Optionally set the version of Python and requirements required to build your # docs python: - version: 3.7 install: - requirements: docs/requirements.txt diff --git a/docs/Users_Guide/release-notes.rst b/docs/Users_Guide/release-notes.rst index e16aa539be..eb488c7e64 100644 --- a/docs/Users_Guide/release-notes.rst +++ b/docs/Users_Guide/release-notes.rst @@ -10,6 +10,22 @@ enhancement, or new feature (`MET GitHub issues `_ + for additional details. + +* Bugfixes: + + * Bugfix: Fix the Clang compilation of MET version 11.0 (`#2514 `_). + * Bugfix: Fix logic for Python embedding with data censoring and/or conversion (`#2575 `_). + * Bugfix: Fix reading of upside-down CF-compliant NetCDF Rotated Lat/Lon data (`#2578 `_). + * Bugfix: Fix logic for computing the 100-th percentile (`#2644 `_). + MET Version 11.0.2 release notes (20230331) ------------------------------------------- diff --git a/docs/Users_Guide/stat-analysis.rst b/docs/Users_Guide/stat-analysis.rst index 1c1f1db4c0..4e439c6a63 100644 --- a/docs/Users_Guide/stat-analysis.rst +++ b/docs/Users_Guide/stat-analysis.rst @@ -282,7 +282,7 @@ The usage statement for the Stat-Analysis tool is shown below: stat_analysis has two required arguments and accepts several optional ones. -In the usage statement for the Stat-Analysis tool, some additional terminology is introduced. In the Stat-Analysis tool, the term "job" refers to a set of tasks to be performed after applying user-specified options (i.e., "filters"). The filters are used to pare down a collection of output from the MET statistics tools to only those lines that are desired for the analysis. The job and its filters together comprise the "job command line". The "job command line" may be specified either on the command line to run a single analysis job or within the configuration file to run multiple analysis jobs at the same time. If jobs are specified in both the configuration file and the command line, only the jobs indicated in the configuration file will be run. The various jobs types are described in :numref:`table_WS_format_info_ISC` and the filtering options are described in :numref:`wavelet_stat-configuration-file`. +In the usage statement for the Stat-Analysis tool, some additional terminology is introduced. In the Stat-Analysis tool, the term "job" refers to a set of tasks to be performed after applying user-specified options (i.e., "filters"). The filters are used to pare down a collection of output from the MET statistics tools to only those lines that are desired for the analysis. The job and its filters together comprise the "job command line". The "job command line" may be specified either on the command line to run a single analysis job or within the configuration file to run multiple analysis jobs at the same time. If jobs are specified in both the configuration file and the command line, only the jobs indicated in the configuration file will be run. The various jobs types are described in :numref:`Des_components_STAT_analysis_tool` and the filtering options are described in :numref:`stat_analysis-configuration-file`. Required arguments for stat_analysis ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/docs/conf.py b/docs/conf.py index efe4a392d2..c03d227544 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -20,12 +20,12 @@ project = 'MET' author = 'UCAR/NCAR, NOAA, CSU/CIRA, and CU/CIRES' author_list = 'Opatz, J., T. Jensen, J. Prestopnik, H. Soh, L. Goodrich, B. Brown, R. Bullock, J. Halley Gotway, K. Newman' -version = '11.0.2' +version = '11.0.3' verinfo = version release = f'{version}' release_year = '2023' -release_date = f'{release_year}-03-31' +release_date = f'{release_year}-09-08' copyright = f'{release_year}, {author}' # -- General configuration --------------------------------------------------- diff --git a/internal/scripts/installation/compile_MET_all.sh b/internal/scripts/installation/compile_MET_all.sh index 49ca28aba8..4418f4b8af 100644 --- a/internal/scripts/installation/compile_MET_all.sh +++ b/internal/scripts/installation/compile_MET_all.sh @@ -214,6 +214,7 @@ fi COMPILER_FAMILY=` echo $COMPILER | cut -d'_' -f1` COMPILER_VERSION=`echo $COMPILER | cut -d'_' -f2` COMPILER_MAJOR_VERSION=`echo $COMPILER_VERSION | cut -d'.' -f1` +COMPILER_MINOR_VERSION=`echo $COMPILER_VERSION | cut -d'.' -f2` echo echo "USE_MODULES = ${USE_MODULES}" @@ -314,6 +315,16 @@ echo "export F77=${F77}" echo "export F90=${F90}" echo +# Figure out what kind of OS is being used +unameOut="$(uname -s)" +case "${unameOut}" in + Linux*) machine=Linux;; + Darwin*) machine=Mac;; + CYGWIN*) machine=Cygwin;; + MINGW*) machine=MinGw;; + *) machine="UNKNOWN:${unameOut}" +esac + # Load Python module if [ ${USE_MODULES} = "TRUE" ]; then @@ -631,7 +642,7 @@ if [ $COMPILE_NETCDF -eq 1 ]; then tar -xzf ${TAR_DIR}/hdf5*.tar.gz cd hdf5* echo "cd `pwd`" - echo "./configure --prefix=${LIB_DIR} --with-zlib=${LIB_Z} CFLAGS=-fPIC CXXFLAGS=-fPIC FFLAGS=-fPIC LDFLAGS=-L${LIB_DIR}/lib CPPFLAGS=-I${LIB_DIR}/include > configure.log 2>&1" + echo "./configure --prefix=${LIB_DIR} --with-zlib=${LIB_Z} CFLAGS=-fPIC CXXFLAGS=-fPIC FFLAGS=-fPIC LDFLAGS=-L${LIB_DIR}/lib:${LIB_Z} CPPFLAGS=-I${LIB_DIR}/include > configure.log 2>&1" ./configure --prefix=${LIB_DIR} --with-zlib=${LIB_Z} CFLAGS=-fPIC CXXFLAGS=-fPIC FFLAGS=-fPIC LDFLAGS=-L${LIB_DIR}/lib:${LIB_Z} CPPFLAGS=-I${LIB_DIR}/include > configure.log 2>&1 ret=$? if [ $ret != 0 ]; then @@ -676,8 +687,13 @@ if [ $COMPILE_NETCDF -eq 1 ]; then tar -xzf ${TAR_DIR}/netcdf-cxx*.tar.gz cd netcdf-cxx* echo "cd `pwd`" - echo "./configure --prefix=${LIB_DIR} LDFLAGS=-L${LIB_DIR}/lib CPPFLAGS=-I${LIB_DIR}/include > configure.log 2>&1" - ./configure --prefix=${LIB_DIR} LDFLAGS=-L${LIB_DIR}/lib CPPFLAGS=-I${LIB_DIR}/include > configure.log 2>&1 + if [[ $machine == "Mac" ]]; then + echo "./configure --prefix=${LIB_DIR} LDFLAGS=-L${LIB_DIR}/lib CPPFLAGS=-I${LIB_DIR}/include LIBS=\"${LIBS} -lhdf5_hl -lhdf5 -lz\"> configure.log 2>&1" + ./configure --prefix=${LIB_DIR} LDFLAGS=-L${LIB_DIR}/lib CPPFLAGS=-I${LIB_DIR}/include LIBS="${LIBS} -lhdf5_hl -lhdf5 -lz"> configure.log 2>&1 + else + echo "./configure --prefix=${LIB_DIR} LDFLAGS=-L${LIB_DIR}/lib CPPFLAGS=-I${LIB_DIR}/include > configure.log 2>&1" + ./configure --prefix=${LIB_DIR} LDFLAGS=-L${LIB_DIR}/lib CPPFLAGS=-I${LIB_DIR}/include > configure.log 2>&1 + fi ret=$? if [ $ret != 0 ]; then echo "configure returned with non-zero ($ret) status" @@ -837,6 +853,12 @@ if [ $COMPILE_MET -eq 1 ]; then export MET_PYTHON_LD=${MET_PYTHON_LD} export MET_PYTHON_CC=${MET_PYTHON_CC} export LDFLAGS="-Wl,--disable-new-dtags" + + + if [[ $machine == "Mac" ]]; then + export LDFLAGS="" + fi + # https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html # ${parameter:+word} # If parameter is null or unset, nothing is substituted, otherwise the expansion of word is substituted. diff --git a/internal/scripts/installation/config/install_met_env.hera b/internal/scripts/installation/config/install_met_env.hera index 803d5e1aef..a8b31c8221 100755 --- a/internal/scripts/installation/config/install_met_env.hera +++ b/internal/scripts/installation/config/install_met_env.hera @@ -1,17 +1,17 @@ module use -a /contrib/anaconda/modulefiles module load intel/2022.1.2 module load anaconda/latest -export TEST_BASE=/contrib/met/11.0.0 +export TEST_BASE=/contrib/met/11.0.1 export COMPILER=intel_2022.1.2 export MET_SUBDIR=${TEST_BASE} -export MET_TARBALL=v11.0.0.tar.gz +export MET_TARBALL=v11.0.1.tar.gz export USE_MODULES=TRUE export PYTHON_MODULE=anaconda_latest export MET_PYTHON=/contrib/anaconda/anaconda3/latest/ export MET_PYTHON_CC=-I${MET_PYTHON}/include/python3.7m export MET_PYTHON_LD=-L${MET_PYTHON}/lib/python3.7/config-3.7m-x86_64-linux-gnu\ -L${MET_PYTHON}/lib\ -lpython3.7m\ -lcrypt\ -lpthread\ -ldl\ -lutil\ -lrt\ -lm\ -Xlinker\ -export-dynamic export SET_D64BIT=FALSE -export EXTERNAL_LIBS=/contrib/met/11.0.0/external_libs/ +export EXTERNAL_LIBS=/contrib/met/11.0.1/external_libs/ #export MET_NETCDF=${EXTERNAL_LIBS} export MET_GSL=${EXTERNAL_LIBS} export MET_BUFRLIB=${EXTERNAL_LIBS} diff --git a/internal/scripts/installation/config/install_met_env.jet b/internal/scripts/installation/config/install_met_env.jet index b90839a982..e1b2fa4135 100644 --- a/internal/scripts/installation/config/install_met_env.jet +++ b/internal/scripts/installation/config/install_met_env.jet @@ -2,17 +2,17 @@ module load intel/2022.1.2 module load netcdf/4.7.0 module load hdf5/1.10.5 -export TEST_BASE=/contrib/met/11.0.0 +export TEST_BASE=/contrib/met/11.0.1 export COMPILER=intel_18.0.5.274 export MET_SUBDIR=${TEST_BASE} -export MET_TARBALL=v11.0.0.tar.gz +export MET_TARBALL=v11.0.1.tar.gz export USE_MODULES=TRUE export MET_PYTHON=/mnt/lfs1/HFIP/dtc-hurr/METplus/miniconda/miniconda3/envs/metplus_v5.0_py3.8 export MET_PYTHON_CC=-I${MET_PYTHON}/include/python3.8 export MET_PYTHON_LD=-L${MET_PYTHON}/lib\ -L${MET_PYTHON}/lib/python3.8/config-3.8-x86_64-linux-gnu\ -lpython3.8\ -lpthread\ -ldl\ -lutil\ -lrt\ -lm\ -Xlinker\ -export-dynamic export MET_NETCDF=/apps/netcdf/4.7.0/intel/18.0.5.274 export MET_HDF5=/apps/hdf5/1.10.5/intel/18.0.5.274 -export EXTERNAL_LIBS=/contrib/met/11.0.0/external_libs/ +export EXTERNAL_LIBS=/contrib/met/11.0.1/external_libs/ #export MET_GSL=${EXTERNAL_LIBS} #export MET_BUFRLIB=${EXTERNAL_LIBS} #export BUFRLIB_NAME=-lbufr diff --git a/internal/scripts/installation/config/install_met_env.narya b/internal/scripts/installation/config/install_met_env.narya new file mode 100644 index 0000000000..9dd12ca42f --- /dev/null +++ b/internal/scripts/installation/config/install_met_env.narya @@ -0,0 +1,26 @@ +export TEST_BASE=/Volumes/d1/jpresto/projects/MET/MET_installation/11.0.2 +export COMPILER=gnu_12.3.0 +export MET_SUBDIR=${TEST_BASE} +export MET_TARBALL=v11.0.2.tar.gz +export USE_MODULES=FALSE +export MET_PYTHON=/opt/local +export MET_PYTHON_CC=-I${MET_PYTHON}/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 +export MET_PYTHON_LD=`python3-config --ldflags --embed` +export SET_D64BIT=FALSE +export CFLAGS="-Wall -g" +export CXXFLAGS="-Wall -g" + +# If you've already compiled these and don't need to compile them again, set the following; +# Otherwise, if you do need to install these libraries, comment out the variables below +export EXTERNAL_LIBS=${TEST_BASE}/external_libs +#export MET_GRIB2CLIB=${EXTERNAL_LIBS}/lib +#export MET_GRIB2CINC=${EXTERNAL_LIBS}/include +#export GRIB2CLIB_NAME=-lgrib2c +#export MET_BUFRLIB=${EXTERNAL_LIBS}/lib +#export BUFRLIB_NAME=-lbufr +#export MET_NETCDF=${EXTERNAL_LIBS} +#export MET_HDF5=${EXTERNAL_LIBS} +#export MET_GSL=${EXTERNAL_LIBS} +#export LIB_JASPER=${EXTERNAL_LIBS}/lib +#export LIB_LIBPNG=${EXTERNAL_LIBS}/lib +#export LIB_Z=${EXTERNAL_LIBS}/lib \ No newline at end of file diff --git a/internal/scripts/installation/config/install_met_env.orion b/internal/scripts/installation/config/install_met_env.orion index a144d8c492..63db005934 100644 --- a/internal/scripts/installation/config/install_met_env.orion +++ b/internal/scripts/installation/config/install_met_env.orion @@ -1,14 +1,14 @@ module load intel/2020.2 -export TEST_BASE=/apps/contrib/MET/11.0.0 +export TEST_BASE=/apps/contrib/MET/11.0.1 export COMPILER=intel_2020 export MET_SUBDIR=${TEST_BASE}/ -export MET_TARBALL=v11.0.0.tar.gz +export MET_TARBALL=v11.0.1.tar.gz export USE_MODULES=TRUE export MET_PYTHON=/work/noaa/ovp/miniconda/miniconda3/envs/metplus_v5.0_py3.8 export MET_PYTHON_CC=-I${MET_PYTHON}/include/python3.8 export MET_PYTHON_LD=-L${MET_PYTHON}/lib/python3.8/config-3.8-x86_64-linux-gnu\ -L${MET_PYTHON}/lib\ -lpython3.8\ -lcrypt\ -lpthread\ -ldl\ -lutil\ -lrt\ -lm -export EXTERNAL_LIBS=/apps/contrib/MET/11.0.0/external_libs +export EXTERNAL_LIBS=/apps/contrib/MET/11.0.1/external_libs export LIB_Z=${EXTERNAL_LIBS}/lib #export MET_GSL=${EXTERNAL_LIBS} #export MET_BUFRLIB=${EXTERNAL_LIBS} diff --git a/internal/scripts/installation/config/install_met_env_met_only.hera b/internal/scripts/installation/config/install_met_env_met_only.hera index 645ca9acab..0391eda698 100644 --- a/internal/scripts/installation/config/install_met_env_met_only.hera +++ b/internal/scripts/installation/config/install_met_env_met_only.hera @@ -1,17 +1,17 @@ module use -a /contrib/anaconda/modulefiles module load intel/2022.1.2 module load anaconda/latest -export TEST_BASE=/contrib/met/11.0.0 +export TEST_BASE=/contrib/met/11.0.1 export COMPILER=intel_2022.1.2 export MET_SUBDIR=${TEST_BASE} -export MET_TARBALL=v11.0.0.tar.gz +export MET_TARBALL=v11.0.1.tar.gz export USE_MODULES=TRUE export PYTHON_MODULE=anaconda_latest export MET_PYTHON=/contrib/anaconda/anaconda3/latest export MET_PYTHON_CC=-I${MET_PYTHON}/include/python3.7m export MET_PYTHON_LD=-L${MET_PYTHON}/lib/python3.7/config-3.7m-x86_64-linux-gnu\ -L${MET_PYTHON}/lib\ -lpython3.7m\ -lcrypt\ -lpthread\ -ldl\ -lutil\ -lrt\ -lm\ -Xlinker\ -export-dynamic export SET_D64BIT=FALSE -export EXTERNAL_LIBS=/contrib/met/11.0.0/external_libs/ +export EXTERNAL_LIBS=/contrib/met/11.0.1/external_libs/ export MET_NETCDF=${EXTERNAL_LIBS} export MET_GSL=${EXTERNAL_LIBS} export MET_BUFRLIB=${EXTERNAL_LIBS} diff --git a/internal/scripts/installation/config/install_met_env_met_only.jet b/internal/scripts/installation/config/install_met_env_met_only.jet index e642880266..9571326213 100644 --- a/internal/scripts/installation/config/install_met_env_met_only.jet +++ b/internal/scripts/installation/config/install_met_env_met_only.jet @@ -2,17 +2,17 @@ module load intel/2022.1.2 module load netcdf/4.7.0 module load hdf5/1.10.5 -export TEST_BASE=/contrib/met/11.0.0 +export TEST_BASE=/contrib/met/11.0.1 export COMPILER=intel_18.0.5.274 export MET_SUBDIR=${TEST_BASE} -export MET_TARBALL=v11.0.0.tar.gz +export MET_TARBALL=v11.0.1.tar.gz export USE_MODULES=TRUE export MET_PYTHON=/mnt/lfs1/HFIP/dtc-hurr/METplus/miniconda/miniconda3/envs/metplus_v5.0_py3.8 export MET_PYTHON_CC=-I${MET_PYTHON}/include/python3.8 export MET_PYTHON_LD=-L${MET_PYTHON}/lib\ -L${MET_PYTHON}/lib/python3.8/config-3.8-x86_64-linux-gnu\ -lpython3.8\ -lpthread\ -ldl\ -lutil\ -lrt\ -lm\ -Xlinker\ -export-dynamic export MET_NETCDF=/apps/netcdf/4.7.0/intel/18.0.5.274 export MET_HDF5=/apps/hdf5/1.10.5/intel/18.0.5.274 -export EXTERNAL_LIBS=/contrib/met/11.0.0/external_libs/ +export EXTERNAL_LIBS=/contrib/met/11.0.1/external_libs/ export MET_GSL=${EXTERNAL_LIBS} export MET_BUFRLIB=${EXTERNAL_LIBS} export BUFRLIB_NAME=-lbufr diff --git a/internal/scripts/installation/config/install_met_env_met_only.orion b/internal/scripts/installation/config/install_met_env_met_only.orion index ece8d88aa3..18a42cab35 100644 --- a/internal/scripts/installation/config/install_met_env_met_only.orion +++ b/internal/scripts/installation/config/install_met_env_met_only.orion @@ -1,14 +1,14 @@ module load intel/2020.2 -export TEST_BASE=/apps/contrib/MET/11.0.0 +export TEST_BASE=/apps/contrib/MET/11.0.1 export COMPILER=intel_2020 export MET_SUBDIR=${TEST_BASE}/ -export MET_TARBALL=v11.0.0.tar.gz +export MET_TARBALL=v11.0.1.tar.gz export USE_MODULES=TRUE export MET_PYTHON=/work/noaa/ovp/miniconda/miniconda3/envs/metplus_v5.0_py3.8 export MET_PYTHON_CC=-I${MET_PYTHON}/include/python3.8 export MET_PYTHON_LD=-L${MET_PYTHON}/lib/python3.8/config-3.8-x86_64-linux-gnu\ -L${MET_PYTHON}/lib\ -lpython3.8\ -lcrypt\ -lpthread\ -ldl\ -lutil\ -lrt\ -lm -export EXTERNAL_LIBS=/apps/contrib/MET/11.0.0/external_libs +export EXTERNAL_LIBS=/apps/contrib/MET/11.0.1/external_libs export MET_GSL=${EXTERNAL_LIBS} export MET_BUFRLIB=${EXTERNAL_LIBS} export BUFRLIB_NAME=-lbufr diff --git a/internal/scripts/installation/modulefiles/11.0.1_hera b/internal/scripts/installation/modulefiles/11.0.1_hera new file mode 100644 index 0000000000..4c16a7428a --- /dev/null +++ b/internal/scripts/installation/modulefiles/11.0.1_hera @@ -0,0 +1,68 @@ +#%Module###################################################################### +## +## Model Evaluation Tools +## +proc ModulesHelp { } { + puts stderr "Sets up the paths and environment variables to use the Model Evaluation Tools v11.0.1 + *** For help see the official MET webpage at http://www.dtcenter.org/met/users ***" +} + +# The intel compiler is required to run MET +prereq intel +prereq anaconda/latest + +set base /contrib/met +set ver 11.0.1 +set share $base/$ver/share/met +set lib_base $base/11.0.1 +setenv MET_ROOT $base/$ver/MET-11.0.1 + + +prepend-path PATH $base/$ver/bin:$lib_base/external_libs/bin + + +#prepend-path LD_LIBRARY_PATH $lib_base/external_libs/lib + +#setenv METversion $ver +#setenv MET_CONFIG $share/config +#setenv MET_POLY $share/poly +#setenv MET_COLORTABLES $share/colortables +#setenv MET_PS $share/ps +#setenv MET_TCDATA $share/tc_data +#setenv MET_TABLES $share/table_files +### +#setenv CC icc +#setenv CXX icc +#setenv F77 ifort + +#module load intel/2022.1.2 +#module load anaconda/latest + +#setenv libdir /contrib/met/11.0.1/external_libs/lib +#setenv incdir /contrib/met/11.0.1/external_libs/include +#setenv iprefix /contrib/met/11.0.1/external_libs +#setenv basedir /contrib/met/11.0.1/met-11.0.1 + +#setenv MET_HDF5 $iprefix +#setenv MET_NETCDF $incdir +#setenv MET_GRIB2CINC $incdir +#setenv MET_GRIB2CLIB $libdir +#setenv MET_GSLLIB $libdir +#setenv MET_GSLINC $incdir +#setenv MET_BUFR $libdir +#setenv MET_HDFINC $incdir +#setenv MET_HDFLIB $libdir +#setenv MET_HDFEOSINC $incdir +#setenv MET_HDFEOSLIB $libdir +#setenv MET_PYTHON /contrib/anaconda3/latest +#setenv MET_PYTHON_CC -I/contrib/anaconda/anaconda3/latest/include/python3.7m +#setenv MET_PYTHON_LD -L/contrib/anaconda/anaconda3/latest/lib\ -lpython3.7m\ -lpthread\ -ldl\ -lutil\ -lm\ -Xlinker\ -export-dynamic +#setenv MET_FONT_DIR $basedir/fonts/ + +# CAIRO and FREETYPE were not used +#setenv MET_CAIROLIB $libdir +#setenv MET_CAIROINC $incdir/cairo +#setenv MET_FREETYPELIB $libdir +#setenv MET_FREETYPEINC $incdir/freetype2 + + diff --git a/internal/scripts/installation/modulefiles/11.0.1_jet b/internal/scripts/installation/modulefiles/11.0.1_jet new file mode 100644 index 0000000000..c2d08fa9d5 --- /dev/null +++ b/internal/scripts/installation/modulefiles/11.0.1_jet @@ -0,0 +1,19 @@ +#%Module###################################################################### +## +## Model Evaluation Tools +## +proc ModulesHelp { } { + puts stderr "Sets up the paths and environment variables to use the Model Evaluation Tools v11.1.0 + *** For help see the official MET webpage at http://www.dtcenter.org/met/users ***" +} + +prereq intel +prereq netcdf/4.7.0 +prereq hdf5/1.10.5 + +set base /contrib/met/11.1.0 +set ver 11.1.0 +set share $base/share/met +setenv MET_ROOT $base/$ver/MET-11.1.0 + +prepend-path PATH $base/bin:$base/external_libs/bin:/apps/netcdf/4.7.0/intel/18.0.5.274/bin:/apps/hdf5/1.10.5/intel_seq/18.0.5.274/bin:/mnt/lfs1/HFIP/dtc-hurr/METplus/miniconda/miniconda3/envs/metplus_v5.0_py3.8 \ No newline at end of file diff --git a/internal/scripts/installation/modulefiles/11.0.1_orion b/internal/scripts/installation/modulefiles/11.0.1_orion new file mode 100644 index 0000000000..4981b5af9d --- /dev/null +++ b/internal/scripts/installation/modulefiles/11.0.1_orion @@ -0,0 +1,45 @@ +#%Module###################################################################### +## +## Model Evaluation Tools +## +proc ModulesHelp { } { + puts stderr "Sets up the paths and environment variables to use the Model Evaluation Tools v11.0.1 + *** For help see the official MET webpage at http://www.dtcenter.org/met/users ***" +} + +prereq intel/2020.2 + +set base /apps/contrib/MET +set ver 11.0.1 +set share $base/$ver/share/met +set lib_base $base/11.0.1 +setenv MET_ROOT $base/$ver/MET-11.0.1 + +prepend-path PATH $base/$ver/bin:$lib_base/external_libs/bin:/work/noaa/ovp/miniconda/miniconda3/envs/metplus_v5.0_py3.8/bin + +#export CC=icc +#export CXX=icc +#export F77=ifort +#module load intel/2020.2 +#module load intelpython3/2020.2 +#export libdir=/apps/contrib/MET/11.0.1/external_libs/lib +#export incdir=/apps/contrib/MET/11.0.1/external_libs/include +#export iprefix=/apps/contrib/MET/11.0.1/external_libs +#export basedir=/apps/contrib/MET/11.0.1/MET-11.0.1 +#export MET_HDF5=$iprefix +#export MET_NETCDF=$incdir +#export MET_GRIB2CINC=$incdir +#export MET_GRIB2CLIB=$libdir +#setenv MET_GSLLIB=$libdir +#export MET_GSLINC=$incdir +#export MET_BUFR=$libdir +#export MET_HDFINC=$incdir +#export MET_HDFLIB=$libdir +#export MET_HDFEOSINC=$incdir +#export MET_HDFEOSLIB=$libdir +#export MET_PYTHON=/work/noaa/ovp/miniconda/miniconda3/envs/metplus_v5.0_py3.8 +#export MET_PYTHON_CC=-I${MET_PYTHON}/include/python3.8 +#export MET_PYTHON_LD=-L${MET_PYTHON}/lib/python3.8/config-3.8-x86_64-linux-gnu\ -L${MET_PYTHON}/lib\ -lpython3.8\ -lcrypt\ -lpthread\ -ldl\ -lutil\ -lrt\ -lm +#export MET_FONT_DIR=$basedir/fonts/ +#export LDFLAGS=-Wl,--disable-new-dtags -Wl,-rpath,${libdir}:${MET_PYTHON}/lib +#export CPPFLAGS=-I/apps/contrib/met/11.0.1/external_libs/include diff --git a/src/basic/vx_log/concat_string.h b/src/basic/vx_log/concat_string.h index 59dec5f4f6..9e0f591cb7 100644 --- a/src/basic/vx_log/concat_string.h +++ b/src/basic/vx_log/concat_string.h @@ -146,7 +146,7 @@ class ConcatString { void chomp(const char *); // removes trailing suffix, if possible - operator const std::string () const; + operator std::string () const; bool startswith(const char *) const; bool endswith(const char *) const; @@ -205,7 +205,7 @@ inline const char * ConcatString::float_format() const { return ( FloatFormat ); inline bool ConcatString::empty() const { return ( s ? s->empty() : true ); } inline bool ConcatString::nonempty() const { return ( s ? !s->empty() : false ); } -inline ConcatString::operator const std::string () const { return ( s ? *s : 0 ); } +inline ConcatString::operator std::string () const { return ( s ? *s : 0 ); } //////////////////////////////////////////////////////////////////////// diff --git a/src/basic/vx_math/ptile.cc b/src/basic/vx_math/ptile.cc index 1869320d33..6bcc178e52 100644 --- a/src/basic/vx_math/ptile.cc +++ b/src/basic/vx_math/ptile.cc @@ -23,6 +23,7 @@ using namespace std; #include "is_bad_data.h" #include "nint.h" +#include "vx_log.h" /////////////////////////////////////////////////////////////////////////////// @@ -63,10 +64,31 @@ int index; double delta; double p = bad_data_double; +// Range check +if ( t < 0.0 || t > 1.0 ) { + + mlog << Error << "\npercentile() -> " + << "requested percentile value (" << t + << ") must be between 0 and 1!\n\n"; + + exit ( 1 ); + +} + if ( n > 0 ) { + index = nint(floor((n - 1)*t)); - delta = (n-1)*t - index; - p = (1 - delta)*ordered_array[index] + delta*ordered_array[index+1]; + + // Use the last value + if ( index == (n - 1) ) { + p = ordered_array[index]; + } + // Interpolate linearly between two values + else if ( index >= 0 && index < (n - 1) ) { + delta = (n - 1)*t - index; + p = (1 - delta)*ordered_array[index] + delta*ordered_array[index + 1]; + } + } return ( p ); @@ -101,13 +123,30 @@ int index; float delta; float p = bad_data_float; +// Range check +if ( t < 0.0 || t > 1.0 ) { + + mlog << Error << "\npercentile_f() -> " + << "requested percentile value (" << t + << ") must be between 0 and 1!\n\n"; + + exit ( 1 ); + +} + if ( n > 0 ) { index = nint(floor((n - 1)*t)); - delta = (n - 1)*t - index; - - p = (1 - delta)*(ordered_array[index]) + delta*(ordered_array[index + 1]); + // Use the last value + if ( index == (n - 1) ) { + p = ordered_array[index]; + } + // Interpolate linearly between two values + else if ( index >= 0 && index < (n - 1) ) { + delta = (n - 1)*t - index; + p = (1 - delta)*ordered_array[index] + delta*ordered_array[index + 1]; + } } diff --git a/src/basic/vx_util/main.cc b/src/basic/vx_util/main.cc index c70ed1fe1f..30f1cda8ea 100644 --- a/src/basic/vx_util/main.cc +++ b/src/basic/vx_util/main.cc @@ -157,7 +157,7 @@ void set_handlers() { void set_user_id() { met_user_id = geteuid (); - register struct passwd *pw; + struct passwd *pw; pw = getpwuid (met_user_id); if (pw) met_user_name = string(pw->pw_name); } diff --git a/src/basic/vx_util/util_constants.h b/src/basic/vx_util/util_constants.h index 36357ba780..7ae2eed751 100644 --- a/src/basic/vx_util/util_constants.h +++ b/src/basic/vx_util/util_constants.h @@ -18,6 +18,7 @@ //////////////////////////////////////////////////////////////////////// // Released versions of MET +static const char met_version_11_0_3[] = "V11.0.3"; static const char met_version_11_0_2[] = "V11.0.2"; static const char met_version_11_0_1[] = "V11.0.1"; static const char met_version_11_0_0[] = "V11.0.0"; @@ -43,7 +44,7 @@ static const char met_version_1_1[] = "V1.1"; //////////////////////////////////////////////////////////////////////// -static const char * const met_version = met_version_11_0_2; +static const char * const met_version = met_version_11_0_3; static const char default_met_data_dir[] = "MET_BASE"; static const char txt_file_ext[] = ".txt"; static const char stat_file_ext[] = ".stat"; diff --git a/src/libcode/vx_data2d_nccf/nccf_file.cc b/src/libcode/vx_data2d_nccf/nccf_file.cc index ad8098d868..ad545dea8f 100644 --- a/src/libcode/vx_data2d_nccf/nccf_file.cc +++ b/src/libcode/vx_data2d_nccf/nccf_file.cc @@ -2580,6 +2580,7 @@ void NcCfFile::get_grid_mapping_rotated_latitude_longitude(const NcVar *grid_map data.aux_rotation = 0; grid.set(data); + grid.set_swap_to_north(swap_to_north); if(grid_np_lat_att) delete grid_np_lat_att; if(grid_np_lon_att) delete grid_np_lon_att; diff --git a/src/libcode/vx_data2d_python/data2d_python.cc b/src/libcode/vx_data2d_python/data2d_python.cc index d8248733a4..d343414da6 100644 --- a/src/libcode/vx_data2d_python/data2d_python.cc +++ b/src/libcode/vx_data2d_python/data2d_python.cc @@ -362,7 +362,13 @@ if ( PythonCommand.empty() || PythonCommand != vinfo.req_name() ) { } -if ( status ) status = process_data_plane(&vinfo, Plane); +if ( status ) { + + plane = Plane; + + status = process_data_plane(&vinfo, plane); + +} if ( !status ) return ( false ); @@ -370,8 +376,6 @@ if ( !status ) return ( false ); // ok // -plane = Plane; - // // store the VarInfo metadata without completely overwritting it // @@ -395,6 +399,7 @@ int MetPythonDataFile::data_plane_array(VarInfo &vinfo, DataPlaneArray &plane_ar { bool status = true; +DataPlane plane; // // the python command is specified by VarInfo::Name @@ -423,7 +428,13 @@ if ( PythonCommand.empty() || PythonCommand != vinfo.req_name() ) { } -if ( status ) status = process_data_plane(&vinfo, Plane); +if ( status ) { + + plane = Plane; + + status = process_data_plane(&vinfo, plane); + +} if ( !status ) return ( 0 ); @@ -433,7 +444,7 @@ if ( !status ) return ( 0 ); plane_array.clear(); -plane_array.add(Plane, 0.0, 0.0); +plane_array.add(plane, 0.0, 0.0); // // store the VarInfo metadata without completely overwritting it diff --git a/src/libcode/vx_grid/grid_base.cc b/src/libcode/vx_grid/grid_base.cc index 88b2f85383..3e0d04d410 100644 --- a/src/libcode/vx_grid/grid_base.cc +++ b/src/libcode/vx_grid/grid_base.cc @@ -826,7 +826,7 @@ return; //////////////////////////////////////////////////////////////////////// bool Grid::get_swap_to_north() const { - return swap_to_north && (info().ll != 0); + return swap_to_north && (info().ll != 0 || info().rll != 0); } //////////////////////////////////////////////////////////////////////// diff --git a/src/libcode/vx_nc_util/nc_utils.h b/src/libcode/vx_nc_util/nc_utils.h index adb518d402..1b85370888 100644 --- a/src/libcode/vx_nc_util/nc_utils.h +++ b/src/libcode/vx_nc_util/nc_utils.h @@ -145,7 +145,7 @@ static const std::string scale_factor_att_name = "scale_factor"; static const std::string standard_name_att_name = "standard_name"; static const std::string units_att_name = "units"; -static const char nc_time_unit_exp[] = "^[a-z|A-Z]* since [0-9]\\{1,4\\}-[0-9]\\{1,2\\}-[0-9]\\{1,2\\}"; +static const char nc_time_unit_exp[] = "^[a-z|A-Z]* *since *[0-9]\\{1,4\\}-[0-9]\\{1,2\\}-[0-9]\\{1,2\\}"; static const char MET_NC_Obs_ver_1_2[] = "1.02"; static const char MET_NC_Obs_version[] = "1.02";