Merge branch 'develop' into feature/ECC-1620_sub-hourly

This commit is contained in:
Shahram Najm 2024-01-12 17:24:37 +00:00
commit b60198320d
85 changed files with 2010 additions and 562 deletions

View File

@ -958,6 +958,36 @@
parameterCategory = 0 ;
parameterNumber = 52 ;
}
#Envelope-maximum individual wave height
'envhmax' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 93 ;
}
#Time domain maximum individual crest height
'tdcmax' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 94 ;
}
#Time domain maximum individual wave height
'tdhmax' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 95 ;
}
#Space time maximum individual crest height
'stcmax' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 96 ;
}
#Space time maximum individual wave height
'sthmax' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 97 ;
}
#Wave Spectral Skewness
'wss' = {
discipline = 10 ;
@ -4454,6 +4484,40 @@
parameterCategory = 0 ;
parameterNumber = 9 ;
}
#Lake depth
'lakdph' = {
discipline = 1 ;
parameterCategory = 2 ;
parameterNumber = 15 ;
typeOfFirstFixedSurface = 1 ;
typeOfSecondFixedSurface = 162 ;
}
#River depth
'rivdph' = {
discipline = 1 ;
parameterCategory = 2 ;
parameterNumber = 16 ;
typeOfFirstFixedSurface = 1 ;
typeOfSecondFixedSurface = 162 ;
}
#River outflow of water
'rivout' = {
discipline = 1 ;
parameterCategory = 0 ;
parameterNumber = 17 ;
}
#Floodplain outflow of water
'fldout' = {
discipline = 1 ;
parameterCategory = 0 ;
parameterNumber = 18 ;
}
#Floodpath outflow of water
'pthflw' = {
discipline = 1 ;
parameterCategory = 0 ;
parameterNumber = 19 ;
}
#Latitude
'lat' = {
discipline = 0 ;

View File

@ -13825,6 +13825,174 @@
typeOfSecondFixedSurface = 255 ;
typeOfStatisticalProcessing = 1 ;
}
#Covariance between 2-metre temperature and volumetric soil water layer 1
'covar_t2m_swvl1' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 192 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and volumetric soil water layer 1
'covar_rh2m_swvl1' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 193 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between surface soil moisture and volumetric soil water layer 1
'covar_ssm_swvl1' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 194 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and volumetric soil water layer 2
'covar_t2m_swvl2' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 195 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and volumetric soil water layer 2
'covar_rh2m_swvl2' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 196 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between surface soil moisture and volumetric soil water layer 2
'covar_ssm_swvl2' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 197 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and volumetric soil water layer 3
'covar_t2m_swvl3' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 198 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and volumetric soil water layer 3
'covar_rh2m_swvl3' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 199 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between surface soil moisture and volumetric soil water layer 3
'covar_ssm_swvl3' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 200 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and soil temperature layer 1
'covar_t2m_stl1' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 201 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and soil temperature layer 1
'covar_rh2m_stl1' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 202 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and soil temperature layer 2
'covar_t2m_stl2' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 203 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and soil temperature layer 2
'covar_rh2m_stl2' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 204 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and soil temperature layer 3
'covar_t2m_stl3' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 205 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and soil temperature layer 3
'covar_rh2m_stl3' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 206 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and temperature of snow layer 1
'covar_t2m_tsn1' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 207 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and temperature of snow layer 1
'covar_rh2m_tsn1' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 208 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and temperature of snow layer 2
'covar_t2m_tsn2' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 209 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and temperature of snow layer 2
'covar_rh2m_tsn2' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 210 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and temperature of snow layer 3
'covar_t2m_tsn3' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 211 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and temperature of snow layer 3
'covar_rh2m_tsn3' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 212 ;
typeOfFirstFixedSurface = 254 ;
}
#Surface roughness length for heat
'srlh' = {
localTablesVersion = 1 ;

View File

@ -6,3 +6,4 @@
'o2d' = {typeOfFirstFixedSurface=102; typeOfSecondFixedSurface=255;gridDefinitionTemplateNumber=101;numberOfGridUsed=5;}
'o2d' = {typeOfFirstFixedSurface=102; typeOfSecondFixedSurface=255;gridDefinitionTemplateNumber=101;numberOfGridUsed=6;}
'o2d' = {typeOfFirstFixedSurface=102; typeOfSecondFixedSurface=255;gridDefinitionTemplateNumber=101;numberOfGridUsed=7;}
'sfc' = {typeOfFirstFixedSurface=254;}

View File

@ -13825,6 +13825,174 @@
typeOfSecondFixedSurface = 255 ;
typeOfStatisticalProcessing = 1 ;
}
#Covariance between 2-metre temperature and volumetric soil water layer 1
'Covariance between 2-metre temperature and volumetric soil water layer 1' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 192 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and volumetric soil water layer 1
'Covariance between 2-metre relative humidity and volumetric soil water layer 1' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 193 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between surface soil moisture and volumetric soil water layer 1
'Covariance between surface soil moisture and volumetric soil water layer 1' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 194 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and volumetric soil water layer 2
'Covariance between 2-metre temperature and volumetric soil water layer 2' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 195 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and volumetric soil water layer 2
'Covariance between 2-metre relative humidity and volumetric soil water layer 2' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 196 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between surface soil moisture and volumetric soil water layer 2
'Covariance between surface soil moisture and volumetric soil water layer 2' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 197 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and volumetric soil water layer 3
'Covariance between 2-metre temperature and volumetric soil water layer 3' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 198 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and volumetric soil water layer 3
'Covariance between 2-metre relative humidity and volumetric soil water layer 3' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 199 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between surface soil moisture and volumetric soil water layer 3
'Covariance between surface soil moisture and volumetric soil water layer 3' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 200 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and soil temperature layer 1
'Covariance between 2-metre temperature and soil temperature layer 1' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 201 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and soil temperature layer 1
'Covariance between 2-metre relative humidity and soil temperature layer 1' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 202 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and soil temperature layer 2
'Covariance between 2-metre temperature and soil temperature layer 2' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 203 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and soil temperature layer 2
'Covariance between 2-metre relative humidity and soil temperature layer 2' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 204 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and soil temperature layer 3
'Covariance between 2-metre temperature and soil temperature layer 3' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 205 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and soil temperature layer 3
'Covariance between 2-metre relative humidity and soil temperature layer 3' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 206 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and temperature of snow layer 1
'Covariance between 2-metre temperature and temperature of snow layer 1' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 207 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and temperature of snow layer 1
'Covariance between 2-metre relative humidity and temperature of snow layer 1' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 208 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and temperature of snow layer 2
'Covariance between 2-metre temperature and temperature of snow layer 2' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 209 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and temperature of snow layer 2
'Covariance between 2-metre relative humidity and temperature of snow layer 2' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 210 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and temperature of snow layer 3
'Covariance between 2-metre temperature and temperature of snow layer 3' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 211 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and temperature of snow layer 3
'Covariance between 2-metre relative humidity and temperature of snow layer 3' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 212 ;
typeOfFirstFixedSurface = 254 ;
}
#Surface roughness length for heat
'Surface roughness length for heat' = {
localTablesVersion = 1 ;

View File

@ -13825,6 +13825,174 @@
typeOfSecondFixedSurface = 255 ;
typeOfStatisticalProcessing = 1 ;
}
#Covariance between 2-metre temperature and volumetric soil water layer 1
'254001' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 192 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and volumetric soil water layer 1
'254002' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 193 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between surface soil moisture and volumetric soil water layer 1
'254003' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 194 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and volumetric soil water layer 2
'254004' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 195 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and volumetric soil water layer 2
'254005' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 196 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between surface soil moisture and volumetric soil water layer 2
'254006' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 197 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and volumetric soil water layer 3
'254007' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 198 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and volumetric soil water layer 3
'254008' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 199 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between surface soil moisture and volumetric soil water layer 3
'254009' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 200 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and soil temperature layer 1
'254010' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 201 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and soil temperature layer 1
'254011' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 202 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and soil temperature layer 2
'254012' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 203 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and soil temperature layer 2
'254013' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 204 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and soil temperature layer 3
'254014' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 205 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and soil temperature layer 3
'254015' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 206 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and temperature of snow layer 1
'254016' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 207 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and temperature of snow layer 1
'254017' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 208 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and temperature of snow layer 2
'254018' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 209 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and temperature of snow layer 2
'254019' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 210 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and temperature of snow layer 3
'254020' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 211 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and temperature of snow layer 3
'254021' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 212 ;
typeOfFirstFixedSurface = 254 ;
}
#Surface roughness length for heat
'260651' = {
localTablesVersion = 1 ;

View File

@ -13825,6 +13825,174 @@
typeOfSecondFixedSurface = 255 ;
typeOfStatisticalProcessing = 1 ;
}
#Covariance between 2-metre temperature and volumetric soil water layer 1
'covar_t2m_swvl1' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 192 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and volumetric soil water layer 1
'covar_rh2m_swvl1' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 193 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between surface soil moisture and volumetric soil water layer 1
'covar_ssm_swvl1' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 194 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and volumetric soil water layer 2
'covar_t2m_swvl2' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 195 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and volumetric soil water layer 2
'covar_rh2m_swvl2' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 196 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between surface soil moisture and volumetric soil water layer 2
'covar_ssm_swvl2' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 197 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and volumetric soil water layer 3
'covar_t2m_swvl3' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 198 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and volumetric soil water layer 3
'covar_rh2m_swvl3' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 199 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between surface soil moisture and volumetric soil water layer 3
'covar_ssm_swvl3' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 200 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and soil temperature layer 1
'covar_t2m_stl1' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 201 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and soil temperature layer 1
'covar_rh2m_stl1' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 202 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and soil temperature layer 2
'covar_t2m_stl2' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 203 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and soil temperature layer 2
'covar_rh2m_stl2' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 204 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and soil temperature layer 3
'covar_t2m_stl3' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 205 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and soil temperature layer 3
'covar_rh2m_stl3' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 206 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and temperature of snow layer 1
'covar_t2m_tsn1' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 207 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and temperature of snow layer 1
'covar_rh2m_tsn1' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 208 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and temperature of snow layer 2
'covar_t2m_tsn2' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 209 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and temperature of snow layer 2
'covar_rh2m_tsn2' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 210 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and temperature of snow layer 3
'covar_t2m_tsn3' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 211 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and temperature of snow layer 3
'covar_rh2m_tsn3' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 212 ;
typeOfFirstFixedSurface = 254 ;
}
#Surface roughness length for heat
'srlh' = {
localTablesVersion = 1 ;

View File

@ -0,0 +1,2 @@
# Concept typeOfLevel
'abstractLevel' = {typeOfFirstFixedSurface=254;}

View File

@ -13825,6 +13825,174 @@
typeOfSecondFixedSurface = 255 ;
typeOfStatisticalProcessing = 1 ;
}
#Covariance between 2-metre temperature and volumetric soil water layer 1
'K m**3 m**-3' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 192 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and volumetric soil water layer 1
'% m**3 m**-3' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 193 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between surface soil moisture and volumetric soil water layer 1
'm**3 m**-3 m**3 m**-3' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 194 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and volumetric soil water layer 2
'K m**3 m**-3' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 195 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and volumetric soil water layer 2
'% m**3 m**-3' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 196 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between surface soil moisture and volumetric soil water layer 2
'm**3 m**-3 m**3 m**-3' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 197 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and volumetric soil water layer 3
'K m**3 m**-3' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 198 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and volumetric soil water layer 3
'% m**3 m**-3' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 199 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between surface soil moisture and volumetric soil water layer 3
'm**3 m**-3 m**3 m**-3' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 200 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and soil temperature layer 1
'K K' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 201 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and soil temperature layer 1
'% K' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 202 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and soil temperature layer 2
'K K' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 203 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and soil temperature layer 2
'% K' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 204 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and soil temperature layer 3
'K K' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 205 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and soil temperature layer 3
'% K' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 206 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and temperature of snow layer 1
'K K' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 207 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and temperature of snow layer 1
'% K' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 208 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and temperature of snow layer 2
'K K' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 209 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and temperature of snow layer 2
'% K' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 210 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre temperature and temperature of snow layer 3
'K K' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 211 ;
typeOfFirstFixedSurface = 254 ;
}
#Covariance between 2-metre relative humidity and temperature of snow layer 3
'% K' = {
localTablesVersion = 1 ;
discipline = 254 ;
parameterCategory = 254 ;
parameterNumber = 212 ;
typeOfFirstFixedSurface = 254 ;
}
#Surface roughness length for heat
'm' = {
localTablesVersion = 1 ;

View File

@ -958,6 +958,36 @@
parameterCategory = 0 ;
parameterNumber = 52 ;
}
#Envelope-maximum individual wave height
'Envelope-maximum individual wave height' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 93 ;
}
#Time domain maximum individual crest height
'Time domain maximum individual crest height' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 94 ;
}
#Time domain maximum individual wave height
'Time domain maximum individual wave height' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 95 ;
}
#Space time maximum individual crest height
'Space time maximum individual crest height' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 96 ;
}
#Space time maximum individual wave height
'Space time maximum individual wave height' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 97 ;
}
#Wave Spectral Skewness
'Wave Spectral Skewness' = {
discipline = 10 ;
@ -4454,6 +4484,40 @@
parameterCategory = 0 ;
parameterNumber = 9 ;
}
#Lake depth
'Lake depth' = {
discipline = 1 ;
parameterCategory = 2 ;
parameterNumber = 15 ;
typeOfFirstFixedSurface = 1 ;
typeOfSecondFixedSurface = 162 ;
}
#River depth
'River depth' = {
discipline = 1 ;
parameterCategory = 2 ;
parameterNumber = 16 ;
typeOfFirstFixedSurface = 1 ;
typeOfSecondFixedSurface = 162 ;
}
#River outflow of water
'River outflow of water' = {
discipline = 1 ;
parameterCategory = 0 ;
parameterNumber = 17 ;
}
#Floodplain outflow of water
'Floodplain outflow of water' = {
discipline = 1 ;
parameterCategory = 0 ;
parameterNumber = 18 ;
}
#Floodpath outflow of water
'Floodpath outflow of water' = {
discipline = 1 ;
parameterCategory = 0 ;
parameterNumber = 19 ;
}
#Latitude
'Latitude' = {
discipline = 0 ;

View File

@ -958,6 +958,36 @@
parameterCategory = 0 ;
parameterNumber = 52 ;
}
#Envelope-maximum individual wave height
'140130' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 93 ;
}
#Time domain maximum individual crest height
'140131' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 94 ;
}
#Time domain maximum individual wave height
'140132' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 95 ;
}
#Space time maximum individual crest height
'140133' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 96 ;
}
#Space time maximum individual wave height
'140134' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 97 ;
}
#Wave Spectral Skewness
'140207' = {
discipline = 10 ;
@ -4454,6 +4484,40 @@
parameterCategory = 0 ;
parameterNumber = 9 ;
}
#Lake depth
'240030' = {
discipline = 1 ;
parameterCategory = 2 ;
parameterNumber = 15 ;
typeOfFirstFixedSurface = 1 ;
typeOfSecondFixedSurface = 162 ;
}
#River depth
'240031' = {
discipline = 1 ;
parameterCategory = 2 ;
parameterNumber = 16 ;
typeOfFirstFixedSurface = 1 ;
typeOfSecondFixedSurface = 162 ;
}
#River outflow of water
'240032' = {
discipline = 1 ;
parameterCategory = 0 ;
parameterNumber = 17 ;
}
#Floodplain outflow of water
'240033' = {
discipline = 1 ;
parameterCategory = 0 ;
parameterNumber = 18 ;
}
#Floodpath outflow of water
'240034' = {
discipline = 1 ;
parameterCategory = 0 ;
parameterNumber = 19 ;
}
#Latitude
'250001' = {
discipline = 0 ;

View File

@ -958,6 +958,36 @@
parameterCategory = 0 ;
parameterNumber = 52 ;
}
#Envelope-maximum individual wave height
'envhmax' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 93 ;
}
#Time domain maximum individual crest height
'tdcmax' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 94 ;
}
#Time domain maximum individual wave height
'tdhmax' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 95 ;
}
#Space time maximum individual crest height
'stcmax' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 96 ;
}
#Space time maximum individual wave height
'sthmax' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 97 ;
}
#Wave Spectral Skewness
'wss' = {
discipline = 10 ;
@ -4454,6 +4484,40 @@
parameterCategory = 0 ;
parameterNumber = 9 ;
}
#Lake depth
'lakdph' = {
discipline = 1 ;
parameterCategory = 2 ;
parameterNumber = 15 ;
typeOfFirstFixedSurface = 1 ;
typeOfSecondFixedSurface = 162 ;
}
#River depth
'rivdph' = {
discipline = 1 ;
parameterCategory = 2 ;
parameterNumber = 16 ;
typeOfFirstFixedSurface = 1 ;
typeOfSecondFixedSurface = 162 ;
}
#River outflow of water
'rivout' = {
discipline = 1 ;
parameterCategory = 0 ;
parameterNumber = 17 ;
}
#Floodplain outflow of water
'fldout' = {
discipline = 1 ;
parameterCategory = 0 ;
parameterNumber = 18 ;
}
#Floodpath outflow of water
'pthflw' = {
discipline = 1 ;
parameterCategory = 0 ;
parameterNumber = 19 ;
}
#Latitude
'lat' = {
discipline = 0 ;

View File

@ -0,0 +1,2 @@
# Code table 0.0 for ECMWF - Discipline of processed data in the GRIB message, number of GRIB Master table
254 254 Model internal fields

View File

@ -0,0 +1,2 @@
# Product discipline 254 for ECMWF - Model internal fields
254 254 Covariances

View File

@ -0,0 +1,22 @@
# Code table 4.2 - discipline=254 category=254 for ECMWF
192 192 Covariance between 2-metre temperature and volumetric soil water layer 1 [K m**3 m**-3]
193 193 Covariance between 2-metre relative humidity and volumetric soil water layer 1 [% m**3 m**-3]
194 194 Covariance between surface soil moisture and volumetric soil water layer 1 [m**3 m**-3 m**3 m**-3]
195 195 Covariance between 2-metre temperature and volumetric soil water layer 2 [K m**3 m**-3]
196 196 Covariance between 2-metre relative humidity and volumetric soil water layer 2 [% m**3 m**-3]
197 197 Covariance between surface soil moisture and volumetric soil water layer 2 [m**3 m**-3 m**3 m**-3]
198 198 Covariance between 2-metre temperature and volumetric soil water layer 3 [K m**3 m**-3]
199 199 Covariance between 2-metre relative humidity and volumetric soil water layer 3 [% m**3 m**-3]
200 200 Covariance between surface soil moisture and volumetric soil water layer 3 [m**3 m**-3 m**3 m**-3]
201 201 Covariance between 2-metre temperature and soil temperature layer 1 [K K]
202 202 Covariance between 2-metre relative humidity and soil temperature layer 1 [% K]
203 203 Covariance between 2-metre temperature and soil temperature layer 2 [K K]
204 204 Covariance between 2-metre relative humidity and soil temperature layer 2 [% K]
205 205 Covariance between 2-metre temperature and soil temperature layer 3 [K K]
206 206 Covariance between 2-metre relative humidity and soil temperature layer 3 [% K]
207 207 Covariance between 2-metre temperature and temperature of snow layer 1 [K K]
208 208 Covariance between 2-metre relative humidity and temperature of snow layer 1 [% K]
209 209 Covariance between 2-metre temperature and temperature of snow layer 2 [K K]
210 210 Covariance between 2-metre relative humidity and temperature of snow layer 2 [% K]
211 211 Covariance between 2-metre temperature and temperature of snow layer 3 [K K]
212 212 Covariance between 2-metre relative humidity and temperature of snow layer 3 [% K]

View File

@ -1 +1,2 @@
173 173 Top surface of snow, over ice, on sea, lake or river
254 254 Abstract level with no vertical localization or meaning

View File

@ -958,6 +958,36 @@
parameterCategory = 0 ;
parameterNumber = 52 ;
}
#Envelope-maximum individual wave height
'm' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 93 ;
}
#Time domain maximum individual crest height
'm' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 94 ;
}
#Time domain maximum individual wave height
'm' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 95 ;
}
#Space time maximum individual crest height
'm' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 96 ;
}
#Space time maximum individual wave height
'm' = {
discipline = 10 ;
parameterCategory = 0 ;
parameterNumber = 97 ;
}
#Wave Spectral Skewness
'Numeric' = {
discipline = 10 ;
@ -4454,6 +4484,40 @@
parameterCategory = 0 ;
parameterNumber = 9 ;
}
#Lake depth
'm' = {
discipline = 1 ;
parameterCategory = 2 ;
parameterNumber = 15 ;
typeOfFirstFixedSurface = 1 ;
typeOfSecondFixedSurface = 162 ;
}
#River depth
'm' = {
discipline = 1 ;
parameterCategory = 2 ;
parameterNumber = 16 ;
typeOfFirstFixedSurface = 1 ;
typeOfSecondFixedSurface = 162 ;
}
#River outflow of water
'm**3 s**-1' = {
discipline = 1 ;
parameterCategory = 0 ;
parameterNumber = 17 ;
}
#Floodplain outflow of water
'm**3 s**-1' = {
discipline = 1 ;
parameterCategory = 0 ;
parameterNumber = 18 ;
}
#Floodpath outflow of water
'm**3 s**-1' = {
discipline = 1 ;
parameterCategory = 0 ;
parameterNumber = 19 ;
}
#Latitude
'Degree N' = {
discipline = 0 ;

View File

@ -73,3 +73,4 @@
92 pfc Point values
93 ppm Point value metrics
94 gwt Weather types
95 est Ensemble statistics

View File

@ -11,6 +11,7 @@ program operator_3_test
implicit none
integer :: iret, outfile, ibufr
integer(kind=4), dimension(:), allocatable :: ivalues
integer(kind=8), dimension(:), allocatable :: lvalues
character(len=100) :: outfile_name
call getarg(1, outfile_name)
@ -21,10 +22,10 @@ program operator_3_test
stop 1
endif
allocate(ivalues(1))
ivalues=(/ -16383 /)
call codes_set(ibufr,'inputOverriddenReferenceValues',ivalues)
deallocate(ivalues)
allocate(lvalues(1))
lvalues=(/ -16383 /)
call codes_set(ibufr,'inputOverriddenReferenceValues',lvalues)
deallocate(lvalues)
allocate(ivalues(3))
ivalues=(/ 2,2,2 /)

View File

@ -12,6 +12,9 @@ program grib_ecc_1316
implicit none
integer :: iret, ostep, olevel, onumber
! Test both interfaces: 4 byte and 8 byte integers
integer(4) :: step_int = 96, level_int = 0, number_int = 0
integer(8) :: step_long = 96, level_long = 0, number_long = 0
character(len=80) :: parameterName
integer :: idx, igrib, count1 = 0
@ -19,9 +22,12 @@ program grib_ecc_1316
call codes_index_create(idx, '../../data/tigge_cf_ecmwf.grib2', &
'parameterName,number,level,step')
call codes_index_select(idx, 'step', 96)
call codes_index_select(idx, 'level', 0)
call codes_index_select(idx, 'number', 0)
call codes_index_select(idx, 'step', step_int)
call codes_index_select(idx, 'level', level_int)
call codes_index_select(idx, 'number', number_int)
call codes_index_select(idx, 'step', step_long)
call codes_index_select(idx, 'level', level_long)
call codes_index_select(idx, 'number', number_long)
call codes_index_select(idx, 'parameterName', 'Soil moisture')
do while (.true.)

View File

@ -15,8 +15,12 @@
program set
use eccodes
implicit none
integer :: infile, outfile
integer :: igrib
integer :: infile, outfile
integer :: igrib
real(4) :: nlev_real4 = 12.21
real(8) :: nlev_real8 = 12.21
integer(4) :: PDTN_int = 11
integer(8) :: PDTN_long = 11
call codes_open_file(infile, '../../data/sample.grib2', 'r')
@ -25,13 +29,15 @@ program set
call codes_grib_new_from_file(infile, igrib)
! individual ensemble forecast
call codes_set(igrib, 'productDefinitionTemplateNumber', 11)
call codes_set(igrib, 'productDefinitionTemplateNumber', PDTN_int)
call codes_set(igrib, 'productDefinitionTemplateNumber', PDTN_long)
! select level type as Generalized Vertical Height Coordinate
call codes_set(igrib, 'typeOfLevel', 'generalVertical')
! now set keys specific to this level type
call codes_set(igrib, 'nlev', 12.21)
call codes_set(igrib, 'nlev', nlev_real4)
call codes_set(igrib, 'nlev', nlev_real8)
call codes_set(igrib, 'numberOfVGridUsed', 13.55)
! check integrity of GRIB message

File diff suppressed because it is too large Load Diff

View File

@ -107,12 +107,12 @@ static int create_accessor(grib_section* p, grib_action* act, grib_loader* h)
static void dump(grib_action* act, FILE* f, int lvl)
{
int i = 0;
grib_action_assert* self = (grib_action_assert*)act;
for (i = 0; i < lvl; i++)
grib_context_print(act->context, f, " ");
grib_expression_print(act->context, self->expression, 0);
printf("\n");
// int i = 0;
// grib_action_assert* self = (grib_action_assert*)act;
// for (i = 0; i < lvl; i++)
// grib_context_print(act->context, f, " ");
// grib_expression_print(act->context, self->expression, 0);
// printf("\n");
}
static void destroy(grib_context* context, grib_action* act)

View File

@ -92,7 +92,7 @@ static void init_class(grib_action_class* c)
grib_action* grib_action_create_if(grib_context* context,
grib_expression* expression,
grib_action* block_true, grib_action* block_false, int transient,
int lineno, char* file_being_parsed)
int lineno, const char* file_being_parsed)
{
char name[1024];
const size_t nameLen = sizeof(name);

View File

@ -8,133 +8,12 @@
* virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
*/
/***************************************************************************
* Jean Baptiste Filippi - 01.11.2005 *
***************************************************************************/
#include "grib_api_internal.h"
/*
This is used by make_class.pl
START_CLASS_DEF
CLASS = action
IMPLEMENTS = create_accessor
IMPLEMENTS = dump
IMPLEMENTS = destroy
MEMBERS = grib_arguments* args
END_CLASS_DEF
*/
/* START_CLASS_IMP */
/*
Don't edit anything between START_CLASS_IMP and END_CLASS_IMP
Instead edit values between START_CLASS_DEF and END_CLASS_DEF
or edit "action.class" and rerun ./make_class.pl
*/
static void init_class (grib_action_class*);
static void dump (grib_action* d, FILE*,int);
static void destroy (grib_context*,grib_action*);
static int create_accessor(grib_section*,grib_action*,grib_loader*);
typedef struct grib_action_put {
grib_action act;
/* Members defined in put */
grib_arguments* args;
} grib_action_put;
static grib_action_class _grib_action_class_put = {
0, /* super */
"action_class_put", /* name */
sizeof(grib_action_put), /* size */
0, /* inited */
&init_class, /* init_class */
0, /* init */
&destroy, /* destroy */
&dump, /* dump */
0, /* xref */
&create_accessor, /* create_accessor*/
0, /* notify_change */
0, /* reparse */
0, /* execute */
};
grib_action_class* grib_action_class_put = &_grib_action_class_put;
static void init_class(grib_action_class* c)
{
}
/* END_CLASS_IMP */
// No longer used: For the original intent see
// src/deprecated/action_class_put.cc
grib_action* grib_action_create_put(grib_context* context, const char* name, grib_arguments* args)
{
grib_action_put* a = NULL;
grib_action_class* c = grib_action_class_put;
grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context, c->size);
act->next = NULL;
act->name = grib_context_strdup_persistent(context, name);
act->op = grib_context_strdup_persistent(context, "forward");
act->cclass = c;
act->context = context;
a = (grib_action_put*)act;
a->args = args;
return act;
}
static int create_accessor(grib_section* p, grib_action* act, grib_loader* h)
{
grib_action_put* a = (grib_action_put*)act;
grib_section* ts = NULL;
grib_accessor* ga = NULL;
ga = grib_find_accessor(p->h, grib_arguments_get_name(p->h, a->args, 1));
if (ga)
ts = ga->sub_section;
/* ts = grib_get_sub_section(ga); */
else
return GRIB_BUFFER_TOO_SMALL;
if (ts) {
ga = grib_accessor_factory(ts, act, 0, a->args);
if (ga)
grib_push_accessor(ga, ts->block);
else
return GRIB_BUFFER_TOO_SMALL;
}
else {
grib_context_log(act->context, GRIB_LOG_ERROR, "Action_class_put : create_accessor_buffer : No Section named %s to export %s ", grib_arguments_get_name(p->h, a->args, 1), grib_arguments_get_name(p->h, a->args, 0));
}
return GRIB_SUCCESS;
}
static void dump(grib_action* act, FILE* f, int lvl)
{
grib_action_put* a = (grib_action_put*)act;
int i = 0;
for (i = 0; i < lvl; i++)
grib_context_print(act->context, f, " ");
grib_context_print(act->context, f, "put %s as %s in %s\n", grib_arguments_get_name(0, a->args, 0), act->name, grib_arguments_get_name(0, a->args, 1));
}
static void destroy(grib_context* context, grib_action* act)
{
grib_action_put* a = (grib_action_put*)act;
grib_arguments_free(context, a->args);
grib_context_free_persistent(context, act->name);
grib_context_free_persistent(context, act->op);
grib_context_log(context, GRIB_LOG_ERROR, "The 'export' statement is deprecated");
return NULL;
}

