D.2.5 Assemble Procedure

The main documentation of the Assemble Procedure contains additional explanation of this code listing.

  define([ASSEMBLE_ROUTINE],[
    ifelse([$1], [character],
      [pushdef([TYPE], [character,*])],
      [pushdef([TYPE], [$1])])
    pushdef([DIM], [$2])
    pushdef([Assemble_TYPE_DIM], expand(Assemble_$1_DIM))

    subroutine Assemble_TYPE_DIM (Output, Input)

      ! Input variables.

      type(TYPE,DIM,np), intent(in) :: Input    ! Variable to be assembled.

      ! Output variable.

      type(TYPE,1,np), intent(out) :: Output    ! Assembled variable.
  
      !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      ! Verify requirements - none.
  
      ! Do the global assemble.

      ifdef([USE_PGSLIB],[

        ! PGSLib parallel assemble.

        call PGSLib_Collate (Output, Input)

      ],[

        ! Serial assemble.

        Output = Input

      ])

      ! Verify guarantees - none.
  
      return
    end subroutine Assemble_TYPE_DIM
  
    popdef([TYPE])
    popdef([DIM])
    popdef([Assemble_TYPE_DIM])
  ])

  forloop([Dim],[0],[1],[
    fortext([Type],[real integer logical character],[
      ASSEMBLE_ROUTINE(Type, Dim)
    ])
  ])



Michael L. Hall