From d315ea860a109df725e2cc3e14fcfc0ffc9c5c25 Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Wed, 25 Sep 2024 19:17:09 +0000 Subject: [PATCH] Per #2979, the write_netcdf_proj(...) utility function adds the lat and lon dimensions. Update mtd to NOT define those dimensions prior to calling write_netcdf_proj(...). --- src/tools/other/mode_time_domain/mtd_file_base.cc | 10 ++++------ src/tools/other/mode_time_domain/mtd_nc_output.cc | 8 ++------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/tools/other/mode_time_domain/mtd_file_base.cc b/src/tools/other/mode_time_domain/mtd_file_base.cc index 44dee81604..e79decba08 100644 --- a/src/tools/other/mode_time_domain/mtd_file_base.cc +++ b/src/tools/other/mode_time_domain/mtd_file_base.cc @@ -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 diff --git a/src/tools/other/mode_time_domain/mtd_nc_output.cc b/src/tools/other/mode_time_domain/mtd_nc_output.cc index b1fa9eb302..1b3cda7655 100644 --- a/src/tools/other/mode_time_domain/mtd_nc_output.cc +++ b/src/tools/other/mode_time_domain/mtd_nc_output.cc @@ -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()); // @@ -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()); //