[FLASH-USERS] Flash 4.4 OPAL opacity
Amit Kashi
kashi at physics.umn.edu
Fri Dec 2 01:55:38 EST 2016
On Fri, December 2, 2016 4:55 am, Klaus Weide wrote:
> On Wed, 30 Nov 2016, Amit Kashi wrote:
>> I'm trying to use the new OPAL opacity option, but I'm having trouble
getting FLASH to load the tables properly.
> Amit,
> Please give more info. How did you notice that FLASH was not loading
tables properly? (Do not rely on the file opacity_printout_tables.txt;
the OPAL code currently does not yet write anything meaningful
> to it even when it is otherwise working.)
Hi Kalus. Thanks for helping me. The main indication was that the code
crashed during the first timestep with no specific error message. Together
with the empty opacity_printout_tables.txt I thought it is related to an
issue with loading the opacity tables. But I don't have a definite
indication that this is the reason. The last line in the log file is just
the step: n=1 line.
> The OPAL code should produce output like the following (on standard
output) upon recognizing and opening an OPAL table file (basically
echoing the first few lines of the file):
> ----------------------------------------------
> OPAL file lowT_fa05_gs98_z2m2_x00.data:
> low temperature opacities from Ferguson, Alexander, et al (2005) with
> gs98 metals
> form version X Z logRs logR_min
> logR_max logTs logT_min logT_max
> 1 37 0.000000 0.020000 46 -8.000000
> 1.000000 105 2.700000 4.500000
> OPAL file gs98_z2m2_x00.data:
> fixed metal distribution -- based on Grevesse & Sauval (1998) solar
> abundances
> form version X Z logRs logR_min
> logR_max logTs logT_min logT_max
> 1 37 0.000000 0.020000 37 -8.000000
> 1.000000 138 3.750000 8.700000
> ----------------------------------------------
> Do you get output like this?
Yes, I do. I get this:
----------
OPAL file lowT_fa05_gn93_z2m2_x35.data:
low temperature opacities from Ferguson, Alexander, et al (2005) with
gn93 metals
form version X Z logRs logR_min
logR_max logTs logT_min logT_max
1 37 0.350000 0.020000 46 -8.000000
1.000000 75 3.000000 4.100000
8 -1.329 -1.331 -1.335 -1.349 -1.369 -1.394 -1.423 -1.444 -1.461
-1.468 -1.465 -1.458 -1.441 -1.407 -1.387 -1.413 -1.453 -1.407
-1.098 -0.802 -0.682 -0.615 -0.515 -0.388 -0.280 -0.211 -0.164
-0.120 -0.084 -0.053 -0.025 -0.002 0.017 0.031 0.041
etc...
----------
And later this:
----------
OPAL file gn93_z2m2_x35.data:
fixed metal distribution -- based on Grevesse & Noels (1993) solar
abundances
form version X Z logRs logR_min
logR_max logTs logT_min logT_max
1 37 0.350000 0.020000 37 -8.000000
1.000000 138 3.750000 8.700000
op_initTabulated: hydro abundance #, needTable = 2 T T T T
op_initTabulated: hydro abundance #, needTable = 2 T T T T
op_initTabulated: hydro abundance #, needTable = 2 T T T T
op_initTabulated: hydro abundance #, needTable = 2 T T T T
4.685 -4.447 -4.173 -3.874 -3.582 -3.285 -3.019 -2.800 -2.620
-2.488 -2.405 -2.350 -2.315 -2.297 -2.284 -2.277 -2.272 -2.269
-2.267
----------
> This is from a first pass that examines all table files.
> Later on, when the table are opened again and the table data is actually
read into memory,
> the first lines are echoed again and should look like this:
> ----------------------------------------------
> R OPAL file lowT_fa05_gs98_z2m2_x00.data:
> Rlow temperature opacities from Ferguson, Alexander, et al (2005) with
> gs98 metals
> R form version X Z logRs logR_min
> logR_max logTs logT_min logT_max
> R 1 37 0.000000 0.020000 46 -8.000000
> 1.000000 105 2.700000 4.500000
> R
> R logT logR = logRho - 3*logT + 18
> R.
> R OPAL file gs98_z2m2_x00.data:
> Rfixed metal distribution -- based on Grevesse & Sauval (1998) solar
> abundances
> R form version X Z logRs logR_min
> logR_max logTs logT_min logT_max
> R 1 37 0.000000 0.020000 37 -8.000000
> 1.000000 138 3.750000 8.700000
> R
> R logT logR = logRho - 3*logT + 18
> R.
> ----------------------------------------------
> Do you see this?
Yes, I do. Here:
------------
R OPAL file gn93_z2m2_x35.data:
Rfixed metal distribution -- based on Grevesse & Noels (1993) solar
abundances
R form version X Z logRs logR_min
logR_max logTs logT_min logT_max
R 1 37 0.350000 0.020000 37 -8.000000
1.000000 138 3.750000 8.700000
R
R logT logR = logRho - 3*logT + 18
fmtStr:(8x, 37(e8.3))
LBOUND(tb%table,1): 1
UBOUND(tb%table,1): 138
fmtStr:(( 38F8.3))
3.750 -0.989 -1.051 -1.123 -1.205 -1.297 -1.393 -1.496 -1.600
-1.707 -1.813 -1.920 -2.024 -2.127 -2.223 -2.315 -2.394 -2.462
-2.506 -2.531
------------
>> I ran it in a debug mode and got this:
> More context would be helpful - what is the ouput before the
> following lines?
>> ----------------------------------------------
>> [op_getOpalTableOpacity] i,j,k,l= 1 1 46
>> 46
> The i,j = 1,1 indicates that the code is looking up an opacity for a
temperature that is below the lower boundary of the temperature range
covered by this file.
> The k,l = 46,46 indicates that the code is looking up an opacity for a
logR that is above the upper boundary of the logR range
> covered by this file.
> But that line of debug output is for a different (temperature,density)
point than the next ones (assuming you have not changed the order of the
print statements in op_getOpalTableOpacity.F90):
>> op_getOpalTableOpacity: mfH,temprange are 2 1 ,ok
op_getOpalTableOpacity: thisTypeTable%table ok
>> op_getOpalTableOpacity: thisTypeTable%table%table ok
>> speciesDensity{,RO}= 2.5434026735557760E-014 -13.594584876529337
>> -8.0000000000000000 1.0000000000000000
>> nstepsDensity= 46 F T F
>> SHAPE(thisTypeTable%table%table)= 75 46
>> -----------------------------------------------
> What comes after this?
> The next line of output should have 'i,j,k,l=' again.
> Maybe the lookup is somehow directed to the wrong file, for a given
(temperatiure,density) combination, by the runtime parameters in effect.
Or maybe your OPAL table files are not in the right format.
> I would like to help, but need more information.
> Klaus
Yes, the block:
----------
[op_getOpalTableOpacity] i,j,k,l= 1 1 46
46
op_getOpalTableOpacity: mfH,temprange are 2 1 ,ok
op_getOpalTableOpacity: thisTypeTable%table ok
op_getOpalTableOpacity: thisTypeTable%table%table ok
speciesDensity{,RO}= 2.5434026735557760E-014 -13.594584876529337
-8.0000000000000000 1.0000000000000000
nstepsDensity= 46 F T F
SHAPE(thisTypeTable%table%table)= 75 46
-----------
repeats many times so the following line is indeed again 'i,j,k,l='.
The numbers in the speciesDensity{,RO} change from block to block
according to the cell density.
Before the first appearance of this block the output is unrelated to the
opacity unit. Just normal output that I always get.
I am quite sure that the OPAL files I use are in the right format, they
even have the same names as in the README file.
Maybe the runtime parameters are not correctly set? I use only one species
(h1).
Here are the relevant lines:
op_opalTableAbundMax_1 = 0.0
op_opalTableHighT_1 = "gn93_z2m2_x35.data"
op_opalTableLowT_1 = "lowT_fa05_gn93_z2m2_x35.data"
op_opalTableAbundMax_2 = 1.0
op_opalTableHighT_2 = "gn93_z2m2_x50.data"
op_opalTableLowT_2 = "lowT_fa05_gn93_z2m2_x50.data"
I also tried
op_opalTableAbundMax_1 = 0.35
op_opalTableAbundMax_2 = 0.5
And different values of the parameter op_opalnumhydrogenabundances
that accepts values from 0-10, but I don't understand what it exactly does.
Many thanks for your help,
Amit
More information about the flash-users
mailing list