Exemple #1
0
 def test_dynamic(self):
     omp_set_dynamic(True)
     dynamic = omp_get_dynamic()
     self.assertTrue(dynamic)
     
     omp_set_dynamic(False)
     dynamic = omp_get_dynamic()
     self.assertFalse(dynamic)
Exemple #2
0

class WRFInterpTest(ut.TestCase):
    longMessage = True


class WRFLatLonTest(ut.TestCase):
    longMessage = True


if __name__ == "__main__":
    from wrf import (omp_set_num_threads, omp_set_schedule, omp_get_schedule,
                     omp_set_dynamic, omp_get_num_procs, OMP_SCHED_STATIC)
    omp_set_num_threads(omp_get_num_procs() // 2)
    omp_set_schedule(OMP_SCHED_STATIC, 0)
    omp_set_dynamic(False)

    ignore_vars = []  # Not testable yet
    wrf_vars = [
        "avo", "eth", "cape_2d", "cape_3d", "ctt", "dbz", "mdbz", "geopt",
        "helicity", "lat", "lon", "omg", "p", "pressure", "pvo", "pw", "rh2",
        "rh", "slp", "ter", "td2", "td", "tc", "theta", "tk", "tv", "twb",
        "updraft_helicity", "ua", "va", "wa", "uvmet10", "uvmet", "z", "cfrac",
        "zstag", "geopt_stag", "height_agl", "wspd_wdir", "wspd_wdir10",
        "uvmet_wspd_wdir", "uvmet10_wspd_wdir"
    ]
    interp_methods = ["interplevel", "vertcross", "interpline", "vinterp"]
    latlon_tests = ["xy", "ll"]

    for dir, ref_nc_file, nest in zip(DIRS, REF_NC_FILES, NEST):
        try: