@@ -46,8 +46,8 @@ TEST_CASE("field_at_height")
46
46
FieldIdentifier z_surf_fid (" z_surf" , FieldLayout ({COL },{ncols }),m,grid->name ());
47
47
FieldIdentifier z_mid_fid (" z_mid" , FieldLayout ({COL, LEV},{ncols, nlevs }),m,grid->name ());
48
48
FieldIdentifier z_int_fid (" z_int" , FieldLayout ({COL, ILEV},{ncols, nlevs+1 }),m,grid->name ());
49
- FieldIdentifier geo_mid_fid (" geopotential_mid " ,FieldLayout ({COL, LEV},{ncols, nlevs }),m,grid->name ());
50
- FieldIdentifier geo_int_fid (" geopotential_int " ,FieldLayout ({COL, ILEV},{ncols, nlevs+1 }),m,grid->name ());
49
+ FieldIdentifier h_mid_fid (" height_mid " ,FieldLayout ({COL, LEV},{ncols, nlevs }),m,grid->name ());
50
+ FieldIdentifier h_int_fid (" height_int " ,FieldLayout ({COL, ILEV},{ncols, nlevs+1 }),m,grid->name ());
51
51
// Keep track of reference fields for comparison
52
52
FieldIdentifier s_tgt_fid (" scalar_target" ,FieldLayout ({COL },{ncols }),m,grid->name ());
53
53
FieldIdentifier v_tgt_fid (" vector_target" ,FieldLayout ({COL,CMP},{ncols,ndims}),m,grid->name ());
@@ -59,8 +59,8 @@ TEST_CASE("field_at_height")
59
59
Field z_surf (z_surf_fid);
60
60
Field z_mid (z_mid_fid);
61
61
Field z_int (z_int_fid);
62
- Field geo_mid (geo_mid_fid );
63
- Field geo_int (geo_int_fid );
62
+ Field h_mid (h_mid_fid );
63
+ Field h_int (h_int_fid );
64
64
Field s_tgt (s_tgt_fid);
65
65
Field v_tgt (v_tgt_fid);
66
66
@@ -71,8 +71,8 @@ TEST_CASE("field_at_height")
71
71
z_surf.allocate_view ();
72
72
z_mid.allocate_view ();
73
73
z_int.allocate_view ();
74
- geo_mid .allocate_view ();
75
- geo_int .allocate_view ();
74
+ h_mid .allocate_view ();
75
+ h_int .allocate_view ();
76
76
s_tgt.allocate_view ();
77
77
v_tgt.allocate_view ();
78
78
@@ -83,8 +83,8 @@ TEST_CASE("field_at_height")
83
83
z_surf.get_header ().get_tracking ().update_time_stamp (t0);
84
84
z_mid.get_header ().get_tracking ().update_time_stamp (t0);
85
85
z_int.get_header ().get_tracking ().update_time_stamp (t0);
86
- geo_mid .get_header ().get_tracking ().update_time_stamp (t0);
87
- geo_int .get_header ().get_tracking ().update_time_stamp (t0);
86
+ h_mid .get_header ().get_tracking ().update_time_stamp (t0);
87
+ h_int .get_header ().get_tracking ().update_time_stamp (t0);
88
88
s_tgt.get_header ().get_tracking ().update_time_stamp (t0);
89
89
v_tgt.get_header ().get_tracking ().update_time_stamp (t0);
90
90
@@ -124,9 +124,9 @@ TEST_CASE("field_at_height")
124
124
125
125
// Set up vertical structure for the tests. Note,
126
126
// z_mid/int represents the height in m above sealevel
127
- // geo_mid /int represente the hegith in m above the surface
127
+ // h_mid /int represente the hegith in m above the surface
128
128
// So we first construct z_mid/int using z_surf as reference, and
129
- // then can build geo_mid /int from z_mid/int
129
+ // then can build h_mid /int from z_mid/int
130
130
// Furthermore, z_mid is just the midpoint between two adjacent z_int
131
131
// points, so we back z_mid out of z_int.
132
132
//
@@ -137,8 +137,8 @@ TEST_CASE("field_at_height")
137
137
const auto & zint_v = z_int.get_view <Real**,Host>();
138
138
const auto & zmid_v = z_mid.get_view <Real**,Host>();
139
139
const auto & zsurf_v = z_surf.get_view <Real*,Host>();
140
- const auto & geoint_v = geo_int .get_view <Real**,Host>();
141
- const auto & geomid_v = geo_mid .get_view <Real**,Host>();
140
+ const auto & geoint_v = h_int .get_view <Real**,Host>();
141
+ const auto & geomid_v = h_mid .get_view <Real**,Host>();
142
142
int min_col_thickness = z_top;
143
143
int max_surf = 0 ;
144
144
for (int ii=0 ; ii<ncols; ++ii) {
@@ -159,21 +159,21 @@ TEST_CASE("field_at_height")
159
159
z_mid.sync_to_dev ();
160
160
z_int.sync_to_dev ();
161
161
z_surf.sync_to_dev ();
162
- geo_int .sync_to_dev ();
163
- geo_mid .sync_to_dev ();
162
+ h_int .sync_to_dev ();
163
+ h_mid .sync_to_dev ();
164
164
// Set the PDF for target height in the test to always be within the shortest column.
165
165
// This ensures that we don't havea target z that extrapolates everywhere.
166
166
// We test this case individually.
167
167
IPDF pdf_levs (max_surf,min_col_thickness);
168
168
// Sanity check that the geo and z vertical structures are in fact different,
169
169
// so we know we are testing above_surface and above_sealevel as different cases.
170
- REQUIRE (! views_are_equal (z_int,geo_int ));
171
- REQUIRE (! views_are_equal (z_mid,geo_mid ));
170
+ REQUIRE (! views_are_equal (z_int,h_int ));
171
+ REQUIRE (! views_are_equal (z_mid,h_mid ));
172
172
173
173
// Make sure that an unsupported reference height throws an error.
174
174
print (" -> Testing throws error with unsupported reference height...\n " );
175
175
{
176
- REQUIRE_THROWS (run_diag (s_mid,geo_mid ," 1m" ," foobar" ));
176
+ REQUIRE_THROWS (run_diag (s_mid,h_mid ," 1m" ," foobar" ));
177
177
}
178
178
print (" -> Testing throws error with unsupported reference height... OK\n " );
179
179
@@ -182,8 +182,8 @@ TEST_CASE("field_at_height")
182
182
std::string loc;
183
183
for (std::string surf_ref : {" sealevel" ," surface" }) {
184
184
printf (" -> Testing for a reference height above %s...\n " ,surf_ref.c_str ());
185
- const auto mid_src = surf_ref == " sealevel" ? z_mid : geo_mid ;
186
- const auto int_src = surf_ref == " sealevel" ? z_int : geo_int ;
185
+ const auto mid_src = surf_ref == " sealevel" ? z_mid : h_mid ;
186
+ const auto int_src = surf_ref == " sealevel" ? z_int : h_int ;
187
187
const int max_surf_4test = surf_ref == " sealevel" ? max_surf : 0 ;
188
188
for (int irun=0 ; irun<nruns; ++irun) {
189
189
@@ -238,23 +238,23 @@ TEST_CASE("field_at_height")
238
238
}
239
239
}
240
240
{
241
- print (" -> Forced extrapolation ...............\n " );
241
+ print (" -> Forced extrapolation at top ...............\n " );
242
242
auto slope = pdf_m (engine);
243
243
auto inter = pdf_y0 (engine);
244
244
f_z_src (inter, slope, int_src, s_int);
245
- print (" -> at top...............\n " );
246
245
z_tgt = 2 *z_top;
247
246
std::string loc = std::to_string (z_tgt) + " m" ;
248
247
auto dtop = run_diag (s_int,int_src,loc,surf_ref);
249
248
f_z_tgt (inter,slope,z_tgt,int_src,s_tgt);
250
249
REQUIRE (views_are_approx_equal (dtop,s_tgt,tol));
251
- print (" -> at bot...............\n " );
250
+ print (" -> Forced extrapolation at top............... OK!\n " );
251
+ print (" -> Forced extrapolation at bot...............\n " );
252
252
z_tgt = 0 ;
253
253
loc = std::to_string (z_tgt) + " m" ;
254
254
auto dbot = run_diag (s_int,int_src,loc,surf_ref);
255
255
f_z_tgt (inter,slope,z_tgt,int_src,s_tgt);
256
256
REQUIRE (views_are_approx_equal (dbot,s_tgt,tol));
257
- print (" -> Forced extrapolation............... OK!\n " );
257
+ print (" -> Forced extrapolation at bot ............... OK!\n " );
258
258
}
259
259
printf (" -> Testing for a reference height above %s... OK!\n " ,surf_ref.c_str ());
260
260
}
0 commit comments