File: Remap3.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 (38 lines) | stat: -rw-r--r-- 1,113 bytes parent folder | download | duplicates (4)
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
#! @PYTHON@

from cdoTest import *
from collections import defaultdict
import os

FORMAT="-f srv -b 32"

HAS_THREADS=cdo_check_req("has-threads")

GRID="global_5"

IFILE=f'{DATAPATH}/topo_eu5.grb'

OPERATORS=["remapdis","remapnn","remapbil","remapbic","remapcon","remaplaf"]
ABSLIMS=defaultdict(lambda : 0.0001, {"remapdis" : 0.001})

test_module = TestModule()

for OPERATOR in OPERATORS:
    if (not HAS_THREADS):
        test_module.add_skip("POSIX threads not enabled")
    else:
#       for extra in ["","off","on"]:
        for extra in ["off"]:

            os.environ['REMAP_EXTRAPOLATE'] = extra
            OFILE=f'topo_eu5_{OPERATOR[5:]}_{extra}_{os.getpid()}'
            RFILE=f'{DATAPATH}/topo_eu5_{OPERATOR[5:]}_{extra}_ref'

            for GRIDTYPE in ["", " -setgridtype,curvilinear"]:
                t=TAPTest(f'{OPERATOR} regional->global')
                t.add(f'{CDO} {FORMAT} {OPERATOR},{GRID} {GRIDTYPE} {IFILE} {OFILE}')
                t.add(f'{CDO} diff,abslim={ABSLIMS[OPERATOR]} {OFILE} {RFILE}')
                t.clean(OFILE)
                test_module.add(t)

test_module.run()