Skip to content

Commit

Permalink
Per #2979, the write_netcdf_proj(...) utility function adds the lat a…
Browse files Browse the repository at this point in the history
…nd lon dimensions. Update mtd to NOT define those dimensions prior to calling write_netcdf_proj(...).
  • Loading branch information
JohnHalleyGotway committed Sep 25, 2024
1 parent 1e14cb1 commit d315ea8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
10 changes: 4 additions & 6 deletions src/tools/other/mode_time_domain/mtd_file_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -481,18 +481,16 @@ void MtdFileBase::write(NcFile & f) const
char junk[256];
ConcatString s;

// Nx, Ny, Nt
// Add the time dimension

add_dim(&f, nx_dim_name, Nx);
add_dim(&f, ny_dim_name, Ny);
add_dim(&f, nt_dim_name, Nt);

// Grid

NcDim lat_dim = get_nc_dim(&f, ny_dim_name);
NcDim lon_dim = get_nc_dim(&f, nx_dim_name);
NcDim ny_dim;
NcDim nx_dim;

write_netcdf_proj(&f, *G, lat_dim, lon_dim);
write_netcdf_proj(&f, *G, ny_dim, nx_dim);

// timestamp info

Expand Down
8 changes: 2 additions & 6 deletions src/tools/other/mode_time_domain/mtd_nc_output.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,9 @@ const bool have_pairs = (fcst_obj.n_objects() != 0)
&& ( obs_obj.n_objects() != 0);

//
// dimensions
// add time dimension
//

nx_dim = add_dim(&out, nx_dim_name, fcst_raw.nx());
ny_dim = add_dim(&out, ny_dim_name, fcst_raw.ny());
nt_dim = add_dim(&out, nt_dim_name, fcst_raw.nt());

//
Expand Down Expand Up @@ -150,11 +148,9 @@ if ( IS_INVALID_NC(out) ) {
}

//
// dimensions
// add time dimension
//

nx_dim = add_dim(&out, nx_dim_name, raw.nx());
ny_dim = add_dim(&out, ny_dim_name, raw.ny());
nt_dim = add_dim(&out, nt_dim_name, raw.nt());

//
Expand Down

0 comments on commit d315ea8

Please sign in to comment.