mirror of https://github.com/ecmwf/eccodes.git
grib_util_set_spec: lambert conformal
This commit is contained in:
parent
7d707e6f8d
commit
9e67f97ec5
|
@ -35,15 +35,14 @@ meta geography.LoVInDegrees
|
||||||
alias orientationOfTheGrid = LoV;
|
alias orientationOfTheGrid = LoV;
|
||||||
alias orientationOfTheGridInDegrees = LoVInDegrees;
|
alias orientationOfTheGridInDegrees = LoVInDegrees;
|
||||||
|
|
||||||
# Dx - X-direction grid length
|
# Dx - X-direction grid length (in units of metres)
|
||||||
unsigned[3] DxInMetres : dump;
|
unsigned[3] DxInMetres : dump;
|
||||||
alias xDirectionGridLength=DxInMetres;
|
alias xDirectionGridLength=DxInMetres;
|
||||||
alias geography.DxInMetres=DxInMetres ;
|
alias geography.DxInMetres=DxInMetres ;
|
||||||
alias Dx = DxInMetres;
|
alias Dx = DxInMetres;
|
||||||
alias Di = DxInMetres;
|
alias Di = DxInMetres;
|
||||||
|
|
||||||
|
# Dy - Y-direction grid length (in units of metres)
|
||||||
# Dy - Y-direction grid length
|
|
||||||
unsigned[3] DyInMetres : dump;
|
unsigned[3] DyInMetres : dump;
|
||||||
alias yDirectionGridLength=DyInMetres;
|
alias yDirectionGridLength=DyInMetres;
|
||||||
alias geography.DyInMetres=DyInMetres;
|
alias geography.DyInMetres=DyInMetres;
|
||||||
|
|
|
@ -40,13 +40,13 @@ meta geography.LaDInDegrees scale(LaD,one,grib2divider,truncateDegrees) : dump;
|
||||||
unsigned[4] LoV : edition_specific;
|
unsigned[4] LoV : edition_specific;
|
||||||
meta geography.LoVInDegrees scale(LoV,one,grib2divider,truncateDegrees) : dump;
|
meta geography.LoVInDegrees scale(LoV,one,grib2divider,truncateDegrees) : dump;
|
||||||
|
|
||||||
# Dx - X-direction grid length
|
# Dx - X-direction grid length (in units of millimetres)
|
||||||
unsigned[4] Dx : edition_specific ;
|
unsigned[4] Dx : edition_specific ;
|
||||||
alias xDirectionGridLength=Dx;
|
alias xDirectionGridLength=Dx;
|
||||||
alias Di = Dx;
|
alias Di = Dx;
|
||||||
meta geography.DxInMetres scale(Dx,one,thousand) : dump;
|
meta geography.DxInMetres scale(Dx,one,thousand) : dump;
|
||||||
|
|
||||||
# Dy - Y-direction grid length
|
# Dy - Y-direction grid length (in units of millimetres)
|
||||||
unsigned[4] Dy : edition_specific ;
|
unsigned[4] Dy : edition_specific ;
|
||||||
alias yDirectionGridLength=Dy ;
|
alias yDirectionGridLength=Dy ;
|
||||||
alias Dj = Dy;
|
alias Dj = Dy;
|
||||||
|
|
|
@ -1054,24 +1054,27 @@ grib_handle* grib_util_set_spec2(grib_handle* h,
|
||||||
size_t n = sizeof(levtype);
|
size_t n = sizeof(levtype);
|
||||||
Assert(grib_get_string(h,"levelType",levtype,&n) == 0);
|
Assert(grib_get_string(h,"levelType",levtype,&n) == 0);
|
||||||
switch (spec->grid_type) {
|
switch (spec->grid_type) {
|
||||||
case GRIB_UTIL_GRID_SPEC_REDUCED_GG:
|
case GRIB_UTIL_GRID_SPEC_REDUCED_GG:
|
||||||
case GRIB_UTIL_GRID_SPEC_REDUCED_ROTATED_GG:
|
case GRIB_UTIL_GRID_SPEC_REDUCED_ROTATED_GG:
|
||||||
/* Choose a sample with the right Gaussian number and edition */
|
/* Choose a sample with the right Gaussian number and edition */
|
||||||
sprintf(name, "%s_pl_%ld_grib%ld", grid_type,spec->N, editionNumber);
|
sprintf(name, "%s_pl_%ld_grib%ld", grid_type,spec->N, editionNumber);
|
||||||
if (spec->pl && spec->pl_size) {
|
if (spec->pl && spec->pl_size) {
|
||||||
/* GRIB-834: pl is given so can use any of the reduced_gg_pl samples */
|
/* GRIB-834: pl is given so can use any of the reduced_gg_pl samples */
|
||||||
|
sprintf(name, "%s_pl_grib%ld", grid_type, editionNumber);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case GRIB_UTIL_GRID_SPEC_LAMBERT_AZIMUTHAL_EQUAL_AREA:
|
||||||
|
if (editionNumber==1) {
|
||||||
|
fprintf(stderr,"GRIB_UTIL_SET_SPEC: grid type='%s' not available in GRIB edition 1.\n", grid_type);
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
sprintf(name, "GRIB%ld", editionNumber);
|
||||||
|
break;
|
||||||
|
case GRIB_UTIL_GRID_SPEC_LAMBERT_CONFORMAL:
|
||||||
|
sprintf(name, "GRIB%ld", editionNumber);
|
||||||
|
break;
|
||||||
|
default :
|
||||||
sprintf(name, "%s_pl_grib%ld", grid_type, editionNumber);
|
sprintf(name, "%s_pl_grib%ld", grid_type, editionNumber);
|
||||||
}
|
|
||||||
break;
|
|
||||||
case GRIB_UTIL_GRID_SPEC_LAMBERT_AZIMUTHAL_EQUAL_AREA:
|
|
||||||
if (editionNumber==1) {
|
|
||||||
fprintf(stderr,"GRIB_UTIL_SET_SPEC: grid type='%s' not available in GRIB edition 1.\n", grid_type);
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
sprintf(name, "GRIB%ld", editionNumber);
|
|
||||||
break;
|
|
||||||
default :
|
|
||||||
sprintf(name, "%s_pl_grib%ld", grid_type, editionNumber);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (spec->pl && spec->grid_name) {
|
if (spec->pl && spec->grid_name) {
|
||||||
|
@ -1211,8 +1214,22 @@ grib_handle* grib_util_set_spec2(grib_handle* h,
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case GRIB_UTIL_GRID_SPEC_LAMBERT_CONFORMAL:
|
case GRIB_UTIL_GRID_SPEC_LAMBERT_CONFORMAL:
|
||||||
*err = GRIB_NOT_IMPLEMENTED;
|
COPY_SPEC_LONG (bitmapPresent);
|
||||||
goto cleanup;
|
if (spec->missingValue) COPY_SPEC_DOUBLE(missingValue);
|
||||||
|
COPY_SPEC_DOUBLE(longitudeOfFirstGridPointInDegrees);
|
||||||
|
COPY_SPEC_DOUBLE(latitudeOfFirstGridPointInDegrees);
|
||||||
|
COPY_SPEC_LONG(Ni); /* same as Nx */
|
||||||
|
COPY_SPEC_LONG(Nj); /* same as Ny */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Note: DxInMetres and DyInMetres
|
||||||
|
* should be 'double' and not integer. WMO GRIB2 uses millimetres!
|
||||||
|
* TODO:
|
||||||
|
* Add other keys like Latin1, LoV etc
|
||||||
|
|
||||||
|
*err = GRIB_NOT_IMPLEMENTED;
|
||||||
|
goto cleanup;
|
||||||
|
*/
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GRIB_UTIL_GRID_SPEC_REDUCED_GG:
|
case GRIB_UTIL_GRID_SPEC_REDUCED_GG:
|
||||||
|
|
Loading…
Reference in New Issue