[MOAB-dev] commit/MOAB: danwu: Merged in danwu/shrink_unit_test_nc_files (pull request #30)
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Thu Jun 26 10:35:33 CDT 2014
1 new commit in MOAB:
https://bitbucket.org/fathomteam/moab/commits/2e78574e2151/
Changeset: 2e78574e2151
Branch: master
User: danwu
Date: 2014-06-26 17:35:27
Summary: Merged in danwu/shrink_unit_test_nc_files (pull request #30)
Shrink some unit test .nc files.
Affected #: 19 files
diff --git a/MeshFiles/unittest/io/Makefile.am b/MeshFiles/unittest/io/Makefile.am
index d40e02b..f259b82 100644
--- a/MeshFiles/unittest/io/Makefile.am
+++ b/MeshFiles/unittest/io/Makefile.am
@@ -2,11 +2,11 @@ EXTRA_DIST = HommeMapping.nc \
brick_cubit10.1.cub \
brick_cubit10.2.cub \
brick_cubit10.cub \
- eul26x48x96.t0.nc \
- eul26x48x96.t1.nc \
- eul26x48x96.t2.nc \
- eul26x48x96.t.3.nc \
- fv26x46x72.t.3.nc \
+ eul3x48x96.t0.nc \
+ eul3x48x96.t1.nc \
+ eul3x48x96.t2.nc \
+ eul3x48x96.t.3.nc \
+ fv3x46x72.t.3.nc \
cubtest12.cub \
cubtest14.cub \
cubtest.jou \
@@ -16,7 +16,7 @@ EXTRA_DIST = HommeMapping.nc \
hex_2x2x2_ss.exo \
ho_test.g \
ho_test.cub \
- homme26x3458.t.3.nc \
+ homme3x3458.t.3.nc \
singlecyl.cub \
singlecyl.ccmg \
test.cub \
diff --git a/MeshFiles/unittest/io/eul26x48x96.t.3.nc b/MeshFiles/unittest/io/eul26x48x96.t.3.nc
deleted file mode 100644
index fafba2a..0000000
Binary files a/MeshFiles/unittest/io/eul26x48x96.t.3.nc and /dev/null differ
diff --git a/MeshFiles/unittest/io/eul26x48x96.t0.nc b/MeshFiles/unittest/io/eul26x48x96.t0.nc
deleted file mode 100644
index 453105a..0000000
Binary files a/MeshFiles/unittest/io/eul26x48x96.t0.nc and /dev/null differ
diff --git a/MeshFiles/unittest/io/eul26x48x96.t1.nc b/MeshFiles/unittest/io/eul26x48x96.t1.nc
deleted file mode 100644
index 61a7c8f..0000000
Binary files a/MeshFiles/unittest/io/eul26x48x96.t1.nc and /dev/null differ
diff --git a/MeshFiles/unittest/io/eul26x48x96.t2.nc b/MeshFiles/unittest/io/eul26x48x96.t2.nc
deleted file mode 100644
index 239bd83..0000000
Binary files a/MeshFiles/unittest/io/eul26x48x96.t2.nc and /dev/null differ
diff --git a/MeshFiles/unittest/io/eul3x48x96.t.3.nc b/MeshFiles/unittest/io/eul3x48x96.t.3.nc
new file mode 100644
index 0000000..6c6e9b0
Binary files /dev/null and b/MeshFiles/unittest/io/eul3x48x96.t.3.nc differ
diff --git a/MeshFiles/unittest/io/eul3x48x96.t0.nc b/MeshFiles/unittest/io/eul3x48x96.t0.nc
new file mode 100644
index 0000000..2bd1298
Binary files /dev/null and b/MeshFiles/unittest/io/eul3x48x96.t0.nc differ
diff --git a/MeshFiles/unittest/io/eul3x48x96.t1.nc b/MeshFiles/unittest/io/eul3x48x96.t1.nc
new file mode 100644
index 0000000..aa2fa9d
Binary files /dev/null and b/MeshFiles/unittest/io/eul3x48x96.t1.nc differ
diff --git a/MeshFiles/unittest/io/eul3x48x96.t2.nc b/MeshFiles/unittest/io/eul3x48x96.t2.nc
new file mode 100644
index 0000000..4a81b3a
Binary files /dev/null and b/MeshFiles/unittest/io/eul3x48x96.t2.nc differ
diff --git a/MeshFiles/unittest/io/fv26x46x72.t.3.nc b/MeshFiles/unittest/io/fv26x46x72.t.3.nc
deleted file mode 100644
index 15ba5b4..0000000
Binary files a/MeshFiles/unittest/io/fv26x46x72.t.3.nc and /dev/null differ
diff --git a/MeshFiles/unittest/io/fv3x46x72.t.3.nc b/MeshFiles/unittest/io/fv3x46x72.t.3.nc
new file mode 100644
index 0000000..dcb05cb
Binary files /dev/null and b/MeshFiles/unittest/io/fv3x46x72.t.3.nc differ
diff --git a/MeshFiles/unittest/io/homme26x3458.t.3.nc b/MeshFiles/unittest/io/homme26x3458.t.3.nc
deleted file mode 100644
index c2218b9..0000000
Binary files a/MeshFiles/unittest/io/homme26x3458.t.3.nc and /dev/null differ
diff --git a/MeshFiles/unittest/io/homme3x3458.t.3.nc b/MeshFiles/unittest/io/homme3x3458.t.3.nc
new file mode 100644
index 0000000..e861dab
Binary files /dev/null and b/MeshFiles/unittest/io/homme3x3458.t.3.nc differ
diff --git a/examples/ReadWriteTest.cpp b/examples/ReadWriteTest.cpp
index 3ae6567..efdfd34 100644
--- a/examples/ReadWriteTest.cpp
+++ b/examples/ReadWriteTest.cpp
@@ -6,7 +6,7 @@
* used for stress test of reader/writer
* report times to read and write
*
- * example ReadWriteTest ../MeshFiles/io/fv26x46x72.t.3.nc out.nc \
+ * example ReadWriteTest ../MeshFiles/io/fv3x46x72.t.3.nc out.nc \
* -O PARALLEL=READ_PART;PARTITION_METHOD=SQIJ;PARALLEL_RESOLVE_SHARED_ENTS;VARIABLE=T,U; \
* -o PARALLEL=WRITE_PART;VARIABLE=T,U
*/
diff --git a/test/io/read_nc.cpp b/test/io/read_nc.cpp
index 369df83..f509c40 100644
--- a/test/io/read_nc.cpp
+++ b/test/io/read_nc.cpp
@@ -4,11 +4,11 @@
using namespace moab;
#ifdef MESHDIR
-static const char example_eul[] = STRINGIFY(MESHDIR) "/io/eul26x48x96.t.3.nc";
-static const char example_fv[] = STRINGIFY(MESHDIR) "/io/fv26x46x72.t.3.nc";
+static const char example_eul[] = STRINGIFY(MESHDIR) "/io/eul3x48x96.t.3.nc";
+static const char example_fv[] = STRINGIFY(MESHDIR) "/io/fv3x46x72.t.3.nc";
#else
-static const char example_eul[] = "/io/eul26x48x96.t.3.nc";
-static const char example_fv[] = "/io/fv26x46x72.t.3.nc";
+static const char example_eul[] = "/io/eul3x48x96.t.3.nc";
+static const char example_fv[] = "/io/fv3x46x72.t.3.nc";
#endif
#ifdef USE_MPI
@@ -35,6 +35,8 @@ void test_read_fv_ghosting();
ErrorCode get_options(std::string& opts);
+const int levels = 3;
+
int main(int argc, char* argv[])
{
int result = 0;
@@ -88,10 +90,10 @@ void test_read_eul_all()
// Check for proper tags
Tag Ttag0, Ttag1, coordTag;
- rval = mb.tag_get_handle("T0", 26, MB_TYPE_DOUBLE, Ttag0);
+ rval = mb.tag_get_handle("T0", levels, MB_TYPE_DOUBLE, Ttag0);
CHECK_ERR(rval);
- rval = mb.tag_get_handle("T1", 26, MB_TYPE_DOUBLE, Ttag1);
+ rval = mb.tag_get_handle("T1", levels, MB_TYPE_DOUBLE, Ttag1);
CHECK_ERR(rval);
rval = mb.tag_get_handle("COORDS", 3, MB_TYPE_DOUBLE, coordTag);
@@ -123,10 +125,10 @@ void test_read_eul_onevar()
// Check for proper tags
Tag Ttag0, Ttag1;
- rval = mb.tag_get_handle("T0", 26, MB_TYPE_DOUBLE, Ttag0);
+ rval = mb.tag_get_handle("T0", levels, MB_TYPE_DOUBLE, Ttag0);
CHECK_ERR(rval);
- rval = mb.tag_get_handle("T1", 26, MB_TYPE_DOUBLE, Ttag1);
+ rval = mb.tag_get_handle("T1", levels, MB_TYPE_DOUBLE, Ttag1);
CHECK_ERR(rval);
// Check values of tag T0 (first level) at some strategically chosen places below
@@ -139,7 +141,7 @@ void test_read_eul_onevar()
#endif
const double eps = 0.0001;
- double val[8 * 26];
+ double val[8 * levels];
if (1 == procs) {
Range global_quads;
@@ -151,14 +153,14 @@ void test_read_eul_onevar()
global_quads[48], global_quads[2303], global_quads[2352], global_quads[4607]};
rval = mb.tag_get_data(Ttag0, &gloabl_quad_ents[0], 8, val);
- CHECK_REAL_EQUAL(252.8529, val[0 * 26], eps); // First global quad
- CHECK_REAL_EQUAL(234.8390, val[1 * 26], eps); // 2256th global quad
- CHECK_REAL_EQUAL(232.6458, val[2 * 26], eps); // 2305th global quad
- CHECK_REAL_EQUAL(205.3905, val[3 * 26], eps); // 4560th global quad
- CHECK_REAL_EQUAL(252.7116, val[4 * 26], eps); // 49th global quad
- CHECK_REAL_EQUAL(232.6670, val[5 * 26], eps); // 2304th global quad
- CHECK_REAL_EQUAL(234.6922, val[6 * 26], eps); // 2353th global quad
- CHECK_REAL_EQUAL(200.6828, val[7 * 26], eps); // Last global quad
+ CHECK_REAL_EQUAL(252.8529, val[0 * levels], eps); // First global quad
+ CHECK_REAL_EQUAL(234.8390, val[1 * levels], eps); // 2256th global quad
+ CHECK_REAL_EQUAL(232.6458, val[2 * levels], eps); // 2305th global quad
+ CHECK_REAL_EQUAL(205.3905, val[3 * levels], eps); // 4560th global quad
+ CHECK_REAL_EQUAL(252.7116, val[4 * levels], eps); // 49th global quad
+ CHECK_REAL_EQUAL(232.6670, val[5 * levels], eps); // 2304th global quad
+ CHECK_REAL_EQUAL(234.6922, val[6 * levels], eps); // 2353th global quad
+ CHECK_REAL_EQUAL(200.6828, val[7 * levels], eps); // Last global quad
}
else if (2 == procs) {
Range local_quads;
@@ -170,16 +172,16 @@ void test_read_eul_onevar()
rval = mb.tag_get_data(Ttag0, &local_quad_ents[0], 4, val);
if (0 == rank) {
- CHECK_REAL_EQUAL(252.8529, val[0 * 26], eps); // First local quad, first global quad
- CHECK_REAL_EQUAL(234.8390, val[1 * 26], eps); // Median local quad, 2256th global quad
- CHECK_REAL_EQUAL(232.6458, val[2 * 26], eps); // Median local quad, 2305th global quad
- CHECK_REAL_EQUAL(205.3905, val[3 * 26], eps); // Last local quad, 4560th global quad
+ CHECK_REAL_EQUAL(252.8529, val[0 * levels], eps); // First local quad, first global quad
+ CHECK_REAL_EQUAL(234.8390, val[1 * levels], eps); // Median local quad, 2256th global quad
+ CHECK_REAL_EQUAL(232.6458, val[2 * levels], eps); // Median local quad, 2305th global quad
+ CHECK_REAL_EQUAL(205.3905, val[3 * levels], eps); // Last local quad, 4560th global quad
}
else if (1 == rank) {
- CHECK_REAL_EQUAL(252.7116, val[0 * 26], eps); // First local quad, 49th global quad
- CHECK_REAL_EQUAL(232.6670, val[1 * 26], eps); // Median local quad, 2304th global quad
- CHECK_REAL_EQUAL(234.6922, val[2 * 26], eps); // Median local quad, 2353th global quad
- CHECK_REAL_EQUAL(200.6828, val[3 * 26], eps); // Last local quad, last global quad
+ CHECK_REAL_EQUAL(252.7116, val[0 * levels], eps); // First local quad, 49th global quad
+ CHECK_REAL_EQUAL(232.6670, val[1 * levels], eps); // Median local quad, 2304th global quad
+ CHECK_REAL_EQUAL(234.6922, val[2 * levels], eps); // Median local quad, 2353th global quad
+ CHECK_REAL_EQUAL(200.6828, val[3 * levels], eps); // Last local quad, last global quad
}
}
}
@@ -198,10 +200,10 @@ void test_read_eul_onetimestep()
// Check for proper tags
Tag Ttag0, Ttag1;
- rval = mb.tag_get_handle("T0", 26, MB_TYPE_DOUBLE, Ttag0);
+ rval = mb.tag_get_handle("T0", levels, MB_TYPE_DOUBLE, Ttag0);
CHECK_EQUAL(rval, MB_TAG_NOT_FOUND);
- rval = mb.tag_get_handle("T1", 26, MB_TYPE_DOUBLE, Ttag1);
+ rval = mb.tag_get_handle("T1", levels, MB_TYPE_DOUBLE, Ttag1);
CHECK_ERR(rval);
}
@@ -225,10 +227,10 @@ void test_read_eul_nomesh()
// Check for proper tag
Tag Ttag0, Ttag1;
- rval = mb.tag_get_handle("T0", 26, MB_TYPE_DOUBLE, Ttag0);
+ rval = mb.tag_get_handle("T0", levels, MB_TYPE_DOUBLE, Ttag0);
CHECK_ERR(rval);
- rval = mb.tag_get_handle("T1", 26, MB_TYPE_DOUBLE, Ttag1);
+ rval = mb.tag_get_handle("T1", levels, MB_TYPE_DOUBLE, Ttag1);
CHECK_EQUAL(rval, MB_TAG_NOT_FOUND);
// Now read 2nd timestep with nomesh option
@@ -237,7 +239,7 @@ void test_read_eul_nomesh()
CHECK_ERR(rval);
// Check for proper tag
- rval = mb.tag_get_handle("T1", 26, MB_TYPE_DOUBLE, Ttag1);
+ rval = mb.tag_get_handle("T1", levels, MB_TYPE_DOUBLE, Ttag1);
CHECK_ERR(rval);
}
@@ -265,17 +267,17 @@ void test_read_eul_novars()
// Check for proper tag
Tag Ttag0, Ttag1;
- rval = mb.tag_get_handle("T0", 26, MB_TYPE_DOUBLE, Ttag0);
+ rval = mb.tag_get_handle("T0", levels, MB_TYPE_DOUBLE, Ttag0);
CHECK_EQUAL(rval, MB_TAG_NOT_FOUND);
opts = orig + std::string(";VARIABLE=T;TIMESTEP=0;NOMESH");
rval = mb.load_file(example_eul, &set, opts.c_str());
CHECK_ERR(rval);
- rval = mb.tag_get_handle("T0", 26, MB_TYPE_DOUBLE, Ttag0);
+ rval = mb.tag_get_handle("T0", levels, MB_TYPE_DOUBLE, Ttag0);
CHECK_ERR(rval);
- rval = mb.tag_get_handle("T1", 26, MB_TYPE_DOUBLE, Ttag1);
+ rval = mb.tag_get_handle("T1", levels, MB_TYPE_DOUBLE, Ttag1);
CHECK_EQUAL(rval, MB_TAG_NOT_FOUND);
// Now read 2nd timestep with nomesh option
@@ -284,7 +286,7 @@ void test_read_eul_novars()
CHECK_ERR(rval);
// Check for proper tag
- rval = mb.tag_get_handle("T1", 26, MB_TYPE_DOUBLE, Ttag1);
+ rval = mb.tag_get_handle("T1", levels, MB_TYPE_DOUBLE, Ttag1);
CHECK_ERR(rval);
}
@@ -302,10 +304,10 @@ void test_read_fv_all()
// Check for proper tags
Tag Ttag0, Ttag1, coordTag;
- rval = mb.tag_get_handle("T0", 26, MB_TYPE_DOUBLE, Ttag0);
+ rval = mb.tag_get_handle("T0", levels, MB_TYPE_DOUBLE, Ttag0);
CHECK_ERR(rval);
- rval = mb.tag_get_handle("T1", 26, MB_TYPE_DOUBLE, Ttag1);
+ rval = mb.tag_get_handle("T1", levels, MB_TYPE_DOUBLE, Ttag1);
CHECK_ERR(rval);
rval = mb.tag_get_handle("COORDS", 3, MB_TYPE_DOUBLE, coordTag);
@@ -326,10 +328,10 @@ void test_read_fv_onevar()
// Check for proper tags
Tag Ttag0, Ttag1;
- rval = mb.tag_get_handle("T0", 26, MB_TYPE_DOUBLE, Ttag0);
+ rval = mb.tag_get_handle("T0", levels, MB_TYPE_DOUBLE, Ttag0);
CHECK_ERR(rval);
- rval = mb.tag_get_handle("T1", 26, MB_TYPE_DOUBLE, Ttag1);
+ rval = mb.tag_get_handle("T1", levels, MB_TYPE_DOUBLE, Ttag1);
CHECK_ERR(rval);
// Check values of tag T0 (first level) at some strategically chosen places below
@@ -342,7 +344,7 @@ void test_read_fv_onevar()
#endif
const double eps = 0.0001;
- double val[8 * 26];
+ double val[8 * levels];
if (1 == procs) {
Range global_quads;
@@ -354,14 +356,14 @@ void test_read_fv_onevar()
global_quads[36], global_quads[1655], global_quads[1692], global_quads[3311]};
rval = mb.tag_get_data(Ttag0, &gloabl_quad_ents[0], 8, val);
- CHECK_REAL_EQUAL(253.6048, val[0 * 26], eps); // First global quad
- CHECK_REAL_EQUAL(232.2170, val[1 * 26], eps); // 1620th global quad
- CHECK_REAL_EQUAL(232.7454, val[2 * 26], eps); // 1657th global quad
- CHECK_REAL_EQUAL(210.2581, val[3 * 26], eps); // 3276th global quad
- CHECK_REAL_EQUAL(253.6048, val[4 * 26], eps); // 37th global quad
- CHECK_REAL_EQUAL(232.9553, val[5 * 26], eps); // 1656th global quad
- CHECK_REAL_EQUAL(232.1704, val[6 * 26], eps); // 1693th global quad
- CHECK_REAL_EQUAL(210.2581, val[7 * 26], eps); // Last global quad
+ CHECK_REAL_EQUAL(253.6048, val[0 * levels], eps); // First global quad
+ CHECK_REAL_EQUAL(232.2170, val[1 * levels], eps); // 1620th global quad
+ CHECK_REAL_EQUAL(232.7454, val[2 * levels], eps); // 1657th global quad
+ CHECK_REAL_EQUAL(210.2581, val[3 * levels], eps); // 3276th global quad
+ CHECK_REAL_EQUAL(253.6048, val[4 * levels], eps); // 37th global quad
+ CHECK_REAL_EQUAL(232.9553, val[5 * levels], eps); // 1656th global quad
+ CHECK_REAL_EQUAL(232.1704, val[6 * levels], eps); // 1693th global quad
+ CHECK_REAL_EQUAL(210.2581, val[7 * levels], eps); // Last global quad
}
else if (2 == procs) {
Range local_quads;
@@ -373,16 +375,16 @@ void test_read_fv_onevar()
rval = mb.tag_get_data(Ttag0, &local_quad_ents[0], 4, val);
if (0 == rank) {
- CHECK_REAL_EQUAL(253.6048, val[0 * 26], eps); // First local quad, first global quad
- CHECK_REAL_EQUAL(232.2170, val[1 * 26], eps); // Median local quad, 1620th global quad
- CHECK_REAL_EQUAL(232.7454, val[2 * 26], eps); // Median local quad, 1657th global quad
- CHECK_REAL_EQUAL(210.2581, val[3 * 26], eps); // Last local quad, 3276th global quad
+ CHECK_REAL_EQUAL(253.6048, val[0 * levels], eps); // First local quad, first global quad
+ CHECK_REAL_EQUAL(232.2170, val[1 * levels], eps); // Median local quad, 1620th global quad
+ CHECK_REAL_EQUAL(232.7454, val[2 * levels], eps); // Median local quad, 1657th global quad
+ CHECK_REAL_EQUAL(210.2581, val[3 * levels], eps); // Last local quad, 3276th global quad
}
else if (1 == rank) {
- CHECK_REAL_EQUAL(253.6048, val[0 * 26], eps); // First local quad, 37th global quad
- CHECK_REAL_EQUAL(232.9553, val[1 * 26], eps); // Median local quad, 1656th global quad
- CHECK_REAL_EQUAL(232.1704, val[2 * 26], eps); // Median local quad, 1693th global quad
- CHECK_REAL_EQUAL(210.2581, val[3 * 26], eps); // Last local quad, last global quad
+ CHECK_REAL_EQUAL(253.6048, val[0 * levels], eps); // First local quad, 37th global quad
+ CHECK_REAL_EQUAL(232.9553, val[1 * levels], eps); // Median local quad, 1656th global quad
+ CHECK_REAL_EQUAL(232.1704, val[2 * levels], eps); // Median local quad, 1693th global quad
+ CHECK_REAL_EQUAL(210.2581, val[3 * levels], eps); // Last local quad, last global quad
}
}
}
@@ -401,10 +403,10 @@ void test_read_fv_onetimestep()
// Check for proper tags
Tag Ttag0, Ttag1;
- rval = mb.tag_get_handle("T0", 26, MB_TYPE_DOUBLE, Ttag0);
+ rval = mb.tag_get_handle("T0", levels, MB_TYPE_DOUBLE, Ttag0);
CHECK_EQUAL(rval, MB_TAG_NOT_FOUND);
- rval = mb.tag_get_handle("T1", 26, MB_TYPE_DOUBLE, Ttag1);
+ rval = mb.tag_get_handle("T1", levels, MB_TYPE_DOUBLE, Ttag1);
CHECK_ERR(rval);
// Check for some tags with double underscore in the tag name
@@ -439,10 +441,10 @@ void test_read_fv_nomesh()
// Check for proper tag
Tag Ttag0, Ttag1;
- rval = mb.tag_get_handle("T0", 26, MB_TYPE_DOUBLE, Ttag0);
+ rval = mb.tag_get_handle("T0", levels, MB_TYPE_DOUBLE, Ttag0);
CHECK_ERR(rval);
- rval = mb.tag_get_handle("T1", 26, MB_TYPE_DOUBLE, Ttag1);
+ rval = mb.tag_get_handle("T1", levels, MB_TYPE_DOUBLE, Ttag1);
CHECK_EQUAL(rval, MB_TAG_NOT_FOUND);
// Now read 2nd timestep with nomesh option
@@ -451,7 +453,7 @@ void test_read_fv_nomesh()
CHECK_ERR(rval);
// Check for proper tag
- rval = mb.tag_get_handle("T1", 26, MB_TYPE_DOUBLE, Ttag1);
+ rval = mb.tag_get_handle("T1", levels, MB_TYPE_DOUBLE, Ttag1);
CHECK_ERR(rval);
}
@@ -479,17 +481,17 @@ void test_read_fv_novars()
// Check for proper tag
Tag Ttag0, Ttag1;
- rval = mb.tag_get_handle("T0", 26, MB_TYPE_DOUBLE, Ttag0);
+ rval = mb.tag_get_handle("T0", levels, MB_TYPE_DOUBLE, Ttag0);
CHECK_EQUAL(rval, MB_TAG_NOT_FOUND);
opts = orig + std::string(";VARIABLE=T;TIMESTEP=0;NOMESH");
rval = mb.load_file(example_fv, &set, opts.c_str());
CHECK_ERR(rval);
- rval = mb.tag_get_handle("T0", 26, MB_TYPE_DOUBLE, Ttag0);
+ rval = mb.tag_get_handle("T0", levels, MB_TYPE_DOUBLE, Ttag0);
CHECK_ERR(rval);
- rval = mb.tag_get_handle("T1", 26, MB_TYPE_DOUBLE, Ttag1);
+ rval = mb.tag_get_handle("T1", levels, MB_TYPE_DOUBLE, Ttag1);
CHECK_EQUAL(rval, MB_TAG_NOT_FOUND);
// Now read 2nd timestep with nomesh option
@@ -498,7 +500,7 @@ void test_read_fv_novars()
CHECK_ERR(rval);
// Check for proper tag
- rval = mb.tag_get_handle("T1", 26, MB_TYPE_DOUBLE, Ttag1);
+ rval = mb.tag_get_handle("T1", levels, MB_TYPE_DOUBLE, Ttag1);
CHECK_ERR(rval);
}
diff --git a/test/io/read_ucd_nc.cpp b/test/io/read_ucd_nc.cpp
index 561d68a..56d9606 100644
--- a/test/io/read_ucd_nc.cpp
+++ b/test/io/read_ucd_nc.cpp
@@ -7,10 +7,10 @@
using namespace moab;
#ifdef MESHDIR
-static const char example[] = STRINGIFY(MESHDIR) "/io/homme26x3458.t.3.nc";
+static const char example[] = STRINGIFY(MESHDIR) "/io/homme3x3458.t.3.nc";
static const char conn_fname[] = STRINGIFY(MESHDIR) "/io/HommeMapping.nc";
#else
-static const char example[] = "/io/homme26x3458.t.3.nc";
+static const char example[] = "/io/homme3x3458.t.3.nc";
static const char conn_fname[] = "io/HommeMapping.nc";
#endif
@@ -30,6 +30,8 @@ void test_read_conn(); // Test reading connectivity file only
void get_options(std::string& opts);
+const int levels = 3;
+
int main(int argc, char* argv[])
{
int result = 0;
@@ -73,10 +75,10 @@ void test_read_all()
// Check for proper tags
Tag Ttag0, Ttag1;
- rval = mb.tag_get_handle("T0", 26, MB_TYPE_DOUBLE, Ttag0);
+ rval = mb.tag_get_handle("T0", levels, MB_TYPE_DOUBLE, Ttag0);
CHECK_ERR(rval);
- rval = mb.tag_get_handle("T1", 26, MB_TYPE_DOUBLE, Ttag1);
+ rval = mb.tag_get_handle("T1", levels, MB_TYPE_DOUBLE, Ttag1);
CHECK_ERR(rval);
}
@@ -103,9 +105,9 @@ void test_read_onevar()
if (1 == procs) {
// Check for proper tags
Tag Ttag0, Ttag1;
- rval = mb.tag_get_handle("T0", 26, MB_TYPE_DOUBLE, Ttag0);
+ rval = mb.tag_get_handle("T0", levels, MB_TYPE_DOUBLE, Ttag0);
CHECK_ERR(rval);
- rval = mb.tag_get_handle("T1", 26, MB_TYPE_DOUBLE, Ttag1);
+ rval = mb.tag_get_handle("T1", levels, MB_TYPE_DOUBLE, Ttag1);
CHECK_ERR(rval);
// Get vertices
@@ -125,10 +127,10 @@ void test_read_onevar()
double* data = (double*) Tbuf;
// Check first level values on 4 strategically selected vertices
- CHECK_REAL_EQUAL(233.1136, data[0 * 26], eps); // First vert
- CHECK_REAL_EQUAL(236.1505, data[1728 * 26], eps); // Median vert
- CHECK_REAL_EQUAL(235.7722, data[1729 * 26], eps); // Median vert
- CHECK_REAL_EQUAL(234.0416, data[3457 * 26], eps); // Last vert
+ CHECK_REAL_EQUAL(233.1136, data[0 * levels], eps); // First vert
+ CHECK_REAL_EQUAL(236.1505, data[1728 * levels], eps); // Median vert
+ CHECK_REAL_EQUAL(235.7722, data[1729 * levels], eps); // Median vert
+ CHECK_REAL_EQUAL(234.0416, data[3457 * levels], eps); // Last vert
}
}
@@ -146,10 +148,10 @@ void test_read_onetimestep()
// Check for proper tags
Tag Ttag0, Ttag1;
- rval = mb.tag_get_handle("T0", 26, MB_TYPE_DOUBLE, Ttag0);
+ rval = mb.tag_get_handle("T0", levels, MB_TYPE_DOUBLE, Ttag0);
CHECK_EQUAL(rval, MB_TAG_NOT_FOUND);
- rval = mb.tag_get_handle("T1", 26, MB_TYPE_DOUBLE, Ttag1);
+ rval = mb.tag_get_handle("T1", levels, MB_TYPE_DOUBLE, Ttag1);
CHECK_ERR(rval);
}
@@ -172,10 +174,10 @@ void test_read_nomesh()
// Check for proper tag
Tag Ttag0, Ttag1;
- rval = mb.tag_get_handle("T0", 26, MB_TYPE_DOUBLE, Ttag0);
+ rval = mb.tag_get_handle("T0", levels, MB_TYPE_DOUBLE, Ttag0);
CHECK_ERR(rval);
- rval = mb.tag_get_handle("T1", 26, MB_TYPE_DOUBLE, Ttag1);
+ rval = mb.tag_get_handle("T1", levels, MB_TYPE_DOUBLE, Ttag1);
CHECK_EQUAL(rval, MB_TAG_NOT_FOUND);
// Now read 2nd timestep with nomesh option
@@ -184,7 +186,7 @@ void test_read_nomesh()
CHECK_ERR(rval);
// Check for proper tag
- rval = mb.tag_get_handle("T1", 26, MB_TYPE_DOUBLE, Ttag1);
+ rval = mb.tag_get_handle("T1", levels, MB_TYPE_DOUBLE, Ttag1);
CHECK_ERR(rval);
}
@@ -211,17 +213,17 @@ void test_read_novars()
// Check for proper tag
Tag Ttag0, Ttag1;
- rval = mb.tag_get_handle("T0", 26, MB_TYPE_DOUBLE, Ttag0);
+ rval = mb.tag_get_handle("T0", levels, MB_TYPE_DOUBLE, Ttag0);
CHECK_EQUAL(rval, MB_TAG_NOT_FOUND);
opts = orig + std::string(";VARIABLE=T;TIMESTEP=0;NOMESH");
rval = mb.load_file(example, &set, opts.c_str());
CHECK_ERR(rval);
- rval = mb.tag_get_handle("T0", 26, MB_TYPE_DOUBLE, Ttag0);
+ rval = mb.tag_get_handle("T0", levels, MB_TYPE_DOUBLE, Ttag0);
CHECK_ERR(rval);
- rval = mb.tag_get_handle("T1", 26, MB_TYPE_DOUBLE, Ttag1);
+ rval = mb.tag_get_handle("T1", levels, MB_TYPE_DOUBLE, Ttag1);
CHECK_EQUAL(rval, MB_TAG_NOT_FOUND);
// Now read 2nd timestep with nomesh option
@@ -230,7 +232,7 @@ void test_read_novars()
CHECK_ERR(rval);
// Check for proper tag
- rval = mb.tag_get_handle("T1", 26, MB_TYPE_DOUBLE, Ttag1);
+ rval = mb.tag_get_handle("T1", levels, MB_TYPE_DOUBLE, Ttag1);
CHECK_ERR(rval);
}
@@ -266,11 +268,11 @@ void test_read_coord_vars()
// Check lev tag size and values on file_set
rval = mb.tag_get_by_ptr(var_tag, &file_set, 1, &var_data, &var_len);
CHECK_ERR(rval);
- CHECK_EQUAL(26, var_len);
+ CHECK_EQUAL(levels, var_len);
double* lev_val = (double*)var_data;
const double eps = 1e-10;
CHECK_REAL_EQUAL(3.54463800000002, lev_val[0], eps);
- CHECK_REAL_EQUAL(992.556100000005, lev_val[25], eps);
+ CHECK_REAL_EQUAL(13.9672100000001, lev_val[levels - 1], eps);
// Check tag for dummy coordinate variable ncol
tag_name = "ncol";
@@ -307,10 +309,10 @@ void test_read_coord_vars()
// Check lev tag size and values on file_set2
rval = mb.tag_get_by_ptr(var_tag, &file_set2, 1, &var_data, &var_len);
CHECK_ERR(rval);
- CHECK_EQUAL(26, var_len);
+ CHECK_EQUAL(levels, var_len);
lev_val = (double*)var_data;
CHECK_REAL_EQUAL(3.54463800000002, lev_val[0], eps);
- CHECK_REAL_EQUAL(992.556100000005, lev_val[25], eps);
+ CHECK_REAL_EQUAL(13.9672100000001, lev_val[levels - 1], eps);
// Check tag for dummy coordinate variable ncol
tag_name = "ncol";
@@ -368,7 +370,7 @@ void test_gather_onevar()
}
Tag Ttag0, gid_tag;
- rval = mb.tag_get_handle("T0", 26, MB_TYPE_DOUBLE, Ttag0, MB_TAG_DENSE);
+ rval = mb.tag_get_handle("T0", levels, MB_TYPE_DOUBLE, Ttag0, MB_TAG_DENSE);
CHECK_ERR(rval);
rval = mb.tag_get_handle(GLOBAL_ID_TAG_NAME, 1, MB_TYPE_INTEGER, gid_tag, MB_TAG_DENSE);
@@ -384,7 +386,7 @@ void test_gather_onevar()
CHECK_EQUAL((size_t)3458, gather_set_verts.size());
// Get T0 tag values on 4 strategically selected gather set vertices
- double T0_val[4 * 26];
+ double T0_val[4 * levels];
EntityHandle vert_ents[] = {gather_set_verts[0], gather_set_verts[1728],
gather_set_verts[1729], gather_set_verts[3457]};
rval = mb.tag_get_data(Ttag0, vert_ents, 4, T0_val);
@@ -393,10 +395,10 @@ void test_gather_onevar()
const double eps = 0.001;
// Check first level values
- CHECK_REAL_EQUAL(233.1136, T0_val[0 * 26], eps); // First vert
- CHECK_REAL_EQUAL(236.1505, T0_val[1 * 26], eps); // Median vert
- CHECK_REAL_EQUAL(235.7722, T0_val[2 * 26], eps); // Median vert
- CHECK_REAL_EQUAL(234.0416, T0_val[3 * 26], eps); // Last vert
+ CHECK_REAL_EQUAL(233.1136, T0_val[0 * levels], eps); // First vert
+ CHECK_REAL_EQUAL(236.1505, T0_val[1 * levels], eps); // Median vert
+ CHECK_REAL_EQUAL(235.7722, T0_val[2 * levels], eps); // Median vert
+ CHECK_REAL_EQUAL(234.0416, T0_val[3 * levels], eps); // Last vert
}
#endif
}
diff --git a/test/io/write_nc.cpp b/test/io/write_nc.cpp
index d0ee024..99ccff5 100644
--- a/test/io/write_nc.cpp
+++ b/test/io/write_nc.cpp
@@ -4,21 +4,21 @@
using namespace moab;
#ifdef MESHDIR
-static const char example_eul[] = STRINGIFY(MESHDIR) "/io/eul26x48x96.t.3.nc";
-static const char example_eul_t0[] = STRINGIFY(MESHDIR) "/io/eul26x48x96.t0.nc";
-static const char example_eul_t1[] = STRINGIFY(MESHDIR) "/io/eul26x48x96.t1.nc";
-static const char example_eul_t2[] = STRINGIFY(MESHDIR) "/io/eul26x48x96.t2.nc";
-static const char example_fv[] = STRINGIFY(MESHDIR) "/io/fv26x46x72.t.3.nc";
-static const char example_homme[] = STRINGIFY(MESHDIR) "/io/homme26x3458.t.3.nc";
+static const char example_eul[] = STRINGIFY(MESHDIR) "/io/eul3x48x96.t.3.nc";
+static const char example_eul_t0[] = STRINGIFY(MESHDIR) "/io/eul3x48x96.t0.nc";
+static const char example_eul_t1[] = STRINGIFY(MESHDIR) "/io/eul3x48x96.t1.nc";
+static const char example_eul_t2[] = STRINGIFY(MESHDIR) "/io/eul3x48x96.t2.nc";
+static const char example_fv[] = STRINGIFY(MESHDIR) "/io/fv3x46x72.t.3.nc";
+static const char example_homme[] = STRINGIFY(MESHDIR) "/io/homme3x3458.t.3.nc";
static const char example_mpas[] = STRINGIFY(MESHDIR) "/io/mpasx1.642.t.2.nc";
static const char example_gcrm[] = STRINGIFY(MESHDIR) "/io/gcrm_r3.nc";
#else
-static const char example_eul[] = "/io/eul26x48x96.t.3.nc";
-static const char example_eul_t0[] = "/io/eul26x48x96.t0.nc";
-static const char example_eul_t1[] = "/io/eul26x48x96.t1.nc";
-static const char example_eul_t2[] = "/io/eul26x48x96.t2.nc";
-static const char example_fv[] = "/io/fv26x46x72.t.3.nc";
-static const char example_homme[] = "/io/homme26x3458.t.3.nc";
+static const char example_eul[] = "/io/eul3x48x96.t.3.nc";
+static const char example_eul_t0[] = "/io/eul3x48x96.t0.nc";
+static const char example_eul_t1[] = "/io/eul3x48x96.t1.nc";
+static const char example_eul_t2[] = "/io/eul3x48x96.t2.nc";
+static const char example_fv[] = "/io/fv3x46x72.t.3.nc";
+static const char example_homme[] = "/io/homme3x3458.t.3.nc";
static const char example_mpas[] = "/io/mpasx1.642.t.2.nc";
static const char example_gcrm[] = "/io/gcrm_r3.nc";
#endif
@@ -82,7 +82,8 @@ void get_homme_read_options(std::string& opts);
void get_mpas_read_options(std::string& opts);
const double eps = 1e-10;
-const int levels = 3; // Number of levels to be checked (e.g. 3 out of 26)
+const int levels = 3;
+const int mpas_levels = 1;
int main(int argc, char* argv[])
{
@@ -730,10 +731,10 @@ void test_mpas_check_vars()
#endif
NCDF_SIZE start[] = {0, 0, 0};
- NCDF_SIZE count[] = {2, 1, 1};
- const int size1 = 2 * 1280;
- const int size2 = 2 * 1920;
- const int size3 = 2 * 642;
+ NCDF_SIZE count[] = {2, 1, mpas_levels};
+ const int size1 = 2 * 1280 * mpas_levels;
+ const int size2 = 2 * 1920 * mpas_levels;
+ const int size3 = 2 * 642 * mpas_levels;
// Read vertex variable vorticity from output file
count[1] = 1280;
@@ -933,10 +934,10 @@ void test_gcrm_check_vars()
#endif
NCDF_SIZE start[] = {0, 0, 0};
- NCDF_SIZE count[] = {2, 1, 3};
- const int size1 = 2 * 1280 * 3;
- const int size2 = 2 * 1920 * 3;
- const int size3 = 2 * 642 * 3;
+ NCDF_SIZE count[] = {2, 1, levels};
+ const int size1 = 2 * 1280 * levels;
+ const int size2 = 2 * 1920 * levels;
+ const int size3 = 2 * 642 * levels;
// Read vertex variable u from output file
count[1] = 1280;
@@ -971,12 +972,12 @@ void test_gcrm_check_vars()
success = NCFUNC(get_vara_double)(ncid_ref, vorticity_id_ref, start, count, vorticity_vals_ref);
CHECK_EQUAL(0, success);
- // Read variable pressure from output file
+ // Read cell variable pressure from output file
double pressure_vals[size3];
success = NCFUNC(get_vara_double)(ncid, pressure_id, start, count, pressure_vals);
CHECK_EQUAL(0, success);
- // Read variable pressure from reference file
+ // Read cell variable pressure from reference file
double pressure_vals_ref[size3];
success = NCFUNC(get_vara_double)(ncid_ref, pressure_id_ref, start, count, pressure_vals_ref);
CHECK_EQUAL(0, success);
@@ -1007,7 +1008,7 @@ void test_gcrm_check_vars()
for (int i = 0; i < size2; i++)
CHECK_REAL_EQUAL(wind_vals_ref[i], wind_vals[i], eps);
- // Check vorticity and pressuer values
+ // Check vorticity and pressure values
for (int i = 0; i < size3; i++) {
CHECK_REAL_EQUAL(vorticity_vals_ref[i], vorticity_vals[i], eps);
CHECK_REAL_EQUAL(pressure_vals_ref[i], pressure_vals[i], eps);
diff --git a/test/parallel/scdpart.cpp b/test/parallel/scdpart.cpp
index 87bdab5..b673d8f 100644
--- a/test/parallel/scdpart.cpp
+++ b/test/parallel/scdpart.cpp
@@ -8,9 +8,9 @@
using namespace moab;
#ifdef MESHDIR
-static const char example[] = STRINGIFY(MESHDIR) "/io/eul26x48x96.t.3.nc";
+static const char example[] = STRINGIFY(MESHDIR) "/io/eul3x48x96.t.3.nc";
#else
-static const char example[] = "/io/eul26x48x96.t.3.nc";
+static const char example[] = "/io/eul3x48x96.t.3.nc";
#endif
void test_read_parallel(int nverts);
@@ -18,6 +18,7 @@ void test_read_parallel_alljorkori();
void test_read_parallel_alljkbal();
void test_read_parallel_sqij();
void test_read_parallel_sqjk();
+
std::string partition_method;
int main(int argc, char **argv)
@@ -34,7 +35,6 @@ int main(int argc, char **argv)
return result;
}
-
void test_read_parallel_alljorkori()
{
partition_method = std::string(";PARTITION_METHOD=alljorkori");
@@ -89,4 +89,3 @@ void test_read_parallel(int num_verts)
if (0 == pcomm->proc_config().proc_rank()) CHECK_EQUAL(total_verts, num_verts);
}
-
diff --git a/test/parallel/ucdtrvpart.cpp b/test/parallel/ucdtrvpart.cpp
index 0800b4c..cdd5e70 100644
--- a/test/parallel/ucdtrvpart.cpp
+++ b/test/parallel/ucdtrvpart.cpp
@@ -8,7 +8,7 @@
using namespace moab;
#ifdef MESHDIR
-static const char example[] = STRINGIFY(MESHDIR) "/io/homme26x3458.t.3.nc";
+static const char example[] = STRINGIFY(MESHDIR) "/io/homme3x3458.t.3.nc";
#endif
void test_read_parallel_ucd_trivial();
@@ -18,6 +18,7 @@ void test_read_parallel(int num_verts, bool test_nb_nodes);
void test_multiple_loads_of_same_file();
std::string partition_method;
+const int levels = 3;
int main(int argc, char* argv[])
{
@@ -192,7 +193,7 @@ void test_multiple_loads_of_same_file()
}
Tag Ttag0;
- rval = mb.tag_get_handle("T0", 26, MB_TYPE_DOUBLE, Ttag0, MB_TAG_DENSE);
+ rval = mb.tag_get_handle("T0", levels, MB_TYPE_DOUBLE, Ttag0, MB_TAG_DENSE);
CHECK_ERR(rval);
int count;
@@ -205,14 +206,14 @@ void test_multiple_loads_of_same_file()
double* data = (double*) Tbuf;
if (0 == rank) {
- CHECK_REAL_EQUAL(233.1136, data[0 * 26], eps); // First vert
- CHECK_REAL_EQUAL(237.1977, data[912 * 26], eps); // Median vert
- CHECK_REAL_EQUAL(234.9711, data[1824 * 26], eps); // Last vert
+ CHECK_REAL_EQUAL(233.1136, data[0 * levels], eps); // First vert
+ CHECK_REAL_EQUAL(237.1977, data[912 * levels], eps); // Median vert
+ CHECK_REAL_EQUAL(234.9711, data[1824 * levels], eps); // Last vert
}
else if (1 == rank) {
- CHECK_REAL_EQUAL(233.1136, data[0 * 26], eps); // First vert
- CHECK_REAL_EQUAL(231.0446, data[912 * 26], eps); // Median vert
- CHECK_REAL_EQUAL(234.0416, data[1824 * 26], eps); // Last vert
+ CHECK_REAL_EQUAL(233.1136, data[0 * levels], eps); // First vert
+ CHECK_REAL_EQUAL(231.0446, data[912 * levels], eps); // Median vert
+ CHECK_REAL_EQUAL(234.0416, data[1824 * levels], eps); // Last vert
}
}
}
Repository URL: https://bitbucket.org/fathomteam/moab/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the moab-dev
mailing list