diff --git a/internal/scripts/environment/development.docker b/internal/scripts/environment/development.docker index 87f4f9cd0a..2ebb0a5d34 100644 --- a/internal/scripts/environment/development.docker +++ b/internal/scripts/environment/development.docker @@ -11,7 +11,7 @@ export MET_PYTHON_BIN_EXE=${MET_PYTHON}/bin/python3 export MET_PYTHON_CC="-I${MET_PYTHON}/include/python3.10" export MET_PYTHON_LD="-L${MET_PYTHON}/lib -lpython3.10 -lcrypt -lpthread -ldl -lutil -lm" -export CFLAGS="-DUNDERSCORE -fPIC -g" +export CFLAGS="-DUNDERSCORE -fPIC" export CXXFLAGS=${CFLAGS} # Set LDFLAGS to include -rpath settings when compiling MET @@ -47,4 +47,4 @@ export SQLITE_INCLUDE_DIR=/usr/include export SQLITE_LIB_DIR=/usr/lib/x86_64-linux-gnu export BUFRLIB_NAME="-lbufr_4" -export GRIB2CLIB_NAME="-lg2c" \ No newline at end of file +export GRIB2CLIB_NAME="-lg2c" diff --git a/internal/test_unit/unit_test.log b/internal/test_unit/unit_test.log deleted file mode 100644 index ef1c7b19b5..0000000000 --- a/internal/test_unit/unit_test.log +++ /dev/null @@ -1,1225 +0,0 @@ -export MET_BASE=/d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/../../share/met -export MET_BUILD_BASE=/d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/../.. -export MET_TEST_BASE=/d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit -export MET_TEST_INPUT=/d1/projects/MET/MET_test_data/unit_test -export MET_TEST_OUTPUT=/d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/../../test_output - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_ascii2nc.xml - -TEST: ascii2nc_TRMM_3hr - - pass - 17.767 sec -TEST: ascii2nc_GAGE_24hr - - pass - 1.165 sec -TEST: ascii2nc_GAGE_24hr_badfile - - pass - 0.53 sec -TEST: ascii2nc_duplicates - - pass - 0.532 sec -TEST: ascii2nc_SURFRAD1 - - pass - 0.975 sec -TEST: ascii2nc_insitu_turb - - pass - 3.119 sec -TEST: ascii2nc_by_var_name_PB - - pass - 146.208 sec -TEST: ascii2nc_rain_01H_sum - - pass - 0.582 sec -TEST: ascii2nc_airnow_daily_v2 - - pass - 0.799 sec -TEST: ascii2nc_airnow_hourly_aqobs - - pass - 0.886 sec -TEST: ascii2nc_airnow_hourly - - pass - 3.847 sec -TEST: ascii2nc_ndbc - - pass - 8.243 sec -TEST: ascii2nc_ismn_SNOTEL - - pass - 14.834 sec -TEST: ascii2nc_iabp - - pass - 0.542 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_ascii2nc_indy.xml - -TEST: ascii2nc_TRMM_12hr - - pass - 20.969 sec -TEST: ascii2nc_LITTLE_R - - pass - 0.605 sec -TEST: ascii2nc_LITTLE_R_BAD_RECORD - - pass - 0.551 sec -TEST: ascii2nc_SURFRAD - - pass - 0.976 sec -TEST: ascii2nc_SURFRAD_summary1 - - pass - 2.007 sec -TEST: ascii2nc_SURFRAD_summary2 - - pass - 1.483 sec -TEST: ascii2nc_SURFRAD_summary3 - - pass - 1.224 sec -TEST: ascii2nc_SURFRAD_summary4 - - pass - 1.205 sec -TEST: ascii2nc_insitu_turb_mask_sid - - pass - 1.241 sec -TEST: ascii2nc_insitu_turb_mask_grid_data - - pass - 2.994 sec -TEST: ascii2nc_insitu_turb_mask_named_grid - - pass - 2.963 sec -TEST: ascii2nc_MASK_GRID - - pass - 3.539 sec -TEST: ascii2nc_MASK_POLY - - pass - 1.298 sec -TEST: ascii2nc_WWSIS_clear_pvwatts_one_min - - pass - 18.383 sec -TEST: ascii2nc_WWSIS_clear_pvwatts_five_min - - pass - 2.641 sec -TEST: ascii2nc_WWSIS_clear_pvwatts_ten_min - - pass - 1.509 sec -TEST: ascii2nc_WWSIS_clear_pvwatts_sixty_min - - pass - 0.694 sec -TEST: ascii2nc_WWSIS_HA_pvwatts_sixty_min - - pass - 0.735 sec -TEST: ascii2nc_WWSIS_pvwatts_one_min - - pass - 18.646 sec -TEST: ascii2nc_WWSIS_pvwatts_sixty_min - - pass - 0.7 sec -TEST: ascii2nc_by_var_name - - pass - 0.534 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_madis2nc.xml - -TEST: madis2nc_METAR - - pass - 12.385 sec -TEST: madis2nc_METAR_time_summary - - pass - 16.391 sec -TEST: madis2nc_METAR_mask_sid - - pass - 0.608 sec -TEST: madis2nc_METAR_mask_grid - - pass - 1.052 sec -TEST: madis2nc_RAOB - - pass - 3.295 sec -TEST: madis2nc_PROFILER_MASK_POLY - - pass - 0.57 sec -TEST: madis2nc_MARITIME - - pass - 0.811 sec -TEST: madis2nc_MESONET_MASK_GRID - - pass - 6.653 sec -TEST: madis2nc_MESONET_optional_vars - - pass - 4.856 sec -TEST: madis2nc_ACARS_PROFILES - - pass - 2.095 sec -TEST: madis2nc_buf_handle - - pass - 2.626 sec -TEST: madis2nc_multiple_inputs - - pass - 2.167 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_trmm2nc.xml - -TEST: trmm2nc_3hr - - pass - 0.334 sec -TEST: trmm2nc_12hr - - pass - 0.331 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_pb2nc.xml - -TEST: pb2nc_GDAS_mask_grid_G212 - - pass - 8.247 sec -TEST: pb2nc_NDAS_no_mask - - pass - 9.265 sec -TEST: pb2nc_NDAS_mask_poly_conus - - pass - 3.676 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_pb2nc_indy.xml - -TEST: pb2nc_NDAS_mask_sid_list - - pass - 1.602 sec -TEST: pb2nc_NDAS_mask_sid_file - - pass - 1.765 sec -TEST: pb2nc_NDAS_mask_grid_data_cfg - - pass - 4.469 sec -TEST: pb2nc_compute_pbl_cape - - pass - 13.715 sec -TEST: pb2nc_NDAS_var_all - - pass - 19.439 sec -TEST: pb2nc_vertical_level_500 - - pass - 1.392 sec -TEST: pb2nc_NDAS_summary - - pass - 6.866 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_gen_vx_mask.xml - -TEST: gen_vx_mask_POLY_GFS_LATLON - - pass - 11.973 sec -TEST: gen_vx_mask_POLY_GFS_MERCATOR - - pass - 0.607 sec -TEST: gen_vx_mask_POLY_NAM_LAMBERT - - pass - 4.092 sec -TEST: gen_vx_mask_POLY_HMT_STEREO - - pass - 1.026 sec -TEST: gen_vx_mask_POLY_GFS_LATLON_NAK - - pass - 1.476 sec -TEST: gen_vx_mask_POLY_LATLON_RECTANGLE - - pass - 0.552 sec -TEST: gen_vx_mask_POLY_XY_RECTANGLE - - pass - 0.544 sec -TEST: gen_vx_mask_GRID_NAM_HMT_STEREO - - pass - 0.732 sec -TEST: gen_vx_mask_GRID_NAMED_GRIDS - - pass - 0.618 sec -TEST: gen_vx_mask_GRID_SPEC_STRINGS - - pass - 0.598 sec -TEST: gen_vx_mask_CIRCLE - - pass - 0.685 sec -TEST: gen_vx_mask_CIRCLE_MASK - - pass - 0.642 sec -TEST: gen_vx_mask_CIRCLE_COMPLEMENT - - pass - 0.649 sec -TEST: gen_vx_mask_TRACK - - pass - 1.096 sec -TEST: gen_vx_mask_TRACK_MASK - - pass - 1.098 sec -TEST: gen_vx_mask_DATA_APCP_24 - - pass - 1.067 sec -TEST: gen_vx_mask_POLY_PASS_THRU - - pass - 0.633 sec -TEST: gen_vx_mask_POLY_INTERSECTION - - pass - 0.633 sec -TEST: gen_vx_mask_POLY_UNION - - pass - 0.634 sec -TEST: gen_vx_mask_POLY_SYMDIFF - - pass - 0.627 sec -TEST: gen_vx_mask_DATA_INPUT_FIELD - - pass - 1.211 sec -TEST: gen_vx_mask_BOX - - pass - 0.536 sec -TEST: gen_vx_mask_SOLAR_ALT - - pass - 0.557 sec -TEST: gen_vx_mask_SOLAR_AZI - - pass - 0.673 sec -TEST: gen_vx_mask_LAT - - pass - 0.543 sec -TEST: gen_vx_mask_LON - - pass - 0.548 sec -TEST: gen_vx_mask_SHAPE - - pass - 0.549 sec -TEST: gen_vx_mask_SHAPE_STR - - pass - 0.695 sec -TEST: gen_vx_mask_SHAPE_STR_MULTI - - pass - 0.605 sec -TEST: gen_vx_mask_PYTHON - - pass - 1.605 sec -TEST: gen_vx_mask_DATA_TWO_FILE_TYPES - - pass - 1.22 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_gen_ens_prod.xml - -TEST: gen_ens_prod_NO_CTRL - - pass - 9.428 sec -TEST: gen_ens_prod_WITH_CTRL - - pass - 8.858 sec -TEST: gen_ens_prod_SINGLE_FILE_NC_NO_CTRL - - pass - 1.23 sec -TEST: gen_ens_prod_SINGLE_FILE_NC_WITH_CTRL - - pass - 1.144 sec -TEST: gen_ens_prod_SINGLE_FILE_GRIB_NO_CTRL - - pass - 1.206 sec -TEST: gen_ens_prod_SINGLE_FILE_GRIB_WITH_CTRL - - pass - 1.213 sec -TEST: gen_ens_prod_NORMALIZE - - pass - 6.058 sec -TEST: gen_ens_prod_CLIMO_ANOM_ENS_MEMBER_ID - - pass - 0.88 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_pcp_combine.xml - -TEST: pcp_combine_sum_GRIB1 - - pass - 28.664 sec -TEST: pcp_combine_sum_GRIB1_MISSING - - pass - 14.362 sec -TEST: pcp_combine_sum_GRIB1_MULTIPLE_FIELDS - - pass - 42.993 sec -TEST: pcp_combine_sum_GRIB2 - - pass - 1.445 sec -TEST: pcp_combine_add_GRIB1 - - pass - 1.686 sec -TEST: pcp_combine_add_GRIB2 - - pass - 0.601 sec -TEST: pcp_combine_add_STAGEIV - - pass - 1.207 sec -TEST: pcp_combine_add_ACCUMS - - pass - 1.414 sec -TEST: pcp_combine_sub_GRIB1 - - pass - 1.089 sec -TEST: pcp_combine_sub_GRIB1_run2 - - pass - 0.675 sec -TEST: pcp_combine_sub_GRIB2 - - pass - 0.553 sec -TEST: pcp_combine_sub_NC_MET_06 - - pass - 0.631 sec -TEST: pcp_combine_sub_P_INTERP - - pass - 0.811 sec -TEST: pcp_combine_add_VARNAME - - pass - 0.891 sec -TEST: pcp_combine_sub_DIFFERENT_INIT - - pass - 0.669 sec -TEST: pcp_combine_sub_NEGATIVE_ACCUM - - pass - 0.694 sec -TEST: pcp_combine_sub_SUBTRACT_MULTIPLE_FIELDS - - pass - 1.045 sec -TEST: pcp_combine_derive_LIST_OF_FILES - - pass - 1.104 sec -TEST: pcp_combine_derive_MULTIPLE_FIELDS - - pass - 3.137 sec -TEST: pcp_combine_derive_VLD_THRESH - - pass - 1.208 sec -TEST: pcp_combine_derive_CUSTOM_NAMES - - pass - 0.747 sec -TEST: pcp_combine_sub_ROT_LL - - pass - 1.096 sec -TEST: pcp_combine_LAEA_GRIB2 - - pass - 1.428 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_wwmca_regrid.xml - -TEST: wwmca_regrid_G003_NO_AGE - - pass - 2.472 sec -TEST: wwmca_regrid_G003_AGE_60 - - pass - 1.532 sec -TEST: wwmca_regrid_G003_AGE_120 - - pass - 1.531 sec -TEST: wwmca_regrid_G003_AGE_240 - - pass - 1.575 sec -TEST: wwmca_regrid_G003_WRITE_PIXEL_AGE - - pass - 1.547 sec -TEST: wwmca_regrid_GFS_LATLON - - pass - 4.694 sec -TEST: wwmca_regrid_GFS_MERCATOR - - pass - 0.699 sec -TEST: wwmca_regrid_NAM_LAMBERT - - pass - 5.288 sec -TEST: wwmca_regrid_HMT_STEREO - - pass - 0.963 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_point_stat.xml - -TEST: point_stat_GRIB1_NAM_GDAS - - pass - 49.029 sec -TEST: point_stat_GRIB1_NAM_GDAS_WINDS - - pass - 11.773 sec -TEST: point_stat_GRIB1_NAM_GDAS_MASK_SID - - pass - 43.827 sec -TEST: point_stat_GRIB2_NAM_NDAS - - pass - 36.403 sec -TEST: point_stat_GRIB2_SREF_GDAS - - pass - 28.574 sec -TEST: point_stat_GRIB1_NAM_TRMM - - pass - 15.594 sec -TEST: point_stat_GRIB2_SREF_TRMM - - pass - 15.265 sec -TEST: point_stat_NCMET_NAM_HMTGAGE - - pass - 1.756 sec -TEST: point_stat_NCMET_NAM_NDAS_SEEPS - - pass - 9.972 sec -TEST: point_stat_NCPINT_TRMM - - pass - 15.005 sec -TEST: point_stat_NCPINT_NDAS - - pass - 7.636 sec -TEST: point_stat_GRIB2_SREF_TRMM_prob - - pass - 2.426 sec -TEST: point_stat_GTG_lc - - pass - 60.144 sec -TEST: point_stat_GTG_latlon - - pass - 43.921 sec -TEST: point_stat_SID_INC_EXC - - pass - 6.573 sec -TEST: point_stat_SID_INC_EXC_CENSOR - - pass - 7.393 sec -TEST: point_stat_GRIB1_NAM_GDAS_INTERP_OPTS - - pass - 5.202 sec -TEST: point_stat_GRIB1_NAM_GDAS_INTERP_OPTS_name - - pass - 20.228 sec -TEST: point_stat_LAND_TOPO_MASK - - pass - 36.319 sec -TEST: point_stat_MPR_THRESH - - pass - 57.575 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_stat_analysis_ps.xml - -TEST: stat_analysis_CONFIG_POINT_STAT - - pass - 44.426 sec -TEST: stat_analysis_POINT_STAT_SUMMARY - - pass - 34.47 sec -TEST: stat_analysis_POINT_STAT_SUMMARY_UNION - - pass - 19.293 sec -TEST: stat_analysis_POINT_STAT_FILTER_OBS_SID - - pass - 1.695 sec -TEST: stat_analysis_POINT_STAT_FILTER_TIMES - - pass - 8.536 sec -TEST: stat_analysis_POINT_STAT_SEEPS - - pass - 3.168 sec -TEST: stat_analysis_RAMPS - - pass - 3.089 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_duplicate_flag.xml - -TEST: point_stat_DUP_NONE - - pass - 0.694 sec -TEST: point_stat_DUP_UNIQUE - - pass - 0.679 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_obs_summary.xml - -TEST: ascii2nc_obs_summary - - pass - 0.571 sec -TEST: point_stat_OS_NONE - - pass - 0.684 sec -TEST: point_stat_OS_NEAREST - - pass - 0.728 sec -TEST: point_stat_OS_MIN - - pass - 0.676 sec -TEST: point_stat_OS_MAX - - pass - 0.686 sec -TEST: point_stat_OS_UW_MEAN - - pass - 0.681 sec -TEST: point_stat_OS_DW_MEAN - - pass - 0.676 sec -TEST: point_stat_OS_MEDIAN - - pass - 0.677 sec -TEST: point_stat_OS_PERC - - pass - 0.682 sec -TEST: point_stat_OS_UNIQUE_ALL - - pass - 1.406 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_grid_stat.xml - -TEST: grid_stat_GRIB_lvl_typ_val - - pass - 102.432 sec -TEST: grid_stat_GRIB_set_attr - - pass - 26.404 sec -TEST: grid_stat_GRIB2_NAM_RTMA - - pass - 21.167 sec -TEST: grid_stat_GRIB2_NAM_RTMA_NP2 - - pass - 19.316 sec -TEST: grid_stat_GRIB1_NAM_STAGE4 - - pass - 35.211 sec -TEST: grid_stat_GRIB1_NAM_STAGE4_CENSOR - - pass - 3.779 sec -TEST: grid_stat_GTG_lc - - pass - 2.261 sec -TEST: grid_stat_GTG_latlon - - pass - 3.405 sec -TEST: grid_stat_GRIB2_SREF_STAGE4_prob_as_scalar - - pass - 2.357 sec -TEST: grid_stat_APPLY_MASK_TRUE - - pass - 5.515 sec -TEST: grid_stat_APPLY_MASK_FALSE - - pass - 5.392 sec -TEST: grid_stat_GFS_FOURIER - - pass - 8.642 sec -TEST: grid_stat_MPR_THRESH - - pass - 59.558 sec -TEST: grid_stat_UK_SEEPS - - pass - 4.344 sec -TEST: grid_stat_WRF_pres - - pass - 1.113 sec -TEST: grid_stat_GEN_ENS_PROD - - pass - 3.09 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_stat_analysis_gs.xml - -TEST: stat_analysis_CONFIG_GRID_STAT - - pass - 0.878 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_wavelet_stat.xml - -TEST: wavelet_stat_GRIB1_NAM_STAGE4 - - pass - 27.062 sec -TEST: wavelet_stat_GRIB1_NAM_STAGE4_NO_THRESH - - pass - 15.383 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_stat_analysis_ws.xml - -TEST: stat_analysis_AGG_ISC - - pass - 0.64 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_ensemble_stat.xml - -TEST: ensemble_stat_CMD_LINE - - pass - 5.766 sec -TEST: ensemble_stat_FILE_LIST - - pass - 5.425 sec -TEST: ensemble_stat_MASK_SID - - pass - 1.392 sec -TEST: ensemble_stat_MASK_SID_CTRL - - pass - 1.345 sec -TEST: ensemble_stat_MASK_SID_CENSOR - - pass - 1.732 sec -TEST: ensemble_stat_SKIP_CONST - - pass - 5.18 sec -TEST: ensemble_stat_OBSERR - - pass - 13.099 sec -TEST: ensemble_stat_SINGLE_FILE_NC_NO_CTRL - - pass - 3.044 sec -TEST: ensemble_stat_SINGLE_FILE_NC_WITH_CTRL - - pass - 3.158 sec -TEST: ensemble_stat_SINGLE_FILE_GRIB_NO_CTRL - - pass - 2.072 sec -TEST: ensemble_stat_SINGLE_FILE_GRIB_WITH_CTRL - - pass - 2.109 sec -TEST: ensemble_stat_RPS_CLIMO_BIN_PROB - - pass - 0.581 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_stat_analysis_es.xml - -TEST: stat_analysis_AGG_RHIST - - pass - 0.843 sec -TEST: stat_analysis_AGG_PHIST - - pass - 0.843 sec -TEST: stat_analysis_AGG_RELP - - pass - 1.007 sec -TEST: stat_analysis_AGG_ECNT - - pass - 1.031 sec -TEST: stat_analysis_AGG_STAT_ORANK_RHIST_PHIST - - pass - 5.348 sec -TEST: stat_analysis_AGG_STAT_ORANK_RELP - - pass - 4.691 sec -TEST: stat_analysis_AGG_STAT_ORANK_SSVAR - - pass - 5.3 sec -TEST: stat_analysis_AGG_STAT_ORANK_ECNT - - pass - 11.662 sec -TEST: stat_analysis_AGG_SSVAR - - pass - 1.132 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_mode.xml - -TEST: mode_NO_MATCH_MERGE - - pass - 2.319 sec -TEST: mode_NO_MERGE - - pass - 1.94 sec -TEST: mode_MERGE_BOTH - - pass - 3.724 sec -TEST: mode_MASK_POLY - - pass - 1.96 sec -TEST: mode_QUILT - - pass - 5.595 sec -TEST: mode_CONFIG_MERGE - - pass - 3.549 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_mode_multivar.xml - -TEST: mode_multivar_snow - - pass - 36.544 sec -TEST: mode_multivar_snow_3_2 - - pass - 19.229 sec -TEST: mode_multivar_snow_super - - pass - 31.774 sec -TEST: mode_multivar_FAKE_DATA - - pass - 4.152 sec -TEST: mode_multivar_FAKE_DATA_with_intensities - - pass - 6.589 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_mode_analysis.xml - -TEST: mode_analysis_BYCASE_SIMPLE - - pass - 0.758 sec -TEST: mode_analysis_BYCASE_CLUSTER - - pass - 0.55 sec -TEST: mode_analysis_MET-644_LOOKIN_BY_DIR - - pass - 0.593 sec -TEST: mode_analysis_MET-644_LOOKIN_BY_FILE - - pass - 0.553 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_plot_point_obs.xml - -TEST: plot_point_obs_G218 - - pass - 4.803 sec -TEST: plot_point_obs_TMP_ADPUPA - - pass - 4.345 sec -TEST: plot_point_obs_CONFIG - - pass - 4.309 sec -TEST: plot_point_obs_CONFIG_REGRID - - pass - 4.069 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_plot_data_plane.xml - -TEST: plot_data_plane_GRIB1 - - pass - 1.385 sec -TEST: plot_data_plane_GRIB1_REC - - pass - 0.934 sec -TEST: plot_data_plane_GRIB1_CODE - - pass - 0.916 sec -TEST: plot_data_plane_GRIB1_ENS - - pass - 0.825 sec -TEST: plot_data_plane_GRIB1_ENS_HI - - pass - 0.793 sec -TEST: plot_data_plane_GRIB1_rotlatlon - - pass - 0.721 sec -TEST: plot_data_plane_GRIB2 - - pass - 0.858 sec -TEST: plot_data_plane_GRIB2_ENS - - pass - 0.715 sec -TEST: plot_data_plane_GRIB2_ENS_LOW - - pass - 0.725 sec -TEST: plot_data_plane_GRIB2_PROB - - pass - 0.645 sec -TEST: plot_data_plane_NC_PINTERP - - pass - 0.755 sec -TEST: plot_data_plane_NC_MET - - pass - 0.804 sec -TEST: plot_data_plane_NCCF_lc_0 - - pass - 0.746 sec -TEST: plot_data_plane_NCCF_lc_25 - - pass - 0.815 sec -TEST: plot_data_plane_NCCF_lc_50 - - pass - 0.802 sec -TEST: plot_data_plane_NCCF_latlon_0 - - pass - 1.003 sec -TEST: plot_data_plane_NCCF_latlon_12 - - pass - 0.976 sec -TEST: plot_data_plane_NCCF_latlon_25 - - pass - 0.976 sec -TEST: plot_data_plane_NCCF_latlon_by_value - - pass - 0.956 sec -TEST: plot_data_plane_NCCF_north_to_south - - pass - 4.35 sec -TEST: plot_data_plane_NCCF_time - - pass - 0.681 sec -TEST: plot_data_plane_NCCF_time_int64 - - pass - 0.73 sec -TEST: plot_data_plane_NCCF_rotlatlon - - pass - 0.934 sec -TEST: plot_data_plane_TRMM_3B42_3hourly_nc - - pass - 1.041 sec -TEST: plot_data_plane_TRMM_3B42_daily_nc - - pass - 1.233 sec -TEST: plot_data_plane_TRMM_3B42_daily_packed - - pass - 1.209 sec -TEST: plot_data_plane_TRMM_3B42_daily_packed_CONVERT - - pass - 1.71 sec -TEST: plot_data_plane_EaSM_CMIP5_rcp85 - - pass - 0.752 sec -TEST: plot_data_plane_EaSM_CMIP5_rcp85_time_slice - - pass - 0.76 sec -TEST: plot_data_plane_EaSM_CESM - - pass - 0.771 sec -TEST: plot_data_plane_GRIB2_NBM_CWASP_L0 - - pass - 3.072 sec -TEST: plot_data_plane_GRIB2_NBM_CWASP_PERC_5 - - pass - 3.146 sec -TEST: plot_data_plane_GRIB2_NBM_CWASP_PROB_50 - - pass - 2.262 sec -TEST: plot_data_plane_GRIB2_NBM_WETBT_MIXED_LEVELS - - pass - 3.377 sec -TEST: plot_data_plane_GRIB2_NBM_FICEAC_A48_PERC_10 - - pass - 2.102 sec -TEST: plot_data_plane_LAEA_GRIB2 - - pass - 1.631 sec -TEST: plot_data_plane_LAEA_NCCF - - pass - 1.595 sec -TEST: plot_data_plane_LAEA_MET_NC - - pass - 1.634 sec -TEST: plot_data_plane_NCCF_POLAR_STEREO - - pass - 1.747 sec -TEST: plot_data_plane_NCCF_POLAR_ELLIPSOIDAL - - pass - 0.719 sec -TEST: plot_data_plane_GRIB2_TABLE_4.48 - - pass - 1.514 sec -TEST: plot_data_plane_WRF_west_east_stag - - pass - 0.864 sec -TEST: plot_data_plane_WRF_south_north_stag - - pass - 0.863 sec -TEST: plot_data_plane_WRF_num_press_levels_stag - - pass - 0.761 sec -TEST: plot_data_plane_WRF_num_z_levels_stag - - pass - 0.741 sec -TEST: plot_data_plane_WRF_bottom_top - - pass - 0.866 sec -TEST: plot_data_plane_WRF_bottom_top_stag - - pass - 0.852 sec -TEST: plot_data_plane_set_attr_grid - - pass - 14.222 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_wwmca_plot.xml - -TEST: wwmca_plot_NH_SH_AGE_240 - - pass - 2.607 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_series_analysis.xml - -TEST: series_analysis_CMD_LINE - - pass - 8.969 sec -TEST: series_analysis_AGGR_CMD_LINE - - pass - 10.585 sec -TEST: series_analysis_FILE_LIST - - pass - 6.317 sec -TEST: series_analysis_AGGR_FILE_LIST - - pass - 7.913 sec -TEST: series_analysis_UPPER_AIR - - pass - 3.876 sec -TEST: series_analysis_CONDITIONAL - - pass - 3.963 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_tc_dland.xml - -TEST: tc_dland_ONE_DEG - - pass - 17.215 sec -TEST: tc_dland_HALF_DEG - - pass - 65.738 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_tc_pairs.xml - -TEST: tc_pairs_ALAL2010 - - pass - 2.412 sec -TEST: tc_pairs_CONSENSUS - - pass - 5.688 sec -TEST: tc_pairs_INTERP12_FILL - - pass - 0.923 sec -TEST: tc_pairs_INTERP12_REPLACE - - pass - 0.938 sec -TEST: tc_pairs_PROBRIRW - - pass - 2.656 sec -TEST: tc_pairs_BASIN_MAP - - pass - 2.661 sec -TEST: tc_pairs_LEAD_REQ - - pass - 1.023 sec -TEST: tc_pairs_WRITE_VALID - - pass - 0.741 sec -TEST: tc_pairs_WRITE_VALID_PROBRIRW - - pass - 2.105 sec -TEST: tc_pairs_DIAGNOSTICS - - pass - 0.932 sec -TEST: tc_pairs_DIAGNOSTICS_CONSENSUS - - pass - 5.124 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_tc_stat.xml - -TEST: tc_stat_ALAL2010 - - pass - 24.263 sec -TEST: tc_stat_FILTER_STRINGS - - pass - 2.475 sec -TEST: tc_stat_PROBRIRW - - pass - 40.831 sec -TEST: tc_stat_LEAD_REQ - - pass - 1.483 sec -TEST: tc_stat_FALSE_ALARMS - - pass - 2.438 sec -TEST: tc_stat_DIAGNOSTICS - - pass - 7.112 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_plot_tc.xml - -TEST: plot_tc_TCMPR - - pass - 9.155 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_tc_rmw.xml - -TEST: tc_rmw_PRESSURE_LEV_OUT - - pass - 39.751 sec -TEST: tc_rmw_GONZALO - - pass - 9.403 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_rmw_analysis.xml - -TEST: rmw_analysis - - pass - 1.61 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_tc_diag.xml - -TEST: tc_diag_IAN - - pass - 117.499 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_tc_gen.xml - -TEST: tc_gen_2016 - - pass - 94.491 sec -TEST: tc_gen_prob - - pass - 1.05 sec -TEST: tc_gen_2021_shape - - pass - 9.322 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_met_test_scripts.xml - -TEST: test_all_gen_vx_mask_1 - - pass - 1.263 sec -TEST: test_all_gen_vx_mask_2 - - pass - 1.054 sec -TEST: test_all_gen_ens_prod - - pass - 1.72 sec -TEST: test_all_pcp_combine_1 - - pass - 1.855 sec -TEST: test_all_pcp_combine_2 - - pass - 3.97 sec -TEST: test_all_pcp_combine_3 - - pass - 5.307 sec -TEST: test_all_pcp_combine_4 - - pass - 1.066 sec -TEST: test_all_pcp_combine_5 - - pass - 1.075 sec -TEST: test_all_pcp_combine_6 - - pass - 1.563 sec -TEST: test_all_mode_1 - - pass - 2.505 sec -TEST: test_all_mode_2 - - pass - 2.463 sec -TEST: test_all_mode_3 - - pass - 3.169 sec -TEST: test_all_grid_stat_1 - - pass - 2.189 sec -TEST: test_all_grid_stat_2 - - pass - 0.646 sec -TEST: test_all_grid_stat_3 - - pass - 1.26 sec -TEST: test_all_grid_stat_4 - - pass - 8.559 sec -TEST: test_all_pb2nc - - pass - 3.645 sec -TEST: test_all_plot_point_obs - - pass - 5.294 sec -TEST: test_all_ascii2nc_1 - - pass - 0.599 sec -TEST: test_all_ascii2nc_2 - - pass - 0.715 sec -TEST: test_all_madis2nc - - pass - 1.521 sec -TEST: test_all_point_stat - - pass - 72.135 sec -TEST: test_all_wavelet_stat_1 - - pass - 4.892 sec -TEST: test_all_wavelet_stat_2 - - pass - 2.751 sec -TEST: test_all_ensemble_stat - - pass - 9.129 sec -TEST: test_all_stat_analysis - - pass - 15.05 sec -TEST: test_all_mode_analysis_1 - - pass - 0.713 sec -TEST: test_all_mode_analysis_2 - - pass - 0.561 sec -TEST: test_all_mode_analysis_3 - - pass - 0.574 sec -TEST: test_all_plot_data_plane_1 - - pass - 1.109 sec -TEST: test_all_plot_data_plane_2 - - pass - 0.662 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_modis.xml - -TEST: modis_regrid_SURFACE_TEMPERATURE - - pass - 3.171 sec -TEST: modis_regrid_CLOUD_FRACTION - - pass - 2.371 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_ref_config_lead_00.xml - -TEST: gen_vx_mask - - pass - 2.464 sec -TEST: pb2nc_ndas_lead_00 - - pass - 8.045 sec -TEST: point_stat_lead_00_upper_air_AFWAv3.4_Noahv2.7.1 - - pass - 48.708 sec -TEST: point_stat_lead_00_surface_AFWAv3.4_Noahv2.7.1 - - pass - 24.294 sec -TEST: point_stat_lead_00_winds_AFWAv3.4_Noahv2.7.1 - - pass - 56.158 sec -TEST: point_stat_lead_00_upper_air_AFWAv3.4_Noahv3.3 - - pass - 48.776 sec -TEST: point_stat_lead_00_surface_AFWAv3.4_Noahv3.3 - - pass - 24.526 sec -TEST: point_stat_lead_00_winds_AFWAv3.4_Noahv3.3 - - pass - 56.448 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_ref_config_lead_12.xml - -TEST: gen_vx_mask - - pass - 2.225 sec -TEST: pb2nc_ndas_lead_12 - - pass - 8.146 sec -TEST: pcp_combine_ST2ml_3hr_09_12 - - pass - 0.909 sec -TEST: pcp_combine_wrf_3hr_09_12 - - pass - 1.143 sec -TEST: point_stat_lead_12_upper_air_AFWAv3.4_Noahv2.7.1 - - pass - 48.863 sec -TEST: point_stat_lead_12_surface_AFWAv3.4_Noahv2.7.1 - - pass - 25.401 sec -TEST: point_stat_lead_12_winds_AFWAv3.4_Noahv2.7.1 - - pass - 55.69 sec -TEST: point_stat_lead_12_upper_air_AFWAv3.4_Noahv3.3 - - pass - 48.919 sec -TEST: point_stat_lead_12_surface_AFWAv3.4_Noahv3.3 - - pass - 25.006 sec -TEST: point_stat_lead_12_winds_AFWAv3.4_Noahv3.3 - - pass - 55.808 sec -TEST: grid_stat_3hr_accum_time_12 - - pass - 0.883 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_ref_config_lead_24.xml - -TEST: gen_vx_mask - - pass - 2.181 sec -TEST: pb2nc_ndas_lead_24 - - pass - 7.926 sec -TEST: pcp_combine_ST2ml_3hr_21_24 - - pass - 0.76 sec -TEST: pcp_combine_wrf_3hr_21_24 - - pass - 1.115 sec -TEST: point_stat_lead_24_upper_air_AFWAv3.4_Noahv2.7.1 - - pass - 47.982 sec -TEST: point_stat_lead_24_surface_AFWAv3.4_Noahv2.7.1 - - pass - 23.972 sec -TEST: point_stat_lead_24_winds_AFWAv3.4_Noahv2.7.1 - - pass - 54.219 sec -TEST: point_stat_lead_24_upper_air_AFWAv3.4_Noahv3.3 - - pass - 48.24 sec -TEST: point_stat_lead_24_surface_AFWAv3.4_Noahv3.3 - - pass - 24.114 sec -TEST: point_stat_lead_24_winds_AFWAv3.4_Noahv3.3 - - pass - 54.602 sec -TEST: grid_stat_3hr_accum_time_24 - - pass - 0.892 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_ref_config_lead_36.xml - -TEST: gen_vx_mask - - pass - 2.186 sec -TEST: pb2nc_ndas_lead_36 - - pass - 8.025 sec -TEST: pcp_combine_ST2ml_3hr_33_36 - - pass - 0.697 sec -TEST: pcp_combine_ST2ml_24hr_12_36 - - pass - 0.596 sec -TEST: pcp_combine_wrf_3hr_33_36 - - pass - 1.092 sec -TEST: pcp_combine_wrf_24hr_12_36 - - pass - 1.108 sec -TEST: point_stat_lead_36_upper_air_AFWAv3.4_Noahv2.7.1 - - pass - 48.391 sec -TEST: point_stat_lead_36_surface_AFWAv3.4_Noahv2.7.1 - - pass - 24.7 sec -TEST: point_stat_lead_36_winds_AFWAv3.4_Noahv2.7.1 - - pass - 54.79 sec -TEST: point_stat_lead_36_upper_air_AFWAv3.4_Noahv3.3 - - pass - 48.341 sec -TEST: point_stat_lead_36_surface_AFWAv3.4_Noahv3.3 - - pass - 24.723 sec -TEST: point_stat_lead_36_winds_AFWAv3.4_Noahv3.3 - - pass - 54.725 sec -TEST: grid_stat_3hr_accum_time_36 - - pass - 0.917 sec -TEST: grid_stat_24hr_accum_time_36 - - pass - 0.896 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_ref_config_lead_48.xml - -TEST: gen_vx_mask - - pass - 2.193 sec -TEST: pb2nc_ndas_lead_48 - - pass - 8.014 sec -TEST: pcp_combine_ST2ml_3hr_45_48 - - pass - 0.72 sec -TEST: pcp_combine_wrf_3hr_45_48 - - pass - 1.101 sec -TEST: point_stat_lead_48_upper_air_AFWAv3.4_Noahv2.7.1 - - pass - 48.027 sec -TEST: point_stat_lead_48_surface_AFWAv3.4_Noahv2.7.1 - - pass - 24.714 sec -TEST: point_stat_lead_48_winds_AFWAv3.4_Noahv2.7.1 - - pass - 54.824 sec -TEST: point_stat_lead_48_upper_air_AFWAv3.4_Noahv3.3 - - pass - 48.048 sec -TEST: point_stat_lead_48_surface_AFWAv3.4_Noahv3.3 - - pass - 24.41 sec -TEST: point_stat_lead_48_winds_AFWAv3.4_Noahv3.3 - - pass - 55.39 sec -TEST: grid_stat_3hr_accum_time_48 - - pass - 0.893 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_ref_config.xml - -TEST: stat_analysis_GO_Index - - pass - 1.468 sec -TEST: stat_analysis_GO_Index_out_stat - - pass - 1.179 sec -TEST: stat_analysis_SFC_SS_Index_out - - pass - 0.874 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_mode_graphics.xml - -TEST: mode_graphics_PLOT_MULTIPLE - - pass - 63.828 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_regrid.xml - -TEST: regrid_grid_stat_ST4_TO_HMT - - pass - 1.052 sec -TEST: regrid_grid_stat_HMT_TO_ST4 - - pass - 8.112 sec -TEST: regrid_grid_stat_BOTH_TO_DTC165 - - pass - 1.594 sec -TEST: regrid_grid_stat_BOTH_TO_NAM - - pass - 5.106 sec -TEST: regrid_grid_stat_BOTH_TO_HMT_D02 - - pass - 1.577 sec -TEST: regrid_data_plane_GFS_TO_HMT_NEAREST - - pass - 2.858 sec -TEST: regrid_data_plane_GFS_ROTLATLON_GRID_SPEC - - pass - 2.465 sec -TEST: regrid_data_plane_GFS_TO_HMT_BILIN - - pass - 2.782 sec -TEST: regrid_data_plane_GFS_TO_HMT_BUDGET - - pass - 2.539 sec -TEST: regrid_data_plane_GFS_TO_HMT_MIN_3 - - pass - 3.824 sec -TEST: regrid_data_plane_GFS_TO_HMT_MAX_3 - - pass - 3.887 sec -TEST: regrid_data_plane_GFS_TO_HMT_UW_MEAN_3 - - pass - 3.837 sec -TEST: regrid_data_plane_GFS_TO_HMT_UW_MEAN_9 - - pass - 19.083 sec -TEST: regrid_data_plane_GFS_TO_HMT_DW_MEAN_3 - - pass - 3.94 sec -TEST: regrid_data_plane_HRRR_MAXGAUSS - - pass - 4.686 sec -TEST: regrid_data_plane_GFS_TO_HMT_MEDIAN_3 - - pass - 3.921 sec -TEST: regrid_data_plane_GFS_TO_HMT_LS_FIT_3 - - pass - 3.982 sec -TEST: regrid_data_plane_GFS_TO_HMT_MAX_5_SQUARE - - pass - 1.92 sec -TEST: regrid_data_plane_GFS_TO_G212_CONVERT_CENSOR - - pass - 0.893 sec -TEST: regrid_data_plane_WRAP_LON - - pass - 1.438 sec -TEST: regrid_data_plane_NC_ROT_LAT_LON - - pass - 2.385 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_gsi_tools.xml - -TEST: gsid2mpr_CONV - - pass - 2.161 sec -TEST: gsid2mpr_DUP - - pass - 1.27 sec -TEST: gsid2mpr_RAD - - pass - 2.469 sec -TEST: gsidens2orank_CONV_NO_MEAN - - pass - 5.607 sec -TEST: gsidens2orank_CONV_ENS_MEAN - - pass - 4.809 sec -TEST: gsidens2orank_RAD - - pass - 4.108 sec -TEST: gsidens2orank_RAD_CHANNEL - - pass - 1.14 sec -TEST: stat_analysis_MPR_TO_CNT - - pass - 2.631 sec -TEST: stat_analysis_ORANK_TO_RHIST - - pass - 23.803 sec -TEST: stat_analysis_ORANK_TO_SSVAR - - pass - 23.779 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_aeronet.xml - -TEST: ascii2nc_AERONET_daily - - pass - 0.814 sec -TEST: ascii2nc_AERONET_v3_daily - - pass - 0.537 sec -TEST: ascii2nc_AERONET_v3_concat - - pass - 0.574 sec -TEST: ascii2nc_AERONET_vld_thresh - - pass - 0.545 sec -TEST: ascii2nc_AERONET_monthly - - pass - 0.698 sec -TEST: point_stat_GRIB2_f18_NGAC_AERONET_daily - - pass - 0.59 sec -TEST: point_stat_GRIB2_f18_NGAC_AERONET_monthly - - pass - 0.639 sec -TEST: point_stat_GRIB2_f21_NGAC_AERONET_daily - - pass - 0.595 sec -TEST: point_stat_GRIB2_f21_NGAC_AERONET_monthly - - pass - 0.639 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_shift_data_plane.xml - -TEST: shift_data_plane_GRIB1 - - pass - 4.387 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_mtd.xml - -TEST: mtd_basic - - pass - 45.285 sec -TEST: mtd_conv_time - - pass - 47.593 sec -TEST: mtd_single - - pass - 11.058 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_climatology_1.0deg.xml - -TEST: climatology_POINT_STAT_GFS_1.0DEG - - pass - 128.342 sec -TEST: climatology_POINT_STAT_GFS_1.0DEG_CLIMO_PREV_MONTH - - pass - 127.347 sec -TEST: climatology_POINT_STAT_PROB_GFS_1.0DEG - - pass - 11.152 sec -TEST: climatology_GRID_STAT_PROB_GFS_1.0DEG - - pass - 8.402 sec -TEST: climatology_STAT_ANALYSIS_1.0DEG - - pass - 3.124 sec -TEST: climatology_SERIES_ANALYSIS_1.0DEG - - pass - 168.005 sec -TEST: climatology_SERIES_ANALYSIS_1.0DEG_CONST_CLIMO - - pass - 49.084 sec -TEST: climatology_SERIES_ANALYSIS_1.0DEG_AGGR - - pass - 215.56 sec -TEST: climatology_SERIES_ANALYSIS_PROB_1.0DEG - - pass - 20.95 sec -TEST: climatology_SERIES_ANALYSIS_PROB_1.0DEG_AGGR - - pass - 24.843 sec -TEST: climatology_ENSEMBLE_STAT_1.0DEG - - pass - 31.429 sec -TEST: climatology_ENSEMBLE_STAT_1.0DEG_ONE_CDF_BIN - - pass - 11.051 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_climatology_1.5deg.xml - -TEST: climatology_POINT_STAT_WMO_1.5DEG - - pass - 245.695 sec -TEST: climatology_STAT_ANALYSIS_WMO_1.5DEG_MPR_AGG_STAT - - pass - 0.741 sec -TEST: climatology_STAT_ANALYSIS_WMO_1.5DEG_VAL1L2_AGG_STAT - - pass - 0.607 sec -TEST: climatology_STAT_ANALYSIS_WMO_1.5DEG_FILTER - - pass - 0.758 sec -TEST: climatology_GRID_STAT_WMO_1.5DEG - - pass - 253.773 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_climatology_2.5deg.xml - -TEST: climatology_POINT_STAT_GFS_2.5DEG - - pass - 207.139 sec -TEST: climatology_GRID_STAT_WRAP_YEAR_2.5DEG - - pass - 126.605 sec -TEST: climatology_GRID_STAT_SINGLE_MONTH_2.5DEG - - pass - 64.927 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_climatology_mixed.xml - -TEST: climatology_GRID_STAT_FCST_NCEP_1.0DEG_OBS_WMO_1.5DEG - - pass - 72.612 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_grib_tables.xml - -TEST: GRIB1_um_dcf - - pass - 2.76 sec -TEST: GRIB2_um_raw - - pass - 2.366 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_grid_weight.xml - -TEST: grid_weight_GRID_STAT_NONE - - pass - 6.082 sec -TEST: grid_weight_GRID_STAT_COS_LAT - - pass - 6.075 sec -TEST: grid_weight_GRID_STAT_AREA - - pass - 6.081 sec -TEST: grid_weight_ENSEMBLE_STAT_NONE - - pass - 2.327 sec -TEST: grid_weight_ENSEMBLE_STAT_COS_LAT - - pass - 2.287 sec -TEST: grid_weight_ENSEMBLE_STAT_AREA - - pass - 2.291 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_netcdf.xml - -TEST: ascii2nc_no_compression - - pass - 16.393 sec -TEST: ascii2nc_compression2_by_config - - pass - 16.728 sec -TEST: ascii2nc_compression3_by_env - - pass - 16.411 sec -TEST: ascii2nc_compression4_by_argument - - pass - 16.483 sec -TEST: 365_days - - pass - 1.913 sec -TEST: netcdf_1byte_time - - pass - 0.934 sec -TEST: netcdf_months_units - - pass - 0.653 sec -TEST: netcdf_months_units_from_day2 - - pass - 0.535 sec -TEST: netcdf_months_units_to_next_month - - pass - 0.537 sec -TEST: netcdf_years_units - - pass - 0.535 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_hira.xml - -WARNING: unable to read test_dir from /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_hira.xml -TEST: point_stat_NCMET_NAM_HMTGAGE_HIRA - - pass - 10.392 sec -TEST: point_stat_HIRA_EMPTY_PROB_CAT_THRESH - - pass - 9.472 sec -TEST: stat_analysis_CONFIG_HIRA - - pass - 4.317 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_interp_shape.xml - -TEST: grid_stat_INTERP_SQUARE - - pass - 6.366 sec -TEST: grid_stat_INTERP_CIRCLE - - pass - 5.351 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_lidar2nc.xml - -TEST: lidar2nc_CALIPSO - - pass - 1.126 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_ioda2nc.xml - -TEST: ioda2nc_mask_sid_list - - pass - 1.612 sec -TEST: ioda2nc_var_all - - pass - 0.549 sec -TEST: ioda2nc_summary - - pass - 0.566 sec -TEST: ioda2nc_same_input - - pass - 0.565 sec -TEST: ioda2nc_int_datetime - - pass - 0.575 sec -TEST: ioda2nc_v2_string_sid - - pass - 0.576 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_airnow.xml - -TEST: pb2nc_AIRNOW - - pass - 16.993 sec -TEST: point_stat_GRIB2_AIRNOW - - pass - 2.994 sec - -CALLING: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/xml/unit_python.xml - -TEST: python_numpy_grid_name - - pass - 1.728 sec -TEST: python_numpy_grid_string - - pass - 1.147 sec -TEST: python_numpy_grid_data_file - - pass - 1.163 sec -TEST: python_numpy_plot_data_plane - - pass - 1.221 sec -TEST: python_xarray_plot_data_plane - - pass - 1.193 sec -TEST: python_numpy_plot_data_plane_missing - - FAIL - 0.533 sec -export MET_PYTHON_EXE=${MET_TEST_MET_PYTHON_EXE} -/d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/../../share/met/../../bin/plot_data_plane \ - PYTHON_NUMPY \ - /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/../../test_output/python/letter_numpy_0_to_missing.ps \ - 'name = "/d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/../../share/met/python/examples/read_ascii_numpy.py /d1/projects/MET/MET_test_data/unit_test/python/letter.txt LETTER 0.0";' \ - -plot_range 0.0 255.0 \ - -title "Python enabled numpy plot_data_plane" \ - -v 1 -DEBUG 1: Start plot_data_plane by johnhg(6088) at 2024-10-07 17:45:28Z cmd: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/../../share/met/../../bin/plot_data_plane PYTHON_NUMPY /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/../../test_output/python/letter_numpy_0_to_missing.ps name = "/d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/../../share/met/python/examples/read_ascii_numpy.py /d1/projects/MET/MET_test_data/unit_test/python/letter.txt LETTER 0.0"; -plot_range 0.0 255.0 -title Python enabled numpy plot_data_plane -v 1 -DEBUG 1: Opening data file: PYTHON_NUMPY -sh: 1: /usr/local/python3/bin/python3: not found -ERROR : -ERROR : tmp_nc_dataplane() -> command "${MET_TEST_MET_PYTHON_EXE} /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/../../share/met/python/pyembed/write_tmp_dataplane.py /tmp/tmp_met_data_386958_0 /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/../../share/met/python/examples/read_ascii_numpy /d1/projects/MET/MET_test_data/unit_test/python/letter.txt LETTER 0.0" failed ... status = 32512 -ERROR : -unset MET_PYTHON_EXE - - -ERROR: /d1/personal/johnhg/MET/MET_development/MET-feature_2887_categorical_weights/internal/test_unit/python/unit.py unit_python.xml failed. - -*** UNIT TESTS FAILED *** - diff --git a/internal/test_util/basic/vx_config/test_lookup.cc b/internal/test_util/basic/vx_config/test_lookup.cc index 8400103504..b9dccac27f 100644 --- a/internal/test_util/basic/vx_config/test_lookup.cc +++ b/internal/test_util/basic/vx_config/test_lookup.cc @@ -114,61 +114,12 @@ if ( !e ) { e->dump(cout); -// ed = e->dict_value(); - cout << "\n\n"; ConcatString foo; foo = parse_conf_string(&config, lookup_key); - -/* - // - // get mid - // -/* -m = ed->lookup("mid"); - -if ( !e ) { - - cerr << "\n\n " << program_name << ": can't find mid!\n\n"; - - exit ( 1 ); - -} - -// m->dump(cout); - -md = m->dict_value(); - - // - // try to get hello from mid - // - -h = md->lookup("hello"); - -if ( !h ) { - - cerr << "\n\n " << program_name << ": can't find entry!\n\n"; - - exit ( 1 ); - -} - -h->dump(cout); -*/ - - - - - - - - - - - cout << "\n\n"; // diff --git a/src/basic/vx_cal/unix_to_mdyhms.cc b/src/basic/vx_cal/unix_to_mdyhms.cc index 45d6462a86..1634ba1c25 100644 --- a/src/basic/vx_cal/unix_to_mdyhms.cc +++ b/src/basic/vx_cal/unix_to_mdyhms.cc @@ -105,18 +105,17 @@ int month_name_to_m (const char *month_str) { int month = -1; -int str_len = strlen(month_str); -char t_month_str[str_len + 1]; -for (int idx=0; idx s(nx); + vector t(nx); // Initialize s and t array for (ix=0; ix pmatch(num_pmat); if(0 != (rc = regcomp(re, pat, REG_EXTENDED))){ regfree(re); if( re ) { delete re; re = 0; } @@ -281,7 +283,7 @@ int regex_apply(const char* pat, int num_mat, const char* str, char** &mat) } // apply the pattern to the input string - rc = regexec(re, str, num_pmat, pmatch, 0); + rc = regexec(re, str, num_pmat, pmatch.data(), 0); // if the match succeeded, build the data for return if( 0 == rc ){ diff --git a/src/libcode/vx_bool_calc/tokenizer.cc b/src/libcode/vx_bool_calc/tokenizer.cc index 783f97850b..9accd8414a 100644 --- a/src/libcode/vx_bool_calc/tokenizer.cc +++ b/src/libcode/vx_bool_calc/tokenizer.cc @@ -228,7 +228,7 @@ else if ( c == negation_char ) { tok.set_negation(old_pos); } -else if ( c = local_var_char ) { +else if ( c == local_var_char ) { k = get_number(); tok.set_local_var(k, old_pos); diff --git a/src/libcode/vx_data2d_factory/is_netcdf_file.cc b/src/libcode/vx_data2d_factory/is_netcdf_file.cc index 3c73e57306..24ab1de989 100644 --- a/src/libcode/vx_data2d_factory/is_netcdf_file.cc +++ b/src/libcode/vx_data2d_factory/is_netcdf_file.cc @@ -63,18 +63,18 @@ bool is_netcdf_file(const char * filename) int fd = -1; int n_read; - char buf[netcdf_magic_len]; + vector buf(netcdf_magic_len); if ( (fd = open(filename, O_RDONLY)) < 0 ) return false; - n_read = read(fd, buf, netcdf_magic_len); + n_read = read(fd, buf.data(), netcdf_magic_len); close(fd); if ( n_read != netcdf_magic_len ) return false; - if ( strncmp(buf, netcdf_magic, netcdf_magic_len) == 0 - || strncmp(buf, hdf_magic, netcdf_magic_len) == 0) return true; + if ( strncmp(buf.data(), netcdf_magic, netcdf_magic_len) == 0 + || strncmp(buf.data(), hdf_magic, netcdf_magic_len) == 0) return true; // // done diff --git a/src/libcode/vx_data2d_grib/grib_utils.cc b/src/libcode/vx_data2d_grib/grib_utils.cc index 5b7f9fe2df..a5aff0fcdd 100644 --- a/src/libcode/vx_data2d_grib/grib_utils.cc +++ b/src/libcode/vx_data2d_grib/grib_utils.cc @@ -656,7 +656,7 @@ double decode_lat_lon(const unsigned char * p, int n) int i, parity; double answer; -unsigned char c[n]; +vector c(n); // // For all of the lat/lon parameters, the leftmost bit indicates the @@ -672,8 +672,8 @@ if ( c[0] & 128 ) parity = -1; c[0] &= 127; - if ( n == 2 ) answer = (double) 0.001*parity*char2_to_int(c); -else if ( n == 3 ) answer = (double) 0.001*parity*char3_to_int(c); + if ( n == 2 ) answer = (double) 0.001*parity*char2_to_int(c.data()); +else if ( n == 3 ) answer = (double) 0.001*parity*char3_to_int(c.data()); else answer = (double) bad_data_float; return answer; diff --git a/src/libcode/vx_data2d_nc_cf/nc_cf_file.cc b/src/libcode/vx_data2d_nc_cf/nc_cf_file.cc index 78c20bd550..2cd2618754 100644 --- a/src/libcode/vx_data2d_nc_cf/nc_cf_file.cc +++ b/src/libcode/vx_data2d_nc_cf/nc_cf_file.cc @@ -1456,15 +1456,22 @@ void NcCfFile::read_netcdf_grid() // the x_dim_var_name and y_dim_var_name strings are both set. if (nullptr == _xDim && nullptr == _yDim && _latVar && _lonVar) { + + // MET #3075 the _xDim and _yDim pointers should reference class + // members rather than local variables that go out of scope int dim_offset = get_dim_count(_lonVar) - 1; - NcDim lon_dim = get_nc_dim(_lonVar, dim_offset); - NcDim lat_dim = get_nc_dim(_latVar, 0); - _xDim = &lon_dim; - _yDim = &lat_dim; - x_dim_var_name = GET_NC_NAME(lon_dim); - y_dim_var_name = GET_NC_NAME(lat_dim); - get_grid_from_lat_lon_vars(_latVar, _lonVar, _yDim->getSize(), _xDim->getSize()); - status = true; + x_dim_var_name = GET_NC_NAME(get_nc_dim(_lonVar, dim_offset)); + y_dim_var_name = GET_NC_NAME(get_nc_dim(_latVar, 0)); + for (int dim_num = 0; dim_num < _numDims; ++dim_num) { + if(x_dim_var_name == GET_NC_NAME_P(_dims[dim_num])) _xDim = _dims[dim_num]; + if(y_dim_var_name == GET_NC_NAME_P(_dims[dim_num])) _yDim = _dims[dim_num]; + } + if (_xDim != nullptr && _yDim != nullptr) { + get_grid_from_lat_lon_vars(_latVar, _lonVar, + _yDim->getSize(), + _xDim->getSize()); + status = true; + } } if (!status || @@ -1717,14 +1724,14 @@ void NcCfFile::get_grid_mapping_lambert_azimuthal_equal_area(const NcVar *grid_m // Figure out the dx/dy and x/y pin values from the dimension variables long x_counts = GET_NC_SIZE_P(_xDim); - double x_values[x_counts]; + vector x_values(x_counts); - get_nc_data(_xCoordVar, x_values); + get_nc_data(_xCoordVar, x_values.data()); long y_counts = GET_NC_SIZE_P(_yDim); - double y_values[y_counts]; + vector y_values(y_counts); - get_nc_data(_yCoordVar, y_values); + get_nc_data(_yCoordVar, y_values.data()); // Unit conversion @@ -1970,14 +1977,14 @@ void NcCfFile::get_grid_mapping_lambert_conformal_conic(const NcVar *grid_mappin // Figure out the dx/dy and x/y pin values from the dimension variables long x_counts = GET_NC_SIZE_P(_xDim); - double x_values[x_counts]; + vector x_values(x_counts); - get_nc_data(_xCoordVar, x_values); + get_nc_data(_xCoordVar, x_values.data()); long y_counts = GET_NC_SIZE_P(_yDim); - double y_values[y_counts]; + vector y_values(y_counts); - get_nc_data(_yCoordVar, y_values); + get_nc_data(_yCoordVar, y_values.data()); // Unit conversion @@ -2369,14 +2376,14 @@ void NcCfFile::get_grid_mapping_polar_stereographic(const NcVar *grid_mapping_va // Figure out the dx/dy and x/y pin values from the dimension variables long x_counts = GET_NC_SIZE_P(_xDim); - double x_values[x_counts]; + vector x_values(x_counts); - get_nc_data(_xCoordVar, x_values); + get_nc_data(_xCoordVar, x_values.data()); long y_counts = GET_NC_SIZE_P(_yDim); - double y_values[y_counts]; + vector y_values(y_counts); - get_nc_data(_yCoordVar, y_values); + get_nc_data(_yCoordVar, y_values.data()); // Unit conversion @@ -2972,14 +2979,14 @@ void NcCfFile::get_grid_mapping_geostationary( // Figure out the dx/dy and x/y pin values from the dimension variables long x_counts = GET_NC_SIZE_P(_xDim); - double x_values[x_counts]; + vector x_values(x_counts); - get_nc_data(_xCoordVar, x_values); + get_nc_data(_xCoordVar, x_values.data()); long y_counts = GET_NC_SIZE_P(_yDim); - double y_values[y_counts]; + vector y_values(y_counts); - get_nc_data(_yCoordVar, y_values); + get_nc_data(_yCoordVar, y_values.data()); // Unit conversion @@ -3037,8 +3044,8 @@ void NcCfFile::get_grid_mapping_geostationary( data.x_values = new double[x_counts]; data.y_values = new double[y_counts]; - memcpy(data.x_values, x_values, sizeof(data.x_values[0])*x_counts); - memcpy(data.y_values, y_values, sizeof(data.y_values[0])*y_counts); + memcpy(data.x_values, x_values.data(), sizeof(data.x_values[0])*x_counts); + memcpy(data.y_values, y_values.data(), sizeof(data.y_values[0])*y_counts); // Get scene_id: "Full Disk", "CONUS", or "Mesoscale" ConcatString scene_id; @@ -3369,8 +3376,8 @@ LatLonData NcCfFile::get_data_from_lat_lon_vars(NcVar *lat_var, NcVar *lon_var, return data; } - double lat_values[lat_counts]; - double lon_values[lon_counts]; + vector lat_values(lat_counts); + vector lon_values(lon_counts); bool lat_first = false; if (two_dim_coord) { lat_first = (lat_counts == get_dim_size(lat_var, 0)); @@ -3381,16 +3388,16 @@ LatLonData NcCfFile::get_data_from_lat_lon_vars(NcVar *lat_var, NcVar *lon_var, length.add(1); if (lat_first) length[0] = lat_counts; else length[1] = lat_counts; - get_nc_data(lat_var,lat_values, length, cur); + get_nc_data(lat_var, lat_values.data(), length, cur); length[0] = length[1] = 1; if (lat_first) length[1] = lon_counts; else length[0] = lon_counts; - get_nc_data(lon_var,lon_values, length, cur); + get_nc_data(lon_var, lon_values.data(), length, cur); } else { - get_nc_data(lat_var,lat_values); - get_nc_data(lon_var,lon_values); + get_nc_data(lat_var, lat_values.data()); + get_nc_data(lon_var, lon_values.data()); } data.lat_ll = lat_values[0]; data.lon_ll = rescale_lon(-lon_values[0]); diff --git a/src/libcode/vx_ioda/ioda.cc b/src/libcode/vx_ioda/ioda.cc index 54fb3ef4a5..dc1d0171cf 100644 --- a/src/libcode/vx_ioda/ioda.cc +++ b/src/libcode/vx_ioda/ioda.cc @@ -345,22 +345,20 @@ bool iodaReader::read_time() { vld_arr.resize(nlocs); if (NC_STRING == GET_NC_TYPE_ID(in_hdr_vld_var)) { - char valid_time[ndatetime+1]; + vector valid_time(ndatetime+1); vector hdr_vld_block(nlocs*(ndatetime+1), 0); vector hdr_vld_block2(nlocs, nullptr); for (int i=0; i valid_time(ndatetime+1); vector hdr_vld_block(nlocs*(ndatetime+1), 0); status = get_nc_data(&in_hdr_vld_var, hdr_vld_block.data()); for (int i=0; i &hdr_data hdr_data.resize(nlocs, ""); if (NC_STRING == GET_NC_TYPE_ID(hdr_var)) { vector hdr_data2(nlocs, nullptr); - for (int i=0; i hdr_typ_block(buf_size * typ_len); + vector hdr_sid_block(buf_size * sid_len); + vector hdr_vld_block(buf_size * vld_len); vector hdr_typ_idx_block(buf_size); vector hdr_sid_idx_block(buf_size); vector hdr_vld_idx_block(buf_size); @@ -637,7 +637,7 @@ void NetcdfObsVars::read_header_data(MetPointHeader &hdr_data) { if (has_array_vars) { lengths[1] = typ_len; if(!get_nc_data(&hdr_typ_var, - (char *)&hdr_typ_block[0], lengths, offsets)) { + hdr_typ_block.data(), lengths, offsets)) { mlog << Error << "\n" << method_name << "trouble getting hdr_typ\n\n"; exit(1); @@ -648,7 +648,7 @@ void NetcdfObsVars::read_header_data(MetPointHeader &hdr_data) { // lengths[1] = sid_len; if(!get_nc_data(&hdr_sid_var, - (char *)&hdr_sid_block[0], lengths, offsets)) { + hdr_sid_block.data(), lengths, offsets)) { mlog << Error << "\n" << method_name << "trouble getting hdr_sid\n\n"; exit(1); @@ -659,7 +659,7 @@ void NetcdfObsVars::read_header_data(MetPointHeader &hdr_data) { // lengths[1] = vld_len; if(!get_nc_data(&hdr_vld_var, - (char *)&hdr_vld_block[0], lengths, offsets)) { + hdr_vld_block.data(), lengths, offsets)) { mlog << Error << "\nget_nc_header() -> " << "trouble getting hdr_vld\n\n"; exit(1); @@ -676,9 +676,9 @@ void NetcdfObsVars::read_header_data(MetPointHeader &hdr_data) { exit(1); } for (int hIndex = 0; hIndex < buf_size; hIndex++) { - hdr_data.typ_array.add(hdr_typ_block[hIndex]); - hdr_data.sid_array.add(hdr_sid_block[hIndex]); - hdr_data.vld_array.add(hdr_vld_block[hIndex]); + hdr_data.typ_array.add(&hdr_typ_block.data()[hIndex*typ_len]); + hdr_data.sid_array.add(&hdr_sid_block.data()[hIndex*sid_len]); + hdr_data.vld_array.add(&hdr_vld_block.data()[hIndex*vld_len]); hdr_data.lat_array.add(hdr_arr_block[hIndex][0]); hdr_data.lon_array.add(hdr_arr_block[hIndex][1]); hdr_data.elv_array.add(hdr_arr_block[hIndex][2]); @@ -754,13 +754,13 @@ void NetcdfObsVars::read_header_data(MetPointHeader &hdr_data) { // Get the corresponding header message type (string) if(!get_nc_data(&hdr_typ_tbl_var, - (char *)&hdr_typ_block[0], lengths, offsets)) { + hdr_typ_block.data(), lengths, offsets)) { mlog << Error << "\n" << method_name << "trouble getting hdr_typ\n\n"; exit(1); } for (int hIndex = 0; hIndex < buf_size; hIndex++) { - hdr_data.typ_array.add(hdr_typ_block[hIndex]); + hdr_data.typ_array.add(&hdr_typ_block.data()[hIndex*typ_len]); } } @@ -774,13 +774,13 @@ void NetcdfObsVars::read_header_data(MetPointHeader &hdr_data) { // Get the corresponding header station id (string) if(!get_nc_data(&hdr_sid_tbl_var, - (char *)&hdr_sid_block[0], lengths, offsets)) { + hdr_sid_block.data(), lengths, offsets)) { mlog << Error << "\n" << method_name << "trouble getting hdr_typ\n\n"; exit(1); } for (int hIndex = 0; hIndex < buf_size; hIndex++) { - hdr_data.sid_array.add(hdr_sid_block[hIndex]); + hdr_data.sid_array.add(&hdr_sid_block.data()[hIndex*sid_len]); } } @@ -800,7 +800,7 @@ void NetcdfObsVars::read_header_data(MetPointHeader &hdr_data) { exit(1); } for (int hIndex = 0; hIndex < buf_size; hIndex++) { - hdr_data.vld_array.add(hdr_vld_block[hIndex]); + hdr_data.vld_array.add(&hdr_vld_block.data()[hIndex*vld_len]); } } } @@ -1280,38 +1280,33 @@ int write_nc_string_array (NcVar *ncVar, StringArray &strArray, const int str_le int data_count = strArray.n_elements(); int max_buf_size = (1024 * 8); int buf_size = (data_count > max_buf_size ? max_buf_size : data_count); - char data_buf[buf_size][str_len]; + vector data_buf(buf_size * str_len, 0); long offsets[2] = { 0, 0 }; long lengths[2] = { buf_size, str_len } ; mlog << Debug(7) << method_name << " " << GET_NC_NAME_P(ncVar) << " data count: " << data_count << "\n"; - // Initialize data_buf - for (int indexX=0; indexX str_len) len_n = str_len; - m_strncpy(data_buf[buf_index], string_data.c_str(), len_n, method_name.c_str()); + m_strncpy(&data_buf.data()[buf_index], string_data.c_str(), len_n, method_name.c_str()); for (int idx=len_n; idx= buf_size) { + buf_index += str_len; + if (buf_index >= (buf_size * str_len)) { mlog << Debug(7) << method_name << " save to NetCDF. index: " << index << " buf_index: " << buf_index << " offsets: " << offsets[0] << " lengths: " << lengths[0] << "\n"; - if(!put_nc_data(ncVar, (char*)data_buf[0], lengths, offsets)) { + if(!put_nc_data(ncVar, data_buf.data(), lengths, offsets)) { mlog << Error << "\n" << method_name << "-> " << "error writing the variable " << GET_NC_NAME_P(ncVar) << " to the netCDF file\n\n"; @@ -1326,7 +1321,7 @@ int write_nc_string_array (NcVar *ncVar, StringArray &strArray, const int str_le lengths[0] = (data_count <= max_buf_size) ? data_count : (data_count % buf_size); mlog << Debug(7) << method_name << " Save to NetCDF. offsets: " << offsets[0] << " lengths: " << lengths[0] << "\n"; - if(!put_nc_data(ncVar, (char*)data_buf[0], lengths, offsets)) { + if(!put_nc_data(ncVar, data_buf.data(), lengths, offsets)) { mlog << Error << "\n" << method_name << "-> " << "error writing the variable " << GET_NC_NAME_P(ncVar) << " to the netCDF file\n\n"; diff --git a/src/libcode/vx_nc_util/nc_utils.cc b/src/libcode/vx_nc_util/nc_utils.cc index 8ab560f7f4..b519042282 100644 --- a/src/libcode/vx_nc_util/nc_utils.cc +++ b/src/libcode/vx_nc_util/nc_utils.cc @@ -13,6 +13,7 @@ #include #include +#include #include "vx_log.h" #include "nc_utils.h" @@ -25,21 +26,21 @@ using namespace netCDF::exceptions; //////////////////////////////////////////////////////////////////////// -void patch_nc_name(string *var_name) { +void patch_nc_name(string &var_name) { size_t offset; // Replace commas with underscores - offset = var_name->find(','); + offset = var_name.find(','); while (offset != string::npos) { - var_name->replace(offset, 1, "_"); - offset = var_name->find(',', offset); + var_name.replace(offset, 1, "_"); + offset = var_name.find(',', offset); } // Replaces stars with the word all - offset = var_name->find('*'); + offset = var_name.find('*'); while (offset != string::npos) { - var_name->replace(offset, 1, "all"); - offset = var_name->find('*', offset); + var_name.replace(offset, 1, "all"); + offset = var_name.find('*', offset); } } @@ -167,14 +168,14 @@ bool get_att_value_chars(const NcAtt *att, ConcatString &value) { nc_type attType = GET_NC_TYPE_ID_P(att); if (attType == NC_CHAR) { try { - char att_value[tmp_buf_size]; - memset(att_value, 0, tmp_buf_size); - att->getValues(att_value); - value = att_value; + size_t att_length = att->getAttLength(); + vector att_value(att_length + 1); + att->getValues(att_value.data()); + att_value[att_length] = '\0'; + value = att_value.data(); } catch (exceptions::NcChar &ex) { value = ""; - // Handle netCDF::exceptions::NcChar: NetCDF: Attempt to convert between text & numbers mlog << Warning << "\n" << method_name << "Exception: " << ex.what() << "\n" << "Fail to read " << GET_NC_NAME_P(att) << " attribute (" @@ -189,14 +190,15 @@ bool get_att_value_chars(const NcAtt *att, ConcatString &value) { value = att_value; } catch (exceptions::NcChar &ex) { + // NC_STRING attributes do not parse well with Intel compilers int num_elements_sub = 8096; - int num_elements = att->getAttLength();; - char *att_value[num_elements]; - for (int i = 0; i < num_elements; i++ ) { + int num_elements = att->getAttLength(); + vector att_value(num_elements); + for(int i=0; igetValues(att_value); + att->getValues(att_value.data()); value = att_value[0]; } catch (exceptions::NcException &ex2) { @@ -206,7 +208,8 @@ bool get_att_value_chars(const NcAtt *att, ConcatString &value) { << GET_NC_TYPE_NAME_P(att) << " type).\n" << "Please check the encoding of the "<< GET_NC_NAME_P(att) << " attribute.\n\n"; } - for (int i = 0; i < num_elements; i++ ) delete att_value[i]; + // Cleanup + for(int i=0; igetAttLength()]; - att->getValues(values); - return values; -} - //////////////////////////////////////////////////////////////////////// float get_att_value_float(const NcAtt *att) { @@ -268,6 +265,8 @@ short get_att_value_short(const NcAtt *att) { return value; } +//////////////////////////////////////////////////////////////////////// + unsigned short get_att_value_ushort(const NcAtt *att) { unsigned short value = bad_data_int; att->getValues(&value); @@ -1030,7 +1029,6 @@ bool get_var_standard_name(const NcVar *var, ConcatString &att_val) { //////////////////////////////////////////////////////////////////////// bool get_var_units(const NcVar *var, ConcatString &att_val) { - return get_nc_att_value(var, units_att_name, att_val); } @@ -1071,7 +1069,7 @@ ConcatString* get_string_val(NcFile * nc, const char * var_name, const int index ConcatString* get_string_val(NcVar *var, const int index, const int len, ConcatString &tmp_cs) { - char tmp_str[len]; + vector tmp_str(len + 1); vector start; vector count; const char *method_name = "get_string_val() "; @@ -1101,12 +1099,13 @@ ConcatString* get_string_val(NcVar *var, const int index, start.emplace_back(0); count.emplace_back(1); count.emplace_back(len); - var->getVar(start, count, &tmp_str); + var->getVar(start, count, tmp_str.data()); + tmp_str[len] = '\0'; // // Store the character array as a ConcatString // - tmp_cs = tmp_str; + tmp_cs = tmp_str.data(); return &tmp_cs; } @@ -1191,7 +1190,7 @@ double get_nc_time(NcVar * var, const int index) { long long vl; unixtime ref_ut; int buf_len = 512; - char *tmp_buf = new char[512]; + vector tmp_buf(buf_len); int dataType = GET_NC_TYPE_ID_P(var); start.emplace_back(index); @@ -1221,8 +1220,8 @@ double get_nc_time(NcVar * var, const int index) { count.emplace_back(buf_len); } for (int i=0; igetVar(start, count, tmp_buf); - parse_time_string(tmp_buf, ref_ut); + var->getVar(start, count, tmp_buf.data()); + parse_time_string(tmp_buf.data(), ref_ut); k = ref_ut; break; case NC_INT: @@ -1247,7 +1246,6 @@ double get_nc_time(NcVar * var, const int index) { << GET_NC_NAME_P(var) << "\".\n\n"; exit(1); } - if (tmp_buf) delete [] tmp_buf; } return k; @@ -1792,12 +1790,13 @@ bool get_nc_data(NcVar *var, unsigned short *data) { if (NC_USHORT == data_type) return_status = get_nc_data_t(var, data); else if (NC_SHORT == data_type && has_unsigned_attribute(var)) { short fill_value = (short)bad_data_int; - NcVarAtt *att_fill_value = get_nc_att(var, (string)"_FillValue"); + NcVarAtt *att_fill_value = get_nc_att(var, (string)"_FillValue"); bool has_fill_value = IS_VALID_NC_P(att_fill_value); if (has_fill_value) fill_value = get_att_value_int(att_fill_value); vector short_data(cell_count); - if (return_status = get_nc_data_t(var, short_data.data())) { + return_status = get_nc_data_t(var, short_data.data()); + if (return_status) { for (int idx=0; idxgetDim(dim_count-1); int count = get_dim_size(&count_dim); int str_len = get_dim_size(&str_dim); - char str_buffer[str_len+1]; + vector str_buffer(str_len + 1); offsets.add(0); offsets.add(0); @@ -1980,12 +1979,13 @@ bool get_nc_data_to_array(NcVar *var, StringArray *array_buf) { result = true; for (int idx=0; idxadd(str_buffer); + str_buffer[str_len] = '\0'; + array_buf->add(str_buffer.data()); } offsets[0]++; } @@ -2238,7 +2238,7 @@ NcGroup get_nc_group(NcFile *nc, const char *group_name) { NcVar get_var(NcFile *nc, const char *var_name) { string new_var_name = var_name; - patch_nc_name(&new_var_name); + patch_nc_name(new_var_name); // // Retrieve the variable from the NetCDF file. @@ -2264,7 +2264,7 @@ NcVar get_var(NcFile *nc, const char *var_name) { NcVar get_var(NcFile *nc, const char *var_name, const char *group_name) { string nc_var_name; string new_var_name = var_name; - patch_nc_name(&new_var_name); + patch_nc_name(new_var_name); // // Retrieve the variable from the NetCDF file. @@ -2298,7 +2298,7 @@ NcVar get_var(NcFile *nc, const char *var_name, const char *group_name) { NcVar get_nc_var(NcFile *nc, const char *var_name, bool log_as_error) { string new_var_name = var_name; - patch_nc_name(&new_var_name); + patch_nc_name(new_var_name); // // Retrieve the variable from the NetCDF file. @@ -2331,7 +2331,7 @@ NcVar get_nc_var(NcFile *nc, const char *var_name, const char *group_name, bool log_as_error) { string nc_var_name; string new_var_name = var_name; - patch_nc_name(&new_var_name); + patch_nc_name(new_var_name); // // Retrieve the variable from the NetCDF file. @@ -2375,16 +2375,17 @@ NcVar get_nc_var(NcFile *nc, const ConcatString &var_name, const char *group_nam void copy_nc_att_byte(NcFile *nc_to, NcGroupAtt *from_att) { size_t att_length = from_att->getAttLength(); - ncbyte value[att_length]; - from_att->getValues((void *)&value); - nc_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, (void *)value); + vector value(att_length); + from_att->getValues(value.data()); + nc_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, value.data()); } void copy_nc_att_char(NcFile *nc_to, NcGroupAtt *from_att) { size_t att_length = from_att->getAttLength(); - char value[att_length]; - from_att->getValues((void *)&value); - nc_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, (void *)value); + vector value(att_length + 1); + from_att->getValues(value.data()); + value[att_length] = '\0'; + nc_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, value.data()); } void copy_nc_att_double(NcFile *nc_to, NcGroupAtt *from_att) { @@ -2395,9 +2396,9 @@ void copy_nc_att_double(NcFile *nc_to, NcGroupAtt *from_att) { nc_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), value); } else { - double values[att_length]; - from_att->getValues(&values); - nc_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, values); + vector values(att_length); + from_att->getValues(values.data()); + nc_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, values.data()); } } @@ -2409,9 +2410,9 @@ void copy_nc_att_float(NcFile *nc_to, NcGroupAtt *from_att) { nc_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), value); } else { - float values[att_length]; - from_att->getValues(&values); - nc_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, values); + vector values(att_length); + from_att->getValues(values.data()); + nc_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, values.data()); } } @@ -2423,9 +2424,9 @@ void copy_nc_att_int(NcFile *nc_to, NcGroupAtt *from_att) { nc_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), value); } else { - int values[att_length]; - from_att->getValues(&values); - nc_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, values); + vector values(att_length); + from_att->getValues(values.data()); + nc_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, values.data()); } } @@ -2437,9 +2438,9 @@ void copy_nc_att_int64(NcFile *nc_to, NcGroupAtt *from_att) { nc_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), value); } else { - long long values[att_length]; - from_att->getValues(&values); - nc_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, values); + vector values(att_length); + from_att->getValues(values.data()); + nc_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, values.data()); } } @@ -2451,9 +2452,9 @@ void copy_nc_att_short(NcFile *nc_to, NcGroupAtt *from_att) { nc_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), value); } else { - short values[att_length]; - from_att->getValues(&values); - nc_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, values); + vector values(att_length); + from_att->getValues(values.data()); + nc_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, values.data()); } } @@ -2461,9 +2462,10 @@ void copy_nc_att_short(NcFile *nc_to, NcGroupAtt *from_att) { void copy_nc_att_char(NcVar *var_to, NcGroupAtt *from_att) { size_t att_length = from_att->getAttLength(); - char value[att_length]; - from_att->getValues((void *)&value); - var_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, (void *)value); + vector value(att_length + 1); + from_att->getValues(value.data()); + value[att_length] = '\0'; + var_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, value.data()); } void copy_nc_att_double(NcVar *var_to, NcGroupAtt *from_att) { @@ -2474,9 +2476,9 @@ void copy_nc_att_double(NcVar *var_to, NcGroupAtt *from_att) { var_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), value); } else { - double values[att_length]; - from_att->getValues(&values); - var_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, values); + vector values(att_length); + from_att->getValues(values.data()); + var_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, values.data()); } } void copy_nc_att_float(NcVar *var_to, NcGroupAtt *from_att) { @@ -2487,9 +2489,9 @@ void copy_nc_att_float(NcVar *var_to, NcGroupAtt *from_att) { var_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), value); } else { - float values[att_length]; - from_att->getValues(&values); - var_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, values); + vector values(att_length); + from_att->getValues(values.data()); + var_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, values.data()); } } @@ -2501,9 +2503,9 @@ void copy_nc_att_int(NcVar *var_to, NcGroupAtt *from_att) { var_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), value); } else { - int values[att_length]; - from_att->getValues(&values); - var_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, values); + vector values(att_length); + from_att->getValues(values.data()); + var_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, values.data()); } } @@ -2515,9 +2517,9 @@ void copy_nc_att_int64(NcVar *var_to, NcGroupAtt *from_att) { var_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), value); } else { - long long values[att_length]; - from_att->getValues(&values); - var_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, values); + vector values(att_length); + from_att->getValues(values.data()); + var_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, values.data()); } } @@ -2529,9 +2531,9 @@ void copy_nc_att_short(NcVar *var_to, NcGroupAtt *from_att) { var_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), value); } else { - short values[att_length]; - from_att->getValues(&values); - var_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, values); + vector values(att_length); + from_att->getValues(values.data()); + var_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, values.data()); } } @@ -2539,16 +2541,17 @@ void copy_nc_att_short(NcVar *var_to, NcGroupAtt *from_att) { void copy_nc_att_byte(NcVar *var_to, NcVarAtt *from_att) { size_t att_length = from_att->getAttLength(); - ncbyte value[att_length]; - from_att->getValues((void *)&value); - var_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, (void *)value); + vector value(att_length); + from_att->getValues(value.data()); + var_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, value.data()); } void copy_nc_att_char(NcVar *var_to, NcVarAtt *from_att) { size_t att_length = from_att->getAttLength(); - char value[att_length]; - from_att->getValues((void *)&value); - var_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, (void *)value); + vector value(att_length + 1); + from_att->getValues(value.data()); + value[att_length] = '\0'; + var_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, value.data()); } void copy_nc_att_double(NcVar *var_to, NcVarAtt *from_att) { @@ -2559,9 +2562,9 @@ void copy_nc_att_double(NcVar *var_to, NcVarAtt *from_att) { var_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), value); } else { - double values[att_length]; - from_att->getValues(&values); - var_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, values); + vector values(att_length); + from_att->getValues(values.data()); + var_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, values.data()); } } @@ -2573,9 +2576,9 @@ void copy_nc_att_float(NcVar *var_to, NcVarAtt *from_att) { var_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), value); } else { - float values[att_length]; - from_att->getValues(&values); - var_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, values); + vector values(att_length); + from_att->getValues(values.data()); + var_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, values.data()); } } @@ -2587,9 +2590,9 @@ void copy_nc_att_int(NcVar *var_to, NcVarAtt *from_att) { var_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), value); } else { - int values[att_length]; - from_att->getValues(&values); - var_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, values); + vector values(att_length); + from_att->getValues(values.data()); + var_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, values.data()); } } @@ -2601,9 +2604,9 @@ void copy_nc_att_int64(NcVar *var_to, NcVarAtt *from_att) { var_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), value); } else { - long long values[att_length]; - from_att->getValues(&values); - var_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, values); + vector values(att_length); + from_att->getValues(values.data()); + var_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, values.data()); } } @@ -2615,9 +2618,9 @@ void copy_nc_att_short(NcVar *var_to, NcVarAtt *from_att) { var_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), value); } else { - short values[att_length]; - from_att->getValues(&values); - var_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, values); + vector values(att_length); + from_att->getValues(values.data()); + var_to->putAtt(GET_NC_NAME_P(from_att), from_att->getType(), att_length, values.data()); } } @@ -2802,16 +2805,15 @@ void copy_nc_atts(NcVar *var_from, NcVar *var_to, const bool all_attrs) { //////////////////////////////////////////////////////////////////////// void copy_nc_data_char(NcVar *var_from, NcVar *var_to, int data_size) { - //const string method_name = "copy_nc_data_char"; - vector data(data_size); + vector data(data_size + 1); var_from->getVar(data.data()); + data[data_size] = '\0'; var_to->putVar(data.data()); } //////////////////////////////////////////////////////////////////////// void copy_nc_data_double(NcVar *var_from, NcVar *var_to, int data_size) { - //const string method_name = "copy_nc_data_double"; vector data(data_size); var_from->getVar(data.data()); var_to->putVar(data.data()); @@ -2820,7 +2822,6 @@ void copy_nc_data_double(NcVar *var_from, NcVar *var_to, int data_size) { //////////////////////////////////////////////////////////////////////// void copy_nc_data_float(NcVar *var_from, NcVar *var_to, int data_size) { - //const string method_name = "copy_nc_data_float"; vector data(data_size); var_from->getVar(data.data()); var_to->putVar(data.data()); @@ -2829,7 +2830,6 @@ void copy_nc_data_float(NcVar *var_from, NcVar *var_to, int data_size) { //////////////////////////////////////////////////////////////////////// void copy_nc_data_int(NcVar *var_from, NcVar *var_to, int data_size) { - //const string method_name = "copy_nc_data_int"; vector data(data_size); var_from->getVar(data.data()); var_to->putVar(data.data()); @@ -2838,7 +2838,6 @@ void copy_nc_data_int(NcVar *var_from, NcVar *var_to, int data_size) { //////////////////////////////////////////////////////////////////////// void copy_nc_data_short(NcVar *var_from, NcVar *var_to, int data_size) { - //const string method_name = "copy_nc_data_double"; vector data(data_size); var_from->getVar(data.data()); var_to->putVar(data.data()); @@ -2847,11 +2846,9 @@ void copy_nc_data_short(NcVar *var_from, NcVar *var_to, int data_size) { //////////////////////////////////////////////////////////////////////// void copy_nc_data_string(NcVar *var_from, NcVar *var_to, int data_size) { - //const string method_name = "copy_nc_data_string"; - string *data = new string[data_size]; - var_from->getVar(data); - var_to->putVar(data); - delete[] data; + vector data(data_size); + var_from->getVar(data.data()); + var_to->putVar(data.data()); } //////////////////////////////////////////////////////////////////////// @@ -2911,7 +2908,7 @@ bool has_nc_group(NcFile *nc, const char *group_name) { bool has_var(NcFile *nc, const char *var_name) { string new_var_name = var_name; - patch_nc_name(&new_var_name); + patch_nc_name(new_var_name); NcVar v = get_var(nc, new_var_name.c_str()); return IS_VALID_NC(v); } @@ -2927,7 +2924,7 @@ bool has_var(NcFile *nc, const ConcatString var_name) { bool has_var(NcFile *nc, const char *var_name, const char *group_name) { string nc_var_name; string new_var_name = var_name; - patch_nc_name(&new_var_name); + patch_nc_name(new_var_name); // // Retrieve the variable from the NetCDF file. @@ -2958,7 +2955,7 @@ bool has_var(NcFile *nc, const ConcatString var_name, const char *group_name) { NcVar add_var(NcFile *nc, const string &var_name, const NcType ncType, const int deflate_level) { vector ncDimVector; string new_var_name = var_name; - patch_nc_name(&new_var_name); + patch_nc_name(new_var_name); NcVar var = nc->addVar(new_var_name, ncType, ncDimVector); if (deflate_level > 0) { @@ -2973,7 +2970,7 @@ NcVar add_var(NcFile *nc, const string &var_name, const NcType ncType, const int NcVar add_var(NcFile *nc, const string &var_name, const NcType ncType, const NcDim ncDim, const int deflate_level) { string new_var_name = var_name; - patch_nc_name(&new_var_name); + patch_nc_name(new_var_name); NcVar var = nc->addVar(new_var_name, ncType, ncDim); if (deflate_level > 0) { @@ -3022,7 +3019,7 @@ NcVar add_var(NcFile *nc, const string &var_name, const NcType ncType, NcVar add_var(NcFile *nc, const string &var_name, const NcType ncType, const vector ncDims, const int deflate_level) { string new_var_name = var_name; - patch_nc_name(&new_var_name); + patch_nc_name(new_var_name); NcVar var = nc->addVar(new_var_name, ncType, ncDims); if (deflate_level > 0) { mlog << Debug(3) << " nc_utils.add_var() deflate_level: " << deflate_level << "\n"; @@ -3055,7 +3052,7 @@ NcVar add_var(NcFile *nc, const string &var_name, const NcType ncType, NcDim add_dim(NcFile *nc, const string &dim_name) { string new_dim_name = dim_name; - patch_nc_name(&new_dim_name); + patch_nc_name(new_dim_name); return nc->addDim(new_dim_name); } @@ -3063,7 +3060,7 @@ NcDim add_dim(NcFile *nc, const string &dim_name) { NcDim add_dim(NcFile *nc, const string &dim_name, const size_t dim_size) { string new_dim_name = dim_name; - patch_nc_name(&new_dim_name); + patch_nc_name(new_dim_name); return nc->addDim(new_dim_name, dim_size); } diff --git a/src/libcode/vx_statistics/compute_stats.cc b/src/libcode/vx_statistics/compute_stats.cc index 867511ecbf..61cb2c49b3 100644 --- a/src/libcode/vx_statistics/compute_stats.cc +++ b/src/libcode/vx_statistics/compute_stats.cc @@ -1644,11 +1644,11 @@ void compute_aggregated_seeps_grid(const DataPlane &fcst_dp, const DataPlane &ob fcst_cat = obs_cat = bad_data_int; seeps_score = bad_data_double; - mlog << Debug(9) << method_name + mlog << Debug(9) << method_name << "obs_value, fcst_value: " << obs_value << " " << fcst_value << "\n"; - if (!is_bad_data(fcst_value) && !is_bad_data(obs_value)) { + if (!is_bad_data(fcst_value) && !is_bad_data(obs_value)) { SeepsScore *seeps_mpr = seeps_climo->get_record(ix, iy, fcst_value, obs_value); if (seeps_mpr != nullptr) { fcst_cat = seeps_mpr->fcst_cat; diff --git a/src/libcode/vx_statistics/pair_data_ensemble.cc b/src/libcode/vx_statistics/pair_data_ensemble.cc index 758986fb20..144a826387 100644 --- a/src/libcode/vx_statistics/pair_data_ensemble.cc +++ b/src/libcode/vx_statistics/pair_data_ensemble.cc @@ -1305,7 +1305,7 @@ void VxPairDataEnsemble::add_point_obs(float *hdr_arr, int *hdr_typ_arr, // Add the observation value // Weight is from the nearest grid point int n = three_to_one(i_msg_typ, i_mask, i_interp); - if(!pd[n].add_point_obs(hdr_typ_str, hdr_sid_str, + if(!pd[n].add_point_obs(hdr_typ_str, hdr_sid_str, hdr_lat, hdr_lon, obs_x, obs_y, hdr_ut, obs_lvl, obs_hgt, obs_v, obs_qty, cpi, default_weight)) { diff --git a/src/libcode/vx_tc_util/track_info.cc b/src/libcode/vx_tc_util/track_info.cc index 7aaa81cd47..2eeb258a88 100644 --- a/src/libcode/vx_tc_util/track_info.cc +++ b/src/libcode/vx_tc_util/track_info.cc @@ -402,8 +402,8 @@ int TrackInfo::warm_core_dur() const { //////////////////////////////////////////////////////////////////////// -const char * TrackInfo::diag_name(int i) const { - return(i>=0 && i=0 && i DEF_NC_BUFFER_SIZE) ? DEF_NC_BUFFER_SIZE : obs_count); - int obs_qty_idx_block[buf_size]; - float obs_arr_block[buf_size][OBS_ARRAY_LEN]; - float obs_arr[OBS_ARRAY_LEN], hdr_arr[HDR_ARRAY_LEN]; - int hdr_typ_arr[HDR_TYPE_ARR_LEN]; + vector obs_qty_idx_block(buf_size); + vector> obs_arr_block(buf_size); + float obs_arr[OBS_ARRAY_LEN]; + float hdr_arr[HDR_ARRAY_LEN]; + int hdr_typ_arr[HDR_TYPE_ARR_LEN]; ConcatString hdr_typ_str; ConcatString hdr_sid_str; ConcatString hdr_vld_str; @@ -1041,11 +1042,14 @@ void process_point_obs(int i_nc) { #ifdef WITH_PYTHON if (use_python) status = met_point_obs->get_point_obs_data()->fill_obs_buf( - buf_size2, i_start, (float *)obs_arr_block, obs_qty_idx_block); + buf_size2, i_start, + (float *) obs_arr_block.data(), + obs_qty_idx_block.data()); else #endif - status = nc_point_obs.read_obs_data(buf_size2, i_start, (float *)obs_arr_block, - obs_qty_idx_block, (char *)0); + status = nc_point_obs.read_obs_data(buf_size2, i_start, + (float *) obs_arr_block.data(), + obs_qty_idx_block.data(), nullptr); if (!status) exit(1); // Process each observation in the file diff --git a/src/tools/core/grid_stat/grid_stat.cc b/src/tools/core/grid_stat/grid_stat.cc index edf724a367..16ad142775 100644 --- a/src/tools/core/grid_stat/grid_stat.cc +++ b/src/tools/core/grid_stat/grid_stat.cc @@ -2975,8 +2975,8 @@ void write_nc(const ConcatString &field_name, const DataPlane &dp, nc_var_sa.add(var_name); // Define the variable - nc_var = add_var(nc_out, (string) var_name, - ncFloat, lat_dim, lon_dim, deflate_level); + nc_var = add_var(nc_out, var_name.string(), ncFloat, + lat_dim, lon_dim, deflate_level); // Add variable attributes add_var_att_local(&nc_var, "name", nc_var.getName()); @@ -3094,7 +3094,7 @@ void write_nbrhd_nc(const DataPlane &fcst_dp, const DataPlane &obs_dp, if(fcst_flag) { // Define the forecast variable - fcst_var = add_var(nc_out, (string) fcst_var_name, ncFloat, + fcst_var = add_var(nc_out, fcst_var_name.string(), ncFloat, lat_dim, lon_dim, deflate_level); // Add to the list of previously defined variables @@ -3120,8 +3120,8 @@ void write_nbrhd_nc(const DataPlane &fcst_dp, const DataPlane &obs_dp, if(obs_flag) { // Define the observation variable - obs_var = add_var(nc_out, (string)obs_var_name, ncFloat, - lat_dim, lon_dim, deflate_level); + obs_var = add_var(nc_out, obs_var_name.string(), ncFloat, + lat_dim, lon_dim, deflate_level); // Add to the list of previously defined variables nc_var_sa.add(obs_var_name); diff --git a/src/tools/core/point_stat/point_stat.cc b/src/tools/core/point_stat/point_stat.cc index a26905b96d..8fb9550dc6 100644 --- a/src/tools/core/point_stat/point_stat.cc +++ b/src/tools/core/point_stat/point_stat.cc @@ -839,8 +839,8 @@ void process_obs_file(int i_nc) { if(use_var_id) var_names = met_point_obs->get_var_names(); const int buf_size = (obs_count > BUFFER_SIZE) ? BUFFER_SIZE : obs_count; - int obs_qty_idx_block[buf_size]; - float obs_arr_block[buf_size][OBS_ARRAY_LEN]; + vector obs_qty_idx_block(buf_size); + vector> obs_arr_block(buf_size); // Process each observation in the file int block_size; @@ -852,12 +852,14 @@ void process_obs_file(int i_nc) { #ifdef WITH_PYTHON if (use_python) status = met_point_obs->get_point_obs_data()->fill_obs_buf( - block_size, i_block_start_idx, (float *)obs_arr_block, obs_qty_idx_block); + block_size, i_block_start_idx, + (float *)obs_arr_block.data(), + obs_qty_idx_block.data()); else #endif status = nc_point_obs.read_obs_data(block_size, i_block_start_idx, - (float *)obs_arr_block, - obs_qty_idx_block, (char *)nullptr); + (float *)obs_arr_block.data(), + obs_qty_idx_block.data(), nullptr); if (!status) exit(1); int hdr_idx; diff --git a/src/tools/core/wavelet_stat/wavelet_stat.cc b/src/tools/core/wavelet_stat/wavelet_stat.cc index 99eef201c1..91f7915484 100644 --- a/src/tools/core/wavelet_stat/wavelet_stat.cc +++ b/src/tools/core/wavelet_stat/wavelet_stat.cc @@ -1552,8 +1552,8 @@ void write_nc_raw(const WaveletStatNcOutInfo & nc_info, const double *fdata, con d = conf_info.get_tile_dim(); int dim_count = get_dim_count(&fcst_var); - long lengths[dim_count]; - long offsets[dim_count]; + vector lengths(dim_count); + vector offsets(dim_count); offsets[0] = i_tile; offsets[1] = 0; @@ -1565,7 +1565,7 @@ void write_nc_raw(const WaveletStatNcOutInfo & nc_info, const double *fdata, con if ( nc_info.do_raw ) { // Write out the forecast field - if(!put_nc_data(&fcst_var, &fcst_data[0], lengths, offsets)) { + if(!put_nc_data(&fcst_var, &fcst_data[0], lengths.data(), offsets.data())) { mlog << Error << "\nwrite_nc_raw() -> " << "error with the fcst_var->put for field " << shc.get_fcst_var() << "\n\n"; @@ -1573,7 +1573,7 @@ void write_nc_raw(const WaveletStatNcOutInfo & nc_info, const double *fdata, con } // Write out the observation field - if(!put_nc_data(&obs_var, &obs_data[0], lengths, offsets)) { + if(!put_nc_data(&obs_var, &obs_data[0], lengths.data(), offsets.data())) { mlog << Error << "\nwrite_nc_raw() -> " << "error with the obs_var->put for field " << shc.get_obs_var() << "\n\n"; @@ -1585,7 +1585,7 @@ void write_nc_raw(const WaveletStatNcOutInfo & nc_info, const double *fdata, con if ( nc_info.do_diff ) { // Write out the difference field - if(!put_nc_data(&diff_var, &diff_data[0], lengths, offsets)) { + if(!put_nc_data(&diff_var, &diff_data[0], lengths.data(), offsets.data())) { mlog << Error << "\nwrite_nc_raw() -> " << "error with the diff_var->put for field " << shc.get_fcst_var() << "\n\n"; @@ -1800,8 +1800,8 @@ void write_nc_wav(const WaveletStatNcOutInfo & nc_info, const double *fdata, con d = conf_info.get_tile_dim(); int dim_count = get_dim_count(&fcst_var); - long lengths[dim_count]; - long offsets[dim_count]; + vector lengths(dim_count); + vector offsets(dim_count); offsets[0] = i_tile; offsets[1] = i_scale+1; @@ -1814,7 +1814,7 @@ void write_nc_wav(const WaveletStatNcOutInfo & nc_info, const double *fdata, con if ( nc_info.do_raw ) { // Write out the forecast field - if(!put_nc_data(&fcst_var, &fcst_data[0], lengths, offsets)) { + if(!put_nc_data(&fcst_var, &fcst_data[0], lengths.data(), offsets.data())) { mlog << Error << "\nwrite_nc_wav() -> " << "error with the fcst_var->put for field " << shc.get_fcst_var() << "\n\n"; @@ -1822,7 +1822,7 @@ void write_nc_wav(const WaveletStatNcOutInfo & nc_info, const double *fdata, con } // Write out the observation field - if(!put_nc_data(&obs_var, &obs_data[0], lengths, offsets)) { + if(!put_nc_data(&obs_var, &obs_data[0], lengths.data(), offsets.data())) { mlog << Error << "\nwrite_nc_wav() -> " << "error with the obs_var->put for field " << shc.get_obs_var() << "\n\n"; @@ -1835,7 +1835,7 @@ void write_nc_wav(const WaveletStatNcOutInfo & nc_info, const double *fdata, con // Write out the difference field - if(!put_nc_data(&diff_var, &diff_data[0], lengths, offsets)) { + if(!put_nc_data(&diff_var, &diff_data[0], lengths.data(), offsets.data())) { mlog << Error << "\nwrite_nc()_wav -> " << "error with the diff_var->put for field " << shc.get_fcst_var() << "\n\n"; diff --git a/src/tools/dev_utils/met_nc_file.cc b/src/tools/dev_utils/met_nc_file.cc index 43fad7cbfb..231f656919 100644 --- a/src/tools/dev_utils/met_nc_file.cc +++ b/src/tools/dev_utils/met_nc_file.cc @@ -153,8 +153,8 @@ bool MetNcFile::readFile(const int desired_grib_code, if (!IS_INVALID_NC(str_dim)) vld_len = strll_count; } - float *obs_arr = new float[obs_arr_len]; - float *hdr_arr = new float[hdr_arr_len]; + vector obs_arr(obs_arr_len); + vector hdr_arr(hdr_arr_len); mlog << Debug(2) << "Processing " << obs_count << " observations at " << hdr_count << " locations.\n"; @@ -162,9 +162,6 @@ bool MetNcFile::readFile(const int desired_grib_code, // Loop through the observations, saving the ones that we are // interested in - - - //int buf_size = ((nobs_count > DEF_NC_BUFFER_SIZE) ? DEF_NC_BUFFER_SIZE : (nobs_count)); int buf_size = obs_count; int hdr_buf_size = hdr_count; @@ -172,17 +169,15 @@ bool MetNcFile::readFile(const int desired_grib_code, // Allocate space to store the data // - char hdr_typ_str_full[hdr_buf_size][typ_len]; - char hdr_sid_str_full[hdr_buf_size][sid_len]; - char hdr_vld_str_full[hdr_buf_size][vld_len]; - //float **hdr_arr_full = (float **) nullptr, **obs_arr_block = (float **) nullptr; + vector hdr_typ_str_full(hdr_buf_size * typ_len); + vector hdr_sid_str_full(hdr_buf_size * sid_len); + vector hdr_vld_str_full(hdr_buf_size * vld_len); - float hdr_arr_full[hdr_buf_size][hdr_arr_len]; - float obs_arr_block[ buf_size][obs_arr_len]; - //char obs_qty_str_block[ buf_size][strl_count]; + vector hdr_arr_full(hdr_buf_size * hdr_arr_len); + vector obs_arr_block(buf_size * obs_arr_len); LongArray offsets; // = { 0, 0 }; - LongArray lengths; // = { 1, 1 }; + LongArray lengths; // = { 1, 1 }; offsets.add(0); offsets.add(0); @@ -193,7 +188,7 @@ bool MetNcFile::readFile(const int desired_grib_code, // Get the corresponding header message type // lengths[1] = typ_len; - if(!get_nc_data(&hdrTypeVar, (char *)&hdr_typ_str_full[0], lengths, offsets)) { + if(!get_nc_data(&hdrTypeVar, hdr_typ_str_full.data(), lengths, offsets)) { mlog << Error << "\nmain() -> " << "trouble getting hdr_typ\n\n"; exit(1); @@ -203,7 +198,7 @@ bool MetNcFile::readFile(const int desired_grib_code, // Get the corresponding header station id // lengths[1] = sid_len; - if(!get_nc_data(&hdrSidVar, (char *)&hdr_sid_str_full[0], lengths, offsets)) { + if(!get_nc_data(&hdrSidVar, hdr_sid_str_full.data(), lengths, offsets)) { mlog << Error << "\nmain() -> " << "trouble getting hdr_sid\n\n"; exit(1); @@ -213,7 +208,7 @@ bool MetNcFile::readFile(const int desired_grib_code, // Get the corresponding header valid time // lengths[1] = vld_len; - if(!get_nc_data(&hdrVldVar, (char *)&hdr_vld_str_full[0], lengths, offsets)) { + if(!get_nc_data(&hdrVldVar, hdr_vld_str_full.data(), lengths, offsets)) { mlog << Error << "\nmain() -> " << "trouble getting hdr_vld\n\n"; exit(1); @@ -223,30 +218,23 @@ bool MetNcFile::readFile(const int desired_grib_code, // Get the header for this observation // lengths[1] = hdr_arr_len; - if(!get_nc_data(&hdrArrVar, (float *)&hdr_arr_full[0], lengths, offsets)) { + if(!get_nc_data(&hdrArrVar, hdr_arr_full.data(), lengths, offsets)) { mlog << Error << "\nmain() -> " << "trouble getting hdr_arr\n\n"; exit(1); } - //for(int i_start=0; i_start DEF_NC_BUFFER_SIZE) ? DEF_NC_BUFFER_SIZE : (nobs_count-i_start); - offsets[0] = 0; lengths[0] = buf_size; lengths[1] = obs_arr_len; // Read the current observation message - if(!get_nc_data(&obsArrVar, (float *)&obs_arr_block[0], lengths, offsets)) { + if(!get_nc_data(&obsArrVar, obs_arr_block.data(), lengths, offsets)) { mlog << Error << "\nmain() -> trouble getting obs_arr\n\n"; exit(1); } lengths[1] = strl_count; - //if(!get_nc_data(&obs_arr_var, (char *)&obs_qty_str_block[0], lengths, offsets)) { - // mlog << Error << "\nmain() -> trouble getting obs_arr\n\n"; - // exit(1); - //} if (OBS_ARRAY_LEN == obs_arr_len) { for (unsigned int i = 0; i < GET_NC_SIZE_P(_nobsDim); ++i) @@ -254,7 +242,7 @@ bool MetNcFile::readFile(const int desired_grib_code, // Copy the current observation message for (int k=0; k < obs_arr_len; k++) - obs_arr[k] = obs_arr_block[i][k]; + obs_arr[k] = obs_arr_block[(i * obs_arr_len) + k]; if (obs_arr[0] >= 1.0E10 && obs_arr[1] >= 1.0E10) break; @@ -274,34 +262,33 @@ bool MetNcFile::readFile(const int desired_grib_code, // Get the corresponding header message type // Read the corresponding header array for this observation for (int k=0; k < hdr_arr_len; k++) - hdr_arr[k] = hdr_arr_full[hdr_index][k]; + hdr_arr[k] = hdr_arr_full[(hdr_index * hdr_arr_len) + k]; int str_length; char message_type_buffer[max_str_len]; char station_id_buffer[max_str_len]; char hdr_vld_buffer[max_str_len]; // Read the corresponding header type for this observation - str_length = m_strlen(hdr_typ_str_full[hdr_index]); + str_length = m_strlen(&hdr_typ_str_full.data()[hdr_index * typ_len]); if (str_length > typ_len) str_length = typ_len; - m_strncpy(message_type_buffer, hdr_typ_str_full[hdr_index], str_length, + m_strncpy(message_type_buffer, &hdr_typ_str_full.data()[hdr_index * typ_len], str_length, method_name.c_str(), "message_type_buffer"); message_type_buffer[str_length] = bad_data_char; // Read the corresponding header Station ID for this observation - str_length = m_strlen(hdr_sid_str_full[hdr_index]); + str_length = m_strlen(&hdr_sid_str_full.data()[hdr_index * sid_len]); if (str_length > sid_len) str_length = sid_len; - m_strncpy(station_id_buffer, hdr_sid_str_full[hdr_index], str_length, + m_strncpy(station_id_buffer, &hdr_sid_str_full.data()[hdr_index * sid_len], str_length, method_name.c_str(), "station_id_buffer"); station_id_buffer[str_length] = bad_data_char; // Read the corresponding valid time for this observation - str_length = m_strlen(hdr_vld_str_full[hdr_index]); + str_length = m_strlen(&hdr_vld_str_full.data()[hdr_index * vld_len]); if (str_length > vld_len) str_length = vld_len; - m_strncpy(hdr_vld_buffer, hdr_vld_str_full[hdr_index], str_length, + m_strncpy(hdr_vld_buffer, &hdr_vld_str_full.data()[hdr_index * vld_len], str_length, method_name.c_str(), "hdr_vld_buffer"); hdr_vld_buffer[str_length] = bad_data_char; - string message_type = message_type_buffer; if (message_type != desired_message_type) @@ -320,10 +307,6 @@ bool MetNcFile::readFile(const int desired_grib_code, observations.emplace_back(SDObservation(hdr_vld_buffer, obs_arr[4])); } // end for i } - // Cleanup - - if (obs_arr) { delete [] obs_arr; obs_arr = (float *) nullptr; } - if (hdr_arr) { delete [] hdr_arr; hdr_arr = (float *) nullptr; } return true; } diff --git a/src/tools/other/grid_diag/grid_diag.cc b/src/tools/other/grid_diag/grid_diag.cc index 0de43a8803..b25c36d828 100644 --- a/src/tools/other/grid_diag/grid_diag.cc +++ b/src/tools/other/grid_diag/grid_diag.cc @@ -242,7 +242,7 @@ const string get_tool_name() { //////////////////////////////////////////////////////////////////////// void process_series(void) { - DataPlane data_dp[conf_info.get_n_data()]; + vector data_dp(conf_info.get_n_data()); double min, max; StringArray *cur_files; GrdFileType *cur_ftype; diff --git a/src/tools/other/ioda2nc/ioda2nc.cc b/src/tools/other/ioda2nc/ioda2nc.cc index 949976ff05..6f215b8ca5 100644 --- a/src/tools/other/ioda2nc/ioda2nc.cc +++ b/src/tools/other/ioda2nc/ioda2nc.cc @@ -625,11 +625,11 @@ static void process_ioda_file(int i_pb) { } if(has_station_id) { - char tmp_sid[nstring+1]; - m_strncpy(tmp_sid, ioda_reader.station_ids[i_read].c_str(), + vector tmp_sid(nstring + 1); + m_strncpy(tmp_sid.data(), ioda_reader.station_ids[i_read].c_str(), nstring, method_name_s, "tmp_sid"); - m_replace_char(tmp_sid, ' ', '_'); - hdr_sid = tmp_sid; + m_replace_char(tmp_sid.data(), ' ', '_'); + hdr_sid = tmp_sid.data(); } else hdr_sid.clear(); diff --git a/src/tools/other/madis2nc/madis2nc.cc b/src/tools/other/madis2nc/madis2nc.cc index ccb4f5f0aa..f533905015 100644 --- a/src/tools/other/madis2nc/madis2nc.cc +++ b/src/tools/other/madis2nc/madis2nc.cc @@ -428,7 +428,8 @@ static bool get_filtered_nc_data(NcVar var, float *data, const char *method_name = "get_filtered_nc_data(float) "; if (IS_VALID_NC(var)) { - if(status = get_nc_data(&var, data, dim, cur)) { + + if((status = get_nc_data(&var, data, dim, cur))) { float in_fill_value; if (get_var_fill_value(&var, in_fill_value)) { @@ -475,7 +476,7 @@ static bool get_filtered_nc_data_2d(NcVar var, int *data, const LongArray &dim, if (IS_VALID_NC(var)) { - if(status = get_nc_data(&var, data, dim, cur)) { + if((status = get_nc_data(&var, data, dim, cur))) { int in_fill_value; if (get_var_fill_value(&var, in_fill_value)) { @@ -519,7 +520,7 @@ static bool get_filtered_nc_data_2d(NcVar var, float *data, const LongArray &dim if (IS_VALID_NC(var)) { - if(status = get_nc_data(&var, data, dim, cur)) { + if((status = get_nc_data(&var, data, dim, cur))) { float in_fill_value; if (get_var_fill_value(&var, in_fill_value)) { @@ -613,6 +614,7 @@ int process_obs(const int in_gc, const float conversion, const time_t valid_time, const double latitude, const double longitude, const double elevation) { int cur_processed_count = 0; + // // Check that the input variable contains valid data. // @@ -773,7 +775,7 @@ void process_madis_metar(NcFile *&f_in) { ConcatString hdr_typ, hdr_sid; float hdr_arr[HDR_ARRAY_LEN], obs_arr[OBS_ARRAY_LEN], conversion; float wdir, wind, ugrd, vgrd; - int count; + int count = 0; StringArray missing_vars, missing_qty_vars; const char *method_name = "process_madis_metar() "; @@ -906,98 +908,84 @@ void process_madis_metar(NcFile *&f_in) { dim[0] = buf_size; cur[0] = i_hdr_s; - float hdr_lat_arr[buf_size]; - float hdr_lon_arr[buf_size]; - float hdr_elv_arr[buf_size]; - double tmp_dbl_arr[buf_size]; - - float seaLevelPress[buf_size]; - float visibility[buf_size]; - float temperature[buf_size]; - float dewpoint[buf_size]; - float windDir[buf_size]; - float windSpeed[buf_size]; - float windGust[buf_size]; - float minTemp24Hour[buf_size]; - float maxTemp24Hour[buf_size]; - float precip1Hour[buf_size]; - float precip3Hour[buf_size]; - float precip6Hour[buf_size]; - float precip24Hour[buf_size]; - float snowCover[buf_size]; - - char seaLevelPressQty[buf_size]; - char visibilityQty[buf_size]; - char temperatureQty[buf_size]; - char dewpointQty[buf_size]; - char windDirQty[buf_size]; - char windSpeedQty[buf_size]; - char windGustQty[buf_size]; - char minTemp24HourQty[buf_size]; - char maxTemp24HourQty[buf_size]; - char precip1HourQty[buf_size]; - char precip3HourQty[buf_size]; - char precip6HourQty[buf_size]; - char precip24HourQty[buf_size]; - char snowCoverQty[buf_size]; - - char hdr_typ_arr[buf_size][hdr_typ_len]; - char hdr_sid_arr[buf_size][hdr_sid_len]; - - get_nc_data(&in_hdr_vld_var, &tmp_dbl_arr[0], buf_size, i_hdr_s); - get_nc_data(&in_hdr_lat_var, &hdr_lat_arr[0], buf_size, i_hdr_s); - get_nc_data(&in_hdr_lon_var, &hdr_lon_arr[0], buf_size, i_hdr_s); - get_filtered_nc_data(in_hdr_elv_var, &hdr_elv_arr[0], buf_size, i_hdr_s, "elevation"); - - if (IS_VALID_NC(seaLevelPressQty_var)) get_nc_data(&seaLevelPressQty_var, seaLevelPressQty, buf_size, i_hdr_s); - else memset(seaLevelPressQty, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(visibilityQty_var)) get_nc_data(&visibilityQty_var, visibilityQty, buf_size, i_hdr_s); - else memset(visibilityQty, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(temperatureQty_var)) get_nc_data(&temperatureQty_var, temperatureQty, buf_size, i_hdr_s); - else memset(temperatureQty, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(dewpointQty_var)) get_nc_data(&dewpointQty_var, dewpointQty, buf_size, i_hdr_s); - else memset(dewpointQty, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(windDirQty_var)) get_nc_data(&windDirQty_var, windDirQty, buf_size, i_hdr_s); - else memset(windDirQty, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(windSpeedQty_var)) get_nc_data(&windSpeedQty_var, windSpeedQty, buf_size, i_hdr_s); - else memset(windSpeedQty, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(windGustQty_var)) get_nc_data(&windGustQty_var, windGustQty, buf_size, i_hdr_s); - else memset(windGustQty, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(minTemp24HourQty_var)) get_nc_data(&minTemp24HourQty_var, minTemp24HourQty, buf_size, i_hdr_s); - else memset(minTemp24HourQty, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(maxTemp24HourQty_var)) get_nc_data(&maxTemp24HourQty_var, maxTemp24HourQty, buf_size, i_hdr_s); - else memset(maxTemp24HourQty, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(precip1HourQty_var)) get_nc_data(&precip1HourQty_var, precip1HourQty, buf_size, i_hdr_s); - else memset(precip1HourQty, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(precip3HourQty_var)) get_nc_data(&precip3HourQty_var, precip3HourQty, buf_size, i_hdr_s); - else memset(precip3HourQty, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(precip6HourQty_var)) get_nc_data(&precip6HourQty_var, precip6HourQty, buf_size, i_hdr_s); - else memset(precip6HourQty, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(precip24HourQty_var)) get_nc_data(&precip24HourQty_var, precip24HourQty, buf_size, i_hdr_s); - else memset(precip24HourQty, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(snowCoverQty_var)) get_nc_data(&snowCoverQty_var, snowCoverQty, buf_size, i_hdr_s); - else memset(snowCoverQty, 0, buf_size*sizeof(char)); - - get_filtered_nc_data(seaLevelPress_var, seaLevelPress, buf_size, i_hdr_s, "seaLevelPress" ); - get_filtered_nc_data(visibility_var, visibility, buf_size, i_hdr_s, "visibility" ); - get_filtered_nc_data(temperature_var, temperature, buf_size, i_hdr_s, "temperature" ); - get_filtered_nc_data(dewpoint_var, dewpoint, buf_size, i_hdr_s, "dewpoint" ); - get_filtered_nc_data(windDir_var, windDir, buf_size, i_hdr_s, "windDir" ); - get_filtered_nc_data(windSpeed_var, windSpeed, buf_size, i_hdr_s, "windSpeed" ); - get_filtered_nc_data(windGust_var, windGust, buf_size, i_hdr_s, "windGust" ); - get_filtered_nc_data(minTemp24Hour_var, minTemp24Hour, buf_size, i_hdr_s, "minTemp24Hour" ); - get_filtered_nc_data(maxTemp24Hour_var, maxTemp24Hour, buf_size, i_hdr_s, "maxTemp24Hour" ); - get_filtered_nc_data(precip1Hour_var, precip1Hour, buf_size, i_hdr_s, "precip1Hour" ); - get_filtered_nc_data(precip3Hour_var, precip3Hour, buf_size, i_hdr_s, "precip3Hour" ); - get_filtered_nc_data(precip6Hour_var, precip6Hour, buf_size, i_hdr_s, "precip6Hour" ); - get_filtered_nc_data(precip24Hour_var, precip24Hour, buf_size, i_hdr_s, "precip24Hour" ); - get_filtered_nc_data(snowCover_var, snowCover, buf_size, i_hdr_s, "snowCover" ); + vector hdr_lat_arr(buf_size); + vector hdr_lon_arr(buf_size); + vector hdr_elv_arr(buf_size); + vector tmp_dbl_arr(buf_size); + + vector seaLevelPress(buf_size); + vector visibility(buf_size); + vector temperature(buf_size); + vector dewpoint(buf_size); + vector windDir(buf_size); + vector windSpeed(buf_size); + vector windGust(buf_size); + vector minTemp24Hour(buf_size); + vector maxTemp24Hour(buf_size); + vector precip1Hour(buf_size); + vector precip3Hour(buf_size); + vector precip6Hour(buf_size); + vector precip24Hour(buf_size); + vector snowCover(buf_size); + + vector seaLevelPressQty(buf_size, 0); + vector visibilityQty(buf_size, 0); + vector temperatureQty(buf_size, 0); + vector dewpointQty(buf_size, 0); + vector windDirQty(buf_size, 0); + vector windSpeedQty(buf_size, 0); + vector windGustQty(buf_size, 0); + vector minTemp24HourQty(buf_size, 0); + vector maxTemp24HourQty(buf_size, 0); + vector precip1HourQty(buf_size, 0); + vector precip3HourQty(buf_size, 0); + vector precip6HourQty(buf_size, 0); + vector precip24HourQty(buf_size, 0); + vector snowCoverQty(buf_size, 0); + + vector hdr_typ_arr(buf_size * hdr_typ_len); + vector hdr_sid_arr(buf_size * hdr_sid_len); + + get_nc_data(&in_hdr_vld_var, tmp_dbl_arr.data(), buf_size, i_hdr_s); + get_nc_data(&in_hdr_lat_var, hdr_lat_arr.data(), buf_size, i_hdr_s); + get_nc_data(&in_hdr_lon_var, hdr_lon_arr.data(), buf_size, i_hdr_s); + get_filtered_nc_data(in_hdr_elv_var, hdr_elv_arr.data(), buf_size, i_hdr_s, "elevation"); + + if (IS_VALID_NC(seaLevelPressQty_var)) get_nc_data(&seaLevelPressQty_var, seaLevelPressQty.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(visibilityQty_var)) get_nc_data(&visibilityQty_var, visibilityQty.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(temperatureQty_var)) get_nc_data(&temperatureQty_var, temperatureQty.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(dewpointQty_var)) get_nc_data(&dewpointQty_var, dewpointQty.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(windDirQty_var)) get_nc_data(&windDirQty_var, windDirQty.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(windSpeedQty_var)) get_nc_data(&windSpeedQty_var, windSpeedQty.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(windGustQty_var)) get_nc_data(&windGustQty_var, windGustQty.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(minTemp24HourQty_var)) get_nc_data(&minTemp24HourQty_var, minTemp24HourQty.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(maxTemp24HourQty_var)) get_nc_data(&maxTemp24HourQty_var, maxTemp24HourQty.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(precip1HourQty_var)) get_nc_data(&precip1HourQty_var, precip1HourQty.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(precip3HourQty_var)) get_nc_data(&precip3HourQty_var, precip3HourQty.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(precip6HourQty_var)) get_nc_data(&precip6HourQty_var, precip6HourQty.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(precip24HourQty_var)) get_nc_data(&precip24HourQty_var, precip24HourQty.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(snowCoverQty_var)) get_nc_data(&snowCoverQty_var, snowCoverQty.data(), buf_size, i_hdr_s); + + get_filtered_nc_data(seaLevelPress_var, seaLevelPress.data(), buf_size, i_hdr_s, "seaLevelPress" ); + get_filtered_nc_data(visibility_var, visibility.data(), buf_size, i_hdr_s, "visibility" ); + get_filtered_nc_data(temperature_var, temperature.data(), buf_size, i_hdr_s, "temperature" ); + get_filtered_nc_data(dewpoint_var, dewpoint.data(), buf_size, i_hdr_s, "dewpoint" ); + get_filtered_nc_data(windDir_var, windDir.data(), buf_size, i_hdr_s, "windDir" ); + get_filtered_nc_data(windSpeed_var, windSpeed.data(), buf_size, i_hdr_s, "windSpeed" ); + get_filtered_nc_data(windGust_var, windGust.data(), buf_size, i_hdr_s, "windGust" ); + get_filtered_nc_data(minTemp24Hour_var, minTemp24Hour.data(), buf_size, i_hdr_s, "minTemp24Hour" ); + get_filtered_nc_data(maxTemp24Hour_var, maxTemp24Hour.data(), buf_size, i_hdr_s, "maxTemp24Hour" ); + get_filtered_nc_data(precip1Hour_var, precip1Hour.data(), buf_size, i_hdr_s, "precip1Hour" ); + get_filtered_nc_data(precip3Hour_var, precip3Hour.data(), buf_size, i_hdr_s, "precip3Hour" ); + get_filtered_nc_data(precip6Hour_var, precip6Hour.data(), buf_size, i_hdr_s, "precip6Hour" ); + get_filtered_nc_data(precip24Hour_var, precip24Hour.data(), buf_size, i_hdr_s, "precip24Hour" ); + get_filtered_nc_data(snowCover_var, snowCover.data(), buf_size, i_hdr_s, "snowCover" ); dim[0] = buf_size; dim[1] = hdr_typ_len; - get_nc_data(&in_hdr_typ_var, (char *)&hdr_typ_arr[0], dim, cur); + get_nc_data(&in_hdr_typ_var, hdr_typ_arr.data(), dim, cur); dim[1] = hdr_sid_len; - get_nc_data(&in_hdr_sid_var, (char *)&hdr_sid_arr[0], dim, cur); + get_nc_data(&in_hdr_sid_var, hdr_sid_arr.data(), dim, cur); for (i_idx=0; i_idx BUFFER_SIZE) ? BUFFER_SIZE: (my_rec_end - i_hdr_s); - int nlvl_manLevel[buf_size]; - int nlvl_sigTLevel[buf_size]; - int nlvl_sigWLevel[buf_size]; - int nlvl_sigPresWLevel[buf_size]; - int nlvl_mTropNum[buf_size]; - int nlvl_mWndNum[buf_size]; - - float hdr_lat_arr[buf_size]; - float hdr_lon_arr[buf_size]; - float hdr_elv_arr[buf_size]; - double tmp_dbl_arr[buf_size]; - - float prMan[buf_size][maxlvl_manLevel]; - float htMan[buf_size][maxlvl_manLevel]; - float tpMan[buf_size][maxlvl_manLevel]; - float tdMan[buf_size][maxlvl_manLevel]; - float wdMan[buf_size][maxlvl_manLevel]; - float wsMan[buf_size][maxlvl_manLevel]; - float prSigT[buf_size][maxlvl_sigTLevel]; - float tpSigT[buf_size][maxlvl_sigTLevel]; - float tdSigT[buf_size][maxlvl_sigTLevel]; - float htSigW[buf_size][maxlvl_sigWLevel]; - float wdSigW[buf_size][maxlvl_sigWLevel]; - float wsSigW[buf_size][maxlvl_sigWLevel]; - float prSigW[buf_size][maxlvl_sigPresWLevel]; - float wdSigPrW[buf_size][maxlvl_sigPresWLevel]; - float wsSigPrW[buf_size][maxlvl_sigPresWLevel]; - float prTrop[buf_size][maxlvl_mTropNum]; - float tpTrop[buf_size][maxlvl_mTropNum]; - float tdTrop[buf_size][maxlvl_mTropNum]; - float wdTrop[buf_size][maxlvl_mTropNum]; - float wsTrop[buf_size][maxlvl_mTropNum]; - float prMaxW[buf_size][maxlvl_mWndNum]; - float wdMaxW[buf_size][maxlvl_mWndNum]; - float wsMaxW[buf_size][maxlvl_mWndNum]; - - char prManQty[buf_size][maxlvl_manLevel]; - char htManQty[buf_size][maxlvl_manLevel]; - char tpManQty[buf_size][maxlvl_manLevel]; - char tdManQty[buf_size][maxlvl_manLevel]; - char wdManQty[buf_size][maxlvl_manLevel]; - char wsManQty[buf_size][maxlvl_manLevel]; - char prSigTQty[buf_size][maxlvl_sigTLevel]; - char tpSigTQty[buf_size][maxlvl_sigTLevel]; - char tdSigTQty[buf_size][maxlvl_sigTLevel]; - char htSigWQty[buf_size][maxlvl_sigWLevel]; - char wdSigWQty[buf_size][maxlvl_sigWLevel]; - char wsSigWQty[buf_size][maxlvl_sigWLevel]; - char prSigWQty[buf_size][maxlvl_sigPresWLevel]; - char wdSigPrWQty[buf_size][maxlvl_sigPresWLevel]; - char wsSigPrWQty[buf_size][maxlvl_sigPresWLevel]; - char prTropQty[buf_size][maxlvl_mTropNum]; - char tpTropQty[buf_size][maxlvl_mTropNum]; - char tdTropQty[buf_size][maxlvl_mTropNum]; - char wdTropQty[buf_size][maxlvl_mTropNum]; - char wsTropQty[buf_size][maxlvl_mTropNum]; - char prMaxWQty[buf_size][maxlvl_mWndNum]; - char wdMaxWQty[buf_size][maxlvl_mWndNum]; - char wsMaxWQty[buf_size][maxlvl_mWndNum]; - - //char hdr_typ_arr[buf_size][hdr_typ_len]; - char hdr_sid_arr[buf_size][hdr_sid_len]; - //char *hdr_typ_arr_ptr = &hdr_typ_arr[0]; - //char *hdr_sid_arr_ptr = &hdr_sid_arr[0]; + vector nlvl_manLevel(buf_size); + vector nlvl_sigTLevel(buf_size); + vector nlvl_sigWLevel(buf_size); + vector nlvl_sigPresWLevel(buf_size); + vector nlvl_mTropNum(buf_size); + vector nlvl_mWndNum(buf_size); + + vector hdr_lat_arr(buf_size); + vector hdr_lon_arr(buf_size); + vector hdr_elv_arr(buf_size); + vector tmp_dbl_arr(buf_size); + + vector prMan(buf_size * maxlvl_manLevel); + vector htMan(buf_size * maxlvl_manLevel); + vector tpMan(buf_size * maxlvl_manLevel); + vector tdMan(buf_size * maxlvl_manLevel); + vector wdMan(buf_size * maxlvl_manLevel); + vector wsMan(buf_size * maxlvl_manLevel); + vector prSigT(buf_size * maxlvl_sigTLevel); + vector tpSigT(buf_size * maxlvl_sigTLevel); + vector tdSigT(buf_size * maxlvl_sigTLevel); + vector htSigW(buf_size * maxlvl_sigWLevel); + vector wdSigW(buf_size * maxlvl_sigWLevel); + vector wsSigW(buf_size * maxlvl_sigWLevel); + vector prSigW(buf_size * maxlvl_sigPresWLevel); + vector wdSigPrW(buf_size * maxlvl_sigPresWLevel); + vector wsSigPrW(buf_size * maxlvl_sigPresWLevel); + vector prTrop(buf_size * maxlvl_mTropNum); + vector tpTrop(buf_size * maxlvl_mTropNum); + vector tdTrop(buf_size * maxlvl_mTropNum); + vector wdTrop(buf_size * maxlvl_mTropNum); + vector wsTrop(buf_size * maxlvl_mTropNum); + vector prMaxW(buf_size * maxlvl_mWndNum); + vector wdMaxW(buf_size * maxlvl_mWndNum); + vector wsMaxW(buf_size * maxlvl_mWndNum); + + vector prManQty(buf_size * maxlvl_manLevel, 0); + vector htManQty(buf_size * maxlvl_manLevel, 0); + vector tpManQty(buf_size * maxlvl_manLevel, 0); + vector tdManQty(buf_size * maxlvl_manLevel, 0); + vector wdManQty(buf_size * maxlvl_manLevel, 0); + vector wsManQty(buf_size * maxlvl_manLevel, 0); + vector prSigTQty(buf_size * maxlvl_sigTLevel, 0); + vector tpSigTQty(buf_size * maxlvl_sigTLevel, 0); + vector tdSigTQty(buf_size * maxlvl_sigTLevel, 0); + vector htSigWQty(buf_size * maxlvl_sigWLevel, 0); + vector wdSigWQty(buf_size * maxlvl_sigWLevel, 0); + vector wsSigWQty(buf_size * maxlvl_sigWLevel, 0); + vector prSigWQty(buf_size * maxlvl_sigPresWLevel, 0); + vector wdSigPrWQty(buf_size * maxlvl_sigPresWLevel, 0); + vector wsSigPrWQty(buf_size * maxlvl_sigPresWLevel, 0); + vector prTropQty(buf_size * maxlvl_mTropNum, 0); + vector tpTropQty(buf_size * maxlvl_mTropNum, 0); + vector tdTropQty(buf_size * maxlvl_mTropNum, 0); + vector wdTropQty(buf_size * maxlvl_mTropNum, 0); + vector wsTropQty(buf_size * maxlvl_mTropNum, 0); + vector prMaxWQty(buf_size * maxlvl_mWndNum, 0); + vector wdMaxWQty(buf_size * maxlvl_mWndNum, 0); + vector wsMaxWQty(buf_size * maxlvl_mWndNum, 0); + + vector hdr_sid_arr(buf_size * hdr_sid_len); cur[0] = i_hdr_s; dim[0] = buf_size; - get_nc_data(&in_man_var, nlvl_manLevel, buf_size, i_hdr_s); - get_nc_data(&in_sigt_var, nlvl_sigTLevel, buf_size, i_hdr_s); - get_nc_data(&in_sigw_var, nlvl_sigWLevel, buf_size, i_hdr_s); - get_nc_data(&in_sigprw_var, nlvl_sigPresWLevel, buf_size, i_hdr_s); - get_nc_data(&in_trop_var, nlvl_mTropNum, buf_size, i_hdr_s); - get_nc_data(&in_maxw_var, nlvl_mWndNum, buf_size, i_hdr_s); + get_nc_data(&in_man_var, nlvl_manLevel.data(), buf_size, i_hdr_s); + get_nc_data(&in_sigt_var, nlvl_sigTLevel.data(), buf_size, i_hdr_s); + get_nc_data(&in_sigw_var, nlvl_sigWLevel.data(), buf_size, i_hdr_s); + get_nc_data(&in_sigprw_var, nlvl_sigPresWLevel.data(), buf_size, i_hdr_s); + get_nc_data(&in_trop_var, nlvl_mTropNum.data(), buf_size, i_hdr_s); + get_nc_data(&in_maxw_var, nlvl_mWndNum.data(), buf_size, i_hdr_s); - if (!get_nc_data(&in_hdr_vld_var, tmp_dbl_arr, buf_size, i_hdr_s)) { + if (!get_nc_data(&in_hdr_vld_var, tmp_dbl_arr.data(), buf_size, i_hdr_s)) { for (int dIdx=0; dIdx BUFFER_SIZE) ? BUFFER_SIZE: (my_rec_end - i_hdr_s); - float hdr_lat_arr[buf_size]; - float hdr_lon_arr[buf_size]; - float hdr_elv_arr[buf_size]; - double tmp_dbl_arr[buf_size]; - char hdr_sid_arr[buf_size][hdr_sid_len]; - - float pressure_arr[buf_size]; - float levels_arr[buf_size][nlvl]; - float uComponent_arr[buf_size][nlvl]; - float vComponent_arr[buf_size][nlvl]; - char uComponentQty_arr[buf_size][nlvl]; - char vComponentQty_arr[buf_size][nlvl]; + vector hdr_lat_arr(buf_size); + vector hdr_lon_arr(buf_size); + vector hdr_elv_arr(buf_size); + vector tmp_dbl_arr(buf_size); + vector hdr_sid_arr(buf_size * hdr_sid_len); + + vector pressure_arr(buf_size); + vector levels_arr(buf_size * nlvl); + vector uComponent_arr(buf_size * nlvl); + vector vComponent_arr(buf_size * nlvl); + vector uComponentQty_arr(buf_size * nlvl, 0); + vector vComponentQty_arr(buf_size * nlvl, 0); // 1D variables - get_nc_data(&in_hdr_vld_var, tmp_dbl_arr, buf_size, i_hdr_s); - get_nc_data(&in_hdr_lat_var, hdr_lat_arr, buf_size, i_hdr_s); - get_nc_data(&in_hdr_lon_var, hdr_lon_arr, buf_size, i_hdr_s); - get_filtered_nc_data(in_hdr_elv_var, hdr_elv_arr, buf_size, i_hdr_s, "eleveation"); - get_filtered_nc_data(in_pressure_var, pressure_arr, buf_size, i_hdr_s, "pressure"); + get_nc_data(&in_hdr_vld_var, tmp_dbl_arr.data(), buf_size, i_hdr_s); + get_nc_data(&in_hdr_lat_var, hdr_lat_arr.data(), buf_size, i_hdr_s); + get_nc_data(&in_hdr_lon_var, hdr_lon_arr.data(), buf_size, i_hdr_s); + get_filtered_nc_data(in_hdr_elv_var, hdr_elv_arr.data(), buf_size, i_hdr_s, "elevation"); + get_filtered_nc_data(in_pressure_var, pressure_arr.data(), buf_size, i_hdr_s, "pressure"); cur[0] = i_hdr_s; dim[0] = buf_size; dim[1] = hdr_sid_len; - get_nc_data(&in_hdr_sid_var, (char *)hdr_sid_arr, dim, cur); + get_nc_data(&in_hdr_sid_var, hdr_sid_arr.data(), dim, cur); dim[1] = nlvl; - get_nc_data(&var_levels, (float *)levels_arr, dim, cur); + get_nc_data(&var_levels, levels_arr.data(), dim, cur); int data_cnt = buf_size * nlvl; - if (IS_VALID_NC(in_uComponentQty_var)) get_nc_data(&in_uComponentQty_var, (char *)uComponentQty_arr, dim, cur); - else memset(uComponentQty_arr, 0, data_cnt*sizeof(char)); - if (IS_VALID_NC(in_vComponentQty_var)) get_nc_data(&in_vComponentQty_var, (char *)vComponentQty_arr, dim, cur); - else memset(vComponentQty_arr, 0, data_cnt*sizeof(char)); + if (IS_VALID_NC(in_uComponentQty_var)) get_nc_data(&in_uComponentQty_var, uComponentQty_arr.data(), dim, cur); + if (IS_VALID_NC(in_vComponentQty_var)) get_nc_data(&in_vComponentQty_var, vComponentQty_arr.data(), dim, cur); - get_filtered_nc_data_2d(in_uComponent_var, (float *)uComponent_arr, dim, cur, "uComponent", data_cnt); - get_filtered_nc_data_2d(in_vComponent_var, (float *)vComponent_arr, dim, cur, "vComponent", data_cnt); + get_filtered_nc_data_2d(in_uComponent_var, uComponent_arr.data(), dim, cur, "uComponent", data_cnt); + get_filtered_nc_data_2d(in_vComponent_var, vComponent_arr.data(), dim, cur, "vComponent", data_cnt); for (int i_idx=0; i_idx BUFFER_SIZE) ? BUFFER_SIZE: (my_rec_end - i_hdr_s); - float hdr_lat_arr[buf_size]; - float hdr_lon_arr[buf_size]; - float hdr_elv_arr[buf_size]; - double tmp_dbl_arr[buf_size]; - char hdr_sid_arr[buf_size][hdr_sid_len]; - - float pressure_arr[buf_size]; - - float windDir_arr[buf_size]; - float windSpeed_arr[buf_size]; - float temperature_arr[buf_size]; - float dewpoint_arr[buf_size]; - float seaLevelPress_arr[buf_size]; - float windGust_arr[buf_size]; - float precip1Hour_arr[buf_size]; - float precip6Hour_arr[buf_size]; - float precip12Hour_arr[buf_size]; - float precip18Hour_arr[buf_size]; - float precip24Hour_arr[buf_size]; - char windDirQty_arr[buf_size]; - char windSpeedQty_arr[buf_size]; - char temperatureQty_arr[buf_size]; - char dewpointQty_arr[buf_size]; - char seaLevelPressQty_arr[buf_size]; - char windGustQty_arr[buf_size]; - char precip1HourQty_arr[buf_size]; - char precip6HourQty_arr[buf_size]; - char precip12HourQty_arr[buf_size]; - char precip18HourQty_arr[buf_size]; - char precip24HourQty_arr[buf_size]; + vector hdr_lat_arr(buf_size); + vector hdr_lon_arr(buf_size); + vector hdr_elv_arr(buf_size); + vector tmp_dbl_arr(buf_size); + vector hdr_sid_arr(buf_size * hdr_sid_len); + + vector pressure_arr(buf_size); + + vector windDir_arr(buf_size); + vector windSpeed_arr(buf_size); + vector temperature_arr(buf_size); + vector dewpoint_arr(buf_size); + vector seaLevelPress_arr(buf_size); + vector windGust_arr(buf_size); + vector precip1Hour_arr(buf_size); + vector precip6Hour_arr(buf_size); + vector precip12Hour_arr(buf_size); + vector precip18Hour_arr(buf_size); + vector precip24Hour_arr(buf_size); + vector windDirQty_arr(buf_size, 0); + vector windSpeedQty_arr(buf_size, 0); + vector temperatureQty_arr(buf_size, 0); + vector dewpointQty_arr(buf_size, 0); + vector seaLevelPressQty_arr(buf_size, 0); + vector windGustQty_arr(buf_size, 0); + vector precip1HourQty_arr(buf_size, 0); + vector precip6HourQty_arr(buf_size, 0); + vector precip12HourQty_arr(buf_size, 0); + vector precip18HourQty_arr(buf_size, 0); + vector precip24HourQty_arr(buf_size, 0); cur[0] = i_hdr_s; dim[0] = buf_size; - get_nc_data(&in_hdr_vld_var, tmp_dbl_arr, buf_size, i_hdr_s); - get_nc_data(&in_hdr_lat_var, hdr_lat_arr, buf_size, i_hdr_s); - get_nc_data(&in_hdr_lon_var, hdr_lon_arr, buf_size, i_hdr_s); - get_filtered_nc_data(in_hdr_elv_var, hdr_elv_arr, buf_size, i_hdr_s, "eleveation"); - - if (IS_VALID_NC(in_windDirQty_var)) get_nc_data(&in_windDirQty_var, windDirQty_arr, buf_size, i_hdr_s); - else memset(windDirQty_arr, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(in_windSpeedQty_var)) get_nc_data(&in_windSpeedQty_var, windSpeedQty_arr, buf_size, i_hdr_s); - else memset(windSpeedQty_arr, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(in_temperatureQty_var)) get_nc_data(&in_temperatureQty_var, temperatureQty_arr, buf_size, i_hdr_s); - else memset(temperatureQty_arr, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(in_dewpointQty_var)) get_nc_data(&in_dewpointQty_var, dewpointQty_arr, buf_size, i_hdr_s); - else memset(dewpointQty_arr, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(in_seaLevelPressQty_var)) get_nc_data(&in_seaLevelPressQty_var, seaLevelPressQty_arr, buf_size, i_hdr_s); - else memset(seaLevelPressQty_arr, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(in_windGustQty_var)) get_nc_data(&in_windGustQty_var, windGustQty_arr, buf_size, i_hdr_s); - else memset(windGustQty_arr, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(in_precip1HourQty_var)) get_nc_data(&in_precip1HourQty_var, precip1HourQty_arr, buf_size, i_hdr_s); - else memset(precip1HourQty_arr, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(in_precip6HourQty_var)) get_nc_data(&in_precip6HourQty_var, precip6HourQty_arr, buf_size, i_hdr_s); - else memset(precip6HourQty_arr, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(in_precip12HourQty_var)) get_nc_data(&in_precip12HourQty_var, precip12HourQty_arr, buf_size, i_hdr_s); - else memset(precip12HourQty_arr, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(in_precip18HourQty_var)) get_nc_data(&in_precip18HourQty_var, precip18HourQty_arr, buf_size, i_hdr_s); - else memset(precip18HourQty_arr, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(in_precip24HourQty_var)) get_nc_data(&in_precip24HourQty_var, precip24HourQty_arr, buf_size, i_hdr_s); - else memset(precip24HourQty_arr, 0, buf_size*sizeof(char)); - - get_filtered_nc_data(in_pressure_var, pressure_arr, buf_size, i_hdr_s, "pressure" ); - get_filtered_nc_data(in_windDir_var, windDir_arr, buf_size, i_hdr_s, "windDir" ); - get_filtered_nc_data(in_windSpeed_var, windSpeed_arr, buf_size, i_hdr_s, "windSpeed" ); - get_filtered_nc_data(in_temperature_var, temperature_arr, buf_size, i_hdr_s, "temperature" ); - get_filtered_nc_data(in_dewpoint_var, dewpoint_arr, buf_size, i_hdr_s, "dewpoint" ); - get_filtered_nc_data(in_seaLevelPress_var, seaLevelPress_arr, buf_size, i_hdr_s, "seaLevelPress"); - get_filtered_nc_data(in_windGust_var, windGust_arr, buf_size, i_hdr_s, "windGust" ); - get_filtered_nc_data(in_precip1Hour_var, precip1Hour_arr, buf_size, i_hdr_s, "precip1Hour" ); - get_filtered_nc_data(in_precip6Hour_var, precip6Hour_arr, buf_size, i_hdr_s, "precip6Hour" ); - get_filtered_nc_data(in_precip12Hour_var, precip12Hour_arr, buf_size, i_hdr_s, "precip12Hour" ); - get_filtered_nc_data(in_precip18Hour_var, precip18Hour_arr, buf_size, i_hdr_s, "precip18Hour" ); - get_filtered_nc_data(in_precip24Hour_var, precip24Hour_arr, buf_size, i_hdr_s, "precip24Hour" ); + get_nc_data(&in_hdr_vld_var, tmp_dbl_arr.data(), buf_size, i_hdr_s); + get_nc_data(&in_hdr_lat_var, hdr_lat_arr.data(), buf_size, i_hdr_s); + get_nc_data(&in_hdr_lon_var, hdr_lon_arr.data(), buf_size, i_hdr_s); + get_filtered_nc_data(in_hdr_elv_var, hdr_elv_arr.data(), buf_size, i_hdr_s, "elevation"); + + if (IS_VALID_NC(in_windDirQty_var)) get_nc_data(&in_windDirQty_var, windDirQty_arr.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(in_windSpeedQty_var)) get_nc_data(&in_windSpeedQty_var, windSpeedQty_arr.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(in_temperatureQty_var)) get_nc_data(&in_temperatureQty_var, temperatureQty_arr.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(in_dewpointQty_var)) get_nc_data(&in_dewpointQty_var, dewpointQty_arr.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(in_seaLevelPressQty_var)) get_nc_data(&in_seaLevelPressQty_var, seaLevelPressQty_arr.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(in_windGustQty_var)) get_nc_data(&in_windGustQty_var, windGustQty_arr.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(in_precip1HourQty_var)) get_nc_data(&in_precip1HourQty_var, precip1HourQty_arr.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(in_precip6HourQty_var)) get_nc_data(&in_precip6HourQty_var, precip6HourQty_arr.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(in_precip12HourQty_var)) get_nc_data(&in_precip12HourQty_var, precip12HourQty_arr.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(in_precip18HourQty_var)) get_nc_data(&in_precip18HourQty_var, precip18HourQty_arr.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(in_precip24HourQty_var)) get_nc_data(&in_precip24HourQty_var, precip24HourQty_arr.data(), buf_size, i_hdr_s); + + get_filtered_nc_data(in_pressure_var, pressure_arr.data(), buf_size, i_hdr_s, "pressure" ); + get_filtered_nc_data(in_windDir_var, windDir_arr.data(), buf_size, i_hdr_s, "windDir" ); + get_filtered_nc_data(in_windSpeed_var, windSpeed_arr.data(), buf_size, i_hdr_s, "windSpeed" ); + get_filtered_nc_data(in_temperature_var, temperature_arr.data(), buf_size, i_hdr_s, "temperature" ); + get_filtered_nc_data(in_dewpoint_var, dewpoint_arr.data(), buf_size, i_hdr_s, "dewpoint" ); + get_filtered_nc_data(in_seaLevelPress_var, seaLevelPress_arr.data(), buf_size, i_hdr_s, "seaLevelPress"); + get_filtered_nc_data(in_windGust_var, windGust_arr.data(), buf_size, i_hdr_s, "windGust" ); + get_filtered_nc_data(in_precip1Hour_var, precip1Hour_arr.data(), buf_size, i_hdr_s, "precip1Hour" ); + get_filtered_nc_data(in_precip6Hour_var, precip6Hour_arr.data(), buf_size, i_hdr_s, "precip6Hour" ); + get_filtered_nc_data(in_precip12Hour_var, precip12Hour_arr.data(), buf_size, i_hdr_s, "precip12Hour" ); + get_filtered_nc_data(in_precip18Hour_var, precip18Hour_arr.data(), buf_size, i_hdr_s, "precip18Hour" ); + get_filtered_nc_data(in_precip24Hour_var, precip24Hour_arr.data(), buf_size, i_hdr_s, "precip24Hour" ); dim[1] = hdr_sid_len; - get_nc_data(&in_hdr_sid_var, (char *)hdr_sid_arr, dim, cur); + get_nc_data(&in_hdr_sid_var, hdr_sid_arr.data(), dim, cur); dim[0] = 1; dim[1] = 1; @@ -2498,15 +2456,14 @@ void process_madis_maritime(NcFile *&f_in) { hdr_arr[2] = hdr_elv_arr[i_idx]; // - // Check masking regions. + // Process the station name. // - if(!check_masks(hdr_arr[0], hdr_arr[1], hdr_sid_arr[i_idx])) continue; - + hdr_sid = &hdr_sid_arr.data()[i_idx * hdr_sid_len]; // - // Process the station name. + // Check masking regions. // - hdr_sid = hdr_sid_arr[i_idx]; + if(!check_masks(hdr_arr[0], hdr_arr[1], hdr_sid.c_str())) continue; // // Process the observation time. @@ -2638,7 +2595,7 @@ void process_madis_mesonet(NcFile *&f_in) { ConcatString hdr_typ, hdr_sid; float hdr_arr[HDR_ARRAY_LEN], obs_arr[OBS_ARRAY_LEN], conversion; float wdir, wind, ugrd, vgrd; - int count; + int count = 0; StringArray missing_vars, missing_qty_vars; const char *method_name = "process_madis_mesonet() "; @@ -2802,141 +2759,118 @@ void process_madis_mesonet(NcFile *&f_in) { // for(i_hdr_s=rec_beg; i_hdr_s BUFFER_SIZE) ? BUFFER_SIZE: (my_rec_end - i_hdr_s); - float hdr_lat_arr[buf_size]; - float hdr_lon_arr[buf_size]; - float hdr_elv_arr[buf_size]; - double tmp_dbl_arr[buf_size]; - char hdr_sid_arr[buf_size][hdr_sid_len]; - - float temperature_arr[buf_size]; - float dewpoint_arr[buf_size]; - float relHumidity_arr[buf_size]; - float stationPressure_arr[buf_size]; - float seaLevelPressure_arr[buf_size]; - float windDir_arr[buf_size]; - float windSpeed_arr[buf_size]; - float windGust_arr[buf_size]; - float visibility_arr[buf_size]; - float precipRate_arr[buf_size]; - float solarRadiation_arr[buf_size]; - float seaSurfaceTemp_arr[buf_size]; - float totalColumnPWV_arr[buf_size]; - float soilTemperature_arr[buf_size]; - float minTemp24Hour_arr[buf_size]; - float maxTemp24Hour_arr[buf_size]; - float precip3hr_arr[buf_size]; - float precip6hr_arr[buf_size]; - float precip12hr_arr[buf_size]; - float precip10min_arr[buf_size]; - float precip1min_arr[buf_size]; - float windDir10_arr[buf_size]; - float windSpeed10_arr[buf_size]; - - char temperatureQty_arr[buf_size]; - char dewpointQty_arr[buf_size]; - char relHumidityQty_arr[buf_size]; - char stationPressureQty_arr[buf_size]; - char seaLevelPressureQty_arr[buf_size]; - char windDirQty_arr[buf_size]; - char windSpeedQty_arr[buf_size]; - char windGustQty_arr[buf_size]; - char visibilityQty_arr[buf_size]; - char precipRateQty_arr[buf_size]; - char solarRadiationQty_arr[buf_size]; - char seaSurfaceTempQty_arr[buf_size]; - char totalColumnPWVQty_arr[buf_size]; - char soilTemperatureQty_arr[buf_size]; - char minTemp24HourQty_arr[buf_size]; - char maxTemp24HourQty_arr[buf_size]; - char precip3hrQty_arr[buf_size]; - char precip6hrQty_arr[buf_size]; - char precip12hrQty_arr[buf_size]; - char precip10minQty_arr[buf_size]; - char precip1minQty_arr[buf_size]; - char windDir10Qty_arr[buf_size]; - char windSpeed10Qty_arr[buf_size]; + vector hdr_lat_arr(buf_size); + vector hdr_lon_arr(buf_size); + vector hdr_elv_arr(buf_size); + vector tmp_dbl_arr(buf_size); + vector hdr_sid_arr(buf_size * hdr_sid_len); + + vector temperature_arr(buf_size); + vector dewpoint_arr(buf_size); + vector relHumidity_arr(buf_size); + vector stationPressure_arr(buf_size); + vector seaLevelPressure_arr(buf_size); + vector windDir_arr(buf_size); + vector windSpeed_arr(buf_size); + vector windGust_arr(buf_size); + vector visibility_arr(buf_size); + vector precipRate_arr(buf_size); + vector solarRadiation_arr(buf_size); + vector seaSurfaceTemp_arr(buf_size); + vector totalColumnPWV_arr(buf_size); + vector soilTemperature_arr(buf_size); + vector minTemp24Hour_arr(buf_size); + vector maxTemp24Hour_arr(buf_size); + vector precip3hr_arr(buf_size); + vector precip6hr_arr(buf_size); + vector precip12hr_arr(buf_size); + vector precip10min_arr(buf_size); + vector precip1min_arr(buf_size); + vector windDir10_arr(buf_size); + vector windSpeed10_arr(buf_size); + + vector temperatureQty_arr(buf_size, 0); + vector dewpointQty_arr(buf_size, 0); + vector relHumidityQty_arr(buf_size, 0); + vector stationPressureQty_arr(buf_size, 0); + vector seaLevelPressureQty_arr(buf_size, 0); + vector windDirQty_arr(buf_size, 0); + vector windSpeedQty_arr(buf_size, 0); + vector windGustQty_arr(buf_size, 0); + vector visibilityQty_arr(buf_size, 0); + vector precipRateQty_arr(buf_size, 0); + vector solarRadiationQty_arr(buf_size, 0); + vector seaSurfaceTempQty_arr(buf_size, 0); + vector totalColumnPWVQty_arr(buf_size, 0); + vector soilTemperatureQty_arr(buf_size, 0); + vector minTemp24HourQty_arr(buf_size, 0); + vector maxTemp24HourQty_arr(buf_size, 0); + vector precip3hrQty_arr(buf_size, 0); + vector precip6hrQty_arr(buf_size, 0); + vector precip12hrQty_arr(buf_size, 0); + vector precip10minQty_arr(buf_size, 0); + vector precip1minQty_arr(buf_size, 0); + vector windDir10Qty_arr(buf_size, 0); + vector windSpeed10Qty_arr(buf_size, 0); cur[0] = i_hdr_s; dim[0] = buf_size; - get_nc_data(&in_hdr_vld_var, tmp_dbl_arr, buf_size, i_hdr_s); - get_nc_data(&in_hdr_lat_var, hdr_lat_arr, buf_size, i_hdr_s); - get_nc_data(&in_hdr_lon_var, hdr_lon_arr, buf_size, i_hdr_s); - get_filtered_nc_data(in_hdr_elv_var, hdr_elv_arr, buf_size, i_hdr_s, "eleveation"); - - if (IS_VALID_NC(in_temperatureQty_var)) get_nc_data(&in_temperatureQty_var, temperatureQty_arr, buf_size, i_hdr_s); - else memset(temperatureQty_arr, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(in_dewpointQty_var)) get_nc_data(&in_dewpointQty_var, dewpointQty_arr, buf_size, i_hdr_s); - else memset(dewpointQty_arr, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(in_relHumidityQty_var)) get_nc_data(&in_relHumidityQty_var, relHumidityQty_arr, buf_size, i_hdr_s); - else memset(relHumidityQty_arr, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(in_stationPressureQty_var)) get_nc_data(&in_stationPressureQty_var, stationPressureQty_arr, buf_size, i_hdr_s); - else memset(stationPressureQty_arr, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(in_seaLevelPressureQty_var)) get_nc_data(&in_seaLevelPressureQty_var, seaLevelPressureQty_arr, buf_size, i_hdr_s); - else memset(seaLevelPressureQty_arr, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(in_windDirQty_var)) get_nc_data(&in_windDirQty_var, windDirQty_arr, buf_size, i_hdr_s); - else memset(windDirQty_arr, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(in_windSpeedQty_var)) get_nc_data(&in_windSpeedQty_var, windSpeedQty_arr, buf_size, i_hdr_s); - else memset(windSpeedQty_arr, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(in_windGustQty_var)) get_nc_data(&in_windGustQty_var, windGustQty_arr, buf_size, i_hdr_s); - else memset(windGustQty_arr, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(in_visibilityQty_var)) get_nc_data(&in_visibilityQty_var, visibilityQty_arr, buf_size, i_hdr_s); - else memset(visibilityQty_arr, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(in_precipRateQty_var)) get_nc_data(&in_precipRateQty_var, precipRateQty_arr, buf_size, i_hdr_s); - else memset(precipRateQty_arr, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(in_solarRadiationQty_var)) get_nc_data(&in_solarRadiationQty_var, solarRadiationQty_arr, buf_size, i_hdr_s); - else memset(solarRadiationQty_arr, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(in_seaSurfaceTempQty_var)) get_nc_data(&in_seaSurfaceTempQty_var, seaSurfaceTempQty_arr, buf_size, i_hdr_s); - else memset(seaSurfaceTempQty_arr, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(in_totalColumnPWVQty_var)) get_nc_data(&in_totalColumnPWVQty_var, totalColumnPWVQty_arr, buf_size, i_hdr_s); - else memset(totalColumnPWVQty_arr, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(in_soilTemperatureQty_var)) get_nc_data(&in_soilTemperatureQty_var, soilTemperatureQty_arr, buf_size, i_hdr_s); - else memset(soilTemperatureQty_arr, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(in_minTemp24HourQty_var)) get_nc_data(&in_minTemp24HourQty_var, minTemp24HourQty_arr, buf_size, i_hdr_s); - else memset(minTemp24HourQty_arr, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(in_maxTemp24HourQty_var)) get_nc_data(&in_maxTemp24HourQty_var, maxTemp24HourQty_arr, buf_size, i_hdr_s); - else memset(maxTemp24HourQty_arr, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(in_precip3hrQty_var)) get_nc_data(&in_precip3hrQty_var, precip3hrQty_arr, buf_size, i_hdr_s); - else memset(precip3hrQty_arr, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(in_precip6hrQty_var)) get_nc_data(&in_precip6hrQty_var, precip6hrQty_arr, buf_size, i_hdr_s); - else memset(precip6hrQty_arr, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(in_precip12hrQty_var)) get_nc_data(&in_precip12hrQty_var, precip12hrQty_arr, buf_size, i_hdr_s); - else memset(precip12hrQty_arr, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(in_precip10minQty_var)) get_nc_data(&in_precip10minQty_var, precip10minQty_arr, buf_size, i_hdr_s); - else memset(precip10minQty_arr, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(in_precip1minQty_var)) get_nc_data(&in_precip1minQty_var, precip1minQty_arr, buf_size, i_hdr_s); - else memset(precip1minQty_arr, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(in_windDir10Qty_var)) get_nc_data(&in_windDir10Qty_var, windDir10Qty_arr, buf_size, i_hdr_s); - else memset(windDir10Qty_arr, 0, buf_size*sizeof(char)); - if (IS_VALID_NC(in_windSpeed10Qty_var)) get_nc_data(&in_windSpeed10Qty_var, windSpeed10Qty_arr, buf_size, i_hdr_s); - else memset(windSpeed10Qty_arr, 0, buf_size*sizeof(char)); - - get_filtered_nc_data(in_temperature_var, temperature_arr, buf_size, i_hdr_s, "temperature" ); - get_filtered_nc_data(in_dewpoint_var, dewpoint_arr, buf_size, i_hdr_s, "dewpoint" ); - get_filtered_nc_data(in_relHumidity_var, relHumidity_arr, buf_size, i_hdr_s, "relHumidity" ); - get_filtered_nc_data(in_stationPressure_var, stationPressure_arr, buf_size, i_hdr_s, "stationPressure" ); - get_filtered_nc_data(in_seaLevelPressure_var, seaLevelPressure_arr, buf_size, i_hdr_s, "seaLevelPressure"); - get_filtered_nc_data(in_windDir_var, windDir_arr, buf_size, i_hdr_s, "windDir" ); - get_filtered_nc_data(in_windSpeed_var, windSpeed_arr, buf_size, i_hdr_s, "windSpeed" ); - get_filtered_nc_data(in_windGust_var, windGust_arr, buf_size, i_hdr_s, "windGust" ); - get_filtered_nc_data(in_visibility_var, visibility_arr, buf_size, i_hdr_s, "visibility" ); - get_filtered_nc_data(in_precipRate_var, precipRate_arr, buf_size, i_hdr_s, "precipRate" ); - get_filtered_nc_data(in_solarRadiation_var, solarRadiation_arr, buf_size, i_hdr_s, "solarRadiation" ); - get_filtered_nc_data(in_seaSurfaceTemp_var, seaSurfaceTemp_arr, buf_size, i_hdr_s, "seaSurfaceTemp" ); - get_filtered_nc_data(in_totalColumnPWV_var, totalColumnPWV_arr, buf_size, i_hdr_s, "totalColumnPWV" ); - get_filtered_nc_data(in_soilTemperature_var, soilTemperature_arr, buf_size, i_hdr_s, "soilTemperature" ); - get_filtered_nc_data(in_minTemp24Hour_var, minTemp24Hour_arr, buf_size, i_hdr_s, "minTemp24Hour" ); - get_filtered_nc_data(in_maxTemp24Hour_var, maxTemp24Hour_arr, buf_size, i_hdr_s, "maxTemp24Hour" ); - get_filtered_nc_data(in_precip3hr_var, precip3hr_arr, buf_size, i_hdr_s, "precip3hr" , false); - get_filtered_nc_data(in_precip6hr_var, precip6hr_arr, buf_size, i_hdr_s, "precip6hr" , false); - get_filtered_nc_data(in_precip12hr_var, precip12hr_arr, buf_size, i_hdr_s, "precip12hr" , false); - get_filtered_nc_data(in_precip10min_var, precip10min_arr, buf_size, i_hdr_s, "precip10min" , false); - get_filtered_nc_data(in_precip1min_var, precip1min_arr, buf_size, i_hdr_s, "precip1min" ); - get_filtered_nc_data(in_windDir10_var, windDir10_arr, buf_size, i_hdr_s, "windDir10" ); - get_filtered_nc_data(in_windSpeed10_var, windSpeed10_arr, buf_size, i_hdr_s, "windSpeed10" ); + get_nc_data(&in_hdr_vld_var, tmp_dbl_arr.data(), buf_size, i_hdr_s); + get_nc_data(&in_hdr_lat_var, hdr_lat_arr.data(), buf_size, i_hdr_s); + get_nc_data(&in_hdr_lon_var, hdr_lon_arr.data(), buf_size, i_hdr_s); + get_filtered_nc_data(in_hdr_elv_var, hdr_elv_arr.data(), buf_size, i_hdr_s, "elevation"); + + if (IS_VALID_NC(in_temperatureQty_var)) get_nc_data(&in_temperatureQty_var, temperatureQty_arr.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(in_dewpointQty_var)) get_nc_data(&in_dewpointQty_var, dewpointQty_arr.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(in_relHumidityQty_var)) get_nc_data(&in_relHumidityQty_var, relHumidityQty_arr.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(in_stationPressureQty_var)) get_nc_data(&in_stationPressureQty_var, stationPressureQty_arr.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(in_seaLevelPressureQty_var)) get_nc_data(&in_seaLevelPressureQty_var, seaLevelPressureQty_arr.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(in_windDirQty_var)) get_nc_data(&in_windDirQty_var, windDirQty_arr.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(in_windSpeedQty_var)) get_nc_data(&in_windSpeedQty_var, windSpeedQty_arr.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(in_windGustQty_var)) get_nc_data(&in_windGustQty_var, windGustQty_arr.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(in_visibilityQty_var)) get_nc_data(&in_visibilityQty_var, visibilityQty_arr.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(in_precipRateQty_var)) get_nc_data(&in_precipRateQty_var, precipRateQty_arr.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(in_solarRadiationQty_var)) get_nc_data(&in_solarRadiationQty_var, solarRadiationQty_arr.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(in_seaSurfaceTempQty_var)) get_nc_data(&in_seaSurfaceTempQty_var, seaSurfaceTempQty_arr.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(in_totalColumnPWVQty_var)) get_nc_data(&in_totalColumnPWVQty_var, totalColumnPWVQty_arr.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(in_soilTemperatureQty_var)) get_nc_data(&in_soilTemperatureQty_var, soilTemperatureQty_arr.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(in_minTemp24HourQty_var)) get_nc_data(&in_minTemp24HourQty_var, minTemp24HourQty_arr.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(in_maxTemp24HourQty_var)) get_nc_data(&in_maxTemp24HourQty_var, maxTemp24HourQty_arr.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(in_precip3hrQty_var)) get_nc_data(&in_precip3hrQty_var, precip3hrQty_arr.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(in_precip6hrQty_var)) get_nc_data(&in_precip6hrQty_var, precip6hrQty_arr.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(in_precip12hrQty_var)) get_nc_data(&in_precip12hrQty_var, precip12hrQty_arr.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(in_precip10minQty_var)) get_nc_data(&in_precip10minQty_var, precip10minQty_arr.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(in_precip1minQty_var)) get_nc_data(&in_precip1minQty_var, precip1minQty_arr.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(in_windDir10Qty_var)) get_nc_data(&in_windDir10Qty_var, windDir10Qty_arr.data(), buf_size, i_hdr_s); + if (IS_VALID_NC(in_windSpeed10Qty_var)) get_nc_data(&in_windSpeed10Qty_var, windSpeed10Qty_arr.data(), buf_size, i_hdr_s); + + get_filtered_nc_data(in_temperature_var, temperature_arr.data(), buf_size, i_hdr_s, "temperature" ); + get_filtered_nc_data(in_dewpoint_var, dewpoint_arr.data(), buf_size, i_hdr_s, "dewpoint" ); + get_filtered_nc_data(in_relHumidity_var, relHumidity_arr.data(), buf_size, i_hdr_s, "relHumidity" ); + get_filtered_nc_data(in_stationPressure_var, stationPressure_arr.data(), buf_size, i_hdr_s, "stationPressure" ); + get_filtered_nc_data(in_seaLevelPressure_var, seaLevelPressure_arr.data(), buf_size, i_hdr_s, "seaLevelPressure"); + get_filtered_nc_data(in_windDir_var, windDir_arr.data(), buf_size, i_hdr_s, "windDir" ); + get_filtered_nc_data(in_windSpeed_var, windSpeed_arr.data(), buf_size, i_hdr_s, "windSpeed" ); + get_filtered_nc_data(in_windGust_var, windGust_arr.data(), buf_size, i_hdr_s, "windGust" ); + get_filtered_nc_data(in_visibility_var, visibility_arr.data(), buf_size, i_hdr_s, "visibility" ); + get_filtered_nc_data(in_precipRate_var, precipRate_arr.data(), buf_size, i_hdr_s, "precipRate" ); + get_filtered_nc_data(in_solarRadiation_var, solarRadiation_arr.data(), buf_size, i_hdr_s, "solarRadiation" ); + get_filtered_nc_data(in_seaSurfaceTemp_var, seaSurfaceTemp_arr.data(), buf_size, i_hdr_s, "seaSurfaceTemp" ); + get_filtered_nc_data(in_totalColumnPWV_var, totalColumnPWV_arr.data(), buf_size, i_hdr_s, "totalColumnPWV" ); + get_filtered_nc_data(in_soilTemperature_var, soilTemperature_arr.data(), buf_size, i_hdr_s, "soilTemperature" ); + get_filtered_nc_data(in_minTemp24Hour_var, minTemp24Hour_arr.data(), buf_size, i_hdr_s, "minTemp24Hour" ); + get_filtered_nc_data(in_maxTemp24Hour_var, maxTemp24Hour_arr.data(), buf_size, i_hdr_s, "maxTemp24Hour" ); + get_filtered_nc_data(in_precip3hr_var, precip3hr_arr.data(), buf_size, i_hdr_s, "precip3hr" , false); + get_filtered_nc_data(in_precip6hr_var, precip6hr_arr.data(), buf_size, i_hdr_s, "precip6hr" , false); + get_filtered_nc_data(in_precip12hr_var, precip12hr_arr.data(), buf_size, i_hdr_s, "precip12hr" , false); + get_filtered_nc_data(in_precip10min_var, precip10min_arr.data(), buf_size, i_hdr_s, "precip10min" , false); + get_filtered_nc_data(in_precip1min_var, precip1min_arr.data(), buf_size, i_hdr_s, "precip1min" ); + get_filtered_nc_data(in_windDir10_var, windDir10_arr.data(), buf_size, i_hdr_s, "windDir10" ); + get_filtered_nc_data(in_windSpeed10_var, windSpeed10_arr.data(), buf_size, i_hdr_s, "windSpeed10" ); dim[1] = hdr_sid_len; - get_nc_data(&in_hdr_sid_var, (char *)hdr_sid_arr, dim, cur); + get_nc_data(&in_hdr_sid_var, hdr_sid_arr.data(), dim, cur); dim[0] = 1; dim[1] = 1; @@ -2971,15 +2905,14 @@ void process_madis_mesonet(NcFile *&f_in) { hdr_arr[2] = hdr_elv_arr[i_idx]; // - // Check masking regions. + // Process the station name. // - if(!check_masks(hdr_arr[0], hdr_arr[1], hdr_sid_arr[i_idx])) continue; - + hdr_sid = &hdr_sid_arr.data()[i_idx * hdr_sid_len]; // - // Process the station name. + // Check masking regions. // - hdr_sid = hdr_sid_arr[i_idx]; + if(!check_masks(hdr_arr[0], hdr_arr[1], hdr_sid.c_str())) continue; // // Process the observation time. @@ -3213,7 +3146,7 @@ void process_madis_acarsProfiles(NcFile *&f_in) { ConcatString hdr_typ, hdr_sid; float hdr_arr[HDR_ARRAY_LEN], obs_arr[OBS_ARRAY_LEN], conversion; float pressure, wdir, wind, ugrd, vgrd; - int count; + int count = 0; StringArray missing_vars, missing_qty_vars; const char * method_name = "process_madis_acarsProfiles() -> "; @@ -3240,7 +3173,6 @@ void process_madis_acarsProfiles(NcFile *&f_in) { NcVar in_nLevelsQty_var = get_var(f_in, "nLevelsDD"); NcVar in_altitudeQty_var = get_var(f_in, "altitudeDD"); - if (IS_INVALID_NC(in_hdr_sid_var)) missing_vars.add("profileAirport"); if (IS_INVALID_NC(in_hdr_vld_var)) missing_vars.add("profileTime"); if (IS_INVALID_NC(in_hdr_lat_var)) missing_vars.add("trackLat"); @@ -3307,12 +3239,12 @@ void process_madis_acarsProfiles(NcFile *&f_in) { // buf_size = (my_rec_end - rec_beg); // read all - int levels[buf_size]; - char levelsQty[buf_size]; + vector levels(buf_size); + vector levelsQty(buf_size); cur[0] = rec_beg; dim[0] = buf_size; - get_nc_data(&in_var, levels, buf_size, cur[0]); - if (IS_VALID_NC(in_nLevelsQty_var)) get_nc_data(&in_nLevelsQty_var, (char *)&levelsQty, buf_size, cur[0]); + get_nc_data(&in_var, levels.data(), buf_size, cur[0]); + if (IS_VALID_NC(in_nLevelsQty_var)) get_nc_data(&in_nLevelsQty_var, levelsQty.data(), buf_size, cur[0]); for(i_hdr=0; i_hdr BUFFER_SIZE) ? BUFFER_SIZE: (my_rec_end - i_hdr_s); - double tmp_dbl_arr[buf_size]; - float hdr_lat_arr[buf_size][maxLevels]; - float hdr_lon_arr[buf_size][maxLevels]; - float hdr_elv_arr[buf_size][maxLevels]; - char hdr_sid_arr[buf_size][hdr_sid_len]; + vector tmp_dbl_arr(buf_size); + vector hdr_lat_arr(buf_size * maxLevels); + vector hdr_lon_arr(buf_size * maxLevels); + vector hdr_elv_arr(buf_size * maxLevels); + vector hdr_sid_arr(buf_size * hdr_sid_len); - int obsTimeOfDay_arr[buf_size][maxLevels]; - float temperature_arr[buf_size][maxLevels]; - float dewpoint_arr[buf_size][maxLevels]; - float windDir_arr[buf_size][maxLevels]; - float windSpeed_arr[buf_size][maxLevels]; + vector obsTimeOfDay_arr(buf_size * maxLevels); + vector temperature_arr(buf_size * maxLevels); + vector dewpoint_arr(buf_size * maxLevels); + vector windDir_arr(buf_size * maxLevels); + vector windSpeed_arr(buf_size * maxLevels); - char temperatureQty_arr[buf_size][maxLevels]; - char dewpointQty_arr[buf_size][maxLevels]; - char windDirQty_arr[buf_size][maxLevels]; - char windSpeedQty_arr[buf_size][maxLevels]; - char altitudeQty_arr[buf_size][maxLevels]; + vector temperatureQty_arr(buf_size * maxLevels, 0); + vector dewpointQty_arr(buf_size * maxLevels, 0); + vector windDirQty_arr(buf_size * maxLevels, 0); + vector windSpeedQty_arr(buf_size * maxLevels, 0); + vector altitudeQty_arr(buf_size * maxLevels, 0); cur[0] = i_hdr_s; dim[0] = buf_size; dim[1] = maxLevels; int data_cnt = buf_size * maxLevels; - get_nc_data(&in_hdr_vld_var, tmp_dbl_arr, dim, cur); - get_nc_data(&in_hdr_lat_var, (float *)hdr_lat_arr, dim, cur); - get_nc_data(&in_hdr_lon_var, (float *)hdr_lon_arr, dim, cur); - get_filtered_nc_data_2d(in_hdr_elv_var, (float *)hdr_elv_arr, dim, cur, "elevation", data_cnt); - - - if (IS_VALID_NC(in_temperatureQty_var)) get_nc_data(&in_temperatureQty_var, (char *)&temperatureQty_arr, dim, cur); - else memset(temperatureQty_arr, 0, data_cnt*sizeof(char)); - if (IS_VALID_NC(in_dewpointQty_var)) get_nc_data(&in_dewpointQty_var, (char *)&dewpointQty_arr, dim, cur); - else memset(dewpointQty_arr, 0, data_cnt*sizeof(char)); - if (IS_VALID_NC(in_windDirQty_var)) get_nc_data(&in_windDirQty_var, (char *)&windDirQty_arr, dim, cur); - else memset(windDirQty_arr, 0, data_cnt*sizeof(char)); - if (IS_VALID_NC(in_windSpeedQty_var)) get_nc_data(&in_windSpeedQty_var, (char *)&windSpeedQty_arr, dim, cur); - else memset(windSpeedQty_arr, 0, data_cnt*sizeof(char)); - if (IS_VALID_NC(in_altitudeQty_var)) get_nc_data(&in_altitudeQty_var, (char *)&altitudeQty_arr, dim, cur); - else memset(altitudeQty_arr, 0, data_cnt*sizeof(char)); - - get_filtered_nc_data_2d(in_hdr_tob_var, (int *)&obsTimeOfDay_arr, dim, cur, "obsTimeOfDay", data_cnt); - get_filtered_nc_data_2d(in_temperature_var, (float *)&temperature_arr, dim, cur, "temperature", data_cnt); - get_filtered_nc_data_2d(in_dewpoint_var, (float *)&dewpoint_arr, dim, cur, "dewpoint", data_cnt); - get_filtered_nc_data_2d(in_windDir_var, (float *)&windDir_arr, dim, cur, "windDir", data_cnt); - get_filtered_nc_data_2d(in_windSpeed_var, (float *)&windSpeed_arr, dim, cur, "windSpeed", data_cnt); + get_nc_data(&in_hdr_vld_var, tmp_dbl_arr.data(), dim, cur); + get_nc_data(&in_hdr_lat_var, hdr_lat_arr.data(), dim, cur); + get_nc_data(&in_hdr_lon_var, hdr_lon_arr.data(), dim, cur); + get_filtered_nc_data_2d(in_hdr_elv_var, hdr_elv_arr.data(), dim, cur, "elevation", data_cnt); + + + if (IS_VALID_NC(in_temperatureQty_var)) get_nc_data(&in_temperatureQty_var, temperatureQty_arr.data(), dim, cur); + if (IS_VALID_NC(in_dewpointQty_var)) get_nc_data(&in_dewpointQty_var, dewpointQty_arr.data(), dim, cur); + if (IS_VALID_NC(in_windDirQty_var)) get_nc_data(&in_windDirQty_var, windDirQty_arr.data(), dim, cur); + if (IS_VALID_NC(in_windSpeedQty_var)) get_nc_data(&in_windSpeedQty_var, windSpeedQty_arr.data(), dim, cur); + if (IS_VALID_NC(in_altitudeQty_var)) get_nc_data(&in_altitudeQty_var, altitudeQty_arr.data(), dim, cur); + + get_filtered_nc_data_2d(in_hdr_tob_var, obsTimeOfDay_arr.data(), dim, cur, "obsTimeOfDay", data_cnt); + get_filtered_nc_data_2d(in_temperature_var, temperature_arr.data(), dim, cur, "temperature", data_cnt); + get_filtered_nc_data_2d(in_dewpoint_var, dewpoint_arr.data(), dim, cur, "dewpoint", data_cnt); + get_filtered_nc_data_2d(in_windDir_var, windDir_arr.data(), dim, cur, "windDir", data_cnt); + get_filtered_nc_data_2d(in_windSpeed_var, windSpeed_arr.data(), dim, cur, "windSpeed", data_cnt); dim[1] = hdr_sid_len; - get_nc_data(&in_hdr_sid_var, (char *)hdr_sid_arr, dim, cur); + get_nc_data(&in_hdr_sid_var, hdr_sid_arr.data(), dim, cur); // // Process the header type. @@ -3391,7 +3318,6 @@ void process_madis_acarsProfiles(NcFile *&f_in) { // hdr_typ = "AIRCFT"; - for (int i_idx=0; i_idx v(Nxy); LongArray offsets; // { 0, 0}; -LongArray lengths; // {Ny, Nx}; // NOT (x, y)! +LongArray lengths; // {Ny, Nx}; and NOT (x, y)! offsets.add(0); offsets.add(0); lengths.add(Ny); lengths.add(Nx); -if (get_nc_data(var, (int *)&v, lengths, offsets)) { - for (x=0; x n ) n = k; - - } - +if (get_nc_data(var, v.data(), lengths, offsets)) { + for (int i=0; i n ) n = v[i]; } } + return n; } diff --git a/src/tools/other/mode_time_domain/3d_conv.cc b/src/tools/other/mode_time_domain/3d_conv.cc index c954f92b51..b6d22cdcae 100644 --- a/src/tools/other/mode_time_domain/3d_conv.cc +++ b/src/tools/other/mode_time_domain/3d_conv.cc @@ -231,8 +231,8 @@ DataHandle handle; const int time_radius = time_end - time_beg + 1; double * p = nullptr; -double * ss [time_radius]; -bool * ok [time_radius]; +vector ss(time_radius); +vector ok(time_radius); const int trp1 = 2*spatial_R + 1; const double scale = 1.0/(trp1*trp1); @@ -802,7 +802,7 @@ const int data_bytes = (in.nxy())*sizeof(double); const int tf_bytes = (in.nxy())*sizeof(bool); const int nxy = in.nxy(); const int time_radius = time_end - time_beg + 1; -bool new_loaded[time_radius]; +vector new_loaded(time_radius); handle.t = t; diff --git a/src/tools/other/plot_point_obs/plot_point_obs.cc b/src/tools/other/plot_point_obs/plot_point_obs.cc index d6465e6b65..8e8bf7a6a8 100644 --- a/src/tools/other/plot_point_obs/plot_point_obs.cc +++ b/src/tools/other/plot_point_obs/plot_point_obs.cc @@ -243,8 +243,8 @@ void process_point_obs(const char *point_obs_filename) { // Allocate space to store the data float hdr_arr[HDR_ARRAY_LEN]; float obs_arr[OBS_ARRAY_LEN]; - int obs_qty_block[buf_size]; - float obs_arr_block[buf_size][OBS_ARRAY_LEN]; + vector obs_qty_block(buf_size); + vector> obs_arr_block(buf_size); use_var_id = met_point_obs->is_using_var_id(); if(use_var_id) var_list = met_point_obs->get_var_names(); @@ -271,11 +271,14 @@ void process_point_obs(const char *point_obs_filename) { #ifdef WITH_PYTHON if (use_python) status = met_point_obs->get_point_obs_data()->fill_obs_buf( - buf_size2, i_start, (float *)obs_arr_block, obs_qty_block); + buf_size2, i_start, + (float *)obs_arr_block.data(), + obs_qty_block.data()); else #endif - status = nc_point_obs.read_obs_data(buf_size2, i_start, (float *)obs_arr_block, - obs_qty_block, (char *)0); + status = nc_point_obs.read_obs_data(buf_size2, i_start, + (float *)obs_arr_block.data(), + obs_qty_block.data(), nullptr); if (!status) exit(1); for(int i_offset=0; i_offsetset_long_name(tmp_long_name.c_str()); - write_nc(prob_dp, to_grid, vinfo, vname_prob.c_str()); - if (do_gaussian_filter) { - NcVar prob_var = get_var(nc_out, vname_prob.c_str()); - if (IS_VALID_NC(prob_var)) { - add_att(&prob_var, "gaussian_radius", RGInfo.gaussian.radius); - add_att(&prob_var, "gaussian_dx", RGInfo.gaussian.dx); - add_att(&prob_var, "trunc_factor", RGInfo.gaussian.trunc_factor); - } - } + + // Write the probability data + write_nc(prob_dp, to_grid, vinfo, vname_prob.c_str(), + do_gaussian_filter); tmp_long_name = vname_prob_mask; tmp_long_name << dim_string; @@ -1265,7 +1263,6 @@ static void process_point_nccf_file(NcFile *nc_in, MetConfig &config, int filtered_by_time = 0; int time_from_size = 1; clock_t start_clock = clock(); - bool opt_all_attrs = false; Grid fr_grid = fr_mtddf->grid(); static const char *method_name = "process_point_nccf_file() -> "; @@ -1458,8 +1455,6 @@ static void process_point_nccf_file(NcFile *nc_in, MetConfig &config, // Write the regridded data write_nc(to_dp, to_grid, vinfo, vname.c_str()); - NcVar to_var = get_nc_var(nc_out, vname.c_str()); - bool has_prob_thresh = !prob_cat_thresh.check(bad_data_double); if (has_prob_thresh || do_gaussian_filter) { DataPlane prob_dp; @@ -1484,19 +1479,10 @@ static void process_point_nccf_file(NcFile *nc_in, MetConfig &config, } if (do_gaussian_filter) interp_gaussian_dp(prob_dp, RGInfo.gaussian, RGInfo.vld_thresh); - write_nc(prob_dp, to_grid, vinfo, vname_prob.c_str()); - if(IS_VALID_NC(var_data)) { - NcVar out_var = get_nc_var(nc_out, vname.c_str()); - copy_nc_atts(&var_data, &out_var, opt_all_attrs); - if (do_gaussian_filter) { - NcVar prob_var = get_var(nc_out, vname_prob.c_str()); - if (IS_VALID_NC(prob_var)) { - add_att(&prob_var, "gaussian_radius", RGInfo.gaussian.radius); - add_att(&prob_var, "gaussian_dx", RGInfo.gaussian.dx); - add_att(&prob_var, "trunc_factor", RGInfo.gaussian.trunc_factor); - } - } - } + + // Write the probability data + write_nc(prob_dp, to_grid, vinfo, vname_prob.c_str(), + do_gaussian_filter); } } // end for i @@ -1739,13 +1725,19 @@ void write_nc_data_int(const DataPlane &dp, const Grid &grid, NcVar *data_var) { //////////////////////////////////////////////////////////////////////// static void write_nc(const DataPlane &dp, const Grid &grid, - const VarInfo *vinfo, const char *vname) { + const VarInfo *vinfo, const char *vname, + bool add_gaussian_atts, + NcFile *in_goes_nc, + NcVar *in_var_nc) { int deflate_level = compress_level; - if (deflate_level < 0) deflate_level = 0; + if(deflate_level < 0) deflate_level = 0; + // Create the output variable NcVar data_var = add_var(nc_out, (string)vname, ncFloat, lat_dim, lon_dim, deflate_level); + + // Add standard attributes add_att(&data_var, "name", (string)vname); add_att(&data_var, "long_name", (string)vinfo->long_name()); add_att(&data_var, "level", (string)vinfo->level_name()); @@ -1753,6 +1745,27 @@ static void write_nc(const DataPlane &dp, const Grid &grid, add_att(&data_var, "_FillValue", bad_data_float); write_netcdf_var_times(&data_var, dp); + // If requested, add global GOES attributes + if(in_goes_nc) { + for(size_t idx=0; idxname()); - NcVar to_var = get_nc_var(nc_out, vname.c_str()); - NcVar var_data = get_goes_nc_var(nc_in, vinfo->name()); - if(IS_VALID_NC(var_data)) { - for (size_t idx=0; idx time_values(time_count + 2); + if (get_nc_data(&time_var, time_values.data())) { valid_time = compute_unixtime(&time_var, time_values[0]); } else { @@ -3003,7 +2997,7 @@ __attribute__((noreturn)) static void usage() { << "to generate gridded data (optional).\n" << "\t\t\"-goes_qc flags\" specifies a comma-separated list of QC flags, " - << "for example \"0,1\" (optional).\n" + << "for example \"0,1\" (optional).\n" << "\t\t\tOnly used if grid_mapping is set to \"goes_imager_projection\" " << "and the QC variable exists.\n" @@ -3050,10 +3044,8 @@ static void set_adp_gc_values(NcVar var_adp_qc) { if (get_nc_att_value(&var_adp_qc, (ConcatString)"flag_meanings", att_flag_meanings)) { StringArray flag_meanings = to_lower(att_flag_meanings).split(" "); - unsigned short flag_values[flag_meanings.n()+128]; /* reserve enough storage */ - for (int i=0; i flag_values(flag_meanings.n() + 128, (unsigned short) -1); + if (get_nc_att_values(&var_adp_qc, att_name_values, flag_values.data())) { int idx; if (flag_meanings.has("low_confidence_smoke_detection_qf", idx)) { adp_qc_low = (flag_values[idx] >> 2) & 0x03;