D.6 Distributed_Vector Class Code Listing

The main documentation of the Distributed_Vector Class contains additional explanation of this code listing.

!
! Author: Michael L. Hall
!         P.O. Box 1663, MS-D413, LANL
!         Los Alamos, NM 87545
!         ph: 505-665-4312
!         email: Hall@LANL.gov
! 
! Created on: 10/18/99
! CVS Info:   $Id: distributed_vector.F90,v 5.5 2006/10/17 23:01:53 hall Exp $

module Caesar_Distributed_Vector_Class

  ! Global use associations.

  use Caesar_Intrinsics_Module
  use Caesar_Communication_Class
  use Caesar_Base_Structure_Class
  use Caesar_Assembled_Vector_Class

  ! Start up with everything untyped and private.

  implicit none
  private

  ! Public procedures.

  public :: Initialize, Finalize, Valid_State, Initialized, Assignment (=)
  public :: Get_Values, Locus, Name, Output, Set_Values, &
            Set_Version, Version

  interface Initialize
    module procedure Initialize_Distributed_Vector
  end interface

  interface Finalize
    module procedure Finalize_Distributed_Vector
  end interface

  interface Valid_State
    module procedure Valid_State_Distributed_Vector
  end interface

  interface Initialized
    module procedure Initialized_Distributed_Vector
  end interface

  interface Assemble
    module procedure Assemble_AV_from_DV
  end interface

  interface Assignment (=)
    module procedure Assemble_AV_from_DV
    module procedure Distribute_AV_to_DV
    module procedure Get_Values_Distributed_Vector_1
    module procedure Get_Values_Distributed_Vector_2
    module procedure Get_Values_Distributed_Vector_3
    module procedure Get_Values_Distributed_Vector_4
    module procedure Set_Values_Distributed_Vector_1
    module procedure Set_Values_Distributed_Vector_2
    module procedure Set_Values_Distributed_Vector_3
    module procedure Set_Values_Distributed_Vector_4
    module procedure Set_Version_Distributed_Vector
  end interface

  interface Distribute
    module procedure Distribute_AV_to_DV
  end interface

  interface Get_Values
    module procedure Get_Values_Distributed_Vector_1
    module procedure Get_Values_Distributed_Vector_2
    module procedure Get_Values_Distributed_Vector_3
    module procedure Get_Values_Distributed_Vector_4
  end interface

  interface Locus
    module procedure Get_Locus_Distributed_Vector
  end interface

  interface Name
    module procedure Get_Name_Distributed_Vector
  end interface

  interface Output
    module procedure Output_Distributed_Vector
  end interface

  interface Set_Version
    module procedure Set_Version_Distributed_Vector
  end interface

  interface Set_Values
    module procedure Set_Values_Distributed_Vector_1
    module procedure Set_Values_Distributed_Vector_2
    module procedure Set_Values_Distributed_Vector_3
    module procedure Set_Values_Distributed_Vector_4
  end interface

  interface Version
    module procedure Get_Version_Distributed_Vector
  end interface

  ! Public type definitions.

  public :: Distributed_Vector_type

  type Distributed_Vector_type

    ! Initialization flag.

    type(integer) :: Initialized               

    ! The name for this variable (especially useful in a vector of Distributed
    ! Vectors).

    type(character,name_length) :: Name

    ! Version number which is incremented every time the vector is modified,
    ! or is synced with the version number of a data structure that it
    ! depends on when it is updated.

    type(integer) :: Version  

    ! Basic data structure for the axis that is spread over the processors.

    type(Base_Structure_type), pointer :: Structure

    ! The number of dimensions that the "vector" has, including the dimension
    ! that is spread over the processors. "Ragged_Right" vectors are signified
    ! by a Dimensionality of -1.

    type(integer) :: Dimensionality

    ! The extents of the dimensions that the "vector" has, including
    ! the dimension that is spread over the processors, which is last. 

    type(integer,1) :: Dimensions

    ! Total number of values in the entire vector (including all PEs).

    type(integer) :: NValues_Total

    ! Number of values on this PE.

    type(integer) :: NValues_PE

    ! A vector containing the number of values on each PE.

    type(integer,1) :: NValues_Vector

    ! Values in the vector, with a different length on each PE. Values may
    ! have either 1, 2, 3, or 4 dimensions, or be a ragged right array. The
    ! last dimension is always the dimension that is spread across the
    ! processors. Only one of the following variables will be allocated for
    ! a given object.

    type(real,1) :: Values1
    type(real,2) :: Values2
    type(real,3) :: Values3
    type(real,4) :: Values4
    ! Needed for Adaptive Angular Refinement.
    ! type(Ragged_Right_Real_type) :: ValuesRR 

  end type Distributed_Vector_type

  ! Global class variables.

  type(integer), parameter :: Version_Increment = 4

 ! Not yet implemented:
 !
 ! call Combine_DV_from_BNA (Distributed_Vector, Bare_Naked_Array) --> =  (assume SUM)
 ! (May not be able to make assignment interface due to conflict with BNV accesses.)
 !
 ! Bare_Naked_Array = Gather_Collect_Access (Distributed_Vector, One_Structure, &
 !                    Many_of_One_Index)

contains

The Distributed_Vector Class contains the following routines which are listed in separate sections:

* Initialize_Distributed_Vector
* Finalize_Distributed_Vector
* Valid_State_Distributed_Vector
* Initialized_Distributed_Vector
* Assemble_AV_from_DV
* Distribute_AV_to_DV
* Get_Locus_Distributed_Vector
* Get_Name_Distributed_Vector
* Get_Values_Distributed_Vector
* Get_Version_Distributed_Vector
* Output_Distributed_Vector
* Set_Values_Distributed_Vector
* Set_Version_Distributed_Vector

end module Caesar_Distributed_Vector_Class



Subsections
Michael L. Hall