tem_load_reduction_single Subroutine

private subroutine tem_load_reduction_single(conf, reduceType, handle, key, pos, iError)

Read a single entry of reductions from the lua file

Arguments

Type IntentOptional Attributes Name
type(flu_State), intent(inout) :: conf

handle for lua file

character(len=labelLen), intent(out) :: reduceType

reduction type to be filled

integer, intent(in), optional :: handle

handle for reduce table

character(len=*), intent(in), optional :: key

which key to open

integer, intent(in), optional :: pos

position to load from in config file

integer, intent(out) :: iError

error from aotus


Calls

proc~~tem_load_reduction_single~~CallsGraph proc~tem_load_reduction_single tem_load_reduction_single aot_get_val aot_get_val proc~tem_load_reduction_single->aot_get_val proc~tem_abort tem_abort proc~tem_load_reduction_single->proc~tem_abort proc~upper_to_lower upper_to_lower proc~tem_load_reduction_single->proc~upper_to_lower mpi_abort mpi_abort proc~tem_abort->mpi_abort

Called by

proc~~tem_load_reduction_single~~CalledByGraph proc~tem_load_reduction_single tem_load_reduction_single proc~tem_load_reduction_spatial tem_load_reduction_spatial proc~tem_load_reduction_spatial->proc~tem_load_reduction_single proc~tem_load_convergenceheader tem_load_convergenceHeader proc~tem_load_convergenceheader->proc~tem_load_reduction_spatial proc~tem_load_trackingconfig tem_load_trackingConfig proc~tem_load_trackingconfig->proc~tem_load_reduction_spatial proc~tem_convergence_load tem_convergence_load proc~tem_convergence_load->proc~tem_load_convergenceheader proc~tem_load_tracking tem_load_tracking proc~tem_load_tracking->proc~tem_load_trackingconfig proc~tem_abortcriteria_load tem_abortCriteria_load proc~tem_abortcriteria_load->proc~tem_convergence_load

Source Code

  subroutine tem_load_reduction_single(conf, reduceType, handle, key, pos, &
    &                                  iError)
    ! ---------------------------------------------------------------------------
    !> handle for lua file
    type(flu_State),intent(inout) :: conf
    !> reduction type to be filled
    character(len=labelLen), intent(out) :: reduceType
    !> handle for reduce table
    integer, optional,intent(in) :: handle
    !> which key to open
    character(len=*),optional,intent(in) :: key
    !> position to load from in config file
    integer,optional,intent(in) :: pos
    !> error from aotus
    integer, intent(out) :: iError
    ! ---------------------------------------------------------------------------
    if( present( key )) then
      call aot_get_val( L       = conf,       &
        &               thandle = handle,     &
        &               val     = reduceType, &
        &               ErrCode = iError,     &
        &               key     = key         )
    elseif( present( pos ))then
      call aot_get_val( L       = conf,       &
        &               thandle = handle,     &
        &               val     = reduceType, &
        &               ErrCode = iError,     &
        &               pos     = pos         )
    else
      iError = ibset(iError,aoterr_NonExistent)
    endif

    ! if reduceType is empty. can happen when reduceType is defined as table
    if (trim(reduceType) == '' ) iError = ibset(iError,aoterr_NonExistent)

    if(.not. btest(iError, aotErr_NonExistent)) then
      ! convert into lower case
      reduceType = upper_to_lower( reduceType )
      ! Check the chosen reduceType
      select case( trim(reduceType) )
        case('sum')
        case('average')
        case('l2norm','l2_norm')
          reduceType = 'l2norm'
        case('l2normalized')
          reduceType = 'l2normalized'
        case('linfnorm', 'linf_norm', 'l_inf_norm')
          reduceType = 'linfnorm'
        case('max','maximum')
          reduceType = 'max'
        case('min','minimum')
          reduceType = 'min'
        case('weighted_sum', 'w_sum')
          ! result weighted by its volume factor
          reduceType = 'weighted_sum'
        case('none')
        case default
          write(logUnit(1),*)' Error: The chosen reduction '//  &
            &                trim(reduceType)//' is not defined.'
          call tem_abort()
      end select
    endif

  end subroutine tem_load_reduction_single