00001
00002
00003
00004 #include "cddefines.h"
00005 #include "timesc.h"
00006 #include "parse.h"
00007
00008 void ParseAge(char *chCard )
00009 {
00010 bool lgEOL;
00011 long int i;
00012
00013 DEBUG_ENTRY( "ParseAge()" );
00014
00015
00016
00017
00018 i = 4;
00019 timesc.CloudAgeSet = (realnum)FFmtRead(chCard,&i,INPUT_LINE_LENGTH,&lgEOL);
00020
00021
00022 if( lgEOL && (!nMatch(" OFF",chCard)) )
00023 {
00024 fprintf( ioQQQ, " The age must be on this line.\n" );
00025 cdEXIT(EXIT_FAILURE);
00026 }
00027
00028
00029 if( nMatch(" LOG",chCard) )
00030 {
00031 timesc.CloudAgeSet = (realnum)pow((realnum)10.f,timesc.CloudAgeSet);
00032 }
00033
00034
00035 if( nMatch("MILL",chCard) )
00036 {
00037
00038 timesc.CloudAgeSet *= (realnum)(3.15569e7*1000.);
00039 }
00040 else if( nMatch("CENT",chCard) )
00041 {
00042
00043 timesc.CloudAgeSet *= (realnum)(3.15569e7*100.);
00044 }
00045 else if( nMatch("YEAR",chCard) )
00046 {
00047
00048 timesc.CloudAgeSet *= 3.15569e7;
00049 }
00050 else if( nMatch("MONT",chCard) )
00051 {
00052
00053 timesc.CloudAgeSet = (realnum)(timesc.CloudAgeSet*3.15569e7/12.);
00054 }
00055 else if( nMatch("FORT",chCard) )
00056 {
00057
00058 timesc.CloudAgeSet *= 24.f*3600.f*14.f;
00059 }
00060 else if( nMatch("WEEK",chCard) )
00061 {
00062
00063 timesc.CloudAgeSet *= 24.f*3600.f*7.f;
00064 }
00065 else if( nMatch("DAY ",chCard) )
00066 {
00067
00068 timesc.CloudAgeSet *= 24.f*3600.f;
00069 }
00070 else if( nMatch("HOUR",chCard) )
00071 {
00072
00073 timesc.CloudAgeSet *= 3600.f;
00074 }
00075 else if( nMatch("MINU",chCard) )
00076 {
00077
00078 timesc.CloudAgeSet *= 60.f;
00079 }
00080 else if( nMatch("SECO",chCard) )
00081 {
00082
00083 timesc.CloudAgeSet *= 1.f;
00084 }
00085
00086 return;
00087 }