diff --git a/definitions/grib1/scanning_mode.def b/definitions/grib1/scanning_mode.def index 31a56e27d..19a7f8167 100644 --- a/definitions/grib1/scanning_mode.def +++ b/definitions/grib1/scanning_mode.def @@ -9,8 +9,8 @@ flagbit jScansPositively(scanningMode,6) : dump; flagbit jPointsAreConsecutive(scanningMode,5) : dump; constant alternativeRowScanning=0 : dump; -transient iScansPositively = !iScansNegatively : constraint; -transient jScansNegatively = !jScansPositively : constraint; +transient iScansPositively = !iScansNegatively : constraint, read_only; +transient jScansNegatively = !jScansPositively : constraint, read_only; alias geography.iScansNegatively=iScansNegatively; alias geography.jScansPositively=jScansPositively; diff --git a/definitions/grib2/template.3.healpix.def b/definitions/grib2/template.3.healpix.def index bf0429a5b..136904194 100644 --- a/definitions/grib2/template.3.healpix.def +++ b/definitions/grib2/template.3.healpix.def @@ -32,8 +32,8 @@ alias geography.orderingConvention = orderingConvention; flags[1] scanningMode 'grib2/tables/[tablesVersion]/3.13.table'; flagbit iScansNegatively(scanningMode,7) : dump; # WMO bit 1 flagbit jScansPositively(scanningMode,6) : dump; # WMO bit 2 -transient iScansPositively = !iScansNegatively : constraint; -transient jScansNegatively = !jScansPositively : constraint; +transient iScansPositively = !iScansNegatively : constraint, read_only; +transient jScansNegatively = !jScansPositively : constraint, read_only; iterator healpix(numberOfPoints,missingValue,values,Nside,orderingConvention); nearest healpix(values,radius,Nx,Ny); diff --git a/definitions/grib2/template.3.scanning_mode.def b/definitions/grib2/template.3.scanning_mode.def index 2eb2ca71e..1be608f41 100644 --- a/definitions/grib2/template.3.scanning_mode.def +++ b/definitions/grib2/template.3.scanning_mode.def @@ -20,8 +20,8 @@ alias geography.iScansNegatively=iScansNegatively; alias geography.jScansPositively=jScansPositively; alias geography.jPointsAreConsecutive=jPointsAreConsecutive; -transient iScansPositively = !iScansNegatively : constraint; -transient jScansNegatively = !jScansPositively : constraint; +transient iScansPositively = !iScansNegatively : constraint, read_only; +transient jScansNegatively = !jScansPositively : constraint, read_only; flagbit scanningMode5(scanningMode,3) = 0: read_only; flagbit scanningMode6(scanningMode,2) = 0: read_only; diff --git a/definitions/grib3/template.4.scanning_mode.def b/definitions/grib3/template.4.scanning_mode.def index 4fcd2fabb..31414321f 100644 --- a/definitions/grib3/template.4.scanning_mode.def +++ b/definitions/grib3/template.4.scanning_mode.def @@ -20,7 +20,7 @@ alias geography.iScansNegatively=iScansNegatively; alias geography.jScansPositively=jScansPositively; alias geography.jPointsAreConsecutive=jPointsAreConsecutive; -transient iScansPositively = !iScansNegatively : constraint; +transient iScansPositively = !iScansNegatively : constraint, read_only; flagbit scanningMode5(scanningMode,3) = 0: read_only; flagbit scanningMode6(scanningMode,2) = 0: read_only; diff --git a/src/grib_accessor.cc b/src/grib_accessor.cc index a08f5348e..a684b9e1d 100644 --- a/src/grib_accessor.cc +++ b/src/grib_accessor.cc @@ -112,7 +112,9 @@ int grib_pack_float(grib_accessor* a, const float* v, size_t* len) int grib_pack_expression(grib_accessor* a, grib_expression* e) { grib_accessor_class* c = a->cclass; - //grib_context_log(a->context, GRIB_LOG_DEBUG, "(%s)%s is packing (double) %g",(a->parent->owner)?(a->parent->owner->name):"root", a->name ,v?(*v):0); + // grib_context_log(a->context, GRIB_LOG_INFO, "....(%s)%s is packing", + // (a->parent->owner)?(a->parent->owner->name):"root", + // a->name); while (c) { if (c->pack_expression) { return c->pack_expression(a, e); diff --git a/tests/grib_change_scanning.sh b/tests/grib_change_scanning.sh index 25c5e005b..5f1d46596 100755 --- a/tests/grib_change_scanning.sh +++ b/tests/grib_change_scanning.sh @@ -11,6 +11,12 @@ . ./include.ctest.sh label="grib_change_scanning_test" +tempFilt=temp.$label.filt +tempGribA=temp.$label.A.grib +tempGribB=temp.$label.B.grib +tempText=temp.$label.txt +tempRef=temp.$label.ref + editions="1 2" gridTypes="regular_ll rotated_ll" @@ -77,12 +83,6 @@ done # alternativeRowScanning # ----------------------- -tempFilt=temp.$label.filt -tempGribA=temp.$label.A.grib -tempGribB=temp.$label.B.grib -tempText=temp.$label.txt -tempRef=temp.$label.ref - cat > $tempFilt </dev/null cmp $tempGribA $tempGribB + +# Check constraint keys follow (observe) their expressions +# -------------------------------------------------------- +cat > $tempFilt <$tempText + status=$? + set -e + [ $status -ne 0 ] + grep -q "Value is read only" $tempText + rm $tempText + done +done + # Clean up rm -f $tempFilt $tempGribA $tempGribB $tempRef $tempText rm -f ${data_dir}/scan1.grib ${data_dir}/scan.grib