Skip to content

Commit

Permalink
Per #3030, fix parsing logic for the gradient dictionary.
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnHalleyGotway committed Dec 12, 2024
1 parent 7ebbb95 commit 6f71ba2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/tools/core/series_analysis/series_analysis_conf_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,9 @@ void SeriesAnalysisConfInfo::process_config(GrdFileType ftype,
if(do_grad) {

// Conf: gradient
grad_dx = conf.lookup_int_array(conf_key_dx);
grad_dy = conf.lookup_int_array(conf_key_dy);
Dictionary *d = conf.lookup_dictionary(conf_key_gradient);
grad_dx = d->lookup_int_array(conf_key_dx);
grad_dy = d->lookup_int_array(conf_key_dy);

// Check for the same length
if(grad_dx.n() != grad_dy.n()) {
Expand Down
6 changes: 4 additions & 2 deletions src/tools/core/series_analysis/series_analysis_conf_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,15 @@ class SeriesAnalysisConfInfo {
// Dump out the counts
int get_n_fcst() const;
int get_n_obs() const;
int get_n_grad() const;
};

////////////////////////////////////////////////////////////////////////

inline int SeriesAnalysisConfInfo::get_n_fcst() const { return n_fcst; }
inline int SeriesAnalysisConfInfo::get_n_obs() const { return n_obs; }
inline int SeriesAnalysisConfInfo::get_compression_level() { return conf.nc_compression(); }
inline int SeriesAnalysisConfInfo::get_n_fcst() const { return n_fcst; }
inline int SeriesAnalysisConfInfo::get_n_obs() const { return n_obs; }
inline int SeriesAnalysisConfInfo::get_n_grad() const { return grad_dx.n(); }

////////////////////////////////////////////////////////////////////////

Expand Down

0 comments on commit 6f71ba2

Please sign in to comment.