From 7b57134d7b14ffd86fc82bf722cb31e8c7ce5fbd Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 16 May 2019 15:35:29 +0100 Subject: [PATCH] Rename and clean up comments --- definitions/grib2/template.3.13.def | 12 ++-------- definitions/grib2/template.3.23.def | 11 ++------- definitions/grib2/template.3.33.def | 11 ++------- definitions/grib2/template.3.61.def | 15 ++---------- definitions/grib2/template.3.62.def | 17 ++------------ definitions/grib2/template.3.63.def | 23 +------------------ definitions/grib2/template.5.53.def | 19 +++++---------- definitions/grib2/template.7.53.def | 22 ++++++------------ ..._accessor_class_data_g2bifourier_packing.c | 3 +-- tests/CMakeLists.txt | 2 +- tests/{missing.sh => grib_missing.sh} | 2 +- 11 files changed, 27 insertions(+), 110 deletions(-) rename tests/{missing.sh => grib_missing.sh} (96%) diff --git a/definitions/grib2/template.3.13.def b/definitions/grib2/template.3.13.def index 33df979d2..717471573 100644 --- a/definitions/grib2/template.3.13.def +++ b/definitions/grib2/template.3.13.def @@ -1,13 +1,5 @@ -# Copyright 2005-2018 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. -# - -# TEMPLATE 3.33002, Mercator for limited area models +# Copyright 2005-2019 ECMWF. +# TEMPLATE 3.13 Mercator with modelling subdomains definition include "grib2/template.3.10.def" include "grib2/template.3.lam.def" diff --git a/definitions/grib2/template.3.23.def b/definitions/grib2/template.3.23.def index 119d588da..ec1bc325b 100644 --- a/definitions/grib2/template.3.23.def +++ b/definitions/grib2/template.3.23.def @@ -1,12 +1,5 @@ -# Copyright 2005-2018 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. -# +# Copyright 2005-2019 ECMWF. -# TEMPLATE 3.33003, Polar stereographic projection for limited area models +# TEMPLATE 3.23 Polar stereographic with modelling subdomains definition include "grib2/template.3.20.def" include "grib2/template.3.lam.def" diff --git a/definitions/grib2/template.3.33.def b/definitions/grib2/template.3.33.def index 00c06b3e1..d7211bff6 100644 --- a/definitions/grib2/template.3.33.def +++ b/definitions/grib2/template.3.33.def @@ -1,12 +1,5 @@ -# Copyright 2005-2018 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. -# +# Copyright 2005-2019 ECMWF. -# TEMPLATE 3.33001, Lambert conformal for limited area models +# TEMPLATE 3.33, Lambert conformal with modelling subdomains definition include "grib2/template.3.30.def" include "grib2/template.3.lam.def" diff --git a/definitions/grib2/template.3.61.def b/definitions/grib2/template.3.61.def index 6816fa1e5..e3bfc7a8a 100644 --- a/definitions/grib2/template.3.61.def +++ b/definitions/grib2/template.3.61.def @@ -1,13 +1,7 @@ -# Copyright 2005-2018 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. -# +# Copyright 2005-2019 ECMWF. # TEMPLATE 3.61, Bi-Fourier coefficients on Mercator projection +# Spectral Mercator with modelling subdomains definition transient biFourierMakeTemplate = 0; @@ -15,7 +9,6 @@ include "grib2/template.3.bf.def" include "grib2/template.3.shape_of_the_earth.def"; -#include "grib2/template.3.10.part1.def" # La1 - latitude of first grid point signed[4] latitudeOfFirstGridPoint: edition_specific,no_copy ; alias La1 = latitudeOfFirstGridPoint; @@ -26,8 +19,6 @@ signed[4] longitudeOfFirstGridPoint : edition_specific,no_copy; alias Lo1 = longitudeOfFirstGridPoint; meta geography.longitudeOfFirstGridPointInDegrees scale(longitudeOfFirstGridPoint,oneConstant,grib2divider,truncateDegrees) : dump; - -#include "grib2/template.3.10.part2.def" # LaD - Latitude(s) at which the Mercator projection intersects the Earth # (Latitude(s) where Di and Dj are specified) signed[4] LaD : edition_specific,no_copy; @@ -43,7 +34,6 @@ signed[4] longitudeOfLastGridPoint: edition_specific,no_copy ; alias Lo2 = longitudeOfLastGridPoint; meta geography.longitudeOfLastGridPointInDegrees scale(longitudeOfLastGridPoint,oneConstant,grib2divider,truncateDegrees) : dump; -#include "grib2/template.3.10.part3.def" # Orientation of the grid, angle between i direction on the map and the equator # NOTE 1: Limited to the range of 0 to 90 degrees; if the angle of orientation of the grid is neither 0 nor 90 degrees, # Di and Dj must be equal to each other @@ -51,4 +41,3 @@ unsigned[4] orientationOfTheGrid : dump ; meta geography.orientationOfTheGridInDegrees scale(orientationOfTheGrid,oneConstant,grib2divider,truncateDegrees) : dump; -# END 2/template.3.61 ---------------------------------------------------------------------- diff --git a/definitions/grib2/template.3.62.def b/definitions/grib2/template.3.62.def index c8450ed13..772b263dc 100644 --- a/definitions/grib2/template.3.62.def +++ b/definitions/grib2/template.3.62.def @@ -1,14 +1,7 @@ -# Copyright 2005-2018 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. -# - +# Copyright 2005-2019 ECMWF. # TEMPLATE 3.62, Bi-Fourier coefficients on polar stereographic projection +# Spectral polar stereographic with modelling subdomains definition transient biFourierMakeTemplate = 0; @@ -18,7 +11,6 @@ include "grib2/template.3.shape_of_the_earth.def"; transient oneThousand=1000; -#include "grib2/template.3.20.part1.def" # La1 - latitude of first grid point signed[4] latitudeOfFirstGridPoint : edition_specific ; meta geography.latitudeOfFirstGridPointInDegrees scale(latitudeOfFirstGridPoint,oneConstant,grib2divider,truncateDegrees) : dump; @@ -45,14 +37,9 @@ signed[4] orientationOfTheGrid : edition_specific; alias LoV = orientationOfTheGrid ; meta geography.orientationOfTheGridInDegrees scale(orientationOfTheGrid,oneConstant,grib2divider,truncateDegrees) : dump; - -#include "grib2/template.3.20.part2.def" # Projection centre flag flags[1] projectionCentreFlag 'grib2/tables/[tablesVersion]/3.5.table' : dump; # Note our flagbit numbers go from 7 to 0, while WMO convention is from 1 to 8 # If bit 1 is 0, then the North Pole is on the projection plane # If bit 1 is 1, then the South Pole is on the projection plane flagbit southPoleOnProjectionPlane(projectionCentreFlag,7) : dump; # WMO bit 1 - - -# END 2/template.3.62 ---------------------------------------------------------------------- diff --git a/definitions/grib2/template.3.63.def b/definitions/grib2/template.3.63.def index bfa553227..f5760f0f0 100644 --- a/definitions/grib2/template.3.63.def +++ b/definitions/grib2/template.3.63.def @@ -1,11 +1,4 @@ -# Copyright 2005-2018 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. -# +# Copyright 2005-2019 ECMWF. # TEMPLATE 3.63, BiFourier coefficients on lambert projection @@ -15,7 +8,6 @@ include "grib2/template.3.bf.def" include "grib2/template.3.shape_of_the_earth.def"; -#include "grib2/template.3.30.part1.def" # La1 - latitude of first grid point signed[4] latitudeOfFirstGridPoint : edition_specific; alias La1 = latitudeOfFirstGridPoint; @@ -32,9 +24,6 @@ meta geography.longitudeOfFirstGridPointInDegrees alias Lo1InDegrees = longitudeOfFirstGridPointInDegrees; #meta longitudeOfFirstGridPointInMicrodegrees times(longitudeOfFirstGridPoint,oneConstant) : no_copy; - - -#include "grib2/template.3.30.part2.def" # LaD - Latitude where Dx and Dy are specified signed[4] LaD : edition_specific ; alias latitudeWhereDxAndDyAreSpecified=LaD; @@ -44,14 +33,9 @@ meta geography.LaDInDegrees scale(LaD,one,grib2divider,truncateDegrees) : dump; unsigned[4] LoV : edition_specific; meta geography.LoVInDegrees scale(LoV,one,grib2divider,truncateDegrees) : dump; - - -#include "grib2/template.3.30.part3.def" # Projection centre flag flags[1] projectionCentreFlag 'grib2/tables/[tablesVersion]/3.5.table' : dump; - -#include "grib2/template.3.30.part4.def" # Latin 1 - first latitude from the pole at which the secant cone cuts the sphere signed[4] Latin1 : edition_specific; alias FirstLatitude=Latin1; @@ -71,8 +55,3 @@ meta geography.latitudeOfSouthernPoleInDegrees scale(latitudeOfSouthernPole unsigned[4] longitudeOfSouthernPole : edition_specific; alias longitudeOfTheSouthernPoleOfProjection=longitudeOfSouthernPole; meta geography.longitudeOfSouthernPoleInDegrees scale(longitudeOfSouthernPole,oneConstant,grib2divider,truncateDegrees) : dump; - - - - - diff --git a/definitions/grib2/template.5.53.def b/definitions/grib2/template.5.53.def index f9fb79849..f72ae1f6c 100644 --- a/definitions/grib2/template.5.53.def +++ b/definitions/grib2/template.5.53.def @@ -1,13 +1,7 @@ -# Copyright 2005-2018 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. -# +# Copyright 2005-2019 ECMWF. # TEMPLATE 5.53, BiFourier coefficients data - complex packing +# Spectral data for limited area models \u2013 complex packing include "grib2/template.5.packing.def"; @@ -15,16 +9,15 @@ transient computeLaplacianOperator=1 : hidden; codetable[1] biFourierSubTruncationType ('5.25.table',masterDir,localDir) : dump; codetable[1] biFourierPackingModeForAxes ('5.26.table',masterDir,localDir) = 0 : dump; -# biFourierDoNotPackAxes constant laplacianScalingFactorUnset = -2147483647; signed[4] laplacianScalingFactor : edition_specific ; # units of 10^-6 -meta data.laplacianOperator scale(laplacianScalingFactor,one,million,truncateLaplacian) ; -meta laplacianOperatorIsSet evaluate(laplacianScalingFactor != laplacianScalingFactorUnset && !computeLaplacianOperator); +meta data.laplacianOperator scale(laplacianScalingFactor,one,million,truncateLaplacian) ; +meta laplacianOperatorIsSet evaluate(laplacianScalingFactor != laplacianScalingFactorUnset && !computeLaplacianOperator); -unsigned[2] biFourierResolutionSubSetParameterN : dump ; # NS -unsigned[2] biFourierResolutionSubSetParameterM : dump ; # MS +unsigned[2] biFourierResolutionSubSetParameterN : dump ; # NS +unsigned[2] biFourierResolutionSubSetParameterM : dump ; # MS unsigned[4] totalNumberOfValuesInUnpackedSubset = 0 : dump; # TS # This is read_only until we support other values diff --git a/definitions/grib2/template.7.53.def b/definitions/grib2/template.7.53.def index 14a55813e..97cb22e89 100644 --- a/definitions/grib2/template.7.53.def +++ b/definitions/grib2/template.7.53.def @@ -1,18 +1,11 @@ -# Copyright 2005-2018 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. -# +# Copyright 2005-2019 ECMWF. # TEMPLATE 7.53, BiFourier coefficients - complex packing +# Spectral data for limited area models \u2013 complex packing constant biFourierCoefficients = 1; constant complexPacking = 1; - meta codedValues data_g2bifourier_packing( section7Length, offsetBeforeData, @@ -47,9 +40,8 @@ meta codedValues data_g2bifourier_packing( ): read_only; meta values data_apply_bitmap(codedValues, - bitmap, - missingValue, - binaryScaleFactor, - numberOfDataPoints, - numberOfValues) : dump; - + bitmap, + missingValue, + binaryScaleFactor, + numberOfDataPoints, + numberOfValues) : dump; diff --git a/src/grib_accessor_class_data_g2bifourier_packing.c b/src/grib_accessor_class_data_g2bifourier_packing.c index 010d32d6b..9d42bef56 100644 --- a/src/grib_accessor_class_data_g2bifourier_packing.c +++ b/src/grib_accessor_class_data_g2bifourier_packing.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2018 ECMWF. + * Copyright 2005-2019 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. @@ -16,7 +16,6 @@ #include "grib_accessor_class.h" #include "grib_optimize_decimal_factor.h" #include -#include /* This is used by make_class.pl diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 580f93af3..8f4e8bf41 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -135,7 +135,7 @@ list( APPEND tests_data_reqd decimalPrecision grib_bitsPerValue get_fail - missing + grib_missing grib_local grib_step grib_set diff --git a/tests/missing.sh b/tests/grib_missing.sh similarity index 96% rename from tests/missing.sh rename to tests/grib_missing.sh index 7ffcff089..524d20d84 100755 --- a/tests/missing.sh +++ b/tests/grib_missing.sh @@ -13,7 +13,7 @@ REDIRECT=/dev/null infile="${data_dir}/missing.grib2" -outfile="${data_dir}/missing_new.grib2" +outfile="${data_dir}/temp.missing_new.grib2" scaleFactorOfSecondFixedSurface=`${tools_dir}/grib_get -w count=1 -p scaleFactorOfSecondFixedSurface $infile` [ "$scaleFactorOfSecondFixedSurface" = "0" ]