forked from ufs-community/land-DA_workflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add WE2E verification capability (ufs-community#131)
* add we2e_vav flag * add we2e v&v to scripts
- Loading branch information
Showing
12 changed files
with
142 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env python | ||
import sys | ||
import numpy as np | ||
from netCDF4 import Dataset | ||
|
||
with Dataset(sys.argv[1]) as nc1, Dataset(sys.argv[2]) as nc2: | ||
f = open(sys.argv[4], "a") | ||
# Check if the list of variables are the same | ||
if nc1.variables.keys()!=nc2.variables.keys(): | ||
print("FATAL ERROR: list of variables are different") | ||
f.write("FATAL ERROR: list of variables are different.\n") | ||
sys.exit(2) | ||
|
||
for varname in nc1.variables.keys(): | ||
# First check if each variable has the same dimension | ||
if np.shape(nc1[varname][:])!=np.shape(nc2[varname][:]): | ||
print(varname,"FATAL ERROR: dimension is different") | ||
f.write("FATAL ERROR: dimension is different.\n") | ||
sys.exit(2) | ||
# If dimension is the same, compare data | ||
else: | ||
np.testing.assert_allclose(nc1[varname][:], nc2[varname][:], rtol=1e-8, atol=float(sys.argv[3])) | ||
|
||
f.write("{} :: {} :: {} :: TEST was complete successfully.\n".format(sys.argv[6],sys.argv[5],sys.argv[7])) | ||
f.close() |