tem_variable_loadMapping_vector Subroutine

public subroutine tem_variable_loadMapping_vector(possVars, conf, parent, key, varDict, varSys)

Loads the variable mapping from a table defined by given key for the variable names defined in possVars list. A variable mapping is used to link a user defined variable to a variable expected from, e.g., an equation system. These mappings are stored in varDict, which basically is a dictionary, whereas the key contains the name of the expected variable and the value contains the name of the user defined variable in the variable table.

Arguments

Type IntentOptional AttributesName
type(tem_possible_variable_type), intent(in) :: possVars

Possible variable names expected by the solver

type(flu_state), intent(in) :: conf

lua config file

integer, intent(in), optional :: parent

optional parent handle

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

optional key for the table

type(grw_stringkeyvaluepairarray_type), intent(inout) :: varDict

The dictionary that contains the mapping between expected variables and the actual variables defined by the user.

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

Variable system to append anonymous variables to.


Calls

proc~~tem_variable_loadmapping_vector~~CallsGraph proc~tem_variable_loadmapping_vector tem_variable_loadMapping_vector proc~aot_table_open aot_table_open proc~tem_variable_loadmapping_vector->proc~aot_table_open proc~aot_table_close aot_table_close proc~tem_variable_loadmapping_vector->proc~aot_table_close proc~tem_variable_loadmapping_single tem_variable_loadMapping_single proc~tem_variable_loadmapping_vector->proc~tem_variable_loadmapping_single interface~tem_varsys_append_stfun tem_varSys_append_stfun proc~tem_variable_loadmapping_single->interface~tem_varsys_append_stfun interface~tem_load_spacetime tem_load_spacetime proc~tem_variable_loadmapping_single->interface~tem_load_spacetime proc~aot_exists aot_exists proc~tem_variable_loadmapping_single->proc~aot_exists interface~append~9 append proc~tem_variable_loadmapping_single->interface~append~9 proc~tem_spacetime_hash_id tem_spacetime_hash_id proc~tem_variable_loadmapping_single->proc~tem_spacetime_hash_id interface~aot_get_val aot_get_val proc~tem_variable_loadmapping_single->interface~aot_get_val proc~tem_varsys_append_stfunvar tem_varSys_append_stFunVar interface~tem_varsys_append_stfun->proc~tem_varsys_append_stfunvar proc~tem_varsys_append_stfun_raw tem_varSys_append_stFun_raw interface~tem_varsys_append_stfun->proc~tem_varsys_append_stfun_raw proc~tem_load_spacetime_single tem_load_spacetime_single interface~tem_load_spacetime->proc~tem_load_spacetime_single proc~tem_load_spacetime_table tem_load_spacetime_table interface~tem_load_spacetime->proc~tem_load_spacetime_table proc~append_ga_stringkeyvaluepair append_ga_stringkeyvaluepair interface~append~9->proc~append_ga_stringkeyvaluepair proc~append_ga_stringkeyvaluepair_vec append_ga_stringkeyvaluepair_vec interface~append~9->proc~append_ga_stringkeyvaluepair_vec proc~aot_fun_id aot_fun_id proc~tem_spacetime_hash_id->proc~aot_fun_id proc~aot_fun_close aot_fun_close proc~tem_spacetime_hash_id->proc~aot_fun_close interface~aot_fun_open aot_fun_open proc~tem_spacetime_hash_id->interface~aot_fun_open interface~expand~7 expand proc~append_ga_stringkeyvaluepair->interface~expand~7 proc~tem_varsys_assignevaltype tem_varSys_assignEvalType proc~tem_varsys_append_stfunvar->proc~tem_varsys_assignevaltype proc~tem_varsys_append_dervar tem_varSys_append_derVar proc~tem_varsys_append_stfunvar->proc~tem_varsys_append_dervar proc~tem_abort tem_abort proc~tem_varsys_append_stfunvar->proc~tem_abort interface~append~25 append proc~tem_varsys_append_stfunvar->interface~append~25 proc~append_ga_stringkeyvaluepair_vec->interface~expand~7 proc~tem_varsys_append_stfun_raw->proc~tem_varsys_assignevaltype proc~tem_varsys_append_stfun_raw->proc~tem_varsys_append_dervar proc~tem_varsys_append_stfun_raw->proc~tem_abort proc~tem_varsys_append_stfun_raw->interface~append~25 proc~tem_load_spacetime_single->proc~aot_table_open proc~tem_load_spacetime_single->proc~aot_exists proc~tem_load_spacetime_single->proc~aot_fun_close proc~tem_load_spacetime_single->proc~tem_load_spacetime_single proc~tem_load_spacetime_single->interface~aot_fun_open interface~tem_load_shape tem_load_shape proc~tem_load_spacetime_single->interface~tem_load_shape proc~aot_type_of aot_type_of proc~tem_load_spacetime_single->proc~aot_type_of interface~aot_get_val~2 aot_get_val proc~tem_load_spacetime_single->interface~aot_get_val~2 proc~load_spacetime_asconst load_spacetime_asConst proc~tem_load_spacetime_single->proc~load_spacetime_asconst proc~tem_load_spacetime_single->proc~tem_abort proc~load_spacetime_predefined load_spacetime_predefined proc~tem_load_spacetime_single->proc~load_spacetime_predefined proc~aot_reference_for aot_reference_for proc~tem_load_spacetime_single->proc~aot_reference_for proc~tem_load_spacetime_table->proc~aot_table_open proc~tem_load_spacetime_table->proc~aot_table_close proc~tem_load_spacetime_table->proc~tem_load_spacetime_single proc~aot_table_length aot_table_length proc~tem_load_spacetime_table->proc~aot_table_length

