Index: service.cpp
===================================================================
--- service.cpp	(revision 1863)
+++ service.cpp	(working copy)
@@ -254,8 +254,8 @@
 
 
 			fprintf( ioQQQ, " Cloudy version number is %s\n", 
-				version.chVersion );
-			fprintf( ioQQQ, " %s\n\n", version.chInfo );
+				version::Inst().chVersion );
+			fprintf( ioQQQ, " %s\n\n", version::Inst().chInfo );
 
 			fprintf( ioQQQ, "%5ld warnings,%3ld cautions,%3ld temperature failures.  Messages follow.\n", 
 			  warnings.nwarn, warnings.ncaun, conv.nTeFail );
Index: punch_fits.cpp
===================================================================
--- punch_fits.cpp	(revision 1863)
+++ punch_fits.cpp	(working copy)
@@ -754,7 +754,7 @@
 	strcpy( tempString, "Generated by Cloudy version " );
 	strcat( tempString, chVer );
 	bytesAdded += addComment( tempString );
-	bytesAdded += addComment( version.chInfo );
+	bytesAdded += addComment( version::Inst().chInfo );
 	strcpy( tempString, "--- " );
 	strcat( tempString, timeString );
 	bytesAdded += addComment( tempString );
Index: init_coreload.cpp
===================================================================
--- init_coreload.cpp	(revision 1863)
+++ init_coreload.cpp	(working copy)
@@ -10,7 +10,6 @@
 #include "dense.h"
 #include "hcmap.h"
 #include "h2.h"
-#include "date.h"
 #include "version.h"
 #include "hextra.h"
 #include "mole.h"
@@ -158,80 +157,6 @@
 	hcmap.nmap = 0;
 	hcmap.lgMapBeingDone = false;
 
-	/* set the date saved in date.h into version.chDate 
-	 * this is the decade part of the year counted after 2000 */
-	int nDecade = (YEAR-100)/10;
-	char chDecade[2];
-
-	/* create space for these strings */
-	version.chDate = (char *)MALLOC( sizeof(char)*INPUT_LINE_LENGTH );
-	version.chVersion = (char *)MALLOC( sizeof(char)*INPUT_LINE_LENGTH );
-
-	static char chMonth[12][4] ={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec" };
-	static char chMonthInt[12][3] ={"01","02","03","04","05","06","07","08","09","10","11","12" };
-
-	sprintf(chDecade,"%i", nDecade );
-	/* set date and version - this code will need to be modified in the year 2110 */
-	if( nDecade > 9 )
-	{
-		fprintf(ioQQQ,"must update formation of chDate in cdInit \n");
-		TotalInsanity();
-	}
-	if( DAY < 10 )
-	{
-		sprintf( version.chDate , "%s%1i%s0%1i", 
-			chDecade,
-			YEAR-100-nDecade*10,
-			chMonth[MONTH],
-			DAY );
-		sprintf( version.chVersion , "%s%1i.%s.0%1i", 
-			chDecade,
-			YEAR-100-nDecade*10,
-			chMonthInt[MONTH],
-			DAY );
-	}
-	else
-	{
-		sprintf( version.chDate , "%s%1i%s%2i", 
-			chDecade,
-			YEAR-100-nDecade*10,
-			chMonth[MONTH],
-			DAY );
-		sprintf( version.chVersion , "%s%1i.%s.%2i", 
-			chDecade,
-			YEAR-100-nDecade*10,
-			chMonthInt[MONTH],
-			DAY );
-	}
-
-	version.chCitation = CITATION;
-	version.chCitationLatex = CITATION_LATEX;
-	version.chCitationShort = CITATION_SHORT;
-
-	/* is this a release version? */
-	version.lgRelease = false;
-
-	/* is this a beta version?  0 for no */
-	version.nBetaVer = 0;
-
-	/* optional letter could come here for updates to branched version */
-	/*strcat( version.chVersion , "a" );*/
-	/* change following from * to letter when letters are used */
-	strcat( version.chDate , "*" );
-
-	char mode[6];
-	if( sizeof(long) == 4 )
-		strncpy( mode, "ILP32", 6 );
-	else if( sizeof(long) == 8 )
-		strncpy( mode, "LP64", 6 );
-	else
-		strncpy( mode, "?????", 6 );
-
-	/* now generate info on how we were compiled, including compiler version */
-	sprintf(version.chInfo , 
-		"cdInit compiled on %s in OS %s using the %s %i compiler in %s mode." ,
-		__DATE__  ,__OS , __COMP , __COMP_VER, mode);
-
 	/* name of output file from optimization run */
 	strncpy( chOptimFileName , "optimal.in" , sizeof( chOptimFileName ) );
 
Index: grains_mie.cpp
===================================================================
--- grains_mie.cpp	(revision 1863)
+++ grains_mie.cpp	(working copy)
@@ -376,7 +376,7 @@
 
 	(void)time(&timer);
 	lgErr = lgErr || ( fprintf(fdes,"# this file was created by Cloudy %s (%s) on %s",
-				   version.chVersion,version.chDate,ctime(&timer)) < 0 );
+														 version::Inst().chVersion,version::Inst().chDate,ctime(&timer)) < 0 );
 	lgErr = lgErr || ( fprintf(fdes,"# ===========================================\n#\n") < 0 );
 	lgErr = lgErr || ( fprintf(fdes,"%12ld # magic number opacity file\n",MAGIC_OPC) < 0 );
 	lgErr = lgErr || ( fprintf(fdes,"%12ld # magic number rfi/mix file\n",gd.magic) < 0 );
