Merge branch 'develop' into feature/WMO_GRIB_Tables_v26

This commit is contained in:
Shahram Najm 2020-11-25 13:17:06 +00:00
commit b64043cb31
16 changed files with 2488 additions and 773 deletions

View File

@ -20,6 +20,75 @@ my $dbh = DBI->connect("dbi:mysql(RaiseError=>1):database=$db;host=$host",$user
# I have written to it already or not
my $tarfilesflag = 0;
sub create_cfName {
my $p; my %seen;
my ($key) = "cfName";
my $field = "cf.name";
my $query= <<"EOF";
select $field,force128,edition,
centre.abbreviation,param_id,attribute.name,attribute_value,param.name,param.shortName
from param,grib,attribute,centre,units,cf where param.hide_def=0 and param.id=grib.param_id
and attribute.id=grib.attribute_id and centre.id=grib.centre and units.id=param.units_id and param.id=cf.grib1_ecmwf
order by edition,centre,param.o,param.id,grib.param_version,attribute.o;
EOF
my $qh=$dbh->prepare($query);
$qh->execute();
# file containing the list of grib api parameters files we want to tar and
# distribute to users for them to download and update their list of parameter
# to the latest
open(TAR,$tarfilesflag ? ">>" : ">","tarfiles.txt") or die "Count not open file tarfiles.txt: $!";
$tarfilesflag=1;
while (my ($keyval,$force128,$edition,$centre,$paramId,$attribute,$value,$name,$shortName)=$qh->fetchrow_array )
{
if ($centre eq "all" ) { $conceptDir=""; }
else { $conceptDir="/localConcepts/$centre"; }
if ($filebase ne "$basedir/grib$edition$conceptDir") {
if ($filebase) {
print $out "}\n";
close $out;
}
$filebase="$basedir/grib$edition$conceptDir";
mkpath($filebase);
print TAR "grib$edition$conceptDir/$key.def\n";
system("cp -f $filebase/$key.def $filebase/$key.def.orig");
open($out,"> $filebase/$key.def")
or die "unable to open $filebase/$key.def";
print $out "# Automatically generated by $0, do not edit\n";
$p=();
}
if ($p ne $paramId || exists($seen{$attribute}) ) {
if ($p) { print $out "\t}\n"; }
print $out "#$name\n" ;
print $out "\'".$keyval."\' = {\n" ;
$p=$paramId;
%seen=();
}
$seen{$attribute}=1;
print "($key=$keyval) $edition,$centre,$shortName,$paramId,$name,$attribute,$value\n";
# we need to allow strings in the attribute_value field
# for the moment we apply a patch here
if ($attribute =~ /stepType/ ) {
$value="\"accum\"";
}
if ($value eq '') {
$value="missing()";
}
print $out "\t $attribute = $value ;\n" ;
}
if ($filebase) {
print $out "}\n";
close $out;
}
close(TAR);
}
sub create_def {
my $p; my %seen;
my ($key) =@_;
@ -185,7 +254,7 @@ create_def("paramId");
create_def("shortName");
create_def("name");
create_def("units");
create_cfName("cfName");
#create_paramId_def();

View File

@ -1,310 +1,349 @@
# Automatically generated by ./create_param.pl, do not edit
# Automatically generated by ./create_def.pl, do not edit
#Geopotential
'geopotential' = {
indicatorOfParameter = 6 ;
table2Version = 3 ;
indicatorOfParameter = 6 ;
}
#Temperature
'air_temperature' = {
table2Version = 3 ;
indicatorOfParameter = 11 ;
table2Version = 3 ;
}
#u-component of wind
#U component of wind
'eastward_wind' = {
table2Version = 3 ;
indicatorOfParameter = 33 ;
table2Version = 3 ;
}
#v-component of wind
#V component of wind
'northward_wind' = {
indicatorOfParameter = 34 ;
table2Version = 3 ;
indicatorOfParameter = 34 ;
}
#Specific humidity
'specific_humidity' = {
indicatorOfParameter = 51 ;
table2Version = 3 ;
indicatorOfParameter = 51 ;
}
#Surface pressure
'surface_air_pressure' = {
indicatorOfParameter = 1 ;
table2Version = 3 ;
indicatorOfParameter = 1 ;
indicatorOfTypeOfLevel = 1 ;
}
#Vertical velocity (geometric)
#Vertical velocity
'lagrangian_tendency_of_air_pressure' = {
indicatorOfParameter = 40 ;
table2Version = 3 ;
indicatorOfParameter = 39 ;
}
#Relative vorticity
#Vorticity (relative)
'atmosphere_relative_vorticity' = {
table2Version = 3 ;
indicatorOfParameter = 43 ;
table2Version = 3 ;
}
#Boundary layer dissipation
'kinetic_energy_dissipation_in_atmosphere_boundary_layer' = {
indicatorOfParameter = 123 ;
table2Version = 3 ;
}
#Surface sensible heat flux
'surface_upward_sensible_heat_flux' = {
indicatorOfParameter = 122 ;
table2Version = 3 ;
}
#Surface latent heat flux
'surface_upward_latent_heat_flux' = {
indicatorOfParameter = 121 ;
table2Version = 3 ;
}
#Mean sea level pressure
'air_pressure_at_mean_sea_level' = {
table2Version = 3 ;
indicatorOfParameter = 2 ;
table2Version = 3 ;
indicatorOfTypeOfLevel = 1 ;
level = 0 ;
}
#Relative divergence
#Divergence
'divergence_of_wind' = {
table2Version = 3 ;
indicatorOfParameter = 44 ;
table2Version = 3 ;
}
#Geopotential height
#Geopotential Height
'geopotential_height' = {
indicatorOfParameter = 7 ;
table2Version = 3 ;
indicatorOfParameter = 7 ;
}
#Relative humidity
'relative_humidity' = {
indicatorOfParameter = 52 ;
table2Version = 3 ;
indicatorOfParameter = 52 ;
}
#Land-sea mask
'land_binary_mask' = {
indicatorOfParameter = 81 ;
table2Version = 3 ;
indicatorOfParameter = 81 ;
}
#Surface roughness
'surface_roughness_length' = {
table2Version = 3 ;
indicatorOfParameter = 83 ;
table2Version = 3 ;
}
#Albedo
'surface_albedo' = {
indicatorOfParameter = 84 ;
table2Version = 3 ;
}
#Evaporation
'lwe_thickness_of_water_evaporation_amount' = {
indicatorOfParameter = 57 ;
table2Version = 3 ;
indicatorOfParameter = 57 ;
}
#Total column ozone
'atmosphere_mass_content_of_ozone' = {
table2Version = 3 ;
indicatorOfParameter = 10 ;
}
#Snow depth
'lwe_thickness_of_surface_snow_amount' = {
table2Version = 3 ;
indicatorOfParameter = 66 ;
}
#Convective cloud cover
'convective_cloud_area_fraction' = {
indicatorOfParameter = 72 ;
table2Version = 3 ;
indicatorOfParameter = 72 ;
}
#Latent heat flux
'surface_upward_latent_heat_flux' = {
table2Version = 3 ;
indicatorOfParameter = 121 ;
}
#Sensible heat flux
'surface_upward_sensible_heat_flux' = {
table2Version = 3 ;
indicatorOfParameter = 122 ;
}
#Boundary layer dissipation
'kinetic_energy_dissipation_in_atmosphere_boundary_layer' = {
table2Version = 3 ;
indicatorOfParameter = 123 ;
}
#Albedo
'surface_albedo' = {
table2Version = 3 ;
indicatorOfParameter = 84 ;
}
#Convective precipitation (water)
'lwe_thickness_of_convective_precipitation_amount' = {
table2Version = 3 ;
indicatorOfParameter = 63 ;
}
#Geopotential
'geopotential' = {
indicatorOfParameter = 6 ;
table2Version = 2 ;
indicatorOfParameter = 6 ;
}
#Temperature
'air_temperature' = {
table2Version = 2 ;
indicatorOfParameter = 11 ;
table2Version = 2 ;
}
#u-component of wind
#U component of wind
'eastward_wind' = {
table2Version = 2 ;
indicatorOfParameter = 33 ;
table2Version = 2 ;
}
#v-component of wind
#V component of wind
'northward_wind' = {
indicatorOfParameter = 34 ;
table2Version = 2 ;
indicatorOfParameter = 34 ;
}
#Specific humidity
'specific_humidity' = {
indicatorOfParameter = 51 ;
table2Version = 2 ;
indicatorOfParameter = 51 ;
}
#Surface pressure
'surface_air_pressure' = {
indicatorOfParameter = 1 ;
table2Version = 2 ;
indicatorOfParameter = 1 ;
indicatorOfTypeOfLevel = 1 ;
}
#Vertical velocity (geometric)
#Vertical velocity
'lagrangian_tendency_of_air_pressure' = {
indicatorOfParameter = 40 ;
table2Version = 2 ;
indicatorOfParameter = 39 ;
}
#Relative vorticity
#Vorticity (relative)
'atmosphere_relative_vorticity' = {
table2Version = 2 ;
indicatorOfParameter = 43 ;
table2Version = 2 ;
}
#Boundary layer dissipation
'kinetic_energy_dissipation_in_atmosphere_boundary_layer' = {
indicatorOfParameter = 123 ;
table2Version = 2 ;
}
#Surface sensible heat flux
'surface_upward_sensible_heat_flux' = {
indicatorOfParameter = 122 ;
table2Version = 2 ;
}
#Surface latent heat flux
'surface_upward_latent_heat_flux' = {
indicatorOfParameter = 121 ;
table2Version = 2 ;
}
#Mean sea level pressure
'air_pressure_at_mean_sea_level' = {
table2Version = 2 ;
indicatorOfParameter = 2 ;
table2Version = 2 ;
indicatorOfTypeOfLevel = 1 ;
level = 0 ;
}
#Relative divergence
#Divergence
'divergence_of_wind' = {
table2Version = 2 ;
indicatorOfParameter = 44 ;
table2Version = 2 ;
}
#Geopotential height
#Geopotential Height
'geopotential_height' = {
indicatorOfParameter = 7 ;
table2Version = 2 ;
indicatorOfParameter = 7 ;
}
#Relative humidity
'relative_humidity' = {
indicatorOfParameter = 52 ;
table2Version = 2 ;
indicatorOfParameter = 52 ;
}
#Land-sea mask
'land_binary_mask' = {
indicatorOfParameter = 81 ;
table2Version = 2 ;
indicatorOfParameter = 81 ;
}
#Surface roughness
'surface_roughness_length' = {
table2Version = 2 ;
indicatorOfParameter = 83 ;
table2Version = 2 ;
}
#Albedo
'surface_albedo' = {
indicatorOfParameter = 84 ;
table2Version = 2 ;
}
#Evaporation
'lwe_thickness_of_water_evaporation_amount' = {
indicatorOfParameter = 57 ;
table2Version = 2 ;
indicatorOfParameter = 57 ;
}
#Total column ozone
'atmosphere_mass_content_of_ozone' = {
table2Version = 2 ;
indicatorOfParameter = 10 ;
}
#Snow depth
'lwe_thickness_of_surface_snow_amount' = {
table2Version = 2 ;
indicatorOfParameter = 66 ;
}
#Convective cloud cover
'convective_cloud_area_fraction' = {
indicatorOfParameter = 72 ;
table2Version = 2 ;
indicatorOfParameter = 72 ;
}
#Latent heat flux
'surface_upward_latent_heat_flux' = {
table2Version = 2 ;
indicatorOfParameter = 121 ;
}
#Sensible heat flux
'surface_upward_sensible_heat_flux' = {
table2Version = 2 ;
indicatorOfParameter = 122 ;
}
#Boundary layer dissipation
'kinetic_energy_dissipation_in_atmosphere_boundary_layer' = {
table2Version = 2 ;
indicatorOfParameter = 123 ;
}
#Albedo
'surface_albedo' = {
table2Version = 2 ;
indicatorOfParameter = 84 ;
}
#Convective precipitation (water)
'lwe_thickness_of_convective_precipitation_amount' = {
table2Version = 2 ;
indicatorOfParameter = 63 ;
}
#Geopotential
'geopotential' = {
indicatorOfParameter = 6 ;
table2Version = 1 ;
indicatorOfParameter = 6 ;
}
#Temperature
'air_temperature' = {
table2Version = 1 ;
indicatorOfParameter = 11 ;
table2Version = 1 ;
}
#u-component of wind
#U component of wind
'eastward_wind' = {
table2Version = 1 ;
indicatorOfParameter = 33 ;
table2Version = 1 ;
}
#v-component of wind
#V component of wind
'northward_wind' = {
indicatorOfParameter = 34 ;
table2Version = 1 ;
indicatorOfParameter = 34 ;
}
#Specific humidity
'specific_humidity' = {
indicatorOfParameter = 51 ;
table2Version = 1 ;
indicatorOfParameter = 51 ;
}
#Surface pressure
'surface_air_pressure' = {
indicatorOfParameter = 1 ;
table2Version = 1 ;
indicatorOfParameter = 1 ;
indicatorOfTypeOfLevel = 1 ;
}
#Vertical velocity (geometric)
#Vertical velocity
'lagrangian_tendency_of_air_pressure' = {
indicatorOfParameter = 40 ;
table2Version = 1 ;
indicatorOfParameter = 39 ;
}
#Relative vorticity
#Vorticity (relative)
'atmosphere_relative_vorticity' = {
table2Version = 1 ;
indicatorOfParameter = 43 ;
table2Version = 1 ;
}
#Boundary layer dissipation
'kinetic_energy_dissipation_in_atmosphere_boundary_layer' = {
indicatorOfParameter = 123 ;
table2Version = 1 ;
}
#Surface sensible heat flux
'surface_upward_sensible_heat_flux' = {
indicatorOfParameter = 122 ;
table2Version = 1 ;
}
#Surface latent heat flux
'surface_upward_latent_heat_flux' = {
indicatorOfParameter = 121 ;
table2Version = 1 ;
}
#Mean sea level pressure
'air_pressure_at_mean_sea_level' = {
table2Version = 1 ;
indicatorOfParameter = 2 ;
table2Version = 1 ;
indicatorOfTypeOfLevel = 1 ;
level = 0 ;
}
#Relative divergence
#Divergence
'divergence_of_wind' = {
table2Version = 1 ;
indicatorOfParameter = 44 ;
table2Version = 1 ;
}
#Geopotential height
#Geopotential Height
'geopotential_height' = {
indicatorOfParameter = 7 ;
table2Version = 1 ;
indicatorOfParameter = 7 ;
}
#Relative humidity
'relative_humidity' = {
indicatorOfParameter = 52 ;
table2Version = 1 ;
indicatorOfParameter = 52 ;
}
#Land-sea mask
'land_binary_mask' = {
indicatorOfParameter = 81 ;
table2Version = 1 ;
indicatorOfParameter = 81 ;
}
#Surface roughness
'surface_roughness_length' = {
table2Version = 1 ;
indicatorOfParameter = 83 ;
table2Version = 1 ;
}
#Albedo
'surface_albedo' = {
indicatorOfParameter = 84 ;
table2Version = 1 ;
}
#Evaporation
'lwe_thickness_of_water_evaporation_amount' = {
indicatorOfParameter = 57 ;
table2Version = 1 ;
indicatorOfParameter = 57 ;
}
#Total column ozone
'atmosphere_mass_content_of_ozone' = {
table2Version = 1 ;
indicatorOfParameter = 10 ;
}
#Snow depth
'lwe_thickness_of_surface_snow_amount' = {
table2Version = 1 ;
indicatorOfParameter = 66 ;
}
#Convective cloud cover
'convective_cloud_area_fraction' = {
indicatorOfParameter = 72 ;
table2Version = 1 ;
indicatorOfParameter = 72 ;
}
#Latent heat flux
'surface_upward_latent_heat_flux' = {
table2Version = 1 ;
indicatorOfParameter = 121 ;
}
#Sensible heat flux
'surface_upward_sensible_heat_flux' = {
table2Version = 1 ;
indicatorOfParameter = 122 ;
}
#Boundary layer dissipation
'kinetic_energy_dissipation_in_atmosphere_boundary_layer' = {
table2Version = 1 ;
indicatorOfParameter = 123 ;
}
#Albedo
'surface_albedo' = {
table2Version = 1 ;
indicatorOfParameter = 84 ;
}
#Convective precipitation (water)
'lwe_thickness_of_convective_precipitation_amount' = {
table2Version = 1 ;
indicatorOfParameter = 63 ;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,191 +1,66 @@
# Automatically generated by ./create_param.pl, do not edit
#Geopotential
'geopotential' = {
discipline = 0 ;
parameterNumber = 4 ;
parameterCategory = 3 ;
}
#Temperature
'air_temperature' = {
discipline = 0 ;
parameterNumber = 0 ;
parameterCategory = 0 ;
}
#u-component of wind
'eastward_wind' = {
discipline = 0 ;
parameterNumber = 2 ;
parameterCategory = 2 ;
}
#v-component of wind
'northward_wind' = {
discipline = 0 ;
parameterNumber = 3 ;
parameterCategory = 2 ;
}
#Specific humidity
'specific_humidity' = {
discipline = 0 ;
parameterNumber = 0 ;
parameterCategory = 1 ;
}
#Surface pressure
'surface_air_pressure' = {
discipline = 0 ;
parameterNumber = 0 ;
typeOfFirstFixedSurface = 1 ;
parameterCategory = 3 ;
}
#Vertical velocity (geometric)
'lagrangian_tendency_of_air_pressure' = {
discipline = 0 ;
parameterNumber = 8 ;
parameterCategory = 2 ;
}
#Relative vorticity
'atmosphere_relative_vorticity' = {
discipline = 0 ;
parameterNumber = 12 ;
parameterCategory = 2 ;
}
#Boundary layer dissipation
'kinetic_energy_dissipation_in_atmosphere_boundary_layer' = {
discipline = 0 ;
parameterNumber = 20 ;
parameterCategory = 2 ;
}
#Surface sensible heat flux
'surface_upward_sensible_heat_flux' = {
discipline = 0 ;
parameterNumber = 11 ;
typeOfFirstFixedSurface = 1 ;
parameterCategory = 0 ;
typeOfStatisticalProcessing = 1 ;
}
#Surface latent heat flux
'surface_upward_latent_heat_flux' = {
discipline = 0 ;
parameterNumber = 10 ;
typeOfFirstFixedSurface = 1 ;
parameterCategory = 0 ;
typeOfStatisticalProcessing = 1 ;
}
#Mean sea level pressure
'air_pressure_at_mean_sea_level' = {
discipline = 0 ;
parameterNumber = 0 ;
typeOfFirstFixedSurface = 101 ;
parameterCategory = 3 ;
}
#Relative divergence
'divergence_of_wind' = {
discipline = 0 ;
parameterNumber = 13 ;
parameterCategory = 2 ;
}
#Geopotential height
'geopotential_height' = {
discipline = 0 ;
parameterNumber = 5 ;
parameterCategory = 3 ;
}
#Relative humidity
'relative_humidity' = {
discipline = 0 ;
parameterNumber = 1 ;
parameterCategory = 1 ;
}
#Land-sea mask
'land_binary_mask' = {
discipline = 2 ;
parameterNumber = 0 ;
typeOfFirstFixedSurface = 1 ;
parameterCategory = 0 ;
}
#Surface roughness
'surface_roughness_length' = {
discipline = 2 ;
parameterNumber = 1 ;
parameterCategory = 0 ;
}
#Surface solar radiation
'surface_net_upward_longwave_flux' = {
discipline = 0 ;
parameterNumber = 9 ;
typeOfFirstFixedSurface = 1 ;
parameterCategory = 4 ;
typeOfStatisticalProcessing = 1 ;
}
#Surface net thermal radiation
'surface_net_upward_longwave_flux' = {
discipline = 0 ;
parameterNumber = 5 ;
typeOfFirstFixedSurface = 1 ;
parameterCategory = 5 ;
typeOfStatisticalProcessing = 1 ;
}
#Top net thermal radiation
'toa_outgoing_longwave_flux' = {
discipline = 0 ;
parameterNumber = 5 ;
typeOfFirstFixedSurface = 8 ;
parameterCategory = 5 ;
typeOfStatisticalProcessing = 1 ;
}
#Surface solar radiation downwards
'surface_downwelling_shortwave_flux_in_air' = {
discipline = 0 ;
parameterCategory = 4 ;
parameterNumber = 7 ;
typeOfStatisticalProcessing = 1 ;
typeOfFirstFixedSurface = 1 ;
}
#Surface net solar radiation
'surface_net_downward_shortwave_flux' = {
discipline = 0 ;
parameterCategory = 4 ;
parameterNumber = 9 ;
typeOfStatisticalProcessing = 1 ;
typeOfFirstFixedSurface = 1 ;
}
#Eastward turbulent surface stress
'surface_downward_eastward_stress' = {
discipline = 0 ;
parameterCategory = 2 ;
parameterNumber = 38 ;
}
#Northward turbulent surface stress
'surface_downward_northward_stress' = {
discipline = 0 ;
parameterCategory = 2 ;
parameterNumber = 37 ;
}
# Automatically generated by ./create_def.pl, do not edit
#Sea ice area fraction
'sea_ice_area_fraction' = {
discipline = 10 ;
parameterCategory = 2 ;
parameterNumber = 0 ;
}
#Depth of 20C isotherm
'depth_of_isosurface_of_sea_water_potential_temperature' = {
discipline = 10 ;
}
#Surface solar radiation downwards
'surface_downwelling_shortwave_flux_in_air' = {
discipline = 0 ;
parameterCategory = 4 ;
parameterNumber = 14 ;
typeOfFirstFixedSurface = 20 ;
typeOfSecondFixedSurface = 255 ;
scaleFactorOfFirstFixedSurface = 2 ;
scaledValueOfFirstFixedSurface = 29315 ;
}
#Ocean mixed layer thickness defined by sigma theta 0.01 kg/m3
'ocean_mixed_layer_thickness_defined_by_sigma_theta' = {
discipline = 10 ;
parameterNumber = 7 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Top net solar radiation
'toa_net_upward_shortwave_flux' = {
discipline = 0 ;
parameterCategory = 4 ;
parameterNumber = 14 ;
typeOfSecondFixedSurface = 255 ;
scaleFactorOfFirstFixedSurface = 2 ;
typeOfFirstFixedSurface = 169 ;
scaledValueOfFirstFixedSurface = 1 ;
}
parameterNumber = 1 ;
typeOfFirstFixedSurface = 8 ;
typeOfStatisticalProcessing = 1 ;
}
#Eastward turbulent surface stress
'surface_downward_eastward_stress' = {
discipline = 0 ;
parameterCategory = 2 ;
parameterNumber = 38 ;
}
#Northward turbulent surface stress
'surface_downward_northward_stress' = {
discipline = 0 ;
parameterCategory = 2 ;
parameterNumber = 37 ;
}
#Ozone mass mixing ratio
'mass_fraction_of_ozone_in_air' = {
discipline = 0 ;
parameterCategory = 14 ;
parameterNumber = 1 ;
}
#Surface net solar radiation, clear sky
'surface_net_downward_shortwave_flux_assuming_clear_sky' = {
discipline = 0 ;
parameterCategory = 4 ;
parameterNumber = 11 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Surface net thermal radiation, clear sky
'surface_net_downward_longwave_flux_assuming_clear_sky' = {
discipline = 0 ;
parameterCategory = 5 ;
parameterNumber = 6 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Snow depth
'lwe_thickness_of_surface_snow_amount' = {
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 11 ;
}
#Sea surface practical salinity
'sea_surface_salinity' = {
discipline = 10 ;
@ -195,47 +70,31 @@
typeOfSecondFixedSurface = 255 ;
scaledValueOfFirstFixedSurface = 0 ;
scaleFactorOfFirstFixedSurface = 0 ;
}
#Surface net solar radiation, clear sky
'surface_net_downward_shortwave_flux_assuming_clear_sky' = {
discipline = 0 ;
}
#Ocean mixed layer thickness defined by sigma theta 0.01 kg/m3
'ocean_mixed_layer_thickness_defined_by_sigma_theta' = {
discipline = 10 ;
parameterCategory = 4 ;
parameterNumber = 11 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Surface net thermal radiation, clear sky
'surface_net_downward_longwave_flux_assuming_clear_sky' = {
discipline = 0 ;
parameterCategory = 5 ;
parameterNumber = 6 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
parameterNumber = 14 ;
typeOfFirstFixedSurface = 169 ;
typeOfSecondFixedSurface = 255 ;
scaledValueOfFirstFixedSurface = 1 ;
scaleFactorOfFirstFixedSurface = 2 ;
}
#Eastward sea water velocity
'eastward_sea_water_velocity' = {
discipline = 10 ;
parameterCategory = 1 ;
parameterNumber = 2 ;
typeOfFirstFixedSurface = 160 ;
}
}
#Northward sea water velocity
'northward_sea_water_velocity' = {
discipline = 10 ;
parameterCategory = 1 ;
parameterNumber = 3 ;
typeOfFirstFixedSurface = 160 ;
}
#Sea-ice thickness
'sea_ice_thickness' = {
discipline = 10 ;
parameterCategory = 2 ;
parameterNumber = 1 ;
typeOfFirstFixedSurface = 160 ;
typeOfSecondFixedSurface = 255 ;
scaledValueOfFirstFixedSurface = 0 ;
scaleFactorOfFirstFixedSurface = 0 ;
}
}
#Sea surface height
'sea_surface_height_above_geoid' = {
discipline = 10 ;
@ -245,12 +104,169 @@
typeOfSecondFixedSurface = 255 ;
scaledValueOfFirstFixedSurface = 0 ;
scaleFactorOfFirstFixedSurface = 0 ;
}
#Top net solar radiation
'toa_net_upward_shortwave_flux' = {
}
#Depth of 20C isotherm
'depth_of_isosurface_of_sea_water_potential_temperature' = {
discipline = 10 ;
parameterCategory = 4 ;
parameterNumber = 14 ;
typeOfFirstFixedSurface = 20 ;
typeOfSecondFixedSurface = 255 ;
scaledValueOfFirstFixedSurface = 29315 ;
scaleFactorOfFirstFixedSurface = 2 ;
}
#Sea-ice thickness
'sea_ice_thickness' = {
discipline = 10 ;
parameterCategory = 2 ;
parameterNumber = 1 ;
typeOfFirstFixedSurface = 160 ;
typeOfSecondFixedSurface = 255 ;
scaledValueOfFirstFixedSurface = 0 ;
scaleFactorOfFirstFixedSurface = 0 ;
}
#Geopotential
'geopotential' = {
discipline = 0 ;
parameterCategory = 3 ;
parameterNumber = 4 ;
}
#Temperature
'air_temperature' = {
discipline = 0 ;
parameterCategory = 0 ;
parameterNumber = 0 ;
}
#U component of wind
'eastward_wind' = {
discipline = 0 ;
parameterCategory = 2 ;
parameterNumber = 2 ;
}
#V component of wind
'northward_wind' = {
discipline = 0 ;
parameterCategory = 2 ;
parameterNumber = 3 ;
}
#Specific humidity
'specific_humidity' = {
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 0 ;
}
#Surface pressure
'surface_air_pressure' = {
discipline = 0 ;
parameterCategory = 3 ;
parameterNumber = 0 ;
typeOfFirstFixedSurface = 1 ;
}
#Vertical velocity
'lagrangian_tendency_of_air_pressure' = {
discipline = 0 ;
parameterCategory = 2 ;
parameterNumber = 8 ;
}
#Vorticity (relative)
'atmosphere_relative_vorticity' = {
discipline = 0 ;
parameterCategory = 2 ;
parameterNumber = 12 ;
}
#Boundary layer dissipation
'kinetic_energy_dissipation_in_atmosphere_boundary_layer' = {
discipline = 0 ;
parameterCategory = 2 ;
parameterNumber = 20 ;
}
#Surface sensible heat flux
'surface_upward_sensible_heat_flux' = {
discipline = 0 ;
parameterCategory = 0 ;
parameterNumber = 11 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Surface latent heat flux
'surface_upward_latent_heat_flux' = {
discipline = 0 ;
parameterCategory = 0 ;
parameterNumber = 10 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Mean sea level pressure
'air_pressure_at_mean_sea_level' = {
discipline = 0 ;
parameterCategory = 3 ;
parameterNumber = 0 ;
typeOfFirstFixedSurface = 101 ;
}
#Divergence
'divergence_of_wind' = {
discipline = 0 ;
parameterCategory = 2 ;
parameterNumber = 13 ;
}
#Geopotential Height
'geopotential_height' = {
discipline = 0 ;
parameterCategory = 3 ;
parameterNumber = 5 ;
}
#Relative humidity
'relative_humidity' = {
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 1 ;
}
#Land-sea mask
'land_binary_mask' = {
discipline = 2 ;
parameterCategory = 0 ;
parameterNumber = 0 ;
typeOfFirstFixedSurface = 1 ;
}
#Surface roughness
'surface_roughness_length' = {
discipline = 2 ;
parameterCategory = 0 ;
parameterNumber = 1 ;
}
#Surface net solar radiation
'surface_net_downward_shortwave_flux' = {
discipline = 0 ;
parameterCategory = 4 ;
parameterNumber = 1 ;
parameterNumber = 9 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Surface net thermal radiation
'surface_net_upward_longwave_flux' = {
discipline = 0 ;
parameterCategory = 5 ;
parameterNumber = 5 ;
typeOfFirstFixedSurface = 1 ;
typeOfStatisticalProcessing = 1 ;
}
#Top net thermal radiation
'toa_outgoing_longwave_flux' = {
discipline = 0 ;
parameterCategory = 5 ;
parameterNumber = 5 ;
typeOfFirstFixedSurface = 8 ;
typeOfStatisticalProcessing = 1 ;
}
#Albedo
'surface_albedo' = {
discipline = 0 ;
parameterCategory = 19 ;
parameterNumber = 1 ;
}
#Convective precipitation (water)
'lwe_thickness_of_convective_precipitation_amount' = {
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 10 ;
}

View File

@ -1,54 +1,4 @@
# Automatically generated by ./create_param.pl, do not edit
#Geopotential
'geopotential' = {
discipline = 0 ;
parameterNumber = 4 ;
parameterCategory = 3 ;
}
#Relative vorticity
'atmosphere_relative_vorticity' = {
discipline = 0 ;
parameterNumber = 12 ;
parameterCategory = 2 ;
}
#Snow depth
'lwe_thickness_of_surface_snow_amount' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 254 ;
}
#Convective precipitation
'lwe_thickness_of_convective_precipitation_amount' = {
discipline = 0 ;
parameterNumber = 10 ;
parameterCategory = 1 ;
unitsFactor = 1000 ;
}
#Boundary layer dissipation
'kinetic_energy_dissipation_in_atmosphere_boundary_layer' = {
discipline = 0 ;
parameterNumber = 20 ;
parameterCategory = 2 ;
}
#Relative divergence
'divergence_of_wind' = {
discipline = 0 ;
parameterNumber = 13 ;
parameterCategory = 2 ;
}
#Relative humidity
'relative_humidity' = {
discipline = 0 ;
parameterNumber = 1 ;
parameterCategory = 1 ;
}
#Surface roughness
'surface_roughness_length' = {
discipline = 2 ;
parameterNumber = 1 ;
parameterCategory = 0 ;
}
# Automatically generated by ./create_def.pl, do not edit
#Total column water vapour
'lwe_thickness_of_atmosphere_mass_content_of_water_vapor' = {
discipline = 192 ;
@ -69,9 +19,10 @@
}
#Snow depth
'lwe_thickness_of_surface_snow_amount' = {
localTablesVersion = 1 ;
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 11 ;
parameterNumber = 254 ;
}
#Large-scale precipitation
'lwe_thickness_of_stratiform_precipitation_amount' = {
@ -84,6 +35,7 @@
discipline = 0 ;
parameterCategory = 1 ;
parameterNumber = 10 ;
unitsFactor = 1000 ;
}
#Snowfall
'lwe_thickness_of_snowfall_amount' = {
@ -121,57 +73,567 @@
parameterCategory = 128 ;
parameterNumber = 185 ;
}
#Total column ozone
'atmosphere_mass_content_of_ozone' = {
discipline = 192 ;
parameterCategory = 128 ;
parameterNumber = 206 ;
}
#Temperature of snow layer
'temperature_in_surface_snow' = {
discipline = 192 ;
parameterCategory = 128 ;
parameterNumber = 238 ;
}
#Depth of 20C isotherm
'depth_of_isosurface_of_sea_water_potential_temperature' = {
#Particulate matter d < 1 um
'mass_concentration_of_pm1_ambient_aerosol_particles_in_air' = {
discipline = 192 ;
parameterCategory = 151 ;
parameterNumber = 163 ;
}
#Ocean barotropic stream function
'ocean_barotropic_streamfunction' = {
parameterCategory = 210 ;
parameterNumber = 72 ;
}
#Particulate matter d < 2.5 um
'mass_concentration_of_pm2p5_ambient_aerosol_particles_in_air' = {
discipline = 192 ;
parameterCategory = 151 ;
parameterNumber = 147 ;
}
#Surface downward northward stress
'surface_downward_northward_stress' = {
parameterCategory = 210 ;
parameterNumber = 73 ;
}
#Particulate matter d < 10 um
'mass_concentration_of_pm10_ambient_aerosol_particles_in_air' = {
discipline = 192 ;
parameterCategory = 151 ;
parameterNumber = 154 ;
}
#Surface downward eastward stress
'surface_downward_eastward_stress' = {
parameterCategory = 210 ;
parameterNumber = 74 ;
}
#Hydrogen peroxide
'mass_fraction_of_hydrogen_peroxide_in_air' = {
discipline = 192 ;
parameterCategory = 151 ;
parameterNumber = 153 ;
}
#Sea water practical salinity
'sea_water_practical_salinity' = {
parameterCategory = 217 ;
parameterNumber = 3 ;
}
#Methane (chemistry)
'mass_fraction_of_methane_in_air' = {
discipline = 192 ;
parameterCategory = 151 ;
parameterNumber = 130 ;
}
parameterCategory = 217 ;
parameterNumber = 4 ;
}
#Nitric acid
'mass_fraction_of_nitric_acid_in_air' = {
discipline = 192 ;
parameterCategory = 217 ;
parameterNumber = 6 ;
}
#Ethene
'mass_fraction_of_ethene_in_air' = {
discipline = 192 ;
parameterCategory = 217 ;
parameterNumber = 10 ;
}
#Peroxyacetyl nitrate
'mass_fraction_of_peroxyacetyl_nitrate_in_air' = {
discipline = 192 ;
parameterCategory = 217 ;
parameterNumber = 13 ;
}
#Isoprene
'mass_fraction_of_isoprene_in_air' = {
discipline = 192 ;
parameterCategory = 217 ;
parameterNumber = 16 ;
}
#Dimethyl sulfide
'mass_fraction_of_dimethyl_sulfide_in_air' = {
discipline = 192 ;
parameterCategory = 217 ;
parameterNumber = 18 ;
}
#Ammonia
'mass_fraction_of_ammonia_in_air' = {
discipline = 192 ;
parameterCategory = 217 ;
parameterNumber = 19 ;
}
#Nitrogen monoxide
'mass_fraction_of_nitrogen_monoxide_in_air' = {
discipline = 192 ;
parameterCategory = 217 ;
parameterNumber = 27 ;
}
#Hydroxyl radical
'mass_fraction_of_hydroxyl_radical_in_air' = {
discipline = 192 ;
parameterCategory = 217 ;
parameterNumber = 30 ;
}
#Nitrate radical
'mass_fraction_of_nitrate_radical_in_air' = {
discipline = 192 ;
parameterCategory = 217 ;
parameterNumber = 32 ;
}
#Dinitrogen pentoxide
'mass_fraction_of_dinitrogen_pentoxide_in_air' = {
discipline = 192 ;
parameterCategory = 217 ;
parameterNumber = 33 ;
}
#Methanol
'mass_fraction_of_methanol_in_air' = {
discipline = 192 ;
parameterCategory = 217 ;
parameterNumber = 42 ;
}
#Formic acid
'mass_fraction_of_formic_acid_in_air' = {
discipline = 192 ;
parameterCategory = 217 ;
parameterNumber = 43 ;
}
#Ethane
'mass_fraction_of_ethane_in_air' = {
discipline = 192 ;
parameterCategory = 217 ;
parameterNumber = 45 ;
}
#Ethanol
'mass_fraction_of_ethanol_in_air' = {
discipline = 192 ;
parameterCategory = 217 ;
parameterNumber = 46 ;
}
#Propane
'mass_fraction_of_propane_in_air' = {
discipline = 192 ;
parameterCategory = 217 ;
parameterNumber = 47 ;
}
#Propene
'mass_fraction_of_propene_in_air' = {
discipline = 192 ;
parameterCategory = 217 ;
parameterNumber = 48 ;
}
#Terpenes
'mass_fraction_of_terpenes_in_air' = {
discipline = 192 ;
parameterCategory = 217 ;
parameterNumber = 49 ;
}
#Chlorine dioxide
'mass_fraction_of_chlorine_dioxide_in_air' = {
discipline = 192 ;
parameterCategory = 217 ;
parameterNumber = 63 ;
}
#Chlorine nitrate
'mass_fraction_of_chlorine_nitrate_in_air' = {
discipline = 192 ;
parameterCategory = 217 ;
parameterNumber = 64 ;
}
#Hypochlorous acid
'mass_fraction_of_hypochlorous_acid_in_air' = {
discipline = 192 ;
parameterCategory = 217 ;
parameterNumber = 65 ;
}
#Hydrogen bromide
'mass_fraction_of_hydrogen_bromide_in_air' = {
discipline = 192 ;
parameterCategory = 217 ;
parameterNumber = 68 ;
}
#Hypobromous acid
'mass_fraction_of_hypobromous_acid_in_air' = {
discipline = 192 ;
parameterCategory = 217 ;
parameterNumber = 70 ;
}
#Methyl chloride
'mass_fraction_of_methyl_chloride_in_air' = {
discipline = 192 ;
parameterCategory = 217 ;
parameterNumber = 78 ;
}
#Methyl bromide
'mass_fraction_of_methyl_bromide_in_air' = {
discipline = 192 ;
parameterCategory = 217 ;
parameterNumber = 80 ;
}
#Sulfuric acid
'mass_fraction_of_sulfuric_acid_in_air' = {
discipline = 192 ;
parameterCategory = 217 ;
parameterNumber = 85 ;
}
#Nitrous acid
'mass_fraction_of_nitrous_acid_in_air' = {
discipline = 192 ;
parameterCategory = 217 ;
parameterNumber = 86 ;
}
#Acetic acid
'mass_fraction_of_acetic_acid_in_air' = {
discipline = 192 ;
parameterCategory = 217 ;
parameterNumber = 96 ;
}
#Chlorine monoxide
'mass_fraction_of_chlorine_monoxide_in_air' = {
discipline = 192 ;
parameterCategory = 217 ;
parameterNumber = 174 ;
}
#Bromine monoxide
'mass_fraction_of_bromine_monoxide_in_air' = {
discipline = 192 ;
parameterCategory = 217 ;
parameterNumber = 176 ;
}
#Bromine nitrate
'mass_fraction_of_bromine_nitrate_in_air' = {
discipline = 192 ;
parameterCategory = 217 ;
parameterNumber = 194 ;
}
#Hydrogen chloride
'mass_fraction_of_hydrogen_chloride_in_air' = {
discipline = 192 ;
parameterCategory = 217 ;
parameterNumber = 200 ;
}
#Total column hydrogen peroxide
'atmosphere_mass_content_of_hydrogen_peroxide' = {
discipline = 192 ;
parameterCategory = 218 ;
parameterNumber = 3 ;
}
#Total column methane
'atmosphere_mass_content_of_methane' = {
discipline = 192 ;
parameterCategory = 218 ;
parameterNumber = 4 ;
}
#Total column nitric acid
'atmosphere_mass_content_of_nitric_acid' = {
discipline = 192 ;
parameterCategory = 218 ;
parameterNumber = 6 ;
}
#Total column ethene
'atmosphere_mass_content_of_ethene' = {
discipline = 192 ;
parameterCategory = 218 ;
parameterNumber = 10 ;
}
#Total column peroxyacetyl nitrate
'atmosphere_mass_content_of_peroxyacetyl_nitrate' = {
discipline = 192 ;
parameterCategory = 218 ;
parameterNumber = 13 ;
}
#Total column isoprene
'atmosphere_mass_content_of_isoprene' = {
discipline = 192 ;
parameterCategory = 218 ;
parameterNumber = 16 ;
}
#Total column dimethyl sulfide
'atmosphere_mass_content_of_dimethyl_sulfide' = {
discipline = 192 ;
parameterCategory = 218 ;
parameterNumber = 18 ;
}
#Total column ammonia
'atmosphere_mass_content_of_ammonia' = {
discipline = 192 ;
parameterCategory = 218 ;
parameterNumber = 19 ;
}
#Total column sulfate
'atmosphere_mass_content_of_sulfate' = {
discipline = 192 ;
parameterCategory = 218 ;
parameterNumber = 20 ;
}
#Total column nitrogen monoxide
'atmosphere_mass_content_of_nitrogen_monoxide' = {
discipline = 192 ;
parameterCategory = 218 ;
parameterNumber = 27 ;
}
#Total column hydroxyl radical
'atmosphere_mass_content_of_hydroxyl_radical' = {
discipline = 192 ;
parameterCategory = 218 ;
parameterNumber = 30 ;
}
#Total column nitrate radical
'atmosphere_mass_content_of_nitrate_radical' = {
discipline = 192 ;
parameterCategory = 218 ;
parameterNumber = 32 ;
}
#Total column dinitrogen pentoxide
'atmosphere_mass_content_of_dinitrogen_pentoxide' = {
discipline = 192 ;
parameterCategory = 218 ;
parameterNumber = 33 ;
}
#Total column methanol
'atmosphere_mass_content_of_methanol' = {
discipline = 192 ;
parameterCategory = 218 ;
parameterNumber = 42 ;
}
#Total column formic acid
'atmosphere_mass_content_of_formic_acid' = {
discipline = 192 ;
parameterCategory = 218 ;
parameterNumber = 43 ;
}
#Total column ethane
'atmosphere_mass_content_of_ethane' = {
discipline = 192 ;
parameterCategory = 218 ;
parameterNumber = 45 ;
}
#Total column ethanol
'atmosphere_mass_content_of_ethanol' = {
discipline = 192 ;
parameterCategory = 218 ;
parameterNumber = 46 ;
}
#Total column propane
'atmosphere_mass_content_of_propane' = {
discipline = 192 ;
parameterCategory = 218 ;
parameterNumber = 47 ;
}
#Total column propene
'atmosphere_mass_content_of_propene' = {
discipline = 192 ;
parameterCategory = 218 ;
parameterNumber = 48 ;
}
#Total column terpenes
'atmosphere_mass_content_of_terpenes' = {
discipline = 192 ;
parameterCategory = 218 ;
parameterNumber = 49 ;
}
#Total column of chlorine dioxide
'atmosphere_mass_content_of_chlorine_dioxide' = {
discipline = 192 ;
parameterCategory = 218 ;
parameterNumber = 63 ;
}
#Total column of chlorine nitrate
'atmosphere_mass_content_of_chlorine_nitrate' = {
discipline = 192 ;
parameterCategory = 218 ;
parameterNumber = 64 ;
}
#Total column of hypochlorous acid
'atmosphere_mass_content_of_hypochlorous_acid' = {
discipline = 192 ;
parameterCategory = 218 ;
parameterNumber = 65 ;
}
#Total column of hydrogen bromide
'atmosphere_mass_content_of_hydrogen_bromide' = {
discipline = 192 ;
parameterCategory = 218 ;
parameterNumber = 68 ;
}
#Total column of hypobromous acid
'atmosphere_mass_content_of_hypobromous_acid' = {
discipline = 192 ;
parameterCategory = 218 ;
parameterNumber = 70 ;
}
#Total column of methyl chloride
'atmosphere_mass_content_of_methyl_chloride' = {
discipline = 192 ;
parameterCategory = 218 ;
parameterNumber = 78 ;
}
#Total column of methyl bromide
'atmosphere_mass_content_of_methyl_bromide' = {
discipline = 192 ;
parameterCategory = 218 ;
parameterNumber = 80 ;
}
#Total column of nitrous acid
'atmosphere_mass_content_of_nitrous_acid' = {
discipline = 192 ;
parameterCategory = 218 ;
parameterNumber = 86 ;
}
#Total column of acetic acid
'atmosphere_mass_content_of_acetic_acid' = {
discipline = 192 ;
parameterCategory = 218 ;
parameterNumber = 96 ;
}
#Total column of chlorine monoxide
'atmosphere_mass_content_of_chlorine_monoxide' = {
discipline = 192 ;
parameterCategory = 218 ;
parameterNumber = 174 ;
}
#Total column of bromine monoxide
'atmosphere_mass_content_of_bromine_monoxide' = {
discipline = 192 ;
parameterCategory = 218 ;
parameterNumber = 176 ;
}
#Total column of bromine nitrate
'atmosphere_mass_content_of_bromine_nitrate' = {
discipline = 192 ;
parameterCategory = 218 ;
parameterNumber = 194 ;
}
#Total column of hydrogen chloride
'atmosphere_mass_content_of_hydrogen_chloride' = {
discipline = 192 ;
parameterCategory = 218 ;
parameterNumber = 200 ;
}
#Sea water potential temperature
'sea_water_potential_temperature' = {
discipline = 192 ;
parameterCategory = 151 ;
parameterNumber = 129 ;
}
#Sea water sigma theta
'sea_water_sigma_theta' = {
}
#Sea water practical salinity
'sea_water_practical_salinity' = {
discipline = 192 ;
parameterCategory = 151 ;
parameterNumber = 138 ;
}
parameterNumber = 130 ;
}
#Upward sea water velocity
'upward_sea_water_velocity' = {
discipline = 192 ;
parameterCategory = 151 ;
parameterNumber = 133 ;
}
#Sea water sigma theta
'sea_water_sigma_theta' = {
discipline = 192 ;
parameterCategory = 151 ;
parameterNumber = 138 ;
}
#Ocean barotropic stream function
'ocean_barotropic_streamfunction' = {
discipline = 192 ;
parameterCategory = 151 ;
parameterNumber = 147 ;
}
#Surface downward eastward stress
'surface_downward_eastward_stress' = {
discipline = 192 ;
parameterCategory = 151 ;
parameterNumber = 153 ;
}
#Surface downward northward stress
'surface_downward_northward_stress' = {
discipline = 192 ;
parameterCategory = 151 ;
parameterNumber = 154 ;
}
#Carbon Dioxide
'mass_fraction_of_carbon_dioxide_in_air' = {
discipline = 192 ;
parameterCategory = 210 ;
parameterNumber = 61 ;
}
#Methane
'mass_fraction_of_methane_in_air' = {
discipline = 192 ;
parameterCategory = 210 ;
parameterNumber = 62 ;
}
#Nitrous oxide
'mass_fraction_of_nitrous_oxide_in_air' = {
discipline = 192 ;
parameterCategory = 210 ;
parameterNumber = 63 ;
}
#Total column Nitrous oxide
'atmosphere_mass_content_of_nitrous_oxide' = {
discipline = 192 ;
parameterCategory = 210 ;
parameterNumber = 66 ;
}
#Nitrogen dioxide
'mass_fraction_of_nitrogen_dioxide_in_air' = {
discipline = 192 ;
parameterCategory = 210 ;
parameterNumber = 121 ;
}
#Sulphur dioxide
'mass_fraction_of_sulfur_dioxide_in_air' = {
discipline = 192 ;
parameterCategory = 210 ;
parameterNumber = 122 ;
}
#Carbon monoxide
'mass_fraction_of_carbon_monoxide_in_air' = {
discipline = 192 ;
parameterCategory = 210 ;
parameterNumber = 123 ;
}
#Formaldehyde
'mass_fraction_of_formaldehyde_in_air' = {
discipline = 192 ;
parameterCategory = 210 ;
parameterNumber = 124 ;
}
#Total column Nitrogen dioxide
'atmosphere_mass_content_of_nitrogen_dioxide' = {
discipline = 192 ;
parameterCategory = 210 ;
parameterNumber = 125 ;
}
#Total column Sulphur dioxide
'atmosphere_mass_content_of_sulfur_dioxide' = {
discipline = 192 ;
parameterCategory = 210 ;
parameterNumber = 126 ;
}
#Total column Carbon monoxide
'atmosphere_mass_content_of_carbon_monoxide' = {
discipline = 192 ;
parameterCategory = 210 ;
parameterNumber = 127 ;
}
#Total column Formaldehyde
'atmosphere_mass_content_of_formaldehyde' = {
discipline = 192 ;
parameterCategory = 210 ;
parameterNumber = 128 ;
}
#Radon
'mass_fraction_of_radon_in_air' = {
discipline = 192 ;
parameterCategory = 210 ;
parameterNumber = 181 ;
}
#Total column Radon
'atmosphere_mass_content_of_radon' = {
discipline = 192 ;
parameterCategory = 210 ;
parameterNumber = 183 ;
}
#GEMS Ozone
'mass_fraction_of_ozone_in_air' = {
discipline = 192 ;
parameterCategory = 210 ;
parameterNumber = 203 ;
}
#GEMS Total column ozone
'atmosphere_mass_content_of_ozone' = {
discipline = 192 ;
parameterCategory = 210 ;
parameterNumber = 206 ;
}

View File

@ -5,3 +5,5 @@ concept_nofail unstructuredGridType(unknown,"unstructuredGridType.def",conceptsL
concept_nofail unstructuredGridSubtype(unknown,"unstructuredGridSubtype.def",conceptsLocalDirAll,conceptsMasterDir);
concept_nofail unstructuredGridUUID(unknown,"unstructuredGridUUID.def",conceptsLocalDirAll,conceptsMasterDir);
meta gridName sprintf("%s_%s",unstructuredGridType,unstructuredGridSubtype);

View File

@ -1,6 +1,6 @@
'undefined' = { numberOfGridInReference = 0; }
'T grid' = { numberOfGridInReference = 1; }
'U grid' = { numberOfGridInReference = 2; }
'V grid' = { numberOfGridInReference = 3; }
'W grid' = { numberOfGridInReference = 4; }
'F grid' = { numberOfGridInReference = 5; }
'T' = { numberOfGridInReference = 1; }
'U' = { numberOfGridInReference = 2; }
'V' = { numberOfGridInReference = 3; }
'W' = { numberOfGridInReference = 4; }
'F' = { numberOfGridInReference = 5; }

View File

@ -16,7 +16,7 @@
CLASS = accessor
SUPER = grib_accessor_class_gen
IMPLEMENTS = get_native_type;init
IMPLEMENTS = compare;unpack_string
IMPLEMENTS = compare;unpack_string;pack_string
END_CLASS_DEF
*/
@ -32,13 +32,13 @@ or edit "accessor.class" and rerun ./make_class.pl
*/
static int get_native_type(grib_accessor*);
static int pack_string(grib_accessor*, const char*, size_t* len);
static int unpack_string(grib_accessor*, char*, size_t* len);
static void init(grib_accessor*, const long, grib_arguments*);
static void init_class(grib_accessor_class*);
static int compare(grib_accessor*, grib_accessor*);
typedef struct grib_accessor_bytes
{
typedef struct grib_accessor_bytes {
grib_accessor att;
/* Members defined in gen */
/* Members defined in bytes */
@ -47,46 +47,46 @@ typedef struct grib_accessor_bytes
extern grib_accessor_class* grib_accessor_class_gen;
static grib_accessor_class _grib_accessor_class_bytes = {
&grib_accessor_class_gen, /* super */
"bytes", /* name */
sizeof(grib_accessor_bytes), /* size */
&grib_accessor_class_gen, /* super */
"bytes", /* name */
sizeof(grib_accessor_bytes), /* size */
0, /* inited */
&init_class, /* init_class */
&init, /* init */
0, /* post_init */
0, /* free mem */
0, /* describes himself */
0, /* get length of section */
0, /* get length of string */
0, /* get number of values */
0, /* get number of bytes */
0, /* get offset to bytes */
0, /* post_init */
0, /* free mem */
0, /* describes himself */
0, /* get length of section */
0, /* get length of string */
0, /* get number of values */
0, /* get number of bytes */
0, /* get offset to bytes */
&get_native_type, /* get native type */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
0, /* grib_pack procedures double */
0, /* grib_unpack procedures double */
0, /* grib_pack procedures string */
0, /* get sub_section */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_pack procedures long */
0, /* grib_unpack procedures long */
0, /* grib_pack procedures double */
0, /* grib_unpack procedures double */
&pack_string, /* grib_pack procedures string */
&unpack_string, /* grib_unpack procedures string */
0, /* grib_pack array procedures string */
0, /* grib_unpack array procedures string */
0, /* grib_pack procedures bytes */
0, /* grib_unpack procedures bytes */
0, /* pack_expression */
0, /* notify_change */
0, /* update_size */
0, /* preferred_size */
0, /* resize */
0, /* nearest_smaller_value */
0, /* next accessor */
0, /* grib_pack array procedures string */
0, /* grib_unpack array procedures string */
0, /* grib_pack procedures bytes */
0, /* grib_unpack procedures bytes */
0, /* pack_expression */
0, /* notify_change */
0, /* update_size */
0, /* preferred_size */
0, /* resize */
0, /* nearest_smaller_value */
0, /* next accessor */
&compare, /* compare vs. another accessor */
0, /* unpack only ith value */
0, /* unpack a subarray */
0, /* clear */
0, /* clone accessor */
0, /* unpack only ith value */
0, /* unpack a subarray */
0, /* clear */
0, /* clone accessor */
};
@ -95,35 +95,34 @@ grib_accessor_class* grib_accessor_class_bytes = &_grib_accessor_class_bytes;
static void init_class(grib_accessor_class* c)
{
c->dump = (*(c->super))->dump;
c->next_offset = (*(c->super))->next_offset;
c->string_length = (*(c->super))->string_length;
c->value_count = (*(c->super))->value_count;
c->byte_count = (*(c->super))->byte_count;
c->byte_offset = (*(c->super))->byte_offset;
c->sub_section = (*(c->super))->sub_section;
c->pack_missing = (*(c->super))->pack_missing;
c->is_missing = (*(c->super))->is_missing;
c->pack_long = (*(c->super))->pack_long;
c->unpack_long = (*(c->super))->unpack_long;
c->pack_double = (*(c->super))->pack_double;
c->unpack_double = (*(c->super))->unpack_double;
c->pack_string = (*(c->super))->pack_string;
c->pack_string_array = (*(c->super))->pack_string_array;
c->unpack_string_array = (*(c->super))->unpack_string_array;
c->pack_bytes = (*(c->super))->pack_bytes;
c->unpack_bytes = (*(c->super))->unpack_bytes;
c->pack_expression = (*(c->super))->pack_expression;
c->notify_change = (*(c->super))->notify_change;
c->update_size = (*(c->super))->update_size;
c->preferred_size = (*(c->super))->preferred_size;
c->resize = (*(c->super))->resize;
c->nearest_smaller_value = (*(c->super))->nearest_smaller_value;
c->next = (*(c->super))->next;
c->unpack_double_element = (*(c->super))->unpack_double_element;
c->unpack_double_subarray = (*(c->super))->unpack_double_subarray;
c->clear = (*(c->super))->clear;
c->make_clone = (*(c->super))->make_clone;
c->dump = (*(c->super))->dump;
c->next_offset = (*(c->super))->next_offset;
c->string_length = (*(c->super))->string_length;
c->value_count = (*(c->super))->value_count;
c->byte_count = (*(c->super))->byte_count;
c->byte_offset = (*(c->super))->byte_offset;
c->sub_section = (*(c->super))->sub_section;
c->pack_missing = (*(c->super))->pack_missing;
c->is_missing = (*(c->super))->is_missing;
c->pack_long = (*(c->super))->pack_long;
c->unpack_long = (*(c->super))->unpack_long;
c->pack_double = (*(c->super))->pack_double;
c->unpack_double = (*(c->super))->unpack_double;
c->pack_string_array = (*(c->super))->pack_string_array;
c->unpack_string_array = (*(c->super))->unpack_string_array;
c->pack_bytes = (*(c->super))->pack_bytes;
c->unpack_bytes = (*(c->super))->unpack_bytes;
c->pack_expression = (*(c->super))->pack_expression;
c->notify_change = (*(c->super))->notify_change;
c->update_size = (*(c->super))->update_size;
c->preferred_size = (*(c->super))->preferred_size;
c->resize = (*(c->super))->resize;
c->nearest_smaller_value = (*(c->super))->nearest_smaller_value;
c->next = (*(c->super))->next;
c->unpack_double_element = (*(c->super))->unpack_double_element;
c->unpack_double_subarray = (*(c->super))->unpack_double_subarray;
c->clear = (*(c->super))->clear;
c->make_clone = (*(c->super))->make_clone;
}
/* END_CLASS_IMP */
@ -158,10 +157,11 @@ static int unpack_string(grib_accessor* a, char* v, size_t* len)
unsigned char* p = NULL;
char* s = v;
int i;
long length = grib_byte_count(a);
const long length = grib_byte_count(a);
const long slength = 2 * length;
if (*len < 2 * length) {
*len = 2 * length;
if (*len < slength) {
*len = slength;
return GRIB_ARRAY_TOO_SMALL;
}
@ -172,7 +172,48 @@ static int unpack_string(grib_accessor* a, char* v, size_t* len)
s += 2;
}
*len = length;
*len = slength;
return GRIB_SUCCESS;
}
static int pack_string(grib_accessor* a, const char* val, size_t* len)
{
/* The string representation (val) of the byte array will have two chars
* per byte e.g. 4C5B means the 2 bytes 0114 and 0133 in octal
* so has to be twice the length of the byte array
*/
int err = 0;
grib_accessor_class* super = *(a->cclass->super);
grib_context* c = a->context;
size_t nbytes = a->length;
const size_t expected_blen = nbytes;
const size_t expected_slen = 2 * expected_blen;
unsigned char* bytearray = NULL;
size_t i = 0, slen = strlen(val);
if (slen != expected_slen || *len != expected_slen) {
grib_context_log(c, GRIB_LOG_ERROR,"pack_string: key %s is %lu bytes. Expected a string with %lu characters",
a->name, expected_blen, expected_slen);
return GRIB_WRONG_ARRAY_SIZE;
}
bytearray = (unsigned char*)grib_context_malloc(c, nbytes * (sizeof(unsigned char)));
if (!bytearray) return GRIB_OUT_OF_MEMORY;
for (i = 0; i < (slen/2); i++) {
unsigned int byteVal = 0;
if (sscanf(val + 2*i, "%02x", &byteVal) != 1) {
grib_context_log(c, GRIB_LOG_ERROR,"pack_string: Invalid hex byte specfication '%.2s'",val + 2*i);
grib_context_free(c, bytearray);
return GRIB_INVALID_KEY_VALUE;
}
Assert(byteVal < 256);
bytearray[i] = (int)byteVal;
}
/* Forward to base class to pack the byte array */
err = super->pack_bytes(a, bytearray, &nbytes);
grib_context_free(c, bytearray);
return err;
}

View File

@ -171,7 +171,7 @@ static void init(grib_accessor* a, const long len, grib_arguments* param)
s_len = sizeof(tmp);
p = grib_expression_evaluate_string(grib_handle_of_accessor(a), expression, tmp, &s_len, &ret);
if (ret != GRIB_SUCCESS) {
grib_context_log(a->context, GRIB_LOG_ERROR, "unable to evaluate %s as string", a->name);
grib_context_log(a->context, GRIB_LOG_ERROR, "Unable to evaluate %s as string", a->name);
Assert(0);
}
s_len = strlen(p) + 1;
@ -243,14 +243,12 @@ static int unpack_bytes(grib_accessor* a, unsigned char* val, size_t* len)
long length = grib_byte_count(a);
long offset = grib_byte_offset(a);
if (*len < length) {
grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it is %d bytes long\n", a->name, length);
*len = length;
return GRIB_ARRAY_TOO_SMALL;
}
memcpy(val, buf + offset, length);
*len = length;
@ -279,7 +277,7 @@ static int unpack_long(grib_accessor* a, long* v, size_t* len)
*v = GRIB_MISSING_LONG;
else
*v = (long)val;
grib_context_log(a->context, GRIB_LOG_DEBUG, " Casting double %s to long", a->name);
grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting double %s to long", a->name);
return GRIB_SUCCESS;
}
@ -292,7 +290,7 @@ static int unpack_long(grib_accessor* a, long* v, size_t* len)
*v = strtol(val, &last, 10);
if (*last == 0) {
grib_context_log(a->context, GRIB_LOG_DEBUG, " Casting string %s to long", a->name);
grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting string %s to long", a->name);
return GRIB_SUCCESS;
}
}
@ -312,7 +310,7 @@ static int unpack_double(grib_accessor* a, double* v, size_t* len)
size_t l = 1;
grib_unpack_long(a, &val, &l);
*v = val;
grib_context_log(a->context, GRIB_LOG_DEBUG, " Casting long %s to double", a->name);
grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting long %s to double", a->name);
return GRIB_SUCCESS;
}
@ -325,7 +323,7 @@ static int unpack_double(grib_accessor* a, double* v, size_t* len)
*v = strtod(val, &last);
if (*last == 0) {
grib_context_log(a->context, GRIB_LOG_DEBUG, " Casting string %s to long", a->name);
grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting string %s to long", a->name);
return GRIB_SUCCESS;
}
}
@ -346,7 +344,7 @@ static int unpack_string(grib_accessor* a, char* v, size_t* len)
grib_unpack_double(a, &val, &l);
sprintf(v, "%g", val);
*len = strlen(v);
grib_context_log(a->context, GRIB_LOG_DEBUG, " Casting double %s to string", a->name);
grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting double %s to string", a->name);
return GRIB_SUCCESS;
}
@ -356,7 +354,7 @@ static int unpack_string(grib_accessor* a, char* v, size_t* len)
grib_unpack_long(a, &val, &l);
sprintf(v, "%ld", val);
*len = strlen(v);
grib_context_log(a->context, GRIB_LOG_DEBUG, " Casting long %s to string \n", a->name);
grib_context_log(a->context, GRIB_LOG_DEBUG, "Casting long %s to string \n", a->name);
return GRIB_SUCCESS;
}
@ -392,7 +390,7 @@ static int pack_expression(grib_accessor* a, grib_expression* e)
len = 1;
ret = grib_expression_evaluate_long(hand, e, &lval);
if (ret != GRIB_SUCCESS) {
grib_context_log(a->context, GRIB_LOG_ERROR, "unable to set %s as long", a->name);
grib_context_log(a->context, GRIB_LOG_ERROR, "Unable to set %s as long", a->name);
return ret;
}
/*if (hand->context->debug)
@ -434,7 +432,7 @@ static int pack_long(grib_accessor* a, const long* v, size_t* len)
double* val = (double*)grib_context_malloc(c, *len * (sizeof(double)));
if (!val) {
grib_context_log(c, GRIB_LOG_ERROR,
"unable to allocate %d bytes\n", (int)(*len * (sizeof(double))));
"Unable to allocate %d bytes\n", (int)(*len * (sizeof(double))));
return GRIB_OUT_OF_MEMORY;
}
for (i = 0; i < *len; i++)
@ -443,7 +441,7 @@ static int pack_long(grib_accessor* a, const long* v, size_t* len)
grib_context_free(c, val);
return ret;
}
grib_context_log(c, GRIB_LOG_ERROR, " Should not grib_pack %s as long", a->name);
grib_context_log(c, GRIB_LOG_ERROR, "Should not grib_pack %s as long", a->name);
Assert(0);
return GRIB_NOT_IMPLEMENTED;
}
@ -456,7 +454,7 @@ static int pack_double_array_as_long(grib_accessor* a, const double* v, size_t*
size_t numBytes = *len * (sizeof(long));
long* lValues = (long*)grib_context_malloc(c, numBytes);
if (!lValues) {
grib_context_log(c, GRIB_LOG_ERROR, "unable to allocate %ld bytes\n", numBytes);
grib_context_log(c, GRIB_LOG_ERROR, "Unable to allocate %ld bytes\n", numBytes);
return GRIB_OUT_OF_MEMORY;
}
for (i = 0; i < *len; i++)
@ -521,13 +519,19 @@ static int pack_string(grib_accessor* a, const char* v, size_t* len)
}
grib_context_log(a->context, GRIB_LOG_ERROR,
" Should not grib_pack %s as string", a->name);
"Should not grib_pack %s as string", a->name);
return GRIB_NOT_IMPLEMENTED;
}
static int pack_bytes(grib_accessor* a, const unsigned char* val, size_t* len)
{
size_t length = *len;
const size_t length = *len;
if (length != a->length) {
grib_context_log(a->context, GRIB_LOG_ERROR,
"pack_bytes: Wrong size (%lu) for %s. It is %lu bytes long",
length, a->name, a->length);
return GRIB_BUFFER_TOO_SMALL;
}
grib_buffer_replace(a, val, length, 1, 1);
return GRIB_SUCCESS;
}

View File

@ -33,6 +33,7 @@ list(APPEND test_bins
bufr_check_descriptors
grib_sh_ieee64
ieee
grib_set_bytes
grib_sh_imag
grib_sh_spectral_complex
grib_lam_bf
@ -60,6 +61,7 @@ if( HAVE_BUILD_TOOLS )
definitions
grib_calendar
grib_md5
grib_cfNames
filter_substr
grib_uerra
grib_2nd_order_numValues
@ -69,6 +71,7 @@ if( HAVE_BUILD_TOOLS )
grib_ecc-1150
grib_ecc-1053
grib_ecc-1065
grib_ecc-1167
bufr_json_samples
bufr_ecc-359
bufr_ecc-517
@ -138,6 +141,7 @@ if( HAVE_BUILD_TOOLS )
grib_ecc-1000
grib_ecc-1001
grib_ecc-1030
grib_set_bytes
bufr_ecc-556
gts_get
gts_ls
@ -158,6 +162,7 @@ if( HAVE_BUILD_TOOLS )
grib2to1
grib1to3
grib2to3
grib2_templates
grib3_templates
badgrib
grib_ls

101
tests/grib2_templates.sh Executable file
View File

@ -0,0 +1,101 @@
#!/bin/sh
# (C) Copyright 2005- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
#
. ./include.sh
set -u
REDIRECT=/dev/null
label="grib2_templates"
temp1=temp1.$label.grib2
temp2=temp2.$label.grib2
temp=temp.$label.grib2
sample2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl
# Template 4.88
# -------------
# TODO: Add tablesVersion later...
#grib_set -s productDefinitionTemplateNumber=88,numberOfForecastsUsedInLocalTime=1 $sample2 $temp
#grib_check_key_equals $temp localTimeMethod 255
# Templates 4.76 -> 4.79, 4.80 -> 4.83
# -------------------------------------
$tools_dir/grib_set -s tablesVersion=24,productDefinitionTemplateNumber=76 $sample2 $temp
grib_check_key_equals $temp constituentType,sourceSinkChemicalPhysicalProcess '0 255'
$tools_dir/grib_set -s tablesVersion=24,productDefinitionTemplateNumber=77 $sample2 $temp
grib_check_key_equals $temp constituentType,sourceSinkChemicalPhysicalProcess,perturbationNumber '0 255 0'
$tools_dir/grib_set -s tablesVersion=24,productDefinitionTemplateNumber=78 $sample2 $temp
grib_check_key_equals $temp constituentType,sourceSinkChemicalPhysicalProcess,numberOfMissingInStatisticalProcess '0 255 0'
$tools_dir/grib_set -s tablesVersion=24,productDefinitionTemplateNumber=79 $sample2 $temp
grib_check_key_equals $temp constituentType,sourceSinkChemicalPhysicalProcess,numberOfMissingInStatisticalProcess,perturbationNumber '0 255 0 0'
$tools_dir/grib_set -s tablesVersion=24,productDefinitionTemplateNumber=80 $sample2 $temp
grib_check_key_equals $temp aerosolType,sourceSinkChemicalPhysicalProcess '0 255'
$tools_dir/grib_set -s tablesVersion=24,productDefinitionTemplateNumber=81 $sample2 $temp
grib_check_key_equals $temp aerosolType,sourceSinkChemicalPhysicalProcess,perturbationNumber '0 255 0'
$tools_dir/grib_set -s tablesVersion=24,productDefinitionTemplateNumber=82 $sample2 $temp
grib_check_key_equals $temp sourceSinkChemicalPhysicalProcess 255
$tools_dir/grib_set -s productDefinitionTemplateNumber=83 $sample2 $temp
grib_check_key_equals $temp sourceSinkChemicalPhysicalProcess 255
# WMO have now added template 4.55 and 4.56
# ------------------------------------------
$tools_dir/grib_set -s productDefinitionTemplateNumber=55 $sample2 $temp
$tools_dir/grib_get -p tileClassification,tileIndex $temp >/dev/null
$tools_dir/grib_set -s productDefinitionTemplateNumber=56 $sample2 $temp
$tools_dir/grib_get -p tileClassification,tileIndex,perturbationNumber $temp >/dev/null
# WMO have now added template 4.53 and 4.54
# ------------------------------------------
$tools_dir/grib_set -s productDefinitionTemplateNumber=53 $sample2 $temp
$tools_dir/grib_get -p partitionNumber $temp >/dev/null
$tools_dir/grib_set -s productDefinitionTemplateNumber=54 $sample2 $temp
$tools_dir/grib_get -p partitionNumber,perturbationNumber $temp >/dev/null
# S2S templates: 4.60 and 4.61
# ------------------------------------------
$tools_dir/grib_set -s tablesVersion=11,productDefinitionTemplateNumber=60 $sample2 $temp 2>/dev/null
$tools_dir/grib_get -p perturbationNumber,YearOfModelVersion,MonthOfModelVersion,DayOfModelVersion $temp >/dev/null
$tools_dir/grib_set -s tablesVersion=11,productDefinitionTemplateNumber=61 $sample2 $temp 2>/dev/null
$tools_dir/grib_get -p perturbationNumber,typeOfStatisticalProcessing,HourOfModelVersion $temp >/dev/null
# GRIB-991 template 4.57
# ------------------------------------------
$tools_dir/grib_set -s tablesVersion=16,productDefinitionTemplateNumber=57,NP=2 $sample2 $temp
$tools_dir/grib_get -p "constituentType,numberOfModeOfDistribution,modeNumber,typeOfDistributionFunction" $temp >/dev/null
# ECC-410 template 4.58
# ------------------------------------------
$tools_dir/grib_set -s tablesVersion=18,productDefinitionTemplateNumber=58,NP=2 $sample2 $temp
$tools_dir/grib_get -p "constituentType,NP,modeNumber,typeOfDistributionFunction,perturbationNumber" $temp >/dev/null
# template 4.67 and 4.68
# ------------------------------------------
$tools_dir/grib_set -s tablesVersion=19,productDefinitionTemplateNumber=67 $sample2 $temp
grib_check_key_exists $temp 'constituentType,timeIncrement'
$tools_dir/grib_set -s tablesVersion=19,productDefinitionTemplateNumber=68 $sample2 $temp
grib_check_key_exists $temp 'constituentType,perturbationNumber'
rm -f $temp $temp1 $temp2

55
tests/grib_cfNames.sh Executable file
View File

@ -0,0 +1,55 @@
#!/bin/sh
# (C) Copyright 2005- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
#
. ./include.sh
set -u
label="grib_cfNames_test"
temp=temp.${label}
sample1=$ECCODES_SAMPLES_PATH/GRIB1.tmpl
sample2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl
${tools_dir}/grib_set -s discipline=192,parameterCategory=128,parameterNumber=137 $sample2 $temp
grib_check_key_equals $temp cfName lwe_thickness_of_atmosphere_mass_content_of_water_vapor
${tools_dir}/grib_set -s discipline=0,parameterNumber=20,parameterCategory=2 $sample2 $temp
grib_check_key_equals $temp cfName kinetic_energy_dissipation_in_atmosphere_boundary_layer
${tools_dir}/grib_set -s paramId=145 $sample2 $temp
grib_check_key_equals $temp cfName kinetic_energy_dissipation_in_atmosphere_boundary_layer
${tools_dir}/grib_set -s paramId=137 $sample2 $temp
grib_check_key_equals $temp cfName lwe_thickness_of_atmosphere_mass_content_of_water_vapor
${tools_dir}/grib_set -s indicatorOfParameter=137,table2Version=128 $sample1 $temp
grib_check_key_equals $temp cfName lwe_thickness_of_atmosphere_mass_content_of_water_vapor
${tools_dir}/grib_set -s paramId=145 $sample2 $temp
grib_check_key_equals $temp cfName kinetic_energy_dissipation_in_atmosphere_boundary_layer
${tools_dir}/grib_set -s indicatorOfParameter=122,table2Version=1 $sample1 $temp
grib_check_key_equals $temp cfName surface_upward_sensible_heat_flux
${tools_dir}/grib_set -s indicatorOfParameter=121,table2Version=1 $sample1 $temp
grib_check_key_equals $temp cfName surface_upward_latent_heat_flux
${tools_dir}/grib_set -s paramId=151154 $sample1 $temp
grib_check_key_equals $temp cfName surface_downward_northward_stress
${tools_dir}/grib_set -s paramId=151154 $sample2 $temp
grib_check_key_equals $temp cfName surface_downward_northward_stress
${tools_dir}/grib_set -s discipline=192,parameterCategory=151,parameterNumber=153 $sample2 $temp
grib_check_key_equals $temp cfName surface_downward_eastward_stress
${tools_dir}/grib_set -s discipline=0,parameterCategory=1,parameterNumber=10 $sample2 $temp
grib_check_key_equals $temp cfName lwe_thickness_of_convective_precipitation_amount
${tools_dir}/grib_set -s discipline=0,parameterCategory=1,parameterNumber=11 $sample2 $temp
grib_check_key_equals $temp cfName lwe_thickness_of_surface_snow_amount
# Clean up
rm -f $temp

45
tests/grib_ecc-1167.sh Executable file
View File

@ -0,0 +1,45 @@
#!/bin/sh
# (C) Copyright 2005- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
#
. ./include.sh
set -u
# ---------------------------------------------------------
# This is the test for the JIRA issue ECC-1167
# GRIB: Allow setting byte array as string
# ---------------------------------------------------------
label="grib_ecc-1167-test"
temp1=temp.${label}.1.grib
temp2=temp.${label}.2.grib
errlog=temp.${label}.err
sample2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl
${tools_dir}/grib_set -s gridType=unstructured_grid $sample2 $temp1
grib_check_key_equals $temp1 uuidOfHGrid '00000000000000000000000000000000'
${tools_dir}/grib_set -s uuidOfHGrid=DEfdBEef10203040b00b1e50001100FF $temp1 $temp2
grib_check_key_equals $temp2 uuidOfHGrid 'defdbeef10203040b00b1e50001100ff'
${tools_dir}/grib_set -s uuidOfHGrid:s=10991111111111111111115000110000 $temp1 $temp2
grib_check_key_equals $temp2 uuidOfHGrid '10991111111111111111115000110000'
exit 0
# Test errors
set +e
# Invalid HEX
${tools_dir}/grib_set -s uuidOfHGrid=DEZZBEef10203040b00b1e50001100FF $temp1 $temp2 2>$errlog
status=$?
set -e
[ $status -ne 0 ]
grep -q "Invalid hex byte specfication 'ZZ'" $errlog
# Clean up
rm -f $temp1 $temp2 $errlog

View File

@ -19,29 +19,30 @@ temp2=temp.2.${label}
${tools_dir}/grib_set -s gridType=unstructured_grid,numberOfGridInReference=4,numberOfGridUsed=2 $sample $temp1
grib_check_key_equals $temp1 'unstructuredGridType' 'ORCA1'
grib_check_key_equals $temp1 'unstructuredGridSubtype' 'W grid'
#grib_check_key_equals $temp1 'unstructuredGridUUID' 'ORCA1 W grid unknown'
grib_check_key_equals $temp1 'unstructuredGridSubtype' 'W'
#grib_check_key_equals $temp1 'unstructuredGridUUID' 'ORCA1 W unknown'
grib_check_key_equals $temp1 gridName 'ORCA1_W'
${tools_dir}/grib_set -s gridType=unstructured_grid,unstructuredGridType=ORCA1,unstructuredGridSubtype='W grid' $sample $temp2
${tools_dir}/grib_set -s gridType=unstructured_grid,unstructuredGridType=ORCA1,unstructuredGridSubtype=W $sample $temp2
${tools_dir}/grib_compare $temp1 $temp2
grib_check_key_equals $temp2 'numberOfGridInReference' '4'
grib_check_key_equals $temp2 'numberOfGridUsed' '2'
grib_check_key_equals $temp2 'numberOfGridInReference,numberOfGridUsed,gridName' '4 2 ORCA1_W'
# Test some lat/lon parameters
${tools_dir}/grib_set -s paramId=250003 $sample $temp1
grib_check_key_equals $temp1 'unstructuredGridSubtype' 'T grid'
grib_check_key_equals $temp1 'unstructuredGridSubtype' 'T'
${tools_dir}/grib_set -s paramId=250005 $sample $temp1
grib_check_key_equals $temp1 'unstructuredGridSubtype' 'U grid'
grib_check_key_equals $temp1 'unstructuredGridSubtype' 'U'
${tools_dir}/grib_set -s paramId=250007 $sample $temp1
grib_check_key_equals $temp1 'unstructuredGridSubtype' 'V grid'
grib_check_key_equals $temp1 'unstructuredGridSubtype' 'V'
${tools_dir}/grib_set -s paramId=250009 $sample $temp1
grib_check_key_equals $temp1 'unstructuredGridSubtype' 'W grid'
grib_check_key_equals $temp1 'unstructuredGridSubtype' 'W'
${tools_dir}/grib_set -s paramId=250011 $sample $temp1
grib_check_key_equals $temp1 'unstructuredGridSubtype' 'F grid'
grib_check_key_equals $temp1 'unstructuredGridSubtype' 'F'
rm -f $temp1 $temp2

78
tests/grib_set_bytes.c Normal file
View File

@ -0,0 +1,78 @@
/*
* (C) Copyright 2005- ECMWF.
*
* This software is licensed under the terms of the Apache Licence Version 2.0
* which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
*
* In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
* virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
*/
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include "eccodes.h"
int main(int argc, char** argv)
{
int err = 0;
size_t size = 0;
FILE* in = NULL;
const char* infile = "../data/test_uuid.grib2";
FILE* out = NULL;
const char* outfile = "temp.grib_set_bytes.grib";
codes_handle* h = NULL;
const void* buffer = NULL;
unsigned char uuid_short[] = { /* not enough bytes */
0x07, 0x20, 0x40, 0x51,
0x07, 0x20, 0x40, 0x51,
0x07, 0x20, 0x40, 0x52,
0x07, 0x20, 0x40
};
unsigned char uuid_good[] = { /* Just the right size i.e. 16 bytes */
0x07, 0x20, 0x40, 0x51,
0x07, 0x20, 0x40, 0x51,
0x07, 0x20, 0x40, 0x52,
0x07, 0x20, 0x40, 0x53
};
unsigned char uuid_long[] = { /* Too many bytes */
0x07, 0x20, 0x40, 0x51,
0x07, 0x20, 0x40, 0x51,
0x07, 0x20, 0x40, 0x52,
0x07, 0x20, 0x40, 0x53,
0x00, 0x01
};
size_t uuid_short_len = sizeof (uuid_short);
size_t uuid_good_len = sizeof (uuid_good);
size_t uuid_long_len = sizeof (uuid_long);
in = fopen(infile, "rb");
assert(in);
out = fopen(outfile, "wb");
assert(out);
h = codes_handle_new_from_file(0, in, PRODUCT_GRIB, &err);
assert(h);
/* The uuidOfVGrid key is 16 bytes long */
err = codes_set_bytes(h, "uuidOfVGrid", uuid_short, &uuid_short_len);
assert(err == CODES_BUFFER_TOO_SMALL);
err = codes_set_bytes(h, "uuidOfVGrid", uuid_long, &uuid_long_len);
assert(err == CODES_BUFFER_TOO_SMALL);
/* This one should work */
err = codes_set_bytes(h, "uuidOfVGrid", uuid_good, &uuid_good_len);
assert(err == 0);
CODES_CHECK(codes_get_message(h, &buffer, &size), 0);
if (fwrite(buffer, 1, size, out) != size) {
perror(argv[1]);
exit(1);
}
codes_handle_delete(h);
fclose(in);
fclose(out);
return 0;
}

22
tests/grib_set_bytes.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/sh
# (C) Copyright 2005- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
#
. ./include.sh
TEMP_ERR=temp.grib_set_bytes.log
TEMP_OUT=temp.grib_set_bytes.grib
$EXEC ${test_dir}/grib_set_bytes 2>$TEMP_ERR
grep -q "Wrong size.*for uuidOfVGrid. It is 16 bytes long" $TEMP_ERR
uuid=`${tools_dir}/grib_get -p uuidOfVGrid $TEMP_OUT`
[ "$uuid" = "07204051072040510720405207204053" ]
rm -f $TEMP_OUT $TEMP_ERR