codimension

One codimension of a coarray.

Declaración

Sintaxis

codimension = (expr? start, expr? end, codimension_type end_star)

Argumentos

Argument

Descripción

start

the lower cobound.

end

the upper cobound, when end_star is CodimensionExpr.

end_star

whether the upper cobound is an expression or *; see codimension_type.

Valores devueltos

None.

Descripción

Unlike a dimension this holds the two bounds rather than a bound and an extent, because the last codimension is always *: its extent depends on the number of images and is only known at run time.

Codimensions live on the Variable rather than on the type, since they describe how copies of the object are distributed across images and not the shape of one copy.

Ejemplos

(codimension
  :start (IntegerConstant
    :n 1
    :type (Integer
      :kind 4
    )
    :intboz_type :Decimal
  )
  :end nil
  :end_star :CodimensionExpr
)

It comes from this complete ASR text document:

(TranslationUnit
  :symtab (SymbolTable
    :id 0
    :symbols {
      "main" (Program
        :symtab (SymbolTable
          :id 1
          :symbols {
            "a" (Variable
              :parent_symtab 1
              :name "a"
              :dependencies []
              :intent :Local
              :symbolic_value nil
              :value nil
              :storage :Default
              :type (Integer
                :kind 4
              )
              :type_declaration nil
              :abi :Source
              :access :Public
              :presence :Required
              :value_attr false
              :target_attr false
              :contiguous_attr false
              :bindc_name nil
              :is_volatile false
              :is_protected false
              :pass_attr :NotMethod
              :self_argument nil
              :codims [
                (codimension
                  :start (IntegerConstant
                    :n 1
                    :type (Integer
                      :kind 4
                    )
                    :intboz_type :Decimal
                  )
                  :end nil
                  :end_star :CodimensionExpr
                )
              ]
            )
            "i" (Variable
              :parent_symtab 1
              :name "i"
              :dependencies []
              :intent :Local
              :symbolic_value nil
              :value nil
              :storage :Default
              :type (Integer
                :kind 4
              )
              :type_declaration nil
              :abi :Source
              :access :Public
              :presence :Required
              :value_attr false
              :target_attr false
              :contiguous_attr false
              :bindc_name nil
              :is_volatile false
              :is_protected false
              :pass_attr :NotMethod
              :self_argument nil
              :codims []
            )
          }
        )
        :name "main"
        :dependencies []
        :body [
          (Assignment
            :target (Var
              :v (SymbolRef 1 "i")
            )
            :value (CoarrayRef
              :var (Var
                :v (SymbolRef 1 "a")
              )
              :coindices [
                (coarray_index
                  :index (IntegerConstant
                    :n 1
                    :type (Integer
                      :kind 4
                    )
                    :intboz_type :Decimal
                  )
                  :star :CodimensionExpr
                )
              ]
              :type (Integer
                :kind 4
              )
              :value nil
            )
            :overloaded nil
            :realloc_lhs false
            :move_allocation false
          )
        ]
      )
    }
  )
  :items []
)

Ver también

codimension_type, coarray_index, CoarrayRef, Variable