Index: assert_results.cpp
===================================================================
--- assert_results.cpp	(revision 1863)
+++ assert_results.cpp	(working copy)
@@ -2471,7 +2471,7 @@
 		/* explain how we were compiled, but only if printing time */
 		if( prt.lgPrintTime )
 		{
-			fprintf( ioQQQ, " %s\n\n", version.chInfo );
+			fprintf( ioQQQ, " %s\n\n", version::Inst().chInfo );
 		}
 	}
 	return lgAssertsOK;
Index: parse_punch.cpp
===================================================================
--- parse_punch.cpp	(revision 1863)
+++ parse_punch.cpp	(working copy)
@@ -202,7 +202,7 @@
 	{
 		sprintf( chHeader, 
 			"# %s %s\n", 
-		  version.chVersion, input.chTitle );
+		  version::Inst().chVersion, input.chTitle );
 	}
 
 	/* usually results for each iteration are followed by a series of
Index: optimize_phymir.cpp
===================================================================
--- optimize_phymir.cpp	(revision 1863)
+++ optimize_phymir.cpp	(working copy)
@@ -227,8 +227,8 @@
 	}
 	else
 	{
-		strcpy(chDum1,version.chDate);
-		strcpy(chDum2,version.chVersion);
+		strcpy(chDum1,version::Inst().chDate);
+		strcpy(chDum2,version::Inst().chVersion);
 		strcpy(chDum3,cpu.host_name());
 		wr_continue(VRSNEW,LIMPAR,a2,c1,c2,xc,xcold,dmax,dold,*ymin,nvarPhymir,optimize.nOptimiz,
 			    optimize.varmax,optimize.varmin,chDum1,chDum2,chDum3,CNTFILE);
Index: version.h
===================================================================
--- version.h	(revision 1863)
+++ version.h	(working copy)
@@ -5,13 +5,91 @@
 #define _VERSION_H_
 
 /** version.h */
-
+#include "date.h"
 #define CITATION	"Ferland, G. J., Korista, K. T., Verner, D. A., Ferguson, J. W., Kingdon, J. B., & Verner, E. M. 1998, PASP, 110, 761" 
 #define CITATION_LATEX	"\\bibitem[Ferland et al.(1998)]{1998PASP..110..761F} Ferland, G.~J., Korista, K.~T., Verner, D.~A., Ferguson, J.~W., Kingdon, J.~B., \\& Verner, E.~M.\\ 1998, \\pasp, 110, 761" 
 #define CITATION_SHORT	"Ferland et al. (1998)" 
 
