File: MapReduce.py.test.in

package info (click to toggle)
cdo 2.5.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 49,964 kB
  • sloc: cpp: 180,221; ansic: 95,352; sh: 7,292; f90: 6,089; makefile: 1,975; ruby: 1,078; csh: 1,020; python: 995; fortran: 319; pascal: 219; perl: 9
file content (33 lines) | stat: -rw-r--r-- 943 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
#! @PYTHON@

from cdoTest import *

HAS_NETCDF=cdo_check_req("has-nc")

OPERATORS=["reducegrid"]
GRIDS=["r18x9","icon_cell"]

test_module = TestModule()
for OPER in OPERATORS:
    for grid  in GRIDS:
        REFGRID=f'{DATAPATH}/{grid}_grid'
        REF=f'{DATAPATH}/griddes.{grid}'

        if (not HAS_NETCDF):
            test_module.add_skip("NetCDF not enabled")
            continue

        t=TAPTest(f'{OPER} {grid}')
        t.add(f'{CDO}  -f nc -temp,{REFGRID} data_{grid}.nc')
        t.add(f'{CDO}  -f nc -gtc,273.15 -temp,{REFGRID} mask_{grid}.nc')
        t.add(f'{CDO}  -f nc {OPER},mask_{grid}.nc data_{grid}.nc reduced_{grid}.nc')

        t.add(f'{CDO} -s griddes reduced_{grid}.nc | grep -v scanningMode > griddes.{grid}')
        t.add(f'diff griddes.{grid} {REF}')

        t.clean(f'reduced_{grid}.nc',f'griddes.{grid}')
        t.clean(f'data_{grid}.nc',f'mask_{grid}.nc')

        test_module.add(t)

test_module.run()