tem_create_varMap Subroutine

public subroutine tem_create_varMap(varName, varSys, varMap)

Creates a variable map. Therefore it looks for the variables stored in varname in the varSys. If found, the name and the corresponding position in the varSys is added to the resultung varMap.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: varName(:)

array of variable labels

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

variable system to look for varName

type(tem_varMap_type), intent(out) :: varMap

Contains position of varname in given varSys


Calls

proc~~tem_create_varmap~~CallsGraph proc~tem_create_varmap tem_create_varMap interface~append~4 append proc~tem_create_varmap->interface~append~4 interface~init~29 init proc~tem_create_varmap->interface~init~29 interface~positionofval~5 positionofval proc~tem_create_varmap->interface~positionofval~5 interface~truncate~23 truncate proc~tem_create_varmap->interface~truncate~23 proc~append_ga_stringkeyvaluepair append_ga_stringkeyvaluepair interface~append~4->proc~append_ga_stringkeyvaluepair proc~append_ga_stringkeyvaluepair_vec append_ga_stringkeyvaluepair_vec interface~append~4->proc~append_ga_stringkeyvaluepair_vec proc~init_da_label init_da_label interface~init~29->proc~init_da_label proc~posofval_label posofval_label interface~positionofval~5->proc~posofval_label proc~truncate_da_label truncate_da_label interface~truncate~23->proc~truncate_da_label interface~expand~3 expand proc~append_ga_stringkeyvaluepair->interface~expand~3 proc~append_ga_stringkeyvaluepair_vec->interface~expand~3 interface~sortedposofval~5 sortedposofval proc~posofval_label->interface~sortedposofval~5 proc~expand_ga_stringkeyvaluepair expand_ga_stringkeyvaluepair interface~expand~3->proc~expand_ga_stringkeyvaluepair proc~sortposofval_label sortposofval_label interface~sortedposofval~5->proc~sortposofval_label

Called by

proc~~tem_create_varmap~~CalledByGraph proc~tem_create_varmap tem_create_varMap proc~hvs_output_init hvs_output_init proc~hvs_output_init->proc~tem_create_varmap proc~tem_init_convergence tem_init_convergence proc~tem_init_convergence->proc~tem_create_varmap proc~tem_init_depend tem_init_depend proc~tem_init_depend->proc~tem_create_varmap proc~tem_init_tracker tem_init_tracker proc~tem_init_tracker->proc~tem_create_varmap proc~tem_init_tracker->proc~hvs_output_init proc~tem_opvar_reduction_transient_init tem_opVar_reduction_transient_init proc~tem_opvar_reduction_transient_init->proc~tem_create_varmap

Source Code

  subroutine tem_create_varMap( varName, varSys, varMap )
    ! --------------------------------------------------------------------------
    !> array of variable labels
    character(len=*), intent(in) :: varName(:)

    !> variable system to look for varName
    type(tem_varSys_type), intent(in) :: varSys

    !> Contains position of varname in given varSys
    type(tem_varMap_type), intent(out) :: varMap
    ! --------------------------------------------------------------------------
    integer :: varPos, iVar
    ! --------------------------------------------------------------------------
    write(logUnit(10),*) 'Create varMap:'
    call init(varMap%varName)
    call init(varMap%varPos)
    do iVar = 1, size(varName)
      varPos = PositionOfVal( me  = varSys%varName,     &
        &                     val = trim(varName(iVar)) )
      if (varPos > 0) then
        write(logUnit(10),"(A,I0)") 'Position of ' // trim(varName(iVar)) &
          & // ': ', varPos
        call append( me = varMap%varPos, val = varPos )
        call append( me = varMap%varname, val = varName(iVar) )
      else
        write(logUnit(5),*) 'Variable ' // trim(varName(iVar)) // &
          &                 ' not found in varSys'
      end if
    end do
    call truncate(varMap%varName)
    call truncate(varMap%varPos)
    varMap%nScalars = sum( varSys%method%val(             &
      &                    varMap%varPos%val(:) )%nComponents )
    write(logUnit(10),"(A,I0)") 'nScalars in varMap: ', varMap%nScalars

  end subroutine tem_create_varMap