@@ -849,6 +849,7 @@ subroutine test_update(apply_mask, restrict_range)
849
849
real (rke), pointer _DIMENSION_GLOBAL_ :: pdata
850
850
real (rke), pointer _DIMENSION_GLOBAL_HORIZONTAL_ :: pdata_hz
851
851
logical :: valid
852
+ logical :: any_unmasked
852
853
853
854
call configure_range(randomize= restrict_range)
854
855
call configure_mask(randomize= apply_mask)
@@ -1238,18 +1239,22 @@ subroutine test_update(apply_mask, restrict_range)
1238
1239
call apply_mask_2d(surface_state(_PREARG_HORIZONTAL_LOCATION_DIMENSIONS_ ivar), model% surface_state_variables(ivar)% missing_value)
1239
1240
end do
1240
1241
1242
+ any_unmasked = .true.
1241
1243
call start_test(' check_interior_state < min' )
1242
1244
_BEGIN_OUTER_INTERIOR_LOOP_
1243
1245
call model% check_interior_state(_PREARG_INTERIOR_IN_ .true. , valid)
1244
1246
#ifdef _HAS_MASK_
1245
1247
# ifdef _FABM_HORIZONTAL_MASK_
1246
- call assert(valid .neqv. any (_IS_UNMASKED_(mask_hz _INDEX_GLOBAL_HORIZONTAL_(_START_:_STOP_))), ' check_interior_state' , ' invalid result' )
1248
+ # if _FABM_VECTORIZED_DIMENSION_INDEX_==_FABM_DEPTH_DIMENSION_INDEX_
1249
+ any_unmasked = _IS_UNMASKED_(mask_hz _INDEX_GLOBAL_HORIZONTAL_(_START_:_STOP_))
1250
+ # else
1251
+ any_unmasked = any (_IS_UNMASKED_(mask_hz _INDEX_GLOBAL_HORIZONTAL_(_START_:_STOP_)))
1252
+ # endif
1247
1253
# else
1248
- call assert(valid .neqv. any (_IS_UNMASKED_(mask _INDEX_GLOBAL_INTERIOR_(_START_:_STOP_))), ' check_interior_state ' , ' invalid result ' )
1254
+ any_unmasked = any (_IS_UNMASKED_(mask _INDEX_GLOBAL_INTERIOR_(_START_:_STOP_)))
1249
1255
# endif
1250
- #else
1251
- call assert(.not. valid, ' check_interior_state' , ' invalid result' )
1252
1256
#endif
1257
+ call assert(valid .neqv. any_unmasked, ' check_interior_state' , ' invalid result' )
1253
1258
_END_OUTER_INTERIOR_LOOP_
1254
1259
do ivar = 1 , size (model% interior_state_variables)
1255
1260
call check_interior(interior_state(_PREARG_LOCATION_DIMENSIONS_ ivar), &
@@ -1261,10 +1266,13 @@ subroutine test_update(apply_mask, restrict_range)
1261
1266
_BEGIN_OUTER_HORIZONTAL_LOOP_
1262
1267
call model% check_surface_state(_PREARG_HORIZONTAL_IN_ .true. , valid)
1263
1268
#ifdef _HAS_MASK_
1264
- call assert(valid .neqv. any (_IS_UNMASKED_(mask_hz _INDEX_GLOBAL_HORIZONTAL_(_START_:_STOP_))), ' check_surface_state' , ' invalid result' )
1265
- #else
1266
- call assert(.not. valid, ' check_surface_state' , ' invalid result' )
1269
+ # if _FABM_VECTORIZED_DIMENSION_INDEX_==_FABM_DEPTH_DIMENSION_INDEX_
1270
+ any_unmasked = _IS_UNMASKED_(mask_hz _INDEX_GLOBAL_HORIZONTAL_(_START_:_STOP_))
1271
+ # else
1272
+ any_unmasked = any (_IS_UNMASKED_(mask_hz _INDEX_GLOBAL_HORIZONTAL_(_START_:_STOP_)))
1273
+ # endif
1267
1274
#endif
1275
+ call assert(valid .neqv. any_unmasked, ' check_surface_state' , ' invalid result' )
1268
1276
_END_OUTER_HORIZONTAL_LOOP_
1269
1277
do ivar = 1 , size (model% surface_state_variables)
1270
1278
call check_horizontal(surface_state(_PREARG_HORIZONTAL_LOCATION_DIMENSIONS_ ivar), &
@@ -1276,10 +1284,13 @@ subroutine test_update(apply_mask, restrict_range)
1276
1284
_BEGIN_OUTER_HORIZONTAL_LOOP_
1277
1285
call model% check_bottom_state(_PREARG_HORIZONTAL_IN_ .true. , valid)
1278
1286
#ifdef _HAS_MASK_
1279
- call assert(valid .neqv. any (_IS_UNMASKED_(mask_hz _INDEX_GLOBAL_HORIZONTAL_(_START_:_STOP_))), ' check_bottom_state' , ' invalid result' )
1280
- #else
1281
- call assert(.not. valid, ' check_bottom_state' , ' invalid result' )
1287
+ # if _FABM_VECTORIZED_DIMENSION_INDEX_==_FABM_DEPTH_DIMENSION_INDEX_
1288
+ any_unmasked = _IS_UNMASKED_(mask_hz _INDEX_GLOBAL_HORIZONTAL_(_START_:_STOP_))
1289
+ # else
1290
+ any_unmasked = any (_IS_UNMASKED_(mask_hz _INDEX_GLOBAL_HORIZONTAL_(_START_:_STOP_)))
1291
+ # endif
1282
1292
#endif
1293
+ call assert(valid .neqv. any_unmasked, ' check_bottom_state' , ' invalid result' )
1283
1294
_END_OUTER_HORIZONTAL_LOOP_
1284
1295
do ivar = 1 , size (model% bottom_state_variables)
1285
1296
call check_horizontal(bottom_state(_PREARG_HORIZONTAL_LOCATION_DIMENSIONS_ ivar), &
@@ -1310,13 +1321,16 @@ subroutine test_update(apply_mask, restrict_range)
1310
1321
call model% check_interior_state(_PREARG_INTERIOR_IN_ .true. , valid)
1311
1322
#ifdef _HAS_MASK_
1312
1323
# ifdef _FABM_HORIZONTAL_MASK_
1313
- call assert(valid .neqv. any (_IS_UNMASKED_(mask_hz _INDEX_GLOBAL_HORIZONTAL_(_START_:_STOP_))), ' check_interior_state' , ' invalid result' )
1324
+ # if _FABM_VECTORIZED_DIMENSION_INDEX_==_FABM_DEPTH_DIMENSION_INDEX_
1325
+ any_unmasked = _IS_UNMASKED_(mask_hz _INDEX_GLOBAL_HORIZONTAL_(_START_:_STOP_))
1326
+ # else
1327
+ any_unmasked = any (_IS_UNMASKED_(mask_hz _INDEX_GLOBAL_HORIZONTAL_(_START_:_STOP_)))
1328
+ # endif
1314
1329
# else
1315
- call assert(valid .neqv. any (_IS_UNMASKED_(mask _INDEX_GLOBAL_INTERIOR_(_START_:_STOP_))), ' check_interior_state ' , ' invalid result ' )
1330
+ any_unmasked = any (_IS_UNMASKED_(mask _INDEX_GLOBAL_INTERIOR_(_START_:_STOP_)))
1316
1331
# endif
1317
- #else
1318
- call assert(.not. valid, ' check_interior_state' , ' invalid result' )
1319
1332
#endif
1333
+ call assert(valid .neqv. any_unmasked, ' check_interior_state' , ' invalid result' )
1320
1334
_END_OUTER_INTERIOR_LOOP_
1321
1335
do ivar = 1 , size (model% interior_state_variables)
1322
1336
call check_interior(interior_state(_PREARG_LOCATION_DIMENSIONS_ ivar), &
@@ -1328,10 +1342,13 @@ subroutine test_update(apply_mask, restrict_range)
1328
1342
_BEGIN_OUTER_HORIZONTAL_LOOP_
1329
1343
call model% check_surface_state(_PREARG_HORIZONTAL_IN_ .true. , valid)
1330
1344
#ifdef _HAS_MASK_
1331
- call assert(valid .neqv. any (_IS_UNMASKED_(mask_hz _INDEX_GLOBAL_HORIZONTAL_(_START_:_STOP_))), ' check_surface_state' , ' invalid result' )
1332
- #else
1333
- call assert(.not. valid, ' check_surface_state' , ' invalid result' )
1345
+ # if _FABM_VECTORIZED_DIMENSION_INDEX_==_FABM_DEPTH_DIMENSION_INDEX_
1346
+ any_unmasked = _IS_UNMASKED_(mask_hz _INDEX_GLOBAL_HORIZONTAL_(_START_:_STOP_))
1347
+ # else
1348
+ any_unmasked = any (_IS_UNMASKED_(mask_hz _INDEX_GLOBAL_HORIZONTAL_(_START_:_STOP_)))
1349
+ # endif
1334
1350
#endif
1351
+ call assert(valid .neqv. any_unmasked, ' check_surface_state' , ' invalid result' )
1335
1352
_END_OUTER_HORIZONTAL_LOOP_
1336
1353
do ivar = 1 , size (model% surface_state_variables)
1337
1354
call check_horizontal(surface_state(_PREARG_HORIZONTAL_LOCATION_DIMENSIONS_ ivar), &
@@ -1343,10 +1360,13 @@ subroutine test_update(apply_mask, restrict_range)
1343
1360
_BEGIN_OUTER_HORIZONTAL_LOOP_
1344
1361
call model% check_bottom_state(_PREARG_HORIZONTAL_IN_ .true. , valid)
1345
1362
#ifdef _HAS_MASK_
1346
- call assert(valid .neqv. any (_IS_UNMASKED_(mask_hz _INDEX_GLOBAL_HORIZONTAL_(_START_:_STOP_))), ' check_bottom_state' , ' invalid result' )
1347
- #else
1348
- call assert(.not. valid, ' check_bottom_state' , ' invalid result' )
1363
+ # if _FABM_VECTORIZED_DIMENSION_INDEX_==_FABM_DEPTH_DIMENSION_INDEX_
1364
+ any_unmasked = _IS_UNMASKED_(mask_hz _INDEX_GLOBAL_HORIZONTAL_(_START_:_STOP_))
1365
+ # else
1366
+ any_unmasked = any (_IS_UNMASKED_(mask_hz _INDEX_GLOBAL_HORIZONTAL_(_START_:_STOP_)))
1367
+ # endif
1349
1368
#endif
1369
+ call assert(valid .neqv. any_unmasked, ' check_bottom_state' , ' invalid result' )
1350
1370
_END_OUTER_HORIZONTAL_LOOP_
1351
1371
do ivar = 1 , size (model% bottom_state_variables)
1352
1372
call check_horizontal(bottom_state(_PREARG_HORIZONTAL_LOCATION_DIMENSIONS_ ivar), &
0 commit comments