View File

@ -10,8 +10,10 @@
#include "grib_api_internal.h"
// No longer used: For the original intent see
// src/deprecated/action_class_trigger.cc
grib_action* grib_action_create_trigger(grib_context* context, grib_arguments* args, grib_action* block)
{
grib_context_log(context, GRIB_LOG_FATAL, "The 'trigger' statement is deprecated");
grib_context_log(context, GRIB_LOG_ERROR, "The 'trigger' statement is deprecated");
return NULL;
}

View File

@ -14,6 +14,6 @@
// src/deprecated/action_class_while.cc
grib_action* grib_action_create_while(grib_context* context, grib_expression* expression, grib_action* block)
{
grib_context_log(context, GRIB_LOG_FATAL, "The 'while' statement is deprecated");
grib_context_log(context, GRIB_LOG_ERROR, "The 'while' statement is deprecated");
return NULL;
}

View File

@ -103,7 +103,7 @@ static int execute(grib_action* act, grib_handle* h)
{
grib_action_write* a = (grib_action_write*)act;
int err = GRIB_SUCCESS;
size_t size;
size_t size = 0;
const void* buffer = NULL;
const char* filename = NULL;
char string[1024] = {0,};
@ -116,13 +116,13 @@ static int execute(grib_action* act, grib_handle* h)
}
if (strlen(a->name) != 0) {
err = grib_recompose_name(h, NULL, a->name, string, 0);
err = grib_recompose_name(h, NULL, a->name, string, 0);
filename = string;
}
else {
if (act->context->outfilename) {
filename = act->context->outfilename;
err = grib_recompose_name(h, NULL, act->context->outfilename, string, 0);
err = grib_recompose_name(h, NULL, act->context->outfilename, string, 0);
if (!err)
filename = string;
}
@ -159,14 +159,16 @@ static int execute(grib_action* act, grib_handle* h)
if (a->padtomultiple) {
char* zeros = NULL;
if (a->padtomultiple < 0)
return GRIB_INVALID_ARGUMENT;
size_t padding = a->padtomultiple - size % a->padtomultiple;
/* printf("XXX padding=%d size=%d padtomultiple=%d\n",padding,size,a->padtomultiple); */
/* printf("XXX padding=%zu size=%zu padtomultiple=%d\n", padding, size,a->padtomultiple); */
zeros = (char*)calloc(padding, 1);
if (!zeros)
return GRIB_OUT_OF_MEMORY;
if (fwrite(zeros, 1, padding, of->handle) != padding) {
grib_context_log(act->context, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR),
"Error writing to %s", filename);
"Error writing to '%s'", filename);
free(zeros);
return GRIB_IO_PROBLEM;
}
@ -174,10 +176,10 @@ static int execute(grib_action* act, grib_handle* h)
}
if (h->gts_header) {
char gts_trailer[4] = { '\x0D', '\x0D', '\x0A', '\x03' };
const char gts_trailer[4] = { '\x0D', '\x0D', '\x0A', '\x03' };
if (fwrite(gts_trailer, 1, 4, of->handle) != 4) {
grib_context_log(act->context, (GRIB_LOG_ERROR) | (GRIB_LOG_PERROR),
"Error writing GTS trailer to %s", filename);
"Error writing GTS trailer to '%s'", filename);
return GRIB_IO_PROBLEM;
}
}

