File: EOFcoeff.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-- 854 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
#! @PYTHON@
from cdoTest import *
import os

HAS_THREADS = cdo_check_req("has-threads")

os.environ['CDO_FILE_SUFFIX'] = "NULL"
os.environ['CDO_WEIGHT_MODE'] = "off"

FORMAT="-f srv -b 32"
OPERATORS=["eofcoeff","eofcoeff3d"]

IFILE=f'{DATAPATH}/psl_DJF_anom.grb'
RFILE=f'{DATAPATH}/pcoeff00000'
OFILE="res_pcoeff"

MODES=["jacobi","danielson_lanczos"]

test_module = TestModule()
for OPER in OPERATORS:
    for MODE in MODES:
        if HAS_THREADS:
            os.environ["CDO_SVD_MODE"]=MODE
            t=TAPTest(f'{OPER} {MODE}')
            t.add(f'{CDO} {FORMAT} {OPER} {DATAPATH}/eof_ref {IFILE} {OFILE}')
            t.add(f'{CDO} diff,abslim=0.02 -abs {OFILE}00000 -abs {RFILE}')
            test_module.clean(OFILE+"00000")
            test_module.add(t)
        else:
            test_module.add_skip("threads not enabled")

test_module.run()