-EXTERN struct t_version {
-
+class version : public Singleton<version> 
+{
+	friend class Singleton<version>;
+protected:
+	version()
+	{
+		/* set the date saved in date.h into version.chDate 
+		 * this is the decade part of the year counted after 2000 */
+		int nDecade = (YEAR-100)/10;
+		char chDecade[2];
+		
+		/* create space for these strings */
+		chDate = (char *)MALLOC( sizeof(char)*INPUT_LINE_LENGTH );
+		chVersion = (char *)MALLOC( sizeof(char)*INPUT_LINE_LENGTH );
+		
+		static char chMonth[12][4] ={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec" };
+		static char chMonthInt[12][3] ={"01","02","03","04","05","06","07","08","09","10","11","12" };
+		
+		sprintf(chDecade,"%i", nDecade );
+		/* set date and version - this code will need to be modified in the year 2110 */
+		if( nDecade > 9 )
+		{
+			fprintf(ioQQQ,"must update formation of chDate in cdInit \n");
+			TotalInsanity();
+		}
+		if( DAY < 10 )
+		{
+			sprintf( chDate , "%s%1i%s0%1i", 
+							 chDecade,
+							 YEAR-100-nDecade*10,
+							 chMonth[MONTH],
+							 DAY );
+			sprintf( chVersion , "%s%1i.%s.0%1i", 
+							 chDecade,
+							 YEAR-100-nDecade*10,
+							 chMonthInt[MONTH],
+							 DAY );
+		}
+		else
+		{
+			sprintf( chDate , "%s%1i%s%2i", 
+							 chDecade,
+							 YEAR-100-nDecade*10,
+							 chMonth[MONTH],
+							 DAY );
+			sprintf( chVersion , "%s%1i.%s.%2i", 
+							 chDecade,
+							 YEAR-100-nDecade*10,
+							 chMonthInt[MONTH],
+							 DAY );
+		}
+		
+		chCitation = CITATION;
+		chCitationLatex = CITATION_LATEX;
+		chCitationShort = CITATION_SHORT;
+		
+		/* is this a release version? */
+		lgRelease = false;
+		
+		/* is this a beta version?  0 for no */
+		nBetaVer = 0;
+		
+		/* optional letter could come here for updates to branched version */
+		/*strcat( chVersion , "a" );*/
+		/* change following from * to letter when letters are used */
+		strcat( chDate , "*" );
+		char mode[6];
+		if( sizeof(long) == 4 )
+			strncpy( mode, "ILP32", 6 );
+		else if( sizeof(long) == 8 )
+			strncpy( mode, "LP64", 6 );
+		else
+			strncpy( mode, "?????", 6 );
+		
+		/* now generate info on how we were compiled, including compiler version */
+		sprintf(chInfo , 
+						"cdInit compiled on %s in OS %s using the %s %i compiler in %s mode." ,
+						__DATE__  ,__OS , __COMP , __COMP_VER, mode);
+	}
+public:
 	/** date of this version of the code as a string, set in cdinit.c,
 	 * where space is allocated */
 	char *chDate;
@@ -39,7 +117,7 @@
 	/** string to print latex bibitem with print citation command */
 	const char *chCitationLatex;
 
-}	version;
+};
 
 
 #endif /* _VERSION_H_ */
Index: parse_commands.cpp
===================================================================
--- parse_commands.cpp	(revision 1863)
+++ parse_commands.cpp	(working copy)
@@ -116,11 +116,11 @@
 	}
 
 	/* say this is a beta version if we are talking and it is the truth */
-	if( version.nBetaVer > 0 && called.lgTalk )
+	if( version::Inst().nBetaVer > 0 && called.lgTalk )
 	{
 		fprintf( ioQQQ, 
 			"\n                             This is %s (beta %ld) of Cloudy, and is intended for testing only.\n\n", 
-			version.chVersion, version.nBetaVer );
+			version::Inst().chVersion, version::Inst().nBetaVer );
 	}
 
 	if( called.lgTalk )
@@ -130,7 +130,7 @@
 		{
 			fprintf(ioQQQ,"%c",' ');
 		}
-		fprintf( ioQQQ, "Cloudy %s\n", version.chVersion);
+		fprintf( ioQQQ, "Cloudy %s\n", version::Inst().chVersion);
 
 		for( i=0; i<57; i++ ) 
 		{
@@ -145,7 +145,7 @@
 
 		/* now print box and date of version, before printing commands */
 		fprintf( ioQQQ, "**************************************");
-		fprintf( ioQQQ, "%8.8s", version.chDate);
+		fprintf( ioQQQ, "%8.8s", version::Inst().chDate);
 		fprintf( ioQQQ, "*************************************\n");
 
 		for( i=0; i<23; i++ ) 
Index: prt_final.cpp
===================================================================
--- prt_final.cpp	(revision 1863)
+++ prt_final.cpp	(working copy)
@@ -144,7 +144,7 @@
 	for(i=0; i<31; ++i )
 		fprintf( ioQQQ, "*");
 	fprintf( ioQQQ, "*"); 
-	fprintf( ioQQQ, "> Cloudy %s <", version.chVersion);
+	fprintf( ioQQQ, "> Cloudy %s <", version::Inst().chVersion);
 	for(i=0; i<32; ++i )
 		fprintf( ioQQQ, "*");
 	fprintf( ioQQQ, "\n" );
@@ -201,7 +201,7 @@
 		"                       *********************************> Log(U):%6.2f <*********************************\n", 
 	  a );
 
