Changeset 2099 for trunk/LMDZ.TITAN/libf/chimtitan
- Timestamp:
- Feb 12, 2019, 3:07:22 PM (6 years ago)
- Location:
- trunk/LMDZ.TITAN/libf/chimtitan
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.TITAN/libf/chimtitan/chimie.c
r3 r2099 13 13 double ai,ao,ei,eo,ki,ko,m,ti,to; 14 14 FILE *out; 15 char corps[100][10];16 15 static char reaction[NREAC+1][12][10]={ 17 16 #include VERCHIM 18 17 "", "", "", "", "", "","","","","","",""}; 19 20 for( i = 0; i <= NC; i++)21 {22 strcpy( corps[i], CORPS[i] );23 corps[i][strcspn(CORPS[i], " ")] = '\0';24 }25 18 26 19 for( i = 0; i <= NC-1; i++ ) … … 40 33 && (strcmp(reaction[i][j],"")) ) /* Which compound ? */ 41 34 { 42 while( strcmp(reaction[i][j], corps[k]) ) /* Compound in reaction j, column i */35 while( strcmp(reaction[i][j],CORPS[k]) ) /* Compound in reaction j, column i */ 43 36 { 44 37 if( k == NC+1 ) -
trunk/LMDZ.TITAN/libf/chimtitan/comp.c
r1126 r2099 8 8 { 9 9 int i,j; 10 char corps[NC+1][10];11 10 12 11 double m,ma,epsa,sig,siga,p; … … 19 18 siga = 3.798e0; /* Lennard-Jones length of background gas 1/10 nm */ 20 19 epsa = 71.4e0; /* Lennard-Jones energy of background gas */ 21 22 for( i = 0; i <= NC; i++)23 {24 strcpy( corps[i], CORPS[i] );25 corps[i][strcspn(CORPS[i], " ")] = '\0';26 }27 20 28 21 for( i = 0; i <= NC-1; i++) … … 33 26 for( i = 0; i <= NC-1; i++ ) 34 27 { 35 if( strcmp( corps[i], "CH4") == 0 )28 if( strcmp(CORPS[i], "CH4") == 0 ) 36 29 { 37 30 MASS[i] = 16.04e0; … … 42 35 / ( CT[j] * sig * omega(TEMP[j],epsa,148.6e0) ); 43 36 } 44 if( strcmp( corps[i], "H") == 0 )37 if( strcmp(CORPS[i], "H") == 0 ) 45 38 { 46 39 MASS[i] = 1.01e0; 47 40 } 48 if( strcmp( corps[i], "H2") == 0 )41 if( strcmp(CORPS[i], "H2") == 0 ) 49 42 { 50 43 MASS[i] = 2.0158e0; … … 55 48 / ( CT[j] * sig * omega(TEMP[j],epsa,59.7e0) ); 56 49 } 57 if( strcmp( corps[i], "CH") == 0 )50 if( strcmp(CORPS[i], "CH") == 0 ) 58 51 { 59 52 MASS[i] = 13.02e0; … … 63 56 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 64 57 } 65 if( ( strcmp( corps[i], "CH2" ) == 0 ) || ( strcmp( corps[i], "CH2s" ) == 0 ) )58 if( ( strcmp( CORPS[i], "CH2" ) == 0 ) || ( strcmp( CORPS[i], "CH2s" ) == 0 ) ) 66 59 { 67 60 MASS[i] = 14.03e0; … … 71 64 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 72 65 } 73 if( strcmp( corps[i], "CH3") == 0 )66 if( strcmp(CORPS[i], "CH3") == 0 ) 74 67 { 75 68 MASS[i] = 15.03e0; … … 79 72 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 80 73 } 81 if( strcmp( corps[i], "C") == 0 )74 if( strcmp(CORPS[i], "C") == 0 ) 82 75 { 83 76 MASS[i] = 12.01e0; … … 87 80 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 88 81 } 89 if( strcmp( corps[i], "C2") == 0 )82 if( strcmp(CORPS[i], "C2") == 0 ) 90 83 { 91 84 MASS[i] = 24.02e0; … … 95 88 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 96 89 } 97 if( strcmp( corps[i], "C2H") == 0 )90 if( strcmp(CORPS[i], "C2H") == 0 ) 98 91 { 99 92 MASS[i] = 25.03e0; … … 103 96 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 104 97 } 105 if( strcmp( corps[i], "C2H3") == 0 )98 if( strcmp(CORPS[i], "C2H3") == 0 ) 106 99 { 107 100 MASS[i] = 27.05e0; … … 111 104 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 112 105 } 113 if( strcmp( corps[i], "C2H4") == 0 )106 if( strcmp(CORPS[i], "C2H4") == 0 ) 114 107 { 115 108 MASS[i] = 28.05e0; … … 120 113 / ( CT[j] * sig * omega(TEMP[j],epsa,224.7e0) ); 121 114 } 122 if( strcmp( corps[i], "C2H2") == 0 )115 if( strcmp(CORPS[i], "C2H2") == 0 ) 123 116 { 124 117 MASS[i] = 26.04e0; … … 129 122 / ( CT[j] * sig * omega(TEMP[j],epsa,231.8e0) ); 130 123 } 131 if( strcmp( corps[i], "C2H5") == 0 )124 if( strcmp(CORPS[i], "C2H5") == 0 ) 132 125 { 133 126 MASS[i] = 29.06e0; … … 137 130 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 138 131 } 139 if( strcmp( corps[i], "C2H6") == 0 )132 if( strcmp(CORPS[i], "C2H6") == 0 ) 140 133 { 141 134 MASS[i] = 30.07e0; … … 146 139 / ( CT[j] * sig * omega(TEMP[j],epsa,215.7e0) ); 147 140 } 148 if( strcmp( corps[i], "C3H2") == 0 )141 if( strcmp(CORPS[i], "C3H2") == 0 ) 149 142 { 150 143 MASS[i] = 38.05e0; … … 154 147 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 155 148 } 156 if( strcmp( corps[i], "C3H3") == 0 )149 if( strcmp(CORPS[i], "C3H3") == 0 ) 157 150 { 158 151 MASS[i] = 39.06e0; … … 162 155 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 163 156 } 164 if( ( strcmp( corps[i], "CH2CCH2") == 0 ) || ( strcmp(corps[i], "CH3CCH") == 0 ) )157 if( ( strcmp(CORPS[i], "CH2CCH2") == 0 ) || ( strcmp(CORPS[i], "CH3CCH") == 0 ) ) 165 158 { 166 159 MASS[i] = 40.07e0; … … 171 164 / ( CT[j] * sig * omega(TEMP[j],epsa,251.8e0) ); 172 165 } 173 if( strcmp( corps[i], "C3H5") == 0 )166 if( strcmp(CORPS[i], "C3H5") == 0 ) 174 167 { 175 168 MASS[i] = 41.07e0; … … 179 172 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 180 173 } 181 if( strcmp( corps[i], "C3H6") == 0 )174 if( strcmp(CORPS[i], "C3H6") == 0 ) 182 175 { 183 176 MASS[i] = 42.08e0; … … 188 181 / ( CT[j] * sig * omega(TEMP[j],epsa,248.9e0) ); 189 182 } 190 if( strcmp( corps[i], "C3H7") == 0 )183 if( strcmp(CORPS[i], "C3H7") == 0 ) 191 184 { 192 185 MASS[i] = 43.09e0; … … 196 189 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 197 190 } 198 if( strcmp( corps[i], "C3H8") == 0 )191 if( strcmp(CORPS[i], "C3H8") == 0 ) 199 192 { 200 193 MASS[i] = 44.11e0; … … 205 198 / ( CT[j] * sig * omega(TEMP[j],epsa,237.1e0) ); 206 199 } 207 if( strcmp( corps[i], "C4H") == 0 )200 if( strcmp(CORPS[i], "C4H") == 0 ) 208 201 { 209 202 MASS[i] = 49.05e0; … … 213 206 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 214 207 } 215 if( ( strcmp( corps[i], "C4H2") == 0 )||( strcmp(corps[i], "C4H2s") == 0 ) )208 if( ( strcmp(CORPS[i], "C4H2") == 0 )||( strcmp(CORPS[i], "C4H2s") == 0 ) ) 216 209 { 217 210 MASS[i] = 50.06e0; … … 221 214 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 222 215 } 223 if( strcmp( corps[i], "C4H3") == 0 )216 if( strcmp(CORPS[i], "C4H3") == 0 ) 224 217 { 225 218 MASS[i] = 51.07e0; … … 229 222 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 230 223 } 231 if( strcmp( corps[i], "C4H4") == 0 )224 if( strcmp(CORPS[i], "C4H4") == 0 ) 232 225 { 233 226 MASS[i] = 52.08e0; … … 237 230 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 238 231 } 239 if( strcmp( corps[i], "C4H5") == 0 )232 if( strcmp(CORPS[i], "C4H5") == 0 ) 240 233 { 241 234 MASS[i] = 53.07e0; … … 245 238 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 246 239 } 247 if( strcmp( corps[i], "C4H6") == 0 )240 if( strcmp(CORPS[i], "C4H6") == 0 ) 248 241 { 249 242 MASS[i] = 54.09e0; … … 253 246 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 254 247 } 255 if( strcmp( corps[i], "C4H10") == 0 )248 if( strcmp(CORPS[i], "C4H10") == 0 ) 256 249 { 257 250 MASS[i] = 58.13e0; … … 262 255 / ( CT[j] * sig * omega(TEMP[j],epsa,531.4e0) ); 263 256 } 264 if( strcmp( corps[i], "C6H") == 0 )257 if( strcmp(CORPS[i], "C6H") == 0 ) 265 258 { 266 259 MASS[i] = 73.07e0; … … 270 263 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 271 264 } 272 if( strcmp( corps[i], "C6H2") == 0 )265 if( strcmp(CORPS[i], "C6H2") == 0 ) 273 266 { 274 267 MASS[i] = 74.08e0; … … 278 271 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 279 272 } 280 if( strcmp( corps[i], "C8H2") == 0 )273 if( strcmp(CORPS[i], "C8H2") == 0 ) 281 274 { 282 275 MASS[i] = 98.10e0; … … 286 279 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 287 280 } 288 if( strcmp( corps[i], "AC6H6" ) == 0 )281 if( strcmp( CORPS[i], "AC6H6" ) == 0 ) 289 282 { 290 283 MASS[i] = 78.1136e0; … … 294 287 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 295 288 } 296 if( ( strcmp( corps[i], "C6H5" ) == 0 ) || ( strcmp( corps[i], "AC6H5" ) == 0 ) )289 if( ( strcmp( CORPS[i], "C6H5" ) == 0 ) || ( strcmp( CORPS[i], "AC6H5" ) == 0 ) ) 297 290 { 298 291 MASS[i] = 77.1136e0; … … 302 295 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 303 296 } 304 if( strcmp( corps[i], "C6H6" ) == 0 )297 if( strcmp( CORPS[i], "C6H6" ) == 0 ) 305 298 { 306 299 MASS[i] = 78.1136e0; … … 310 303 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 311 304 } 312 if( strcmp( corps[i], "N2") == 0 )305 if( strcmp(CORPS[i], "N2") == 0 ) 313 306 { 314 307 MASS[i] = 28.0134e0; 315 308 } 316 if( strcmp( corps[i], "N4S") == 0 )309 if( strcmp(CORPS[i], "N4S") == 0 ) 317 310 { 318 311 MASS[i] = 14.01e0; … … 322 315 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 323 316 } 324 if( strcmp( corps[i], "NH") == 0 )317 if( strcmp(CORPS[i], "NH") == 0 ) 325 318 { 326 319 MASS[i] = 15.01e0; … … 330 323 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 331 324 } 332 if( strcmp( corps[i], "CN") == 0 )325 if( strcmp(CORPS[i], "CN") == 0 ) 333 326 { 334 327 MASS[i] = 26.02e0; … … 338 331 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 339 332 } 340 if( strcmp( corps[i], "HCN") == 0 )333 if( strcmp(CORPS[i], "HCN") == 0 ) 341 334 { 342 335 MASS[i] = 27.04e0; … … 347 340 / ( CT[j] * sig * omega(TEMP[j],epsa,569.1e0) ); 348 341 } 349 if( strcmp( corps[i], "H2CN") == 0 )342 if( strcmp(CORPS[i], "H2CN") == 0 ) 350 343 { 351 344 MASS[i] = 28.05e0; … … 355 348 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 356 349 } 357 if( strcmp( corps[i], "C2N") == 0 ) /* C2N */350 if( strcmp(CORPS[i], "C2N") == 0 ) /* C2N */ 358 351 { 359 352 MASS[i] = 39.05e0; … … 363 356 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 364 357 } 365 if( strcmp( corps[i], "CHCN" ) == 0 )358 if( strcmp( CORPS[i], "CHCN" ) == 0 ) 366 359 { 367 360 MASS[i] = 39.05e0; … … 371 364 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 372 365 } 373 if( strcmp( corps[i], "CH2CN" ) == 0 )366 if( strcmp( CORPS[i], "CH2CN" ) == 0 ) 374 367 { 375 368 MASS[i] = 40.04e0; … … 379 372 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 380 373 } 381 if( strcmp( corps[i], "CH3CN" ) == 0 )374 if( strcmp( CORPS[i], "CH3CN" ) == 0 ) 382 375 { 383 376 MASS[i] = 41.05e0; … … 387 380 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 388 381 } 389 if( strcmp( corps[i], "C2H3CN" ) == 0 )382 if( strcmp( CORPS[i], "C2H3CN" ) == 0 ) 390 383 { 391 384 MASS[i] = 53.06e0; … … 395 388 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 396 389 } 397 if( strcmp( corps[i], "NCCN") == 0 ) /* NCCN */390 if( strcmp(CORPS[i], "NCCN") == 0 ) /* NCCN */ 398 391 { 399 392 MASS[i] = 52.04e0; … … 404 397 / ( CT[j] * sig * omega(TEMP[j],epsa,348.6e0) ); 405 398 } 406 if( strcmp( corps[i], "C3N") == 0 ) /* C3N */399 if( strcmp(CORPS[i], "C3N") == 0 ) /* C3N */ 407 400 { 408 401 MASS[i] = 50.04e0; … … 412 405 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 413 406 } 414 if( strcmp( corps[i], "HC3N") == 0 ) /* HC3N */407 if( strcmp(CORPS[i], "HC3N") == 0 ) /* HC3N */ 415 408 { 416 409 MASS[i] = 51.05e0; … … 420 413 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 421 414 } 422 if( strcmp( corps[i], "C4N2" ) == 0 )415 if( strcmp( CORPS[i], "C4N2" ) == 0 ) 423 416 { 424 417 MASS[i] = 76.1e0; … … 428 421 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 429 422 } 430 if( strcmp( corps[i], "H2O") == 0 )423 if( strcmp(CORPS[i], "H2O") == 0 ) 431 424 { 432 425 MASS[i] = 18.02e0; … … 437 430 / ( CT[j] * sig * omega(TEMP[j],epsa,809.1e0) ); 438 431 } 439 if( ( strcmp( corps[i], "O3P") == 0 ) || ( strcmp(corps[i], "O1D") == 0 ) )432 if( ( strcmp(CORPS[i], "O3P") == 0 ) || ( strcmp(CORPS[i], "O1D") == 0 ) ) 440 433 { 441 434 MASS[i] = 16.0e0; … … 445 438 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 446 439 } 447 if( strcmp( corps[i], "OH") == 0 )440 if( strcmp(CORPS[i], "OH") == 0 ) 448 441 { 449 442 MASS[i] = 17.01e0; … … 453 446 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 454 447 } 455 if( strcmp( corps[i], "HO2") == 0 )448 if( strcmp(CORPS[i], "HO2") == 0 ) 456 449 { 457 450 MASS[i] = 33.01e0; … … 461 454 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 462 455 } 463 if( strcmp( corps[i], "H2O2") == 0 )456 if( strcmp(CORPS[i], "H2O2") == 0 ) 464 457 { 465 458 MASS[i] = 33.01e0; … … 469 462 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 470 463 } 471 if( strcmp( corps[i], "O2") == 0 )464 if( strcmp(CORPS[i], "O2") == 0 ) 472 465 { 473 466 MASS[i] = 32.0e0; … … 477 470 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 478 471 } 479 if( strcmp( corps[i], "O3") == 0 )472 if( strcmp(CORPS[i], "O3") == 0 ) 480 473 { 481 474 MASS[i] = 32.0e0; … … 485 478 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 486 479 } 487 if( strcmp( corps[i], "CO") == 0 )480 if( strcmp(CORPS[i], "CO") == 0 ) 488 481 { 489 482 MASS[i] = 28.01e0; … … 494 487 / ( CT[j] * sig * omega(TEMP[j],epsa,91.7e0) ); 495 488 } 496 if( strcmp( corps[i], "HCO") == 0 )489 if( strcmp(CORPS[i], "HCO") == 0 ) 497 490 { 498 491 MASS[i] = 29.02e0; … … 502 495 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 503 496 } 504 if( strcmp( corps[i], "CO2") == 0 )497 if( strcmp(CORPS[i], "CO2") == 0 ) 505 498 { 506 499 MASS[i] = 44.01e0; … … 511 504 / ( CT[j] * sig * omega(TEMP[j],epsa,195.2e0) ); 512 505 } 513 if( strcmp( corps[i], "CH2CO") == 0 )506 if( strcmp(CORPS[i], "CH2CO") == 0 ) 514 507 { 515 508 MASS[i] = 42.04e0; … … 519 512 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 520 513 } 521 if( strcmp( corps[i], "CH2O") == 0 )514 if( strcmp(CORPS[i], "CH2O") == 0 ) 522 515 { 523 516 MASS[i] = 30.03e0; … … 527 520 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 528 521 } 529 if( ( strcmp( corps[i], "CH2OH") == 0 ) || ( strcmp(corps[i], "CH3O") == 0 ) )522 if( ( strcmp(CORPS[i], "CH2OH") == 0 ) || ( strcmp(CORPS[i], "CH3O") == 0 ) ) 530 523 { 531 524 MASS[i] = 31.04e0; … … 535 528 MD[i][j] = sqrt( p * TEMP[j] * m ) / ( CT[j] * sig ); 536 529 } 537 if( strcmp( corps[i], "CH3OH") == 0 )530 if( strcmp(CORPS[i], "CH3OH") == 0 ) 538 531 { 539 532 MASS[i] = 32.042e0; -
trunk/LMDZ.TITAN/libf/chimtitan/gptitan.c
r1965 r2099 19 19 int *htoh2, double *surfhaze) 20 20 { 21 char outlog[100] ,corps[100][10];21 char outlog[100]; 22 22 int i,j,k,l; 23 23 int ireac,ncom1,ncom2; … … 58 58 #endif 59 59 /**/ 60 61 for( i = 0; i <= NC; i++)62 {63 strcpy( corps[i], CORPS[i] );64 corps[i][strcspn(CORPS[i], " ")] = '\0';65 }66 60 67 61 strcpy( outlog, "chimietitan" ); … … 105 99 for( i = 0; i <= ST-1; i++ ) 106 100 { 107 if( strcmp( corps[i], "H" ) == 0 ) ih = i;108 if( strcmp( corps[i], "H2" ) == 0 ) ih2 = i;109 if( strcmp( corps[i], "N2" ) == 0 ) in2 = i;110 if( strcmp( corps[i], "N4S") == 0 ) in4s = i;101 if( strcmp(CORPS[i], "H" ) == 0 ) ih = i; 102 if( strcmp(CORPS[i], "H2" ) == 0 ) ih2 = i; 103 if( strcmp(CORPS[i], "N2" ) == 0 ) in2 = i; 104 if( strcmp(CORPS[i], "N4S") == 0 ) in4s = i; 111 105 } 112 106 … … 160 154 fprintf(out,"%d %e %e %e\n",j,(RA[j]-R0),NB[j],TEMP[j]); 161 155 for (i=0;i<=NREAC-1;i++) fprintf(out,"%d %e\n",i,KRATE[i][j]); 162 for (i=0;i<=ST-1;i++) fprintf(out,"%10s %e\n", corps[i],Y[i][j]);156 for (i=0;i<=ST-1;i++) fprintf(out,"%10s %e\n",CORPS[i],Y[i][j]); 163 157 fclose( out ); 164 158 } … … 231 225 if( (*aerprod) == 1 ) 232 226 { 233 aer( corps,TEMP,NB,Y,&j,k_dep,faer,227 aer(CORPS,TEMP,NB,Y,&j,k_dep,faer, 234 228 &dyc2h2,&dyhc3n,&dyhcn,&dynccn,&dych3cn,&dyc2h3cn,utilaer, 235 229 mmolaer,productaer,csurn,csurh); … … 245 239 printf("AERPROD : LAT = %g - J = %d\n",(*LAT),j); 246 240 if(fabs(dyc2h2*NB[j])>fabs(fp[utilaer[2]]/10.)) 247 printf("fp(%s) =%e; dyc2h2 =%e\n", corps[utilaer[2]],241 printf("fp(%s) =%e; dyc2h2 =%e\n",CORPS[utilaer[2]], 248 242 fp[utilaer[2]],dyc2h2*NB[j]); 249 243 if(fabs(dyhcn*NB[j])>fabs(fp[utilaer[5]]/10.)) 250 printf("fp(%s) =%e; dyhcn =%e\n", corps[utilaer[5]],244 printf("fp(%s) =%e; dyhcn =%e\n",CORPS[utilaer[5]], 251 245 fp[utilaer[5]],dyhcn*NB[j]); 252 246 if(fabs(dyhc3n*NB[j])>fabs(fp[utilaer[6]]/10.)) 253 printf("fp(%s) =%e; dyhc3n =%e\n", corps[utilaer[6]],247 printf("fp(%s) =%e; dyhc3n =%e\n",CORPS[utilaer[6]], 254 248 fp[utilaer[6]],dyhc3n*NB[j]); 255 249 if(fabs(dynccn*NB[j])>fabs(fp[utilaer[13]]/10.)) 256 printf("fp(%s) =%e; dynccn =%e\n", corps[utilaer[13]],250 printf("fp(%s) =%e; dynccn =%e\n",CORPS[utilaer[13]], 257 251 fp[utilaer[13]],dynccn*NB[j]); 258 252 if(fabs(dych3cn*NB[j])>fabs(fp[utilaer[14]]/10.)) 259 printf("fp(%s) =%e; dych3cn=%e\n", corps[utilaer[14]],253 printf("fp(%s) =%e; dych3cn=%e\n",CORPS[utilaer[14]], 260 254 fp[utilaer[14]],dych3cn*NB[j]); 261 255 if(fabs(dyc2h3cn*NB[j])>fabs(fp[utilaer[15]]/10.)) 262 printf("fp(%s) =%e; dyc2h3cn=%e\n", corps[utilaer[15]],256 printf("fp(%s) =%e; dyc2h3cn=%e\n",CORPS[utilaer[15]], 263 257 fp[utilaer[15]],dyc2h3cn*NB[j]); 264 258 */ … … 289 283 if( (*htoh2) == 1 ) 290 284 { 291 heterohtoh2( corps,TEMP,NB,Y,surfhaze,&j,&dyh,&dyh2,utilaer);285 heterohtoh2(CORPS,TEMP,NB,Y,surfhaze,&j,&dyh,&dyh2,utilaer); 292 286 /* dyh <= 0 / 1.0 en adsor., 1 en reac. */ 293 287 … … 295 289 printf("HTOH2 : LAT = %g - J = %d\n",(*LAT),j); 296 290 if(fabs(dyh*NB[j])>fabs(fp[utilaer[0]]/10.)) 297 printf("fp(%s) = %e; dyh = %e\n", corps[utilaer[0]],fp[utilaer[0]],dyh*NB[j]);291 printf("fp(%s) = %e; dyh = %e\n",CORPS[utilaer[0]],fp[utilaer[0]],dyh*NB[j]); 298 292 if(fabs(dyh2*NB[j])>fabs(fp[utilaer[1]]/10.)) 299 printf("fp(%s) = %e; dyh2 = %e\n", corps[utilaer[1]],fp[utilaer[1]],dyh2*NB[j]);293 printf("fp(%s) = %e; dyh2 = %e\n",CORPS[utilaer[1]],fp[utilaer[1]],dyh2*NB[j]); 300 294 */ 301 295 … … 527 521 out = fopen( outlog, "a" ); 528 522 fprintf( out, "Latitude %g;", (*LAT)); 529 fprintf(out, " alt:%e; %s %e %e ; %e %e\n",(RA[j]-R0), corps[i],ym1[i],Y[i][j],time,delta);523 fprintf(out, " alt:%e; %s %e %e ; %e %e\n",(RA[j]-R0),CORPS[i],ym1[i],Y[i][j],time,delta); 530 524 fclose( out ); 531 525 } … … 546 540 out = fopen( outlog, "a" ); 547 541 fprintf( out, "WARNING %s mixing ratio is %e %e at %d\n", 548 corps[i], ym1[i], Y[i][j], j );542 CORPS[i], ym1[i], Y[i][j], j ); 549 543 for( k = 0; k <= NLEV-1; k++ ) fprintf( out, "%d %e %e\n",k,ym1[i],Y[i][k] ); 550 544 fclose( out ); … … 669 663 if( (*aerprod) == 1 ) 670 664 { 671 aer( corps,TEMP,NB,Y,&j,k_dep,faer,665 aer(CORPS,TEMP,NB,Y,&j,k_dep,faer, 672 666 &dyc2h2,&dyhc3n,&dyhcn,&dynccn,&dych3cn,&dyc2h3cn,utilaer, 673 667 mmolaer,productaer,csurn,csurh); … … 683 677 printf("AERPROD : LAT = %g - J = %d\n",(*LAT),j); 684 678 if(fabs(dyc2h2*NB[j])>fabs(fp[utilaer[2]]/10.)) 685 printf("fp(%s) =%e; dyc2h2 =%e\n", corps[utilaer[2]],679 printf("fp(%s) =%e; dyc2h2 =%e\n",CORPS[utilaer[2]], 686 680 fp[utilaer[2]],dyc2h2*NB[j]); 687 681 if(fabs(dyhcn*NB[j])>fabs(fp[utilaer[5]]/10.)) 688 printf("fp(%s) =%e; dyhcn =%e\n", corps[utilaer[5]],682 printf("fp(%s) =%e; dyhcn =%e\n",CORPS[utilaer[5]], 689 683 fp[utilaer[5]],dyhcn*NB[j]); 690 684 if(fabs(dyhc3n*NB[j])>fabs(fp[utilaer[6]]/10.)) 691 printf("fp(%s) =%e; dyhc3n =%e\n", corps[utilaer[6]],685 printf("fp(%s) =%e; dyhc3n =%e\n",CORPS[utilaer[6]], 692 686 fp[utilaer[6]],dyhc3n*NB[j]); 693 687 if(fabs(dynccn*NB[j])>fabs(fp[utilaer[13]]/10.)) 694 printf("fp(%s) =%e; dynccn =%e\n", corps[utilaer[13]],688 printf("fp(%s) =%e; dynccn =%e\n",CORPS[utilaer[13]], 695 689 fp[utilaer[13]],dynccn*NB[j]); 696 690 if(fabs(dych3cn*NB[j])>fabs(fp[utilaer[14]]/10.)) 697 printf("fp(%s) =%e; dych3cn=%e\n", corps[utilaer[14]],691 printf("fp(%s) =%e; dych3cn=%e\n",CORPS[utilaer[14]], 698 692 fp[utilaer[14]],dych3cn*NB[j]); 699 693 if(fabs(dyc2h3cn*NB[j])>fabs(fp[utilaer[15]]/10.)) 700 printf("fp(%s) =%e; dyc2h3cn=%e\n", corps[utilaer[15]],694 printf("fp(%s) =%e; dyc2h3cn=%e\n",CORPS[utilaer[15]], 701 695 fp[utilaer[15]],dyc2h3cn*NB[j]); 702 696 */ … … 727 721 if( (*htoh2) == 1 ) 728 722 { 729 heterohtoh2( corps,TEMP,NB,Y,surfhaze,&j,&dyh,&dyh2,utilaer);723 heterohtoh2(CORPS,TEMP,NB,Y,surfhaze,&j,&dyh,&dyh2,utilaer); 730 724 /* dyh <= 0 / 1.0 en adsor., 1 en reac. */ 731 725 … … 733 727 printf("HTOH2 : LAT = %g - J = %d\n",(*LAT),j); 734 728 if(fabs(dyh*NB[j])>fabs(fp[utilaer[0]]/10.)) 735 printf("fp(%s) = %e; dyh = %e\n", corps[utilaer[0]],fp[utilaer[0]],dyh*NB[j]);729 printf("fp(%s) = %e; dyh = %e\n",CORPS[utilaer[0]],fp[utilaer[0]],dyh*NB[j]); 736 730 if(fabs(dyh2*NB[j])>fabs(fp[utilaer[1]]/10.)) 737 printf("fp(%s) = %e; dyh2 = %e\n", corps[utilaer[1]],fp[utilaer[1]],dyh2*NB[j]);731 printf("fp(%s) = %e; dyh2 = %e\n",CORPS[utilaer[1]],fp[utilaer[1]],dyh2*NB[j]); 738 732 */ 739 733 … … 817 811 out = fopen( outlog, "a" ); 818 812 fprintf( out, "Latitude: %g; declin:%e;", (*LAT), (*DECLIN) ); 819 fprintf(out, " alt:%e; %s %e %e ; %e %e\n",(RA[j]-R0), corps[i],ym1[i],Y[i][j],time,delta);813 fprintf(out, " alt:%e; %s %e %e ; %e %e\n",(RA[j]-R0),CORPS[i],ym1[i],Y[i][j],time,delta); 820 814 fclose( out ); 821 815 } … … 836 830 out = fopen( outlog, "a" ); 837 831 fprintf( out, "WARNING %s mixing ratio is %e %e at %d\n", 838 corps[i], ym1[i][j], Y[i][j], j );832 CORPS[i], ym1[i][j], Y[i][j], j ); 839 833 for( k = 0; k <= NLEV-1; k++ ) fprintf( out, "%d %e %e\n",k,ym1[i][j],Y[i][k] ); 840 834 fclose( out ); -
trunk/LMDZ.TITAN/libf/chimtitan/tractitan.c
r104 r2099 7 7 double Y0[][NLEV], double *FIN ) 8 8 { 9 char outlog[100] ,corps[100][10];9 char outlog[100]; 10 10 int i,j,k,l; 11 11 double annee,**tau,**ym1; … … 15 15 FILE *out; 16 16 17 for( i = 0; i <= NC; i++)18 {19 strcpy( corps[i], CORPS[i] );20 corps[i][strcspn(CORPS[i], " ")] = '\0';21 }22 23 17 time = ts = 0.0e0; 24 18 annee = 9.46728e8; … … 54 48 tau[i][j] = 1.e6; /* autres corps = 1.e6 s, donc rappel tres fort */ 55 49 56 if( strcmp( corps[i],"C2H2") == 0 )50 if( strcmp(CORPS[i],"C2H2") == 0 ) 57 51 tau[i][j] = annee*pow( 10., 2.+1.*(100.-(RB[j]-R0))/200. ); 58 if( strcmp( corps[i],"C2H6") == 0 )52 if( strcmp(CORPS[i],"C2H6") == 0 ) 59 53 tau[i][j] = annee*pow( 10., 1.+1.*(200.-(RB[j]-R0))/300. ); 60 if( strcmp( corps[i],"HCN") == 0 )54 if( strcmp(CORPS[i],"HCN") == 0 ) 61 55 { 62 56 if( (RB[j]-R0) >= 350. ) … … 65 59 tau[i][j] = annee*10.; 66 60 } 67 if( strcmp( corps[i],"C4H2") == 0 )61 if( strcmp(CORPS[i],"C4H2") == 0 ) 68 62 { 69 63 if( (RB[j]-R0) >= 300. ) … … 113 107 if( conv > 0.1 ) 114 108 { 115 fprintf(out, "%d %s %e %e\n",j, corps[i],ym1[i][j],Y[i][j]);109 fprintf(out, "%d %s %e %e\n",j,CORPS[i],ym1[i][j],Y[i][j]); 116 110 } 117 111 */ … … 131 125 /* 132 126 fprintf( out, "WARNING %s mixing ratio is %e %e at %d", 133 corps[i], ym1[i][j], Y[i][j], j );127 CORPS[i], ym1[i][j], Y[i][j], j ); 134 128 fclose( out ); 135 129 */
Note: See TracChangeset
for help on using the changeset viewer.