diff --git a/.gitattributes b/.gitattributes index 4468522e11a6b415755e3e7a00d6df84cde1db5c..b6e96457378deb097eda9f863c9bc0abd5e0f37f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -27,6 +27,7 @@ *.pvtu* filter=lfs diff=lfs merge=lfs -text *.gif filter=lfs diff=lfs merge=lfs -text *.mp4 filter=lfs diff=lfs merge=lfs -text +*.nc filter=lfs diff=lfs merge=lfs -text web/resources/_gen/**/*.content filter=lfs diff=lfs merge=lfs -text # Gocad files *.sg filter=lfs diff=lfs merge=lfs -text diff --git a/Applications/Utils/Tests.cmake b/Applications/Utils/Tests.cmake index 6fffe0a5ed3f1d529abea405ff4131b99f866778..95de6c8b7184c286660d1de87326f5c4923d4bff 100644 --- a/Applications/Utils/Tests.cmake +++ b/Applications/Utils/Tests.cmake @@ -285,3 +285,27 @@ AddTest( DIFF_DATA AmmerSubsurfaceGrid.vtu AmmerGridOutput.vtu MaterialIDs MaterialIDs 0 0 ) + +if(OGS_USE_NETCDF) + AddTest( + NAME NetCDF_2D_Test + PATH FileConverter/ + EXECUTABLE NetCdfConverter + EXECUTABLE_ARGS -i sresa1b_ncar_ccsm3-example.nc -o ${Data_BINARY_DIR}/FileConverter/sresa1b_ncar_ccsm3-example.vtu -v pr -t 0 --dim1 2 --dim2 1 --timestep-first 0 --timestep-last 0 -e tri + REQUIREMENTS NOT OGS_USE_MPI + TESTER vtkdiff + DIFF_DATA + sresa1b_ncar_ccsm3-example.vtu sresa1b_ncar_ccsm3-example.vtu pr pr 1e-16 0 + ) + + AddTest( + NAME NetCDF_3D_Test + PATH FileConverter/ + EXECUTABLE NetCdfConverter + EXECUTABLE_ARGS -i slim_100897_198.nc -o ${Data_BINARY_DIR}/FileConverter/slim_100897_198.vtu -v NO -t 0 --dim1 3 --dim2 2 --dim3 1 --timestep-first 0 --timestep-last 0 -e hex + REQUIREMENTS NOT OGS_USE_MPI + TESTER vtkdiff + DIFF_DATA + slim_100897_198.vtu slim_100897_198.vtu NO NO 1e-16 0 + ) +endif() diff --git a/Tests/Data/FileConverter/slim_100897_198.nc b/Tests/Data/FileConverter/slim_100897_198.nc new file mode 100644 index 0000000000000000000000000000000000000000..0127d346117a115ba66580a707cfa8ca6e2a7cec --- /dev/null +++ b/Tests/Data/FileConverter/slim_100897_198.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cb278e02f075784b28241b476a1745dcad93131d9751415afbf00b9657e01718 +size 5352788 diff --git a/Tests/Data/FileConverter/slim_100897_198.vtu b/Tests/Data/FileConverter/slim_100897_198.vtu new file mode 100644 index 0000000000000000000000000000000000000000..a81f426f1ecf049384fd858b906659e4f4ec6463 --- /dev/null +++ b/Tests/Data/FileConverter/slim_100897_198.vtu @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8ceec1ea5ea0967e7111c945e5e41032a8351a60bddd5ecc8675ef40ab46432e +size 4462866 diff --git a/Tests/Data/FileConverter/sresa1b_ncar_ccsm3-example.nc b/Tests/Data/FileConverter/sresa1b_ncar_ccsm3-example.nc new file mode 100644 index 0000000000000000000000000000000000000000..4b6338fe11b086710877544dea3d3afe0f258853 --- /dev/null +++ b/Tests/Data/FileConverter/sresa1b_ncar_ccsm3-example.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2c2047ee329654f3bebf0a4b0d99eada50f1183728a3c7c129b0bc50d404511b +size 2767916 diff --git a/Tests/Data/FileConverter/sresa1b_ncar_ccsm3-example.vtu b/Tests/Data/FileConverter/sresa1b_ncar_ccsm3-example.vtu new file mode 100644 index 0000000000000000000000000000000000000000..8be050ca1bb45388737a0bd6e7695862012c30e4 --- /dev/null +++ b/Tests/Data/FileConverter/sresa1b_ncar_ccsm3-example.vtu @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4dc1627a4ea12e0d223c59f7155ad22eda205fbd0a8f4745516d08cd9a80f63f +size 4644854