View File

@ -199,7 +199,7 @@ char* codes_bufr_keys_iterator_get_name(const bufr_keys_iterator* ckiter)
bufr_keys_iterator* kiter = (bufr_keys_iterator*)ckiter;
int* r = 0;
char* ret = 0;
grib_context* c = kiter->handle->context;
const grib_context* c = kiter->handle->context;
DEBUG_ASSERT(kiter->current);
if (kiter->prefix) {
@ -236,7 +236,7 @@ grib_accessor* codes_bufr_keys_iterator_get_accessor(bufr_keys_iterator* kiter)
int codes_bufr_keys_iterator_delete(bufr_keys_iterator* kiter)
{
if (kiter) {
grib_context* c = kiter->handle->context;
const grib_context* c = kiter->handle->context;
kiter->key_name = NULL;
if (kiter->seen)
grib_trie_delete(kiter->seen);

View File

@ -18,7 +18,7 @@ int compute_bufr_key_rank(grib_handle* h, grib_string_list* keys, const char* ke
grib_string_list* prev = keys;
int theRank = 0;
size_t size = 0;
grib_context* c = h->context;
const grib_context* c = h->context;
DEBUG_ASSERT(h->product_kind == PRODUCT_BUFR);
while (next && next->value && strcmp(next->value, key)) {
@ -1114,7 +1114,7 @@ int codes_bufr_header_get_string(codes_bufr_header* bh, const char* key, char* v
// Returns 1 if the BUFR key is in the header and 0 if it is in the data section
int codes_bufr_key_is_header(const grib_handle* h, const char* key, int* err)
{
grib_accessor* acc = grib_find_accessor(h, key);
const grib_accessor* acc = grib_find_accessor(h, key);
if (!acc) {
*err = GRIB_NOT_FOUND;
return 0;
@ -1126,7 +1126,7 @@ int codes_bufr_key_is_header(const grib_handle* h, const char* key, int* err)
// Returns 1 if the BUFR key is a coordinate descriptor
int codes_bufr_key_is_coordinate(const grib_handle* h, const char* key, int* err)
{
grib_accessor* acc = grib_find_accessor(h, key);
const grib_accessor* acc = grib_find_accessor(h, key);
if (!acc) {
*err = GRIB_NOT_FOUND;
return 0;

View File

@ -133,7 +133,7 @@ char* codes_getenv(const char* name)
int codes_check_grib_ieee_packing_value(int value)
{
grib_context* c = grib_context_get_default();
const grib_context* c = grib_context_get_default();
if (value != 32 && value != 64) {
grib_context_log(c, GRIB_LOG_ERROR, "Invalid value for ECCODES_GRIB_IEEE_PACKING: should be 32 or 64");
return GRIB_INVALID_ARGUMENT;
@ -146,7 +146,7 @@ int codes_flush_sync_close_file(FILE* f)
{
int err = 0;
int fd = 0;
grib_context* c = grib_context_get_default();
const grib_context* c = grib_context_get_default();
Assert(f);
fd = fileno(f);

View File

@ -0,0 +1,140 @@
/*
* (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.
*/
/***************************************************************************
* Jean Baptiste Filippi - 01.11.2005 *
***************************************************************************/
#include "grib_api_internal.h"
/*
This is used by make_class.pl
START_CLASS_DEF
CLASS = action
IMPLEMENTS = create_accessor
IMPLEMENTS = dump
IMPLEMENTS = destroy
MEMBERS = grib_arguments* args
END_CLASS_DEF
*/
/* START_CLASS_IMP */
/*
Don't edit anything between START_CLASS_IMP and END_CLASS_IMP
Instead edit values between START_CLASS_DEF and END_CLASS_DEF
or edit "action.class" and rerun ./make_class.pl
*/
static void init_class (grib_action_class*);
static void dump (grib_action* d, FILE*,int);
static void destroy (grib_context*,grib_action*);
static int create_accessor(grib_section*,grib_action*,grib_loader*);
typedef struct grib_action_put {
grib_action act;
/* Members defined in put */
grib_arguments* args;
} grib_action_put;
static grib_action_class _grib_action_class_put = {
0, /* super */
"action_class_put", /* name */
sizeof(grib_action_put), /* size */
0, /* inited */
&init_class, /* init_class */
0, /* init */
&destroy, /* destroy */
&dump, /* dump */
0, /* xref */
&create_accessor, /* create_accessor*/
0, /* notify_change */
0, /* reparse */
0, /* execute */
};
grib_action_class* grib_action_class_put = &_grib_action_class_put;
static void init_class(grib_action_class* c)
{
}
/* END_CLASS_IMP */
grib_action* grib_action_create_put(grib_context* context, const char* name, grib_arguments* args)
{
grib_action_put* a = NULL;
grib_action_class* c = grib_action_class_put;
grib_action* act = (grib_action*)grib_context_malloc_clear_persistent(context, c->size);
act->next = NULL;
act->name = grib_context_strdup_persistent(context, name);
act->op = grib_context_strdup_persistent(context, "forward");
act->cclass = c;
act->context = context;
a = (grib_action_put*)act;
a->args = args;
return act;
}
static int create_accessor(grib_section* p, grib_action* act, grib_loader* h)
{
grib_action_put* a = (grib_action_put*)act;
grib_section* ts = NULL;
grib_accessor* ga = NULL;
ga = grib_find_accessor(p->h, grib_arguments_get_name(p->h, a->args, 1));
if (ga)
ts = ga->sub_section;
/* ts = grib_get_sub_section(ga); */
else
return GRIB_BUFFER_TOO_SMALL;
if (ts) {
ga = grib_accessor_factory(ts, act, 0, a->args);
if (ga)
grib_push_accessor(ga, ts->block);
else
return GRIB_BUFFER_TOO_SMALL;
}
else {
grib_context_log(act->context, GRIB_LOG_ERROR, "Action_class_put : create_accessor_buffer : No Section named %s to export %s ", grib_arguments_get_name(p->h, a->args, 1), grib_arguments_get_name(p->h, a->args, 0));
}
return GRIB_SUCCESS;
}
static void dump(grib_action* act, FILE* f, int lvl)
{
grib_action_put* a = (grib_action_put*)act;
int i = 0;
for (i = 0; i < lvl; i++)
grib_context_print(act->context, f, " ");
grib_context_print(act->context, f, "put %s as %s in %s\n", grib_arguments_get_name(0, a->args, 0), act->name, grib_arguments_get_name(0, a->args, 1));
}
static void destroy(grib_context* context, grib_action* act)
{
grib_action_put* a = (grib_action_put*)act;
grib_arguments_free(context, a->args);
grib_context_free_persistent(context, act->name);
grib_context_free_persistent(context, act->op);
}

View File

@ -20,7 +20,7 @@ grib_action* grib_action_create_alias(grib_context* context, const char* name, c
grib_action* grib_action_create_gen(grib_context* context, const char* name, const char* op, const long len, grib_arguments* params, grib_arguments* default_value, int flags, const char* name_space, const char* set);
/* action_class_if.cc */
grib_action* grib_action_create_if(grib_context* context, grib_expression* expression, grib_action* block_true, grib_action* block_false, int transient, int lineno, char* file_being_parsed);
grib_action* grib_action_create_if(grib_context* context, grib_expression* expression, grib_action* block_true, grib_action* block_false, int transient, int lineno, const char* file_being_parsed);
/* action_class_switch.cc */
grib_action* grib_action_create_switch(grib_context* context, grib_arguments* args, grib_case* Case, grib_action* Default);
@ -635,19 +635,6 @@ grib_action* grib_action_create_set_missing(grib_context* context, const char* n
/* grib_index.cc*/
int grib_index_compress(grib_index* index);
int grib_read_uchar(FILE* fh, unsigned char* val);
int grib_read_short(FILE* fh, short* val);
int grib_read_long(FILE* fh, long* val);
int grib_read_unsigned_long(FILE* fh, unsigned long* val);
int grib_write_uchar(FILE* fh, unsigned char val);
int grib_write_short(FILE* fh, short val);
int grib_write_long(FILE* fh, long val);
int grib_write_unsigned_long(FILE* fh, unsigned long val);
int grib_write_string(FILE* fh, const char* s);
int grib_write_identifier(FILE* fh, const char* id);
int grib_write_null_marker(FILE* fh);
int grib_write_not_null_marker(FILE* fh);
char* grib_read_string(grib_context* c, FILE* fh, int* err);
grib_field_tree* grib_read_field_tree(grib_context* c, FILE* fh, grib_file** files, int* err);
grib_index* grib_index_new(grib_context* c, const char* key, int* err);
void grib_index_delete(grib_index* index);
@ -1200,7 +1187,7 @@ int grib_get_long_array(const grib_handle* h, const char* name, long* val, size_
int grib_get_values(grib_handle* h, grib_values* args, size_t count);
int grib_set_values(grib_handle* h, grib_values* args, size_t count);
int grib_get_nearest_smaller_value(grib_handle* h, const char* name, double val, double* nearest);
void grib_print_values(const char* title, grib_values* values);
void grib_print_values(const char* title, grib_values* values, FILE* out);
int grib_values_check(grib_handle* h, grib_values* values, int count);
int grib_key_equal(const grib_handle* h1, const grib_handle* h2, const char* key, int type, int* err);
int codes_copy_key(grib_handle* h1, grib_handle* h2, const char* key, int type);

View File

@ -193,7 +193,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len)
long tlen = 0;
long i = 0;
int err = 0;
grib_handle* hand = grib_handle_of_accessor(a);
const grib_handle* hand = grib_handle_of_accessor(a);
err = grib_value_count(a, &tlen);
if (err)

View File

@ -254,7 +254,7 @@ static size_t get_length(grib_accessor* a)
grib_accessor_bufr_data_array* self = (grib_accessor_bufr_data_array*)a;
size_t len = 0;
grib_handle* h = grib_handle_of_accessor(a);
const grib_handle* h = grib_handle_of_accessor(a);
grib_get_size(h, self->bufrDataEncodedName, &len);
@ -2427,7 +2427,7 @@ static int create_keys(const grib_accessor* a, long onlySubset, long startSubset
bufr_descriptor* descriptor;
/*grib_section* sectionUp=0;*/
grib_section* groupSection = 0;
long groupNumber = 0;
// long groupNumber = 0;
/*long indexOfGroupNumber=0;*/
int depth;
int max_depth = -1; /* highest value of depth */
@ -2481,7 +2481,7 @@ static int create_keys(const grib_accessor* a, long onlySubset, long startSubset
self->tempStrings = self->numberOfSubsets? grib_sarray_new(c, self->numberOfSubsets, 500) : NULL;
end = self->compressedData ? 1 : self->numberOfSubsets;
groupNumber = 1;
// groupNumber = 1;
gaGroup = grib_accessor_factory(self->dataKeys, &creatorGroup, 0, NULL);
//gaGroup->bufr_group_number = groupNumber;
@ -2525,7 +2525,7 @@ static int create_keys(const grib_accessor* a, long onlySubset, long startSubset
self->unpackMode == CODES_BUFR_UNPACK_STRUCTURE) {
const int sidx = descriptor->Y + significanceQualifierIndexArray[descriptor->X] * NUMBER_OF_QUALIFIERS_PER_CATEGORY;
DEBUG_ASSERT(sidx > 0);
groupNumber++;
// groupNumber++;
add_coord_flag = 1;
if (significanceQualifierGroup[sidx]) {
@ -2569,7 +2569,7 @@ static int create_keys(const grib_accessor* a, long onlySubset, long startSubset
else if (descriptor->code == 31031 && incrementBitmapIndex != 0) {
/* bitmap */
bitmapIndex++;
groupNumber++;
// groupNumber++;
incrementBitmapIndex = 0;
if (bitmapIndex >= MAX_NUMBER_OF_BITMAPS) {
//grib_context_log(c, GRIB_LOG_ERROR, "Bitmap error: bitmap index=%d, max num bitmaps=%d\n", bitmapIndex, MAX_NUMBER_OF_BITMAPS);

View File

@ -132,19 +132,18 @@ grib_accessor_class* grib_accessor_class_data_dummy_field = &_grib_accessor_clas
static void init(grib_accessor* a, const long v, grib_arguments* args)
{
grib_accessor_data_dummy_field* self = (grib_accessor_data_dummy_field*)a;
self->missing_value = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++);
self->numberOfPoints = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++);
self->bitmap = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++);
self->missing_value = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++);
self->numberOfPoints = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++);
self->bitmap = grib_arguments_get_name(grib_handle_of_accessor(a), args, self->carg++);
}
static int unpack_double(grib_accessor* a, double* val, size_t* len)
{
grib_accessor_data_dummy_field* self = (grib_accessor_data_dummy_field*)a;
size_t i = 0;
size_t n_vals = 0;
size_t i = 0, n_vals = 0;
long numberOfPoints;
double missing_value = 0;
int err = 0;
int err = 0;
if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfPoints, &numberOfPoints)) != GRIB_SUCCESS)
return err;
@ -174,15 +173,11 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len)
{
grib_accessor_data_dummy_field* self = (grib_accessor_data_dummy_field*)a;
size_t n_vals = *len;
int err = 0;
long bits_per_value = 0;
long half_byte = 0;
size_t buflen = 0;
size_t buflen = 0;
unsigned char* buf = NULL;
if (*len == 0)
@ -213,8 +208,8 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len)
static int value_count(grib_accessor* a, long* numberOfPoints)
{
grib_accessor_data_dummy_field* self = (grib_accessor_data_dummy_field*)a;
int err = 0;
*numberOfPoints = 0;
int err = 0;
*numberOfPoints = 0;
if ((err = grib_get_long_internal(grib_handle_of_accessor(a), self->numberOfPoints, numberOfPoints)) != GRIB_SUCCESS) {
grib_context_log(a->context, GRIB_LOG_ERROR, "Unable to get count of %s (%s)", a->name, grib_get_error_message(err));

View File

@ -359,7 +359,8 @@ static int unpack(grib_accessor* a, double* dvalues, float* fvalues, size_t* len
double reference_value;
long binary_scale_factor;
long decimal_scale_factor;
long j, count = 0;
long j;
// long count = 0;
long *groupWidths = NULL, *groupLengths = NULL;
long orderOfSPD = 0;
long* SPD = 0;
@ -456,7 +457,7 @@ static int unpack(grib_accessor* a, double* dvalues, float* fvalues, size_t* len
&X[n]);
for (j = 0; j < groupLengths[i]; j++) {
X[n] += firstOrderValues[i];
count++;
// count++;
n++;
}
@ -1350,10 +1351,10 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len)
/* ECC-259: Set correct number of values */
ret = grib_set_long_internal(a->parent->h, self->number_of_values, *len);
if (ret)
return ret;
if (ret) return ret;
grib_buffer_replace(a, buffer, size, 1, 1);
ret = grib_buffer_replace(a, buffer, size, 1, 1);
if (ret) return ret;
grib_context_free(a->context, buffer);
grib_context_free(a->context, X);

View File

@ -236,7 +236,8 @@ static int pack_double(grib_accessor* a, const double* cval, size_t* len)
constantFieldHalfByte = 0;
if ((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->half_byte, constantFieldHalfByte)) != GRIB_SUCCESS)
return ret;
grib_buffer_replace(a, NULL, 0, 1, 1);
ret = grib_buffer_replace(a, NULL, 0, 1, 1);
if (ret != GRIB_SUCCESS) return ret;
return GRIB_SUCCESS;
break;
case GRIB_NO_VALUES:
@ -252,7 +253,8 @@ static int pack_double(grib_accessor* a, const double* cval, size_t* len)
return ret;
if ((ret = grib_set_long_internal(grib_handle_of_accessor(a), self->half_byte, constantFieldHalfByte)) != GRIB_SUCCESS)
return ret;
grib_buffer_replace(a, NULL, 0, 1, 1);
ret = grib_buffer_replace(a, NULL, 0, 1, 1);
if (ret != GRIB_SUCCESS) return ret;
return GRIB_SUCCESS;
break;
case GRIB_INVALID_BPV:

View File

@ -126,7 +126,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len)
long primary_len = 0, secondary_len = 0;
double* primary_bitmap = NULL;
double* secondary_bitmap = NULL;
long i = 0, j = 0, on = 0, k = 0, m = 0;
long i = 0, j = 0, k = 0, m = 0;
double missing_value = 0, present_value = 0;
long expand_by = 0;
@ -177,7 +177,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len)
primary_bitmap[k++] = present_value;
for (j = 0; j < expand_by; j++)
secondary_bitmap[m++] = val[i + j];
on++;
//on++;
}
}

View File

@ -204,7 +204,8 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len)
size_t i = 0;
int ret = GRIB_SUCCESS;
long hcount = 0, lcount = 0, hpos = 0, lup = 0, mmax = 0, n_vals = 0;
// long lup = 0;
long hcount = 0, lcount = 0, hpos = 0, mmax = 0, n_vals = 0;
double* scals = NULL;
/* double *pscals=NULL; */
@ -330,12 +331,12 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len)
i = 0;
while (maxv > 0) {
lup = mmax;
// lup = mmax;
if (sub_k >= 0) {
for (hcount = 0; hcount < sub_k + 1; hcount++) {
decode_float(grib_decode_unsigned_long(hres, &hpos, 8 * bytes));
decode_float(grib_decode_unsigned_long(hres, &hpos, 8 * bytes));
lup++;
// lup++;
}
sub_k--;
}
@ -352,7 +353,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len)
reference_value);
if (mmax == 0)
val[i - 1] = 0;
lup++;
// lup++;
}
maxv--;

View File

@ -106,7 +106,7 @@ grib_accessor_class* grib_accessor_class_g1_message_length = &_grib_accessor_cla
static void init(grib_accessor* a, const long len, grib_arguments* args)
{
grib_accessor_g1_message_length* self = (grib_accessor_g1_message_length*)a;
self->sec4_length = grib_arguments_get_name(grib_handle_of_accessor(a), args, 0);
self->sec4_length = grib_arguments_get_name(grib_handle_of_accessor(a), args, 0);
}
int grib_get_g1_message_size(grib_handle* h, grib_accessor* tl, grib_accessor* s4,
@ -134,15 +134,12 @@ int grib_get_g1_message_size(grib_handle* h, grib_accessor* tl, grib_accessor* s
if (slen < 120 && (tlen & 0x800000)) {
/* printf("DECODING large grib tlen=%ld slen=%ld\n",tlen,slen); */
tlen &= 0x7fffff;
tlen *= 120;
tlen -= slen;
tlen += 4;
slen = tlen - s4->offset - 4; /* 4 is for 7777 */
/*printf("DECODING large grib total=%ld section4=%ld\n",tlen,slen);*/
}
*total_length = tlen;
@ -184,7 +181,6 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len)
slen = t120 * 120 - tlen;
tlen = 0x800000 | t120;
/* printf("ENCODING large grib total = %ld tlen=%ld slen=%ld \n",*val,tlen,slen); */
*len = 1;
if ((ret = grib_pack_long(s4, &slen, len)) != GRIB_SUCCESS)
return ret;
@ -198,11 +194,9 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len)
{
long total_length = -1, sec4_length = -1;
grib_get_g1_message_size(grib_handle_of_accessor(a),
a,
grib_get_g1_message_size(grib_handle_of_accessor(a), a,
grib_find_accessor(grib_handle_of_accessor(a), self->sec4_length),
&total_length,
&sec4_length);
&total_length, &sec4_length);
if (total_length != *val) {
const char* cclass_name = a->cclass->name;
grib_context_log(a->context, GRIB_LOG_ERROR,
@ -212,7 +206,6 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len)
grib_context_log(a->context, GRIB_LOG_ERROR, "Hint: Try encoding as GRIB2\n");
return GRIB_ENCODING_ERROR;
}
Assert(total_length == *val);
}
return GRIB_SUCCESS;
@ -222,16 +215,14 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len)
{
grib_accessor_g1_message_length* self = (grib_accessor_g1_message_length*)a;
int ret;
long total_length, sec4_length;
if ((ret = grib_get_g1_message_size(grib_handle_of_accessor(a),
a,
if ((ret = grib_get_g1_message_size(grib_handle_of_accessor(a), a,
grib_find_accessor(grib_handle_of_accessor(a), self->sec4_length),
&total_length,
&sec4_length)) != GRIB_SUCCESS)
&total_length, &sec4_length)) != GRIB_SUCCESS)
{
return ret;
}
*val = total_length;
return GRIB_SUCCESS;

View File

@ -125,7 +125,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len)
size_t i;
int err = 0;
long pos = 0;
long bmaplen = 0;
//long bmaplen = 0;
const int bit_padding = 16;
double miss_values = 0;
tlen = ((*len + bit_padding - 1) / bit_padding * bit_padding) / 8;
@ -141,7 +141,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len)
if (val[i] == miss_values)
pos++;
else {
bmaplen++;
//bmaplen++;
grib_set_bit_on(buf, &pos);
}
}

View File

@ -134,7 +134,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len)
size_t i;
int err = 0;
long pos = 0;
long bmaplen = 0;
// long bmaplen = 0;
double miss_values = 0;
tlen = (*len + 7) / 8;
@ -149,7 +149,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len)
if (val[i] == miss_values)
pos++;
else {
bmaplen++;
// bmaplen++;
grib_set_bit_on(buf, &pos);
}
}

View File

@ -131,7 +131,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len)
size_t size = 0;
int ret = 0, i = 0;
grib_accessor_scale_values* self = (grib_accessor_scale_values*)a;
grib_context* c = a->context;
const grib_context* c = a->context;
grib_handle* h = grib_handle_of_accessor(a);
if (*val == 1)

