Commit ea915fc6 authored by Jorn Bruggeman's avatar Jorn Bruggeman
Browse files

testing: make sure bottom index is always valid when host does not use mask

parent eabdbb3d
......@@ -492,12 +492,18 @@ contains
subroutine randomize_mask
#if _FABM_BOTTOM_INDEX_==-1
! Depth index of bottom varies in the horizontal - pick random numbers between 0 (land) and maximum index
! Depth index of bottom varies in the horizontal
call random_number(tmp_hz)
# ifdef _HAS_MASK_
! Pick random numbers between 0 (land) and maximum index
bottom_index = floor(tmp_hz*(1+domain_extent(_FABM_DEPTH_DIMENSION_INDEX_)))
# ifdef _FABM_VERTICAL_BOTTOM_TO_SURFACE_
# ifdef _FABM_VERTICAL_BOTTOM_TO_SURFACE_
! Ensure invalid bottom indices [land points] are set such that vertical loops have 0 iterations.
where (bottom_index == 0) bottom_index = domain_extent(_FABM_DEPTH_DIMENSION_INDEX_) + 1
# endif
# else
! Pick random numbers between 1 and maximum index
bottom_index = 1 + floor(tmp_hz*(domain_extent(_FABM_DEPTH_DIMENSION_INDEX_)))
# endif
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment