This function returns pre-stored value at given idx or evaluate a spatial function for a point at given idx in growing array of points. Return value is a scalar.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_spatial_type), | intent(in) | :: | me |
spatial type |
||
type(tem_grwPoints_type), | intent(in) | :: | grwPnt |
growing array of all spatial point of a variable |
||
integer, | intent(in) | :: | idx(nVals) |
Index position to return a pre-store value or to compute |
||
integer, | intent(in) | :: | nVals |
number of return values |
||
integer, | intent(in) | :: | iLevel |
Level to which the evaluated values to be returned |
return value of a function
function tem_spatial_scalar_for_index( me, grwPnt, idx, nVals, iLevel ) & & result (res) ! -------------------------------------------------------------------- ! !> spatial type type(tem_spatial_type), intent(in) :: me !> number of return values integer, intent(in) :: nVals !> growing array of all spatial point of a variable type(tem_grwPoints_type), intent(in) :: grwPnt !> Index position to return a pre-store value or to compute integer, intent(in) :: idx(nVals) !> return value of a function real( kind=rk ) :: res(nVals) !> Level to which the evaluated values to be returned integer, intent(in) :: iLevel ! -------------------------------------------------------------------- ! integer :: iVal real(kind=rk) :: coord(1,3), res_tmp(1) ! -------------------------------------------------------------------- ! if (me%isStored) then res(1:nVals) = me%valOnLvl(iLevel)%evalVal%val( idx(1:nVals) ) else select case (trim(me%kind)) case ('none', 'const') res = me%const(1) case ('lua_fun') res = tem_spatial_lua_for( fun_ref = me%lua_fun_ref, & & conf = me%conf, & & grwPnt = grwPnt, & & idx = idx, & & nVals = nVals ) case default do iVal = 1, nVals coord(1,:) = (/ grwPnt%coordX%val( idx(iVal) ), & & grwPnt%coordY%val( idx(iVal) ), & & grwPnt%coordZ%val( idx(iVal) ) /) res_tmp = tem_spatial_for_coord( me = me, & & coord = coord, & & n = 1 ) res(iVal) = res_tmp(1) end do end select end if end function tem_spatial_scalar_for_index