/*RTMake do escape and destruction probs for all lines in code. * Called with FALSE arg by ionize, to only redo destruction probabilites, * and with TRUE by cloudy to do both escape and destruction */ #include #include "cddefines.h" #include "wind.h" #include "taulines.h" #include "pop371.h" #include "ionrange.h" #include "hydrogenic.h" #include "hetran.h" #include "rt.h" void RTMake( /* this is TRUE if we want to do both escape and destruction probs, * and FALSE if only destruction probabilities are needed */ int lgDoEsc ) { long int i, ipZ; # ifdef DEBUG_FUN fputs( "<+>RTMake()\n", debug_fp ); # endif for( ipZ=0; ipZ < LIMELM; ipZ++ ) { /* note that ipZ scale is totally on c not physical scale, so 0 is h */ /* evaluate hydrogenic balance if ionization reaches this high */ if( (IonRange.IonHigh[ipZ] == ipZ + 2) ) { /* evaluate branch As, escape probabilities, and destruction rates */ HydroPesc(ipZ , lgDoEsc); } } /* do helium singlets and triplets */ HeTran(); if( wind.windv == 0. ) { { /* option to print particulars of some line when called */ enum {DEBUG=FALSE}; if( DEBUG ) { # include "dumpline.h" DumpLine(&TauLines[93]);/**/ /*DumpLine(&TauLines[128]);*/ } } /* static model - level 1 lines */ for( i=1; i <= nLevel1; i++ ) { RTMakeStat(&TauLines[i] , lgDoEsc ); } if( lgDoEsc ) { /* level 2 heavy element lines in cooling with only g-bar, * only update their dest/esc probs one time per zone */ for( i=0; i < nWindLine; i++ ) { float dest; dest = TauLine2[i].Pdest; RTMakeStat(&TauLine2[i] , lgDoEsc ); /* >>chng 99 Sep 17, following to prevent oscillations * where level 2 lines overlap He+ ionizing continuum */ /* dest probs for these level 2 lines should not matter * since they should be weak ots sources. there can be * problems with the zoning when they high H or He edges, * so use average */ TauLine2[i].Pdest = TauLine2[i].Pdest*0.25f + 0.75f*dest ; } } } else { /* windy model * level 1 lines */ for( i=1; i <= nLevel1; i++ ) { RTMakeWind(&TauLines[i] , lgDoEsc ); } if( lgDoEsc ) { /* level 2 lines * heavy element lines in cooling with only g-bar * only update their dest/esc probs one time per zone */ for( i=0; i < nWindLine; i++ ) { RTMakeWind(&TauLine2[i] , lgDoEsc ); } } } /* Verner's model FeII atom * do not call if Netzer model used, or it Fe(2) is zero * exception is when code is searching for first soln */ if( FeII.lgFeIION ) { RTFeIIMake( lgDoEsc ); } # ifdef DEBUG_FUN fputs( " <->RTMake()\n", debug_fp ); # endif return; }