times-software / feff10

Other
24 stars 13 forks source link

xnatph(stoichiometry) ratio maximum of 999999 #18

Open CharlesCardot opened 1 year ago

CharlesCardot commented 1 year ago

Given how FEFF writes the pot.inp file, stoichiometries of 10^6 or larger end up spilling over into the lmaxsc column.

feff.inp image

pot.inp image

A quick fix for this is to scale down all the stoichiometry values by dividing them all by 10. 4185 -> 418.5 14570 -> 1457.0 135 -> 13.5 4810 -> 481.0 And leave the Nitrogen stoichiometry alone. This does change the overall ratio, but it's up to the user if a ratio of 10^5 vs a ratio of 10^6 really makes a difference.

For a more permanent, but still a Band-Aid fix, I also tried changing line 592 in /src/COMMON/m_inpmodules.f90 such that the string formatting had more digits to work with when pot.inp gets written. image to image

jjkas commented 1 year ago

This is correct, with the following caveat. FEFF has a minimum stoichiometry, which is 0.01. Thus the exact statement would be:

If the minimum stoichiometry in the feff.inp file is >= 0.01, then the ratio of the maximum stoichiometry to the minimum stoichiometry must be less than 10^7 (999999 or less).

If the minimum stoichiometry in the feff.inp file is < 0.01, then the ratio of the maximum stoichiometry to 0.01 must be less than 10^7 (999999 or less).