Skip to content

HotFixes_13

William Henney edited this page Oct 17, 2019 · 2 revisions

Hot Fixes for C13

C13.03

When interpolating stellar grid models that have zero flux at some frequencies, you may experience a spurious crash due to a FP exception. This is due to a compiler bug in g++ versions from version 4.7.0 onwards described here. Versions 13.03 and older of Cloudy are affected by this problem. The workaround is to replace this loop in stars.cpp:

	if( lgTakeLog )
	{
		/* convert to logs since we will interpolate in log flux */
		for( i=0; i < rfield.nupper; ++i )
			flux[i] = (realnum)log10( MAX2( 1e-37, (double)flux[i] ) );
	}

with the following new code:

	if( lgTakeLog )
	{
		/* convert to logs since we will interpolate in log flux */
		for( i=0; i < rfield.nupper; ++i )
		{
		        volatile double help = flux[i];
			if( help > 0. )
				help = log10(help);
			else
				help = -99999.;
			flux[i] = realnum(help);
		}
	}

The loop in question starts on line 3834 in c13.03, or on line 3817 in c13.00 through c13.02.

2016 May 25


Versions C13.00 through C13.03 no longer compile with very recent versions of the libstdc++ headers. Linux distros that are known to have these headers are openSUSE Tumbleweed and Ubuntu 16.04, but the list will grow as time progresses. The compiler will produce error messages similar to this:

/usr/include/c++/5/bits/valarray_before.h:350:12: error: invalid use of incomplete type ‘class molezone’

To fix this issue, you need to download this patch, then cd into the source directory and type:

patch < /path/to/changeset_r11053.diff

(change "/path/to" with the actual location of the file) and then compile again. This problem will be fixed in C13.04, so this patch should not be applied to C13.04 and later versions.

2016 May 23


With C13.04 we will change the definition of the xi ionization parameter. Through versions C13.03 we defined xi as the total luminosity in ionizing photons, the original Tarter definition.
The definition of xi basing on 1-1000 Ryd luminosity seems to come from Krolik, McKee and Tarter 1981, Equations (2.3) ,(2.2a) and the definition of F_{ion} (not xi) there. The X-ray community uses the Kallman & Bautista (2001) definition, which integrates the SED between 1 and 1000 Rydbergs.
The 1 - 1000 Ryd definition will be part of C13.04 and later versions of the code. This only makes a difference for very hard SEDs.

To change to the X-ray community definition of xi edit parse_ionpar.cpp and add two lines following line 47 - afterwards it will read as

strcpy( rfield.chSpNorm[p.m_nqh], "IONX" );
rfield.range[(p.m_nqh)][0] = 1.;
rfield.range[(p.m_nqh)][1] = 1000.;

Then recompile. We thank Ildar Khabibullin for drawing our attention to this.

2015 Aug 1


The large block of emission-line predictions that is presented at the end of the calculation is a heterogeneous mix of many different quantities. Intensities of lines with the full radiative transfer treatment are there, but there are also many other quantities that indicate the importance of various physical processes such as photoelectric or charge exchange heating, recombination or inner shell contributions to line formation, or indications of pumped or thermalized components of transferred lines. These are intrinsic properties of the gas so do make sense in the intrinsic printout.

The code predicts both intrinsic and emergent intensities, as described in Hazy 2 Section 2.1. As coded now, the emergent lines, the second block of lines, report all of the entries in the intrinsic list. Only the lines with the full radiative transfer treatment, referred to as the transferred lines in Hazy 2 Section 9.3, are actually passed through the emergent infrastructure. A list of only these line is generated by the test case func_lines in tsuite / auto - see the file func_lines.lis. The other quantities, the quantities that are not the transferred lines, are the same in the intrinsic and emergent line lists. This is confusing since it is not clear from the printout which quantities represent the transferred lines.

This will be addressed more completely in the next major release, but for C13.04 we will only report the transferred lines in the emergent line list. The hotfix to enable this is simple. Edit the file source/prt_final.cpp and, after line 870 add three lines. After the change the code will read as follows, starting at line 869

			if( scaled[i] >= prt.TooFaint && lgPrt[i] )
			{
				/* do not report info entries for emergent intensity */
				if( ipEmType==1 && (LineSv[i].chSumTyp=='i' || LineSv[i].chSumTyp=='h') )
					continue;
 

We thank Jim Smith for pointing this out on the Yahoo group.

2015 Aug 1


There is a problem with the _stop neutral column density command when a significant amount of hydrogen becomes molecular._
The simplest fix is to edit iter_end_chk.cpp and delete lines 341 - 349 then recompile the code. The deleted lines are the following:

	/* >>chng 99 jul 7, when no h2 molecules, include h2 as neutral atomic hydrogen,
	 * hmi.lgNoH2Mole is set false in zero, true with command no hydrogen molecules */
	else if( 
		( (colden.colden[ipCOL_H0]+2.*(colden.colden[ipCOL_H2g]+colden.colden[ipCOL_H2s])) >= StopCalc.colnut/EPS)  )
	{
		lgDone = true;
		strncpy( StopCalc.chReasonStop, "H0-H0+H2 column dens reached.", sizeof(StopCalc.chReasonStop) );
	}

2015 Jun 26


Return to HotFixes main page

Return to the StepByStep instructions

Return to main [WikiStart wiki] page


Clone this wiki locally