Newer
Older
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// Purpose: Script to test subsetting with auxiliary coordinates
// print("Test script for subsetting of auxiliary coordinates\n");
// Count number of errors
nbr_err=0;
if( $gds_crd.size != 2 )
{
print("ERROR: gds_crd dim wrong size\n");
nbr_err++;
}
if( lat_gds.type() != NC_DOUBLE || lat_gds.min() != 0.0d || lat_gds.max() != 30.0d)
{
print("ERROR: lat_gds coord wrong\n");
nbr_err++;
}
if( lon_gds.type() != NC_DOUBLE || lon_gds.min() !=180.0d || lon_gds.max() != 180.0d )
{
print("ERROR: lon_gds coord wrong\n");
nbr_err++;
}
if( gds_var.type() != NC_FLOAT || gds_var.ndims() != 1 )
{
print("ERROR: gds_var shape wrong\n");
nbr_err++;
}
if( fabs(gds_var.min() - 273.5d)>1e-1d || fabs(gds_var.total() - 547.2d)>1e-1d )
{
print("ERROR: gds_var values wrong\n");
nbr_err++;
}
if( gds_3dvar.type() != NC_FLOAT || gds_3dvar.ndims() != 2 )
{
print("ERROR: gds_3dvar shape wrong\n");
nbr_err++;
}
if( fabs(gds_3dvar.min() - 273.5d)>1e-1d || fabs(gds_3dvar.total() - 5562.0d)>1e-1d )
{
print("ERROR: gds_3dvar values wrong\n");
nbr_err++;
}
// Results summany
print("RESULTS SUMMARY: total errors=");print(nbr_err,"%d");