00001
00002
00003
00004 #include "cddefines.h"
00005 #include "iso.h"
00006 #include "taulines.h"
00007 #include "phycon.h"
00008 #include "helike.h"
00009 #include "helike_recom.h"
00010 #include "parse.h"
00011
00012
00013 void ParseAtomHeLike(char *chCard )
00014 {
00015 long int i,
00016 nHe,
00017 nelem;
00018 bool lgEOL;
00019
00020 DEBUG_ENTRY( "ParseAtomHeLike()" );
00021
00022
00023 if( nMatch("COLL",chCard) && !nMatch("LEVE" , chCard ) )
00024 {
00025 if( nMatch("EXCI",chCard) )
00026 {
00027
00028 iso.lgColl_excite[ipHE_LIKE] = false;
00029 phycon.lgPhysOK = false;
00030 }
00031 else if( nMatch("IONI",chCard) )
00032 {
00033
00034 iso.lgColl_ionize[ipHE_LIKE] = false;
00035 phycon.lgPhysOK = false;
00036 }
00037 else if( nMatch("L-MI",chCard) )
00038 {
00039 if( nMatch("THER",chCard) )
00040 {
00041
00042
00043 if( nMatch("NO T",chCard) )
00044 {
00045
00046
00047
00048 helike.lgCS_therm_ave = false;
00049 }
00050 else
00051 {
00052 helike.lgCS_therm_ave = true;
00053 }
00054 }
00055 else if( nMatch("PENG",chCard) )
00056 {
00057 helike.lgCS_Vrinceanu = false;
00058 }
00059 else if( nMatch(" OFF" , chCard ) )
00060 {
00061
00062
00063
00064 iso.lgColl_l_mixing[ipHE_LIKE] = false;
00065 phycon.lgPhysOK = false;
00066 helike.lgCS_Vrinceanu = false;
00067 helike.lgCS_therm_ave = true;
00068 }
00069 else
00070 {
00071 fprintf( ioQQQ, " needs parameter\n" );
00072 puts( "[Stop in ParseSet]" );
00073 cdEXIT(EXIT_FAILURE);
00074 }
00075 }
00076 else if( nMatch(" OFF" , chCard ) )
00077 {
00078
00079 iso.lgColl_excite[ipHE_LIKE] = false;
00080 iso.lgColl_ionize[ipHE_LIKE] = false;
00081 iso.lgColl_l_mixing[ipHE_LIKE] = false;
00082 phycon.lgPhysOK = false;
00083 }
00084 else
00085 {
00086 fprintf( ioQQQ, " needs parameter\n" );
00087 puts( "[Stop in ParseSet]" );
00088 cdEXIT(EXIT_FAILURE);
00089 }
00090 }
00091
00092 else if( nMatch("DIEL",chCard) )
00093 {
00094
00095 if( nMatch(" OFF",chCard) )
00096 {
00097 helike.nDielRecom = 0;
00098 }
00099 else if( nMatch(" GU ",chCard) )
00100 {
00101 helike.nDielRecom = 1;
00102 }
00103 else
00104 helike.nDielRecom = 2;
00105 }
00106
00107 else if( nMatch("ERRO",chCard) && nMatch("GENE" , chCard ) )
00108 {
00109
00110
00111
00112 helike.lgRandErrGen = true;
00113 i = 5;
00114 helike.modelRank = (int)FFmtRead(chCard,&i,INPUT_LINE_LENGTH,&lgEOL);
00115
00116 helike.modelRank = MAX2( 0, helike.modelRank );
00117 if( lgEOL )
00118
00119
00120 helike.modelRank = abs((int)time(NULL));
00121
00122
00123
00124 srand( (unsigned)helike.modelRank );
00125 }
00126
00127 else if( nMatch(" FSM",chCard) )
00128 {
00129
00130
00131 if( nMatch(" OFF",chCard) )
00132 helike.lgFSM = false;
00133 else
00134 helike.lgFSM = true;
00135 }
00136
00137 else if( nMatch("GBAR",chCard) )
00138 {
00139
00140
00141 helike.lgCS_Vriens = false;
00142 helike.lgCS_None = false;
00143 helike.nCS_new = false;
00144
00145
00146 if( nMatch("VRIE",chCard) )
00147 {
00148
00149 helike.lgCS_Vriens = true;
00150 }
00151 else if( nMatch(" NEW",chCard) )
00152 {
00153
00154 i = 5;
00155 helike.nCS_new = (int)FFmtRead(chCard,&i,INPUT_LINE_LENGTH,&lgEOL);
00156
00157
00158
00159 if( lgEOL )
00160 helike.nCS_new = 1;
00161
00162 ASSERT( helike.nCS_new );
00163 }
00164 else if( nMatch(" OFF",chCard) )
00165 {
00166
00167 helike.lgCS_None = true;
00168 }
00169 else
00170 {
00171 fprintf( ioQQQ, " needs parameter\n" );
00172 puts( "[Stop in ParseSet]" );
00173 cdEXIT(EXIT_FAILURE);
00174 }
00175 }
00176
00177 else if( nMatch("BENJ",chCard) )
00178 {
00179
00180
00181
00182
00183
00184
00185
00186 helike.lgSetBenjamin = true;
00187 }
00188
00189 else if( nMatch("LYMA",chCard) )
00190 {
00191
00192 i = 5;
00193 iso.nLyman[ipHE_LIKE] = (long int)FFmtRead(chCard,&i,INPUT_LINE_LENGTH,&lgEOL);
00194 if( lgEOL )
00195 NoNumb(chCard);
00196 }
00197
00198
00199
00200 else if( nMatch("RECO",chCard) &&
00201 nMatch(" NO ",chCard) && nMatch("INTE",chCard) )
00202 {
00203
00204
00205
00206 helike.lgNoRecombInterp = true;
00207 }
00208
00209 else if( nMatch("REDI",chCard) )
00210 {
00211 int ipRedis=0;
00212
00213
00214
00215
00216
00217 if( nMatch(" PRD",chCard) )
00218 {
00219 ipRedis = ipPRD;
00220 }
00221
00222 else if( nMatch(" CRD",chCard) )
00223 {
00224 ipRedis = ipCRD;
00225 }
00226
00227 else if( nMatch("CRDW",chCard) )
00228 {
00229 ipRedis = ipCRDW;
00230 }
00231
00232
00233 else if( !nMatch("SHOW",chCard) )
00234 {
00235 fprintf(ioQQQ," There should have been a second keyword on this command.\n");
00236 fprintf(ioQQQ," Options are _PRD, _CRD, CRDW (_ is space). Sorry.\n");
00237 puts( "[Stop in ParseAtomHeLike]" );
00238 cdEXIT(EXIT_FAILURE);
00239 }
00240
00241
00242 if( nMatch("ALPH",chCard) )
00243 {
00244 iso.ipLyaRedist[ipHE_LIKE] = ipRedis;
00245 }
00246
00247 if( nMatch("RESO",chCard) )
00248 {
00249 iso.ipResoRedist[ipHE_LIKE] = ipRedis;
00250 }
00251
00252 else if( nMatch("SUBO",chCard) )
00253 {
00254 iso.ipSubRedist[ipHE_LIKE] = ipRedis;
00255 }
00256
00257 else if( nMatch("SHOW",chCard) )
00258 {
00259 fprintf(ioQQQ," Ly a is ");
00260 if( iso.ipLyaRedist[ipHE_LIKE] ==ipCRDW )
00261 {
00262 fprintf(ioQQQ,"complete redistribution with wings\n");
00263 }
00264 else if( iso.ipLyaRedist[ipHE_LIKE] ==ipCRD )
00265 {
00266 fprintf(ioQQQ,"complete redistribution with core only.\n");
00267 }
00268 else if( iso.ipLyaRedist[ipHE_LIKE] ==ipPRD )
00269 {
00270 fprintf(ioQQQ,"partial redistribution.\n");
00271 }
00272 else if( iso.ipLyaRedist[ipHE_LIKE] ==ipLY_A )
00273 {
00274 fprintf(ioQQQ,"special Lya.\n");
00275 }
00276 else
00277 {
00278 fprintf(ioQQQ," PROBLEM Impossible value for iso.ipLyaRedist.\n");
00279 TotalInsanity();
00280 }
00281
00282 fprintf(ioQQQ," Other He resonance lines are ");
00283 if( iso.ipResoRedist[ipHE_LIKE] ==ipCRDW )
00284 {
00285 fprintf(ioQQQ,"complete redistribution with wings\n");
00286 }
00287 else if( iso.ipResoRedist[ipHE_LIKE] ==ipCRD )
00288 {
00289 fprintf(ioQQQ,"complete redistribution with core only.\n");
00290 }
00291 else if( iso.ipResoRedist[ipHE_LIKE] ==ipPRD )
00292 {
00293 fprintf(ioQQQ,"partial redistribution.\n");
00294 }
00295 else
00296 {
00297 fprintf(ioQQQ," PROBLEM Impossible value for iso.ipResoRedist.\n");
00298 TotalInsanity();
00299 }
00300
00301 fprintf(ioQQQ," He subordinate lines are ");
00302 if( iso.ipSubRedist[ipHE_LIKE] ==ipCRDW )
00303 {
00304 fprintf(ioQQQ,"complete redistribution with wings\n");
00305 }
00306 else if( iso.ipSubRedist[ipHE_LIKE] ==ipCRD )
00307 {
00308 fprintf(ioQQQ,"complete redistribution with core only.\n");
00309 }
00310 else if( iso.ipSubRedist[ipHE_LIKE] ==ipPRD )
00311 {
00312 fprintf(ioQQQ,"partial redistribution.\n");
00313 }
00314 else
00315 {
00316 fprintf(ioQQQ," PROBLEM Impossible value for iso.ipSubRedist.\n");
00317 TotalInsanity();
00318 }
00319 }
00320 else
00321 {
00322 fprintf(ioQQQ," here should have been another keyword on this command.\n");
00323 fprintf(ioQQQ," Options are ALPHA, RESONANCE, SUBORDINATE. Sorry.\n");
00324 puts( "[Stop in ParseAtomHeLike]" );
00325 cdEXIT(EXIT_FAILURE);
00326 }
00327 }
00328
00329 else if( nMatch("LEVE",chCard) )
00330 {
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343 if( !lgHydroMalloc )
00344 {
00345 i = 5;
00346 nHe = (long int)FFmtRead(chCard,&i,INPUT_LINE_LENGTH,&lgEOL);
00347
00348 if( nMatch("HUGE",chCard) )
00349 {
00350 helike.lgHugeCaseB = true;
00351 }
00352 else if( !lgEOL )
00353 {
00354
00355
00356 if( nHe < 30 )
00357 helike.lgCS_therm_ave = false;
00358 else
00359 helike.lgCS_therm_ave = true;
00360 }
00361
00362 if( lgEOL )
00363 {
00364
00365
00366 if( nMatch("LARG",chCard) )
00367 {
00368
00369
00370 nHe = HE_RREC_MAXN;
00371 }
00372
00373
00374 else if( nMatch("SMAL",chCard) || nMatch("COMP",chCard) )
00375 {
00376
00377 nHe = 3;
00378 }
00379
00380
00381
00382
00383 else if( nMatch("HUGE",chCard) )
00384 {
00385 helike.lgHugeCaseB = true;
00386
00387 nHe = 100;
00388 }
00389
00390
00391 else
00392 {
00393
00394 NoNumb(chCard);
00395 }
00396 }
00397 else if( ( nHe < 3 ) && !nMatch("COLL",chCard) )
00398 {
00399
00400 fprintf( ioQQQ, " cannot have fewer than 3 levels, the requested number was %li\n" ,
00401 nHe );
00402 fprintf( ioQQQ, " Sorry.\n" );
00403 puts( "[Stop in ParseAtomHeLike]" );
00404 cdEXIT(EXIT_FAILURE);
00405 }
00406
00407 if( nMatch("COLL",chCard) )
00408 {
00409 if( (nHe<1) && !helike.lgSetBenjamin )
00410 {
00411 fprintf( ioQQQ, "He-like: there must be at least one collapsed level.\n");
00412 puts( "[Stop in ParseAtomHeLike]" );
00413 cdEXIT(EXIT_FAILURE);
00414 }
00415
00416 if( lgEOL )
00417 NoNumb(chCard);
00418
00419
00420 if( nMatch("ELEM",chCard) )
00421 {
00422
00423 nelem = GetElem(chCard);
00424
00425
00426 iso.nCollapsed_max[ipHE_LIKE][nelem] = nHe;
00427 }
00428 else
00429 {
00430
00431 for( nelem=ipHELIUM; nelem<LIMELM; ++nelem )
00432 {
00433 iso.nCollapsed_max[ipHE_LIKE][nelem] = nHe;
00434 }
00435 }
00436 }
00437
00438
00439
00440
00441
00442 else if( nMatch("ELEM",chCard) )
00443 {
00444
00445 nelem = GetElem(chCard);
00446 iso.n_HighestResolved_max[ipHE_LIKE][nelem] = nHe;
00447 iso.numLevels_max[ipHE_LIKE][nelem] = nHe*nHe + nHe + 1;
00448 }
00449 else
00450 {
00451
00452 for( i=ipHELIUM; i<LIMELM; ++i )
00453 {
00454 iso.n_HighestResolved_max[ipHE_LIKE][i] = nHe;
00455 iso.numLevels_max[ipHE_LIKE][i] = nHe*nHe + nHe + 1;
00456 }
00457 }
00458 }
00459 }
00460
00461
00462 else if( nMatch("MATR",chCard) )
00463 {
00464 if( nMatch(" POP",chCard) )
00465 {
00466 strcpy( iso.chTypeAtomSet[ipHE_LIKE] , "POPU" );
00467 }
00468 else if( nMatch(" LOW",chCard) )
00469 {
00470 strcpy( iso.chTypeAtomSet[ipHE_LIKE] , "LOWT" );
00471 }
00472 else
00473 {
00474 fprintf( ioQQQ, " There should have been a keyword on the MATRIX option.\n");
00475 fprintf( ioQQQ, " The keywords are POPulations, and LOWte.\n");
00476 fprintf( ioQQQ, " Stop in ParseAtomHeLike\n" );
00477 puts( "[Stop in ParseAtomHeLike]" );
00478 cdEXIT(EXIT_FAILURE);
00479 }
00480 }
00481
00482 else if( nMatch("TOPO",chCard) )
00483 {
00484 if( nMatch(" OFF",chCard) )
00485 {
00486 helike.lgTopoff = false;
00487 fprintf( ioQQQ, "HE-LIKE TOPOFF is OFF\n");
00488 }
00489 else
00490 helike.lgTopoff = true;
00491 }
00492
00493 else
00494 {
00495 fprintf( ioQQQ, " There should have been a keyword - STOP\n" );
00496 puts( "[Stop in ParseAtomHeLike]" );
00497 cdEXIT(EXIT_FAILURE);
00498 }
00499
00500 DEBUG_EXIT( "ParseAtomHeLike()" );
00501 return;
00502 }