Called by

proc~~tem_variable_loadmapping_vector~~CalledByGraph proc~tem_variable_loadmapping_vector tem_variable_loadMapping_vector interface~tem_variable_loadmapping tem_variable_loadMapping interface~tem_variable_loadmapping->proc~tem_variable_loadmapping_vector proc~tem_load_bc_state tem_load_bc_state proc~tem_load_bc_state->interface~tem_variable_loadmapping

Contents


Source Code

  subroutine tem_variable_loadMapping_vector( possVars, conf, parent, key,     &
    &                                         varDict, varSys                  )
    !---------------------------------------------------------------------------
    !> Possible variable names expected by the solver
    type(tem_possible_variable_type), intent(in) :: possVars
    !> lua config file
    type(flu_state), intent(in) :: conf
    !> optional parent handle
    integer, optional, intent(in) :: parent
    !> optional key for the table
    character(len=*), optional, intent(in) :: key
    !> The dictionary that contains the mapping between expected variables
    !! and the actual variables defined by the user.
    type(grw_stringKeyValuePairArray_type), intent(inout) :: varDict
    !> Variable system to append anonymous variables to.
    type(tem_varSys_type), intent(inout) :: varSys

    !---------------------------------------------------------------------------
    character(len=32) :: localKey
    integer :: iVar, srchandle
    integer :: ErrorCode(possVars%varname%nVals)
    !---------------------------------------------------------------------------

    if( present( key )) then
      localKey = key
    else
      localKey = 'source'
    endif
    write(logUnit(1),*) 'Loading the mappings from table: ' // trim(localkey)

    if (possVars%varname%nVals == 0) then
      write(logUnit(1),*) 'WARNING: No possible variables are defined!' &
        & // ' Definitions from ' // trim(localKey) // ' are not loaded.'
      return
    end if

    ! Try to open the mapping table
    call aot_table_open( L       = conf,      &
      &                  parent  = parent,    &
      &                  thandle = srchandle, &
      &                  key     = localkey   )

    ! if mapping table is defined
    if (srchandle > 0) then
      ! loop over all possible variables
      do iVar = 1, possVars%varname%nVals
        ! check if expected variable is defined in lua file
        ! and if variable exist then store in stringKeyValuePairArray
        call tem_variable_loadMapping_single(                  &
          &     expectedName = possVars%varName%val(iVar),     &
          &     conf         = conf,                           &
          &     thandle      = srchandle,                      &
          &     varDict      = varDict,                        &
          &     varSys       = varSys,                         &
          &     nComp        = possVars%nComponents%val(iVar), &
          &     ErrCode      = ErrorCode(iVar)                 )
      end do

      call aot_table_close( L = conf, thandle = srchandle)
    else
      write(logUnit(1),*) 'Table ' // trim(localKey) &
        & // ' could not be opened for reading variable mappings!'
    end if

  end subroutine tem_variable_loadMapping_vector