ReFRACtor / ABSCO

Software that can generate a set of ABSoprtion COefficient tables that span the thermal IR to UV spectral range
Other
9 stars 4 forks source link

ABSCO Produces Nearly Identical Tables when CO and CH4 both specified in the NIR #19

Open mcduffie opened 1 year ago

mcduffie commented 1 year ago

For the following ABSCO config portion (everything else is default values) the CH4 and CO tables produced end up being essentially the same value:

[channels]
wn1 = 4166.0000
wn2 = 4358.0000
lblres = 7.8125000000e-05
outres = 1.0000000000e-02
units = cm-1

[molecules]
molnames = ch4 co h2o
-> nccmp -f -d -N -T 1 nc_ABSCO/CO_04166-04358_v0.0_init.nc nc_ABSCO/CH4_04166-04358_v0.0_init.nc  |& head
DIFFER : VARIABLE : Cross_Section : POSITION : [232,3,64] : VALUES : 1.97039e-25 <> 1.99851e-25 : PERCENT : 1.40738
DIFFER : VARIABLE : Cross_Section : POSITION : [353,6,76] : VALUES : 3.75934e-25 <> 3.71959e-25 : PERCENT : 1.05724
DIFFER : VARIABLE : Cross_Section : POSITION : [384,2,63] : VALUES : 1.45506e-24 <> 1.47706e-24 : PERCENT : 1.48954
DIFFER : VARIABLE : Cross_Section : POSITION : [390,6,77] : VALUES : 5.15435e-25 <> 4.96332e-25 : PERCENT : 3.70614
DIFFER : VARIABLE : Cross_Section : POSITION : [606,8,73] : VALUES : 1.15443e-24 <> 1.12869e-24 : PERCENT : 2.23009
DIFFER : VARIABLE : Cross_Section : POSITION : [638,3,53] : VALUES : 3.3876e-23 <> 3.34006e-23 : PERCENT : 1.40349
DIFFER : VARIABLE : Cross_Section : POSITION : [1265,2,75] : VALUES : 6.90031e-25 <> 7.16258e-25 : PERCENT : 3.66162
DIFFER : VARIABLE : Cross_Section : POSITION : [1334,0,71] : VALUES : 1.18167e-24 <> 1.21219e-24 : PERCENT : 2.51803
DIFFER : VARIABLE : Cross_Section : POSITION : [1383,0,60] : VALUES : 9.94463e-25 <> 9.82776e-25 : PERCENT : 1.17519
DIFFER : VARIABLE : Cross_Section : POSITION : [1383,5,60] : VALUES : 2.07573e-24 <> 2.03953e-24 : PERCENT : 1.7439

Both tables look "like" a CO table when plotted.

If we run CH4 and CO separately and delete the LBLRTM directories (LBL_Runs, LNFL_Runs, TAPE3_dir) in between runs we get tables that look as expected. Running separately means changing the config to list only one of the two species at a time and deleting the intermediate directories. Additionally, the CO table produced separately does not match the CO table produced when generated alongside CH4.

pernak18 commented 1 year ago

@mcduffie thanks for the detailed report. i can look into this, but probably not until the middle of next week

pernak18 commented 1 year ago

@mcduffie i think https://github.com/ReFRACtor/ABSCO/commit/eb8129ff9ccf404a769f7bff95bbf4f060a728c2 addresses this issue. i serendipitously stumbled across this very small bug while adding HDO to the package.

now, the differences are more numerous and larger:

% nccmp -f -d -N -T 1 nc_ABSCO/CO_04166-04358_v0.0_init.nc nc_ABSCO/CH4_04166-04358_v0.0_init.nc |& head DIFFER : VARIABLE : Cross_Section : POSITION : [0,0,46] : VALUES : 1.07802e-24 <> 7.12801e-23 : PERCENT : 98.4876 DIFFER : VARIABLE : Cross_Section : POSITION : [0,0,47] : VALUES : 1.01669e-24 <> 6.75467e-23 : PERCENT : 98.4948 DIFFER : VARIABLE : Cross_Section : POSITION : [0,0,48] : VALUES : 9.5865e-25 <> 6.40716e-23 : PERCENT : 98.5038 DIFFER : VARIABLE : Cross_Section : POSITION : [0,0,49] : VALUES : 9.02569e-25 <> 6.06235e-23 : PERCENT : 98.5112 DIFFER : VARIABLE : Cross_Section : POSITION : [0,0,50] : VALUES : 8.47691e-25 <> 5.74254e-23 : PERCENT : 98.5238 DIFFER : VARIABLE : Cross_Section : POSITION : [0,0,51] : VALUES : 7.95501e-25 <> 5.42501e-23 : PERCENT : 98.5336 DIFFER : VARIABLE : Cross_Section : POSITION : [0,0,52] : VALUES : 7.45217e-25 <> 5.12778e-23 : PERCENT : 98.5467 DIFFER : VARIABLE : Cross_Section : POSITION : [0,0,53] : VALUES : 6.97305e-25 <> 4.84375e-23 : PERCENT : 98.5604 DIFFER : VARIABLE : Cross_Section : POSITION : [0,0,54] : VALUES : 6.50811e-25 <> 4.56371e-23 : PERCENT : 98.5739 DIFFER : VARIABLE : Cross_Section : POSITION : [0,0,55] : VALUES : 6.06766e-25 <> 4.30824e-23 : PERCENT : 98.5916

mcduffie commented 1 year ago

Shouldn't this line

self.iMol = 0 if mol == 'HDO' else self.HITRAN.index(inMol)

be:

self.iMol = 0 if inMol == 'HDO' else self.HITRAN.index(inMol)

Since mol is a loop variable and not the input to the method?

pernak18 commented 1 year ago

@mcduffie yes, thank you for catching that. the bug fix has been pushed with https://github.com/ReFRACtor/ABSCO/commit/b00453c399e16bae0841f17c02331fd6d0b3c78e