File: Gridarea.py.test.in

package info (click to toggle)
cdo 2.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 49,836 kB
  • sloc: cpp: 185,271; ansic: 95,766; sh: 7,192; f90: 6,147; makefile: 1,977; ruby: 1,078; csh: 1,028; python: 995; fortran: 319; pascal: 219; perl: 9
file content (32 lines) | stat: -rw-r--r-- 754 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
#! @PYTHON@
#
from cdoTest import *
import os
#
HAS_THREADS=cdo_check_req("has-threads")
#
REFVAL="12.5663706"
GRIDS=["global_5","global_2","global_1","global_.5","F32","F80","F160"]
RSTAT=0;
PLANET_RADIUS=1
#
os.environ["PLANET_RADIUS"]="1"
#
OPER="gridarea"
#
test_module=TestModule()
for GRID in GRIDS:
    if(not HAS_THREADS):
        test_module.add_skip("POSIX threads not enabled")
        continue

    t=TAPTest(GRID)
    CDOCOMMAND="$CDO -s outputf,%10.7f -fldsum -$STATS -random,$GRID"
    t.add(f'{CDO} -s outputf,%10.7f -fldsum -{OPER} -random,{GRID} > gridarea_res')
    t.add(f'echo {REFVAL} > gridarea_ref')
    t.add("diff gridarea_ref gridarea_res")
    t.clean("gridarea_res","gridarea_ref")
    test_module.add(t)

test_module.run()