diff --git a/met/data/wrappers/read_tmp_dataplane.py b/met/data/wrappers/read_tmp_dataplane.py index c6f8f57a9c..09e2530ef0 100644 --- a/met/data/wrappers/read_tmp_dataplane.py +++ b/met/data/wrappers/read_tmp_dataplane.py @@ -10,11 +10,8 @@ import numpy as np import netCDF4 as nc -print('Python Script:\t', sys.argv[0]) met_info = {} - netcdf_filename = sys.argv[1] -print('Read NetCDF:\t', netcdf_filename) # read NetCDF file ds = nc.Dataset(netcdf_filename, 'r') @@ -32,4 +29,4 @@ del met_attrs['name_str'] met_info['met_data'] = met_data met_info['attrs'] = met_attrs -print(met_info) + diff --git a/met/data/wrappers/write_tmp_dataplane.py b/met/data/wrappers/write_tmp_dataplane.py index b5a1b24995..b9194b2920 100644 --- a/met/data/wrappers/write_tmp_dataplane.py +++ b/met/data/wrappers/write_tmp_dataplane.py @@ -13,13 +13,7 @@ import importlib.util import netCDF4 as nc -print('Python Script:\t', sys.argv[0]) -print('User Command:\t', sys.argv[2:]) - netcdf_filename = sys.argv[1] - -print('Write NetCDF:\t', netcdf_filename) - pyembed_module_name = sys.argv[2] sys.argv = sys.argv[2:] @@ -44,25 +38,30 @@ attrs = met_in.attrs met_info['attrs'] = attrs -print('write_tmp_dataplane') -print(met_info) +# determine fill value +try: + fill = met_data.get_fill_value() +except: + fill = -9999. # write NetCDF file ds = nc.Dataset(netcdf_filename, 'w') +# create dimensions and variable nx, ny = met_in.met_data.shape ds.createDimension('x', nx) ds.createDimension('y', ny) -dp = ds.createVariable('met_data', met_in.met_data.dtype, ('x', 'y')) +dp = ds.createVariable('met_data', met_in.met_data.dtype, ('x', 'y'), fill_value=fill) dp[:] = met_in.met_data +# append attributes for attr, attr_val in met_info['attrs'].items(): - print(attr, attr_val, type(attr_val)) if attr == 'name': setattr(ds, 'name_str', attr_val) - elif type(attr_val) == str: - setattr(ds, attr, attr_val) elif type(attr_val) == dict: for key in attr_val: setattr(ds, attr + '.' + key, attr_val[key]) + else: + setattr(ds, attr, attr_val) + ds.close() diff --git a/met/docs/Users_Guide/installation.rst b/met/docs/Users_Guide/installation.rst index d654119717..013cd4d384 100644 --- a/met/docs/Users_Guide/installation.rst +++ b/met/docs/Users_Guide/installation.rst @@ -69,7 +69,7 @@ NCEP's BUFRLIB is used by the MET to decode point-based observation datasets in .. code-block:: none gcc -c -DUNDERSCORE `./getdefflags_C.sh` *.c >> make.log - gfortran -c -fno-second-underscore `./getdefflags_F.sh` modv*.F moda*.F \ + gfortran -c -fno-second-underscore -fallow-argument-mismatch `./getdefflags_F.sh` modv*.F moda*.F \ `ls -1 *.F *.f | grep -v "mod[av]_"` >> make.log ar crv libbufr.a *.o diff --git a/met/docs/Users_Guide/stat-analysis.rst b/met/docs/Users_Guide/stat-analysis.rst index acbad3127d..5d3d998fb9 100644 --- a/met/docs/Users_Guide/stat-analysis.rst +++ b/met/docs/Users_Guide/stat-analysis.rst @@ -44,9 +44,11 @@ The Stat-Analysis “aggregate” job aggregates values from multiple STAT lines Aggregate STAT lines and produce aggregated statistics ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The Stat-Analysis “aggregate-stat” job aggregates multiple STAT lines of the same type together and produces relevant statistics from the aggregated line. This may be done in the same manner listed above in :numref:`StA_Aggregated-values-from`. However, rather than writing out the aggregated STAT line itself, the relevant statistics generated from that aggregated line are provided in the output. Specifically, if a contingency table line type (FHO, CTC, PCT, MCTC, or NBRCTC) has been aggregated, a contingency table statistics (CTS, PSTD, MCTS, or NBRCTS) line type will be written out. If a partial sums line type (SL1L2 or SAL1L2) has been aggregated, a continuous statistics (CNT) line type will be written out. If a vector partial sums line type (VL1L2) has been aggregated, the vector continuous statistics (VCNT) line type will be written out. For ensembles, the ORANK line type can be accumulated into ECNT, RPS, RHIST, PHIST, RELP, or SSVAR output. If the matched pair line type (MPR) has been aggregated, the user may choose the line type to be output (FHO, CTC, CTS, CNT, MCTC, MCTS, SL1L2, SAL1L2, VL1L2, VCNT, WDIR, PCT, PSTD, PJC, PRC, or ECLV). +The Stat-Analysis “aggregate-stat” job aggregates multiple STAT lines of the same type together and produces relevant statistics from the aggregated line. This may be done in the same manner listed above in :numref:`StA_Aggregated-values-from`. However, rather than writing out the aggregated STAT line itself, the relevant statistics generated from that aggregated line are provided in the output. Specifically, if a contingency table line type (FHO, CTC, PCT, MCTC, or NBRCTC) has been aggregated, contingency table statistics (CTS, ECLV, PSTD, MCTS, or NBRCTS) line types can be computed. If a partial sums line type (SL1L2 or SAL1L2) has been aggregated, the continuous statistics (CNT) line type can be computed. If a vector partial sums line type (VL1L2) has been aggregated, the vector continuous statistics (VCNT) line type can be computed. For ensembles, the ORANK line type can be accumulated into ECNT, RPS, RHIST, PHIST, RELP, or SSVAR output. If the matched pair line type (MPR) has been aggregated, may output line types (FHO, CTC, CTS, CNT, MCTC, MCTS, SL1L2, SAL1L2, VL1L2, VCNT, WDIR, PCT, PSTD, PJC, PRC, or ECLV) can be computed. Multiple output line types may be specified for each “aggregate-stat” job, as long as each output is derivable from the input. -When aggregating the matched pair line type (MPR) and computing an output contingency table statistics (CTS) or continuous statistics (CNT) line type, the bootstrapping method is applied for computing confidence intervals. The bootstrapping method is applied here in the same way that it is applied in the statistics tools. For a set of n matched forecast-observation pairs, the matched pairs are resampled with replacement many times. For each replicated sample, the corresponding statistics are computed. The confidence intervals are derived from the statistics computed for each replicated sample. +When aggregating the matched pair line type (MPR), additional required job command options are determined by the requested output line type(s). For example, the “-out_thresh” (or “-out_fcst_thresh” and “-out_obs_thresh” options) are required to compute contingnecy table counts (FHO, CTC) or statistics (CTS). Those same job command options can also specify filtering thresholds when computing continuous partial sums (SL1L2, SAL1L2) or statistics (CNT). Output is written for each threshold specified. + +When aggregating the matched pair line type (MPR) and computing an output contingency table statistics (CTS) or continuous statistics (CNT) line type, the bootstrapping method can be applied to compute confidence intervals. The bootstrapping method is applied here in the same way that it is applied in the statistics tools. For a set of n matched forecast-observation pairs, the matched pairs are resampled with replacement many times. For each replicated sample, the corresponding statistics are computed. The confidence intervals are derived from the statistics computed for each replicated sample. .. _StA_Skill-Score-Index: @@ -541,7 +543,7 @@ Each analysis job is performed over a subset of the input data. Filtering the in -out_line_type name -This option specifies the desired output line type for the **aggregate_stat** job type. +This option specifies the desired output line type(s) for the **aggregate_stat** job type. .. code-block:: none diff --git a/met/src/basic/vx_util/ascii_table.cc b/met/src/basic/vx_util/ascii_table.cc index 2b345f2950..04b19a30c3 100644 --- a/met/src/basic/vx_util/ascii_table.cc +++ b/met/src/basic/vx_util/ascii_table.cc @@ -331,8 +331,6 @@ if ( e.size() != NRC ) { } -//for (j=0; j nul sublist pointer!\n\n"; + mlog << Error << "\nPyLineDataFile::make_data_line() ->" + << "nul sublist pointer!\n\n"; exit ( 1 ); @@ -255,8 +255,8 @@ if ( ! sublist ) { if ( ! PyList_Check(sublist) ) { - mlog << Error - << "\n\n PyLineDataFile::make_data_line() -> python object is not a list!\n\n"; + mlog << Error << "\nPyLineDataFile::make_data_line() ->" + << "python object is not a list!\n\n"; exit ( 1 ); @@ -336,8 +336,7 @@ if ( PyErr_Occurred() ) { PyErr_Print(); - mlog << Error - << "\nPyLineDataFile::do_straight() -> " + mlog << Error << "\nPyLineDataFile::do_straight() -> " << "an error occurred importing module " << '\"' << user_base.text() << "\"\n\n"; @@ -411,6 +410,9 @@ for (j=0; jread_pickle(list_name, pickle_path.text()); main_list = script->lookup(list_name); if ( ! main_list ) { - mlog << Error - << "\n\n PyLineDataFile::do_pickle() -> nul main list pointer!\n\n"; + mlog << Error << "\nPyLineDataFile::do_pickle() ->" + << "nul main list pointer!\n\n"; exit ( 1 ); diff --git a/met/src/libcode/vx_analysis_util/stat_job.cc b/met/src/libcode/vx_analysis_util/stat_job.cc index 870d5cac1d..1b00c802da 100644 --- a/met/src/libcode/vx_analysis_util/stat_job.cc +++ b/met/src/libcode/vx_analysis_util/stat_job.cc @@ -186,6 +186,8 @@ void STATAnalysisJob::clear() { if(dump_row) { delete [] dump_row; dump_row = (char *) 0; } if(stat_file) { delete [] stat_file; stat_file = (char *) 0; } + stat_row = 0; + out_line_type.clear(); out_fcst_thresh.clear(); @@ -307,8 +309,8 @@ void STATAnalysisJob::assign(const STATAnalysisJob & aj) { wmo_fisher_stats = aj.wmo_fisher_stats; column_thresh_map = aj.column_thresh_map; - column_str_inc_map = aj.column_str_inc_map; - column_str_exc_map = aj.column_str_exc_map; + column_str_inc_map = aj.column_str_inc_map; + column_str_exc_map = aj.column_str_exc_map; by_column = aj.by_column; @@ -354,6 +356,8 @@ void STATAnalysisJob::assign(const STATAnalysisJob & aj) { mask_poly = aj.mask_poly; mask_sid = aj.mask_sid; + stat_row = aj.stat_row; + set_dump_row (aj.dump_row); set_stat_file(aj.stat_file); @@ -1880,6 +1884,8 @@ void STATAnalysisJob::open_stat_file() { close_stat_file(); + stat_row = 0; + if(!stat_file) return; stat_out = new ofstream; @@ -1904,7 +1910,7 @@ void STATAnalysisJob::setup_stat_file(int n_row, int n) { int i, c, n_col; // - // Nothing to do unless output STAT file stream is defined + // Nothing to do if no output STAT file stream is defined // if(!stat_out) return; @@ -1970,63 +1976,104 @@ void STATAnalysisJob::setup_stat_file(int n_row, int n) { n_col += n_header_columns; // - // Setup the STAT table - // - stat_at.set_size(n_row, n_col); - justify_stat_cols(stat_at); - stat_at.set_precision(precision); - stat_at.set_bad_data_value(bad_data_double); - stat_at.set_bad_data_str(na_str); - stat_at.set_delete_trailing_blank_rows(1); - - // - // Write the STAT header row - // - switch(out_lt) { - case stat_sl1l2: write_header_row (sl1l2_columns, n_sl1l2_columns, 1, stat_at, 0, 0); break; - case stat_sal1l2: write_header_row (sal1l2_columns, n_sal1l2_columns, 1, stat_at, 0, 0); break; - case stat_vl1l2: write_header_row (vl1l2_columns, n_vl1l2_columns, 1, stat_at, 0, 0); break; - case stat_val1l2: write_header_row (val1l2_columns, n_val1l2_columns, 1, stat_at, 0, 0); break; - case stat_fho: write_header_row (fho_columns, n_fho_columns, 1, stat_at, 0, 0); break; - case stat_ctc: write_header_row (ctc_columns, n_ctc_columns, 1, stat_at, 0, 0); break; - case stat_cts: write_header_row (cts_columns, n_cts_columns, 1, stat_at, 0, 0); break; - case stat_mctc: write_mctc_header_row (1, n, stat_at, 0, 0); break; - case stat_mcts: write_header_row (mcts_columns, n_mcts_columns, 1, stat_at, 0, 0); break; - case stat_cnt: write_header_row (cnt_columns, n_cnt_columns, 1, stat_at, 0, 0); break; - case stat_vcnt: write_header_row (vcnt_columns, n_vcnt_columns, 1, stat_at, 0, 0); break; - case stat_pct: write_pct_header_row (1, n, stat_at, 0, 0); break; - case stat_pstd: write_pstd_header_row (1, n, stat_at, 0, 0); break; - case stat_pjc: write_pjc_header_row (1, n, stat_at, 0, 0); break; - case stat_prc: write_prc_header_row (1, n, stat_at, 0, 0); break; - case stat_eclv: write_eclv_header_row (1, n, stat_at, 0, 0); break; - case stat_mpr: write_header_row (mpr_columns, n_mpr_columns, 1, stat_at, 0, 0); break; - case stat_nbrctc: write_header_row (nbrctc_columns, n_sl1l2_columns, 1, stat_at, 0, 0); break; - case stat_nbrcts: write_header_row (nbrcts_columns, n_sl1l2_columns, 1, stat_at, 0, 0); break; - case stat_nbrcnt: write_header_row (nbrcnt_columns, n_sl1l2_columns, 1, stat_at, 0, 0); break; - case stat_grad: write_header_row (grad_columns, n_grad_columns, 1, stat_at, 0, 0); break; - case stat_isc: write_header_row (isc_columns, n_isc_columns, 1, stat_at, 0, 0); break; - case stat_wdir: write_header_row (job_wdir_columns, n_job_wdir_columns, 1, stat_at, 0, 0); break; - case stat_ecnt: write_header_row (ecnt_columns, n_ecnt_columns, 1, stat_at, 0, 0); break; - case stat_rps: write_header_row (rps_columns, n_rps_columns, 1, stat_at, 0, 0); break; - case stat_rhist: write_rhist_header_row (1, n, stat_at, 0, 0); break; - case stat_phist: write_phist_header_row (1, n, stat_at, 0, 0); break; - case stat_relp: write_relp_header_row (1, n, stat_at, 0, 0); break; - case stat_orank: write_header_row (orank_columns, n_orank_columns, 1, stat_at, 0, 0); break; - case stat_ssvar: write_header_row (ssvar_columns, n_ssvar_columns, 1, stat_at, 0, 0); break; - case stat_genmpr: write_header_row (genmpr_columns, n_genmpr_columns, 1, stat_at, 0, 0); break; + // Create table from scratch + // + if(stat_row == 0) { + + // + // Multiply the number of rows by the number of + // output line types to avoid resizing later + // + n_row *= max(1, out_sa.n()); // - // Write only header columns for unspecified line type + // Setup the STAT table + // + stat_at.set_size(n_row, n_col); + justify_stat_cols(stat_at); + stat_at.set_precision(precision); + stat_at.set_bad_data_value(bad_data_double); + stat_at.set_bad_data_str(na_str); + stat_at.set_delete_trailing_blank_rows(1); + // - case no_stat_line_type: - write_header_row ((const char **) 0, 0, 1, stat_at, 0, 0); break; - - default: - mlog << Error << "\nSTATAnalysisJob::setup_stat_file() -> " - << "unexpected stat line type \"" << statlinetype_to_string(out_lt) - << "\"!\n\n"; - exit(1); - break; + // Write the STAT header row + // + switch(out_lt) { + case stat_sl1l2: write_header_row (sl1l2_columns, n_sl1l2_columns, 1, stat_at, 0, 0); break; + case stat_sal1l2: write_header_row (sal1l2_columns, n_sal1l2_columns, 1, stat_at, 0, 0); break; + case stat_vl1l2: write_header_row (vl1l2_columns, n_vl1l2_columns, 1, stat_at, 0, 0); break; + case stat_val1l2: write_header_row (val1l2_columns, n_val1l2_columns, 1, stat_at, 0, 0); break; + case stat_fho: write_header_row (fho_columns, n_fho_columns, 1, stat_at, 0, 0); break; + case stat_ctc: write_header_row (ctc_columns, n_ctc_columns, 1, stat_at, 0, 0); break; + case stat_cts: write_header_row (cts_columns, n_cts_columns, 1, stat_at, 0, 0); break; + case stat_mctc: write_mctc_header_row (1, n, stat_at, 0, 0); break; + case stat_mcts: write_header_row (mcts_columns, n_mcts_columns, 1, stat_at, 0, 0); break; + case stat_cnt: write_header_row (cnt_columns, n_cnt_columns, 1, stat_at, 0, 0); break; + case stat_vcnt: write_header_row (vcnt_columns, n_vcnt_columns, 1, stat_at, 0, 0); break; + case stat_pct: write_pct_header_row (1, n, stat_at, 0, 0); break; + case stat_pstd: write_pstd_header_row (1, n, stat_at, 0, 0); break; + case stat_pjc: write_pjc_header_row (1, n, stat_at, 0, 0); break; + case stat_prc: write_prc_header_row (1, n, stat_at, 0, 0); break; + case stat_eclv: write_eclv_header_row (1, n, stat_at, 0, 0); break; + case stat_mpr: write_header_row (mpr_columns, n_mpr_columns, 1, stat_at, 0, 0); break; + case stat_nbrctc: write_header_row (nbrctc_columns, n_sl1l2_columns, 1, stat_at, 0, 0); break; + case stat_nbrcts: write_header_row (nbrcts_columns, n_sl1l2_columns, 1, stat_at, 0, 0); break; + case stat_nbrcnt: write_header_row (nbrcnt_columns, n_sl1l2_columns, 1, stat_at, 0, 0); break; + case stat_grad: write_header_row (grad_columns, n_grad_columns, 1, stat_at, 0, 0); break; + case stat_isc: write_header_row (isc_columns, n_isc_columns, 1, stat_at, 0, 0); break; + case stat_wdir: write_header_row (job_wdir_columns, n_job_wdir_columns, 1, stat_at, 0, 0); break; + case stat_ecnt: write_header_row (ecnt_columns, n_ecnt_columns, 1, stat_at, 0, 0); break; + case stat_rps: write_header_row (rps_columns, n_rps_columns, 1, stat_at, 0, 0); break; + case stat_rhist: write_rhist_header_row (1, n, stat_at, 0, 0); break; + case stat_phist: write_phist_header_row (1, n, stat_at, 0, 0); break; + case stat_relp: write_relp_header_row (1, n, stat_at, 0, 0); break; + case stat_orank: write_header_row (orank_columns, n_orank_columns, 1, stat_at, 0, 0); break; + case stat_ssvar: write_header_row (ssvar_columns, n_ssvar_columns, 1, stat_at, 0, 0); break; + case stat_genmpr: write_header_row (genmpr_columns, n_genmpr_columns, 1, stat_at, 0, 0); break; + + // + // Write only header columns for unspecified line type + // + case no_stat_line_type: + write_header_row ((const char **) 0, 0, 1, stat_at, 0, 0); break; + + default: + mlog << Error << "\nSTATAnalysisJob::setup_stat_file() -> " + << "unexpected stat line type \"" << statlinetype_to_string(out_lt) + << "\"!\n\n"; + exit(1); + break; + } + + // + // Increment row counter + // + stat_row++; + } + // + // Expand the table, if needed + // + else { + + // + // Determine the required dimensions + // + int need_rows = max(stat_at.nrows(), stat_row + n_row); + int need_cols = max(stat_at.ncols(), n_col); + + if(need_rows > stat_at.nrows() || need_cols > stat_at.ncols()) { + + // + // Resize the STAT table + // + stat_at.expand(need_rows, need_cols); + justify_stat_cols(stat_at); + stat_at.set_precision(precision); + stat_at.set_bad_data_value(bad_data_double); + stat_at.set_bad_data_str(na_str); + stat_at.set_delete_trailing_blank_rows(1); + } } return; diff --git a/met/src/libcode/vx_analysis_util/stat_job.h b/met/src/libcode/vx_analysis_util/stat_job.h index c099336712..80facaf912 100644 --- a/met/src/libcode/vx_analysis_util/stat_job.h +++ b/met/src/libcode/vx_analysis_util/stat_job.h @@ -249,6 +249,7 @@ class STATAnalysisJob { char *stat_file; // dump output statistics to a STAT file ofstream *stat_out; // output file stream for -out_stat AsciiTable stat_at; // AsciiTable for buffering output STAT data + int stat_row; // Counter for the current stat row StringArray out_line_type; // output line types ThreshArray out_fcst_thresh; // output forecast threshold(s) diff --git a/met/src/libcode/vx_data2d_nccf/data2d_nccf.cc b/met/src/libcode/vx_data2d_nccf/data2d_nccf.cc index 6709845101..099b095565 100644 --- a/met/src/libcode/vx_data2d_nccf/data2d_nccf.cc +++ b/met/src/libcode/vx_data2d_nccf/data2d_nccf.cc @@ -469,13 +469,17 @@ LongArray MetNcCFDataFile::collect_time_offsets(VarInfo &vinfo) { } } } - else if (0 <= time_dim_slot && dim_offset < time_dim_size) - time_offsets.add(dim_offset); - else error_code = error_code_unknown; + else { + if (time_as_value) dim_offset = convert_time_to_offset(dim_offset); + if (0 <= time_dim_slot && dim_offset < time_dim_size) + time_offsets.add(dim_offset); + else error_code = error_code_unknown; + } - if (0 < time_offsets.n_elements()) - mlog << Debug(7) << method_name << " Found " << time_offsets.n_elements() - << " times from between " + int time_count = time_offsets.n_elements(); + if (0 < time_count) + mlog << Debug(7) << method_name << " Found " << time_count + << (time_count==1 ? " time" : " times") << " between " << unix_to_yyyymmdd_hhmmss(_file->ValidTime[0]) << " and " << unix_to_yyyymmdd_hhmmss(_file->ValidTime[time_dim_size-1]) << "\n"; else { diff --git a/met/src/libcode/vx_data2d_python/python_dataplane.cc b/met/src/libcode/vx_data2d_python/python_dataplane.cc index 8f70af5109..8280c99fe5 100644 --- a/met/src/libcode/vx_data2d_python/python_dataplane.cc +++ b/met/src/libcode/vx_data2d_python/python_dataplane.cc @@ -317,6 +317,9 @@ for (j=1; j 0 || - job.out_obs_thresh.n() > 0)) { - - SingleThresh fst, ost; - if(job.out_fcst_thresh.n() > 0) fst = job.out_fcst_thresh[0]; - if(job.out_obs_thresh.n() > 0) ost = job.out_obs_thresh[0]; - - if(!check_fo_thresh(cur.fcst, cur.obs, cur.climo_mean, cur.climo_stdev, - fst, ost, job.out_cnt_logic)) { - mlog << Debug(4) << "aggr_mpr_lines() -> " - << "skipping forecast (" - << cur.fcst << " " << job.out_fcst_thresh.get_str() - << ") and observation (" - << cur.obs << " " << job.out_obs_thresh.get_str() - << ") matched pair with " - << setlogic_to_string(job.out_cnt_logic) - << " logic.\n"; - continue; - } - } - // // Add a new map entry, if necessary // @@ -3370,23 +3346,20 @@ void aggr_time_series_lines(LineDataFile &f, STATAnalysisJob &job, //////////////////////////////////////////////////////////////////////// void mpr_to_ctc(STATAnalysisJob &job, const AggrMPRInfo &info, - CTSInfo &cts_info) { + int i_thresh, CTSInfo &cts_info) { int i; - int n = info.pd.f_na.n(); - SingleThresh ft = job.out_fcst_thresh[0]; - SingleThresh ot = job.out_obs_thresh[0]; // // Initialize // cts_info.clear(); - cts_info.fthresh = ft; - cts_info.othresh = ot; + cts_info.fthresh = job.out_fcst_thresh[i_thresh]; + cts_info.othresh = job.out_obs_thresh[i_thresh]; // // Populate the contingency table // - for(i=0; i " + << "no MPR lines retained for -out_fcst_thresh " + << job.out_fcst_thresh[i_thresh].get_str() << " -out_obs_thresh " + << job.out_obs_thresh[i_thresh].get_str() << " -out_cnt_logic " + << setlogic_to_string(job.out_cnt_logic) + << "\n\n"; + return; + } // // Set the precip flag based on fcst_var and obs_var @@ -3556,13 +3534,13 @@ void mpr_to_cnt(STATAnalysisJob &job, const AggrMPRInfo &info, // if(job.boot_interval == boot_bca_flag) { - compute_cnt_stats_ci_bca(rng_ptr, info.pd, + compute_cnt_stats_ci_bca(rng_ptr, pd_thr, precip_flag, job.rank_corr_flag, job.n_boot_rep, cnt_info, tmp_dir); } else { - compute_cnt_stats_ci_perc(rng_ptr, info.pd, + compute_cnt_stats_ci_perc(rng_ptr, pd_thr, precip_flag, job.rank_corr_flag, job.n_boot_rep, job.boot_rep_prop, cnt_info, tmp_dir); } @@ -3573,19 +3551,42 @@ void mpr_to_cnt(STATAnalysisJob &job, const AggrMPRInfo &info, //////////////////////////////////////////////////////////////////////// void mpr_to_psum(STATAnalysisJob &job, const AggrMPRInfo &info, - SL1L2Info &s_info) { + int i_thresh, SL1L2Info &s_info) { int i; - int n = info.pd.f_na.n(); int scount, sacount; double f, o, c; double f_sum, o_sum, ff_sum, oo_sum, fo_sum; double fa_sum, oa_sum, ffa_sum, ooa_sum, foa_sum; double abs_err_sum; + PairDataPoint pd_thr; // - // Initialize the SL1L2Info object and counts + // Initialize // s_info.clear(); + + // Apply continuous filtering thresholds to subset pairs + pd_thr = info.pd.subset_pairs_cnt_thresh( + job.out_fcst_thresh[i_thresh], + job.out_obs_thresh[i_thresh], + job.out_cnt_logic); + + // + // If there are no matched pairs to process, return + // + if(pd_thr.f_na.n() == 0 || pd_thr.o_na.n() == 0) { + mlog << Warning << "\nmpr_to_psum() -> " + << "no MPR lines retained for -out_fcst_thresh " + << job.out_fcst_thresh[i_thresh].get_str() << " -out_obs_thresh " + << job.out_obs_thresh[i_thresh].get_str() << " -out_cnt_logic " + << setlogic_to_string(job.out_cnt_logic) + << "\n\n"; + return; + } + + // + // Initialize counts + // scount = sacount = 0; f_sum = o_sum = ff_sum = oo_sum = fo_sum = 0.0; fa_sum = oa_sum = ffa_sum = ooa_sum = foa_sum = 0.0; @@ -3594,14 +3595,14 @@ void mpr_to_psum(STATAnalysisJob &job, const AggrMPRInfo &info, // // Update the partial sums // - for(i=0; i &, + const STATLineType); + +//////////////////////////////////////////////////////////////////////// + void set_job_from_config(MetConfig &c, STATAnalysisJob &job) { BootInfo boot_info; @@ -581,7 +588,9 @@ void do_job_aggr_stat(const ConcatString &jobstring, LineDataFile &f, ofstream *sa_out, const ConcatString &tmp_dir, gsl_rng *rng_ptr) { STATLine line; - STATLineType in_lt, out_lt; + STATLineType in_lt; + vector out_lt; + vector::iterator it; AsciiTable out_at; int i, n; @@ -598,19 +607,26 @@ void do_job_aggr_stat(const ConcatString &jobstring, LineDataFile &f, // supplied only once // if(job.line_type.n() != 1 || - job.out_line_type.n() != 1) { + job.out_line_type.n() == 0) { mlog << Error << "\ndo_job_aggr_stat() -> " - << "this function may only be called when the " - << "\"-line_type\" and \"-out_line_type\" options have been " - << "used exactly once: " << jobstring << "\n\n"; + << "the \"-line_type\" option must be used exactly once and " + << "the \"-out_line_type\" option must be used at least once: " + << jobstring << "\n\n"; throw(1); } + // + // Write the job command line + // + write_jobstring(jobstring, sa_out); + // // Determine the input and output line types for this job // in_lt = string_to_statlinetype(job.line_type[0].c_str()); - out_lt = string_to_statlinetype(job.out_line_type[0].c_str()); + for(i=0; i CTS, ECLV // NBRCTC -> NBRCTS // - if(((in_lt == stat_fho || - in_lt == stat_ctc) && - (out_lt == stat_cts || - out_lt == stat_eclv)) || - (in_lt == stat_nbrctc && - out_lt == stat_nbrcts)) { + if(((in_lt == stat_fho || + in_lt == stat_ctc) && + (has_line_type(out_lt, stat_cts) || + has_line_type(out_lt, stat_eclv))) || + (in_lt == stat_nbrctc && + has_line_type(out_lt, stat_nbrcts))) { aggr_ctc_lines(f, job, ctc_map, n_in, n_out); - write_job_aggr_ctc(job, out_lt, ctc_map, out_at); + for(it=out_lt.begin(); it!=out_lt.end(); it++) { + write_job_aggr_ctc(job, *it, ctc_map, out_at); + if(!job.stat_out) write_table(out_at, sa_out); + } } // @@ -649,22 +668,28 @@ void do_job_aggr_stat(const ConcatString &jobstring, LineDataFile &f, // MCTC -> MCTS // else if(in_lt == stat_mctc && - out_lt == stat_mcts) { + has_line_type(out_lt, stat_mcts)) { aggr_mctc_lines(f, job, mctc_map, n_in, n_out); - write_job_aggr_mctc(job, out_lt, mctc_map, out_at); + for(it=out_lt.begin(); it!=out_lt.end(); it++) { + write_job_aggr_mctc(job, *it, mctc_map, out_at); + if(!job.stat_out) write_table(out_at, sa_out); + } } // // Sum up the Nx2 contingency table lines: // PCT -> PSTD, PJC, PRC, ECLV // - else if( in_lt == stat_pct && - (out_lt == stat_pstd || - out_lt == stat_pjc || - out_lt == stat_prc || - out_lt == stat_eclv)) { + else if(in_lt == stat_pct && + (has_line_type(out_lt, stat_pstd) || + has_line_type(out_lt, stat_pjc) || + has_line_type(out_lt, stat_prc) || + has_line_type(out_lt, stat_eclv))) { aggr_pct_lines(f, job, pct_map, n_in, n_out); - write_job_aggr_pct(job, out_lt, pct_map, out_at); + for(it=out_lt.begin(); it!=out_lt.end(); it++) { + write_job_aggr_pct(job, *it, pct_map, out_at); + if(!job.stat_out) write_table(out_at, sa_out); + } } // @@ -672,42 +697,49 @@ void do_job_aggr_stat(const ConcatString &jobstring, LineDataFile &f, // SL1L2, SAL1L2 -> CNT // NBRCTC -> NBRCNT // - else if((in_lt == stat_sl1l2 || - in_lt == stat_sal1l2) && - out_lt == stat_cnt) { + else if((in_lt == stat_sl1l2 || + in_lt == stat_sal1l2) && + has_line_type(out_lt, stat_cnt)) { aggr_psum_lines(f, job, psum_map, n_in, n_out); - write_job_aggr_psum(job, out_lt, psum_map, out_at); + for(it=out_lt.begin(); it!=out_lt.end(); it++) { + write_job_aggr_psum(job, *it, psum_map, out_at); + if(!job.stat_out) write_table(out_at, sa_out); + } } // // Sum the vector partial sum line types: // VL1L2 -> VCNT // - else if(in_lt == stat_vl1l2 && - out_lt == stat_vcnt) { + else if(in_lt == stat_vl1l2 && + has_line_type(out_lt, stat_vcnt)) { aggr_psum_lines(f, job, psum_map, n_in, n_out); - write_job_aggr_psum(job, out_lt, psum_map, out_at); + for(it=out_lt.begin(); it!=out_lt.end(); it++) { + write_job_aggr_psum(job, *it, psum_map, out_at); + if(!job.stat_out) write_table(out_at, sa_out); + } } // // Sum the vector partial sum line types: // VL1L2, VAL1L2 -> WDIR // - else if((in_lt == stat_vl1l2 || - in_lt == stat_val1l2) && - out_lt == stat_wdir) { + else if((in_lt == stat_vl1l2 || + in_lt == stat_val1l2) && + has_line_type(out_lt, stat_wdir)) { aggr_wind_lines(f, job, wind_map, n_in, n_out); write_job_aggr_wind(job, in_lt, wind_map, out_at); + if(!job.stat_out) write_table(out_at, sa_out); } // // Sum the UGRD and VGRD matched pair lines: // MPR -> WDIR // - else if(in_lt == stat_mpr && - (out_lt == stat_wdir || - out_lt == stat_vl1l2 || - out_lt == stat_vcnt)) { + else if(in_lt == stat_mpr && + (has_line_type(out_lt, stat_wdir) || + has_line_type(out_lt, stat_vl1l2) || + has_line_type(out_lt, stat_vcnt))) { mlog << Debug(4) << "do_job_aggr_stat() -> " << "For MPR wind aggregation, searching for UGRD and VGRD MPR lines.\n"; @@ -717,11 +749,15 @@ void do_job_aggr_stat(const ConcatString &jobstring, LineDataFile &f, job.fcst_var.add(vgrd_abbr_str); aggr_mpr_wind_lines(f, job, wind_map, n_in, n_out); - if(out_lt == stat_wdir) { - write_job_aggr_wind(job, in_lt, wind_map, out_at); - } - else { - write_job_aggr_mpr_wind(job, out_lt, wind_map, out_at); + for(it=out_lt.begin(); it!=out_lt.end(); it++) { + if(*it == stat_wdir) { + write_job_aggr_wind(job, in_lt, wind_map, out_at); + if(!job.stat_out) write_table(out_at, sa_out); + } + else { + write_job_aggr_mpr_wind(job, *it, wind_map, out_at); + if(!job.stat_out) write_table(out_at, sa_out); + } } } @@ -730,14 +766,17 @@ void do_job_aggr_stat(const ConcatString &jobstring, LineDataFile &f, // ORANK -> ECNT, RPS, RHIST, PHIST, RELP, SSVAR // else if(in_lt == stat_orank && - (out_lt == stat_ecnt || out_lt == stat_rps || - out_lt == stat_rhist || out_lt == stat_phist || - out_lt == stat_relp || out_lt == stat_ssvar)) { + (has_line_type(out_lt, stat_ecnt) || + has_line_type(out_lt, stat_rps) || + has_line_type(out_lt, stat_rhist) || + has_line_type(out_lt, stat_phist) || + has_line_type(out_lt, stat_relp) || + has_line_type(out_lt, stat_ssvar))) { // // Check forecast thresholds for RPS // - if(out_lt == stat_rps) { + if(has_line_type(out_lt, stat_rps)) { if(job.out_fcst_thresh.n() == 0) { mlog << Error << "\ndo_job_aggr_stat() -> " @@ -749,7 +788,10 @@ void do_job_aggr_stat(const ConcatString &jobstring, LineDataFile &f, } aggr_orank_lines(f, job, orank_map, n_in, n_out); - write_job_aggr_orank(job, out_lt, orank_map, out_at, rng_ptr); + for(it=out_lt.begin(); it!=out_lt.end(); it++) { + write_job_aggr_orank(job, *it, orank_map, out_at, rng_ptr); + if(!job.stat_out) write_table(out_at, sa_out); + } } // @@ -758,29 +800,60 @@ void do_job_aggr_stat(const ConcatString &jobstring, LineDataFile &f, // SL1L2, SAL1L2, PCT, PSTD, PJC, PRC, ECLV // else if(in_lt == stat_mpr && - (out_lt == stat_fho || out_lt == stat_ctc || - out_lt == stat_cts || out_lt == stat_mctc || - out_lt == stat_mcts || out_lt == stat_cnt || - out_lt == stat_sl1l2 || out_lt == stat_sal1l2 || - out_lt == stat_pct || out_lt == stat_pstd || - out_lt == stat_pjc || out_lt == stat_prc || - out_lt == stat_eclv)) { + (has_line_type(out_lt, stat_fho) || + has_line_type(out_lt, stat_ctc) || + has_line_type(out_lt, stat_cts) || + has_line_type(out_lt, stat_mctc) || + has_line_type(out_lt, stat_mcts) || + has_line_type(out_lt, stat_cnt) || + has_line_type(out_lt, stat_sl1l2) || + has_line_type(out_lt, stat_sal1l2) || + has_line_type(out_lt, stat_pct) || + has_line_type(out_lt, stat_pstd) || + has_line_type(out_lt, stat_pjc) || + has_line_type(out_lt, stat_prc) || + has_line_type(out_lt, stat_eclv))) { + + // + // Check output thresholds for continuous line types + // + if(has_line_type(out_lt, stat_cnt) || + has_line_type(out_lt, stat_sl1l2) || + has_line_type(out_lt, stat_sal1l2)) { + + if(job.out_fcst_thresh.n() != job.out_obs_thresh.n()) { + mlog << Error << "\ndo_job_aggr_stat() -> " + << "when \"-out_line_type\" is set to CNT, SL1L2, " + << "or SAL1L2, the \"-out_fcst_thresh\" and " + << "\"-out_obs_thresh\" options must specify the " + << "same number of thresholds.\n\n"; + throw(1); + } + + // Store a single NA threshold + if(job.out_fcst_thresh.n() == 0) { + job.out_fcst_thresh.add("NA"); + job.out_obs_thresh.add("NA"); + } + } // // Check output threshold values for 2x2 contingency table // - if(out_lt == stat_fho || - out_lt == stat_ctc || - out_lt == stat_cts || - out_lt == stat_eclv) { + if(has_line_type(out_lt, stat_fho) || + has_line_type(out_lt, stat_ctc) || + has_line_type(out_lt, stat_cts) || + has_line_type(out_lt, stat_eclv)) { - if(job.out_fcst_thresh.n() != 1 || - job.out_obs_thresh.n() != 1) { + if(job.out_fcst_thresh.n() == 0 || + job.out_obs_thresh.n() == 0 || + job.out_fcst_thresh.n() != job.out_obs_thresh.n()) { mlog << Error << "\ndo_job_aggr_stat() -> " << "when \"-out_line_type\" is set to FHO, CTC, " << "CTS, or ECLV, the \"-out_thresh\" option or " << "\"-out_fcst_thresh\" and \"-out_obs_thresh\" " - << "options must specify exactly one threshold.\n\n"; + << "options must specify the same number of thresholds " + << "and at least one.\n\n"; throw(1); } } @@ -788,8 +861,8 @@ void do_job_aggr_stat(const ConcatString &jobstring, LineDataFile &f, // // Check output threshold values for NxN contingency table // - if(out_lt == stat_mctc || - out_lt == stat_mcts) { + if(has_line_type(out_lt, stat_mctc) || + has_line_type(out_lt, stat_mcts)) { if(job.out_fcst_thresh.n() <= 1 || job.out_fcst_thresh.n() != job.out_obs_thresh.n()) { @@ -807,9 +880,9 @@ void do_job_aggr_stat(const ConcatString &jobstring, LineDataFile &f, job.out_obs_thresh[i].get_value() > job.out_obs_thresh[i+1].get_value() || job.out_fcst_thresh[i].get_type() != job.out_fcst_thresh[i+1].get_type() || job.out_obs_thresh[i].get_type() != job.out_obs_thresh[i+1].get_type() || - job.out_fcst_thresh[i].get_type() == thresh_eq || - job.out_fcst_thresh[i].get_type() == thresh_ne || - job.out_obs_thresh[i].get_type() == thresh_eq || + job.out_fcst_thresh[i].get_type() == thresh_eq || + job.out_fcst_thresh[i].get_type() == thresh_ne || + job.out_obs_thresh[i].get_type() == thresh_eq || job.out_obs_thresh[i].get_type() == thresh_ne) { mlog << Error << "\ndo_job_aggr_stat() -> " @@ -825,10 +898,10 @@ void do_job_aggr_stat(const ConcatString &jobstring, LineDataFile &f, // // Check for output threshold values // - if(out_lt == stat_pct || - out_lt == stat_pstd || - out_lt == stat_pjc || - out_lt == stat_prc) { + if(has_line_type(out_lt, stat_pct) || + has_line_type(out_lt, stat_pstd) || + has_line_type(out_lt, stat_pjc) || + has_line_type(out_lt, stat_prc)) { if(job.out_obs_thresh.n() != 1) { mlog << Error << "\ndo_job_aggr_stat() -> " @@ -887,7 +960,10 @@ void do_job_aggr_stat(const ConcatString &jobstring, LineDataFile &f, // Parse the input MPR lines // aggr_mpr_lines(f, job, mpr_map, n_in, n_out); - write_job_aggr_mpr(job, out_lt, mpr_map, out_at, tmp_dir.c_str(), rng_ptr); + for(it=out_lt.begin(); it!=out_lt.end(); it++) { + write_job_aggr_mpr(job, *it, mpr_map, out_at, tmp_dir.c_str(), rng_ptr); + if(!job.stat_out) write_table(out_at, sa_out); + } } // @@ -897,7 +973,7 @@ void do_job_aggr_stat(const ConcatString &jobstring, LineDataFile &f, mlog << Error << "\ndo_job_aggr_stat() -> " << "invalid combination of \"-line_type " << statlinetype_to_string(in_lt) << "\" and " - << "\"-out_line_type " << statlinetype_to_string(out_lt) + << "\"-out_line_type " << statlinetype_to_string(out_lt[0]) << "\"\n\n"; throw(1); } @@ -912,13 +988,6 @@ void do_job_aggr_stat(const ConcatString &jobstring, LineDataFile &f, return; } - // - // Write the ASCII Table and the job command line - // If -out_stat was specified, do not write output - // - write_jobstring(jobstring, sa_out); - if(!job.stat_out) write_table(out_at, sa_out); - return; } @@ -1167,7 +1236,7 @@ void write_job_aggr_ctc(STATAnalysisJob &job, STATLineType lt, // // Loop through the map // - for(it = m.begin(), r=1; it != m.end(); it++, r++) { + for(it = m.begin(), r=1; it != m.end(); it++) { // // Write the output STAT header columns @@ -1176,7 +1245,7 @@ void write_job_aggr_ctc(STATAnalysisJob &job, STATLineType lt, job.hdr_name, job.hdr_value, lt); if(job.stat_out) { if(lt == stat_cts || lt == stat_nbrcts) shc.set_alpha(job.out_alpha); - write_header_cols(shc, job.stat_at, r); + write_header_cols(shc, job.stat_at, job.stat_row); } // @@ -1190,12 +1259,12 @@ void write_job_aggr_ctc(STATAnalysisJob &job, STATLineType lt, if(lt == stat_fho) { if(job.stat_out) { write_fho_cols(it->second.cts_info, job.stat_at, - r, n_header_columns); + job.stat_row++, n_header_columns); } else { at.set_entry(r, c++, (string)"FHO:"); write_case_cols(it->first, at, r, c); - write_fho_cols(it->second.cts_info, at, r, c); + write_fho_cols(it->second.cts_info, at, r++, c); } } // @@ -1204,12 +1273,12 @@ void write_job_aggr_ctc(STATAnalysisJob &job, STATLineType lt, else if(lt == stat_ctc) { if(job.stat_out) { write_ctc_cols(it->second.cts_info, job.stat_at, - r, n_header_columns); + job.stat_row++, n_header_columns); } else { at.set_entry(r, c++, (string)"CTC:"); write_case_cols(it->first, at, r, c); - write_ctc_cols(it->second.cts_info, at, r, c); + write_ctc_cols(it->second.cts_info, at, r++, c); } } // @@ -1235,12 +1304,12 @@ void write_job_aggr_ctc(STATAnalysisJob &job, STATLineType lt, // if(job.stat_out) { write_cts_cols(it->second.cts_info, 0, job.stat_at, - r, n_header_columns); + job.stat_row++, n_header_columns); } else { at.set_entry(r, c++, (string)"CTS:"); write_case_cols(it->first, at, r, c); - write_cts_cols(it->second.cts_info, 0, at, r, c); + write_cts_cols(it->second.cts_info, 0, at, r++, c); } } // @@ -1250,12 +1319,12 @@ void write_job_aggr_ctc(STATAnalysisJob &job, STATLineType lt, if(job.stat_out) { write_eclv_cols(it->second.cts_info.cts, job.out_eclv_points, job.stat_at, - r, n_header_columns); + job.stat_row++, n_header_columns); } else { at.set_entry(r, c++, (string)"ECLV:"); write_case_cols(it->first, at, r, c); - write_eclv_cols(it->second.cts_info.cts, job.out_eclv_points, at, r, c); + write_eclv_cols(it->second.cts_info.cts, job.out_eclv_points, at, r++, c); } } // @@ -1268,12 +1337,12 @@ void write_job_aggr_ctc(STATAnalysisJob &job, STATLineType lt, if(job.stat_out) { write_nbrctc_cols(nbrcts_info, job.stat_at, - r, n_header_columns); + job.stat_row++, n_header_columns); } else { at.set_entry(r, c++, (string)"NBRCTC:"); write_case_cols(it->first, at, r, c); - write_nbrctc_cols(nbrcts_info, at, r, c); + write_nbrctc_cols(nbrcts_info, at, r++, c); } } // @@ -1302,14 +1371,23 @@ void write_job_aggr_ctc(STATAnalysisJob &job, STATLineType lt, // if(job.stat_out) { write_nbrcts_cols(nbrcts_info, 0, job.stat_at, - r, n_header_columns); + job.stat_row++, n_header_columns); } else { at.set_entry(r, c++, (string)"NBRCTS:"); write_case_cols(it->first, at, r, c); - write_nbrcts_cols(nbrcts_info, 0, at, r, c); + write_nbrcts_cols(nbrcts_info, 0, at, r++, c); } } + // + // Unsupported line type + // + else { + mlog << Error << "\nwrite_job_aggr_ctc() -> " + << "unsupported output line type \"" + << statlinetype_to_string(lt) << "\" requested.\n\n"; + throw(1); + } } // end for it return; @@ -1358,7 +1436,7 @@ void write_job_aggr_mctc(STATAnalysisJob &job, STATLineType lt, // // Loop through the map // - for(it = m.begin(), r=1; it != m.end(); it++, r++) { + for(it = m.begin(), r=1; it != m.end(); it++) { // // Write the output STAT header columns @@ -1367,7 +1445,7 @@ void write_job_aggr_mctc(STATAnalysisJob &job, STATLineType lt, job.hdr_name, job.hdr_value, lt); if(job.stat_out) { if(lt == stat_mcts) shc.set_alpha(job.out_alpha); - write_header_cols(shc, job.stat_at, r); + write_header_cols(shc, job.stat_at, job.stat_row); } // @@ -1381,12 +1459,12 @@ void write_job_aggr_mctc(STATAnalysisJob &job, STATLineType lt, if(lt == stat_mctc) { if(job.stat_out) { write_mctc_cols(it->second.mcts_info, job.stat_at, - r, n_header_columns); + job.stat_row++, n_header_columns); } else { at.set_entry(r, c++, (string)"MCTC:"); write_case_cols(it->first, at, r, c); - write_mctc_cols(it->second.mcts_info, at, r, c); + write_mctc_cols(it->second.mcts_info, at, r++, c); } } // @@ -1412,14 +1490,23 @@ void write_job_aggr_mctc(STATAnalysisJob &job, STATLineType lt, // if(job.stat_out) { write_mcts_cols(it->second.mcts_info, 0, job.stat_at, - r, n_header_columns); + job.stat_row++, n_header_columns); } else { at.set_entry(r, c++, (string)"MCTS:"); write_case_cols(it->first, at, r, c); - write_mcts_cols(it->second.mcts_info, 0, at, r, c); + write_mcts_cols(it->second.mcts_info, 0, at, r++, c); } } + // + // Unsupported line type + // + else { + mlog << Error << "\nwrite_job_aggr_mctc() -> " + << "unsupported output line type \"" + << statlinetype_to_string(lt) << "\" requested.\n\n"; + throw(1); + } } // end for it return; @@ -1478,7 +1565,7 @@ void write_job_aggr_pct(STATAnalysisJob &job, STATLineType lt, // // Loop through the map // - for(it = m.begin(), r=1; it != m.end(); it++, r++) { + for(it = m.begin(), r=1; it != m.end(); it++) { // // Write the output STAT header columns @@ -1487,7 +1574,7 @@ void write_job_aggr_pct(STATAnalysisJob &job, STATLineType lt, job.hdr_name, job.hdr_value, lt); if(job.stat_out) { if(lt == stat_pstd) shc.set_alpha(job.out_alpha); - write_header_cols(shc, job.stat_at, r); + write_header_cols(shc, job.stat_at, job.stat_row); } // @@ -1501,12 +1588,12 @@ void write_job_aggr_pct(STATAnalysisJob &job, STATLineType lt, if(lt == stat_pct) { if(job.stat_out) { write_pct_cols(it->second.pct_info, job.stat_at, - r, n_header_columns); + job.stat_row++, n_header_columns); } else { at.set_entry(r, c++, (string)"PCT:"); write_case_cols(it->first, at, r, c); - write_pct_cols(it->second.pct_info, at, r, c); + write_pct_cols(it->second.pct_info, at, r++, c); } } // @@ -1532,12 +1619,12 @@ void write_job_aggr_pct(STATAnalysisJob &job, STATLineType lt, // if(job.stat_out) { write_pstd_cols(it->second.pct_info, 0, job.stat_at, - r, n_header_columns); + job.stat_row++, n_header_columns); } else { at.set_entry(r, c++, (string)"PSTD:"); write_case_cols(it->first, at, r, c); - write_pstd_cols(it->second.pct_info, 0, at, r, c); + write_pstd_cols(it->second.pct_info, 0, at, r++, c); } } // @@ -1546,12 +1633,12 @@ void write_job_aggr_pct(STATAnalysisJob &job, STATLineType lt, else if(lt == stat_pjc) { if(job.stat_out) { write_pjc_cols(it->second.pct_info, job.stat_at, - r, n_header_columns); + job.stat_row++, n_header_columns); } else { at.set_entry(r, c++, (string)"PJC:"); write_case_cols(it->first, at, r, c); - write_pjc_cols(it->second.pct_info, at, r, c); + write_pjc_cols(it->second.pct_info, at, r++, c); } } // @@ -1560,12 +1647,12 @@ void write_job_aggr_pct(STATAnalysisJob &job, STATLineType lt, else if(lt == stat_prc) { if(job.stat_out) { write_prc_cols(it->second.pct_info, job.stat_at, - r, n_header_columns); + job.stat_row++, n_header_columns); } else { at.set_entry(r, c++, (string)"PRC:"); write_case_cols(it->first, at, r, c); - write_prc_cols(it->second.pct_info, at, r, c); + write_prc_cols(it->second.pct_info, at, r++, c); } } // @@ -1573,22 +1660,31 @@ void write_job_aggr_pct(STATAnalysisJob &job, STATLineType lt, // else if(lt == stat_eclv) { ThreshArray prob_ta = string_to_prob_thresh(shc.get_fcst_thresh_str().c_str()); - for(i=0; isecond.pct_info.pct.nrows(); i++, r++) { + for(i=0; isecond.pct_info.pct.nrows(); i++) { if(job.stat_out) { shc.set_fcst_thresh(prob_ta[i]); - write_header_cols(shc, job.stat_at, r); + write_header_cols(shc, job.stat_at, job.stat_row); write_eclv_cols(it->second.pct_info.pct.ctc_by_row(i), - job.out_eclv_points, job.stat_at, r, n_header_columns); + job.out_eclv_points, job.stat_at, job.stat_row++, n_header_columns); } else { c = 0; at.set_entry(r, c++, (string)"ECLV:"); write_case_cols(it->first, at, r, c); write_eclv_cols(it->second.pct_info.pct.ctc_by_row(i), - job.out_eclv_points, at, r, c); + job.out_eclv_points, at, r++, c); } } } + // + // Unsupported line type + // + else { + mlog << Error << "\nwrite_job_aggr_pct() -> " + << "unsupported output line type \"" + << statlinetype_to_string(lt) << "\" requested.\n\n"; + throw(1); + } } // end for it return; @@ -1640,7 +1736,7 @@ void write_job_aggr_psum(STATAnalysisJob &job, STATLineType lt, // // Loop through the map // - for(it = m.begin(), r=1; it != m.end(); it++, r++) { + for(it = m.begin(), r=1; it != m.end(); it++) { // // Write the output STAT header columns @@ -1649,7 +1745,7 @@ void write_job_aggr_psum(STATAnalysisJob &job, STATLineType lt, job.hdr_name, job.hdr_value, lt); if(job.stat_out) { if(lt == stat_cnt || lt == stat_nbrcnt) shc.set_alpha(job.out_alpha); - write_header_cols(shc, job.stat_at, r); + write_header_cols(shc, job.stat_at, job.stat_row); } // @@ -1663,12 +1759,12 @@ void write_job_aggr_psum(STATAnalysisJob &job, STATLineType lt, if(lt == stat_sl1l2) { if(job.stat_out) { write_sl1l2_cols(it->second.sl1l2_info, job.stat_at, - r, n_header_columns); + job.stat_row++, n_header_columns); } else { at.set_entry(r, c++, (string)"SL1L2:"); write_case_cols(it->first, at, r, c); - write_sl1l2_cols(it->second.sl1l2_info, at, r, c); + write_sl1l2_cols(it->second.sl1l2_info, at, r++, c); } } // @@ -1677,12 +1773,12 @@ void write_job_aggr_psum(STATAnalysisJob &job, STATLineType lt, else if(lt == stat_sal1l2) { if(job.stat_out) { write_sal1l2_cols(it->second.sl1l2_info, job.stat_at, - r, n_header_columns); + job.stat_row++, n_header_columns); } else { at.set_entry(r, c++, (string)"SAL1L2:"); write_case_cols(it->first, at, r, c); - write_sal1l2_cols(it->second.sl1l2_info, at, r, c); + write_sal1l2_cols(it->second.sl1l2_info, at, r++, c); } } // @@ -1691,12 +1787,12 @@ void write_job_aggr_psum(STATAnalysisJob &job, STATLineType lt, else if(lt == stat_vl1l2) { if(job.stat_out) { write_vl1l2_cols(it->second.vl1l2_info, job.stat_at, - r, n_header_columns); + job.stat_row++, n_header_columns); } else { at.set_entry(r, c++, (string)"VL1L2:"); write_case_cols(it->first, at, r, c); - write_vl1l2_cols(it->second.vl1l2_info, at, r, c); + write_vl1l2_cols(it->second.vl1l2_info, at, r++, c); } } // @@ -1705,12 +1801,12 @@ void write_job_aggr_psum(STATAnalysisJob &job, STATLineType lt, else if(lt == stat_val1l2) { if(job.stat_out) { write_val1l2_cols(it->second.vl1l2_info, job.stat_at, - r, n_header_columns); + job.stat_row++, n_header_columns); } else { at.set_entry(r, c++, (string)"VAL1L2:"); write_case_cols(it->first, at, r, c); - write_val1l2_cols(it->second.vl1l2_info, at, r, c); + write_val1l2_cols(it->second.vl1l2_info, at, r++, c); } } // @@ -1736,12 +1832,12 @@ void write_job_aggr_psum(STATAnalysisJob &job, STATLineType lt, if(job.stat_out) { write_cnt_cols(it->second.cnt_info, 0, job.stat_at, - r, n_header_columns); + job.stat_row++, n_header_columns); } else { at.set_entry(r, c++, (string)"CNT:"); write_case_cols(it->first, at, r, c); - write_cnt_cols(it->second.cnt_info, 0, at, r, c); + write_cnt_cols(it->second.cnt_info, 0, at, r++, c); } } // @@ -1750,12 +1846,12 @@ void write_job_aggr_psum(STATAnalysisJob &job, STATLineType lt, else if(lt == stat_vcnt) { if(job.stat_out) { write_vcnt_cols(it->second.vl1l2_info, job.stat_at, - r, n_header_columns); + job.stat_row++, n_header_columns); } else { at.set_entry(r, c++, (string)"VCNT:"); write_case_cols(it->first, at, r, c); - write_vcnt_cols(it->second.vl1l2_info, at, r, c); + write_vcnt_cols(it->second.vl1l2_info, at, r++, c); } } // @@ -1770,14 +1866,23 @@ void write_job_aggr_psum(STATAnalysisJob &job, STATLineType lt, if(job.stat_out) { write_nbrcnt_cols(it->second.nbrcnt_info, 0, job.stat_at, - r, n_header_columns); + job.stat_row++, n_header_columns); } else { at.set_entry(r, c++, "NBRCNT:"); write_case_cols(it->first, at, r, c); - write_nbrcnt_cols(it->second.nbrcnt_info, 0, at, r, c); + write_nbrcnt_cols(it->second.nbrcnt_info, 0, at, r++, c); } } + // + // Unsupported line type + // + else { + mlog << Error << "\nwrite_job_aggr_psum() -> " + << "unsupported output line type \"" + << statlinetype_to_string(lt) << "\" requested.\n\n"; + throw(1); + } } // end for it return; @@ -1817,14 +1922,14 @@ void write_job_aggr_grad(STATAnalysisJob &job, STATLineType lt, // // Loop through the map // - for(it = m.begin(), r=1; it != m.end(); it++, r++) { + for(it = m.begin(), r=1; it != m.end(); it++) { // // Write the output STAT header columns // shc = it->second.hdr.get_shc(it->first, job.by_column, job.hdr_name, job.hdr_value, lt); - if(job.stat_out) write_header_cols(shc, job.stat_at, r); + if(job.stat_out) write_header_cols(shc, job.stat_at, job.stat_row); // // Initialize @@ -1836,12 +1941,12 @@ void write_job_aggr_grad(STATAnalysisJob &job, STATLineType lt, // if(job.stat_out) { write_grad_cols(it->second.grad_info, job.stat_at, - r, n_header_columns); + job.stat_row++, n_header_columns); } else { at.set_entry(r, c++, "GRAD:"); write_case_cols(it->first, at, r, c); - write_grad_cols(it->second.grad_info, at, r, c); + write_grad_cols(it->second.grad_info, at, r++, c); } } // end for it @@ -2052,14 +2157,14 @@ void write_job_aggr_ecnt(STATAnalysisJob &job, STATLineType lt, // // Loop through the map // - for(it = m.begin(), r=1; it != m.end(); it++, r++) { + for(it = m.begin(), r=1; it != m.end(); it++) { // // Write the output STAT header columns // shc = it->second.hdr.get_shc(it->first, job.by_column, job.hdr_name, job.hdr_value, lt); - if(job.stat_out) write_header_cols(shc, job.stat_at, r); + if(job.stat_out) write_header_cols(shc, job.stat_at, job.stat_row); // // Initialize @@ -2076,12 +2181,12 @@ void write_job_aggr_ecnt(STATAnalysisJob &job, STATLineType lt, // if(job.stat_out) { write_ecnt_cols(ecnt_info, job.stat_at, - r, n_header_columns); + job.stat_row++, n_header_columns); } else { at.set_entry(r, c++, "ECNT:"); write_case_cols(it->first, at, r, c); - write_ecnt_cols(ecnt_info, at, r, c); + write_ecnt_cols(ecnt_info, at, r++, c); } } // end for it @@ -2123,14 +2228,14 @@ void write_job_aggr_rps(STATAnalysisJob &job, STATLineType lt, // // Loop through the map // - for(it = m.begin(), r=1; it != m.end(); it++, r++) { + for(it = m.begin(), r=1; it != m.end(); it++) { // // Write the output STAT header columns // shc = it->second.hdr.get_shc(it->first, job.by_column, job.hdr_name, job.hdr_value, lt); - if(job.stat_out) write_header_cols(shc, job.stat_at, r); + if(job.stat_out) write_header_cols(shc, job.stat_at, job.stat_row); // // Initialize @@ -2142,12 +2247,12 @@ void write_job_aggr_rps(STATAnalysisJob &job, STATLineType lt, // if(job.stat_out) { write_rps_cols(it->second.rps_info, job.stat_at, - r, n_header_columns); + job.stat_row++, n_header_columns); } else { at.set_entry(r, c++, "RPS:"); write_case_cols(it->first, at, r, c); - write_rps_cols(it->second.rps_info, at, r, c); + write_rps_cols(it->second.rps_info, at, r++, c); } } // end for it @@ -2194,7 +2299,7 @@ void write_job_aggr_rhist(STATAnalysisJob &job, STATLineType lt, // // Loop through the map // - for(it = m.begin(), r=1; it != m.end(); it++, r++) { + for(it = m.begin(), r=1; it != m.end(); it++) { // // Write the output STAT header columns @@ -2202,7 +2307,7 @@ void write_job_aggr_rhist(STATAnalysisJob &job, STATLineType lt, shc = it->second.hdr.get_shc(it->first, job.by_column, job.hdr_name, job.hdr_value, lt); if(job.stat_out) { - write_header_cols(shc, job.stat_at, r); + write_header_cols(shc, job.stat_at, job.stat_row); } // @@ -2215,12 +2320,12 @@ void write_job_aggr_rhist(STATAnalysisJob &job, STATLineType lt, // if(job.stat_out) { write_rhist_cols(&(it->second.ens_pd), job.stat_at, - r, n_header_columns); + job.stat_row++, n_header_columns); } else { at.set_entry(r, c++, "RHIST:"); write_case_cols(it->first, at, r, c); - write_rhist_cols(&(it->second.ens_pd), at, r, c); + write_rhist_cols(&(it->second.ens_pd), at, r++, c); } } // end for it @@ -2267,7 +2372,7 @@ void write_job_aggr_phist(STATAnalysisJob &job, STATLineType lt, // // Loop through the map // - for(it = m.begin(), r=1; it != m.end(); it++, r++) { + for(it = m.begin(), r=1; it != m.end(); it++) { // // Write the output STAT header columns @@ -2275,7 +2380,7 @@ void write_job_aggr_phist(STATAnalysisJob &job, STATLineType lt, shc = it->second.hdr.get_shc(it->first, job.by_column, job.hdr_name, job.hdr_value, lt); if(job.stat_out) { - write_header_cols(shc, job.stat_at, r); + write_header_cols(shc, job.stat_at, job.stat_row); } // @@ -2288,12 +2393,12 @@ void write_job_aggr_phist(STATAnalysisJob &job, STATLineType lt, // if(job.stat_out) { write_phist_cols(&(it->second.ens_pd), job.stat_at, - r, n_header_columns); + job.stat_row++, n_header_columns); } else { at.set_entry(r, c++, "PHIST:"); write_case_cols(it->first, at, r, c); - write_phist_cols(&(it->second.ens_pd), at, r, c); + write_phist_cols(&(it->second.ens_pd), at, r++, c); } } // end for it @@ -2340,7 +2445,7 @@ void write_job_aggr_relp(STATAnalysisJob &job, STATLineType lt, // // Loop through the map // - for(it = m.begin(), r=1; it != m.end(); it++, r++) { + for(it = m.begin(), r=1; it != m.end(); it++) { // // Write the output STAT header columns @@ -2348,7 +2453,7 @@ void write_job_aggr_relp(STATAnalysisJob &job, STATLineType lt, shc = it->second.hdr.get_shc(it->first, job.by_column, job.hdr_name, job.hdr_value, lt); if(job.stat_out) { - write_header_cols(shc, job.stat_at, r); + write_header_cols(shc, job.stat_at, job.stat_row); } // @@ -2361,12 +2466,12 @@ void write_job_aggr_relp(STATAnalysisJob &job, STATLineType lt, // if(job.stat_out) { write_relp_cols(&(it->second.ens_pd), job.stat_at, - r, n_header_columns); + job.stat_row++, n_header_columns); } else { at.set_entry(r, c++, "RELP:"); write_case_cols(it->first, at, r, c); - write_relp_cols(&(it->second.ens_pd), at, r, c); + write_relp_cols(&(it->second.ens_pd), at, r++, c); } } // end for it @@ -2444,7 +2549,7 @@ void write_job_aggr_ssvar(STATAnalysisJob &job, STATLineType lt, // for(bin_it = case_it->second.ssvar_bins.begin(), i=0; bin_it != case_it->second.ssvar_bins.end(); - bin_it++, r++, i++) { + bin_it++, i++) { // // Initialize @@ -2461,42 +2566,43 @@ void write_job_aggr_ssvar(STATAnalysisJob &job, STATLineType lt, // if(job.stat_out) { c = n_header_columns; - write_header_cols(shc, job.stat_at, r); - job.stat_at.set_entry(r, c++, n); - job.stat_at.set_entry(r, c++, (int) case_it->second.ssvar_bins.size()); - job.stat_at.set_entry(r, c++, i); - job.stat_at.set_entry(r, c++, bin_it->second.bin_n); - job.stat_at.set_entry(r, c++, bin_it->second.var_min); - job.stat_at.set_entry(r, c++, bin_it->second.var_max); - job.stat_at.set_entry(r, c++, bin_it->second.var_mean); - job.stat_at.set_entry(r, c++, bin_it->second.sl1l2_info.fbar); - job.stat_at.set_entry(r, c++, bin_it->second.sl1l2_info.obar); - job.stat_at.set_entry(r, c++, bin_it->second.sl1l2_info.fobar); - job.stat_at.set_entry(r, c++, bin_it->second.sl1l2_info.ffbar); - job.stat_at.set_entry(r, c++, bin_it->second.sl1l2_info.oobar); - job.stat_at.set_entry(r, c++, cnt_info.fbar.v_ncl[0]); - job.stat_at.set_entry(r, c++, cnt_info.fbar.v_ncu[0]); - job.stat_at.set_entry(r, c++, cnt_info.fstdev.v); - job.stat_at.set_entry(r, c++, cnt_info.fstdev.v_ncl[0]); - job.stat_at.set_entry(r, c++, cnt_info.fstdev.v_ncu[0]); - job.stat_at.set_entry(r, c++, cnt_info.obar.v_ncl[0]); - job.stat_at.set_entry(r, c++, cnt_info.obar.v_ncu[0]); - job.stat_at.set_entry(r, c++, cnt_info.ostdev.v); - job.stat_at.set_entry(r, c++, cnt_info.ostdev.v_ncl[0]); - job.stat_at.set_entry(r, c++, cnt_info.ostdev.v_ncu[0]); - job.stat_at.set_entry(r, c++, cnt_info.pr_corr.v); - job.stat_at.set_entry(r, c++, cnt_info.pr_corr.v_ncl[0]); - job.stat_at.set_entry(r, c++, cnt_info.pr_corr.v_ncu[0]); - job.stat_at.set_entry(r, c++, cnt_info.me.v); - job.stat_at.set_entry(r, c++, cnt_info.me.v_ncl[0]); - job.stat_at.set_entry(r, c++, cnt_info.me.v_ncu[0]); - job.stat_at.set_entry(r, c++, cnt_info.estdev.v); - job.stat_at.set_entry(r, c++, cnt_info.estdev.v_ncl[0]); - job.stat_at.set_entry(r, c++, cnt_info.estdev.v_ncu[0]); - job.stat_at.set_entry(r, c++, cnt_info.mbias.v); - job.stat_at.set_entry(r, c++, cnt_info.mse.v); - job.stat_at.set_entry(r, c++, cnt_info.bcmse.v); - job.stat_at.set_entry(r, c++, cnt_info.rmse.v); + write_header_cols(shc, job.stat_at, job.stat_row); + job.stat_at.set_entry(job.stat_row, c++, n); + job.stat_at.set_entry(job.stat_row, c++, (int) case_it->second.ssvar_bins.size()); + job.stat_at.set_entry(job.stat_row, c++, i); + job.stat_at.set_entry(job.stat_row, c++, bin_it->second.bin_n); + job.stat_at.set_entry(job.stat_row, c++, bin_it->second.var_min); + job.stat_at.set_entry(job.stat_row, c++, bin_it->second.var_max); + job.stat_at.set_entry(job.stat_row, c++, bin_it->second.var_mean); + job.stat_at.set_entry(job.stat_row, c++, bin_it->second.sl1l2_info.fbar); + job.stat_at.set_entry(job.stat_row, c++, bin_it->second.sl1l2_info.obar); + job.stat_at.set_entry(job.stat_row, c++, bin_it->second.sl1l2_info.fobar); + job.stat_at.set_entry(job.stat_row, c++, bin_it->second.sl1l2_info.ffbar); + job.stat_at.set_entry(job.stat_row, c++, bin_it->second.sl1l2_info.oobar); + job.stat_at.set_entry(job.stat_row, c++, cnt_info.fbar.v_ncl[0]); + job.stat_at.set_entry(job.stat_row, c++, cnt_info.fbar.v_ncu[0]); + job.stat_at.set_entry(job.stat_row, c++, cnt_info.fstdev.v); + job.stat_at.set_entry(job.stat_row, c++, cnt_info.fstdev.v_ncl[0]); + job.stat_at.set_entry(job.stat_row, c++, cnt_info.fstdev.v_ncu[0]); + job.stat_at.set_entry(job.stat_row, c++, cnt_info.obar.v_ncl[0]); + job.stat_at.set_entry(job.stat_row, c++, cnt_info.obar.v_ncu[0]); + job.stat_at.set_entry(job.stat_row, c++, cnt_info.ostdev.v); + job.stat_at.set_entry(job.stat_row, c++, cnt_info.ostdev.v_ncl[0]); + job.stat_at.set_entry(job.stat_row, c++, cnt_info.ostdev.v_ncu[0]); + job.stat_at.set_entry(job.stat_row, c++, cnt_info.pr_corr.v); + job.stat_at.set_entry(job.stat_row, c++, cnt_info.pr_corr.v_ncl[0]); + job.stat_at.set_entry(job.stat_row, c++, cnt_info.pr_corr.v_ncu[0]); + job.stat_at.set_entry(job.stat_row, c++, cnt_info.me.v); + job.stat_at.set_entry(job.stat_row, c++, cnt_info.me.v_ncl[0]); + job.stat_at.set_entry(job.stat_row, c++, cnt_info.me.v_ncu[0]); + job.stat_at.set_entry(job.stat_row, c++, cnt_info.estdev.v); + job.stat_at.set_entry(job.stat_row, c++, cnt_info.estdev.v_ncl[0]); + job.stat_at.set_entry(job.stat_row, c++, cnt_info.estdev.v_ncu[0]); + job.stat_at.set_entry(job.stat_row, c++, cnt_info.mbias.v); + job.stat_at.set_entry(job.stat_row, c++, cnt_info.mse.v); + job.stat_at.set_entry(job.stat_row, c++, cnt_info.bcmse.v); + job.stat_at.set_entry(job.stat_row, c++, cnt_info.rmse.v); + job.stat_row++; } // // SSVAR output line @@ -2539,6 +2645,7 @@ void write_job_aggr_ssvar(STATAnalysisJob &job, STATLineType lt, at.set_entry(r, c++, cnt_info.mse.v); at.set_entry(r, c++, cnt_info.bcmse.v); at.set_entry(r, c++, cnt_info.rmse.v); + r++; } } // end for bin_it } // end for case_it @@ -2653,21 +2760,21 @@ void write_job_aggr_orank(STATAnalysisJob &job, STATLineType lt, if(lt == stat_ecnt) { ECNTInfo ecnt_info; ecnt_info.set(it->second.ens_pd); - at.set_entry(r, c++, "ECNT:"); - write_case_cols(it->first, at, r, c); - write_ecnt_cols(ecnt_info, at, r, c); + if(job.stat_out) { - write_header_cols(shc, job.stat_at, r); - write_ecnt_cols(ecnt_info, job.stat_at, r, n_header_columns); + write_header_cols(shc, job.stat_at, job.stat_row); + write_ecnt_cols(ecnt_info, job.stat_at, + job.stat_row++, n_header_columns); + } + else { + at.set_entry(r, c++, "ECNT:"); + write_case_cols(it->first, at, r, c); + write_ecnt_cols(ecnt_info, at, r++, c); } - // Increment row counter - r++; } - // // RPS output line // - else if(lt == stat_rps) { RPSInfo rps_info; rps_info.fthresh = job.out_fcst_thresh; @@ -2675,19 +2782,16 @@ void write_job_aggr_orank(STATAnalysisJob &job, STATLineType lt, if(job.stat_out) { shc.set_fcst_thresh(job.out_fcst_thresh); - write_header_cols(shc, job.stat_at, r); - write_rps_cols(rps_info, job.stat_at, r, n_header_columns); + write_header_cols(shc, job.stat_at, job.stat_row); + write_rps_cols(rps_info, job.stat_at, + job.stat_row++, n_header_columns); } else { at.set_entry(r, c++, "RPS:"); write_case_cols(it->first, at, r, c); - write_rps_cols(rps_info, at, r, c); + write_rps_cols(rps_info, at, r++, c); } - - // Increment row counter - r++; } - // // RHIST output line // @@ -2695,37 +2799,31 @@ void write_job_aggr_orank(STATAnalysisJob &job, STATLineType lt, it->second.ens_pd.compute_rhist(); if(job.stat_out) { - write_header_cols(shc, job.stat_at, r); - write_rhist_cols(&(it->second.ens_pd), job.stat_at, r, n_header_columns); + write_header_cols(shc, job.stat_at, job.stat_row); + write_rhist_cols(&(it->second.ens_pd), job.stat_at, + job.stat_row++, n_header_columns); } else { at.set_entry(r, c++, "RHIST:"); write_case_cols(it->first, at, r, c); - write_rhist_cols(&(it->second.ens_pd), at, r, c); + write_rhist_cols(&(it->second.ens_pd), at, r++, c); } - - // Increment row counter - r++; } - // // PHIST output line // else if(lt == stat_phist) { if(job.stat_out) { - write_header_cols(shc, job.stat_at, r); - write_phist_cols(&(it->second.ens_pd), job.stat_at, r, n_header_columns); + write_header_cols(shc, job.stat_at, job.stat_row); + write_phist_cols(&(it->second.ens_pd), job.stat_at, + job.stat_row++, n_header_columns); } else { at.set_entry(r, c++, "PHIST:"); write_case_cols(it->first, at, r, c); - write_phist_cols(&(it->second.ens_pd), at, r, c); + write_phist_cols(&(it->second.ens_pd), at, r++, c); } - - // Increment row counter - r++; } - // // RELP output line // @@ -2733,20 +2831,16 @@ void write_job_aggr_orank(STATAnalysisJob &job, STATLineType lt, it->second.ens_pd.compute_relp(); if(job.stat_out) { - write_header_cols(shc, job.stat_at, r); + write_header_cols(shc, job.stat_at, job.stat_row); write_relp_cols(&(it->second.ens_pd), job.stat_at, - r, n_header_columns); + job.stat_row++, n_header_columns); } else { at.set_entry(r, c++, "RELP:"); write_case_cols(it->first, at, r, c); - write_relp_cols(&(it->second.ens_pd), at, r, c); + write_relp_cols(&(it->second.ens_pd), at, r++, c); } - - // Increment row counter - r++; } - // // SSVAR output lines // @@ -2759,21 +2853,27 @@ void write_job_aggr_orank(STATAnalysisJob &job, STATLineType lt, // for(i=0; isecond.ens_pd.ssvar_bins[0].n_bin; i++) { if(job.stat_out) { - write_header_cols(shc, job.stat_at, r); + write_header_cols(shc, job.stat_at, job.stat_row); write_ssvar_cols(&(it->second.ens_pd), i, job.out_alpha, job.stat_at, - r, n_header_columns); + job.stat_row++, n_header_columns); } else { c = 0; at.set_entry(r, c++, "SSVAR:"); write_case_cols(it->first, at, r, c); - write_ssvar_cols(&(it->second.ens_pd), i, job.out_alpha, at, r, c); + write_ssvar_cols(&(it->second.ens_pd), i, job.out_alpha, at, r++, c); } - - // Increment row counter - r++; } } + // + // Unsupported line type + // + else { + mlog << Error << "\nwrite_job_aggr_orank() -> " + << "unsupported output line type \"" + << statlinetype_to_string(lt) << "\" requested.\n\n"; + throw(1); + } } // end for it return; @@ -2830,16 +2930,16 @@ void write_job_aggr_isc(STATAnalysisJob &job, STATLineType lt, // // ISC output line // - for(i=-1, c=0; i<=it->second.isc_info.n_scale; i++, r++, c=0) { + for(i=-1, c=0; i<=it->second.isc_info.n_scale; i++, c=0) { if(job.stat_out) { - write_header_cols(shc, job.stat_at, r); + write_header_cols(shc, job.stat_at, job.stat_row); write_isc_cols(it->second.isc_info, i, job.stat_at, - r, n_header_columns); + job.stat_row++, n_header_columns); } else { at.set_entry(r, c++, "ISC:"); write_case_cols(it->first, at, r, c); - write_isc_cols(it->second.isc_info, i, at, r, c); + write_isc_cols(it->second.isc_info, i, at, r++, c); } } } // end for it @@ -2854,7 +2954,7 @@ void write_job_aggr_mpr(STATAnalysisJob &job, STATLineType lt, AsciiTable &at, const char *tmp_dir, gsl_rng *rng_ptr) { map::iterator it; - int n, n_row, n_col, r, c; + int n, n_row, n_col, r, c, i; StatHdrColumns shc; CTSInfo cts_info; @@ -2866,8 +2966,21 @@ void write_job_aggr_mpr(STATAnalysisJob &job, STATLineType lt, // // Setup the output table // - n = 0; - n_row = 1 + m.size(); + n = 0; + + // Number of rows + n_row = 1; + if(lt == stat_fho || lt == stat_ctc || + lt == stat_cts || lt == stat_eclv || + lt == stat_cnt || lt == stat_sl1l2 || + lt == stat_sal1l2) { + n_row += job.out_fcst_thresh.n() * m.size(); + } + else { + n_row += m.size(); + } + + // Number of columns n_col = 1 + job.by_column.n(); if(lt == stat_fho) { n_col += n_fho_columns; } else if(lt == stat_ctc) { n_col += n_ctc_columns; } @@ -2919,97 +3032,103 @@ void write_job_aggr_mpr(STATAnalysisJob &job, STATLineType lt, // // Loop through the map // - for(it = m.begin(), r=1; it != m.end(); it++, r++) { + for(it = m.begin(), r=1; it != m.end(); it++) { // - // Process percentile thresholds. + // Process percentile thresholds // job.set_perc_thresh(it->second.pd.f_na, it->second.pd.o_na, it->second.pd.cmn_na); // - // Write the output STAT header columns + // Prepare the output STAT header columns // shc = it->second.hdr.get_shc(it->first, job.by_column, job.hdr_name, job.hdr_value, lt); - if(job.stat_out) { - if(lt == stat_cts || lt == stat_nbrcts || lt == stat_mcts || - lt == stat_cnt || lt == stat_nbrcnt || lt == stat_pstd) { - shc.set_alpha(job.out_alpha); - } - if(job.out_fcst_thresh.n() > 0 || job.out_obs_thresh.n() > 0) { - shc.set_fcst_thresh(job.out_fcst_thresh); - shc.set_obs_thresh(job.out_obs_thresh); - if(lt == stat_cnt || lt == stat_sl1l2) { - shc.set_thresh_logic(job.out_cnt_logic); - } - } - write_header_cols(shc, job.stat_at, r); - } - - // - // Initialize - // - c = 0; // // FHO output line // if(lt == stat_fho) { - mpr_to_ctc(job, it->second, cts_info); - if(job.stat_out) { - write_fho_cols(cts_info, job.stat_at, - r, n_header_columns); - } - else { - at.set_entry(r, c++, "FHO:"); - write_case_cols(it->first, at, r, c); - write_fho_cols(cts_info, at, r, c); - } + for(i=0; isecond, i, cts_info); + if(job.stat_out) { + shc.set_fcst_thresh(job.out_fcst_thresh[i]); + shc.set_obs_thresh(job.out_obs_thresh[i]); + write_header_cols(shc, job.stat_at, job.stat_row); + write_fho_cols(cts_info, job.stat_at, + job.stat_row++, n_header_columns); + } + else { + c = 0; + at.set_entry(r, c++, "FHO:"); + write_case_cols(it->first, at, r, c); + write_fho_cols(cts_info, at, r++, c); + } + } // end for i } // // CTC output line // else if(lt == stat_ctc) { - mpr_to_ctc(job, it->second, cts_info); - if(job.stat_out) { - write_ctc_cols(cts_info, job.stat_at, - r, n_header_columns); - } - else { - at.set_entry(r, c++, "CTC:"); - write_case_cols(it->first, at, r, c); - write_ctc_cols(cts_info, at, r, c); - } + for(i=0; isecond, i, cts_info); + if(job.stat_out) { + shc.set_fcst_thresh(job.out_fcst_thresh[i]); + shc.set_obs_thresh(job.out_obs_thresh[i]); + write_header_cols(shc, job.stat_at, job.stat_row); + write_ctc_cols(cts_info, job.stat_at, + job.stat_row++, n_header_columns); + } + else { + c = 0; + at.set_entry(r, c++, "CTC:"); + write_case_cols(it->first, at, r, c); + write_ctc_cols(cts_info, at, r++, c); + } + } // end for i } // // CTS output line // else if(lt == stat_cts) { - mpr_to_cts(job, it->second, cts_info, tmp_dir, rng_ptr); - if(job.stat_out) { - write_cts_cols(cts_info, 0, job.stat_at, - r, n_header_columns); - } - else { - at.set_entry(r, c++, "CTS:"); - write_case_cols(it->first, at, r, c); - write_cts_cols(cts_info, 0, at, r, c); - } + for(i=0; isecond, i, cts_info, tmp_dir, rng_ptr); + if(job.stat_out) { + shc.set_fcst_thresh(job.out_fcst_thresh[i]); + shc.set_obs_thresh(job.out_obs_thresh[i]); + shc.set_alpha(job.out_alpha); + write_header_cols(shc, job.stat_at, job.stat_row); + write_cts_cols(cts_info, 0, job.stat_at, + job.stat_row++, n_header_columns); + } + else { + c = 0; + at.set_entry(r, c++, "CTS:"); + write_case_cols(it->first, at, r, c); + write_cts_cols(cts_info, 0, at, r++, c); + } + } // end for i } // // ECLV output line // else if(lt == stat_eclv) { - mpr_to_ctc(job, it->second, cts_info); - if(job.stat_out) { - write_eclv_cols(cts_info.cts, job.out_eclv_points, - job.stat_at, r, n_header_columns); - } - else { - at.set_entry(r, c++, "ECLV:"); - write_case_cols(it->first, at, r, c); - write_eclv_cols(cts_info.cts, job.out_eclv_points, at, r, c); - } + for(i=0; isecond, i, cts_info); + if(job.stat_out) { + shc.set_fcst_thresh(job.out_fcst_thresh[i]); + shc.set_obs_thresh(job.out_obs_thresh[i]); + write_header_cols(shc, job.stat_at, job.stat_row); + write_eclv_cols(cts_info.cts, job.out_eclv_points, job.stat_at, + job.stat_row++, n_header_columns); + } + else { + c = 0; + at.set_entry(r, c++, "ECLV:"); + write_case_cols(it->first, at, r, c); + write_eclv_cols(cts_info.cts, job.out_eclv_points, at, r++, c); + } + } // end for i } // // MCTC output line @@ -3017,13 +3136,17 @@ void write_job_aggr_mpr(STATAnalysisJob &job, STATLineType lt, else if(lt == stat_mctc) { mpr_to_mctc(job, it->second, mcts_info); if(job.stat_out) { + shc.set_fcst_thresh(job.out_fcst_thresh); + shc.set_obs_thresh(job.out_obs_thresh); + write_header_cols(shc, job.stat_at, job.stat_row); write_mctc_cols(mcts_info, job.stat_at, - r, n_header_columns); + job.stat_row++, n_header_columns); } else { + c = 0; at.set_entry(r, c++, "MCTC:"); write_case_cols(it->first, at, r, c); - write_mctc_cols(mcts_info, at, r, c); + write_mctc_cols(mcts_info, at, r++, c); } } // @@ -3032,59 +3155,89 @@ void write_job_aggr_mpr(STATAnalysisJob &job, STATLineType lt, else if(lt == stat_mcts) { mpr_to_mcts(job, it->second, mcts_info, tmp_dir, rng_ptr); if(job.stat_out) { + shc.set_fcst_thresh(job.out_fcst_thresh); + shc.set_obs_thresh(job.out_obs_thresh); + shc.set_alpha(job.out_alpha); + write_header_cols(shc, job.stat_at, job.stat_row); write_mcts_cols(mcts_info, 0, job.stat_at, - r, n_header_columns); + job.stat_row++, n_header_columns); } else { + c = 0; at.set_entry(r, c++, "MCTS:"); write_case_cols(it->first, at, r, c); - write_mcts_cols(mcts_info, 0, at, r, c); + write_mcts_cols(mcts_info, 0, at, r++, c); } } // // CNT output line // else if(lt == stat_cnt) { - mpr_to_cnt(job, it->second, cnt_info, tmp_dir, rng_ptr); - if(job.stat_out) { - write_cnt_cols(cnt_info, 0, job.stat_at, - r, n_header_columns); - } - else { - at.set_entry(r, c++, "CNT:"); - write_case_cols(it->first, at, r, c); - write_cnt_cols(cnt_info, 0, at, r, c); - } + for(i=0; isecond, i, cnt_info, tmp_dir, rng_ptr); + if(cnt_info.n == 0) continue; + if(job.stat_out) { + shc.set_fcst_thresh(job.out_fcst_thresh[i]); + shc.set_obs_thresh(job.out_obs_thresh[i]); + shc.set_thresh_logic(job.out_cnt_logic); + shc.set_alpha(job.out_alpha); + write_header_cols(shc, job.stat_at, job.stat_row); + write_cnt_cols(cnt_info, 0, job.stat_at, + job.stat_row++, n_header_columns); + } + else { + c = 0; + at.set_entry(r, c++, "CNT:"); + write_case_cols(it->first, at, r, c); + write_cnt_cols(cnt_info, 0, at, r++, c); + } + } // end for i } // // SL1L2 output line // else if(lt == stat_sl1l2) { - mpr_to_psum(job, it->second, sl1l2_info); - if(job.stat_out) { - write_sl1l2_cols(sl1l2_info, job.stat_at, - r, n_header_columns); - } - else { - at.set_entry(r, c++, "SL1L2:"); - write_case_cols(it->first, at, r, c); - write_sl1l2_cols(sl1l2_info, at, r, c); - } + for(i=0; isecond, i, sl1l2_info); + if(sl1l2_info.scount == 0) continue; + if(job.stat_out) { + shc.set_fcst_thresh(job.out_fcst_thresh[i]); + shc.set_obs_thresh(job.out_obs_thresh[i]); + shc.set_thresh_logic(job.out_cnt_logic); + write_header_cols(shc, job.stat_at, job.stat_row); + write_sl1l2_cols(sl1l2_info, job.stat_at, + job.stat_row++, n_header_columns); + } + else { + c = 0; + at.set_entry(r, c++, "SL1L2:"); + write_case_cols(it->first, at, r, c); + write_sl1l2_cols(sl1l2_info, at, r++, c); + } + } // end for i } // // SAL1L2 output line // else if(lt == stat_sal1l2) { - mpr_to_psum(job, it->second, sl1l2_info); - if(job.stat_out) { - write_sal1l2_cols(sl1l2_info, job.stat_at, - r, n_header_columns); - } - else { - at.set_entry(r, c++, "SAL1L2:"); - write_case_cols(it->first, at, r, c); - write_sal1l2_cols(sl1l2_info, at, r, c); - } + for(i=0; isecond, i, sl1l2_info); + if(sl1l2_info.sacount == 0) continue; + if(job.stat_out) { + shc.set_fcst_thresh(job.out_fcst_thresh[i]); + shc.set_obs_thresh(job.out_obs_thresh[i]); + shc.set_thresh_logic(job.out_cnt_logic); + write_header_cols(shc, job.stat_at, job.stat_row); + write_sal1l2_cols(sl1l2_info, job.stat_at, + job.stat_row++, n_header_columns); + } + else { + c = 0; + at.set_entry(r, c++, "SAL1L2:"); + write_case_cols(it->first, at, r, c); + write_sal1l2_cols(sl1l2_info, at, r++, c); + } + } // end for i } // // PCT output line @@ -3092,13 +3245,17 @@ void write_job_aggr_mpr(STATAnalysisJob &job, STATLineType lt, else if(lt == stat_pct) { mpr_to_pct(job, it->second, pct_info); if(job.stat_out) { + shc.set_fcst_thresh(job.out_fcst_thresh); + shc.set_obs_thresh(job.out_obs_thresh); + write_header_cols(shc, job.stat_at, job.stat_row); write_pct_cols(pct_info, job.stat_at, - r, n_header_columns); + job.stat_row++, n_header_columns); } else { + c = 0; at.set_entry(r, c++, "PCT:"); write_case_cols(it->first, at, r, c); - write_pct_cols(pct_info, at, r, c); + write_pct_cols(pct_info, at, r++, c); } } // @@ -3107,13 +3264,18 @@ void write_job_aggr_mpr(STATAnalysisJob &job, STATLineType lt, else if(lt == stat_pstd) { mpr_to_pct(job, it->second, pct_info); if(job.stat_out) { + shc.set_fcst_thresh(job.out_fcst_thresh); + shc.set_obs_thresh(job.out_obs_thresh); + shc.set_alpha(job.out_alpha); + write_header_cols(shc, job.stat_at, job.stat_row); write_pstd_cols(pct_info, 0, job.stat_at, - r, n_header_columns); + job.stat_row++, n_header_columns); } else { + c = 0; at.set_entry(r, c++, "PSTD:"); write_case_cols(it->first, at, r, c); - write_pstd_cols(pct_info, 0, at, r, c); + write_pstd_cols(pct_info, 0, at, r++, c); } } // @@ -3122,13 +3284,18 @@ void write_job_aggr_mpr(STATAnalysisJob &job, STATLineType lt, else if(lt == stat_pjc) { mpr_to_pct(job, it->second, pct_info); if(job.stat_out) { + shc.set_fcst_thresh(job.out_fcst_thresh); + shc.set_obs_thresh(job.out_obs_thresh); + shc.set_alpha(job.out_alpha); + write_header_cols(shc, job.stat_at, job.stat_row); write_pjc_cols(pct_info, job.stat_at, - r, n_header_columns); + job.stat_row++, n_header_columns); } else { + c = 0; at.set_entry(r, c++, "PJC:"); write_case_cols(it->first, at, r, c); - write_pjc_cols(pct_info, at, r, c); + write_pjc_cols(pct_info, at, r++, c); } } // @@ -3137,17 +3304,36 @@ void write_job_aggr_mpr(STATAnalysisJob &job, STATLineType lt, else if(lt == stat_prc) { mpr_to_pct(job, it->second, pct_info); if(job.stat_out) { + shc.set_fcst_thresh(job.out_fcst_thresh); + shc.set_obs_thresh(job.out_obs_thresh); + shc.set_alpha(job.out_alpha); + write_header_cols(shc, job.stat_at, job.stat_row); write_prc_cols(pct_info, job.stat_at, - r, n_header_columns); + job.stat_row++, n_header_columns); } else { + c = 0; at.set_entry(r, c++, "PRC:"); write_case_cols(it->first, at, r, c); - write_prc_cols(pct_info, at, r, c); + write_prc_cols(pct_info, at, r++, c); } } + // + // Unsupported line type + // + else { + mlog << Error << "\nwrite_job_aggr_mpr() -> " + << "unsupported output line type \"" + << statlinetype_to_string(lt) << "\" requested.\n\n"; + throw(1); + } } // end for it + // + // Discard contents of an empty AsciiTable + // + if(r == 1) at.clear(); + return; } @@ -3187,7 +3373,7 @@ void write_job_aggr_mpr_wind(STATAnalysisJob &job, STATLineType lt, // // Loop through the map // - for(it = m.begin(), r=1; it != m.end(); it++, r++) { + for(it = m.begin(), r=1; it != m.end(); it++) { // // Write the output STAT header columns @@ -3196,7 +3382,7 @@ void write_job_aggr_mpr_wind(STATAnalysisJob &job, STATLineType lt, job.hdr_name, job.hdr_value, lt); if(job.stat_out) { if(lt == stat_cnt || lt == stat_nbrcnt) shc.set_alpha(job.out_alpha); - write_header_cols(shc, job.stat_at, r); + write_header_cols(shc, job.stat_at, job.stat_row); } // @@ -3210,12 +3396,12 @@ void write_job_aggr_mpr_wind(STATAnalysisJob &job, STATLineType lt, if(lt == stat_vl1l2) { if(job.stat_out) { write_vl1l2_cols(it->second.vl1l2_info, job.stat_at, - r, n_header_columns); + job.stat_row++, n_header_columns); } else { at.set_entry(r, c++, "VL1L2:"); write_case_cols(it->first, at, r, c); - write_vl1l2_cols(it->second.vl1l2_info, at, r, c); + write_vl1l2_cols(it->second.vl1l2_info, at, r++, c); } } // @@ -3224,14 +3410,23 @@ void write_job_aggr_mpr_wind(STATAnalysisJob &job, STATLineType lt, else if(lt == stat_vcnt) { if(job.stat_out) { write_vcnt_cols(it->second.vl1l2_info, job.stat_at, - r, n_header_columns); + job.stat_row++, n_header_columns); } else { at.set_entry(r, c++, "VCNT:"); write_case_cols(it->first, at, r, c); - write_vcnt_cols(it->second.vl1l2_info, at, r, c); + write_vcnt_cols(it->second.vl1l2_info, at, r++, c); } } + // + // Unsupported line type + // + else { + mlog << Error << "\nwrite_job_aggr_mpr_wind() -> " + << "unsupported output line type \"" + << statlinetype_to_string(lt) << "\" requested.\n\n"; + throw(1); + } } // end for it return; @@ -3263,7 +3458,7 @@ void write_job_ramp(STATAnalysisJob &job, // Initialize to one header row int n_stat_row = 1; - int r_stat, r_ctc, r_cts, r_mpr; + int r_ctc, r_cts, r_mpr; // // Setup CTC output table @@ -3340,7 +3535,7 @@ void write_job_ramp(STATAnalysisJob &job, // // Loop through the map // - for(it = m.begin(), r_stat = r_ctc = r_cts = r_mpr = 1; it != m.end(); it++) { + for(it = m.begin(), r_ctc = r_cts = r_mpr = 1; it != m.end(); it++) { // // Nothing to do @@ -3662,16 +3857,16 @@ void write_job_ramp(STATAnalysisJob &job, // CTC line type if(job.out_line_type.has(stat_ctc_str)) { - write_header_cols(ctc_shc, job.stat_at, r_stat); - write_ctc_cols(cts_info, job.stat_at, r_stat, n_header_columns); - r_stat++; + write_header_cols(ctc_shc, job.stat_at, job.stat_row); + write_ctc_cols(cts_info, job.stat_at, + job.stat_row++, n_header_columns); } // CTS line type if(job.out_line_type.has(stat_cts_str)) { - write_header_cols(cts_shc, job.stat_at, r_stat); - write_cts_cols(cts_info, 0, job.stat_at, r_stat, n_header_columns); - r_stat++; + write_header_cols(cts_shc, job.stat_at, job.stat_row); + write_cts_cols(cts_info, 0, job.stat_at, + job.stat_row++, n_header_columns); } } @@ -4011,6 +4206,11 @@ void setup_table(AsciiTable &at, int n_hdr_cols, int prec) { void write_table(AsciiTable &at, ofstream *sa_out) { + // + // Do not write an empty table + // + if(at.nrows() == 0 && at.ncols() == 0) return; + if(sa_out) *(sa_out) << at << "\n" << flush; else cout << at << "\n" << flush; @@ -4596,3 +4796,10 @@ void write_case_cols(const ConcatString &cs, AsciiTable &at, } //////////////////////////////////////////////////////////////////////// + +bool has_line_type(const vector &v, + const STATLineType lt) { + return(std::find(v.begin(), v.end(), lt) != v.end()); +} + +//////////////////////////////////////////////////////////////////////// diff --git a/met/src/tools/other/ascii2nc/python_handler.cc b/met/src/tools/other/ascii2nc/python_handler.cc index d894ab6c64..09c7b90d2c 100644 --- a/met/src/tools/other/ascii2nc/python_handler.cc +++ b/met/src/tools/other/ascii2nc/python_handler.cc @@ -361,6 +361,9 @@ for (j=0; j> make.log 2>&1 - elif [[ ${COMPILER_FAMILY} == "intel" ]] || [[ ${COMPILER_FAMILY} == "ics" ]] || [[ ${COMPILER_FAMILY} == "ips" ]] || [[ ${COMPILER_FAMILY} == "ips" ]] || [[ ${COMPILER_FAMILY} == "PrgEnv-intel" ]]; then + ${FC} -c -fno-second-underscore -fallow-argument-mismatch `./getdefflags_F.sh` modv*.F moda*.F `ls -1 *.F *.f | grep -v "mod[av]_"` >> make.log 2>&1 + elif [[ ${COMPILER_FAMILY} == "intel" ]] || [[ ${COMPILER_FAMILY} == "ics" ]] || [[ ${COMPILER_FAMILY} == "ips" ]] || [[ ${COMPILER_FAMILY} == "ips" ]] || [[ ${COMPILER_FAMILY} == "PrgEnv-intel" ]]; then ${FC} -c `./getdefflags_F.sh` modv*.F moda*.F `ls -1 *.F *.f | grep -v "mod[av]_"` >> make.log 2>&1 elif [[ ${COMPILER_FAMILY} == "pgi" ]]; then ${FC} -c -Mnosecond_underscore `./getdefflags_F.sh` modv*.F moda*.F `ls -1 *.F *.f | grep -v "mod[av]_"` >> make.log 2>&1 @@ -460,8 +460,14 @@ if [ $COMPILE_HDF -eq 1 ]; then echo "configure returned with non-zero ($ret) status" exit 1 fi - cat mfhdf/hdiff/Makefile | sed 's/LIBS = -ljpeg -lz/LIBS = -ljpeg -lz -lm/g' > Makefile_NEW - mv Makefile_NEW mfhdf/hdiff/Makefile + cat mfhdf/hdiff/Makefile | \ + sed 's/LIBS = -ljpeg -lz/LIBS = -ljpeg -lz -lm/g' \ + > Makefile_new + mv Makefile_new mfhdf/hdiff/Makefile + cat hdf/src/Makefile | \ + sed 's/FFLAGS = -O2/FFLAGS = -w -fallow-argument-mismatch -O2/g' \ + > Makefile_new + mv Makefile_new hdf/src/Makefile echo "make > make.log 2>&1" make > make.log 2>&1 ret=$? @@ -624,7 +630,7 @@ fi if [ $COMPILE_CAIRO -eq 1 ]; then # If on Cray, compile PIXMAN - if [ ${COMPILER_FAMILY} == "PrgEnv-intel" ]; then + if [ ${COMPILER_FAMILY} = "PrgEnv-intel" ]; then echo echo "Compiling pixman at `date`" mkdir -p ${LIB_DIR}/pixman @@ -664,7 +670,7 @@ if [ $COMPILE_CAIRO -eq 1 ]; then tar -xf ${TAR_DIR}/cairo*.tar* cd cairo* export PKG_CONFIG=`which pkg-config` - if [ ${COMPILER_FAMILY} == "PrgEnv-intel" ]; then + if [ ${COMPILER_FAMILY} = "PrgEnv-intel" ]; then export PKG_CONFIG_PATH=${LIB_DIR}/lib/pkgconfig/ fi echo "cd `pwd`" @@ -699,7 +705,7 @@ if [ $COMPILE_MET -eq 1 ]; then cd ${MET_DIR} # If using source from a tar file remove everything and unpack the tar file # FALSE = compiling from github repo and we don't want to overwrite the files - if [ ${USE_MET_TAR_FILE} == "TRUE" ]; then + if [ ${USE_MET_TAR_FILE} = "TRUE" ]; then rm -rf met* tar -xzf ${MET_TARBALL} fi @@ -712,7 +718,11 @@ if [ $COMPILE_MET -eq 1 ]; then fi if [ -z ${MET_GRIB2CLIB} ]; then - export MET_GRIB2C=${LIB_DIR} + export MET_GRIB2CLIB=${LIB_DIR}/lib + export MET_GRIB2CINC=${LIB_DIR}/include + export LIB_JASPER=${LIB_DIR}/lib + export LIB_LIBPNG=${LIB_DIR}/lib + export LIB_Z=${LIB_DIR}/lib else export MET_GRIB2CLIB=${MET_GRIB2CLIB} export MET_GRIB2CINC=${MET_GRIB2CINC} @@ -744,7 +754,7 @@ if [ $COMPILE_MET -eq 1 ]; then export LIBS="${LIBS} -lhdf5_hl -lhdf5 -lz" export MET_FONT_DIR=${TEST_BASE}/fonts - if [ ${SET_D64BIT} == "TRUE" ]; then + if [ ${SET_D64BIT} = "TRUE" ]; then export CFLAGS="-D__64BIT__" export CXXFLAGS="-D__64BIT__" fi diff --git a/scripts/installation/config/install_met_env.cheyenne_gcc b/scripts/installation/config/install_met_env.cheyenne_gcc new file mode 100644 index 0000000000..57e013ebd2 --- /dev/null +++ b/scripts/installation/config/install_met_env.cheyenne_gcc @@ -0,0 +1,29 @@ +module load ncarenv/1.3 +module load gnu/10.1.0 +module load python/3.7.9 +module load netcdf/4.7.4 +ncar_pylib + +export TEST_BASE=/glade/p/ral/jntp/MET/MET_cross_platform_testing/met-10.0.0-beta4/gcc +export COMPILER=gnu_10.1.0 +export MET_SUBDIR=${TEST_BASE} +export MET_TARBALL=met-10.0.0-beta4.20210302.tar.gz +export USE_MODULES=TRUE +export MET_PYTHON=/glade/u/apps/ch/opt/python/3.7.9/gnu/9.1.0 +export MET_PYTHON_CC=-I${MET_PYTHON}/include/python3.7m +export MET_PYTHON_LD=-L${MET_PYTHON}/lib\ -lpython3.7m\ -lcrypt\ -lpthread\ -ldl\ -lutil\ -lm +export MET_NETCDF=/glade/u/apps/ch/opt/netcdf/4.7.4/gnu/10.1.0/ +export EXTERNAL_LIBS=/glade/p/ral/jntp/MET/MET_cross_platform_testing/met-10.0.0-beta4/gcc/external_libs/ +export MET_GSL=${EXTERNAL_LIBS} +export MET_BUFRLIB=${EXTERNAL_LIBS} +export BUFRLIB_NAME=-lbufr +export MET_HDF5=/glade/u/apps/ch/opt/netcdf/4.7.4/gnu/10.1.0/ +export MET_GRIB2CLIBS=${EXTERNAL_LIBS}/lib +export MET_GRIB2CINC=${EXTERNAL_LIBS}/include +export GRIB2CLIB_NAME=-lgrib2c +export LIB_JASPER=${EXTERNAL_LIBS}/lib +export LIB_LIBPNG=${EXTERNAL_LIBS}/lib +export LIB_Z=${EXTERNAL_LIBS}/lib +#export SET_D64BIT=FALSE +export CFLAGS="-Wall -g" +export CXXFLAGS="-Wall -g" diff --git a/test/config/STATAnalysisConfig_point_stat b/test/config/STATAnalysisConfig_point_stat index 68e1d17901..4d1a402a26 100644 --- a/test/config/STATAnalysisConfig_point_stat +++ b/test/config/STATAnalysisConfig_point_stat @@ -72,7 +72,7 @@ weight = []; // jobs = [ "-job aggregate_stat -fcst_var TMP -fcst_lev Z2 \ - -line_type MPR -out_line_type CNT \ + -line_type MPR -out_line_type CNT,SL1L2 -out_thresh NA,gt273 \ -dump_row ${OUTPUT_DIR}/CONFIG_POINT_STAT_agg_stat_mpr_to_cnt_dump.stat \ -out_stat ${OUTPUT_DIR}/CONFIG_POINT_STAT_agg_stat_mpr_to_cnt_out.stat \ -set_hdr VX_MASK CONUS", @@ -88,8 +88,8 @@ jobs = [ -out_wind_thresh >0 -out_wind_logic INTERSECTION \ -dump_row ${OUTPUT_DIR}/CONFIG_POINT_STAT_agg_stat_mpr_to_wdir_dump.stat", "-job aggregate_stat -fcst_var TMP -fcst_lev Z2 \ - -line_type MPR -out_line_type ECLV \ - -out_thresh >273 -out_eclv_points 0.1", + -line_type MPR -out_line_type ECLV,CTC,CTS \ + -out_thresh >273,>278 -out_eclv_points 0.1", "-job filter -fcst_var TMP -fcst_lev Z2 \ -line_type MPR -mask_sid ${CONFIG_DIR}/SID_CO.txt \ -dump_row ${OUTPUT_DIR}/CONFIG_POINT_STAT_filter_mpr_sid.stat", diff --git a/test/xml/unit_stat_analysis.xml b/test/xml/unit_stat_analysis.xml index 1558d101fd..93ef98b5bc 100644 --- a/test/xml/unit_stat_analysis.xml +++ b/test/xml/unit_stat_analysis.xml @@ -90,39 +90,21 @@ - + &MET_BIN;/stat_analysis \ -lookin &OUTPUT_DIR;/ensemble_stat/ensemble_stat_CMD_LINE_20120410_120000V.stat \ - -job aggregate_stat -line_type ORANK -out_line_type RHIST \ - -fcst_var APCP_24 -vx_mask NWC -vx_mask GRB \ - -dump_row &OUTPUT_DIR;/stat_analysis/AGG_STAT_ORANK_RHIST_dump.stat \ - -out_stat &OUTPUT_DIR;/stat_analysis/AGG_STAT_ORANK_RHIST_out.stat \ - -out &OUTPUT_DIR;/stat_analysis/AGG_STAT_ORANK_RHIST.out \ - -v 1 - - - &OUTPUT_DIR;/stat_analysis/AGG_STAT_ORANK_RHIST_dump.stat - &OUTPUT_DIR;/stat_analysis/AGG_STAT_ORANK_RHIST_out.stat - &OUTPUT_DIR;/stat_analysis/AGG_STAT_ORANK_RHIST.out - - - - - &MET_BIN;/stat_analysis - \ - -lookin &OUTPUT_DIR;/ensemble_stat/ensemble_stat_CMD_LINE_20120410_120000V.stat \ - -job aggregate_stat -line_type ORANK -out_line_type PHIST \ + -job aggregate_stat -line_type ORANK -out_line_type RHIST,PHIST \ -fcst_var APCP_24 -vx_mask NWC -vx_mask GRB -out_bin_size 0.10 \ - -dump_row &OUTPUT_DIR;/stat_analysis/AGG_STAT_ORANK_PHIST_dump.stat \ - -out_stat &OUTPUT_DIR;/stat_analysis/AGG_STAT_ORANK_PHIST_out.stat \ - -out &OUTPUT_DIR;/stat_analysis/AGG_STAT_ORANK_PHIST.out \ + -dump_row &OUTPUT_DIR;/stat_analysis/AGG_STAT_ORANK_RHIST_PHIST_dump.stat \ + -out_stat &OUTPUT_DIR;/stat_analysis/AGG_STAT_ORANK_RHIST_PHIST_out.stat \ + -out &OUTPUT_DIR;/stat_analysis/AGG_STAT_ORANK_RHIST_PHIST.out \ -v 1 - &OUTPUT_DIR;/stat_analysis/AGG_STAT_ORANK_PHIST_dump.stat - &OUTPUT_DIR;/stat_analysis/AGG_STAT_ORANK_PHIST_out.stat - &OUTPUT_DIR;/stat_analysis/AGG_STAT_ORANK_PHIST.out + &OUTPUT_DIR;/stat_analysis/AGG_STAT_ORANK_RHIST_PHIST_dump.stat + &OUTPUT_DIR;/stat_analysis/AGG_STAT_ORANK_RHIST_PHIST_out.stat + &OUTPUT_DIR;/stat_analysis/AGG_STAT_ORANK_RHIST_PHIST.out