Skip to content

Commit

Permalink
Merge pull request #2434 from dtcenter/feature_2218_polar_stereographic
Browse files Browse the repository at this point in the history
#2218 Initialize polar stereographics parameters for ellipsoidal earth
  • Loading branch information
hsoh-u authored Feb 2, 2023
2 parents 3fe335f + d9e7218 commit d124e2e
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/libcode/vx_data2d_grib/grib_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();

//
Expand Down
5 changes: 5 additions & 0 deletions src/libcode/vx_data2d_grib2/data2d_grib2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 12 additions & 0 deletions src/libcode/vx_data2d_nc_met/get_met_grid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();

//
Expand Down Expand Up @@ -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();

//
Expand Down
6 changes: 6 additions & 0 deletions src/libcode/vx_data2d_nc_pinterp/get_pinterp_grid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
//
Expand Down
5 changes: 5 additions & 0 deletions src/libcode/vx_data2d_python/grid_from_python_dict.cc