Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix 1795 fortify_nccf #1802

Merged
merged 4 commits into from
May 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions met/src/libcode/vx_data2d_nccf/nccf_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ bool NcCfFile::open(const char * filepath)
}
}
}
delete [] time_values;
}

NcVar init_time_var = get_var(_ncFile, "forecast_reference_time");
Expand Down
8 changes: 3 additions & 5 deletions met/src/libcode/vx_grid/gaussian_grid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -157,20 +157,18 @@ for (j=0; j<Ny; ++j) Latitudes[j] = 0.0;

for (j=0; j<ny_half; ++j) {

k = j + ny_half;
i = j + ny_half;

k = Ny - 1 - k;
k = Ny - 1 - i;

L.lether_root_weight(k, r, w);
// L.d_and_r_root_weight(k, r, w);

latitude = asind(r);

i = j + ny_half;

Latitudes[i] = latitude;

Latitudes[Ny - 1 - i] = -latitude;
Latitudes[k] = -latitude;

}

Expand Down
2 changes: 1 addition & 1 deletion met/src/libcode/vx_render/renderinfo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ void RenderInfo::add_filter(const int k)
{


if ( Nfilters > max_filters ) {
if ( Nfilters >= max_filters ) {

mlog << Error << "\nRenderInfo::add_filter() -> "
<< "too many filters!\n\n";
Expand Down
72 changes: 38 additions & 34 deletions met/src/tools/tc_utils/rmw_analysis/rmw_analysis.cc
Original file line number Diff line number Diff line change
Expand Up @@ -243,48 +243,52 @@ void setup() {
// Initialize statistical data cube lists
for(int i_var = 0; i_var < data_names.size(); i_var++) {

// Size data cubes
DataCube* data_count_2d = new DataCube();
DataCube* data_count_3d = new DataCube();
DataCube* data_mean_2d = new DataCube();
DataCube* data_mean_3d = new DataCube();
DataCube* data_stdev_2d = new DataCube();
DataCube* data_stdev_3d = new DataCube();
DataCube* data_max_2d = new DataCube();
DataCube* data_max_3d = new DataCube();
DataCube* data_min_2d = new DataCube();
DataCube* data_min_3d = new DataCube();

data_count_2d->set_size(n_range, n_azimuth, 1);
data_count_3d->set_size(n_range, n_azimuth, n_level);
data_mean_2d->set_size(n_range, n_azimuth, 1);
data_mean_3d->set_size(n_range, n_azimuth, n_level);
data_stdev_2d->set_size(n_range, n_azimuth, 1);
data_stdev_3d->set_size(n_range, n_azimuth, n_level);
data_max_2d->set_size(n_range, n_azimuth, 1);
data_max_3d->set_size(n_range, n_azimuth, n_level);
data_min_2d->set_size(n_range, n_azimuth, 1);
data_min_3d->set_size(n_range, n_azimuth, n_level);

data_count_2d->set_constant(0);
data_count_3d->set_constant(0);
data_mean_2d->set_constant(0);
data_mean_3d->set_constant(0);
data_stdev_2d->set_constant(0);
data_stdev_3d->set_constant(0);
data_max_2d->set_constant(-1.0e6);
data_max_3d->set_constant(-1.0e6);
data_min_2d->set_constant(1.0e6);
data_min_3d->set_constant(1.0e6);

if (data_n_dims[i_var] == 2) {
// Size data cubes
DataCube* data_count_2d = new DataCube();
DataCube* data_mean_2d = new DataCube();
DataCube* data_stdev_2d = new DataCube();
DataCube* data_max_2d = new DataCube();
DataCube* data_min_2d = new DataCube();

data_count_2d->set_size(n_range, n_azimuth, 1);
data_mean_2d->set_size(n_range, n_azimuth, 1);
data_stdev_2d->set_size(n_range, n_azimuth, 1);
data_max_2d->set_size(n_range, n_azimuth, 1);
data_min_2d->set_size(n_range, n_azimuth, 1);

data_count_2d->set_constant(0);
data_mean_2d->set_constant(0);
data_stdev_2d->set_constant(0);
data_max_2d->set_constant(-1.0e6);
data_min_2d->set_constant(1.0e6);

data_counts.push_back(data_count_2d);
data_means.push_back(data_mean_2d);
data_stdevs.push_back(data_stdev_2d);
data_mins.push_back(data_min_2d);
data_maxs.push_back(data_max_2d);
}
if (data_n_dims[i_var] == 3) {
// Size data cubes
DataCube* data_count_3d = new DataCube();
DataCube* data_mean_3d = new DataCube();
DataCube* data_stdev_3d = new DataCube();
DataCube* data_max_3d = new DataCube();
DataCube* data_min_3d = new DataCube();

data_count_3d->set_size(n_range, n_azimuth, n_level);
data_mean_3d->set_size(n_range, n_azimuth, n_level);
data_stdev_3d->set_size(n_range, n_azimuth, n_level);
data_max_3d->set_size(n_range, n_azimuth, n_level);
data_min_3d->set_size(n_range, n_azimuth, n_level);

data_count_3d->set_constant(0);
data_mean_3d->set_constant(0);
data_stdev_3d->set_constant(0);
data_max_3d->set_constant(-1.0e6);
data_min_3d->set_constant(1.0e6);

data_counts.push_back(data_count_3d);
data_means.push_back(data_mean_3d);
data_stdevs.push_back(data_stdev_3d);
Expand Down