Changeset 1891
- Timestamp:
- 03/27/08 12:40:50 (5 months ago)
- Location:
- trunk
- Files:
-
- 15 modified
-
source/assert_results.cpp (modified) (1 diff)
-
source/cddrive.cpp (modified) (2 diffs)
-
source/grains_mie.cpp (modified) (1 diff)
-
source/grid_do.cpp (modified) (3 diffs)
-
source/init_coreload.cpp (modified) (2 diffs)
-
source/optimize_phymir.cpp (modified) (1 diff)
-
source/parse_commands.cpp (modified) (4 diffs)
-
source/parse_print.cpp (modified) (2 diffs)
-
source/parse_punch.cpp (modified) (1 diff)
-
source/prt_comment.cpp (modified) (3 diffs)
-
source/prt_final.cpp (modified) (3 diffs)
-
source/punch_fits.cpp (modified) (1 diff)
-
source/service.cpp (modified) (1 diff)
-
source/version.h (modified) (2 diffs, 1 prop)
-
tsuite/programs/mpi/mpi.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/assert_results.cpp
r1857 r1891 2472 2472 if( prt.lgPrintTime ) 2473 2473 { 2474 fprintf( ioQQQ, " %s\n\n", version .chInfo );2474 fprintf( ioQQQ, " %s\n\n", version::Inst().chInfo ); 2475 2475 } 2476 2476 } -
trunk/source/cddrive.cpp
r1878 r1891 352 352 * 353 353 * cdVersion - puts version number of code into string 354 * incoming string must have at least 8 charand will become null354 * incoming string must have sufficient length and will become null 355 355 * terminated string 356 356 * 357 357 ************************************************************************/ 358 358 359 void cdVersion(char chString[] ) 360 { 361 DEBUG_ENTRY( "cdVersion()" ); 362 363 if( !lgcdInitCalled ) 364 { 365 printf(" cdInit was not called first - this must be the first call.\n"); 366 cdEXIT(EXIT_FAILURE); 367 } 368 369 /* version was set by cdInit */ 370 strcpy( chString , version.chVersion ); 359 void cdVersion(char chString[]) 360 { 361 strcpy( chString , version::Inst().chVersion ); 371 362 return; 372 363 } … … 381 372 382 373 /* cdDate - puts date of code into string */ 383 void cdDate(char chString[] ) 384 { 385 /* date was set by cdInit */ 386 strcpy( chString , version.chDate ); 374 void cdDate(char chString[]) 375 { 376 strcpy( chString , version::Inst().chDate ); 387 377 return; 388 378 } -
trunk/source/grains_mie.cpp
r1815 r1891 377 377 (void)time(&timer); 378 378 lgErr = lgErr || ( fprintf(fdes,"# this file was created by Cloudy %s (%s) on %s", 379 version .chVersion,version.chDate,ctime(&timer)) < 0 );379 version::Inst().chVersion,version::Inst().chDate,ctime(&timer)) < 0 ); 380 380 lgErr = lgErr || ( fprintf(fdes,"# ===========================================\n#\n") < 0 ); 381 381 lgErr = lgErr || ( fprintf(fdes,"%12ld # magic number opacity file\n",MAGIC_OPC) < 0 ); -
trunk/source/grid_do.cpp
r1771 r1891 167 167 if( strcmp(optimize.chOptRtn,"XSPE") == 0 ) 168 168 { 169 fprintf( ioQQQ, " Grid Driver\n" );169 fprintf( ioQQQ, " Grid Driver\n" ); 170 170 } 171 171 else … … 173 173 fprintf( ioQQQ, " Optimization Driver\n" ); 174 174 } 175 fprintf( ioQQQ, " Cloudy %s\n\n",version.chVersion);176 fprintf( ioQQQ, " **************************************%8.87s*************************************\n", version.chDate);177 fprintf( ioQQQ, " * *\n");178 175 int indent = (122 - strlen(version::Inst().chVersion))/2; 176 fprintf( ioQQQ, "%*cCloudy %s\n\n",indent,' ',version::Inst().chVersion); 177 fprintf( ioQQQ, "%23c**************************************%7.7s**************************************\n", ' ', version::Inst().chDate ); 178 fprintf( ioQQQ, "%23c*%81c*\n", ' ', ' ' ); 179 179 180 180 /* now echo initial input quantities with flag for vary */ … … 195 195 } 196 196 197 fprintf( ioQQQ, " %7.7s * ",chNote); 198 j = 0; 199 /* print actual command */ 200 while( input.chCardSav[i][j] !='\0' ) 201 { 202 fprintf( ioQQQ, "%c", input.chCardSav[i][j] ); 203 ++j; 204 } 205 /* flush out rest of space then * */ 206 while( j<80 ) 207 { 208 fprintf( ioQQQ, "%c", ' ' ); 209 ++j; 210 } 211 /* end the line */ 212 fprintf( ioQQQ, "*\n" ); 213 } 214 fprintf( ioQQQ, " * *\n ***********************************************************************************\n\n\n" ); 197 fprintf( ioQQQ, "%22.7s * %-80s*\n", chNote, input.chCardSav[i] ); 198 } 199 fprintf( ioQQQ, "%23c*%81c*\n", ' ', ' ' ); 200 fprintf( ioQQQ, "%23c***********************************************************************************\n\n\n", ' ' ); 215 201 216 202 /* option to trace logical flow within this sub */ -
trunk/source/init_coreload.cpp
r1842 r1891 11 11 #include "hcmap.h" 12 12 #include "h2.h" 13 #include "date.h"14 13 #include "version.h" 15 14 #include "hextra.h" … … 159 158 hcmap.lgMapBeingDone = false; 160 159 161 /* set the date saved in date.h into version.chDate162 * this is the decade part of the year counted after 2000 */163 int nDecade = (YEAR-100)/10;164 char chDecade[2];165 166 /* create space for these strings */167 version.chDate = (char *)MALLOC( sizeof(char)*INPUT_LINE_LENGTH );168 version.chVersion = (char *)MALLOC( sizeof(char)*INPUT_LINE_LENGTH );169 170 static char chMonth[12][4] ={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec" };171 static char chMonthInt[12][3] ={"01","02","03","04","05","06","07","08","09","10","11","12" };172 173 sprintf(chDecade,"%i", nDecade );174 /* set date and version - this code will need to be modified in the year 2110 */175 if( nDecade > 9 )176 {177 fprintf(ioQQQ,"must update formation of chDate in cdInit \n");178 TotalInsanity();179 }180 if( DAY < 10 )181 {182 sprintf( version.chDate , "%s%1i%s0%1i",183 chDecade,184 YEAR-100-nDecade*10,185 chMonth[MONTH],186 DAY );187 sprintf( version.chVersion , "%s%1i.%s.0%1i",188 chDecade,189 YEAR-100-nDecade*10,190 chMonthInt[MONTH],191 DAY );192 }193 else194 {195 sprintf( version.chDate , "%s%1i%s%2i",196 chDecade,197 YEAR-100-nDecade*10,198 chMonth[MONTH],199 DAY );200 sprintf( version.chVersion , "%s%1i.%s.%2i",201 chDecade,202 YEAR-100-nDecade*10,203 chMonthInt[MONTH],204 DAY );205 }206 207 version.chCitation = CITATION;208 version.chCitationLatex = CITATION_LATEX;209 version.chCitationShort = CITATION_SHORT;210 211 /* is this a release version? */212 version.lgRelease = false;213 214 /* is this a beta version? 0 for no */215 version.nBetaVer = 0;216 217 /* optional letter could come here for updates to branched version */218 /*strcat( version.chVersion , "a" );*/219 /* change following from * to letter when letters are used */220 strcat( version.chDate , "*" );221 222 char mode[6];223 if( sizeof(long) == 4 )224 strncpy( mode, "ILP32", 6 );225 else if( sizeof(long) == 8 )226 strncpy( mode, "LP64", 6 );227 else228 strncpy( mode, "?????", 6 );229 230 /* now generate info on how we were compiled, including compiler version */231 sprintf(version.chInfo ,232 "cdInit compiled on %s in OS %s using the %s %i compiler in %s mode." ,233 __DATE__ ,__OS , __COMP , __COMP_VER, mode);234 235 160 /* name of output file from optimization run */ 236 161 strncpy( chOptimFileName , "optimal.in" , sizeof( chOptimFileName ) ); -
trunk/source/optimize_phymir.cpp
r1856 r1891 228 228 else 229 229 { 230 strcpy(chDum1,version .chDate);231 strcpy(chDum2,version .chVersion);230 strcpy(chDum1,version::Inst().chDate); 231 strcpy(chDum2,version::Inst().chVersion); 232 232 strcpy(chDum3,cpu.host_name()); 233 233 wr_continue(VRSNEW,LIMPAR,a2,c1,c2,xc,xcold,dmax,dold,*ymin,nvarPhymir,optimize.nOptimiz, -
trunk/source/parse_commands.cpp
r1864 r1891 117 117 118 118 /* say this is a beta version if we are talking and it is the truth */ 119 if( version .nBetaVer > 0 && called.lgTalk )119 if( version::Inst().nBetaVer > 0 && called.lgTalk ) 120 120 { 121 121 fprintf( ioQQQ, 122 122 "\n This is %s (beta %ld) of Cloudy, and is intended for testing only.\n\n", 123 version .chVersion, version.nBetaVer );123 version::Inst().chVersion, version::Inst().nBetaVer ); 124 124 } 125 125 … … 127 127 { 128 128 /* this code prints pretty lines at top of output box */ 129 for( i=0; i<57; i++ ) 130 { 131 fprintf(ioQQQ,"%c",' '); 132 } 133 fprintf( ioQQQ, "Cloudy %s\n", version.chVersion); 134 135 for( i=0; i<57; i++ ) 136 { 137 fprintf(ioQQQ,"%c",' '); 138 } 139 fprintf( ioQQQ, "www.nublado.org\n\n"); 140 141 for( i=0; i<23; i++ ) 142 { 143 fprintf(ioQQQ,"%c",' '); 144 } 129 int indent = (122 - strlen(version::Inst().chVersion))/2; 130 fprintf( ioQQQ, "%*cCloudy %s\n", indent, ' ', version::Inst().chVersion ); 131 132 fprintf( ioQQQ, "%57cwww.nublado.org\n\n", ' ' ); 145 133 146 134 /* now print box and date of version, before printing commands */ 135 fprintf( ioQQQ, "%23c", ' ' ); 147 136 fprintf( ioQQQ, "**************************************"); 148 fprintf( ioQQQ, "%8.8s", version.chDate); 149 fprintf( ioQQQ, "*************************************\n"); 150 151 for( i=0; i<23; i++ ) 152 { 153 fprintf(ioQQQ,"%c",' '); 154 } 155 fprintf( ioQQQ, "*"); 156 157 for( i=0; i<81; i++ ) 158 { 159 fprintf(ioQQQ,"%c",' '); 160 } 161 fprintf( ioQQQ, "*\n"); 137 fprintf( ioQQQ, "%7.7s", version::Inst().chDate); 138 fprintf( ioQQQ, "**************************************\n"); 139 140 fprintf( ioQQQ, "%23c*%81c*\n", ' ', ' ' ); 162 141 } 163 142 … … 194 173 /* >>chng 04 jan 21, add HIDE option, mostly for print quiet command */ 195 174 if( called.lgTalk && !nMatch("HIDE",input.chCARDCAPS) ) 196 { 197 fprintf( ioQQQ, " * "); 198 i=0; 199 while( chCard[i]!='\0' ) 200 { 201 fprintf(ioQQQ,"%c",chCard[i]); 202 ++i; 203 } 204 205 while( i<80 ) 206 { 207 fprintf(ioQQQ,"%c",' '); 208 ++i; 209 } 210 fprintf(ioQQQ,"*\n"); 211 } 175 fprintf( ioQQQ, "%23c* %-80s*\n", ' ', chCard ); 212 176 213 177 /* change chCard to all caps */ … … 1863 1827 if( called.lgTalk ) 1864 1828 { 1865 fprintf( ioQQQ, " * %80.80s*\n", 1866 chCard ); 1867 fprintf( ioQQQ, " ***********************************************************************************\n\n\n\n" ); 1829 fprintf( ioQQQ, "%23c*%81c*\n", ' ', ' ' ); 1830 fprintf( ioQQQ, "%23c***********************************************************************************\n\n\n\n", ' ' ); 1868 1831 } 1869 1832 -
trunk/source/parse_print.cpp
r1815 r1891 72 72 fprintf( ioQQQ, "Calculations were performed with version %s of Cloudy," 73 73 " last described by %s.\n\n", 74 version .chVersion,75 version .chCitationShort);76 fprintf( ioQQQ, "The reference is:\n%s\n\n", version .chCitation );77 fprintf( ioQQQ, "In Latex this is:\n%s\n\n", version .chCitationLatex );74 version::Inst().chVersion, 75 version::Inst().chCitationShort); 76 fprintf( ioQQQ, "The reference is:\n%s\n\n", version::Inst().chCitation ); 77 fprintf( ioQQQ, "In Latex this is:\n%s\n\n", version::Inst().chCitationLatex ); 78 78 } 79 79 … … 96 96 /* print compiler and code version information */ 97 97 fprintf( ioQQQ, "\nThis is Cloudy, version %s\n%s\n\n" , 98 version .chVersion,99 version .chInfo );98 version::Inst().chVersion, 99 version::Inst().chInfo ); 100 100 } 101 101 -
trunk/source/parse_punch.cpp
r1852 r1891 203 203 sprintf( chHeader, 204 204 "# %s %s\n", 205 version .chVersion, input.chTitle );205 version::Inst().chVersion, input.chTitle ); 206 206 } 207 207 -
trunk/source/prt_comment.cpp
r1854 r1891 160 160 wcnint(); 161 161 162 if( version .nBetaVer > 0 )162 if( version::Inst().nBetaVer > 0 ) 163 163 { 164 164 sprintf( chLine, 165 165 " !This is beta test version%4ld and is intended for testing only.", 166 version .nBetaVer );166 version::Inst().nBetaVer ); 167 167 bangin(chLine); 168 168 } … … 171 171 * to show that parts of the code need repair. 172 172 * lgRelease is true if this is release version */ 173 if( broke.lgFixit && !version .lgRelease )173 if( broke.lgFixit && !version::Inst().lgRelease ) 174 174 { 175 175 sprintf( chLine, " !The code needs to be fixed - search for fixit()." ); … … 180 180 * to show that parts of the code need to be reviewed. 181 181 * lgRelease is true if this is release version */ 182 if( broke.lgCheckit && !version .lgRelease )182 if( broke.lgCheckit && !version::Inst().lgRelease ) 183 183 { 184 184 sprintf( chLine, " !New code needs to be reviewed - search for CodeReview()." ); -
trunk/source/prt_final.cpp
r1787 r1891 136 136 137 137 /* print name and version number */ 138 /*lint -e666 expression with side effects */139 138 fprintf( ioQQQ, "\f\n"); 140 REPEAT_16( fprintf( ioQQQ, " "); ) 141 REPEAT_4( fprintf( ioQQQ, " "); ) 142 REPEAT_2( fprintf( ioQQQ, " ");) 143 fprintf( ioQQQ, " "); 144 for(i=0; i<31; ++i ) 145 fprintf( ioQQQ, "*"); 146 fprintf( ioQQQ, "*"); 147 fprintf( ioQQQ, "> Cloudy %s <", version.chVersion); 148 for(i=0; i<32; ++i ) 149 fprintf( ioQQQ, "*"); 139 fprintf( ioQQQ, "%23c", ' ' ); 140 int len = strlen(version::Inst().chVersion); 141 int repeat = (72-len)/2; 142 for( i=0; i < repeat; ++i ) 143 fprintf( ioQQQ, "*" ); 144 fprintf( ioQQQ, "> Cloudy %s <", version::Inst().chVersion ); 145 for( i=0; i < 72-repeat-len; ++i ) 146 fprintf( ioQQQ, "*" ); 150 147 fprintf( ioQQQ, "\n" ); 151 /*lint +e666 */152 148 153 149 for( i=0; i <= input.nSave; i++ ) … … 165 161 /* >>chng 04 jan 21, add hide option */ 166 162 if( (strcmp(chCKey,"CONT")!= 0) && !nMatch( "HIDE" , input.chCARDCAPS) ) 167 { 168 /* print leading space and first * */ 169 fprintf( ioQQQ, " * "); 170 171 j = 0; 172 /* print actual command */ 173 while( input.chCardSav[i][j] !='\0' ) 174 { 175 fprintf( ioQQQ, "%c", input.chCardSav[i][j] ); 176 ++j; 177 } 178 179 /* flush out rest of space then * */ 180 while( j<80 ) 181 { 182 fprintf( ioQQQ, "%c", ' ' ); 183 ++j; 184 } 185 /* end the line */ 186 fprintf( ioQQQ, "*\n" ); 187 } 163 fprintf( ioQQQ, "%23c* %-80s*\n", ' ', input.chCardSav[i] ); 188 164 } 189 165 … … 202 178 a ); 203 179 204 if( version .nBetaVer > 0 )180 if( version::Inst().nBetaVer > 0 ) 205 181 { 206 182 fprintf( ioQQQ, -
trunk/source/punch_fits.cpp
r1771 r1891 755 755 strcat( tempString, chVer ); 756 756 bytesAdded += addComment( tempString ); 757 bytesAdded += addComment( version .chInfo );757 bytesAdded += addComment( version::Inst().chInfo ); 758 758 strcpy( tempString, "--- " ); 759 759 strcat( tempString, timeString ); -
trunk/source/service.cpp
r1819 r1891 255 255 256 256 fprintf( ioQQQ, " Cloudy version number is %s\n", 257 version .chVersion );258 fprintf( ioQQQ, " %s\n\n", version .chInfo );257 version::Inst().chVersion ); 258 fprintf( ioQQQ, " %s\n\n", version::Inst().chInfo ); 259 259 260 260 fprintf( ioQQQ, "%5ld warnings,%3ld cautions,%3ld temperature failures. Messages follow.\n", -
trunk/source/version.h
- Property svn:keywords set to URL
r1732 r1891 6 6 7 7 /** version.h */ 8 #include "date.h" 8 9 9 # define CITATION "Ferland, G. J., Korista, K. T., Verner, D. A., Ferguson, J. W., Kingdon, J. B., & Verner, E. M. 1998, PASP, 110, 761"10 #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" 11 #define CITATION_SHORT "Ferland et al. (1998)" 10 #if 0 11 static const int CLD_MAJOR = 8; 12 static const int CLD_MINOR = 0; 12 13 13 EXTERN struct t_version { 14 #ifdef SVN_REVISION 15 static const char* svn_revision = SVN_REVISION; 16 #else 17 static const char* svn_revision = "unknown"; 18 #endif 14 19 20 static const string Url = "$HeadURL$"; 21 #endif 22 23 static const char* CITATION = "Ferland, G. J., Korista, K. T., Verner, D. A., Ferguson, J. W., Kingdon, J. B., & Verner, E. M. 1998, PASP, 110, 761"; 24 static const char* 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"; 25 static const char* CITATION_SHORT = "Ferland et al. (1998)"; 26 27 class version : public Singleton<version> 28 { 29 friend class Singleton<version>; 30 protected: 31 version() 32 { 33 /* set date and version - this code will need to be modified in the year 2100 */ 34 if( YEAR >= 200 ) 35 { 36 fprintf(ioQQQ,"must update formation of chDate in cdInit \n"); 37 TotalInsanity(); 38 } 39 40 static const char chMonth[12][4] = 41 { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; 42 43 /* is this a beta version? 0 for no */ 44 nBetaVer = 0; 45 46 /* is this a release version? */ 47 lgRelease = false; 48 49 sprintf( chDate, "%2.2i%3.3s%2.2i", 50 YEAR-100, 51 chMonth[MONTH], 52 DAY ); 53 54 sprintf( chVersion, "%2.2i.%2.2i.%2.2i", 55 YEAR-100, 56 MONTH+1, 57 DAY ); 58 59 char mode[6]; 60 if( sizeof(long) == 4 ) 61 strncpy( mode, "ILP32", 6 ); 62 else if( sizeof(long) == 8 ) 63 strncpy( mode, "LP64", 6 ); 64 else 65 strncpy( mode, "?????", 6 ); 66 67 /* now generate info on how we were compiled, including compiler version */ 68 sprintf(chInfo , 69 "cdInit compiled on %s in OS %s using the %s %i compiler in %s mode." , 70 __DATE__ ,__OS , __COMP , __COMP_VER, mode); 71 72 chCitation = CITATION; 73 chCitationLatex = CITATION_LATEX; 74 chCitationShort = CITATION_SHORT; 75 } 76 public: 15 77 /** date of this version of the code as a string, set in cdinit.c, 16 78 * where space is allocated */ 17 char *chDate;79 char chDate[INPUT_LINE_LENGTH]; 18 80 19 81 /** version number of this version of the code, as a string, set in cdinit.c 20 82 * where space is allocated */ 21 char *chVersion;83 char chVersion[INPUT_LINE_LENGTH]; 22 84 23 85 /** normally zero, non-zero if this is a beta test version */ … … 39 101 /** string to print latex bibitem with print citation command */ 40 102 const char *chCitationLatex; 41 42 } version; 103 }; 43 104 44 105 -
trunk/tsuite/programs/mpi/mpi.cpp
r1806 r1891
