set_params_spacetime Subroutine

public recursive subroutine set_params_spacetime(fun, varSys, instring)

This routine process instring and store information in spacetime function.

Abort if same spacetime function is used as boundaries and sources.

Arguments

Type IntentOptional Attributes Name
class(tem_varSys_op_type), intent(in) :: fun

Description of the method to obtain the variables, here some preset values might be stored, like the space time function to use or the required variables.

type(tem_varSys_type), intent(in) :: varSys

The variable system to obtain the variable from.

character(len=*), intent(in) :: instring

Input string with parameter to set in method_data


Calls

proc~~set_params_spacetime~~CallsGraph proc~set_params_spacetime set_params_spacetime aot_get_val aot_get_val proc~set_params_spacetime->aot_get_val open_config_chunk open_config_chunk proc~set_params_spacetime->open_config_chunk proc~tem_abort tem_abort proc~set_params_spacetime->proc~tem_abort mpi_abort mpi_abort proc~tem_abort->mpi_abort

Source Code

  recursive subroutine set_params_spacetime( fun, varSys, instring )
    ! -------------------------------------------------------------------- !
    !> Description of the method to obtain the variables, here some preset
    !! values might be stored, like the space time function to use or the
    !! required variables.
    class(tem_varSys_op_type), intent(in) :: fun

    !> The variable system to obtain the variable from.
    type(tem_varSys_type), intent(in) :: varSys

    !> Input string with parameter to set in method_data
    character(len=*), intent(in) :: instring
    ! -------------------------------------------------------------------- !
    type(flu_state) :: conf
    type(tem_st_fun_listElem_type), pointer :: fPtr
    logical :: isSurface_loc
    integer :: iStFun
    integer :: iError
    ! -------------------------------------------------------------------- !
    call C_F_POINTER( fun%method_Data, fPtr )

    call open_config_chunk(L = conf, chunk = instring)
    call aot_get_val( L       = conf,          &
      &               key     = 'isSurface',   &
      &               val     = isSurface_loc, &
      &               ErrCode = iError         )

    if (btest(iError,  aoterr_Fatal)) then
      write(logUnit(1),*) 'Error: In set_params to load "isSurface" '//&
        &                 'for spacetime variable ', &
        &                 trim(varSys%varname%val(fun%mypos))
      if (btest(iError, aoterr_WrongType)) then
        write(logUnit(1),*) '       "isSurface" is wrong type'
      end if
      if (btest(iError, aoterr_NonExistent)) then
        write(logUnit(1),*) '       "isSurface" does not exist'
      end if
      call tem_abort()
    end if

    ! KM Store bc_id and field id only for apesmate coupling
    do iStFun = 1, fPtr%nVals
      select case (trim(fPtr%val(iStFun)%fun_kind))
      case ('apesmate')
        if (fPtr%isSurface == -1) then
          if (isSurface_loc) then
            fPtr%isSurface = 0
          else
            fPtr%isSurface = 1
          end if
        else
          write(logUnit(10),*) 'Warning: ' &
            &                  // 'Set params stfun: isSurface is already set'
          if (isSurface_loc) then
            if (fPtr%isSurface == 1) then
              write(logUnit(1),*) 'Error: In set params for spacetime function'
              write(logUnit(1),*) '       This st_fun is already used for' &
                &                 // ' volume'
              write(logUnit(1),*) '       so cannot be used for surface.'
              call tem_abort()
            end if
          else
            if (fPtr%isSurface == 0) then
              write(logUnit(1),*) 'Error: In set params for spacetime function'
              write(logUnit(1),*) '       This st_fun is already used for' &
                &                 // ' surface'
              write(logUnit(1),*) '       so cannot be used for volume.'
              call tem_abort()
            end if
          end if
        end if

        ! store surface or volume information in coupling type
        fPtr%val(iStFun)%aps_coupling%isSurface = fPtr%isSurface

      end select
    end do

  end subroutine set_params_spacetime