Index: trunk/psLib/src/collections/psScalar.c
===================================================================
--- trunk/psLib/src/collections/psScalar.c	(revision 1060)
+++ trunk/psLib/src/collections/psScalar.c	(revision 1060)
@@ -0,0 +1,122 @@
+/** @file  psScalar.c
+ *
+ *  @brief Contains basic scalar definitions and operations
+ *
+ *  This file defines the basic type for a scalar struct and functions useful
+ *  in manupulating scalars.
+ * *
+ *  @author Ross Harman, MHPCC
+ *
+ *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-18 23:35:49 $
+ *
+ *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
+ */
+
+/******************************************************************************/
+/*  INCLUDE FILES                                                             */
+/******************************************************************************/
+#include "psMemory.h"
+#include "psError.h"
+#include "psScalar.h"
+#include "psLogMsg.h"
+
+/******************************************************************************/
+/*  DEFINE STATEMENTS                                                         */
+/******************************************************************************/
+
+// None
+
+/******************************************************************************/
+/*  TYPE DEFINITIONS                                                          */
+/******************************************************************************/
+
+// None
+
+/*****************************************************************************/
+/*  GLOBAL VARIABLES                                                         */
+/*****************************************************************************/
+
+// None
+
+/*****************************************************************************/
+/*  FILE STATIC VARIABLES                                                    */
+/*****************************************************************************/
+
+// None
+
+/*****************************************************************************/
+/*  FUNCTION IMPLEMENTATION - LOCAL                                          */
+/*****************************************************************************/
+
+// None
+
+/*****************************************************************************/
+/* FUNCTION IMPLEMENTATION - PUBLIC                                          */
+/*****************************************************************************/
+psScalar *psScalarAlloc(psC64 value, psElemType dataType)
+{
+    double valueReal = 0.0;
+    psScalar *scalar = NULL;
+
+    // Create scalar
+    scalar = (psScalar *)psAlloc(sizeof(psScalar));
+    scalar->type.dimen = PS_DIMEN_SCALAR;
+    scalar->type.type = dataType;
+    valueReal = creal(value);
+
+    switch (dataType) {
+    case PS_TYPE_S8:
+        scalar->data.S8 = (psS8)value;
+        break;
+    case PS_TYPE_U8:
+        scalar->data.U8 = (psU8)value;
+        break;
+    case PS_TYPE_S16:
+        scalar->data.S16 = (psS16)value;
+        break;
+    case PS_TYPE_U16:
+        scalar->data.U16 = (psU16)value;
+        break;
+    case PS_TYPE_S32:
+        scalar->data.S32 = (psS32)value;
+        break;
+    case PS_TYPE_U32:
+        scalar->data.U32 = (psU32)value;
+        break;
+    case PS_TYPE_S64:
+        scalar->data.S64 = (psS64)value;
+        break;
+    case PS_TYPE_U64:
+        scalar->data.U64 = (psU64)value;
+        break;
+    case PS_TYPE_F32:
+        scalar->data.F32 = (psF32)value;
+        break;
+    case PS_TYPE_F64:
+        scalar->data.F64 = (psF64)value;
+        break;
+    case PS_TYPE_C32:
+        scalar->data.C32 = (psC32)value;
+        break;
+    case PS_TYPE_C64:
+        scalar->data.C64 = (psC64)value;
+        break;
+    default:
+        psError(__func__, ": Line %d - Invalid PS_TYPE: %d", __LINE__, dataType);
+    }
+
+
+    return scalar;
+}
+
+void psScalarFree(psScalar *restrict scalar)
+{
+    if (scalar == NULL) {
+        return;
+    }
+
+    psFree(scalar);
+}
+
+
Index: trunk/psLib/src/collections/psScalar.h
===================================================================
--- trunk/psLib/src/collections/psScalar.h	(revision 1060)
+++ trunk/psLib/src/collections/psScalar.h	(revision 1060)
@@ -0,0 +1,83 @@
+/** @file  psScalar.h
+ *
+ *  @brief Contains basic scalar definitions and operations
+ *
+ *  This file defines the basic type for a scalar struct and functions useful
+ *  in manupulating scalars.
+ *
+ *  @ingroup Scalar
+ *
+ *  @author Ross Harman, MHPCC
+ *
+ *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-18 23:36:02 $
+ *
+ *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
+ */
+
+#ifndef PS_SCALAR_H
+#define PS_SCALAR_H
+
+#include "psType.h"
+
+/// @addtogroup Scalar
+/// @{
+
+/** Basic scalar data structure.
+ *
+ * Struct for maintaining a scalar of frequently used primitive types.
+ *
+ */
+typedef struct
+{
+    psType type;                       ///< Type of data.
+
+    union {
+        psU8    U8;                    ///< Unsigned 8-bit integer data.
+        psU16   U16;                   ///< Unsigned 16-bit integer data.
+        psU32   U32;                   ///< Unsigned 32-bit integer data.
+        psU64   U64;                   ///< Unsigned 64-bit integer data.
+        psS8    S8;                    ///< Signed 8-bit integer data.
+        psS16   S16;                   ///< Signed 16-bit integer data.
+        psS32   S32;                   ///< Signed 32-bit integer data.
+        psS64   S64;                   ///< Signed 64-bit integer data.
+        psF32   F32;                   ///< Single-precision float data.
+        psF64   F64;                   ///< Double-precision float data.
+        psC32   C32;                   ///< Single-precision complex data.
+        psC64   C64;                   ///< Double-precision complex data.
+    } data;                            ///< Union for data types.
+}
+psScalar;
+
+/*****************************************************************************/
+/* FUNCTION PROTOTYPES                                                       */
+/*****************************************************************************/
+
+/** Allocate a scalar.
+ *
+ * Uses psLib memory allocation functions to create scalar data as defined by the psType type.
+ * Accepts a complex 64 bit float for input value, as max size, but resizes according to
+ * correct type.
+ * @return psScalar*: Pointer to psScalar.
+ *
+ */
+psScalar *psScalarAlloc(
+    psC64 value,            ///< Data to be put into psScalar.
+    psElemType dataType     ///< Type of data to be held by psScalar.
+);
+
+
+/** Deallocate a scalar.
+ *
+ * Uses psLib memory allocation functions to deallocate a scalar.
+ *
+ * @return void.
+ *
+ */
+void psScalarFree(
+    psScalar *restrict scalar  ///< Scalar to free.
+);
+
+/// @}
+
+#endif
