From 2adc503970cdf749d9e0b12d3f08ef773724458d Mon Sep 17 00:00:00 2001 From: Howard Soh Date: Thu, 2 Feb 2023 12:17:45 -0700 Subject: [PATCH 1/2] #2218 Initialize polar stereographics parametres for ellipsoial earth --- src/libcode/vx_data2d_grib/grib_utils.cc | 6 ++++++ src/libcode/vx_data2d_grib2/data2d_grib2.cc | 5 +++++ src/libcode/vx_data2d_nc_met/get_met_grid.cc | 12 ++++++++++++ src/libcode/vx_data2d_nc_pinterp/get_pinterp_grid.cc | 6 ++++++ 4 files changed, 29 insertions(+) diff --git a/src/libcode/vx_data2d_grib/grib_utils.cc b/src/libcode/vx_data2d_grib/grib_utils.cc index c1ef70f775..71b3ee8dc2 100644 --- a/src/libcode/vx_data2d_grib/grib_utils.cc +++ b/src/libcode/vx_data2d_grib/grib_utils.cc @@ -572,6 +572,12 @@ data.nx = char2_to_int(gds.nx); // Number of points in the y-direction data.ny = char2_to_int(gds.ny); +data.eccentricity = 0.; +data.false_east = 0.; +data.false_north = 0.; +data.scale_factor = 1.0; +data.dy_km = data.d_km; + data.dump(); // diff --git a/src/libcode/vx_data2d_grib2/data2d_grib2.cc b/src/libcode/vx_data2d_grib2/data2d_grib2.cc index 42582b781e..45d931b9c2 100644 --- a/src/libcode/vx_data2d_grib2/data2d_grib2.cc +++ b/src/libcode/vx_data2d_grib2/data2d_grib2.cc @@ -1172,6 +1172,11 @@ void MetGrib2DataFile::read_grib2_grid( gribfield *gfld) { data.r_km = r_km; data.nx = gfld->igdtmpl[7]; data.ny = gfld->igdtmpl[8]; + data.eccentricity = 0.; + data.false_east = 0.; + data.false_north = 0.; + data.scale_factor = 1.0; + data.dy_km = data.d_km; // check for dx != dy if( !is_eq((double)gfld->igdtmpl[14] / 1000000.0, diff --git a/src/libcode/vx_data2d_nc_met/get_met_grid.cc b/src/libcode/vx_data2d_nc_met/get_met_grid.cc index 6016ab4dd2..67ddad0fa8 100644 --- a/src/libcode/vx_data2d_nc_met/get_met_grid.cc +++ b/src/libcode/vx_data2d_nc_met/get_met_grid.cc @@ -447,6 +447,12 @@ get_global_att(ncfile, string("nx"), data.nx); // Number of points in the y-direction get_global_att(ncfile, string("ny"), data.ny); +data.eccentricity = 0.; +data.false_east = 0.; +data.false_north = 0.; +data.scale_factor = 1.0; +data.dy_km = data.d_km; + data.dump(); // @@ -643,6 +649,12 @@ get_global_att(ncfile, string("nx"), data.nx); // Number of points in the y-direction get_global_att(ncfile, string("ny"), data.ny); +data.eccentricity = 0.; +data.false_east = 0.; +data.false_north = 0.; +data.scale_factor = 1.0; +data.dy_km = data.d_km; + data.dump(); // diff --git a/src/libcode/vx_data2d_nc_pinterp/get_pinterp_grid.cc b/src/libcode/vx_data2d_nc_pinterp/get_pinterp_grid.cc index b5a78b109a..d93f0d3701 100644 --- a/src/libcode/vx_data2d_nc_pinterp/get_pinterp_grid.cc +++ b/src/libcode/vx_data2d_nc_pinterp/get_pinterp_grid.cc @@ -185,6 +185,12 @@ data.d_km *= 0.001; data.r_km = default_grib_radius_km; +data.eccentricity = 0.; +data.false_east = 0.; +data.false_north = 0.; +data.scale_factor = 1.0; +data.dy_km = data.d_km; + // // done // From 568223f19f6750459a9b58e25cf40afaa21e0462 Mon Sep 17 00:00:00 2001 From: Howard Soh Date: Thu, 2 Feb 2023 13:14:07 -0700 Subject: [PATCH 2/2] #2218 Initialize polar stereographics parameters for ellipsoidal earth --- src/libcode/vx_data2d_python/grid_from_python_dict.cc | 5 +++++ src/tools/other/mode_time_domain/nc_grid.cc | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/libcode/vx_data2d_python/grid_from_python_dict.cc b/src/libcode/vx_data2d_python/grid_from_python_dict.cc index 8c9aa7dae1..93de48387d 100644 --- a/src/libcode/vx_data2d_python/grid_from_python_dict.cc +++ b/src/libcode/vx_data2d_python/grid_from_python_dict.cc @@ -208,6 +208,11 @@ data.r_km = dict.lookup_double("r_km"); data.nx = dict.lookup_int("nx"); data.ny = dict.lookup_int("ny"); +data.eccentricity = 0.; +data.false_east = 0.; +data.false_north = 0.; +data.scale_factor = 1.0; +data.dy_km = data.d_km; //////////////// diff --git a/src/tools/other/mode_time_domain/nc_grid.cc b/src/tools/other/mode_time_domain/nc_grid.cc index e31246ab4d..022a2e8ebe 100644 --- a/src/tools/other/mode_time_domain/nc_grid.cc +++ b/src/tools/other/mode_time_domain/nc_grid.cc @@ -191,6 +191,11 @@ data.r_km = string_att_as_double(f, "r_km"); data.nx = string_att_as_int(f, "nx"); data.ny = string_att_as_int(f, "ny"); +data.eccentricity = 0.; +data.false_east = 0.; +data.false_north = 0.; +data.scale_factor = 1.0; +data.dy_km = data.d_km; // // done