D.3.9 Base_Structure Class Unit Test Program

This lightly commented program performs a unit test on the Base_Structure Class.

program Unit_Test

  use Caesar_Intrinsics_Module
  use Caesar_Base_Structure_Class
  use Caesar_Communication_Class
  implicit none

  type(Communication_type) :: Comm
  type(Base_Structure_type) :: Cell_Structure
  type(Status_type) :: status
  type(character,name_length) :: Cell_Locus
  type(integer,1) :: Cell_Length_Vector
  type(integer) :: i

  ! Initializations.

  call Initialize (Comm)
  call Output (Comm)
  call Initialize (status)
  call Initialize (Cell_Locus)
  call Initialize (Cell_Length_Vector, NPEs)

  ! Set up.

  Cell_Locus = 'Cells'
  Cell_Length_Vector = (/ (i**2, i = 1, NPEs) /)

  ! Initialize base structure.
  call Initialize (Cell_Structure, Cell_Length_Vector, Cell_Locus, status)

  ! Output info.

  call Output (Cell_Structure)

  ! Check state of base structure.


  ! Generate an even distribution (only output on error).

  call Generate_Even_Distribution (Cell_Length_Vector, 123456789)

  ! Finalize base structure and communications.

  call Finalize (Cell_Structure)
  call Finalize (Comm)


Michael L. Hall