-	if( version.nBetaVer > 0 )
+	if( version::Inst().nBetaVer > 0 )
 	{
 		fprintf( ioQQQ, 
 			"\n                        This is a beta test version of the code, and is intended for testing only.\n\n" );
Index: grid_do.cpp
===================================================================
--- grid_do.cpp	(revision 1863)
+++ grid_do.cpp	(working copy)
@@ -172,8 +172,8 @@
 	{
 		fprintf( ioQQQ, "                                                      Optimization  Driver\n" );
 	}
-	fprintf( ioQQQ, "                                                        Cloudy %s\n\n",version.chVersion);
-	fprintf( ioQQQ, "                       **************************************%8.87s*************************************\n", version.chDate);
+	fprintf( ioQQQ, "                                                        Cloudy %s\n\n",version::Inst().chVersion);
+	fprintf( ioQQQ, "                       **************************************%8.87s*************************************\n", version::Inst().chDate);
 	fprintf( ioQQQ, "                       *                                                                                 *\n");
 
 
Index: parse_print.cpp
===================================================================
--- parse_print.cpp	(revision 1863)
+++ parse_print.cpp	(working copy)
@@ -71,10 +71,10 @@
 			" efforts of many people.  It should be cited as follows:\n" );
 		fprintf( ioQQQ, "Calculations were performed with version %s of Cloudy,"
 			" last described by %s.\n\n",
-			version.chVersion,
-			version.chCitationShort);
-		fprintf( ioQQQ, "The reference is:\n%s\n\n", version.chCitation );
-		fprintf( ioQQQ, "In Latex this is:\n%s\n\n", version.chCitationLatex  );
+			version::Inst().chVersion,
+			version::Inst().chCitationShort);
+		fprintf( ioQQQ, "The reference is:\n%s\n\n", version::Inst().chCitation );
+		fprintf( ioQQQ, "In Latex this is:\n%s\n\n", version::Inst().chCitationLatex  );
 	}
 
 	else if( nMatch("COLU",chCARD_CAPS) && nMatch("DENS",chCARD_CAPS) )
@@ -95,8 +95,8 @@
 	{
 		/* print compiler and code version information */
 		fprintf( ioQQQ, "\nThis is Cloudy, version %s\n%s\n\n" , 
-			version.chVersion,
-			version.chInfo );
+			version::Inst().chVersion,
+			version::Inst().chInfo );
 	}
 
 	/* option to print departure coefficients in addition to level pops 
Index: cddrive.cpp
===================================================================
--- cddrive.cpp	(revision 1863)
+++ cddrive.cpp	(working copy)
@@ -367,7 +367,7 @@
 	}
 
 	/* version was set by cdInit */
-	strcpy( chString , version.chVersion );
+	strcpy( chString , version::Inst().chVersion );
 	return;
 }
 
@@ -383,7 +383,7 @@
 void cdDate(char chString[] ) 
 {
 	/* date was set by cdInit */
-	strcpy( chString , version.chDate );
+	strcpy( chString , version::Inst().chDate );
 	return;
 }
 
Index: prt_comment.cpp
===================================================================
--- prt_comment.cpp	(revision 1863)
+++ prt_comment.cpp	(working copy)
@@ -159,18 +159,18 @@
 	/* initialize the line saver */
 	wcnint();
 
-	if( version.nBetaVer > 0 )
+	if( version::Inst().nBetaVer > 0 )
 	{
 		sprintf( chLine, 
 			"  !This is beta test version%4ld and is intended for testing only.", 
-		  version.nBetaVer );
+		  version::Inst().nBetaVer );
 		bangin(chLine);
 	}
 
 	/* this flag set by call to fixit routine,
 	 * to show that parts of the code need repair. 
 	 * lgRelease is true if this is release version */
-	if( broke.lgFixit && !version.lgRelease )
+	if( broke.lgFixit && !version::Inst().lgRelease )
 	{
 		sprintf( chLine, "  !The code needs to be fixed - search for fixit()." );
 		bangin(chLine);
@@ -179,7 +179,7 @@
 	/* this flag set by call to CodeReview routine,
 	* to show that parts of the code need to be reviewed. 
 	* lgRelease is true if this is release version */
-	if( broke.lgCheckit  && !version.lgRelease )
+	if( broke.lgCheckit  && !version::Inst().lgRelease )
 	{
 		sprintf( chLine, "  !New code needs to be reviewed - search for CodeReview()." );
 		bangin(chLine);
