Skip to content

Commit

Permalink
never process cells below bottom for hosts with variable bottom index…
Browse files Browse the repository at this point in the history
… but without mask (e.g., schism)
  • Loading branch information
jornbr committed Mar 26, 2024
1 parent ff4c00a commit 9045039
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
14 changes: 14 additions & 0 deletions src/fabm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2114,8 +2114,22 @@ subroutine process_job(self, job _POSTARG_HORIZONTAL_LOCATION_RANGE_)
select case (task%operation)
case (source_do)
_BEGIN_OUTER_INTERIOR_LOOP_
#if _FABM_BOTTOM_INDEX_==-1 && !defined(_HAS_MASK_) && _FABM_VECTORIZED_DIMENSION_INDEX_==_FABM_DEPTH_DIMENSION_INDEX_ && defined(_FABM_DEPTH_DIMENSION_INDEX_)
! We are looping over depth, but as we have a non-constant bottom index (yet no mask), we need to skip everything below bottom
# if _FABM_BOTTOM_INDEX_==-1
# ifdef _FABM_VERTICAL_BOTTOM_TO_SURFACE_
_START_ = self%domain%bottom_indices _INDEX_HORIZONTAL_LOCATION_
# else
_STOP_ = self%domain%bottom_indices _INDEX_HORIZONTAL_LOCATION_
# endif
# endif
#endif
call process_interior_slice(task, self%domain, self%catalog, self%cache_fill_values, self%store, self%cache_int _POSTARG_INTERIOR_IN_)
_END_OUTER_INTERIOR_LOOP_
#if _FABM_BOTTOM_INDEX_==-1 && !defined(_HAS_MASK_) && _FABM_VECTORIZED_DIMENSION_INDEX_==_FABM_DEPTH_DIMENSION_INDEX_ && defined(_FABM_DEPTH_DIMENSION_INDEX_)
_START_ = self%domain%start(_FABM_DEPTH_DIMENSION_INDEX_)
_STOP_ = self%domain%stop(_FABM_DEPTH_DIMENSION_INDEX_)
#endif
case (source_do_surface, source_do_bottom, source_do_horizontal)
_BEGIN_OUTER_HORIZONTAL_LOOP_
call process_horizontal_slice(task, self%domain, self%catalog, self%cache_fill_values, self%store, self%cache_hz _POSTARG_HORIZONTAL_IN_)
Expand Down
14 changes: 13 additions & 1 deletion src/test/host.F90
Original file line number Diff line number Diff line change
Expand Up @@ -805,8 +805,20 @@ subroutine simulate(n)

_BEGIN_OUTER_INTERIOR_LOOP_
dy = 0
call model%get_interior_sources(_PREARG_INTERIOR_IN_ dy)
#if _FABM_BOTTOM_INDEX_==-1 && !defined(_HAS_MASK_) && _FABM_VECTORIZED_DIMENSION_INDEX_==_FABM_DEPTH_DIMENSION_INDEX_ && defined(_FABM_DEPTH_DIMENSION_INDEX_)
! We are looping over depth, but as we have a non-constant bottom index (yet no mask), we need to skip everything below bottom
# ifdef _FABM_VERTICAL_BOTTOM_TO_SURFACE_
_START_ = bottom_index _INDEX_HORIZONTAL_LOCATION_
# else
_STOP_ = bottom_index _INDEX_HORIZONTAL_LOCATION_
# endif
#endif
call model%get_interior_sources(_PREARG_INTERIOR_IN_ dy _INTERIOR_SLICE_RANGE_PLUS_1_)
_END_OUTER_INTERIOR_LOOP_
#if _FABM_BOTTOM_INDEX_==-1 && !defined(_HAS_MASK_) && _FABM_VECTORIZED_DIMENSION_INDEX_==_FABM_DEPTH_DIMENSION_INDEX_ && defined(_FABM_DEPTH_DIMENSION_INDEX_)
_START_ = domain_start(_FABM_VECTORIZED_DIMENSION_INDEX_)
_STOP_ = domain_stop(_FABM_VECTORIZED_DIMENSION_INDEX_)
# endif

call model%finalize_outputs()

Expand Down

0 comments on commit 9045039

Please sign in to comment.