Index: trunk/psLib/src/astronomy/psTime.c
===================================================================
--- trunk/psLib/src/astronomy/psTime.c	(revision 3182)
+++ trunk/psLib/src/astronomy/psTime.c	(revision 3220)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.51 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-10 02:36:41 $
+ *  @version $Revision: 1.52 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-02-15 03:02:53 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -74,4 +74,5 @@
 psF64 searchTables(psF64 index, psU64 column, psLookupStatusType *status, char *metadataTableNames[], psU32 nTables);
 
+
 /** Removes leading and trailing whitespace and # characters from a string. The cleaned string is a new null
  *  terminated copy of the original input string. */
@@ -133,4 +134,17 @@
     return cleanToken;
 }
+
+// get the psTime.config filename by checking environment variable first, then original installation area.
+char* p_psGetConfigFileName()
+{
+    char* filename = getenv("PS_CONFIG_FILE");
+
+    if (filename == NULL) { // environment variable not found
+        filename = PS_CONFIG_FILE_DEFAULT; // this should come from configure.ac
+    }
+
+    return filename;
+}
+
 
 /** Searches time tables in priority order and performs interpolation if input index value is within a table.
@@ -148,5 +162,5 @@
     // Check time metadata. Function call reports errors.
     if(timeMetadata == NULL) {
-        if(!p_psTimeInit(CONFIG_FILE))
+        if(!p_psTimeInit(p_psGetConfigFileName()))
             return 0.0;
     }
@@ -705,5 +719,5 @@
     // Check time metadata
     if(timeMetadata == NULL) {
-        if(!p_psTimeInit(CONFIG_FILE)) {
+        if(!p_psTimeInit(p_psGetConfigFileName())) {
             psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_FILE_NOT_FOUND, "psTime.config");
             return 0.0;