View File

@ -159,6 +159,8 @@ static void dump(grib_accessor* a, grib_dumper* dumper)
static int unpack_long(grib_accessor* a, long* val, size_t* len)
{
return GRIB_NOT_IMPLEMENTED;
#if 0
grib_accessor_signed_bits* self = (grib_accessor_signed_bits*)a;
int i;
int ret = 0;
@ -193,10 +195,13 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len)
*len = rlen;
return GRIB_SUCCESS;
#endif
}
static int pack_long(grib_accessor* a, const long* val, size_t* len)
{
return GRIB_NOT_IMPLEMENTED;
#if 0
grib_accessor_signed_bits* self = (grib_accessor_signed_bits*)a;
int ret = 0;
long off = 0;
@ -232,6 +237,7 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len)
grib_context_free(a->context, buf);
return ret;
#endif
}
static int value_count(grib_accessor* a, long* numberOfElements)

View File

@ -284,7 +284,8 @@ static int grib_load_smart_table(grib_context* c, const char* filename,
{
char line[1024] = {0,};
FILE* f = NULL;
int lineNumber, numberOfColumns, code;
// int lineNumber;
int numberOfColumns, code;
grib_context_log(c, GRIB_LOG_DEBUG, "Loading code table from %s", filename);
@ -313,14 +314,14 @@ static int grib_load_smart_table(grib_context* c, const char* filename,
t->recomposed_name[2] = grib_context_strdup_persistent(c, recomposed_name);
}
lineNumber = 0;
// lineNumber = 0;
while (fgets(line, sizeof(line) - 1, f)) {
char* s = line;
char* p;
line[strlen(line) - 1] = 0;
++lineNumber;
// ++lineNumber;
while (*s != '\0' && isspace(*s))
s++;

View File

@ -173,22 +173,23 @@ static int evaluate_long(grib_expression* g, grib_handle* h, long* result)
static int evaluate_double(grib_expression* g, grib_handle* h, double* result)
{
grib_expression_is_in_list* e = (grib_expression_is_in_list*)g;
int err = 0;
char mybuf[1024] = {0,};
size_t size = 1024;
return GRIB_NOT_IMPLEMENTED;
// grib_expression_is_in_list* e = (grib_expression_is_in_list*)g;
// int err = 0;
// char mybuf[1024] = {0,};
// size_t size = 1024;
grib_trie* list = load_list(h->context, g, &err);
// grib_trie* list = load_list(h->context, g, &err);
if ((err = grib_get_string_internal(h, e->name, mybuf, &size)) != GRIB_SUCCESS)
return err;
// if ((err = grib_get_string_internal(h, e->name, mybuf, &size)) != GRIB_SUCCESS)
// return err;
if (grib_trie_get(list, mybuf))
*result = 1;
else
*result = 0;
// if (grib_trie_get(list, mybuf))
// *result = 1;
// else
// *result = 0;
return err;
// return err;
}
static string evaluate_string(grib_expression* g, grib_handle* h, char* buf, size_t* size, int* err)

View File

@ -155,14 +155,14 @@ static string evaluate_string(grib_expression* g, grib_handle* h, char* buf, siz
static void print(grib_context* c, grib_expression* g, grib_handle* f)
{
grib_expression_is_integer* e = (grib_expression_is_integer*)g;
printf("access('%s", e->name);
if (f) {
long s = 0;
grib_get_long(f, e->name, &s);
printf("=%ld", s);
}
printf("')");
// grib_expression_is_integer* e = (grib_expression_is_integer*)g;
// printf("access('%s", e->name);
// if (f) {
// long s = 0;
// grib_get_long(f, e->name, &s);
// printf("=%ld", s);
// }
// printf("')");
}
static void destroy(grib_context* c, grib_expression* g)

View File

@ -597,7 +597,8 @@ static grib_handle* grib_handle_new_multi(grib_context* c, unsigned char** data,
long edition = 0;
size_t seclen = 0;
unsigned char* secbegin = 0;
int secnum = 0, seccount = 0;
int secnum = 0;
// int seccount = 0;
int err = 0, i = 0;
grib_multi_support* gm = NULL;
@ -631,9 +632,9 @@ static grib_handle* grib_handle_new_multi(grib_context* c, unsigned char** data,
secbegin = gm->sections[gm->section_number];
seclen = gm->sections_length[gm->section_number];
secnum = gm->section_number;
seccount = 0;
// seccount = 0;
while (grib2_get_next_section((unsigned char*)message, olen, &secbegin, &seclen, &secnum, &err)) {
seccount++;
// seccount++;
/*printf(" - %d - section %d length=%d\n",(int)seccount,(int)secnum,(int)seclen);*/
gm->sections[secnum] = secbegin;
@ -716,7 +717,8 @@ static grib_handle* grib_handle_new_from_file_multi(grib_context* c, FILE* f, in
long edition = 0;
size_t seclen = 0;
unsigned char* secbegin = 0;
int secnum = 0, seccount = 0;
int secnum = 0;
// int seccount = 0;
int err = 0, i = 0;
grib_multi_support* gm = NULL;
off_t gts_header_offset = 0;
@ -784,9 +786,9 @@ static grib_handle* grib_handle_new_from_file_multi(grib_context* c, FILE* f, in
secbegin = gm->sections[gm->section_number];
seclen = gm->sections_length[gm->section_number];
secnum = gm->section_number;
seccount = 0;
// seccount = 0;
while (grib2_get_next_section((unsigned char*)data, olen, &secbegin, &seclen, &secnum, &err)) {
seccount++;
// seccount++;
/*printf(" - %d - section %d length=%d\n",(int)seccount,(int)secnum,(int)seclen);*/
gm->sections[secnum] = secbegin;

View File

@ -274,7 +274,7 @@ static grib_index_key* grib_index_new_key(grib_context* c, grib_index_key* keys,
return keys;
}
int grib_read_uchar(FILE* fh, unsigned char* val)
static int grib_read_uchar(FILE* fh, unsigned char* val)
{
if (fread(val, sizeof(unsigned char), 1, fh) < 1) {
if (feof(fh))
@ -285,7 +285,7 @@ int grib_read_uchar(FILE* fh, unsigned char* val)
return GRIB_SUCCESS;
}
int grib_read_short(FILE* fh, short* val)
static int grib_read_short(FILE* fh, short* val)
{
if (fread(val, sizeof(short), 1, fh) < 1) {
if (feof(fh))
@ -296,7 +296,18 @@ int grib_read_short(FILE* fh, short* val)
return GRIB_SUCCESS;
}
int grib_read_long(FILE* fh, long* val)
// static int grib_read_long(FILE* fh, long* val)
// {
// if (fread(val, sizeof(long), 1, fh) < 1) {
// if (feof(fh))
// return GRIB_END_OF_FILE;
// else
// return GRIB_IO_PROBLEM;
// }
// return GRIB_SUCCESS;
// }
static int grib_read_unsigned_long(FILE* fh, unsigned long* val)
{
if (fread(val, sizeof(long), 1, fh) < 1) {
if (feof(fh))
@ -307,46 +318,35 @@ int grib_read_long(FILE* fh, long* val)
return GRIB_SUCCESS;
}
int grib_read_unsigned_long(FILE* fh, unsigned long* val)
{
if (fread(val, sizeof(long), 1, fh) < 1) {
if (feof(fh))
return GRIB_END_OF_FILE;
else
return GRIB_IO_PROBLEM;
}
return GRIB_SUCCESS;
}
int grib_write_uchar(FILE* fh, unsigned char val)
static int grib_write_uchar(FILE* fh, unsigned char val)
{
if (fwrite(&val, sizeof(unsigned char), 1, fh) < 1)
return GRIB_IO_PROBLEM;
return GRIB_SUCCESS;
}
int grib_write_short(FILE* fh, short val)
static int grib_write_short(FILE* fh, short val)
{
if (fwrite(&val, sizeof(short), 1, fh) < 1)
return GRIB_IO_PROBLEM;
return GRIB_SUCCESS;
}
int grib_write_long(FILE* fh, long val)
// static int grib_write_long(FILE* fh, long val)
// {
// if (fwrite(&val, sizeof(long), 1, fh) < 1)
// return GRIB_IO_PROBLEM;
// return GRIB_SUCCESS;
// }
static int grib_write_unsigned_long(FILE* fh, unsigned long val)
{
if (fwrite(&val, sizeof(long), 1, fh) < 1)
return GRIB_IO_PROBLEM;
return GRIB_SUCCESS;
}
int grib_write_unsigned_long(FILE* fh, unsigned long val)
{
if (fwrite(&val, sizeof(long), 1, fh) < 1)
return GRIB_IO_PROBLEM;
return GRIB_SUCCESS;
}
int grib_write_string(FILE* fh, const char* s)
static int grib_write_string(FILE* fh, const char* s)
{
size_t len = 0;
if (s == NULL)
@ -358,22 +358,22 @@ int grib_write_string(FILE* fh, const char* s)
return GRIB_SUCCESS;
}
int grib_write_identifier(FILE* fh, const char* ID)
static int grib_write_identifier(FILE* fh, const char* ID)
{
return grib_write_string(fh, ID);
}
int grib_write_null_marker(FILE* fh)
static int grib_write_null_marker(FILE* fh)
{
return grib_write_uchar(fh, NULL_MARKER);
}
int grib_write_not_null_marker(FILE* fh)
static int grib_write_not_null_marker(FILE* fh)
{
return grib_write_uchar(fh, NOT_NULL_MARKER);
}
char* grib_read_string(grib_context* c, FILE* fh, int* err)
static char* grib_read_string(grib_context* c, FILE* fh, int* err)
{
unsigned char len = 0;
char* s = NULL;

View File

@ -131,6 +131,11 @@ int grib_set_long(grib_handle* h, const char* name, long val)
return ret;
}
if (h->context->debug) {
fprintf(stderr, "ECCODES DEBUG grib_set_long %s=%ld (Key not found)\n", name, val);
}
return GRIB_NOT_FOUND;
}
@ -476,6 +481,11 @@ int grib_set_string(grib_handle* h, const char* name, const char* val, size_t* l
}
return ret;
}
if (h->context->debug) {
fprintf(stderr, "ECCODES DEBUG grib_set_string %s=|%s| (Key not found)\n", name, val);
}
return GRIB_NOT_FOUND;
}
@ -1769,6 +1779,12 @@ int grib_set_values(grib_handle* h, grib_values* args, size_t count)
for (i = 0; i < count; i++)
args[i].error = GRIB_NOT_FOUND;
if (h->context->debug) {
for (i = 0; i < count; i++) {
grib_print_values("ECCODES DEBUG set key/value pairs", &args[i], stderr);
}
}
while (more) {
more = 0;
for (i = 0; i < count; i++) {
@ -1839,23 +1855,22 @@ int grib_get_nearest_smaller_value(grib_handle* h, const char* name,
return grib_nearest_smaller_value(act, val, nearest);
}
void grib_print_values(const char* title, grib_values* values)
void grib_print_values(const char* title, grib_values* values, FILE* out)
{
while(values) {
printf("%s: %s%s", title, values->name, (values->equal?"=":"!="));
if (values) {
fprintf(out, "%s: %s=", title, values->name);
switch (values->type) {
case GRIB_TYPE_LONG:
printf("%ld", values->long_value);
fprintf(out, "%ld", values->long_value);
break;
case GRIB_TYPE_DOUBLE:
printf("%g", values->double_value);
fprintf(out, "%g", values->double_value);
break;
case GRIB_TYPE_STRING:
printf("%s", values->string_value);
fprintf(out, "%s", values->string_value);
break;
}
printf(" (type=%s)\n", grib_get_type_name(values->type));
values = values->next;
fprintf(out, " (type=%s)\n", grib_get_type_name(values->type));
}
}

View File

@ -97,6 +97,7 @@ if( HAVE_BUILD_TOOLS )
grib_ifsParam
grib_packing_order
filter_substr
filter_is_in_list
filter_transient_darray
grib_uerra
grib_ecpoint

View File

@ -30,7 +30,7 @@ echo "Test: copy synop messages ..."
rm -f $fBufrTmp
echo "Test: copy synop messages " >> $fLog
${tools_dir}/bufr_copy -w dataCategory=0 $fBufrInput $fBufrTmp >> $fLog
${tools_dir}/bufr_copy -p typicalDate -w dataCategory=0 $fBufrInput $fBufrTmp >> $fLog
for i in 1 2 3 ;do
category=`${tools_dir}/bufr_get -w count=$i -p dataCategory:l $fBufrTmp`

View File

@ -8,14 +8,18 @@
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
#
set -x
. ./include.ctest.sh
cd ${data_dir}/bufr
# Define a common label for all the tmp files
label="bufr_dump_decode_filter_test"
if [ $ECCODES_ON_WINDOWS -eq 1 ]; then
echo "$0: This test is currently disabled on Windows"
exit 0
fi
cd ${data_dir}/bufr
# Create log file
fLog=temp.${label}".log"
rm -f $fLog

View File

@ -99,8 +99,8 @@ for bf in ${bufr_files}; do
done
# BUFRs with localLatitude1, localLongitude2 etc
# ----------------------------------------------
# BUFRs with specific keys to compare
# ------------------------------------
bufr_files="
aaen_55.bufr
aben_55.bufr
@ -179,21 +179,16 @@ modw_87.bufr
monw_87.bufr
nomi_206.bufr
nos1_208.bufr
nos2_208.bufr
nos3_208.bufr
nos4_208.bufr
nos5_208.bufr
nos6_208.bufr
nos7_208.bufr
nos8_208.bufr
pgps_110.bufr
rada_250.bufr
rado_250.bufr
s4kn_165.bufr
sb19_206.bufr
sbu8_206.bufr
smin_49.bufr
smis_49.bufr
smiu_49.bufr
smos_203.bufr
sn4k_165.bufr
@ -203,7 +198,8 @@ tropical_cyclone.bufr
tros_31.bufr
"
KEYS='localLongitude1,localLatitude1,localLongitude2,localLatitude2,localNumberOfObservations,satelliteID,restricted'
# ECC-1744: Do not compare floating-point keys like localLatitude1, localLongitude2
KEYS='typicalDate,localNumberOfObservations,satelliteID,restricted'
for bf in ${bufr_files}; do
input=${data_dir}/bufr/$bf
$EXEC ${test_dir}/bufr_extract_headers $KEYS $input > $temp1

View File

@ -12,6 +12,7 @@
label="bufr_indexing_test"
tempIndex=temp.$label.$$.idx
tempBufr=temp.$label.$$.bufr
tempOut=temp.$label.$$.out
tempRef=temp.$label.$$.ref
@ -41,5 +42,17 @@ ${tools_dir}/bufr_index_build -k mars.ident -o $tempIndex $infile |\
grep -q "mars.ident = { 01001, 01003, 01007 }"
# ------------------
# Error conditions
# ------------------
echo BUFR > $tempBufr
set +e
${tools_dir}/bufr_index_build $tempBufr > $tempOut 2>&1
status=$?
set -e
[ $status -ne 0 ]
grep -q "End of resource reached" $tempOut
# Clean up
rm -f $tempIndex $tempOut $tempRef
rm -f $tempIndex $tempOut $tempRef $tempBufr

View File

@ -16,6 +16,12 @@ tempOut=temp.${label}.txt
tempBufr=temp.${label}.bufr
if [ $ECCODES_ON_WINDOWS -eq 1 ]; then
echo "$0: This test is currently disabled on Windows"
exit 0
fi
REDIRECT=/dev/null
cd ${data_dir}/bufr

View File

@ -80,6 +80,13 @@ set -e
[ $status -ne 0 ]
grep -w "unreadable message" $fLog
set +e
${tools_dir}/bufr_ls -j $fTmp > $fLog 2>&1
status=$?
set -e
[ $status -ne 0 ]
grep -w "unreadable message" $fLog
# Clean up
rm -f $fLog $res_ls

View File

@ -52,6 +52,11 @@ for i in 1 2 3 ;do
[ $centre = "222" ]
done
# Strict option
f=aeolus_wmo_26.bufr
${tools_dir}/bufr_set -S -w localNumberOfObservations=40 -s rdbType=3 $f $fBufrTmp
cnt=$( ${tools_dir}/bufr_count $fBufrTmp )
[ $cnt -eq 3 ]
#-----------------------------------------------------
# Test: setting data values for single message file

View File

@ -24,11 +24,7 @@ echo "Deprecated while statement"
cat >$tempFilt <<EOF
while (edition < 2) { print "woo"; }
EOF
set +e
${tools_dir}/grib_filter $tempFilt $input > $tempOut 2>&1
status=$?
set -e
[ $status -ne 0 ]
grep -q "statement is deprecated" $tempOut
@ -37,13 +33,18 @@ echo "Deprecated trigger statement"
cat >$tempFilt <<EOF
trigger (edition) { print "woo"; }
EOF
set +e
${tools_dir}/grib_filter $tempFilt $input > $tempOut 2>&1
status=$?
set -e
[ $status -ne 0 ]
grep -q "statement is deprecated" $tempOut
echo "Deprecated export statement"
# -----------------------------------------
cat >$tempFilt <<EOF
export abcd (edition);
EOF
${tools_dir}/grib_filter $tempFilt $input > $tempOut 2>&1
grep -q "is deprecated" $tempOut
# Clean up
rm -f $tempGrib $tempFilt $tempOut $tempRef

View File

@ -67,6 +67,12 @@ status=$?
set -e
[ $status -eq 1 ]
set +e
${tools_dir}/codes_export_resource -s GRIB2 /
status=$?
set -e
[ $status -eq 1 ]
# Clean up
rm -f $temp

45
tests/filter_is_in_list.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.ctest.sh
label="filter_is_in_list_test"
temp=temp.$label.txt
sample=$ECCODES_SAMPLES_PATH/GRIB2.tmpl
# Evaluate long
${tools_dir}/grib_filter - $sample <<EOF
transient a_name="#";
if (is_in_list(a_name, "boot.def")) {
print "Found";
}
EOF
# Evaluate string
${tools_dir}/grib_filter - $sample <<EOF
transient a_name="#";
transient the_cond = (is_in_list(a_name, "boot.def"));
if (the_cond) {
print "Found";
}
EOF
# Illegal cases
${tools_dir}/grib_filter - $sample 2>$temp <<EOF
transient a_name="xyz";
if (is_in_list(a_name, "existential nihilism")) {
print "Found";
}
EOF
grep -q "unable to find def file" $temp
# Clean up
rm -f $temp

View File

@ -11,6 +11,14 @@
. ./include.ctest.sh
label="grib_check_param_concepts_test"
if [ $ECCODES_ON_WINDOWS -eq 1 ]; then
echo "$0: This test is currently disabled on Windows"
exit 0
fi
#
# Do various checks on the concepts files
#

View File

@ -27,7 +27,8 @@ val2=`${tools_dir}/gts_get -p AA $temp`
[ "$val1" = "$val2" ]
[ "$val1" = "XK" ]
${tools_dir}/grib_copy -w count=1 $input $temp
${tools_dir}/grib_copy -p edition -w count=1 $input $temp
${tools_dir}/grib_copy -p shortName -w count=2 $input $temp
set +e
${tools_dir}/gts_get -p AA $temp
status=$?
@ -102,6 +103,12 @@ set -e
grep -w "unreadable message" $fLog
#-------------------------------------------------------------------
echo "Test: dummy field ..."
#-------------------------------------------------------------------
input=${data_dir}/missing_field.grib1
${tools_dir}/grib_copy -r $input $temp
#${tools_dir}/grib_copy -w count=1 -X 57143 $input $temp #Last msg
#r1=`${tools_dir}/grib_get -w count=37 -n ls $input`
#r2=`${tools_dir}/grib_get -n ls $temp`

View File

@ -406,7 +406,48 @@ EOF
${tools_dir}/grib_filter $tempFilt $ECCODES_SAMPLES_PATH/GRIB2.tmpl
# Write statement with padding
# ------------------------------------------------------------------------
input=$ECCODES_SAMPLES_PATH/GRIB2.tmpl
echo 'write;' | ${tools_dir}/grib_filter -o $tempGrib - $input
cmp $input $tempGrib # No padding added
echo 'write(0);' | ${tools_dir}/grib_filter -o $tempGrib - $input
cmp $input $tempGrib # zero bytes padding
echo 'write(10);' | ${tools_dir}/grib_filter -o $tempGrib - $input
set +e
cmp $input $tempGrib # output should be different byte-wise
status=$?
set -e
[ $status -ne 0 ]
${tools_dir}/grib_compare $input $tempGrib # compare should succeed
set +e
echo 'write(-10);' | ${tools_dir}/grib_filter -o $tempGrib - $input > $tempOut 2>&1
status=$?
set -e
[ $status -ne 0 ]
grep -q "Invalid argument" $tempOut
# GTS header
# ---------------
input=$data_dir/gts.grib
echo 'write;' | ${tools_dir}/grib_filter -g -o $tempGrib - $input
cmp $input $tempGrib
echo 'write;' | ${tools_dir}/grib_filter -o $tempGrib - $input
set +e
cmp $input $tempGrib
status=$?
set -e
[ $status -ne 0 ]
# Bad filter
# ----------------
set +e
${tools_dir}/grib_filter a_non_existent_filter_file $ECCODES_SAMPLES_PATH/GRIB2.tmpl > $tempOut 2>&1
status=$?

View File

@ -153,6 +153,18 @@ ${tools_dir}/grib_index_build -N -o $tempIndex1 $sample1 > /dev/null
${tools_dir}/grib_dump $tempIndex1 >/dev/null
# ------------------
# Error conditions
# ------------------
echo GRIB > $tempGribFile1
set +e
${tools_dir}/grib_index_build $tempGribFile1 > $tempOut 2>&1
status=$?
set -e
[ $status -ne 0 ]
grep -q "End of resource reached" $tempOut
# Clean up
rm -f $tempOut $tempRef
rm -f $tempIndex $tempIndex1 $tempIndex2 $tempGribFile1 $tempGribFile2

View File

@ -15,6 +15,11 @@ tempOut=temp.${label}.out
tempGrib=temp.${label}.grib
tempRef=temp.${label}.ref
if [ $ECCODES_ON_WINDOWS -eq 1 ]; then
echo "$0: This test is currently disabled on Windows"
exit 0
fi
grib1_sample=$ECCODES_SAMPLES_PATH/GRIB1.tmpl
grib2_sample=$ECCODES_SAMPLES_PATH/reduced_gg_pl_32_grib2.tmpl
types_table=$ECCODES_DEFINITION_PATH/mars/type.table

View File

@ -16,6 +16,10 @@ tempGrib=temp.${label}.grib
grib1_sample=$ECCODES_SAMPLES_PATH/GRIB1.tmpl
grib2_sample=$ECCODES_SAMPLES_PATH/reduced_gg_pl_32_grib2.tmpl
if [ $ECCODES_ON_WINDOWS -eq 1 ]; then
echo "$0: This test is currently disabled on Windows"
exit 0
fi
# Check lowercase/uppercase
${tools_dir}/grib_set -s class=YT,type=EM,stream=DCWV $grib1_sample $tempGrib

View File

@ -21,21 +21,31 @@ dir="${data_dir}/tigge"
temp1="temp.${label}.grib1_"
temp2="temp.${label}.grib2_"
if [ $ECCODES_ON_WINDOWS -eq 1 ]; then
echo "$0: This test is currently disabled on Windows"
exit 0
fi
# --- Do I want to exclude any file pattern from the comparison ?
exclusion_pattern="tcw|ssr|str|skt|cap|ci|ttr|st|sm|sd|slhf|sshf"
# ECC-1744: Some very small floating-point differences shown for these
blacklist="-b iDirectionIncrementInDegrees,jDirectionIncrementInDegrees"
for file in ${dir}/tigge_[a-e]*.grib; do
exclude=`echo $file | awk " /$exclusion_pattern/ {print \"found\";} "`
if [ -z "$exclude" ]; then
rm -f ${temp1} ${temp2}
# 2 to 1 conversion check
${tools_dir}/grib_set -s editionNumber=1 ${file} ${temp1} 2> $REDIRECT > $REDIRECT
${tools_dir}/grib_compare -P -c data:n,geography:n ${temp1} ${file} 2> $REDIRECT > $REDIRECT
${tools_dir}/grib_set -s editionNumber=1 ${file} ${temp1}
${tools_dir}/grib_compare $blacklist -P -c data:n,geography:n ${temp1} ${file}
# 1 to 2 conversion check
${tools_dir}/grib_set -s editionNumber=2 ${temp1} ${temp2} 2> $REDIRECT > $REDIRECT
${tools_dir}/grib_compare -P -c shortName,data:n,geography:n ${temp2} ${file} 2> $REDIRECT > $REDIRECT
${tools_dir}/grib_set -s editionNumber=2 ${temp1} ${temp2}
${tools_dir}/grib_compare $blacklist -P -c shortName,data:n,geography:n ${temp2} ${file}
fi
done

View File

@ -21,21 +21,30 @@ dir="${data_dir}/tigge"
temp1="temp.${label}.grib1_"
temp2="temp.${label}.grib2_"
if [ $ECCODES_ON_WINDOWS -eq 1 ]; then
echo "$0: This test is currently disabled on Windows"
exit 0
fi
# --- Do I want to exclude any file pattern from the comparison ?
exclusion_pattern="tcw|ssr|str|skt|cap|ci|ttr|st|sm|sd|slhf|sshf"
# ECC-1744: Some very small floating-point differences shown for these
blacklist="-b iDirectionIncrementInDegrees,jDirectionIncrementInDegrees"
for file in ${dir}/tigge_[f-z]*.grib; do
exclude=`echo $file | awk " /$exclusion_pattern/ {print \"found\";} "`
if [ -z "$exclude" ]; then
rm -f ${temp1} ${temp2}
# 2 to 1 conversion check
${tools_dir}/grib_set -s editionNumber=1 ${file} ${temp1} 2> $REDIRECT > $REDIRECT
${tools_dir}/grib_compare -P -c data:n,geography:n ${temp1} ${file} 2> $REDIRECT > $REDIRECT
${tools_dir}/grib_set -s editionNumber=1 ${file} ${temp1}
${tools_dir}/grib_compare $blacklist -P -c data:n,geography:n ${temp1} ${file}
# 1 to 2 conversion check
${tools_dir}/grib_set -s editionNumber=2 ${temp1} ${temp2} 2> $REDIRECT > $REDIRECT
${tools_dir}/grib_compare -P -c shortName,data:n,geography:n ${temp2} ${file} 2> $REDIRECT > $REDIRECT
${tools_dir}/grib_set -s editionNumber=2 ${temp1} ${temp2}
${tools_dir}/grib_compare $blacklist -P -c shortName,data:n,geography:n ${temp2} ${file}
fi
done

View File

@ -20,6 +20,7 @@ cd ${data_dir}/gts
gts_file=EGRR20150317121020_00493212.DAT
${tools_dir}/gts_dump -w count=1 $gts_file
${tools_dir}/gts_dump -w count=2 $gts_file
${tools_dir}/gts_dump -Dat $gts_file
${tools_dir}/gts_dump -OH $gts_file

View File

@ -29,7 +29,14 @@ ${tools_dir}/gts_get -p TT,AA,II,CCCC,YY,GG,gg,BBB $gts_file >/dev/null
#----------------------------------------------
# Test "-w" switch
#----------------------------------------------
${tools_dir}/gts_get -p TT -w count=3 $gts_file >/dev/null
${tools_dir}/gts_get -p TT -w count=3 $gts_file
#----------------------------------------------
# Test "-s" switch
#----------------------------------------------
result=$( ${tools_dir}/gts_get -s YY=ab -p YY -w count=3 $gts_file )
[ "$result" = "ab" ]
gts_file=${data_dir}/gts.grib

View File

@ -13,6 +13,13 @@
OUTPUT=all_codetable_flagtable_keys.txt
TEMP=temp.list_codetable_flagtable_keys.txt
if [ $ECCODES_ON_WINDOWS -eq 1 ]; then
echo "$0: This test is currently disabled on Windows"
exit 0
fi
[ -z "$ECCODES_DEFINITION_PATH" ] || ECCODES_DEFINITION_PATH=`${tools_dir}/codes_info -d`
touch $TEMP

View File

@ -42,6 +42,11 @@ ${tools_dir}/metar_ls $f >> $fLog
${tools_dir}/metar_ls -w CCCC=VILK $f >> $fLog
#-------------------------------------------
# Test "-s" switch
#-------------------------------------------
${tools_dir}/metar_ls -s dummy=1 -w count=5 $f >> $fLog
#-------------------------------------------
# Test "-p" switch
#-------------------------------------------

View File

@ -454,7 +454,7 @@ static void test_parse_keyval_string()
values_required, GRIB_TYPE_UNDEFINED, values1, &count);
Assert( !err );
Assert( count == 2 );
grib_print_values("print values test: values1", values1);
grib_print_values("print values test: values1", values1, stdout);
Assert( strcmp(values1[0].name, "key1")==0 );
Assert( strcmp(values1[0].string_value, "value1")==0 );
@ -474,7 +474,7 @@ static void test_parse_keyval_string()
values_required, GRIB_TYPE_LONG, values2, &count);
Assert( !err );
Assert( count == 1 );
grib_print_values("print values test: values2", values2);
grib_print_values("print values test: values2", values2, stdout);
Assert( strcmp(values2[0].name, "x")==0 );
Assert( values2[0].long_value == 14 );
Assert( values2[0].equal == 1 );
@ -485,7 +485,7 @@ static void test_parse_keyval_string()
values_required, GRIB_TYPE_DOUBLE, values3, &count);
Assert( !err );
Assert( count == 1 );
grib_print_values("print values test: values3", values3);
grib_print_values("print values test: values3", values3, stdout);
Assert( strcmp(values3[0].name, "mars.level")==0 );
free( (void*)values3[0].name );
}

View File

@ -698,7 +698,6 @@ static int compare_values(grib_runtime_options* options, grib_handle* handle1, g
char *sval1 = NULL, *sval2 = NULL;
char **svals1 = NULL, **svals2 = NULL;
unsigned char *uval1 = NULL, *uval2 = NULL;
double *dval1 = NULL, *dval2 = NULL;
long *lval1 = NULL, *lval2 = NULL;
double maxdiff = 0;
@ -1094,60 +1093,9 @@ static int compare_values(grib_runtime_options* options, grib_handle* handle1, g
printf(" as bytes\n");
if (options->mode == MODE_BUFR)
return 0;
if (len1 < 2)
len1 = 512;
if (len2 < 2)
len2 = 512;
uval1 = (unsigned char*)grib_context_malloc(handle1->context, len1 * sizeof(unsigned char));
uval2 = (unsigned char*)grib_context_malloc(handle2->context, len2 * sizeof(unsigned char));
if ((err1 = grib_get_bytes(handle1, name, uval1, &len1)) != GRIB_SUCCESS) {
printInfo(handle1);
save_error(c, name);
printf("Error: cannot get bytes value of [%s] in %s field: %s\n",
name, first_str, grib_get_error_message(err1));
}
if ((err2 = grib_get_bytes(handle2, name, uval2, &len2)) != GRIB_SUCCESS) {
printInfo(handle1);
save_error(c, name);
printf("Error: cannot get bytes value of [%s] in %s field: %s\n",
name, second_str, grib_get_error_message(err2));
}
if (err1 == GRIB_SUCCESS && err2 == GRIB_SUCCESS) {
if (memcmp(uval1, uval2, len1) != 0) {
for (i = 0; i < len1; i++) {
if (uval1[i] != uval2[i]) {
printInfo(handle1);
save_error(c, name);
if (len1 == 1)
printf("[%s] byte values are different: [%02x] and [%02x]\n",
name, uval1[i], uval2[i]);
else
printf("[%s] byte value %d of %ld are different: [%02x] and [%02x]\n",
name, i, (long)len1, uval1[i], uval2[i]);
err1 = GRIB_VALUE_MISMATCH;
break;
}
}
err1 = GRIB_VALUE_MISMATCH;
}
}
grib_context_free(handle1->context, uval1);
grib_context_free(handle2->context, uval2);
if (err1)
return err1;
if (err2)
return err2;
break;
case GRIB_TYPE_LABEL:
if (verbose)
printf(" as label\n");
break;
default:

View File

@ -86,7 +86,7 @@ int grib_tool_new_filename_action(grib_runtime_options* options, const char* fil
printf("--- %s: processing %s\n", tool_name, file);
ret = grib_index_add_file(idx, file);
if (ret) {
printf("error: %s\n", grib_get_error_message(ret));
fprintf(stderr, "Error: %s\n", grib_get_error_message(ret));
exit(ret);
}
return 0;

View File

@ -75,6 +75,7 @@ int main(int argc, char* argv[])
fout = fopen(out_file, "wb");
if (!fout) {
fprintf(stderr, "Failed to open output file '%s'\n", out_file);
perror(out_file);
return 1;
}
fin = codes_fopen(full_path, "r");

View File

@ -92,7 +92,6 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h)
long* bitmap = NULL; /* bitmap array */
size_t bmp_len = 0;
double *data_values = 0, *lats = 0, *lons = 0;
int n = 0;
size_t size = 0, num_bytes = 0;
long hasMissingValues = 0;
@ -239,7 +238,6 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h)
if (print_keys)
print_key_values(values, options->print_keys_count);
fprintf(dump_file, "\n");
n++;
}
}
else if (skip_missing == 1) {
@ -259,7 +257,6 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h)
if (print_keys)
print_key_values(values, options->print_keys_count);
fprintf(dump_file, "\n");
n++;
}
}
}

View File

@ -83,7 +83,7 @@ int grib_tool_new_filename_action(grib_runtime_options* options, const char* fil
printf("--- %s: processing %s\n", tool_name, file);
ret = grib_index_add_file(idx, file);
if (ret) {
printf("error: %s\n", grib_get_error_message(ret));
fprintf(stderr, "Error: %s\n", grib_get_error_message(ret));
exit(ret);
}
return 0;

View File

@ -1607,7 +1607,6 @@ static void cube_indexes(
int i = 0;
int index = 0;
int n = 1;
int ok = 0;
if (size < c) {
grib_context_log(ctx, GRIB_LOG_ERROR, "Internal error in cube_indexes. size=%d < axis=%d", size, c);
@ -1649,7 +1648,6 @@ static void cube_indexes(
if (h->compare ? h->compare[i](w, v) : (w == v)) {
index += j * n;
n *= dims;
ok++;
((hypercube*)h)->index_cache[i] = j;
break;
}

View File

@ -73,14 +73,14 @@ int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* fi
int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h)
{
int err = 0;
if (!options->skip) {
if (options->set_values_count != 0)
err = grib_set_values(h, options->set_values, options->set_values_count);
// int err = 0;
// if (!options->skip) {
// if (options->set_values_count != 0)
// err = grib_set_values(h, options->set_values, options->set_values_count);
if (err != GRIB_SUCCESS && options->fail)
exit(err);
}
// if (err != GRIB_SUCCESS && options->fail)
// exit(err);
// }
grib_tools_write_message(options, h);
return 0;

View File

@ -95,8 +95,7 @@ int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* fi
if (!options->current_infile->name)
return 0;
snprintf(tmp, 1024, "FILE: %s ", options->current_infile->name);
if (!grib_options_on("C"))
fprintf(stdout, "***** %s\n", tmp);
fprintf(stdout, "***** %s\n", tmp);
return 0;
}
@ -114,8 +113,8 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h)
grib_set_flag(h, options->print_keys[i].name, GRIB_ACCESSOR_FLAG_DUMP);
snprintf(tmp, 1024, "MESSAGE %d ( length=%ld )", options->handle_count, length);
if (!grib_options_on("C"))
fprintf(stdout, "#============== %-38s ==============\n", tmp);
fprintf(stdout, "#============== %-38s ==============\n", tmp);
if (!strcmp(options->dump_mode, "default")) {
GRIB_CHECK_NOLINE(grib_get_string(h, "identifier", identifier, &idlen), 0);
printf("%s {\n", identifier);

View File

@ -31,7 +31,6 @@ grib_option grib_options[] = {
"double (key:d) or an integer (key:i)\n\t\ttype can be defined. Default type "
"is string.\n",
0, 1, 0 },
{ "B:", 0, 0, 0, 1, 0 },
{ "V", 0, 0, 0, 1, 0 },
{ "W:", 0, 0, 0, 1, 0 },
{ "U", 0, 0, 1, 0, 0 },

View File

@ -99,7 +99,7 @@ int grib_tool_new_file_action(grib_runtime_options* options, grib_tools_file* fi
if (!options->current_infile->name)
return 0;
snprintf(tmp, 1024, "FILE: %s ", options->current_infile->name);
if ( !grib_options_on("C") && !grib_options_on("j") )
if ( !grib_options_on("j") )
fprintf(stdout, "***** %s\n", tmp);
return 0;
}
@ -118,7 +118,7 @@ int grib_tool_new_handle_action(grib_runtime_options* options, grib_handle* h)
grib_set_flag(h, options->print_keys[i].name, GRIB_ACCESSOR_FLAG_DUMP);
snprintf(tmp, 1024, "MESSAGE %d ( length=%ld )", options->handle_count, length);
if (!grib_options_on("C") && !grib_options_on("j"))
if (!grib_options_on("j"))
fprintf(stdout, "#============== %-38s ==============\n", tmp);
if (!strcmp(options->dump_mode, "default")) {
GRIB_CHECK_NOLINE(grib_get_string(h, "identifier", identifier, &idlen), 0);

View File

@ -17,24 +17,18 @@ grib_option grib_options[] = {
{ "F:", 0, 0, 1, 1, "%g" },
{ "P:", 0, 0, 0, 1, 0 },
{ "w:", 0, 0, 0, 1, 0 },
// { "j", 0, "json output\n", 0, 1, 0 },
{ "B:", 0, 0, 0, 1, 0 },
/* {"l:",0,0,0,1,0}, */
{ "s:", 0, 0, 0, 1, 0 },
/* {"i:",0,0,0,1,0}, */
{ "n:", 0, 0, 1, 1, "ls" },
{ "m", 0, 0, 0, 1, 0 },
{ "V", 0, 0, 0, 1, 0 },
{ "W:", 0, 0, 1, 1, "10" },
{ "S", 0, 0, 1, 0, 0 },
/* {"M",0,0,0,1,0}, */
{ "H", 0, 0, 1, 0, 0 },
{ "g", 0, 0, 0, 1, 0 },
{ "P", 0, 0, 1, 0, 0 },
{ "T:", 0, 0, 1, 0, "M" },
{ "7", 0, 0, 0, 1, 0 },
{ "v", 0, 0, 1, 0, 0 }
/*{"x",0,0,0,1,0}*/
};
const char* tool_description =