source: palm/trunk/UTIL/chemistry/gasphase_preproc/kpp/drv/general.c @ 2796

Last change on this file since 2796 was 2696, checked in by kanani, 7 years ago

Merge of branch palm4u into trunk

File size: 1.3 KB
Line 
1int  InitSaveData();
2void Initialize();
3int  SaveData();
4int  CloseSaveData();
5int  GenerateMatlab( char * prefix );
6void GetMass( double CL[], double Mass[] );
7void INTEGRATE( double TIN, double TOUT );
8
9int main()
10{
11KPP_REAL dval[NSPEC];
12int i;
13 
14/* ---- TIME VARIABLES ------------------ */
15
16  RTOLS = 1e-3;
17  TSTART = 3600*12;
18  TEND = TSTART + 3600*24*5;
19  DT = 3600.;
20  TEMP = 236.21;
21
22  Initialize();
23     
24  for( i = 0; i < NVAR; i++ ) {
25    RTOL[i] = RTOLS;
26    ATOL[i] = 1.0;
27  }
28  STEPMIN = 0.01;
29  STEPMAX = 900;
30     
31/* ********** TIME LOOP **************************** */
32
33  InitSaveData();
34
35  printf("\n%7s %7s   ", "done[%]", "Time[h]");
36  for( i = 0; i < NMONITOR; i++ ) 
37    printf( "%8s  ", SPC_NAMES[MONITOR[i]] );
38  for( i = 0; i < NMASS; i++ ) 
39    printf( "(%6s)  ", SMASS[i] );
40 
41  TIME = TSTART;
42  while (TIME <= TEND) {
43    GetMass( C, dval );
44    printf("\n%6.1f%% %7.2f   ", (TIME-TSTART)/(TEND-TSTART)*100, TIME/3600 );
45    for( i = 0; i < NMONITOR; i++ ) 
46      printf( "%9.3e  ", C[ MONITOR[i] ]/CFACTOR );
47    for( i = 0; i < NMASS; i++ ) 
48      printf( "%9.3e  ", dval[i]/CFACTOR );
49   
50    SaveData();
51
52    INTEGRATE( TIME , TIME+DT );
53    TIME += DT;
54  }
55
56/* *********** END TIME LOOP *********************** */
57
58  printf("\n");
59  CloseSaveData();
60
61    return 0; /*didnt return anything initially */
62
63}
Note: See TracBrowser for help on using the repository browser.