Skip to content

Commit

Permalink
test/host: simplified check_surface/check_bottom mask treatment
Browse files Browse the repository at this point in the history
  • Loading branch information
jornbr committed Apr 19, 2024
1 parent 5068681 commit 2b47011
Showing 1 changed file with 12 additions and 28 deletions.
40 changes: 12 additions & 28 deletions src/test/host.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1266,15 +1266,11 @@ subroutine test_update(apply_mask, restrict_range)
_BEGIN_OUTER_HORIZONTAL_LOOP_
call model%check_surface_state(_PREARG_HORIZONTAL_IN_ .true., valid)
#ifdef _HAS_MASK_
# ifdef _FABM_HORIZONTAL_MASK_
# if _FABM_VECTORIZED_DIMENSION_INDEX_==_FABM_DEPTH_DIMENSION_INDEX_
# if _FABM_VECTORIZED_DIMENSION_INDEX_==_FABM_DEPTH_DIMENSION_INDEX_
any_unmasked = _IS_UNMASKED_(mask_hz _INDEX_GLOBAL_HORIZONTAL_(_START_:_STOP_))
# else
# else
any_unmasked = any(_IS_UNMASKED_(mask_hz _INDEX_GLOBAL_HORIZONTAL_(_START_:_STOP_)))
# endif
# else
any_unmasked = any(_IS_UNMASKED_(mask _INDEX_GLOBAL_INTERIOR_(_START_:_STOP_)))
# endif
# endif
#endif
call assert(valid .neqv. any_unmasked, 'check_surface_state', 'invalid result')
_END_OUTER_HORIZONTAL_LOOP_
Expand All @@ -1288,15 +1284,11 @@ subroutine test_update(apply_mask, restrict_range)
_BEGIN_OUTER_HORIZONTAL_LOOP_
call model%check_bottom_state(_PREARG_HORIZONTAL_IN_ .true., valid)
#ifdef _HAS_MASK_
# ifdef _FABM_HORIZONTAL_MASK_
# if _FABM_VECTORIZED_DIMENSION_INDEX_==_FABM_DEPTH_DIMENSION_INDEX_
# if _FABM_VECTORIZED_DIMENSION_INDEX_==_FABM_DEPTH_DIMENSION_INDEX_
any_unmasked = _IS_UNMASKED_(mask_hz _INDEX_GLOBAL_HORIZONTAL_(_START_:_STOP_))
# else
# else
any_unmasked = any(_IS_UNMASKED_(mask_hz _INDEX_GLOBAL_HORIZONTAL_(_START_:_STOP_)))
# endif
# else
any_unmasked = any(_IS_UNMASKED_(mask _INDEX_GLOBAL_INTERIOR_(_START_:_STOP_)))
# endif
# endif
#endif
call assert(valid .neqv. any_unmasked, 'check_bottom_state', 'invalid result')
_END_OUTER_HORIZONTAL_LOOP_
Expand Down Expand Up @@ -1350,15 +1342,11 @@ subroutine test_update(apply_mask, restrict_range)
_BEGIN_OUTER_HORIZONTAL_LOOP_
call model%check_surface_state(_PREARG_HORIZONTAL_IN_ .true., valid)
#ifdef _HAS_MASK_
# ifdef _FABM_HORIZONTAL_MASK_
# if _FABM_VECTORIZED_DIMENSION_INDEX_==_FABM_DEPTH_DIMENSION_INDEX_
# if _FABM_VECTORIZED_DIMENSION_INDEX_==_FABM_DEPTH_DIMENSION_INDEX_
any_unmasked = _IS_UNMASKED_(mask_hz _INDEX_GLOBAL_HORIZONTAL_(_START_:_STOP_))
# else
# else
any_unmasked = any(_IS_UNMASKED_(mask_hz _INDEX_GLOBAL_HORIZONTAL_(_START_:_STOP_)))
# endif
# else
any_unmasked = any(_IS_UNMASKED_(mask _INDEX_GLOBAL_INTERIOR_(_START_:_STOP_)))
# endif
# endif
#endif
call assert(valid .neqv. any_unmasked, 'check_surface_state', 'invalid result')
_END_OUTER_HORIZONTAL_LOOP_
Expand All @@ -1372,15 +1360,11 @@ subroutine test_update(apply_mask, restrict_range)
_BEGIN_OUTER_HORIZONTAL_LOOP_
call model%check_bottom_state(_PREARG_HORIZONTAL_IN_ .true., valid)
#ifdef _HAS_MASK_
# ifdef _FABM_HORIZONTAL_MASK_
# if _FABM_VECTORIZED_DIMENSION_INDEX_==_FABM_DEPTH_DIMENSION_INDEX_
# if _FABM_VECTORIZED_DIMENSION_INDEX_==_FABM_DEPTH_DIMENSION_INDEX_
any_unmasked = _IS_UNMASKED_(mask_hz _INDEX_GLOBAL_HORIZONTAL_(_START_:_STOP_))
# else
# else
any_unmasked = any(_IS_UNMASKED_(mask_hz _INDEX_GLOBAL_HORIZONTAL_(_START_:_STOP_)))
# endif
# else
any_unmasked = any(_IS_UNMASKED_(mask _INDEX_GLOBAL_INTERIOR_(_START_:_STOP_)))
# endif
# endif
#endif
call assert(valid .neqv. any_unmasked, 'check_bottom_state', 'invalid result')
_END_OUTER_HORIZONTAL_LOOP_
Expand Down

0 comments on commit 2b47011

Please sign in to comment.