File: grib_ecc-1671.sh

package info (click to toggle)
eccodes 2.45.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 154,456 kB
  • sloc: cpp: 162,953; ansic: 26,308; sh: 21,742; f90: 6,854; perl: 6,361; python: 5,172; java: 2,226; javascript: 1,427; yacc: 854; fortran: 543; lex: 359; makefile: 278; xml: 183; awk: 66
file content (61 lines) | stat: -rwxr-xr-x 1,755 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/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

# ---------------------------------------------------------------------
# This is the test for JIRA issue ECC-1671
# Issue in reading glofas data
# ---------------------------------------------------------------------

label="grib_ecc-1671_test"

if [ $HAVE_GEOGRAPHY -eq 0 ]; then
    exit 0
fi

tempGrib=temp.$label.grib
tempFilt=temp.${label}.filt
tempOut=temp.${label}.txt

sample="$samp_dir/GRIB2.tmpl"

cat > $tempFilt <<EOF
  set numberOfDataPoints = 5400000;
  set numberOfValues = 5400000;
  set Ni = 3600;
  set Nj = 1500;
  set latitudeOfFirstGridPoint = 89950000;
  set longitudeOfFirstGridPoint = 180050000;
  set latitudeOfLastGridPoint = -59950000;
  set longitudeOfLastGridPoint = 539950000;
  set iDirectionIncrement = 100000;
  set jDirectionIncrement = 100000;
  write;
EOF

${tools_dir}/grib_filter -o $tempGrib $tempFilt $sample
# ${tools_dir}/grib_ls -j -n geography $tempGrib

cat > $tempFilt <<EOF
  meta last_elem element(distinctLongitudes, 3599);
  # print "[last_elem:d]";
  if ( last_elem - 179.95 > 0.001 ) {
    print "Error: last longitude is [last_elem:d] but should be 179.95";
    assert(0);
  }
EOF
${tools_dir}/grib_filter $tempFilt $tempGrib

# ${tools_dir}/grib_get_data $tempGrib > $tempOut
# cat $tempOut
# ${tools_dir}/grib_ls -l 37.5,16.0,1 $tempGrib > $tempOut

rm -f $tempGrib $tempFilt $tempOut