diff --git a/data/config/GridStatConfig_default b/data/config/GridStatConfig_default index adbb9a214b..4bec5ecf4b 100644 --- a/data/config/GridStatConfig_default +++ b/data/config/GridStatConfig_default @@ -264,12 +264,6 @@ nc_pairs_flag = { //////////////////////////////////////////////////////////////////////////////// -ugrid_dataset = ""; -ugrid_max_distance_km = 30; -ugrid_coordinates_file = ""; - -//////////////////////////////////////////////////////////////////////////////// - grid_weight_flag = NONE; tmp_dir = "/tmp"; output_prefix = ""; diff --git a/data/config/PointStatConfig_default b/data/config/PointStatConfig_default index 9a8132dccc..d4b277c6a3 100644 --- a/data/config/PointStatConfig_default +++ b/data/config/PointStatConfig_default @@ -299,12 +299,6 @@ output_flag = { //////////////////////////////////////////////////////////////////////////////// -ugrid_dataset = ""; -ugrid_max_distance_km = 30; -ugrid_coordinates_file = ""; - -//////////////////////////////////////////////////////////////////////////////// - tmp_dir = "/tmp"; output_prefix = ""; version = "V12.0.0"; diff --git a/data/config/UGridConfig_lfric b/data/config/UGridConfig_lfric index 7c5e164643..8b12f429f5 100644 --- a/data/config/UGridConfig_lfric +++ b/data/config/UGridConfig_lfric @@ -2,7 +2,7 @@ // // Unstructured grid configuration file. // -// UGridConfig_lfric at the current working directory overrides the settings here. +// UGridConfig_lfric at the current working directory replaces the settings here. // For additional or updated information, please see the MET User's Guide. // //////////////////////////////////////////////////////////////////////////////// @@ -12,23 +12,14 @@ // ugrid_metadata_map = [ { key = "dim_face"; val = "nMesh2d_face"; }, - { key = "dim_node"; val = "nMesh2d_node"; }, - { key = "dim_edge"; val = "nMesh2d_edge"; }, { key = "dim_time"; val = "time_counter"; }, - { key = "dim_vert"; val = "nVertLevels"; }, - { key = "cell_id"; val = "indexToCellID"; }, + { key = "dim_vert"; val = ""; }, // optional { key = "lat_face"; val = "Mesh2d_face_y"; }, { key = "lon_face"; val = "Mesh2d_face_x"; }, - { key = "vert_face"; val = "zCell"; }, - { key = "lat_edge"; val = "Mesh2d_edge_y"; }, - { key = "lon_edge"; val = "Mesh2d_edge_x"; }, - { key = "lat_node"; val = "Mesh2d_node_y"; }, - { key = "lon_node"; val = "Mesh2d_node_x"; }, - { key = "time"; val = "time_centered"; } + { key = "vert_face"; val = ""; }, // optional + { key = "time"; val = "time_instant"; } ]; -ugrid_max_distance_km = 30; - //////////////////////////////////////////////////////////////////////////////// version = "V12.0.0"; diff --git a/data/config/UGridConfig_mpas b/data/config/UGridConfig_mpas index 803daf6767..70fca86f98 100644 --- a/data/config/UGridConfig_mpas +++ b/data/config/UGridConfig_mpas @@ -2,7 +2,7 @@ // // Unstructured grid configuration file. // -// UGridConfig_mpas at the current working directory overrides the settings here. +// UGridConfig_mpas at the current working directory replaces the settings here. // For additional or updated information, please see the MET User's Guide. // //////////////////////////////////////////////////////////////////////////////// @@ -12,23 +12,14 @@ // ugrid_metadata_map = [ { key = "dim_face"; val = "nCells"; }, - { key = "dim_node"; val = "nVertices"; }, - { key = "dim_edge"; val = "nEdges"; }, { key = "dim_time"; val = "Time"; }, - { key = "dim_vert"; val = "nVertLevels"; }, - { key = "cell_id"; val = "indexToCellID"; }, + { key = "dim_vert"; val = "nVertLevels"; }, // optional { key = "lat_face"; val = "latCell"; }, { key = "lon_face"; val = "lonCell"; }, - { key = "vert_face"; val = "zCell"; }, - { key = "lat_edge"; val = "latEdge"; }, - { key = "lon_edge"; val = "lonEdge"; }, - { key = "lat_node"; val = "latVertex"; }, - { key = "lon_node"; val = "lonVertex"; }, + { key = "vert_face"; val = "zCell"; }, // optional { key = "time"; val = "xtime"; } ]; -ugrid_max_distance_km = 30; - //////////////////////////////////////////////////////////////////////////////// version = "V12.0.0"; diff --git a/docs/Users_Guide/release-notes.rst b/docs/Users_Guide/release-notes.rst index c762149df0..c8f2fb0f2c 100644 --- a/docs/Users_Guide/release-notes.rst +++ b/docs/Users_Guide/release-notes.rst @@ -9,6 +9,31 @@ When applicable, release notes are followed by the GitHub issue number which des enhancement, or new feature (`MET GitHub issues `_). Important issues are listed **in bold** for emphasis. +MET Version 12.0.0-beta4 Release Notes (20240417) +------------------------------------------------- + + .. dropdown:: Repository, build, and test + + * Add GitHub action to run SonarQube for MET pull requests and feature branches (`#2379 `_). + * Move namespace specifications below include directives (`#2696 `_). + * Enhance GitHub action compilation options and testing workflows (`#2815 `_). + * Fix the SonarQube findings for MET version 12.0.0 (`#2673 `_). + * SonarQube: Replace "enum" to "enum class" (`#2830 `_). + + .. dropdown:: Bugfixes + + * **Bugfix: Fix the TC-Diag and TC-RMW tools to correctly handle the range and azimuth settings in range/azimuth grids** (`#2833 `_). + + .. dropdown:: Enhancements + + * **Refine configuration options for defining bins in the verification of probabilistic forecasts** (`#2280 `_). + * **Add new wind direction verification statistics for RMSE, Bias, and MAE** (`#2395 `_). + * Add new ECNT statistics that incorporate observational uncertainty as advised in Ferro (2017) (`#2583 `_). + * Enhance ASCII2NC to support IABP/IPAB Arctic and Antarctic drifting buoy observations (`#2654 `_). + * Enhance Multivariate MODE to read input data only once rather than multiple times (`#2707 `_). + * Enhance the calculation of RPSS to support starting from probabilistic data (`#2786 `_). + * Add convex hull to MODE output (`#2819 `_). + MET Version 12.0.0-beta3 Release Notes (20240207) ------------------------------------------------- @@ -108,3 +133,5 @@ MET Version 12.0.0 Upgrade Instructions * The required `Proj `_ library dependency was added in the 12.0.0-beta1 development cycle (`#2669 `_). * The optional `Atlas `_ library dependency was added in the 12.0.0-beta2 development cycle (`#2574 `_). * The optional `ecKit `_ library dependency was added in the 12.0.0-beta2 development cycle (`#2574 `_). + +* Note that the `#2833 `_ bugfix affects all previously generated output from the TC-Diag and TC-RMW tools. diff --git a/docs/conf.py b/docs/conf.py index ad28a7dd63..3a135308ab 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -20,11 +20,11 @@ project = 'MET' author = 'UCAR/NCAR, NOAA, CSU/CIRA, and CU/CIRES' author_list = 'Prestopnik, J., H. Soh, L. Goodrich, B. Brown, R. Bullock, J. Halley Gotway, K. Newman, J. Opatz, T. Jensen' -version = '12.0.0-beta3' +version = '12.0.0-beta4' verinfo = version release = f'{version}' release_year = '2024' -release_date = f'{release_year}-02-07' +release_date = f'{release_year}-04-17' copyright = f'{release_year}, {author}' # -- General configuration --------------------------------------------------- diff --git a/internal/scripts/docker/build_met_sonarqube.sh b/internal/scripts/docker/build_met_sonarqube.sh index 45e1d10fc5..2eea05654e 100755 --- a/internal/scripts/docker/build_met_sonarqube.sh +++ b/internal/scripts/docker/build_met_sonarqube.sh @@ -84,9 +84,7 @@ SONAR_PROPERTIES=sonar-project.properties # Configure the sonar-project.properties [ -e $SONAR_PROPERTIES ] && rm $SONAR_PROPERTIES -sed -e "s|SONAR_PROJECT_KEY|MET-GHA|" \ - -e "s|SONAR_PROJECT_NAME|MET GHA|" \ - -e "s|SONAR_PROJECT_VERSION|$SONAR_PROJECT_VERSION|" \ +sed -e "s|SONAR_PROJECT_VERSION|$SONAR_PROJECT_VERSION|" \ -e "s|SONAR_HOST_URL|$SONAR_HOST_URL|" \ -e "s|SONAR_TOKEN|$SONAR_TOKEN|" \ -e "s|SONAR_BRANCH_NAME|$MET_GIT_NAME|" \ diff --git a/internal/scripts/installation/compile_MET_all.sh b/internal/scripts/installation/compile_MET_all.sh index 98d9fca899..6524aa8563 100755 --- a/internal/scripts/installation/compile_MET_all.sh +++ b/internal/scripts/installation/compile_MET_all.sh @@ -37,7 +37,7 @@ # The compile_MET_all.sh script will compile and install MET and its # external library dependencies, if needed, including: # PROJ (with dependency SQLITE >= 3.11), GSL, BUFRLIB, -# GRIB2C (with dependencies Z, PNG, JASPER), HDF5, NETCDF (C and CXX), +# GRIB2C (with dependencies Z, PNG, JASPER, JPEG), HDF5, NETCDF (C and CXX), # HDF4 (optional for MODIS-Regrid and lidar2nc), HDFEOS (optional for # MODIS-Regrid and lidar2nc), FREETYPE (optional for MODE Graphics), # and CAIRO (optional for MODE Graphics). @@ -51,7 +51,7 @@ # in the input environment configuration file (install_met_env.: # MET_GRIB2CLIB, MET_GRIB2CINC, GRIB2CLIB_NAME, MET_BUFRLIB, BUFRLIB_NAME, # MET_HDF5, MET_NETCDF, MET_PROJ, MET_GSL, LIB_JASPER, LIB_LIBPNG, LIB_Z, -# SQLITE_INCLUDE_DIR, SQLITE_LIB_DIR, TIFF_INCLUDE_DIR, TIFF_LIB_DIR. +# LIB_JPEG, SQLITE_INCLUDE_DIR, SQLITE_LIB_DIR, TIFF_INCLUDE_DIR, TIFF_LIB_DIR. # # The optional libraries ecKit and atlas offer support for unstructured # grids. The optional libraries HDF4, HDFEOS, FREETYPE, and CAIRO are @@ -176,11 +176,13 @@ if [[ -z ${MET_GRIB2CLIB} ]] && [[ -z ${MET_GRIB2C} ]]; then COMPILE_ZLIB=1 COMPILE_LIBPNG=1 COMPILE_JASPER=1 + COMPILE_JPEG=1 COMPILE_G2CLIB=1 else COMPILE_ZLIB=0 COMPILE_LIBPNG=0 COMPILE_JASPER=0 + COMPILE_JPEG=0 COMPILE_G2CLIB=0 fi @@ -269,6 +271,7 @@ if [ ! -z "${SKIP_LIBS}" ]; then COMPILE_ZLIB=0 COMPILE_LIBPNG=0 COMPILE_JASPER=0 + COMPILE_JPEG=0 COMPILE_G2CLIB=0 COMPILE_ECKIT=0 COMPILE_ATLAS=0 @@ -570,6 +573,7 @@ if [[ $COMPILE_LIBPNG -eq 1 && $HOST != ys* ]]; then run_cmd "make ${MAKE_ARGS} install > $(pwd)/libpng.make_install.log 2>&1" fi + # Compile JASPER if [ $COMPILE_JASPER -eq 1 ]; then @@ -594,6 +598,24 @@ if [ $COMPILE_JASPER -eq 1 ]; then run_cmd "make ${MAKE_ARGS} install > $(pwd)/jasper.make_install.log 2>&1" fi +# Compile JPEG +if [ $COMPILE_JPEG -eq 1 ]; then + + vrs="9e" + + echo + echo "Compiling JPEG at `date`" + mkdir -p ${LIB_DIR}/jpeg + rm -rf ${LIB_DIR}/jpeg/jpeg* + tar -xf ${TAR_DIR}/jpegsrc.v${vrs}.tar.gz -C ${LIB_DIR}/jpeg + cd ${LIB_DIR}/jpeg/jpeg-${vrs} + echo "cd `pwd`" + run_cmd "./configure --prefix=${LIB_DIR} LDFLAGS=-L${LIB_DIR}/lib CPPFLAGS=-I${LIB_DIR}/include > $(pwd)/libjpeg.configure.log 2>&1" + run_cmd "make ${MAKE_ARGS} > $(pwd)/libjpeg.make.log 2>&1" + run_cmd "make ${MAKE_ARGS} install > $(pwd)/libjpeg.make_install.log 2>&1" +fi + + # Compile G2CLIB if [ $COMPILE_G2CLIB -eq 1 ]; then diff --git a/internal/scripts/installation/config/install_met_env.acorn_py3.10 b/internal/scripts/installation/config/install_met_env.acorn similarity index 100% rename from internal/scripts/installation/config/install_met_env.acorn_py3.10 rename to internal/scripts/installation/config/install_met_env.acorn diff --git a/internal/scripts/installation/config/install_met_env.casper b/internal/scripts/installation/config/install_met_env.casper index c9e9f06a91..703be5e531 100644 --- a/internal/scripts/installation/config/install_met_env.casper +++ b/internal/scripts/installation/config/install_met_env.casper @@ -1,30 +1,40 @@ -module load ncarenv/1.3 -module load intel/2021.2 -module load netcdf/4.8.0 +module load ncarenv/23.10 +module load intel-classic/2023.2.1 +module load cmake/3.26.3 -export TEST_BASE=/glade/p/ral/jntp/MET/MET_releases/casper/11.1.0 -export COMPILER=intel_2021.2 +export TEST_BASE=/glade/work/dtcrt/METplus/casper/components/MET/installations/12.0.0 +export COMPILER=intel-classic_2023.2.1 export MET_SUBDIR=${TEST_BASE} -export MET_TARBALL=v11.1.0.tar.gz +export MET_TARBALL=v12.0.0.tar.gz export USE_MODULES=TRUE -export MET_PYTHON=/glade/p/ral/jntp/MET/METplus/miniconda/miniconda3/envs/metplus_v5.1_py3.10 +export MET_PYTHON=/glade/work/dtcrt/METplus/casper/miniconda/miniconda3/envs/metplus_v5.1_py3.10 export MET_PYTHON_CC=-I${MET_PYTHON}/include/python3.10 export MET_PYTHON_LD=`${MET_PYTHON}/bin/python3-config --ldflags --embed` -export MET_NETCDF=/glade/u/apps/ch/opt/netcdf/4.8.0/intel/2021.2/ -export MET_HDF5=/glade/u/apps/ch/opt/netcdf/4.8.0/intel/2021.2/ +#export ADDTL_DIR=/usr/lib64 export EXTERNAL_LIBS=${TEST_BASE}/external_libs -#export MET_GSL=${EXTERNAL_LIBS} -#export MET_BUFRLIB=${EXTERNAL_LIBS} -#export BUFRLIB_NAME=-lbufr -#export MET_HDF5=${EXTERNAL_LIBS} -#export MET_GRIB2CLIB=${EXTERNAL_LIBS}/lib -#export MET_GRIB2CINC=${EXTERNAL_LIBS}/include -#export GRIB2CLIB_NAME=-lgrib2c -#export LIB_JASPER=${EXTERNAL_LIBS}/lib -#export LIB_LIBPNG=${EXTERNAL_LIBS}/lib -#export LIB_Z=${EXTERNAL_LIBS}/lib -export SET_D64BIT=FALSE +#export COMPILE_ECKIT=1 +#export COMPILE_ATLAS=1 +export MET_PROJ=${EXTERNAL_LIBS} +export MET_ECKIT=${EXTERNAL_LIBS} +export MET_ATLAS=${EXTERNAL_LIBS} +export MET_GSL=${EXTERNAL_LIBS} +export MET_BUFRLIB=${EXTERNAL_LIBS} +export BUFRLIB_NAME=-lbufr_4 +export MET_GRIB2CLIB=${EXTERNAL_LIBS}/lib64 +export MET_GRIB2CINC=${EXTERNAL_LIBS}/include +export GRIB2CLIB_NAME=-lg2c +export LIB_JASPER=${EXTERNAL_LIBS}/lib64 +export LIB_LIBPNG=${EXTERNAL_LIBS}/lib +export LIB_Z=${EXTERNAL_LIBS}/lib +export LIB_JPEG=${EXTERNAL_LIBS}/lib +export MET_NETCDF=${EXTERNAL_LIBS} +export MET_HDF5=${EXTERNAL_LIBS} +export TIFF_INCLUDE_DIR=${EXTERNAL_LIBS}/include +export TIFF_LIB_DIR=${EXTERNAL_LIBS}/lib +export SQLITE_INCLUDE_DIR=${EXTERNAL_LIBS}/include +export SQLITE_LIB_DIR=${EXTERNAL_LIBS}/lib +export MAKE_ARGS="-j 5" #export CFLAGS="-Wall -g" #export CXXFLAGS="-Wall -g" -export MAKE_ARGS=-j -export CXXFLAGS="-std=c++11" +#export CXXFLAGS="-std=c++11" +#export SKIP_MET=true diff --git a/internal/scripts/installation/config/install_met_env.derecho b/internal/scripts/installation/config/install_met_env.derecho index 5ad11f3eb7..eb02198760 100644 --- a/internal/scripts/installation/config/install_met_env.derecho +++ b/internal/scripts/installation/config/install_met_env.derecho @@ -1,36 +1,42 @@ -module load ncarenv/23.06 -module load intel-oneapi/2023.0.0 +module load ncarenv/23.09 +module load intel/2023.2.1 module load cmake/3.26.3 -module load hdf5/1.12.2 -module load netcdf/4.9.2 -export TEST_BASE=/glade/p/ral/jntp/MET/MET_releases/12.0.0 -export COMPILER=intel-oneapi_2023.0.0 +export CC=icx +export CXX=icpx +export FC=ifx +export F77=ifx +export F90=ifx + +export TEST_BASE=/glade/work/dtcrt/METplus/derecho/components/MET/installations/12.0.0 +export COMPILER=intel_2023.2.1 export MET_SUBDIR=${TEST_BASE} export MET_TARBALL=v12.0.0.tar.gz export USE_MODULES=TRUE -export MET_PYTHON=/glade/p/ral/jntp/MET/METplus/miniconda/miniconda3/envs/metplus_v5.1_py3.10 +export MET_PYTHON=/glade/work/dtcrt/METplus/derecho/miniconda/miniconda3/envs/metplus_v5.1_py3.10 export MET_PYTHON_CC=-I${MET_PYTHON}/include/python3.10 export MET_PYTHON_LD=`${MET_PYTHON}/bin/python3-config --ldflags --embed` -export MET_NETCDF=/glade/u/apps/derecho/23.06/spack/opt/spack/netcdf/4.9.2/oneapi/2023.0.0/iijr -export MET_HDF5=/glade/u/apps/derecho/23.06/spack/opt/spack/hdf5/1.12.2/oneapi/2023.0.0/d6xa -export ADDTL_DIR=/usr/lib64 export EXTERNAL_LIBS=${TEST_BASE}/external_libs -#export MET_PROJ=${EXTERNAL_LIBS} -#export LIB_TIFF=${ADDTL_DIR}/libtiff.so.5 export COMPILE_ECKIT=1 export COMPILE_ATLAS=1 +#export MET_PROJ=${EXTERNAL_LIBS} #export MET_ECKIT=${EXTERNAL_LIBS} #export MET_ATLAS=${EXTERNAL_LIBS} #export MET_GSL=${EXTERNAL_LIBS} #export MET_BUFRLIB=${EXTERNAL_LIBS} #export BUFRLIB_NAME=-lbufr_4 +#export MET_NETCDF=${EXTERNAL_LIBS} +#export MET_HDF5=${EXTERNAL_LIBS} #export MET_GRIB2CLIB=${EXTERNAL_LIBS}/lib64 #export MET_GRIB2CINC=${EXTERNAL_LIBS}/include #export GRIB2CLIB_NAME=-lg2c #export LIB_JASPER=${EXTERNAL_LIBS}/lib64 #export LIB_LIBPNG=${EXTERNAL_LIBS}/lib #export LIB_Z=${EXTERNAL_LIBS}/lib +#export TIFF_INCLUDE_DIR=${EXTERNAL_LIBS}/include +#export TIFF_LIB_DIR=${EXTERNAL_LIBS}/lib +#export SQLITE_INCLUDE_DIR=${EXTERNAL_LIBS}/include +#export SQLITE_LIB_DIR=${EXTERNAL_LIBS}/lib export MAKE_ARGS=-j #export CFLAGS="-Wall -g" #export CXXFLAGS="-Wall -g" diff --git a/internal/scripts/installation/config/install_met_env.gaea b/internal/scripts/installation/config/install_met_env.gaea index 78052504da..8a60c93f84 100644 --- a/internal/scripts/installation/config/install_met_env.gaea +++ b/internal/scripts/installation/config/install_met_env.gaea @@ -5,21 +5,18 @@ export F77=ifx export F90=ifx export CC=icx export CXX=icpx -export TEST_BASE=/usw/met/12.0.0-beta2 +export TEST_BASE=/usw/met/12.0.0 export COMPILER=intel-oneapi_2022.0.2 export MET_SUBDIR=${TEST_BASE} -export MET_TARBALL=v12.0.0-beta2.tar.gz +export MET_TARBALL=v12.0.0.tar.gz export USE_MODULES=TRUE -export MET_PYTHON=/lustre/f2/dev/esrl/Julie.Prestopnik/projects/miniconda/miniconda3/envs/metplus_v5.1_py3.10/ +export MET_PYTHON=/gpfs/f5/esrl/proj-shared/Julie.Prestopnik/projects/miniconda/miniconda3/envs/metplus_v5.1_py3.10/ export MET_PYTHON_CC=-I${MET_PYTHON}/include/python3.10 export MET_PYTHON_LD=-L${MET_PYTHON}/lib/python3.10/config-3.10-x86_64-linux-gnu\ -L${MET_PYTHON}/lib\ -lpython3.10\ -lcrypt\ -lpthread\ -ldl\ -lutil\ -lm -export ADDTL_DIR=/usr/lib64 -#export TIFF_INCLUDE_DIR=/lustre/f2/dev/esrl/Julie.Prestopnik/projects/miniconda/miniconda3/pkgs/libtiff-4.4.0-h82bc61c_5/include -#export LIB_TIFF=${ADDTL_DIR}/libtiff.so.5 -#export EXTERNAL_LIBS=/usw/met/12.0.0-beta2/external_libs +export EXTERNAL_LIBS=${TEST_BASE}/external_libs +COMPILE_ATLAS=1 +COMPILE_ECKIT=1 #export MET_PROJ=${EXTERNAL_LIBS} -#COMPILE_ATLAS=1 -#COMPILE_ECKIT=1 #export MET_ATLAS=${EXTERNAL_LIBS} #export MET_ECKIT=${EXTERNAL_LIBS} #export MET_GSL=${EXTERNAL_LIBS} @@ -33,5 +30,9 @@ export ADDTL_DIR=/usr/lib64 #export LIB_JASPER=${EXTERNAL_LIBS}/lib #export LIB_LIBPNG=${EXTERNAL_LIBS}/lib #export LIB_Z=${EXTERNAL_LIBS}/lib +#export TIFF_INCLUDE_DIR=${EXTERNAL_LIBS}/include +#export TIFF_LIB_DIR=${EXTERNAL_LIBS}/lib +#export SQLITE_INCLUDE_DIR=${EXTERNAL_LIBS}/include +#export SQLITE_LIB_DIR=${EXTERNAL_LIBS}/lib export MAKE_ARGS="-j 5" diff --git a/internal/scripts/installation/config/install_met_env.hera b/internal/scripts/installation/config/install_met_env.hera index cddaa00f90..2b0b054190 100755 --- a/internal/scripts/installation/config/install_met_env.hera +++ b/internal/scripts/installation/config/install_met_env.hera @@ -1,6 +1,6 @@ module load gnu/9.2.0 module load intel/2022.1.2 -module load cmake/3.26.4 +module load cmake/3.28.1 export FC=ifort export F77=ifort @@ -34,6 +34,8 @@ export COMPILE_ATLAS=1 #export LIB_JASPER=${EXTERNAL_LIBS}/lib #export LIB_LIBPNG=${EXTERNAL_LIBS}/lib #export LIB_Z=${EXTERNAL_LIBS}/lib +#export TIFF_INCLUDE_DIR=${EXTERNAL_LIBS}/include +#export TIFF_LIB_DIR=${EXTERNAL_LIBS}/lib #export SQLITE_INCLUDE_DIR=${EXTERNAL_LIBS}/include #export SQLITE_LIB_DIR=${EXTERNAL_LIBS}/lib export MAKE_ARGS="-j 5" diff --git a/internal/scripts/installation/config/install_met_env.hercules b/internal/scripts/installation/config/install_met_env.hercules new file mode 100644 index 0000000000..dffb8fe186 --- /dev/null +++ b/internal/scripts/installation/config/install_met_env.hercules @@ -0,0 +1,39 @@ +module load intel-oneapi-compilers/2022.2.1 +module load cmake/3.26.3 + +export CC=icx +export CXX=icpx +export FC=ifx +export F77=ifx +export F90=ifx + +export TEST_BASE=/apps/contrib/MET/12.0.0-beta3 +export COMPILER=intel-oneapi-compilers_2022.2.1 +export MET_SUBDIR=${TEST_BASE}/ +export MET_TARBALL=v12.0.0-beta3.tar.gz +export USE_MODULES=TRUE +export MET_PYTHON=/work/noaa/ovp/miniconda/miniconda3/envs/metplus_v5.1_py3.10 +export MET_PYTHON_CC=-I${MET_PYTHON}/include/python3.10 +export MET_PYTHON_LD=-L${MET_PYTHON}/lib/python3.10/config-3.10-x86_64-linux-gnu\ -L${MET_PYTHON}/lib\ -lpython3.10\ -lcrypt\ -lpthread\ -ldl\ -lutil\ -lrt\ -lm\ -lm +export EXTERNAL_LIBS=${TEST_BASE}/external_libs +COMPILE_ATLAS=1 +COMPILE_ECKIT=1 +#export MET_PROJ=${EXTERNAL_LIBS} +#export MET_ATLAS=${EXTERNAL_LIBS} +#export MET_ECKIT=${EXTERNAL_LIBS} +#export MET_GSL=${EXTERNAL_LIBS} +#export MET_BUFRLIB=${EXTERNAL_LIBS} +#export BUFRLIB_NAME=-lbufr_4 +#export MET_HDF5=${EXTERNAL_LIBS} +#export MET_NETCDF=${EXTERNAL_LIBS} +#export MET_GRIB2CLIB=${EXTERNAL_LIBS}/lib +#export MET_GRIB2CINC=${EXTERNAL_LIBS}/include +#export GRIB2CLIB_NAME=-lg2c +#export LIB_JASPER=${EXTERNAL_LIBS}/lib +#export LIB_LIBPNG=${EXTERNAL_LIBS}/lib +#export LIB_Z=${EXTERNAL_LIBS}/lib +#export TIFF_INCLUDE_DIR=${EXTERNAL_LIBS}/include +#export TIFF_LIB_DIR=${EXTERNAL_LIBS}/lib +#export SQLITE_INCLUDE_DIR=${EXTERNAL_LIBS}/include +#export SQLITE_LIB_DIR=${EXTERNAL_LIBS}/lib +export MAKE_ARGS="-j 5" diff --git a/internal/scripts/installation/config/install_met_env.jet b/internal/scripts/installation/config/install_met_env.jet index b3be597853..15b5563ac2 100644 --- a/internal/scripts/installation/config/install_met_env.jet +++ b/internal/scripts/installation/config/install_met_env.jet @@ -1,5 +1,5 @@ module load intel/2022.1.2 -module load cmake/3.26.4 +module load cmake/3.28.1 export FC=ifort export F77=ifort @@ -14,13 +14,11 @@ export USE_MODULES=TRUE export MET_PYTHON=/mnt/lfs1/HFIP/dtc-hurr/METplus/miniconda/miniconda3/envs/metplus_v5.1_py3.10 export MET_PYTHON_CC=-I${MET_PYTHON}/include/python3.10 export MET_PYTHON_LD=-L${MET_PYTHON}/lib/python3.10/config-3.10-x86_64-linux-gnu\ -L${MET_PYTHON}/lib\ -lpython3.10\ -lcrypt\ -lpthread\ -ldl\ -lutil\ -lrt\ -lm\ -lm -export ADDTL_DIR=/usr/lib64 +#export ADDTL_DIR=/usr/lib64 export EXTERNAL_LIBS=${TEST_BASE}/external_libs/ COMPILE_ATLAS=1 COMPILE_ECKIT=1 #export MET_PROJ=${EXTERNAL_LIBS} -export TIFF_INCLUDE_DIR=/usr/include -export TIFF_LIB_DIR=/usr/lib64 #export MET_ATLAS=${EXTERNAL_LIBS} #export MET_ECKIT=${EXTERNAL_LIBS} #export MET_GSL=${EXTERNAL_LIBS} @@ -34,6 +32,8 @@ export TIFF_LIB_DIR=/usr/lib64 #export LIB_JASPER=${EXTERNAL_LIBS}/lib #export LIB_LIBPNG=${EXTERNAL_LIBS}/lib #export LIB_Z=${EXTERNAL_LIBS}/lib +#export TIFF_INCLUDE_DIR=${EXTERNAL_LIBS}/include +#export TIFF_LIB_DIR=${EXTERNAL_LIBS}/lib #export SQLITE_INCLUDE_DIR=${EXTERNAL_LIBS}/include #export SQLITE_LIB_DIR=${EXTERNAL_LIBS}/lib export MAKE_ARGS="-j 5" diff --git a/internal/scripts/installation/config/install_met_env.orion b/internal/scripts/installation/config/install_met_env.orion index b951ee41f5..7ba320fe03 100644 --- a/internal/scripts/installation/config/install_met_env.orion +++ b/internal/scripts/installation/config/install_met_env.orion @@ -1,23 +1,19 @@ module load intel/2020.2 module load cmake/3.22.1 -export TEST_BASE=/apps/contrib/MET/12.0.0-beta2 +export TEST_BASE=/apps/contrib/MET/12.0.0 export COMPILER=intel_2020 export MET_SUBDIR=${TEST_BASE}/ -export MET_TARBALL=v12.0.0-beta2.tar.gz +export MET_TARBALL=v12.0.0.tar.gz export USE_MODULES=TRUE export MET_PYTHON=/work/noaa/ovp/miniconda/miniconda3/envs/metplus_v5.1_py3.10 export MET_PYTHON_CC=-I${MET_PYTHON}/include/python3.10 export MET_PYTHON_LD=-L${MET_PYTHON}/lib/python3.10/config-3.10-x86_64-linux-gnu\ -L${MET_PYTHON}/lib\ -lpython3.10\ -lcrypt\ -lpthread\ -ldl\ -lutil\ -lrt\ -lm\ -lm -export ADDTL_DIR=/usr/lib64 -#export TIFF_INCLUDE_DIR=${ADDTL_DIR} -#export LIB_TIFF=${ADDTL_DIR}/libtiff.so.5 +#export ADDTL_DIR=/usr/lib64 export EXTERNAL_LIBS=${TEST_BASE}/external_libs -#export SQLITE_INCLUDE_DIR=${EXTERNAL_LIBS}/include -#export SQLITE_LIB_DIR=${EXTERNAL_LIBS}/lib +COMPILE_ATLAS=1 +COMPILE_ECKIT=1 #export MET_PROJ=${EXTERNAL_LIBS} -#COMPILE_ATLAS=1 -#COMPILE_ECKIT=1 #export MET_ATLAS=${EXTERNAL_LIBS} #export MET_ECKIT=${EXTERNAL_LIBS} #export MET_GSL=${EXTERNAL_LIBS} @@ -31,4 +27,8 @@ export EXTERNAL_LIBS=${TEST_BASE}/external_libs #export LIB_JASPER=${EXTERNAL_LIBS}/lib #export LIB_LIBPNG=${EXTERNAL_LIBS}/lib #export LIB_Z=${EXTERNAL_LIBS}/lib +#export TIFF_INCLUDE_DIR=${EXTERNAL_LIBS}/include +#export TIFF_LIB_DIR=${EXTERNAL_LIBS}/lib +#export SQLITE_INCLUDE_DIR=${EXTERNAL_LIBS}/include +#export SQLITE_LIB_DIR=${EXTERNAL_LIBS}/lib export MAKE_ARGS="-j 5" diff --git a/internal/scripts/installation/config/install_met_env.wcoss2_py3.10 b/internal/scripts/installation/config/install_met_env.wcoss2 similarity index 98% rename from internal/scripts/installation/config/install_met_env.wcoss2_py3.10 rename to internal/scripts/installation/config/install_met_env.wcoss2 index f2f29e57df..86b73e0064 100644 --- a/internal/scripts/installation/config/install_met_env.wcoss2_py3.10 +++ b/internal/scripts/installation/config/install_met_env.wcoss2 @@ -21,13 +21,13 @@ export F77=ifort export F90=ifort export CC=icc export CXX=icpc -#export TEST_BASE=/apps/ops/para/libs/intel/19.1.3.304/met/12.0.0-beta1 +#export TEST_BASE=/apps/ops/para/libs/intel/19.1.3.304/met/12.0.0-beta3 export TEST_BASE=$(pwd) export LIB_DIR=${TEST_BASE}/external_libs export BIN_DIR_PATH=${TEST_BASE}/bin export COMPILER=intel_19.1.3.304 export MET_SUBDIR=${TEST_BASE} -export MET_TARBALL=v12.0.0-beta1.tar.gz +export MET_TARBALL=v12.0.0-beta3.tar.gz export USE_MODULES=TRUE export ADDTL_DIR=/apps/spack/gettext/0.21/intel/19.1.3.304/at2kdo4edvuhyzrt5g6zhwrdb7bdui4s/lib64 export PYTHON_MODULE=python_3.10.4 diff --git a/internal/scripts/installation/modulefiles/11.1.0_cheyenne b/internal/scripts/installation/modulefiles/11.1.0_cheyenne deleted file mode 100644 index 70032e4f5d..0000000000 --- a/internal/scripts/installation/modulefiles/11.1.0_cheyenne +++ /dev/null @@ -1,29 +0,0 @@ -#%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 ***" -} - -# If they exist, remove ncdump and ncgen from /glade/p/ral/jntp/MET/MET_releases/11.1.0/external_libs/bin - -# The intel compiler is required to run MET -module load ncarenv/1.3 -module load intel/2021.2 -module load netcdf/4.8.0 - -set base /glade/p/ral/jntp/MET/MET_releases/11.1.0 -set ver 11.1.0 -set share $base/share/met - -prepend-path PATH $base/bin:/glade/p/ral/jntp/MET/MET_releases/11.1.0/external_libs/bin:/glade/p/ral/jntp/MET/METplus/miniconda/miniconda3/envs/metplus_v5.1_py3.10/bin - -setenv METversion V$ver - -# setenv MET_BUFRLIB /glade/p/ral/jntp/MET/MET_releases/11.1.0/external_libs/libs -# setenv MET_GRIB2C /glade/p/ral/jntp/MET/MET_releases/11.1.0/external_libs -# setenv MET_GSL /glade/p/ral/jntp/MET/MET_releases/11.1.0/external_libs - - diff --git a/internal/scripts/installation/modulefiles/12.0.0_acorn b/internal/scripts/installation/modulefiles/12.0.0_acorn index c97f4e92ed..5d7a98dcd7 100644 --- a/internal/scripts/installation/modulefiles/12.0.0_acorn +++ b/internal/scripts/installation/modulefiles/12.0.0_acorn @@ -22,6 +22,9 @@ module load libpng/1.6.37 module load gsl/2.7 module load g2c/1.6.4 module load proj/7.1.0 +module use /apps/dev/lmodules/intel/19.1.3.304/ +module load atlas/0.30.0 +module load eckit/1.20.2 set base /apps/sw_review/emc/MET/12.0.0 set ver 12.0.0 @@ -32,3 +35,4 @@ prepend-path PATH $base/bin setenv METversion V$ver setenv MET_ROOT $base +setenv MET_PYTHON_EXE /apps/dev/ve/evs/2.0/bin/python \ No newline at end of file diff --git a/internal/scripts/installation/modulefiles/12.0.0_casper b/internal/scripts/installation/modulefiles/12.0.0_casper new file mode 100644 index 0000000000..1c270efb3e --- /dev/null +++ b/internal/scripts/installation/modulefiles/12.0.0_casper @@ -0,0 +1,24 @@ +#%Module###################################################################### +## +## Model Evaluation Tools +## +proc ModulesHelp { } { + puts stderr "Sets up the paths and environment variables to use the Model Evaluation Tools v12.0.0 + *** For help see the official MET webpage at http://www.dtcenter.org/met/users ***" +} + + +# The intel compiler is required to run MET + +module load ncarenv/23.10 +module load intel-classic/2023.2.1 + +set base /glade/work/dtcrt/METplus/casper/components/MET/installations/12.0.0 +set ver 12.0.0 +set share $base/share/met + +prepend-path PATH $base/bin:/glade/work/dtcrt/METplus/casper/components/MET/installations/12.0.0/external_libs/bin:/glade/work/dtcrt/METplus/casper/miniconda/miniconda3/envs/metplus_v5.1_py3.10/bin + +setenv METversion V$ver + + diff --git a/internal/scripts/installation/modulefiles/12.0.0_derecho b/internal/scripts/installation/modulefiles/12.0.0_derecho new file mode 100644 index 0000000000..bfbe555e99 --- /dev/null +++ b/internal/scripts/installation/modulefiles/12.0.0_derecho @@ -0,0 +1,22 @@ +#%Module###################################################################### +## +## Model Evaluation Tools +## +proc ModulesHelp { } { + puts stderr "Sets up the paths and environment variables to use the Model Evaluation Tools v12.0.0 + *** For help see the official MET webpage at http://www.dtcenter.org/met/users ***" +} + +# The intel compiler is required to run MET + +module load ncarenv/23.09 +module load intel/2023.2.1 + +set base /glade/work/dtcrt/METplus/derecho/components/MET/installations/12.0.0 +set ver 12.0.0 +set share $base/share/met + +prepend-path PATH $base/bin:/glade/work/dtcrt/METplus/derecho/components/MET/installations/12.0.0/external_libs/bin:/glade/work/dtcrt/METplus/derecho/miniconda/miniconda3/envs/metplus_v5.1_py3.10/bin + +setenv METversion V$ver +setenv MET_PYTHON_EXE /glade/work/dtcrt/METplus/derecho/miniconda/miniconda3/envs/metplus_v5.1_py3.10/bin/python3 diff --git a/internal/scripts/installation/modulefiles/12.0.0_gaea b/internal/scripts/installation/modulefiles/12.0.0_gaea index 1ce4cd13c3..00b4625114 100644 --- a/internal/scripts/installation/modulefiles/12.0.0_gaea +++ b/internal/scripts/installation/modulefiles/12.0.0_gaea @@ -14,4 +14,6 @@ set ver 12.0.0 set share $base/$ver/share/met set lib_base $base/12.0.0 -prepend-path PATH $base/$ver/bin:$lib_base/external_libs/bin:/lustre/f2/dev/esrl/Julie.Prestopnik/projects/miniconda/miniconda3/envs/metplus_v5.1_py3.10/bin +prepend-path PATH $base/$ver/bin:$lib_base/external_libs/bin:/gpfs/f5/esrl/proj-shared/Julie.Prestopnik/projects/miniconda/miniconda3/envs/metplus_v5.1_py3.10/bin + +setenv MET_PYTHON_EXE /gpfs/f5/esrl/proj-shared/Julie.Prestopnik/projects/miniconda/miniconda3/envs/metplus_v5.1_py3.10/bin/python \ No newline at end of file diff --git a/internal/scripts/installation/modulefiles/12.0.0_hera b/internal/scripts/installation/modulefiles/12.0.0_hera index 2548513892..a97925d7e2 100644 --- a/internal/scripts/installation/modulefiles/12.0.0_hera +++ b/internal/scripts/installation/modulefiles/12.0.0_hera @@ -19,6 +19,8 @@ setenv MET_ROOT $base/$ver prepend-path PATH $base/$ver/bin:$lib_base/external_libs/bin:/scratch1/BMC/dtc/miniconda/miniconda3/envs/metplus_v5.1_py3.10/bin +setenv MET_PYTHON_EXE /scratch1/BMC/dtc/miniconda/miniconda3/envs/metplus_v5.1_py3.10/bin/python + #setenv METversion $ver #setenv MET_CONFIG $share/config #setenv MET_POLY $share/poly diff --git a/internal/scripts/installation/modulefiles/12.0.0_hercules b/internal/scripts/installation/modulefiles/12.0.0_hercules new file mode 100644 index 0000000000..deec9e17e9 --- /dev/null +++ b/internal/scripts/installation/modulefiles/12.0.0_hercules @@ -0,0 +1,20 @@ +#%Module###################################################################### +## +## Model Evaluation Tools +## +proc ModulesHelp { } { + puts stderr "Sets up the paths and environment variables to use the Model Evaluation Tools v12.0.0 + *** For help see the official MET webpage at http://www.dtcenter.org/met/users ***" +} + +prereq intel-oneapi-compilers/2022.2.1 + +set base /apps/contrib/MET +set ver 12.0.0 +set share $base/$ver/share/met +set lib_base $base/12.0.0 +setenv MET_ROOT $base/$ver/MET-12.0.0 + +prepend-path PATH $base/$ver/bin:$lib_base/external_libs/bin:/work/noaa/ovp/miniconda/miniconda3/envs/metplus_v5.1_py3.10/bin + +setenv MET_PYTHON_EXE /work/noaa/ovp/miniconda/miniconda3/envs/metplus_v5.1_py3.10/bin/python diff --git a/internal/scripts/installation/modulefiles/12.0.0_jet b/internal/scripts/installation/modulefiles/12.0.0_jet index 430bd27113..0ab7b873ce 100644 --- a/internal/scripts/installation/modulefiles/12.0.0_jet +++ b/internal/scripts/installation/modulefiles/12.0.0_jet @@ -15,3 +15,5 @@ set share $base/share/met setenv MET_ROOT $base/$ver/MET-12.0.0 prepend-path PATH $base/bin:$base/external_libs/bin:/mnt/lfs1/HFIP/dtc-hurr/METplus/miniconda/miniconda3/envs/metplus_v5.1_py3.10 + +setenv MET_PYTHON_EXE /mnt/lfs1/HFIP/dtc-hurr/METplus/miniconda/miniconda3/envs/metplus_v5.1_py3.10_intel/bin/python \ No newline at end of file diff --git a/internal/scripts/installation/modulefiles/12.0.0_orion b/internal/scripts/installation/modulefiles/12.0.0_orion index ed0dd56805..a78bfe25bb 100644 --- a/internal/scripts/installation/modulefiles/12.0.0_orion +++ b/internal/scripts/installation/modulefiles/12.0.0_orion @@ -10,10 +10,11 @@ proc ModulesHelp { } { prereq intel/2020.2 set base /apps/contrib/MET -set ver 12.0.0-beta2 +set ver 12.0.0 set share $base/$ver/share/met -set lib_base $base/12.0.0-beta2 -setenv MET_ROOT $base/$ver/MET-12.0.0-beta2 +set lib_base $base/12.0.0 +setenv MET_ROOT $base/$ver/MET-12.0.0 prepend-path PATH $base/$ver/bin:$lib_base/external_libs/bin:/work/noaa/ovp/miniconda/miniconda3/envs/metplus_v5.1_py3.10/bin +setenv MET_PYTHON_EXE /work/noaa/ovp/miniconda/miniconda3/envs/metplus_v5.1_py3.10/bin/python diff --git a/internal/scripts/sonarqube/run_sonarqube.sh b/internal/scripts/sonarqube/run_sonarqube.sh index 1a57b0b726..ac439b8a11 100755 --- a/internal/scripts/sonarqube/run_sonarqube.sh +++ b/internal/scripts/sonarqube/run_sonarqube.sh @@ -125,9 +125,7 @@ if [ -z "$SONAR_TOKEN" ]; then exit 1 else [ -e $SONAR_PROPERTIES ] && rm $SONAR_PROPERTIES - sed -e "s|SONAR_PROJECT_KEY|MET_NB|" \ - -e "s|SONAR_PROJECT_NAME|MET Nightly Build|" \ - -e "s|SONAR_PROJECT_VERSION|$SONAR_PROJECT_VERSION|" \ + sed -e "s|SONAR_PROJECT_VERSION|$SONAR_PROJECT_VERSION|" \ -e "s|SONAR_HOST_URL|$SONAR_HOST_URL|" \ -e "s|SONAR_TOKEN|$SONAR_TOKEN|" \ -e "s|SONAR_BRANCH_NAME|${1}|" \ diff --git a/internal/scripts/sonarqube/sonar-project.properties b/internal/scripts/sonarqube/sonar-project.properties index 215749e75b..30ee495c7b 100644 --- a/internal/scripts/sonarqube/sonar-project.properties +++ b/internal/scripts/sonarqube/sonar-project.properties @@ -1,6 +1,6 @@ # Project and source code settings -sonar.projectKey=SONAR_PROJECT_KEY -sonar.projectName=SONAR_PROJECT_NAME +sonar.projectKey=MET +sonar.projectName=MET sonar.projectVersion=SONAR_PROJECT_VERSION sonar.branch.name=SONAR_BRANCH_NAME sonar.sources=src,scripts/python,data/wrappers diff --git a/internal/test_unit/config/GridStatConfig_ugrid_mpas b/internal/test_unit/config/GridStatConfig_ugrid_mpas index db40bb0798..d54b25de53 100644 --- a/internal/test_unit/config/GridStatConfig_ugrid_mpas +++ b/internal/test_unit/config/GridStatConfig_ugrid_mpas @@ -203,12 +203,12 @@ output_flag = { cts = NONE; mctc = NONE; mcts = NONE; - cnt = STAT; + cnt = NONE; sl1l2 = STAT; - sal1l2 = STAT; - vl1l2 = STAT; - val1l2 = STAT; - vcnt = STAT; + sal1l2 = NONE; + vl1l2 = NONE; + val1l2 = NONE; + vcnt = NONE; pct = NONE; pstd = NONE; pjc = NONE; diff --git a/internal/test_unit/config/GridStatConfig_ugrid_mpas_diag b/internal/test_unit/config/GridStatConfig_ugrid_mpas_diag index c893957e15..9e479d0302 100644 --- a/internal/test_unit/config/GridStatConfig_ugrid_mpas_diag +++ b/internal/test_unit/config/GridStatConfig_ugrid_mpas_diag @@ -203,12 +203,12 @@ output_flag = { cts = NONE; mctc = NONE; mcts = NONE; - cnt = STAT; + cnt = NONE; sl1l2 = STAT; - sal1l2 = STAT; - vl1l2 = STAT; - val1l2 = STAT; - vcnt = STAT; + sal1l2 = NONE; + vl1l2 = NONE; + val1l2 = NONE; + vcnt = NONE; pct = NONE; pstd = NONE; pjc = NONE; diff --git a/internal/test_unit/config/PointStatConfig_ugrid_mpas_diag b/internal/test_unit/config/PointStatConfig_ugrid_mpas_diag index ca0ef81ae7..886c6bb301 100644 --- a/internal/test_unit/config/PointStatConfig_ugrid_mpas_diag +++ b/internal/test_unit/config/PointStatConfig_ugrid_mpas_diag @@ -119,17 +119,17 @@ hira = { //////////////////////////////////////////////////////////////////////////////// output_flag = { - fho = BOTH; - ctc = BOTH; - cts = BOTH; + fho = STAT; + ctc = STAT; + cts = STAT; mctc = NONE; mcts = NONE; - cnt = BOTH; - sl1l2 = NONE; + cnt = NONE; + sl1l2 = STAT; sal1l2 = NONE; vl1l2 = NONE; val1l2 = NONE; - vcnt = BOTH; + vcnt = NONE; pct = NONE; pstd = NONE; pjc = NONE; @@ -137,8 +137,8 @@ output_flag = { ecnt = NONE; orank = NONE; rps = NONE; - eclv = BOTH; - mpr = BOTH; + eclv = NONE; + mpr = STAT; seeps = NONE; seeps_mpr = NONE; } diff --git a/internal/test_unit/config/PointStatConfig_ugrid_mpas_out b/internal/test_unit/config/PointStatConfig_ugrid_mpas_out index 1e1f9e4887..c16deb0f7d 100644 --- a/internal/test_unit/config/PointStatConfig_ugrid_mpas_out +++ b/internal/test_unit/config/PointStatConfig_ugrid_mpas_out @@ -119,17 +119,17 @@ hira = { //////////////////////////////////////////////////////////////////////////////// output_flag = { - fho = BOTH; - ctc = BOTH; - cts = BOTH; + fho = STAT; + ctc = STAT; + cts = STAT; mctc = NONE; mcts = NONE; - cnt = BOTH; - sl1l2 = NONE; + cnt = NONE; + sl1l2 = STAT; sal1l2 = NONE; vl1l2 = NONE; val1l2 = NONE; - vcnt = BOTH; + vcnt = NONE; pct = NONE; pstd = NONE; pjc = NONE; @@ -137,8 +137,8 @@ output_flag = { ecnt = NONE; orank = NONE; rps = NONE; - eclv = BOTH; - mpr = BOTH; + eclv = NONE; + mpr = STAT; seeps = NONE; seeps_mpr = NONE; } diff --git a/internal/test_unit/config/PointStatConfig_ugrid_no_dataset b/internal/test_unit/config/PointStatConfig_ugrid_no_dataset new file mode 100644 index 0000000000..9c7c7f5b3a --- /dev/null +++ b/internal/test_unit/config/PointStatConfig_ugrid_no_dataset @@ -0,0 +1,167 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Point-Stat configuration file. +// +// For additional information, please see the MET User's Guide. +// +//////////////////////////////////////////////////////////////////////////////// + +model = "WRF"; + +// +// Output description to be written +// May be set separately in each "obs.field" entry +// +desc = "NA"; + +//////////////////////////////////////////////////////////////////////////////// + +regrid = { + to_grid = NONE; + method = NEAREST; + width = 1; +} + +//////////////////////////////////////////////////////////////////////////////// + +obs_window = { + beg = ${BEG_DS}; + end = ${END_DS}; +} + +//////////////////////////////////////////////////////////////////////////////// + +mpr_column = []; +mpr_thresh = []; +cnt_thresh = [ NA ]; +cnt_logic = UNION; +wind_thresh = [ NA ]; +wind_logic = UNION; +eclv_points = 0.05; + + +fcst = { + sid_inc = []; + sid_exc = []; + obs_quality_inc = []; + obs_quality_exc = []; + + field = [ + { name = "theta"; level = "L2"; message_type = "ADPSFC"; } + ]; + +} + +obs = { + sid_inc = []; + sid_exc = []; + obs_quality_inc = []; + obs_quality_exc = []; + + field = [ + { name = "TMP"; level = "P1000-500"; message_type = "ADPSFC"; } + ]; + +} + +//////////////////////////////////////////////////////////////////////////////// + +climo_mean = obs; +climo_mean = { + file_name = []; +} + +//////////////////////////////////////////////////////////////////////////////// + +mask = { + grid = []; + poly = []; + sid = []; + llpnt = [{ name = "ALLLATLON"; lat_thresh = NA; lon_thresh = NA; }]; +} + +//////////////////////////////////////////////////////////////////////////////// + +ci_alpha = [ 0.05 ]; + +boot = { + interval = PCTILE; + rep_prop = 1.0; + n_rep = 200; + rng = "mt19937"; + seed = "1"; +} + +//////////////////////////////////////////////////////////////////////////////// + +interp = { + vld_thresh = 1.0; + + type = [ + { + method = NEAREST; + width = 1; + } + ]; +} + +//////////////////////////////////////////////////////////////////////////////// + +hira = { + flag = FALSE; + width = [ 2, 3, 4, 5 ]; + vld_thresh = 1.0; + cov_thresh = [ ==0.25 ]; + shape = SQUARE; + prob_cat_thresh = []; +} + +//////////////////////////////////////////////////////////////////////////////// + +output_flag = { + fho = NONE; + ctc = NONE; + cts = NONE; + mctc = NONE; + mcts = NONE; + cnt = NONE; + sl1l2 = STAT; + sal1l2 = NONE; + vl1l2 = NONE; + val1l2 = NONE; + vcnt = NONE; + pct = NONE; + pstd = NONE; + pjc = NONE; + prc = NONE; + ecnt = NONE; + orank = NONE; + rps = NONE; + eclv = NONE; + mpr = STAT; + seeps = NONE; + seeps_mpr = NONE; +} + +//////////////////////////////////////////////////////////////////////////////// +// Threshold for SEEPS p1 (Probability of being dry) + +seeps_p1_thresh = NA; + +//////////////////////////////////////////////////////////////////////////////// +// Unstructured Grid (optional ecept ugrid_dataset) + +//ugrid_dataset = "mpas"; +ugrid_max_distance_km = 35; +//ugrid_map_config = ""; +ugrid_coordinates_file = "${MET_TEST_INPUT}/ugrid_data/mpas/static.40962_reduced.nc"; + +//////////////////////////////////////////////////////////////////////////////// + +duplicate_flag = NONE; +rank_corr_flag = TRUE; +tmp_dir = "/tmp"; +output_prefix = "${OUTPUT_PREFIX}"; +version = "V12.0.0"; + +//////////////////////////////////////////////////////////////////////////////// diff --git a/internal/test_unit/xml/unit_gen_ens_prod.xml b/internal/test_unit/xml/unit_gen_ens_prod.xml index 771bf3e201..371a5c5283 100644 --- a/internal/test_unit/xml/unit_gen_ens_prod.xml +++ b/internal/test_unit/xml/unit_gen_ens_prod.xml @@ -26,7 +26,7 @@ echo "&DATA_DIR_MODEL;/grib1/arw-fer-gep1/arw-fer-gep1_2012040912_F024.grib \ &DATA_DIR_MODEL;/grib1/arw-sch-gep2/arw-sch-gep2_2012040912_F024.grib \ - &DATA_DIR_MODEL;/grib1/arw-tom-gep3/arw-tom-gep3_2012040912_F024.grib \ + MISSING \ &DATA_DIR_MODEL;/grib1/nmm-fer-gep4/nmm-fer-gep4_2012040912_F024.grib \ &DATA_DIR_MODEL;/grib1/arw-fer-gep5/arw-fer-gep5_2012040912_F024.grib \ &DATA_DIR_MODEL;/grib1/arw-sch-gep6/arw-sch-gep6_2012040912_F024.grib \ @@ -42,7 +42,7 @@ -ens &OUTPUT_DIR;/gen_ens_prod/input_file_list \ -config &CONFIG_DIR;/GenEnsProdConfig \ -out &OUTPUT_DIR;/gen_ens_prod/gen_ens_prod_NO_CTRL_20120410_120000V.nc \ - -v 2 + -v 3 &OUTPUT_DIR;/gen_ens_prod/gen_ens_prod_NO_CTRL_20120410_120000V.nc @@ -52,7 +52,7 @@ echo "&DATA_DIR_MODEL;/grib1/arw-fer-gep1/arw-fer-gep1_2012040912_F024.grib \ &DATA_DIR_MODEL;/grib1/arw-sch-gep2/arw-sch-gep2_2012040912_F024.grib \ - &DATA_DIR_MODEL;/grib1/arw-tom-gep3/arw-tom-gep3_2012040912_F024.grib \ + MISSING/&DATA_DIR_MODEL;/grib1/arw-tom-gep3/arw-tom-gep3_2012040912_F024.grib \ &DATA_DIR_MODEL;/grib1/nmm-fer-gep4/nmm-fer-gep4_2012040912_F024.grib \ &DATA_DIR_MODEL;/grib1/arw-fer-gep5/arw-fer-gep5_2012040912_F024.grib \ &DATA_DIR_MODEL;/grib1/arw-sch-gep6/arw-sch-gep6_2012040912_F024.grib \ @@ -69,7 +69,7 @@ -ctrl &DATA_DIR_MODEL;/grib1/arw-tom-gep0/arw-tom-gep0_2012040912_F024.grib \ -config &CONFIG_DIR;/GenEnsProdConfig \ -out &OUTPUT_DIR;/gen_ens_prod/gen_ens_prod_WITH_CTRL_20120410_120000V.nc \ - -v 2 + -v 3 &OUTPUT_DIR;/gen_ens_prod/gen_ens_prod_WITH_CTRL_20120410_120000V.nc @@ -162,7 +162,7 @@ -ctrl &DATA_DIR_MODEL;/grib1/arw-tom-gep0/arw-tom-gep0_2012040912_F024.grib \ -config &CONFIG_DIR;/GenEnsProdConfig_normalize \ -out &OUTPUT_DIR;/gen_ens_prod/gen_ens_prod_NORMALIZE.nc \ - -v 2 + -v 3 &OUTPUT_DIR;/gen_ens_prod/gen_ens_prod_NORMALIZE.nc diff --git a/internal/test_unit/xml/unit_ugrid.xml b/internal/test_unit/xml/unit_ugrid.xml index a77d95d886..80a6a53360 100644 --- a/internal/test_unit/xml/unit_ugrid.xml +++ b/internal/test_unit/xml/unit_ugrid.xml @@ -77,12 +77,6 @@ &OUTPUT_DIR;/point_stat_ugrid/point_stat_UGRID_MPAS_DIAG_TEMP_000000L_20120409_120000V.stat - &OUTPUT_DIR;/point_stat_ugrid/point_stat_UGRID_MPAS_DIAG_TEMP_000000L_20120409_120000V_fho.txt - &OUTPUT_DIR;/point_stat_ugrid/point_stat_UGRID_MPAS_DIAG_TEMP_000000L_20120409_120000V_ctc.txt - &OUTPUT_DIR;/point_stat_ugrid/point_stat_UGRID_MPAS_DIAG_TEMP_000000L_20120409_120000V_cts.txt - &OUTPUT_DIR;/point_stat_ugrid/point_stat_UGRID_MPAS_DIAG_TEMP_000000L_20120409_120000V_cnt.txt - &OUTPUT_DIR;/point_stat_ugrid/point_stat_UGRID_MPAS_DIAG_TEMP_000000L_20120409_120000V_eclv.txt - &OUTPUT_DIR;/point_stat_ugrid/point_stat_UGRID_MPAS_DIAG_TEMP_000000L_20120409_120000V_mpr.txt @@ -102,12 +96,26 @@ &OUTPUT_DIR;/point_stat_ugrid/point_stat_UGRID_MPAS_OUT_TEMP_000000L_20120409_120000V.stat - &OUTPUT_DIR;/point_stat_ugrid/point_stat_UGRID_MPAS_OUT_TEMP_000000L_20120409_120000V_fho.txt - &OUTPUT_DIR;/point_stat_ugrid/point_stat_UGRID_MPAS_OUT_TEMP_000000L_20120409_120000V_ctc.txt - &OUTPUT_DIR;/point_stat_ugrid/point_stat_UGRID_MPAS_OUT_TEMP_000000L_20120409_120000V_cts.txt - &OUTPUT_DIR;/point_stat_ugrid/point_stat_UGRID_MPAS_OUT_TEMP_000000L_20120409_120000V_cnt.txt - &OUTPUT_DIR;/point_stat_ugrid/point_stat_UGRID_MPAS_OUT_TEMP_000000L_20120409_120000V_eclv.txt - &OUTPUT_DIR;/point_stat_ugrid/point_stat_UGRID_MPAS_OUT_TEMP_000000L_20120409_120000V_mpr.txt + + + + + &MET_BIN;/point_stat + + BEG_DS -1800 + END_DS 1800 + OUTPUT_PREFIX UGRID_MPAS_CFG_OUT_TEMP + CONFIG_DIR &CONFIG_DIR; + + \ + &DATA_DIR_UGRID;/mpas/mpasout.2012-04-09_12.00.00_reduced.nc \ + &OUTPUT_DIR;/pb2nc/gdas1.20120409.t12z.prepbufr.nc \ + &CONFIG_DIR;/PointStatConfig_ugrid_no_dataset \ + -ugrid_config ${MET_BASE}/config/UGridConfig_mpas \ + -outdir &OUTPUT_DIR;/point_stat_ugrid -v 1 + + + &OUTPUT_DIR;/point_stat_ugrid/point_stat_UGRID_MPAS_CFG_OUT_TEMP_000000L_20120409_120000V.stat diff --git a/src/libcode/vx_data2d_factory/parse_file_list.cc b/src/libcode/vx_data2d_factory/parse_file_list.cc index 0363f0221f..2e2be2a632 100644 --- a/src/libcode/vx_data2d_factory/parse_file_list.cc +++ b/src/libcode/vx_data2d_factory/parse_file_list.cc @@ -37,6 +37,7 @@ using namespace std; static const char python_str [] = "python"; static const char file_list_str [] = "file_list"; +static const char missing_str [] = "MISSING"; //////////////////////////////////////////////////////////////////////// @@ -201,4 +202,68 @@ return a; } +//////////////////////////////////////////////////////////////////////// + + +GrdFileType parse_file_list_type(const StringArray& file_list) + +{ + +GrdFileType ftype = FileType_None; + +for ( int i=0; i= debug_level) { - for (int idx=0; idx< time_offsets.n_elements(); idx++ ) { - mlog << Debug(debug_level) << method_name << "time: " - << unix_to_yyyymmdd_hhmmss(_file->ValidTime[time_offsets[idx]]) - << " from index " << time_offsets[idx] << "\n"; - } - } - } - */ } else if (level.type() == LevelType_Pres) { if (nullptr == data_vinfo) { @@ -353,7 +332,7 @@ int MetUGridDataFile::data_plane_array(VarInfo &vinfo, if (vlevel >= lvl_lower && vlevel <= lvl_upper) { vinfo.set_req_name(vinfo_list[idx]->name.c_str()); if (data_plane(vinfo, plane, vinfo_list[idx])) { - plane_array.add(plane, lvl_lower, lvl_upper); + plane_array.add(plane, vlevel, vlevel); n_rec++; } mlog << Debug(5) << method_name diff --git a/src/libcode/vx_data2d_ugrid/ugrid_file.cc b/src/libcode/vx_data2d_ugrid/ugrid_file.cc index f85a6ea0ea..d157f75f0c 100644 --- a/src/libcode/vx_data2d_ugrid/ugrid_file.cc +++ b/src/libcode/vx_data2d_ugrid/ugrid_file.cc @@ -940,6 +940,9 @@ void UGridFile::read_netcdf_grid() } } + // Convert longitude from degrees east to west + for (int idx=0; idxNedge = data.Nedge; -D->Nnode = data.Nnode; +D->n_edge = data.n_edge; +D->n_node = data.n_node; D->max_distance_km = data.max_distance_km; -D->set_points(data.Nface, data.pointLonLat); +D->set_points(data.n_face, data.point_lonlat); us = D; D = (UnstructuredData *)nullptr; @@ -1690,11 +1690,11 @@ bool is_eq(const UnstructuredData * us1, const UnstructuredData * us2) bool status = false; if (us1 && us2) { if (us1 == us2) status = true; - else status = us1->Nface == us2->Nface - && us1->Nnode == us2->Nnode - && us1->Nedge == us2->Nedge - && us1->pointLonLat[0] == us2->pointLonLat[0] - && (us1->Nface > 0 && us1->pointLonLat[us1->Nface-1] == us2->pointLonLat[us2->Nface-1]) + else status = us1->n_face == us2->n_face + && us1->n_node == us2->n_node + && us1->n_edge == us2->n_edge + && us1->point_lonlat[0] == us2->point_lonlat[0] + && (us1->n_face > 0 && us1->point_lonlat[us1->n_face-1] == us2->point_lonlat[us2->n_face-1]) && is_eq(us1->lat_checksum, us2->lat_checksum) && is_eq(us1->lon_checksum, us2->lon_checksum); } diff --git a/src/libcode/vx_grid/unstructured_grid.cc b/src/libcode/vx_grid/unstructured_grid.cc index 9af740a233..d1a56ff9f0 100644 --- a/src/libcode/vx_grid/unstructured_grid.cc +++ b/src/libcode/vx_grid/unstructured_grid.cc @@ -96,14 +96,14 @@ void UnstructuredGrid::set_from_data(const UnstructuredData &data) { clear(); if (data.name) Name = data.name; - Nx = data.Nface; + Nx = data.n_face; - Data.Nface = Nx; - Data.Nedge = data.Nedge; - Data.Nnode = data.Nnode; + Data.n_face = Nx; + Data.n_edge = data.n_edge; + Data.n_node = data.n_node; Data.max_distance_km = data.max_distance_km; - Data.set_points(Nx, data.pointLonLat); + Data.set_points(Nx, data.point_lonlat); } @@ -120,9 +120,9 @@ void UnstructuredGrid::set_max_distance_km(double max_distance) { void UnstructuredGrid::latlon_to_xy(double lat, double lon, double &x, double &y) const { - PointLonLat _pointLonLat(lon, lat); + PointLonLat _point_lonlat(lon, lat); - IndexKDTree::ValueList neighbor = Data.kdtree->closestPoints(_pointLonLat, 1); + IndexKDTree::ValueList neighbor = Data.kdtree->closestPoints(_point_lonlat, 1); size_t index(neighbor[0].payload()); double distance_km(neighbor[0].distance()/1000.); bool in_distance = Data.is_in_distance(distance_km); @@ -130,16 +130,12 @@ void UnstructuredGrid::latlon_to_xy(double lat, double lon, double &x, double &y x = in_distance ? index : -1.0; y = 0; - //PointLonLat r_lonlat; - //if(_distance > 180.0) atlas_geometry.xyz2lonlat(neighbor[0].point(), r_lonlat); - //else r_lonlat.assign(neighbor[0].point()[0], neighbor[0].point()[1]); - if(mlog.verbosity_level() >= UGRID_DEBUG_LEVEL) mlog << Debug(UGRID_DEBUG_LEVEL) << "UnstructuredGrid::latlon_to_xy() " << "input=(" << lon << ", " << lat << ") ==> (" << x << ", " << y << ") == (" - << Data.pointLonLat[index].x() << ", " << Data.pointLonLat[index].y() + << Data.point_lonlat[index].x() << ", " << Data.point_lonlat[index].y() << ") distance= " << distance_km << "km, " - << _pointLonLat.distance(Data.pointLonLat[index]) + << _point_lonlat.distance(Data.point_lonlat[index]) << " degree" << (in_distance ? " " : ", rejected") << "\n"; } @@ -149,8 +145,8 @@ void UnstructuredGrid::latlon_to_xy(double lat, double lon, double &x, double &y void UnstructuredGrid::xy_to_latlon(double x, double y, double &lat, double &lon) const { - lat = Data.pointLonLat[x].y(); - lon = Data.pointLonLat[x].x(); + lat = Data.point_lonlat[x].y(); + lon = Data.point_lonlat[x].x(); if(mlog.verbosity_level() >= UGRID_DEBUG_LEVEL) mlog << Debug(UGRID_DEBUG_LEVEL) << "UnstructuredGrid::xy_to_latlon() " @@ -213,7 +209,7 @@ else out << "(nul)\n"; out << '\n'; -out << prefix << "Nface = " << Nx << "\n"; +out << prefix << "n_face = " << Nx << "\n"; // // done @@ -234,7 +230,7 @@ ConcatString a; a << "Projection: UnstructuredGrid" << sep; -a << "Nface: " << Nx << sep; +a << "n_face: " << Nx << sep; // // done // @@ -352,13 +348,13 @@ void UnstructuredData::build_tree() { atlas::idx_t n = 0; kdtree = new IndexKDTree(atlas_geometry); - kdtree->reserve(Nface); - for (int i=0; ireserve(n_face); + for (int i=0; iinsert(pointLL, n++); - lat_checksum += (i+1) * pointLonLat[i].y(); - lon_checksum += (i+1) * pointLonLat[i].x(); + lat_checksum += (i+1) * point_lonlat[i].y(); + lon_checksum += (i+1) * point_lonlat[i].x(); } kdtree->build(); @@ -368,18 +364,18 @@ void UnstructuredData::build_tree() { //////////////////////////////////////////////////////////////////////// void UnstructuredData::copy_from(const UnstructuredData &us_data) { - set_points(us_data.Nface, us_data.pointLonLat); - Nedge = us_data.Nedge; - Nnode = us_data.Nnode; + set_points(us_data.n_face, us_data.point_lonlat); + n_edge = us_data.n_edge; + n_node = us_data.n_node; max_distance_km = us_data.max_distance_km; } //////////////////////////////////////////////////////////////////////// void UnstructuredData::copy_from(const UnstructuredData *us_data) { - set_points(us_data->Nface, us_data->pointLonLat); - Nedge = us_data->Nedge; - Nnode = us_data->Nnode; + set_points(us_data->n_face, us_data->point_lonlat); + n_edge = us_data->n_edge; + n_node = us_data->n_node; max_distance_km = us_data->max_distance_km; } @@ -400,15 +396,15 @@ void UnstructuredData::set_points(int count, double *_lon, double *_lat) { clear_data(); - Nface = count; - pointLonLat.reserve(count); + n_face = count; + point_lonlat.reserve(count); for (int i=0; i= UGRID_DEBUG_LEVEL) mlog << Debug(UGRID_DEBUG_LEVEL) << "UnstructuredData::set_points(int, double *, double *) first (" - << pointLonLat[0].x() << ", " << pointLonLat[0].y() << ") and last (" - << pointLonLat[count-1].x() << ", " << pointLonLat[count-1].y() << ") from (" + << point_lonlat[0].x() << ", " << point_lonlat[0].y() << ") and last (" + << point_lonlat[count-1].x() << ", " << point_lonlat[count-1].y() << ") from (" << _lon[0] << ", " << _lat[0] << ") and (" << _lon[count-1] << ", " << _lat[count-1] << ")\n"; @@ -422,15 +418,15 @@ void UnstructuredData::set_points(int count, const std::vector &ptL clear_data(); - Nface = count; - pointLonLat.reserve(count); + n_face = count; + point_lonlat.reserve(count); for (int i=0; i= UGRID_DEBUG_LEVEL) mlog - << Debug(UGRID_DEBUG_LEVEL) << "UnstructuredData::set_points(std::vector &) first: (" - << pointLonLat[0].x() << ", " << pointLonLat[0].y() << ") and last (" - << pointLonLat[count-1].x() << ", " << pointLonLat[count-1].y() << ") from (" + << Debug(UGRID_DEBUG_LEVEL) << "UnstructuredData::set_points(int, std::vector &) first: (" + << point_lonlat[0].x() << ", " << point_lonlat[0].y() << ") and last (" + << point_lonlat[count-1].x() << ", " << point_lonlat[count-1].y() << ") from (" << ptLonLat[0].x() << ", " << ptLonLat[0].y() << ") and (" << ptLonLat[count-1].x() << ", " << ptLonLat[count-1].y() << ")\n"; diff --git a/src/libcode/vx_grid/unstructured_grid_defs.h b/src/libcode/vx_grid/unstructured_grid_defs.h index a363bbab6d..68456d0d35 100644 --- a/src/libcode/vx_grid/unstructured_grid_defs.h +++ b/src/libcode/vx_grid/unstructured_grid_defs.h @@ -36,14 +36,14 @@ struct UnstructuredData { const char * name; // not allocated - int Nface; - int Nedge; - int Nnode; + int n_face; + int n_edge; + int n_node; double max_distance_km; // This should be set after calling set_points() double lat_checksum; double lon_checksum; - std::vector pointLonLat; + std::vector point_lonlat; atlas::util::IndexKDTree *kdtree; UnstructuredData(); diff --git a/src/libcode/vx_regrid/vx_regrid.cc b/src/libcode/vx_regrid/vx_regrid.cc index 7abfee78b4..5fcc970601 100644 --- a/src/libcode/vx_regrid/vx_regrid.cc +++ b/src/libcode/vx_regrid/vx_regrid.cc @@ -133,7 +133,6 @@ to_data.set_accum (from_data.accum()); // // copy data // - for (xt=0; xt<(to_grid.nx()); ++xt) { for (yt=0; yt<(to_grid.ny()); ++yt) { diff --git a/src/tools/core/ensemble_stat/ensemble_stat.cc b/src/tools/core/ensemble_stat/ensemble_stat.cc index 0ed6b71597..b15f0fd728 100644 --- a/src/tools/core/ensemble_stat/ensemble_stat.cc +++ b/src/tools/core/ensemble_stat/ensemble_stat.cc @@ -70,8 +70,10 @@ // 038 09/06/22 Halley Gotway MET #1908 Remove ensemble processing logic. // 039 09/29/22 Halley Gotway MET #2286 Refine GRIB1 table lookup logic. // 040 10/03/22 Prestopnik MET #2227 Remove using namespace netCDF from -// header files +// header files. // 041 04/16/24 Halley Gotway MET #2786 Compute RPS from climo bin probs. +// 042 04/29/24 Halley Gotway MET #2870 Ignore MISSING keyword. +// 043 04/29/24 Halley Gotway MET #2795 Move level mismatch warning. // //////////////////////////////////////////////////////////////////////// @@ -205,8 +207,6 @@ void process_command_line(int argc, char **argv) { int i; CommandLine cline; ConcatString default_config_file; - Met2dDataFile *ens_mtddf = (Met2dDataFile *) nullptr; - Met2dDataFile *obs_mtddf = (Met2dDataFile *) nullptr; const char *method_name = "process_command_line() -> "; // Set default output directory @@ -360,32 +360,20 @@ void process_command_line(int argc, char **argv) { // Get the ensemble file type from config, if present etype = parse_conf_file_type(conf_info.conf.lookup_dictionary(conf_key_fcst)); - if(FileType_UGrid == etype) { - mlog << Error << "\n" << program_name << " -> filetype " - << grdfiletype_to_string(etype) << " from the configuration is not supported\n\n"; - exit(1); + // Get the ensemble file type from the files + if(etype == FileType_None) { + etype = parse_file_list_type(ens_file_list); } - // Read the first input ensemble file - if(!(ens_mtddf = mtddf_factory.new_met_2d_data_file(ens_file_list[0].c_str(), etype))) { + // UGrid not supported + if(etype == FileType_UGrid) { mlog << Error << "\n" << method_name - << "trouble reading ensemble file \"" - << ens_file_list[0] << "\"\n\n"; - exit(1); - } - - // Store the input ensemble file type - etype = ens_mtddf->file_type(); - if(FileType_UGrid == etype) { - mlog << Error << "\n" << program_name << " -> The filetype " - << grdfiletype_to_string(etype) << " (" << ens_file_list[0] - << ") is not supported\n\n"; - + << grdfiletype_to_string(etype) + << " ensemble files are not supported\n\n"; exit(1); } - // Observation files are required if(!grid_obs_flag && !point_obs_flag) { mlog << Error << "\n" << method_name @@ -405,28 +393,17 @@ void process_command_line(int argc, char **argv) { // Get the observation file type from config, if present otype = parse_conf_file_type(conf_info.conf.lookup_dictionary(conf_key_obs)); - if(FileType_UGrid == otype) { - mlog << Error << "\n" << program_name << " -> filetype " - << grdfiletype_to_string(otype) << " from the configuration is not supported\n\n"; - - exit(1); - } - // Read the first gridded observation file - if(!(obs_mtddf = mtddf_factory.new_met_2d_data_file(grid_obs_file_list[0].c_str(), otype))) { - mlog << Error << "\n" << method_name - << "trouble reading gridded observation file \"" - << grid_obs_file_list[0] << "\"\n\n"; - exit(1); + // Get the observation file type from the files + if(otype == FileType_None) { + otype = parse_file_list_type(grid_obs_file_list); } - // Store the gridded observation file type - otype = obs_mtddf->file_type(); - if(FileType_UGrid == otype) { - mlog << Error << "\n" << program_name << " -> The filetype " - << grdfiletype_to_string(etype) << " (" << grid_obs_file_list[0] - << ") is not supported\n\n"; - + // UGrid not supported + if(otype == FileType_UGrid) { + mlog << Error << "\n" << method_name + << grdfiletype_to_string(otype) + << " gridded observation files are not supported\n\n"; exit(1); } } @@ -475,9 +452,7 @@ void process_command_line(int argc, char **argv) { if(!file_exists(ens_file_list[i].c_str()) && !is_python_grdfiletype(etype)) { - mlog << Warning << "\n" << method_name - << "can't open input ensemble file: " - << ens_file_list[i] << "\n\n"; + log_missing_file(method_name, "input ensemble file", ens_file_list[i]); ens_file_vld.add(0); } else { @@ -488,9 +463,7 @@ void process_command_line(int argc, char **argv) { // User-specified ensemble mean file if(ens_mean_file.nonempty()) { if(!file_exists(ens_mean_file.c_str())) { - mlog << Warning << "\n" << method_name - << "can't open input ensemble mean file: " - << ens_mean_file << "\n\n"; + log_missing_file(method_name, "input ensemble mean file", ens_mean_file); ens_mean_file = ""; } } @@ -502,10 +475,6 @@ void process_command_line(int argc, char **argv) { << "control file is not provided with -ctrl argument\n\n"; } - // Deallocate memory for data files - if(ens_mtddf) { delete ens_mtddf; ens_mtddf = (Met2dDataFile *) nullptr; } - if(obs_mtddf) { delete obs_mtddf; obs_mtddf = (Met2dDataFile *) nullptr; } - return; } @@ -839,6 +808,10 @@ void process_point_vx() { // Loop through each of the fields to be verified for(i=0; iget_var_info(); + VarInfo *obs_info = conf_info.vx_opt[i].vx_pd.obs_info; + bool print_level_mismatch_warning = true; + // Initialize emn_dpa.clear(); @@ -857,6 +830,23 @@ void process_point_vx() { continue; } + // MET #2795, for multiple individual forecast levels, print a + // warning if the observations levels are not fully covered. + if(print_level_mismatch_warning && + fcst_dpa.n_planes() > 1 && + !is_eq(fcst_info->level().lower(), fcst_info->level().upper()) && + (obs_info->level().lower() < fcst_info->level().lower() || + obs_info->level().upper() > fcst_info->level().upper())) { + mlog << Warning << "\nprocess_point_vx() -> " + << "The forecast level range (" << fcst_info->magic_str() + << ") does not fully contain the observation level range (" + << obs_info->magic_str() << "). No vertical interpolation " + << "will be performed for observations falling outside " + << "the range of forecast levels. Instead, they will be " + << "matched to the single nearest forecast level.\n\n"; + print_level_mismatch_warning = false; + } + // Store ensemble member data conf_info.vx_opt[i].vx_pd.set_fcst_dpa(fcst_dpa); @@ -875,20 +865,18 @@ void process_point_vx() { mlog << Debug(2) << "Processing ensemble mean file: " << ens_mean_file << "\n"; - VarInfo *info = conf_info.vx_opt[i].vx_pd.fcst_info->get_var_info(); - // Read the gridded data from the ensemble mean file - if(!get_data_plane_array(ens_mean_file.c_str(), info->file_type(), info, - emn_dpa, true)) { + if(!get_data_plane_array(ens_mean_file.c_str(), fcst_info->file_type(), + fcst_info, emn_dpa, true)) { mlog << Error << "\nprocess_point_vx() -> " << "trouble reading the ensemble mean field \"" - << info->magic_str() << "\" from file \"" + << fcst_info->magic_str() << "\" from file \"" << ens_mean_file << "\"\n\n"; exit(1); } // Dump out the number of levels found - mlog << Debug(2) << "For " << info->magic_str() + mlog << Debug(2) << "For " << fcst_info->magic_str() << " found " << emn_dpa.n_planes() << " forecast levels.\n"; } @@ -975,10 +963,8 @@ void process_point_obs(int i_nc) { #endif if(!nc_point_obs.open(point_obs_file_list[i_nc].c_str())) { nc_point_obs.close(); - - mlog << Warning << "\n" << method_name - << "can't open observation netCDF file: " - << point_obs_file_list[i_nc] << "\n\n"; + log_missing_file(method_name, "observation netCDF file", + point_obs_file_list[i_nc]); return; } diff --git a/src/tools/core/ensemble_stat/ensemble_stat_conf_info.cc b/src/tools/core/ensemble_stat/ensemble_stat_conf_info.cc index 8306e3f41e..7987c742de 100644 --- a/src/tools/core/ensemble_stat/ensemble_stat_conf_info.cc +++ b/src/tools/core/ensemble_stat/ensemble_stat_conf_info.cc @@ -710,25 +710,6 @@ void EnsembleStatVxOpt::process_config(GrdFileType ftype, Dictionary &fdict, vx_pd.obs_info->dump(cout); } - // Check the levels for the forecast and observation fields. If the - // forecast field is a range of pressure levels, check to see if the - // range of observation field pressure levels is wholly contained in the - // fcst levels. If not, print a warning message. - if(vx_pd.fcst_info->get_var_info()->level().type() == LevelType_Pres && - !is_eq(vx_pd.fcst_info->get_var_info()->level().lower(), vx_pd.fcst_info->get_var_info()->level().upper()) && - (vx_pd.obs_info->level().lower() < vx_pd.fcst_info->get_var_info()->level().lower() || - vx_pd.obs_info->level().upper() > vx_pd.fcst_info->get_var_info()->level().upper())) { - - mlog << Warning - << "\nEnsembleStatVxOpt::process_config() -> " - << "The range of requested observation pressure levels " - << "is not contained within the range of requested " - << "forecast pressure levels. No vertical interpolation " - << "will be performed for observations falling outside " - << "the range of forecast levels. Instead, they will be " - << "matched to the single nearest forecast level.\n\n"; - } - // No support for wind direction if(vx_pd.fcst_info->get_var_info()->is_wind_direction() || vx_pd.obs_info->is_wind_direction()) { diff --git a/src/tools/core/grid_stat/grid_stat.cc b/src/tools/core/grid_stat/grid_stat.cc index 89ac9c8385..6d8e13864d 100644 --- a/src/tools/core/grid_stat/grid_stat.cc +++ b/src/tools/core/grid_stat/grid_stat.cc @@ -192,11 +192,13 @@ static void finish_txt_files(); static void clean_up(); static void usage(); -static void set_config(const StringArray &); static void set_outdir(const StringArray &); static void set_compress(const StringArray &); static bool read_data_plane(VarInfo* info, DataPlane& dp, Met2dDataFile* mtddf, const ConcatString &filename); +#ifdef WITH_UGRID +static void set_ugrid_config(const StringArray &); +#endif //////////////////////////////////////////////////////////////////////// @@ -248,6 +250,9 @@ void process_command_line(int argc, char **argv) { // Add the options function calls cline.add(set_outdir, "-outdir", 1); cline.add(set_compress, "-compress", 1); +#ifdef WITH_UGRID + cline.add(set_ugrid_config, "-ugrid_config", 1); +#endif // Parse the command line cline.parse(); @@ -271,7 +276,9 @@ void process_command_line(int argc, char **argv) { // Read the config files conf_info.read_config(default_config_file.c_str(), config_file.c_str()); - conf_info.read_configs(config_files); +#ifdef WITH_UGRID + conf_info.read_ugrid_configs(ugrid_config_files, config_file.c_str()); +#endif // Get the forecast and observation file types from config, if present ftype = parse_conf_file_type(conf_info.conf.lookup_dictionary(conf_key_fcst)); @@ -3094,6 +3101,9 @@ void usage() { << "\tfcst_file\n" << "\tobs_file\n" << "\tconfig_file\n" +#ifdef WITH_UGRID + << "\t[-ugrid_config config_file]\n" +#endif << "\t[-outdir path]\n" << "\t[-log file]\n" << "\t[-v level]\n" @@ -3108,8 +3118,10 @@ void usage() { << "\t\t\"config_file\" is a GridStatConfig file containing " << "the desired configuration settings (required).\n" - << "\t\t\"-config config_file\" specifies additional PointStatConfig file containing " - << "the configuration settings for unstructured grid (optional).\n" +#ifdef WITH_UGRID + << "\t\t\"-ugrid_config ugrid_config_file\" is a UGridConfig file containing " + << "the desired configuration settings for unstructured grid (required only for UGrid)\n" +#endif << "\t\t\"-outdir path\" overrides the default output directory " << "(" << out_dir << ") (optional).\n" @@ -3128,10 +3140,12 @@ void usage() { //////////////////////////////////////////////////////////////////////// -void set_config(const StringArray & a) +#ifdef WITH_UGRID +void set_ugrid_config(const StringArray & a) { - config_files.add(a[0]); + ugrid_config_files.add(a[0]); } +#endif //////////////////////////////////////////////////////////////////////// diff --git a/src/tools/core/grid_stat/grid_stat.h b/src/tools/core/grid_stat/grid_stat.h index b5db513b57..ccd85c82ac 100644 --- a/src/tools/core/grid_stat/grid_stat.h +++ b/src/tools/core/grid_stat/grid_stat.h @@ -113,7 +113,7 @@ static ConcatString obs_file; // Input Config file static ConcatString config_file; -static StringArray config_files; +static StringArray ugrid_config_files; static GridStatConfInfo conf_info; // Optional arguments diff --git a/src/tools/core/grid_stat/grid_stat_conf_info.cc b/src/tools/core/grid_stat/grid_stat_conf_info.cc index d277783684..db34b15925 100644 --- a/src/tools/core/grid_stat/grid_stat_conf_info.cc +++ b/src/tools/core/grid_stat/grid_stat_conf_info.cc @@ -49,6 +49,9 @@ void GridStatConfInfo::init_from_scratch() { // Initialize pointers vx_opt = (GridStatVxOpt *) nullptr; +#ifdef WITH_UGRID + ignore_ugrid_dataset = false; +#endif clear(); return; @@ -69,7 +72,7 @@ void GridStatConfInfo::clear() { version.clear(); #ifdef WITH_UGRID ugrid_nc.clear(); - ugrid_dataset.clear(); + if (!ignore_ugrid_dataset) ugrid_dataset.clear(); ugrid_map_config.clear(); ugrid_max_distance_km = bad_data_double; #endif @@ -109,18 +112,25 @@ void GridStatConfInfo::read_config(const char *default_file_name, //////////////////////////////////////////////////////////////////////// -void GridStatConfInfo::read_configs(StringArray user_file_names) { - - const char *file_name; - for (int i=0; i " - << "The configuration file \"" << user_file_names[i]<< "\" does not exist.\n\n"; +#ifdef WITH_UGRID +void GridStatConfInfo::read_ugrid_configs(StringArray ugrid_config_names, const char * user_config) { + + ConcatString file_name; + for (int i=0; i " + << "The configuration file \"" << ugrid_config_names[i]<< "\" does not exist.\n\n"; } + if (file_exists(user_config)) conf.read(user_config); /* to avoid overriding by ugrid_config_names */ return; } +#endif //////////////////////////////////////////////////////////////////////// @@ -154,7 +164,7 @@ void GridStatConfInfo::process_config(GrdFileType ftype, #ifdef WITH_UGRID // Conf: ugrid_dataset - ugrid_dataset = parse_conf_ugrid_dataset(&conf); + if (!ignore_ugrid_dataset) ugrid_dataset = parse_conf_ugrid_dataset(&conf); // Conf: ugrid_nc ugrid_nc = parse_conf_ugrid_coordinates_file(&conf); diff --git a/src/tools/core/grid_stat/grid_stat_conf_info.h b/src/tools/core/grid_stat/grid_stat_conf_info.h index 33418fbfbb..ca529a27e1 100644 --- a/src/tools/core/grid_stat/grid_stat_conf_info.h +++ b/src/tools/core/grid_stat/grid_stat_conf_info.h @@ -284,6 +284,7 @@ class GridStatConfInfo { ConcatString output_prefix; // String to customize output file name ConcatString version; // Config file version #ifdef WITH_UGRID + bool ignore_ugrid_dataset; ConcatString ugrid_nc; // NetCDF for coordinate variables of unstructured grid ConcatString ugrid_dataset; // UGRid dataset name (mpas, lfric etc) ConcatString ugrid_map_config; // User's configuration file which contains ugrid metadata mapping @@ -299,7 +300,9 @@ class GridStatConfInfo { void clear(); void read_config (const char *, const char *); - void read_configs (StringArray user_file_names); +#ifdef WITH_UGRID + void read_ugrid_configs(StringArray ugrid_config_names, const char * user_config); +#endif void process_config(GrdFileType, GrdFileType); void process_flags (); void process_masks (const Grid &); diff --git a/src/tools/core/point_stat/point_stat.cc b/src/tools/core/point_stat/point_stat.cc index 38cbc28f40..bbfb8774d5 100644 --- a/src/tools/core/point_stat/point_stat.cc +++ b/src/tools/core/point_stat/point_stat.cc @@ -102,7 +102,8 @@ // 050 02/11/22 Halley Gotway MET #2045 Fix HiRA output. // 051 07/06/22 Howard Soh METplus-Internal #19 Rename main to met_main // 052 09/29/22 Halley Gotway MET #2286 Refine GRIB1 table lookup logic. -// 053 10/03/22 Prestopnik MET #2227 Remove using namespace netCDF from header files +// 053 10/03/22 Prestopnik MET #2227 Remove using namespace netCDF from header files. +// 054 04/29/24 Halley Gotway MET #2795 Move level mismatch warning. // //////////////////////////////////////////////////////////////////////// @@ -175,12 +176,14 @@ static void finish_txt_files(); static void clean_up(); static void usage(); -static void set_config(const StringArray &); static void set_point_obs(const StringArray &); static void set_ncfile(const StringArray &); static void set_obs_valid_beg_time(const StringArray &); static void set_obs_valid_end_time(const StringArray &); static void set_outdir(const StringArray &); +#ifdef WITH_UGRID +static void set_ugrid_config(const StringArray &); +#endif //////////////////////////////////////////////////////////////////////// @@ -240,7 +243,9 @@ void process_command_line(int argc, char **argv) { cline.set_usage(usage); // Add the options function calls - cline.add(set_config, "-config", 1); +#ifdef WITH_UGRID + cline.add(set_ugrid_config, "-ugrid_config", 1); +#endif cline.add(set_point_obs, "-point_obs", 1); cline.add(set_ncfile, "-ncfile", 1); cline.add(set_obs_valid_beg_time, "-obs_valid_beg", 1); @@ -283,7 +288,9 @@ void process_command_line(int argc, char **argv) { // Read the config files conf_info.read_config(default_config_file.c_str(), config_file.c_str()); - conf_info.read_configs(config_files); +#ifdef WITH_UGRID + conf_info.read_ugrid_configs(ugrid_config_files, config_file.c_str()); +#endif // Get the forecast file type from config, if present ftype = parse_conf_file_type(conf_info.conf.lookup_dictionary(conf_key_fcst)); @@ -600,25 +607,37 @@ void process_fcst_climo_files() { // the forecast and climatological fields for verification for(int i=0; idata_plane_array( - *conf_info.vx_opt[i].vx_pd.fcst_info, fcst_dpa); - mlog << Debug(2) - << "\n" << sep_str << "\n\n" - << "Reading data for " - << conf_info.vx_opt[i].vx_pd.fcst_info->magic_str() - << ".\n"; + n_fcst = fcst_mtddf->data_plane_array(*fcst_info, fcst_dpa); + mlog << Debug(2) << "\n" << sep_str << "\n\n" + << "Reading data for " << fcst_info->magic_str() << ".\n"; // Check for zero fields if(n_fcst == 0) { mlog << Warning << "\nprocess_fcst_climo_files() -> " - << "no fields matching " - << conf_info.vx_opt[i].vx_pd.fcst_info->magic_str() - << " found in file: " - << fcst_file << "\n\n"; + << "no fields matching " << fcst_info->magic_str() + << " found in file: " << fcst_file << "\n\n"; continue; } + // MET #2795, for multiple individual forecast levels, print a + // warning if the observations levels are not fully covered. + if(n_fcst > 1 && + !is_eq(fcst_info->level().lower(), fcst_info->level().upper()) && + (obs_info->level().lower() < fcst_info->level().lower() || + obs_info->level().upper() > fcst_info->level().upper())) { + mlog << Warning << "\nprocess_fcst_climo_files() -> " + << "The forecast level range (" << fcst_info->magic_str() + << ") does not fully contain the observation level range (" + << obs_info->magic_str() << "). No vertical interpolation " + << "will be performed for observations falling outside " + << "the range of forecast levels. Instead, they will be " + << "matched to the single nearest forecast level.\n\n"; + } + // Setup the first pass through the data if(is_first_pass) setup_first_pass(fcst_dpa[0], fcst_mtddf->grid()); @@ -626,19 +645,18 @@ void process_fcst_climo_files() { if(!(fcst_mtddf->grid() == grid)) { mlog << Debug(1) << "Regridding " << fcst_dpa.n_planes() - << " forecast field(s) for " - << conf_info.vx_opt[i].vx_pd.fcst_info->magic_str() + << " forecast field(s) for " << fcst_info->magic_str() << " to the verification grid.\n"; // Loop through the forecast fields for(j=0; jgrid(), grid, - conf_info.vx_opt[i].vx_pd.fcst_info->regrid()); + fcst_info->regrid()); } } // Rescale probabilities from [0, 100] to [0, 1] - if(conf_info.vx_opt[i].vx_pd.fcst_info->p_flag()) { + if(fcst_info->p_flag()) { for(j=0; jmagic_str() - << " found " << n_fcst << " forecast levels, " + << "For " << fcst_info->magic_str() << " found " + << n_fcst << " forecast levels, " << cmn_dpa.n_planes() << " climatology mean levels, and " << csd_dpa.n_planes() << " climatology standard deviation levels.\n"; @@ -1819,8 +1837,8 @@ void do_hira_ens(int i_vx, const PairDataPoint *pd_ptr) { conf_info.vx_opt[i_vx].hira_info.width[i], grid.wrap_lon()); if (nullptr == gt) { - mlog << Warning - << "\nPdo_hira_ens() Fail to get GridTemplate for " << i << "-th width.\n\n"; + mlog << Warning << "\ndo_hira_ens() -> " + << "failed to get GridTemplate for " << i << "-th width.\n\n"; continue; } @@ -2203,7 +2221,9 @@ void usage() { << "\tfcst_file\n" << "\tobs_file\n" << "\tconfig_file\n" - << "\t[-config config_file]\n" +#ifdef WITH_UGRID + << "\t[-ugrid_config config_file]\n" +#endif << "\t[-point_obs file]\n" << "\t[-obs_valid_beg time]\n" << "\t[-obs_valid_end time]\n" @@ -2220,8 +2240,10 @@ void usage() { << "\t\t\"config_file\" is a PointStatConfig file containing " << "the desired configuration settings (required).\n" - << "\t\t\"-config config_file\" specifies additional PointStatConfig file containing " - << "the configuration settings for unstructured grid (optional).\n" +#ifdef WITH_UGRID + << "\t\t\"-ugrid_config ugrid_config_file\" is a UGridConfig file containing " + << "the desired configuration settings for unstructured grid (required only for UGrid)\n" +#endif << "\t\t\"-point_obs file\" specifies additional NetCDF point " << "observation files to be used (optional).\n" @@ -2246,10 +2268,12 @@ void usage() { //////////////////////////////////////////////////////////////////////// -void set_config(const StringArray & a) +#ifdef WITH_UGRID +void set_ugrid_config(const StringArray & a) { - config_files.add(a[0]); + ugrid_config_files.add(a[0]); } +#endif //////////////////////////////////////////////////////////////////////// diff --git a/src/tools/core/point_stat/point_stat.h b/src/tools/core/point_stat/point_stat.h index 7d69a62b62..0804650b0a 100644 --- a/src/tools/core/point_stat/point_stat.h +++ b/src/tools/core/point_stat/point_stat.h @@ -108,7 +108,7 @@ static StringArray obs_file; // Input Config file static ConcatString config_file; -static StringArray config_files; +static StringArray ugrid_config_files; static PointStatConfInfo conf_info; // Optional arguments diff --git a/src/tools/core/point_stat/point_stat_conf_info.cc b/src/tools/core/point_stat/point_stat_conf_info.cc index ce7a0035f7..1a416fbd5a 100644 --- a/src/tools/core/point_stat/point_stat_conf_info.cc +++ b/src/tools/core/point_stat/point_stat_conf_info.cc @@ -49,6 +49,9 @@ void PointStatConfInfo::init_from_scratch() { // Initialize pointers vx_opt = (PointStatVxOpt *) nullptr; +#ifdef WITH_UGRID + ignore_ugrid_dataset = false; +#endif clear(); return; @@ -73,7 +76,7 @@ void PointStatConfInfo::clear() { version.clear(); #ifdef WITH_UGRID ugrid_nc.clear(); - ugrid_dataset.clear(); + if (!ignore_ugrid_dataset) ugrid_dataset.clear(); ugrid_map_config.clear(); ugrid_max_distance_km = bad_data_double; #endif @@ -105,18 +108,25 @@ void PointStatConfInfo::read_config(const char *default_file_name, //////////////////////////////////////////////////////////////////////// -void PointStatConfInfo::read_configs(StringArray user_file_names) { - - const char *file_name; - for (int i=0; i " - << "The configuration file \"" << user_file_names[i]<< "\" does not exist.\n\n"; +#ifdef WITH_UGRID +void PointStatConfInfo::read_ugrid_configs(StringArray ugrid_config_names, const char * user_config) { + + ConcatString file_name; + for (int i=0; i " + << "The configuration file \"" << ugrid_config_names[i]<< "\" does not exist.\n\n"; } + if (file_exists(user_config)) conf.read(user_config); /* to avoid overriding by ugrid_config_names */ return; } +#endif //////////////////////////////////////////////////////////////////////// @@ -143,7 +153,7 @@ void PointStatConfInfo::process_config(GrdFileType ftype) { #ifdef WITH_UGRID // Conf: ugrid_dataset - ugrid_dataset = parse_conf_ugrid_dataset(&conf); + if (!ignore_ugrid_dataset) ugrid_dataset = parse_conf_ugrid_dataset(&conf); // Conf: ugrid_nc ugrid_nc = parse_conf_ugrid_coordinates_file(&conf); @@ -841,25 +851,6 @@ void PointStatVxOpt::process_config(GrdFileType ftype, vx_pd.obs_info->dump(cout); } - // Check the levels for the forecast and observation fields. If the - // forecast field is a range of pressure levels, check to see if the - // range of observation field pressure levels is wholly contained in the - // fcst levels. If not, print a warning message. - if(vx_pd.fcst_info->level().type() == LevelType_Pres && - !is_eq(vx_pd.fcst_info->level().lower(), vx_pd.fcst_info->level().upper()) && - (vx_pd.obs_info->level().lower() < vx_pd.fcst_info->level().lower() || - vx_pd.obs_info->level().upper() > vx_pd.fcst_info->level().upper())) { - - mlog << Warning - << "\nPointStatVxOpt::process_config() -> " - << "The range of requested observation pressure levels " - << "is not contained within the range of requested " - << "forecast pressure levels. No vertical interpolation " - << "will be performed for observations falling outside " - << "the range of forecast levels. Instead, they will be " - << "matched to the single nearest forecast level.\n\n"; - } - // No support for wind direction if(vx_pd.fcst_info->is_wind_direction() || vx_pd.obs_info->is_wind_direction()) { diff --git a/src/tools/core/point_stat/point_stat_conf_info.h b/src/tools/core/point_stat/point_stat_conf_info.h index 5e3db2184a..befde20349 100644 --- a/src/tools/core/point_stat/point_stat_conf_info.h +++ b/src/tools/core/point_stat/point_stat_conf_info.h @@ -247,6 +247,7 @@ class PointStatConfInfo { ConcatString output_prefix; // String to customize output file name ConcatString version; // Config file version #ifdef WITH_UGRID + bool ignore_ugrid_dataset; ConcatString ugrid_nc; // NetCDF for coordinate variables of unstructured grid ConcatString ugrid_dataset; // UGRid dataset name (mpas, lfric etc) ConcatString ugrid_map_config; // User's configuration file which contains ugrid metadata mapping @@ -261,7 +262,9 @@ class PointStatConfInfo { void clear(); void read_config(const char *, const char *); - void read_configs(StringArray user_file_names); +#ifdef WITH_UGRID + void read_ugrid_configs(StringArray ugrid_config_names, const char * user_config); +#endif void process_config(GrdFileType); void process_grib_codes(); diff --git a/src/tools/other/gen_ens_prod/gen_ens_prod.cc b/src/tools/other/gen_ens_prod/gen_ens_prod.cc index 4de6c2b2b8..46ad8b66df 100644 --- a/src/tools/other/gen_ens_prod/gen_ens_prod.cc +++ b/src/tools/other/gen_ens_prod/gen_ens_prod.cc @@ -20,10 +20,10 @@ // 003 02/17/22 Halley Gotway MET #1918 Add normalize config option. // 004 07/06/22 Howard Soh METplus-Internal #19 Rename main to met_main // 005 10/03/22 Prestopnik MET #2227 Remove using namespace std and netCDF from header files +// 006 04/29/24 Halley Gotway MET #2870 Ignore MISSING keyword. // //////////////////////////////////////////////////////////////////////// - #include #include #include @@ -53,7 +53,6 @@ using namespace std; using namespace netCDF; - //////////////////////////////////////////////////////////////////////// static void process_command_line(int, char **); @@ -111,19 +110,17 @@ int met_main(int argc, char *argv[]) { //////////////////////////////////////////////////////////////////////// - const string get_tool_name() { return "gen_ens_prod"; } - //////////////////////////////////////////////////////////////////////// void process_command_line(int argc, char **argv) { int i; CommandLine cline; ConcatString default_config_file; - Met2dDataFile *ens_mtddf = (Met2dDataFile *) nullptr; + const char *method_name = "process_command_line() -> "; // // Check for zero arguments @@ -159,19 +156,19 @@ void process_command_line(int argc, char **argv) { // Check that the required arguments have been set n_ens_files = ens_files.n(); if(n_ens_files == 0) { - mlog << Error << "\nprocess_command_line() -> " + mlog << Error << "\n" << method_name << "the ensemble file list must be set using the " << "\"-ens\" option.\n\n"; exit(1); } if(out_file.length() == 0) { - mlog << Error << "\nprocess_command_line() -> " + mlog << Error << "\n" << method_name << "the output file must be set using the " << "\"-out\" option.\n\n"; exit(1); } if(config_file.length() == 0) { - mlog << Error << "\nprocess_command_line() -> " + mlog << Error << "\n" << method_name << "the configuration file must be set using the " << "\"-config\" option.\n\n"; exit(1); @@ -191,15 +188,18 @@ void process_command_line(int argc, char **argv) { // Get the ensemble file type from config, if present etype = parse_conf_file_type(conf_info.conf.lookup_dictionary(conf_key_ens)); - // Read the first input ensemble file - if(!(ens_mtddf = mtddf_factory.new_met_2d_data_file(ens_files[0].c_str(), etype))) { - mlog << Error << "\nprocess_command_line() -> " - << "trouble reading ensemble file \"" << ens_files[0] << "\"\n\n"; - exit(1); + // Get the ensemble file type from the files + if(etype == FileType_None) { + etype = parse_file_list_type(ens_files); } - // Store the input ensemble file type - etype = ens_mtddf->file_type(); + // UGrid not supported + if(etype == FileType_UGrid) { + mlog << Error << "\n" << method_name + << grdfiletype_to_string(etype) + << " ensemble files are not supported\n\n"; + exit(1); + } // Process the configuration conf_info.process_config(etype, &ens_files, ctrl_file.nonempty()); @@ -225,7 +225,7 @@ void process_command_line(int argc, char **argv) { // Check for control in the list of ensemble files if(ctrl_file.nonempty() && ens_files.has(ctrl_file) && n_ens_files != 1) { - mlog << Error << "\nprocess_command_line() -> " + mlog << Error << "\n" << method_name << "the ensemble control file should not appear in the list " << "of ensemble member files:\n" << ctrl_file << "\n\n"; exit(1); @@ -235,9 +235,7 @@ void process_command_line(int argc, char **argv) { for(i=0; i " - << "cannot open input ensemble file: " - << ens_files[i] << "\n\n"; + log_missing_file(method_name, "input ensemble file", ens_files[i]); ens_file_vld.add(0); } else { @@ -246,14 +244,11 @@ void process_command_line(int argc, char **argv) { } if(conf_info.control_id.nonempty() && ctrl_file.empty()) { - mlog << Warning << "\nprocess_command_line() -> " + mlog << Warning << "\n" << method_name << "control_id is set in the config file but " << "control file is not provided with -ctrl argument\n\n"; } - // Deallocate memory for data files - if(ens_mtddf) { delete ens_mtddf; ens_mtddf = (Met2dDataFile *) nullptr; } - return; }