/* This file is part of Cloudy and is copyright (C)1978-2006 by Gary J. Ferland
 * For conditions of distribution and use see copyright notice in license.txt */
/* maximum number of stop line commands */
#define	MXSTPL	10

/* this is the stopping column density that is "default" - if still at
 * this value then stop column is not used */
#define	COLUMN_INIT	1e30f

/* stopcalc.h */
EXTERN struct t_StopCalc {
	/* this has the various ending criteria for stopping a model */

	/* optical depth to stop calculation */
	float tauend, 
		/* this is the energy within the continuum mesh, we will stop when the
		 * optical depth at this energy reaches tauend */
	  taunu;

	/* this points to taunu within the continuum mesh */
	long int iptnu;

	/* highest allowed temperature, set with stop temperature exceeds command */
	float T2High;

	/* this is the default lowest to highest temperature checked
	 * TeLowest is 2.8, tehigh 1e10, in scalar, also zerologic */
	float TeLowest, 
	  TeHighest;

	/* this provides a "floor" for the temperature - when the temperature
	 * falls to this limit, go to constant temperature solution */
	float TeFloor;

	/* tend is lowest temperature, set with stop temperature command */
	float tend;

	/* stop efraction sets this limiting electron fraction rel to H */
	float StopElecFrac;

	/* stop at a hydrogen molecular fraction, relative to total hydrogen,
	 * this is 2H_2 / H_total*/
	float StopH2MoleFrac;

	/* stop at a ionized hydrogen fraction, this was put in to simulate the contribution 
	 * of the H+ region to the overall intensity of PDR lines */
	float StopHPlusFrac;

	/* stop when a certain fraction of O frozen out on grains is reached, this was put
	 * in to stop Cloudy from going into regimes where time dependence must be considered*/
	float StopDepleteFrac;

	/* limit column densities set with stop column command
	 * colend is total hydrogen column, others are ionized and neutral */
	float HColStop, 
	  colpls, 
	  colnut;

	/* column density in molecular hydrogen */
	float col_h2;

	/* stop at some mass */
	float xMass;

	/* column density in molecular + neutral hydrogen */
	float col_h2_nut;

	/* integrated n()H0) / Tspin */
	float col_H0_ov_Tspin;

	/* column density in carbon monoxide */
	float col_monoxco;

	/* stop at AV, point or extended */
	float AV_point , AV_extended;

	/* stopping electron density, set with stop eden command */
	float StopElecDensity;

	/* MXSTPL (above, equal to 10) is maximum numeer of stop line commands 
	 *
	 * parameters for stop line command
	 * LineStopWl - line wavelength for stop line command
	 * ipStopLin1 is pointer to first line of pair in stack of lines 
	 * ipStopLin2 is pointer to second line of pair in stack of lines, usually Hbeta
	 *  initially holds wavelength, converted to pointer in startr
	 */
	float stpint[MXSTPL];

	long int ipStopLin1[MXSTPL], 
	  ipStopLin2[MXSTPL], 
	  nstpl;

	float StopLineWl[MXSTPL],
		StopLineWl2[MXSTPL];

	float ErrorLineWl[MXSTPL],
		ErrorLineWl2[MXSTPL];

	/* line labels */
	char chStopLabel[MXSTPL][5] ,
		chStopLabel2[MXSTPL][5];

	/* flag saying to stop at 21cm line optical depth */
	int lgStop21cm;

	}	StopCalc;

